:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3250;
  --accent: #4f6ef7;
  --accent-hover: #3d5ae8;
  --text: #e8eaf6;
  --text-muted: #7b82aa;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f97316;
  /* Alias sémantiques (utilisés en inline depuis le JS). Pointent sur les
     couleurs de statut, communes aux deux thèmes. */
  --success: var(--green);
  --warning: var(--yellow);
  --danger: var(--red);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #e4e7f2;
  --border: #c8ccdf;
  --text: #1a1d2e;
  --text-muted: #5a6080;
}
[data-theme="light"] .badge-green  { background: #dcfce7; color: #15803d; }
[data-theme="light"] .badge-red    { background: #fee2e2; color: #b91c1c; }
[data-theme="light"] .badge-yellow { background: #fef3c7; color: #b45309; }
[data-theme="light"] .badge-grey   { background: #f1f5f9; color: #475569; }
[data-theme="light"] .badge-blue   { background: #dbeafe; color: #1d4ed8; }
[data-theme="light"] .badge-orange { background: #ffedd5; color: #c2410c; }
[data-theme="light"] .dot-grey     { background: #9ca3af; }
[data-theme="light"] tbody tr.cdr-flagged { background: color-mix(in srgb, var(--yellow) 12%, transparent); }
[data-theme="light"] tbody tr.cdr-flagged:hover { background: color-mix(in srgb, var(--yellow) 20%, var(--surface2)); }
[data-theme="light"] tbody tr.cdr-emergency { background: color-mix(in srgb, var(--red) 13%, transparent); }
[data-theme="light"] tbody tr.cdr-emergency:hover { background: color-mix(in srgb, var(--red) 20%, var(--surface2)); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.lucide { display: inline-block; vertical-align: middle; flex-shrink: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: min(360px, 100%);
}
.login-box h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.login-box p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .85rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-group input {
  width: 100%; padding: .6rem .8rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: .95rem;
  transition: border-color .15s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.2rem; border-radius: 6px; border: none;
  font-size: .9rem; cursor: pointer; transition: background .15s;
  /* Sans cette ligne, un <button> sans couleur explicite (boutons secondaires
     Actualiser/Réinitialiser) hérite du « buttontext » sombre du navigateur,
     illisible sur fond sombre en mode nuit. Les variantes (.btn-primary…)
     forcent leur propre couleur et l'emportent. */
  color: var(--text);
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-hover); }
.error-msg { color: var(--red); font-size: .85rem; margin-top: .75rem; }
.login-status {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.login-status-item {
  display: flex;
  align-items: center;
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── LAYOUT ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; height: 52px; position: sticky; top: 0; z-index: 100;
}
header .logo { font-weight: 700; font-size: 1.05rem; color: var(--accent); letter-spacing: .02em; display: flex; align-items: center; gap: .35rem; }
.logo-stack { display: flex; flex-direction: column; line-height: 1.15; }
.logo-subtitle { font-size: .65rem; font-weight: 500; color: var(--text-muted); letter-spacing: .03em; }
nav { display: flex; gap: .25rem; flex: 1; }
nav button {
  background: none; border: none; color: var(--text-muted);
  padding: .4rem .9rem; border-radius: 6px; cursor: pointer;
  font-size: .875rem; transition: all .15s;
}
nav button:hover { background: var(--surface2); color: var(--text); }
nav button.active { background: var(--surface2); color: var(--accent); font-weight: 600; }
.nav-calls-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  margin-left: 6px; vertical-align: middle; line-height: 1;
}
.user-info { font-size: .8rem; color: var(--text-muted); }
.btn-logout {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .35rem .8rem; border-radius: 6px; cursor: pointer; font-size: .8rem;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }
.dot-grey { background: #555; }
.dot-blue { background: var(--blue); }

main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; width: 100%; }
.section { display: none; }
.section.active { display: block; }

/* ── CARDS GRID ── */
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .9rem 1rem;
}
.card-title { font-weight: 600; font-size: .9rem; }
.card-sub { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.card-badge {
  display: inline-flex; align-items: center; margin-top: .5rem;
  font-size: .75rem; padding: .2rem .6rem; border-radius: 999px;
}
.badge-green { background: #16361e; color: var(--green); }
.badge-red { background: #3b1212; color: var(--red); }
.badge-yellow { background: #3b2c0a; color: var(--yellow); }
.badge-grey { background: #1e1e2e; color: #666; }
.badge-blue { background: #0f1f3b; color: var(--blue); }
.badge-orange { background: #3b1e0a; color: var(--orange); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface); padding: .65rem 1rem;
  text-align: left; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody tr.cdr-new { animation: cdr-flash 2.5s ease-out forwards; }
@keyframes cdr-flash {
  0%   { background: color-mix(in srgb, var(--accent) 25%, transparent); }
  100% { background: transparent; }
}
tbody td { padding: .65rem 1rem; font-size: .875rem; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 2rem; }

/* ── Appels vers numéros d'urgence ── */
tbody tr.cdr-emergency {
  background: color-mix(in srgb, var(--red) 9%, transparent);
  box-shadow: inset 3px 0 0 var(--red);
}
tbody tr.cdr-emergency:hover { background: color-mix(in srgb, var(--red) 15%, var(--surface2)); }
.dst-emergency {
  display: inline-flex; align-items: center; gap: .25rem;
  font-weight: 700; color: var(--red);
}
.emergency-label {
  display: inline-block; margin-top: .15rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--red);
}

/* ── FILTERS ── */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; align-items: flex-end; }
.filters input, .filters select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: .5rem .7rem; border-radius: 6px; font-size: .85rem;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); }
.filters .btn { font-size: .85rem; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: 1rem; }
.pagination button {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: .35rem .8rem; border-radius: 6px; cursor: pointer; font-size: .8rem;
}
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination span { font-size: .8rem; color: var(--text-muted); }

/* ── AUDIO PLAYER ── */
.audio-cell { display: flex; gap: .4rem; align-items: center; min-width: 320px; }
.audio-cell audio { height: 34px; width: 100%; min-width: 280px; accent-color: var(--accent); }
.btn-dl {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .2rem .5rem; border-radius: 4px; cursor: pointer; font-size: .75rem;
}
.btn-dl:hover { border-color: var(--accent); color: var(--accent); }

/* ── LIVE CALLS ── */
.duration-cell { font-variant-numeric: tabular-nums; }

/* ── HISTORIQUE DES STATUTS ── */
#btn-events { position: relative; }
#btn-events.has-unread::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--surface);
}
.events-list { max-height: 72vh; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; margin-top: 1rem; }
.ev-export-input {
  font-size: .8rem; padding: .3rem .45rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.ev-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem; border-bottom: 1px solid var(--border); font-size: .85rem;
}
.ev-row:last-child { border-bottom: none; }
.ev-ico { display: inline-flex; flex-shrink: 0; }
.ev-text { flex: 1; min-width: 0; }
.ev-time { color: var(--text-muted); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-green .ev-ico  { color: var(--green); }
.ev-red .ev-ico    { color: var(--red); }
.ev-orange .ev-ico { color: var(--orange); }
.ev-blue .ev-ico   { color: var(--accent); }
.ev-grey .ev-ico   { color: var(--text-muted); }
.ev-empty { color: var(--text-muted); text-align: center; padding: 2rem 0; font-size: .85rem; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.75rem; width: 420px; max-width: 95vw;
}
.btn-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 4px;
}
.btn-close:hover { background: var(--surface2); color: var(--text); }

/* Bouton icône header */
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .3rem .6rem; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* Bouton supprimer dans tableau */
.btn-delete {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .2rem .5rem; border-radius: 4px; cursor: pointer; font-size: .75rem;
}
.btn-delete:hover { border-color: var(--red); color: var(--red); }

/* ── TOPOLOGY VIEW ── */
#topo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-bottom: 2rem;
}

.topo-vline {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
}

.topo-trunks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  max-width: 900px;
  margin-bottom: 0;
}

.topo-trunks .card {
  padding: .45rem .85rem;
  font-size: .8rem;
}

.topo-server {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: .65rem 1.4rem;
  font-weight: 600;
  font-size: .9rem;
}

.topo-branches {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  position: relative;
}

/* Ligne horizontale reliant les deux colonnes */
.topo-branches::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.topo-branch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.5rem;
  position: relative;
  min-width: 200px;
  transition: opacity .3s;
}

/* Ligne verticale depuis la barre horizontale vers le nœud */
.topo-branch-col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 1.5rem;
  background: var(--border);
}

.topo-branch-active::before {
  background: var(--accent);
  width: 2px;
}

.topo-branch-inactive {
  opacity: .45;
}

.topo-branch-overflow {
  opacity: .45;
}

.topo-overflow-label {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: .04em;
  margin-top: .4rem;
}

.topo-incoming-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .04em;
  margin-bottom: .35rem;
}

.topo-branch-active .topo-queue-node {
  border-color: var(--accent);
}

.topo-queue-node {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 500;
}

.topo-pcm-warning {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: .6rem 1rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}

.topo-queue-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  line-height: 1.2;
}

.topo-priority-card {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  padding: .45rem .8rem;
  background: #0f1f3b;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
}
.topo-priority-num {
  font-size: .8rem;
  font-weight: 600;
}
.topo-priority-hint {
  font-size: .68rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
[data-theme="light"] .topo-priority-card {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.topo-queue-descr {
  font-size: .68rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.topo-unqueued-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

#topo-unqueued-col {
  min-width: 0;
}

.topo-unqueued-groups {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: .5rem;
}

.topo-unqueued-type {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.topo-unqueued-type-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.topo-unqueued-decades {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}

.topo-decade-col {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: stretch;
}

.topo-decade-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.topo-ext-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  max-width: 700px;
  padding: 0 .5rem;
  margin-top: .5rem;
}

.topo-ext-row .card {
  min-width: 120px;
  max-width: 165px;
}

.topo-ext-col {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: stretch;
  margin-top: .5rem;
}

.topo-ext-col .card {
  min-width: 180px;
}

/* ── TOGGLE BUTTONS (stats controls) ── */
.btn-toggle {
  padding: .25rem .6rem;
  font-size: .75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-toggle:hover { border-color: var(--accent); color: var(--accent); }
.btn-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── STATS ── */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.stats-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: .4rem;
  font-variant-numeric: tabular-nums;
}

/* ── HISTOGRAM ── */
.histo-outer {
  padding-bottom: 1.75rem;
  position: relative;
}
.histo-with-axis {
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.histo-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  min-width: 2rem;
  flex-shrink: 0;
  text-align: right;
}
.histo-ytick {
  font-size: .6rem;
  color: var(--text-muted);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.histo-main {
  flex: 1;
  min-width: 0;
}
.histo-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to top,
    transparent 0px,
    transparent calc(25% - 1px),
    color-mix(in srgb, var(--border) 60%, transparent) calc(25% - 1px),
    color-mix(in srgb, var(--border) 60%, transparent) 25%
  );
}
.histo-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  cursor: default;
}
.histo-col:hover .histo-bar {
  background: var(--accent);
}
.histo-bar {
  width: 100%;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 2px 2px 0 0;
  transition: background .1s;
  min-width: 2px;
}
.histo-labels {
  display: flex;
  gap: 2px;
  margin-top: .3rem;
}
.histo-lbl {
  flex: 1;
  font-size: .6rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

/* ── CDR ANNOTATIONS ── */
.cdr-actions { white-space: nowrap; width: 62px; text-align: center; }

.btn-flag {
  background: none; border: none;
  cursor: pointer; padding: 0;
  color: var(--text-muted); opacity: .4;
  transition: color .15s, opacity .15s;
  line-height: 0; vertical-align: middle;
}
.btn-flag:hover         { color: var(--yellow); opacity: 1; }
.btn-flag.flagged       { color: var(--yellow); opacity: 1; }
.btn-flag.flagged:hover { color: var(--text-muted); opacity: .6; }

.btn-note-toggle {
  background: none; border: none;
  cursor: pointer; padding: 0 0 0 .4rem;
  color: var(--text-muted); opacity: .4;
  transition: color .15s, opacity .15s;
  line-height: 0; vertical-align: middle;
}
.btn-note-toggle:hover    { color: var(--accent); opacity: 1; }
.btn-note-toggle.has-note { color: var(--accent); opacity: 1; }

tbody tr.cdr-flagged { background: color-mix(in srgb, var(--yellow) 6%, transparent); }
tbody tr.cdr-flagged:hover { background: color-mix(in srgb, var(--yellow) 11%, var(--surface2)); }

tbody tr.note-row         { background: var(--surface2) !important; }
tbody tr.note-row:hover   { background: var(--surface2) !important; }
tbody tr.note-row td      { padding: .4rem 1rem .6rem; border-top: none; }

.note-expand { display: flex; flex-direction: column; gap: .45rem; }
.note-textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: .5rem .75rem;
  font-size: .85rem; font-family: inherit; resize: vertical; min-height: 62px;
}
.note-textarea:focus { outline: none; border-color: var(--accent); }
.note-row-actions { display: flex; gap: .5rem; }

/* ── FOOTER ── */
.app-footer {
  text-align: center;
  padding: .75rem 1.5rem;
  font-size: .75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2); border: 1px solid var(--border);
  padding: .7rem 1.2rem; border-radius: 8px; font-size: .85rem;
  display: none; z-index: 1000; max-width: 320px;
}
#toast.show { display: block; }
#toast.error { border-color: var(--red); color: var(--red); }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 640px) {
  header {
    flex-wrap: wrap;
    height: auto;
    padding: .5rem .75rem;
    gap: .4rem;
  }
  header .logo { flex: 1; min-width: 0; }
  .user-info { display: none; }

  /* Nav en deuxième ligne, scrollable horizontalement */
  header nav {
    order: 10;
    width: 100%;
    flex: none;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    gap: .1rem;
  }
  header nav::-webkit-scrollbar { display: none; }
  header nav button { white-space: nowrap; font-size: .8rem; padding: .3rem .65rem; }

  /* Logout : icône seulement */
  .logout-text { display: none; }
  .btn-logout { padding: .3rem .5rem; }

  main { padding: 1rem .75rem; }

  .login-wrap { padding: 1rem; align-items: flex-start; padding-top: 3rem; }
  .login-box { border-radius: 8px; }

  /* Filtres CDR empilés */
  .filters > div { width: 100%; }
  .filters input, .filters select { width: 100% !important; }

  /* Stats header empilé */
  .stats-header { flex-direction: column; align-items: flex-start; gap: .75rem; }

  /* Topologie : branches en colonne */
  .topo-branches { flex-direction: column; align-items: center; gap: 1.5rem; }
  .topo-branches::before { display: none; }
  .topo-branch-col { min-width: 0; }

  /* Audio player plus compact */
  .audio-cell { min-width: 0; }
  .audio-cell audio { width: 100%; min-width: 180px; }

  /* Toast plus proche du bas */
  #toast { right: .75rem; left: .75rem; max-width: none; bottom: .75rem; }
}
