/* ═══════════════════════════════════════════════════════════
   TOBI P1 — Apple Design System Refonte
   Light theme default · Dark theme via [data-theme="dark"]
   ══════════════════════════════════════════════════════════ */

/* ─── LIGHT THEME (default) ────────────────────────────── */
:root {
  --bg:          #f5f5f7;
  --surface:     #ffffff;
  --surface2:    #f2f2f7;
  --border:      rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text:        #1d1d1f;
  --text-muted:  #86868b;
  --blue:        #007AFF;
  --blue-light:  #0A84FF;
  --green:       #34C759;
  --green-light: #30D158;
  --red:         #FF3B30;
  --red-light:   #FF453A;
  --yellow:      #FF9500;
  --yellow-light:#FF9F0A;
  --accent:      #007AFF;
  --glow:        transparent;
  --radius:      12px;
  --sidebar-w:   252px;
  --transition:  .2s ease;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --sidebar-bg:  #ffffff;
  --header-bg:   rgba(255,255,255,0.85);
  --input-bg:    #f2f2f7;
}

/* ─── DARK THEME ────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #000000;
  --surface:     #1c1c1e;
  --surface2:    #2c2c2e;
  --border:      rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text:        #f5f5f7;
  --text-muted:  #98989d;
  --blue:        #0A84FF;
  --blue-light:  #409CFF;
  --green:       #30D158;
  --green-light: #32D74B;
  --red:         #FF453A;
  --red-light:   #FF6961;
  --yellow:      #FF9F0A;
  --yellow-light:#FFD60A;
  --accent:      #0A84FF;
  --glow:        transparent;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-elevated: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  --sidebar-bg:  #1c1c1e;
  --header-bg:   rgba(28,28,30,0.85);
  --input-bg:    #2c2c2e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-shell {
  position: relative;
  isolation: isolate;
}
.app-shell::before {
  display: none;
}
.app-shell > .sidebar,
.app-shell > .main,
.app-shell > .sidebar-overlay,
.app-shell > .mobile-bottom-nav {
  position: relative;
  z-index: 1;
}

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 99px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ─── LAYOUT ────────────────────────────────────────────── */
body { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  gap: 0;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}
.header__title {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.header__status {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

/* ─── TAB CONTENT ───────────────────────────────────────── */
.content > .tab-content {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1.75rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}
.content > .tab-content.active {
  display: block;
}

.content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.tab-inner {
  display: block;
  width: 100%;
}
.tab-inner > * + * {
  margin-top: 1.25rem;
}

#tab-contacts .contacts-grid,
#tab-filtres .filtres-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}
#tab-contacts .contacts-filters {
  display: flex;
  flex-direction: column;
}
#tab-contacts .contacts-filters-body {
  padding: 0 1rem 1rem;
}
#tab-contacts .contacts-table-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#tab-contacts .contacts-table-wrap > .card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#tab-contacts .contacts-table-scroll {
  flex: 1;
  min-height: 160px;
  max-height: min(560px, calc(100vh - 220px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 1rem 1rem;
  scrollbar-gutter: stable;
}
#tab-contacts .contacts-filters {
  max-height: min(640px, calc(100vh - 180px));
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#tab-filtres .filtres-grid {
  grid-template-columns: minmax(240px, 300px) 1fr;
}
#tab-filtres .filtres-fichiers-col {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
#tab-filtres .filtres-main-card {
  display: flex;
  flex-direction: column;
}
#tab-filtres .filtres-main-scroll {
  padding: 0 1.25rem 1.25rem;
}

.content > #tab-contacts.active,
.content > #tab-filtres.active {
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
}

@media (max-width: 860px) {
  #tab-contacts .contacts-grid,
  #tab-filtres .filtres-grid {
    grid-template-columns: 1fr;
  }
  /* Filter toggle visible on tablet/mobile */
  #uiFiltreToggleBtn { display: inline-flex !important; }
  .contacts-filters-body:not(.filter-open) { display: none !important; }
  /* Tap target for filter toggle */
  #uiFiltreToggleBtn {
    min-height: 36px !important;
    padding: .3rem .6rem !important;
    font-size: .75rem !important;
  }
}
#uiFiltreToggleBtn { display: none; }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.brand-icon {
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 11px;
  stroke: #fff;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── NAV ───────────────────────────────────────────────── */
.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 0 .75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .84rem;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  background: var(--surface2);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--accent); }

/* ─── SIDEBAR STATUS ────────────────────────────────────── */
.sidebar__status {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
  font-size: .78rem;
  color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition);
  flex-shrink: 0;
}
.status-dot.running { background: var(--green); box-shadow: 0 0 4px var(--green); }
.status-dot.trunk-ok { background: #22c55e; box-shadow: 0 0 4px #22c55e; }

/* ─── TOPBAR ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  gap: 1rem;
  flex-shrink: 0;
}
.topbar__title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.topbar__actions { display: flex; gap: .65rem; }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .52rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, opacity .15s, background var(--transition);
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.btn--success  { background: var(--green); color: #fff; border-color: transparent; }
.btn--danger   { background: var(--red); color: #fff; border-color: transparent; }
.btn--outline  { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--sm       { padding: .38rem .78rem; font-size: .78rem; border-radius: 8px; }

.btn:hover:not(:disabled) {
  opacity: .85;
  transform: translateY(-1px);
}
.btn--primary:hover:not(:disabled) { opacity: .9; }

/* ─── STATS GRID ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}
.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon svg { width: 20px; height: 20px; }

.stat-card--blue  .stat-card__icon { background: rgba(0,122,255,0.1);  color: var(--blue);  }
.stat-card--green .stat-card__icon { background: rgba(52,199,89,0.1);  color: var(--green); }
.stat-card--red   .stat-card__icon { background: rgba(255,59,48,0.1);  color: var(--red);   }
.stat-card--yellow .stat-card__icon { background: rgba(255,149,0,0.1); color: var(--yellow); }
.stat-card--purple .stat-card__icon { background: rgba(175,82,222,0.1); color: #AF52DE; }

.stat-card__body  { display: flex; flex-direction: column; gap: .15rem; }
.stat-card__value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-card--green .stat-card__value { color: var(--green); }
.stat-card--red .stat-card__value { color: var(--red); }
.stat-card__label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* ─── PROGRESS ──────────────────────────────────────────── */
.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-card);
}
.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: .65rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
}
.progress-pct { color: var(--text); font-weight: 600; }
.progress-bar-track {
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .6s ease;
}

/* ─── CARD ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}
.card--full { flex: 1; min-height: 0; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .88rem;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.card__body { padding: 1rem 1.25rem; overflow-y: auto; }
.card__body.p0 { padding: 0; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* ─── BADGE ─────────────────────────────────────────────── */
.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .22rem .7rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}

/* ─── RECENT LOGS ───────────────────────────────────────── */
.recent-logs {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-height: 220px;
  overflow-y: auto;
}
.recent-logs .log-line { display: block; }

/* ─── UPLOAD ZONE ───────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0,122,255,0.04);
}
.upload-hint { font-size: .75rem; }
.upload-hint code { color: var(--accent); }

/* ─── FEEDBACK ──────────────────────────────────────────── */
.feedback {
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 500;
  margin-top: .75rem;
}
.hidden { display: none !important; }
.feedback.hidden { display: none; }
.feedback.ok  { background: rgba(52,199,89,.08); color: var(--green); border: 1px solid rgba(52,199,89,.2); }
.feedback.err { background: rgba(255,59,48,.08);  color: var(--red);   border: 1px solid rgba(255,59,48,.2); }

/* ─── TABLE ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.data-table th {
  text-align: left;
  padding: .6rem .75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(0,122,255,0.03); }
[data-theme="dark"] .data-table tbody tr:hover td { background: rgba(10,132,255,0.06); }

.status-pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-pill.ok  { background: rgba(52,199,89,.1);  color: var(--green); }
.status-pill.err { background: rgba(255,59,48,.1);  color: var(--red); }

/* ─── LOG CONTAINER ─────────────────────────────────────── */
.log-container {
  flex: 1;
  overflow-y: auto;
  padding: .85rem 1.25rem;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: .78rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.log-line { display: block; }
.log-line.INFO    { color: var(--text-muted); }
.log-line.WARNING { color: var(--yellow); }
.log-line.ERROR   { color: var(--red); }
.log-line.SUCCESS { color: var(--green); }

/* ─── CONFIG FORM ───────────────────────────────────────── */
.config-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .78rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-group input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .85rem;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
[data-theme="dark"] .form-group input:focus { box-shadow: 0 0 0 3px rgba(10,132,255,0.2); }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ─── FORM FIELD (inline form-field used in HTML) ─────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .85rem;
}
.form-field label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── TOGGLE ────────────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* ─── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1.25rem;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
  z-index: 9999;
  transition: opacity .25s ease, transform .25s ease;
  max-width: 340px;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.toast.ok  { border-color: rgba(52,199,89,.3);  color: var(--green); }
.toast.err { border-color: rgba(255,59,48,.3);   color: var(--red); }
.toast.info { border-color: rgba(0,122,255,.3);  color: var(--accent); }

.empty-state {
  display: block;
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  font-size: .82rem;
}

/* ─── FILTRES LAYOUT ────────────────────────────────────────── */
.filtres-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
  height: 100%;
}
.filtres-col-files { display: flex; flex-direction: column; gap: 1rem; }
.filtres-col-right  { display: flex; flex-direction: column; gap: 1rem; }

/* ─── FICHIERS LIST ─────────────────────────────────────────── */
.fichiers-list { display: flex; flex-direction: column; }
.fichier-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.fichier-item:last-child { border-bottom: none; }
.fichier-item:hover { background: var(--surface2); }
.fichier-item.selected { background: rgba(0,122,255,.06); border-left: 3px solid var(--accent); }
.fichier-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.fichier-item__info { flex: 1; min-width: 0; }
.fichier-item__name { font-size: .83rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichier-item__meta { font-size: .7rem; color: var(--text-muted); }
.fichier-item__count { font-size: .78rem; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ─── FILTRE BLOC ───────────────────────────────────────────── */
.filtre-bloc {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.filtre-bloc:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filtre-bloc__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .65rem;
}
.filtre-hint { font-size: .72rem; color: var(--text-muted); margin-top: .35rem; }

/* ─── TAGS CHECK ROW ────────────────────────────────────────── */
.tags-check-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-check {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .78rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  user-select: none;
}
.tag-check input { accent-color: var(--accent); cursor: pointer; }
.tag-check:has(input:checked) {
  background: rgba(0,122,255,.08);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ─── BANQUE LIST ───────────────────────────────────────────── */
.banque-list { display: flex; flex-direction: column; gap: .5rem; }
.banque-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.banque-item.selected { border-color: var(--accent); }
.banque-item__header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .85rem;
  cursor: pointer;
}
.banque-item__header input { accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.banque-item__name { font-size: .85rem; font-weight: 600; flex: 1; }
.banque-item__count { font-size: .72rem; color: var(--text-muted); }
.banque-item__bics {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: 0 .85rem .55rem;
}
.bic-tag {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: .7rem;
  padding: .15rem .5rem;
  background: rgba(0,122,255,.06);
  border: 1px solid rgba(0,122,255,.15);
  border-radius: 4px;
  color: var(--accent);
}

/* ─── COLUMN TAGS ───────────────────────────────────────────── */
.col-tags-section { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.col-label { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.tags-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.col-tag {
  padding: .2rem .6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .72rem;
  color: var(--text-muted);
}
.col-tag.available { border-color: rgba(52,199,89,.3); color: var(--green); background: rgba(52,199,89,.06); }

.input-full {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .85rem;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.input-full:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }

/* ─── APERÇU GRID ───────────────────────────────────────────── */
.apercu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.apercu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.apercu-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.apercu-lbl  { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.apercu-green  { color: var(--green); }
.apercu-orange { color: var(--yellow); }
.apercu-blue   { color: var(--accent); }

/* ─── SELECT ────────────────────────────────────────────────── */
.select-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .75rem;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.select-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
[data-theme="dark"] .modal { box-shadow: 0 24px 80px rgba(0,0,0,.5); }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__header h2 { font-size: 1.05rem; font-weight: 700; }
.modal__close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
  padding: .25rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.modal__close:hover { color: var(--text); background: var(--surface2); }

.modal__body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-section h3 {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .85rem;
}
.modal-section { display: flex; flex-direction: column; }

/* ─── TOGGLE ROW ────────────────────────────────────────────── */
.toggle-row  { display: flex; gap: 1rem; flex-wrap: wrap; }
.toggle-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  flex: 1;
  min-width: 180px;
}
.toggle-item strong { font-size: .88rem; display: block; }
.toggle-item small  { font-size: .72rem; color: var(--text-muted); }

/* ─── SWITCH (checkbox) ─────────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 99px;
  transition: background .2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ─── APERÇU PREVIEW ────────────────────────────────────────── */
.apercu-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .88rem;
}

/* ─── BADGE PURPLE ──────────────────────────────────────────────────────── */
.badge--purple { background: rgba(175,82,222,.08); color: #AF52DE; border: 1px solid rgba(175,82,222,.2); }

/* ─── LIVE CALLS ─────────────────────────────────────────────────────────── */
.live-calls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  min-height: 60px;
}
.live-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .88rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface2);
}
.live-call-card {
  background: var(--surface2);
  border: 1px solid rgba(0,122,255,.2);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.live-call-card__header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  background: rgba(0,122,255,.06);
  border-bottom: 1px solid rgba(0,122,255,.1);
}
[data-theme="dark"] .live-call-card__header {
  background: rgba(10,132,255,.1);
  border-bottom-color: rgba(10,132,255,.15);
}
.live-dot-pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse-dot 1.2s infinite;
}
.live-agent-name {
  flex: 1;
  font-weight: 700;
  font-size: .85rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-timer {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  padding: .15rem .45rem;
  border-radius: 4px;
  min-width: 52px;
  text-align: center;
  letter-spacing: .03em;
}
.live-call-card__body {
  padding: .75rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.live-client-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}
.live-client-num {
  font-size: .82rem;
  color: var(--text-muted);
  letter-spacing: .03em;
}

/* ─── AGENT CARDS ───────────────────────────────────────────────────────── */
.agent-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.agent-card__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .75rem;
  background: rgba(0,122,255,.04);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .agent-card__header { background: rgba(10,132,255,.08); }
.agent-card__num {
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
}
.agent-card__name {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
}
.agent-card__name::placeholder { color: var(--text-muted); }
.agent-card__body {
  padding: .65rem .75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem .75rem;
}
.agent-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.agent-field.full { grid-column: span 2; }
.agent-field label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.agent-field input, .agent-field select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: .3rem .55rem;
  font-size: .82rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.agent-field input:focus, .agent-field select:focus { border-color: var(--accent); }
.agent-field select { cursor: pointer; }

/* ─── AGENT TABLE INPUTS ────────────────────────────────────────────────── */
.agent-tbl-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .6rem;
  font-size: .83rem;
  outline: none;
  box-sizing: border-box;
  color: var(--text);
}
.agent-tbl-input:focus { border-color: var(--accent); }

/* ─── AGENTS POPUP ──────────────────────────────────────────── */
.agents-popup {
  position: fixed;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 280px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}
.agents-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  background: rgba(0,122,255,.06);
  color: var(--accent);
  font-weight: 600;
  font-size: .85rem;
}
.agents-popup__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0;
  opacity: .7;
}
.agents-popup__close:hover { opacity: 1; }
.agents-popup__list {
  padding: .5rem 0;
  max-height: 200px;
  overflow-y: auto;
}
.agents-popup__item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem 1rem;
  font-size: .83rem;
}
.agents-popup__item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse-dot 1.2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ─── CONTACTS TABLE ───────────────────────────────────── */
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.contacts-table th {
  text-align: left;
  padding: .5rem .6rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.contacts-table td {
  padding: .45rem .6rem;
  border-bottom: 1px solid var(--border);
}
.contacts-table-wrap { overflow-x: auto; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .apercu-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  #cardAgentsLigne { grid-column: span 2; }
  .apercu-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .toggle-row { flex-direction: column; }
}

/* ─── CONTACTS UNIFIED LAYOUT ───────────────────────────────────────────── */
.contacts-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.contacts-filter-col { min-width: 0; }
.contacts-table-col  { min-width: 0; }

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

/* ─── CIVILITÉ BUTTONS ───────────────────────────────────────────────────── */
.civ-btn-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.civ-btn {
  padding: .32rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s, color .15s, border-color .15s;
}
.civ-btn:hover  { border-color: var(--accent); color: var(--text); }
.civ-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ─── BANQUE AUTOCOMPLETE ────────────────────────────────────────────────── */
.banque-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
}
.banque-sugg-item {
  padding: .55rem .8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.banque-sugg-item:last-child { border-bottom: none; }
.banque-sugg-item:hover { background: rgba(0,122,255,.05); }
.banque-sugg-item strong { font-size: .83rem; color: var(--text); }
.banque-sugg-bics  { font-size: .72rem; font-family: 'SF Mono', monospace; color: var(--text-muted); }
.banque-sugg-total { font-size: .71rem; color: var(--accent); font-weight: 600; }
.banque-sugg-empty { padding: .7rem .8rem; color: var(--text-muted); font-size: .82rem; }

/* ─── BIC PILLS ──────────────────────────────────────────────────────────── */
.bic-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--text);
  font-size: .76rem;
  font-family: 'SF Mono', monospace;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  flex-shrink: 0;
}
.bic-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ─── CHIPS BANQUES SÉLECTIONNÉES ───────────────────────────────────────── */
.banques-chips { display: flex; flex-direction: column; gap: .3rem; margin-top: .45rem; }
.banque-chip {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(0,122,255,.05);
  border: 1px solid rgba(0,122,255,.15);
  border-radius: var(--radius);
  padding: .28rem .6rem;
  font-size: .79rem;
}
.banque-chip__name  { flex: 1; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banque-chip__bics  { font-family: 'SF Mono', monospace; font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
.banque-chip__rm {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
  padding: 0 .1rem; flex-shrink: 0;
}
.banque-chip__rm:hover { color: var(--red); }

/* ─── APERÇU MINI ────────────────────────────────────────────────────────── */
.apercu-mini {
  display: flex; gap: .4rem; margin-top: .75rem;
}
.apercu-mini .apercu-item {
  flex: 1; text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .2rem;
}
.badge--green { background: rgba(52,199,89,.08); color: var(--green); border: 1px solid rgba(52,199,89,.2); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE MOBILE  ≤ 768px
   ══════════════════════════════════════════════════════════ */

.btn-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: .4rem;
  border-radius: 6px;
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}
.btn-hamburger:hover { background: var(--surface2); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  html, body { overflow: auto; }
  body { flex-direction: column; height: auto; min-height: 100vh; }

  .btn-hamburger { display: flex; align-items: center; justify-content: center; }

  .app-shell > .sidebar,
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .main { flex: 1; width: 100%; overflow-y: auto; height: 100vh; }

  .topbar {
    flex-wrap: wrap;
    gap: .5rem;
    padding: .7rem .85rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
  }
  .topbar__title { font-size: .95rem; }
  .topbar__actions { display: flex; gap: .4rem; flex-wrap: wrap; }
  .topbar__actions .btn { font-size: .75rem; padding: .4rem .7rem; }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: .6rem;
  }
  .stat-card__value { font-size: 1.5rem; }

  #dashChartRow {
    grid-template-columns: 1fr !important;
  }

  .card { border-radius: 10px; }
  .card__header { padding: .65rem .75rem; }
  .card__body   { padding: .65rem .75rem; }

  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; font-size: .75rem; }

  #ccLayout, #parametresLayout,
  [style*="grid-template-columns"][style*="300px"] {
    grid-template-columns: 1fr !important;
  }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .apercu-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: .5rem;
  }

  .prep-step { padding: .65rem .75rem; }
  .progress-section { padding: .7rem .75rem; }

  .live-calls-grid {
    grid-template-columns: 1fr !important;
  }

  #ccAgentsList .agent-row,
  .agents-list .agent-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
  }

  #btnAddCcAgent { font-size: .72rem; padding: .3rem .55rem; }
  #resultatsTable { min-width: 560px; }
  .col-hide-mobile { display: none !important; }

  .header {
    padding: .65rem .85rem;
    padding-top: max(.65rem, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .header__title {
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header__status span:last-child {
    display: none;
  }

  .content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .content > .tab-content {
    position: relative;
    inset: auto;
    min-height: auto;
    overflow: visible;
    padding: .85rem .75rem 1rem;
  }
  .content > #tab-contacts.active,
  .content > #tab-filtres.active {
    overflow: visible;
  }
  .main {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .modal {
    padding-bottom: max(.5rem, env(safe-area-inset-bottom));
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .5rem !important;
  }
  .stats-row .stat-card {
    padding: .75rem .85rem;
  }
  .stats-row .stat-card__value {
    font-size: 1.35rem;
  }
  #cardAgentsLigne {
    grid-column: span 2;
  }

  .dash-grid-3,
  .dash-grid-2 {
    grid-template-columns: 1fr !important;
    gap: .75rem !important;
    margin-bottom: .75rem !important;
  }
  .dash-guide__arrow { display: none; }
  .dash-guide__steps { flex-direction: column; }
  .dash-guide__step { min-width: 0; }

  .dash-grid-3 .btn,
  #tab-dashboard .card div[style*="display:flex"] > .btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
  .btn {
    min-height: 42px;
    padding: .55rem .85rem;
  }
  .btn--sm {
    min-height: 38px;
  }

  #tab-contacts .contacts-table-scroll {
    max-height: none;
    padding: 0 .5rem .5rem;
  }
  #tab-contacts .contacts-filters {
    max-height: none;
  }
  #tab-contacts .data-table th:nth-child(n+6),
  #tab-contacts .data-table td:nth-child(n+6) {
    display: none;
  }

  input, select, textarea {
    font-size: 16px !important;
  }

  .toast {
    left: .75rem;
    right: .75rem;
    bottom: calc(72px + env(safe-area-inset-bottom));
    max-width: none;
  }

  .nav-item {
    padding: .75rem .85rem;
    min-height: 44px;
  }

  .mobile-bottom-nav { display: flex; }
}

/* ─── STATS ROW (dashboard) ─────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.stats-row .stat-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  gap: .35rem;
}
.stat-card.ok  { border-color: rgba(52,199,89,.25); }
.stat-card.err { border-color: rgba(255,59,48,.25); }
.stat-card.warn { border-color: rgba(255,149,0,.25); }
.stat-card__hint {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .2rem;
  line-height: 1.35;
}

/* ─── Dashboard guide & étapes ─────────────────────────────── */
.dash-guide {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border-color: var(--border);
}
.dash-guide__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.dash-guide__title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .2rem;
}
.dash-guide__sub {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 42rem;
}
.dash-guide__link {
  font-size: .78rem;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}
.dash-guide__link:hover { text-decoration: underline; }
.dash-guide__steps {
  display: flex;
  align-items: stretch;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.dash-guide__step {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .55rem .65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .75rem;
  color: var(--text-muted);
  transition: border-color .2s, background .2s;
}
.dash-guide__step strong {
  display: block;
  color: var(--text);
  font-size: .8rem;
  margin-bottom: .15rem;
}
.dash-guide__step.is-active {
  border-color: rgba(0,122,255,.35);
  background: rgba(0,122,255,.04);
}
[data-theme="dark"] .dash-guide__step.is-active {
  background: rgba(10,132,255,.08);
}
.dash-guide__step.is-done {
  border-color: rgba(52,199,89,.3);
  background: rgba(52,199,89,.04);
}
.dash-guide__step.is-done .dash-guide__num {
  background: var(--green);
}
.dash-guide__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-guide__arrow {
  align-self: center;
  color: var(--text-muted);
  font-size: 1rem;
  opacity: .5;
}
.dash-guide__banner {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .8rem;
  line-height: 1.45;
}
.dash-guide__banner--idle {
  background: rgba(0,122,255,.04);
  border: 1px solid rgba(0,122,255,.15);
  color: var(--text);
}
.dash-guide__banner--wait {
  background: rgba(255,149,0,.04);
  border: 1px solid rgba(255,149,0,.2);
  color: var(--text);
}
.dash-guide__banner--ok {
  background: rgba(52,199,89,.04);
  border: 1px solid rgba(52,199,89,.2);
  color: var(--text);
}
.dash-guide__banner--run {
  background: rgba(0,122,255,.04);
  border: 1px solid rgba(0,122,255,.2);
  color: var(--text);
}

.dash-section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: .25rem 0 .65rem;
  padding-left: .15rem;
}

.dash-step-card {
  transition: border-color .25s;
}
.dash-step-card.is-active {
  border-color: rgba(0,122,255,.3);
}
.dash-step-card.is-done {
  border-color: rgba(52,199,89,.25);
}
.dash-step-help {
  font-size: .76rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 1.25rem .65rem;
}
.dash-step-link {
  display: inline-block;
  margin: 0 1.25rem 1rem;
  font-size: .78rem;
  color: var(--accent);
}
.dash-filters-box {
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 1.25rem .5rem;
}
.dash-empty-msg {
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.45;
}
.dash-detail-text {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .55rem 1.25rem .75rem;
  line-height: 1.45;
}
.dash-field-label {
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: .35rem;
}
.dash-field-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .4rem .55rem;
  color: var(--text);
  font-size: .82rem;
  outline: none;
}
.dash-field-hint {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .25rem;
  line-height: 1.35;
}
.dash-nb-contacts {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 1.25rem .45rem;
}
.dash-launch-hint {
  font-size: .78rem;
  color: var(--green);
  margin: 0 1.25rem .65rem;
  line-height: 1.4;
  min-height: 1.1rem;
}

.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ─── Bottom navigation mobile ─────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  gap: .15rem;
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 600;
  padding: .35rem .2rem;
  min-height: 52px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn svg {
  width: 20px;
  height: 20px;
}
.mobile-nav-btn.active {
  color: var(--accent);
}
.mobile-nav-btn:active {
  opacity: .75;
}

@media (min-width: 769px) {
  .mobile-bottom-nav { display: none !important; }
}

/* ─── Apple polish ─────────────────────────────────────────── */
#sidebarDailyFill {
  background: var(--accent) !important;
}
#btnLogout {
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: border-color .15s, color .15s, background .15s !important;
}
#btnLogout:hover {
  background: rgba(255,59,48,0.06) !important;
}
.sidebar__brand span.brand-text {
  color: var(--text);
}
.log-box {
  background: var(--input-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

/* ─── Theme toggle card ────────────────────────────────────── */
.theme-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}
.theme-toggle-info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.theme-toggle-info strong {
  font-size: .88rem;
  font-weight: 600;
}
.theme-toggle-info span {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ─── CC card in callcenters tab ───────────────────────────── */
.cc-card { cursor: pointer; margin: 0; }

/* ─── Warn pill ────────────────────────────────────────────── */
.status-pill.warn { background: rgba(255,149,0,.1); color: var(--yellow); }

/* ─── CC / Agent toggle buttons ─────────────────────────────── */
.cc-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .3rem 0;
  min-height: 36px;
}
.cc-toggle-btn {
  padding: .35rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .82rem;
  cursor: pointer;
  background: var(--input-bg);
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  user-select: none;
  white-space: nowrap;
}
.cc-toggle-btn:hover {
  border-color: var(--accent);
}
.cc-toggle-btn.active {
  background: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
  color: #fff;
}
.cc-toggle-btn:active { transform: scale(0.95); }
