/* =========================================================
   ChatMeet — pages applicatives (dashboard, admin, rapport,
   connexion) et panneau de notes dans la salle.
   ========================================================= */

/* ------------------------------- Structure ------------------------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(18px);
}

.app-header .brand {
  flex: none;
}

.app-nav {
  display: flex;
  gap: 4px;
}

.app-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-nav a:hover {
  color: #e8edf7;
  background: rgba(148, 163, 184, 0.08);
}

.app-nav a.active {
  color: #fff;
  background: rgba(124, 92, 255, 0.16);
}

.app-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.app-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #dbe4f3;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
}

.app-page {
  min-height: 100dvh;
  overflow-y: auto;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(124, 92, 255, 0.13), transparent 60%),
    var(--bg);
}

.app-main {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 34px 28px 70px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.page-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 620px;
}

.page-actions {
  display: flex;
  gap: 9px;
  flex: none;
  flex-wrap: wrap;
}

/* -------------------------------- Boutons -------------------------------- */

.btn-secondary {
  color: #dbe4f3;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.18);
}

.btn-danger {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.26);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-sm {
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
  gap: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Dans les pages applicatives, les boutons ne prennent pas toute la largeur
   (contrairement au bouton principal de la carte de connexion). */
.app-page .btn-primary {
  width: auto;
  margin-top: 0;
}

.btn-link {
  padding: 0;
  color: #a5b4fc;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

/* --------------------------------- Cartes -------------------------------- */

.card {
  background: linear-gradient(180deg, rgba(19, 28, 48, 0.82), rgba(11, 17, 32, 0.9));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
}

.card-pad {
  padding: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.card-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat-value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

/* -------------------------------- Badges --------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.scheduled {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
}

.badge.live {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.badge.ended {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
}

.badge.admin {
  color: #ddd6fe;
  background: rgba(124, 92, 255, 0.16);
  border-color: rgba(124, 92, 255, 0.24);
}

.badge.plain::before {
  display: none;
}

.group-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--accent);
}

/* ------------------------------- Réunions -------------------------------- */

.filter-bar {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
  width: fit-content;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.filter-btn.active {
  color: #fff;
  background: rgba(124, 92, 255, 0.22);
}

.meeting-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meeting-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.52);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.meeting-card:hover {
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(19, 29, 50, 0.72);
  transform: translateY(-1px);
}

.meeting-date {
  width: 58px;
  flex: none;
  text-align: center;
  padding: 7px 4px;
  border-radius: 11px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.18);
}

.meeting-date strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.meeting-date span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 2px;
}

.meeting-main {
  min-width: 0;
  flex: 1;
}

.meeting-title {
  font-size: 14.5px;
  font-weight: 650;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meeting-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.meeting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.search-row {
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 0 14px;
}

.my-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.45);
}

.my-action-main {
  flex: 1;
  min-width: 0;
}

.my-action-main strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-action-main span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.my-action .btn {
  flex: none;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.45);
  font-size: 12.5px;
}

.attachment-item a {
  color: #c7d2fe;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item a:hover {
  text-decoration: underline;
}

.attachment-item .muted {
  font-size: 11px;
  flex: none;
}

.attachment-item .ghost-btn {
  flex: none;
  margin-left: auto;
}

/* -------------------------------- Tableaux ------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.data-table th {
  text-align: left;
  padding: 11px 13px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.04);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr:hover td {
  background: rgba(148, 163, 184, 0.035);
}

.cell-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* --------------------------------- Formulaires --------------------------- */

.form-panel {
  margin-bottom: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
  color: #b6c2d9;
}

textarea.input {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 6px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.form-error {
  margin-top: 12px;
  font-size: 12.5px;
  color: #fca5a5;
}

.alert {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  color: #cbd5e1;
}

.alert.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.24);
}

.alert.success {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.24);
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
}

.empty-state strong {
  display: block;
  font-size: 14px;
  color: #dbe4f3;
  margin-bottom: 4px;
}

.empty-state p {
  margin: 0;
  font-size: 12.5px;
}

/* --------------------------------- Connexion ----------------------------- */

.auth-body {
  min-height: 100dvh;
  overflow-y: auto;
  background:
    radial-gradient(800px 500px at 8% 0%, rgba(124, 92, 255, 0.2), transparent 60%),
    radial-gradient(700px 500px at 95% 20%, rgba(34, 211, 238, 0.12), transparent 55%),
    var(--bg);
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-aside {
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}

.auth-aside h1 {
  margin: 40px 0 0;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.auth-aside p {
  max-width: 460px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 18px;
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 13.5px;
  color: #cbd5e1;
}

.auth-points li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.auth-points li::before {
  content: "✓";
  color: #22d3ee;
  font-weight: 700;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 36px 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 30px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.94), rgba(12, 19, 35, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.auth-card .card-sub {
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.auth-tab.active {
  color: #fff;
  background: rgba(124, 92, 255, 0.22);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-form .btn-primary {
  margin-top: 4px;
}

.auth-foot {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted-2);
  text-align: center;
}

.auth-foot a {
  color: #a5b4fc;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

.link-button {
  padding: 0;
  color: var(--muted-2);
  font: inherit;
  font-size: 12.5px;
  text-decoration: none;
}

.link-button:hover {
  color: #e8edf7;
  text-decoration: underline;
}

/* --------------------------------- Admin --------------------------------- */

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.admin-tab.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.group-card {
  padding: 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
  position: relative;
}

.group-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.group-card h3 {
  margin: 0;
  font-size: 14.5px;
}

.group-card p {
  margin: 0;
  min-height: 34px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.group-stats {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.group-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

/* ---------------------------- Configuration ------------------------------ */

.config-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
}

.config-toolbar h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.config-toolbar .card-sub {
  margin: 0;
  max-width: 680px;
}

.config-toolbar-actions {
  display: flex;
  gap: 7px;
  flex: none;
  flex-wrap: wrap;
}

.config-toolbar-actions label.btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.config-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.config-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.5);
}

.config-nav-btn {
  text-align: left;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.config-nav-btn:hover {
  color: #e8edf7;
  background: rgba(148, 163, 184, 0.07);
}

.config-nav-btn.active {
  color: #fff;
  background: rgba(124, 92, 255, 0.2);
}

.config-panels {
  min-width: 0;
}

.config-panel {
  display: none;
}

.config-panel.active {
  display: block;
}

.config-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.config-panel .card-sub {
  margin: 0 0 18px;
}

.config-help {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.config-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.config-test-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.config-test-row .input {
  max-width: 320px;
}

.config-result {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  white-space: pre-wrap;
}

.config-result:empty {
  display: none;
}

.config-result.ok {
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.08);
}

.config-result.error {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 800px) {
  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .config-nav-btn {
    white-space: nowrap;
  }
}

/* -------------------------------- Chat ----------------------------------- */

.chat-shell {
  height: calc(100dvh - 64px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 250px;
  overflow: hidden;
  background: var(--bg);
}

.chat-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(10, 16, 30, 0.6);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.chat-sidebar-head h2 {
  margin: 0;
  font-size: 16px;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  text-align: left;
  border: 1px solid transparent;
}

.conversation-item:hover {
  background: rgba(148, 163, 184, 0.07);
}

.conversation-item.active {
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.22);
}

.conversation-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #4f8cff 55%, #22d3ee);
  text-transform: uppercase;
}

.conversation-avatar.ai,
.avatar-sm.avatar-ai {
  color: #1f1300;
  background: linear-gradient(135deg, #fbbf24, #f59e0b 55%, #f97316);
}

.people-row.ai {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.14);
}

.people-row.clickable {
  cursor: pointer;
}

.people-row.ai:hover {
  background: rgba(245, 158, 11, 0.12);
}

.conversation-info {
  min-width: 0;
  flex: 1;
}

.conversation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.conversation-top strong {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 10px;
  color: var(--muted-2);
  flex: none;
}

.conversation-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.conversation-preview {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.chat-head-title {
  min-width: 0;
}

.chat-head-title h1 {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.chat-day {
  align-self: center;
  margin: 8px 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted-2);
  font-size: 10.5px;
  text-transform: capitalize;
}

.chat-system {
  align-self: center;
  max-width: 85%;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
  padding: 2px 8px;
}

.chat-msg {
  max-width: min(640px, 82%);
  align-self: flex-start;
  animation: rise 0.16s ease both;
}

.chat-msg.self {
  align-self: flex-end;
}

.chat-msg-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 3px;
  padding: 0 2px;
}

.chat-msg.self .chat-msg-head {
  justify-content: flex-end;
}

.chat-msg-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #c4b5fd;
}

.chat-msg.self .chat-msg-name {
  color: #a5f3fc;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--muted-2);
}

.chat-msg-body {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-msg.self .chat-msg-body {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.32), rgba(79, 140, 255, 0.24));
  border-color: rgba(124, 92, 255, 0.3);
}

.chat-msg-body a {
  color: #a5f3fc;
}

.chat-msg-body p {
  margin: 0 0 8px;
}

.chat-msg-body .btn {
  display: inline-flex;
}

.chat-composer {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.chat-composer .input {
  height: 44px;
}

.chat-people {
  border-left: 1px solid var(--line);
  background: rgba(10, 16, 30, 0.45);
  padding: 16px 14px;
  overflow-y: auto;
  min-height: 0;
}

.people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.people-head h2,
.people-title {
  margin: 0 0 10px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.people-title {
  margin-top: 4px;
}

.people-online,
.people-members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.people-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 9px;
  position: relative;
}

.people-row:hover {
  background: rgba(148, 163, 184, 0.05);
}

.people-row .avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.people-row-info {
  min-width: 0;
  flex: 1;
}

.people-row-info strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-row-info span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
}

.presence-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #475569;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 1);
}

.presence-dot.online {
  background: #34d399;
}

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(520px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #0b1120;
  box-shadow: var(--shadow);
}

.modal-people {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}

.modal-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}

.modal-person:hover {
  background: rgba(148, 163, 184, 0.06);
}

.modal-person input {
  accent-color: var(--accent);
}

/* Emojis et pièces jointes dans les chats */
.emoji-popover {
  position: fixed;
  z-index: 120;
  width: 310px;
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0b1120;
  box-shadow: var(--shadow);
}

.emoji-item {
  height: 32px;
  border-radius: 7px;
  font-size: 19px;
  line-height: 1;
}

.emoji-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.chat-composer {
  align-items: center;
}

.composer-tool {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
}

.composer-tool:hover {
  color: #e8edf7;
  background: rgba(148, 163, 184, 0.1);
}

.composer-tool svg {
  width: 18px;
  height: 18px;
}

.chat-file-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.chat-file-msg img {
  max-width: 240px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
}

.chat-file-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.14);
  color: #a5f3fc;
  font-size: 11px;
  font-weight: 700;
}

.chat-file-link {
  color: #a5f3fc;
  font-size: 12.5px;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.chat-file-meta {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
  margin-top: 2px;
}

.ai-toggle[data-on='true'] {
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.chat-msg.ai .chat-msg-name {
  color: #fcd34d;
}

.chat-msg.ai .chat-msg-body {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.06);
}

@media (max-width: 1000px) {
  .chat-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .chat-people {
    display: none;
  }
}

@media (max-width: 720px) {
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    display: none;
  }

  .chat-head {
    padding: 10px 12px;
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-composer {
    padding: 8px 12px 12px;
  }

  .chat-head-actions .btn span {
    display: none;
  }
}

.color-input {
  width: 52px;
  height: 42px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid var(--line-strong);
}

/* -------------------------------- Rapport -------------------------------- */

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.report-section {
  margin-bottom: 18px;
}

.report-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.report-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.7;
  color: #dbe4f3;
  word-wrap: break-word;
}

.summary-text {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
  word-wrap: break-word;
}

.summary-text h3 {
  margin: 20px 0 8px;
  font-size: 15px;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.summary-text h3:first-child {
  margin-top: 0;
}

.summary-text h4 {
  margin: 16px 0 6px;
  font-size: 13.5px;
  color: #e2e8f0;
}

.summary-text p {
  margin: 0 0 10px;
}

.summary-text ul,
.summary-text ol {
  margin: 4px 0 12px;
  padding-left: 22px;
}

.summary-text li {
  margin: 3px 0;
}

.summary-text blockquote {
  margin: 10px 0;
  padding: 4px 13px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.summary-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 12.5px;
}

.summary-text th,
.summary-text td {
  border: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}

.summary-text th {
  background: rgba(148, 163, 184, 0.06);
  color: #dbe4f3;
}

.admin-tabs::-webkit-scrollbar {
  height: 4px;
}

.admin-tabs::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
}

.report-meta {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  font-size: 12.5px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span:first-child {
  color: var(--muted-2);
}

.kv span:last-child {
  color: #dbe4f3;
  text-align: right;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-actions .btn {
  width: 100%;
}

.email-panel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.email-panel textarea.input {
  min-height: 70px;
}

/* ------------------------- Notes dans la salle --------------------------- */

.notes-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: flex-end;
}

.notes-drawer {
  width: min(780px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b1120;
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(2, 6, 23, 0.6);
  animation: slideIn 0.22s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(30px);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notes-head {
  flex: none;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.notes-head h2 {
  margin: 0;
  font-size: 16px;
}

.notes-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}

.notes-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.notes-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #b6c2d9;
}

.notes-field textarea {
  min-height: 190px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.65;
}

.actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.actions-head strong {
  font-size: 12px;
  color: #b6c2d9;
}

.action-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.action-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.action-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.04);
}

.action-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.action-table input,
.action-table select {
  width: 100%;
  height: 32px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #dbe4f3;
  font-size: 12px;
}

.action-table input:hover,
.action-table select:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.05);
}

.action-table input:focus,
.action-table select:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(7, 11, 20, 0.7);
}

.action-table select {
  appearance: none;
}

.notes-foot {
  flex: none;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.save-state {
  margin-right: auto;
  font-size: 11.5px;
  color: var(--muted-2);
}

.save-state.ok {
  color: #86efac;
}

.save-state.err {
  color: #fca5a5;
}

/* ----------------------------- Salle d'attente --------------------------- */

.waiting-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(12px);
}

.waiting-card {
  width: min(460px, 100%);
  padding: 34px 30px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.96), rgba(12, 19, 35, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.waiting-card .spinner {
  margin: 0 auto 18px;
}

.waiting-card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.waiting-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.waiting-card .btn {
  width: auto;
  margin: 0 auto;
}

.waiting-drawer {
  width: min(470px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b1120;
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(2, 6, 23, 0.6);
  animation: slideIn 0.22s ease;
}

.waiting-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.waiting-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.waiting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.55);
}

.waiting-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #4f8cff 55%, #22d3ee);
}

.waiting-info {
  min-width: 0;
  flex: 1;
}

.waiting-info strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waiting-info span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted-2);
}

.waiting-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.waiting-actions .btn {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.waiting-body .empty-state {
  margin-top: 8px;
}

/* ------------------------------- Divers ---------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  z-index: 80;
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 550;
  color: #e8edf7;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(69, 10, 10, 0.98);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: "Cascadia Code", "Consolas", monospace;
}

.mt-0 {
  margin-top: 0;
}

.mt-16 {
  margin-top: 16px;
}

.flex-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.divider-line {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

/* ------------------------------- Responsive ------------------------------ */

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-meta {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-header {
    padding: 0 16px;
    gap: 10px;
  }

  .app-nav a {
    padding: 7px 9px;
    font-size: 12.5px;
  }

  .app-user-name,
  .app-user .badge {
    display: none;
  }

  .app-main {
    padding: 24px 16px 56px;
  }

  .page-head {
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .meeting-card {
    flex-wrap: wrap;
    gap: 12px;
  }

  .meeting-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .notes-drawer {
    width: 100%;
  }

  .notes-head,
  .notes-body,
  .notes-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 460px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .meeting-date {
    width: 50px;
  }

  .app-header .brand-name {
    display: none;
  }

  .auth-card {
    padding: 22px;
  }
}
