/* ═══════════════════════════════════════════════════════════════
   SATELLITE CRM — Design System v42.0
   Dark warm + gold luxury theme
   ═══════════════════════════════════════════════════════════════ */

/* Theme variables: see css/theme-vars.css */

/* ─── RESET & BASE ─── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent }
html { touch-action: manipulation; scroll-behavior: smooth }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  position: relative;
  overflow-x: hidden;
}

::selection { background: rgba(212, 165, 116, .3); color: var(--white) }
::-webkit-scrollbar { width: 6px; height: 6px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px }
::-webkit-scrollbar-thumb:hover { background: var(--bg5) }

/* ─── LAYOUT ─── */
.dir-layout { display: flex; min-height: 100vh }
.dir-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; transition: margin-left .3s var(--transition); min-width: 0; overflow-x: clip; }
.dir-main.expanded { margin-left: 0 }
.main { max-width: none; margin: 0; padding: 1.5rem }

/* ─── TOP BAR ─── */
.topbar, .dir-top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; height: 64px;
  background: rgba(22, 19, 16, 0.55);
  backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 22px;
  margin: 1rem 1.25rem 1.5rem;
  position: sticky; top: 1rem; z-index: 100;
}
.topbar::after, .dir-top::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 183, 117, 0.30), transparent);
}
.burger-btn {
  width: 38px; height: 38px; background: transparent; border: 1px solid var(--border);
  border-radius: 12px; color: var(--text2); display: grid; place-items: center;
  cursor: pointer; transition: all 0.2s; outline: none; flex-shrink: 0;
}
.burger-btn:hover { border-color: var(--border2); color: var(--gold-light); }
.burger-btn:focus { outline: none; }
.burger-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.burger-btn svg { width: 18px; height: 18px; }
.brand-mini { font-family: var(--font-ui); font-weight: 600; font-size: 14px; letter-spacing: 0.18em; color: var(--text); text-transform: uppercase; margin-right: 8px; flex-shrink: 0; }
.brand-dot { color: var(--gold); }
.page-title, .dir-top-t { font-family: var(--font-ui); font-weight: 500; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 10px; position: relative; padding-left: 16px; flex-shrink: 0; }
.page-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 18px; background: var(--border2); }
.search { margin-left: auto; position: relative; flex: 0 1 360px; min-width: 200px; }
.search input { width: 100%; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); border-radius: 999px; padding: 9px 54px 9px 40px; color: var(--text); font-family: inherit; font-size: 13px; outline: none; transition: all 0.25s; }
.search input::placeholder { color: var(--text3); }
.search input:focus { border-color: var(--border2); box-shadow: 0 0 0 3px rgba(232, 183, 117, 0.10); }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text3); pointer-events: none; }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; background: var(--bg); pointer-events: none; }
.topbar-btn { padding: 8px 14px !important; font-size: 12.5px !important; white-space: nowrap; flex-shrink: 0; }
.topbar-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.topbar-date { font-family: var(--font-ui); font-size: 12px; color: var(--text3); white-space: nowrap; flex-shrink: 0; }
.notif-wrapper { position: relative; flex-shrink: 0; }
.notif-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 340px; max-height: 420px; background: linear-gradient(155deg, rgba(31, 27, 23, 0.96), rgba(22, 19, 16, 0.96)); backdrop-filter: blur(20px); border: 1px solid var(--border2); border-radius: 14px; box-shadow: 0 24px 48px rgba(0,0,0,0.5); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 1000; overflow: hidden; }
.notif-dropdown::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 183, 117, 0.30), transparent); }
.notif-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.notif-title { font-size: 14px; font-weight: 500; color: var(--text); }
.notif-action { font-size: 11px; color: var(--gold); text-decoration: none; cursor: pointer; font-weight: 500; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; font-size: 12px; }
.notif-item:hover { background: rgba(212, 165, 116, 0.03); }
.notif-empty { padding: 28px 18px; text-align: center; color: var(--text3); font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; color: var(--text2); position: relative; flex-shrink: 0; transition: all 0.2s; }
.icon-btn:hover { border-color: var(--border2); color: var(--gold-light); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--gold-light); border-radius: 50%; box-shadow: 0 0 10px rgba(232, 183, 117, 0.65); animation: pulse 2s ease-in-out infinite; }
.profile { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; flex-shrink: 0; transition: all 0.2s; }
.profile:hover { border-color: var(--border2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--av-default-1), var(--av-default-2)); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--white); }
.profile-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; position: relative; overflow: hidden; }
.btn svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.btn-primary { background: linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-deep)); color: #1A1310; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 0 0 1px var(--gold-deep), 0 6px 16px rgba(232, 183, 117, 0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 0 0 1px var(--gold-deep), 0 10px 24px rgba(232, 183, 117, 0.35); }
.btn-secondary { background: rgba(31, 27, 23, 0.6); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--border2); box-shadow: 0 0 16px rgba(232, 183, 117, 0.08); }
.sb-toggle {
  background: none; border: none; color: var(--text2); font-size: .85rem;
  cursor: pointer; padding: .35rem .5rem; border-radius: var(--radius-sm);
  transition: all .2s; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.sb-toggle:hover { background: var(--bg4); color: var(--text) }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(26, 22, 19, 0.85) 0%, rgba(15, 12, 10, 0.85) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 22px 14px; gap: 3px;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar::before {
  content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.15), transparent 40%, transparent 60%, rgba(212, 165, 116, 0.06));
  pointer-events: none;
}
.sidebar.collapsed { transform: translateX(-100%) }
.sidebar-header { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border) }
.sidebar-brand { display: flex; align-items: center; gap: .7rem }
.sb-avatar {
  width: 38px; height: 38px;
  background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold-deep) 80%);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 600; font-size: .6rem; color: #1A1310;
  box-shadow: 0 0 28px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.30);
  position: relative; overflow: hidden;
}
.sb-avatar::after {
  content: ''; position: absolute; top: -100%; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { transform: translate(-100%,-100%); } 50% { transform: translate(100%,100%); } }
.sb-info .sb-name { font-size: .74rem; font-weight: 700 }
.sb-info .sb-role { font-size: .55rem; color: var(--accent); font-weight: 500 }
.sidebar-nav { flex: 1; padding: .4rem 0; overflow-y: auto }
.sb-sec, .nav-section {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-muted, #443F38); padding: 18px 12px 8px;
}
.sb-it, .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md, 12px);
  color: var(--text2); text-decoration: none;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all 0.25s; position: relative;
}
.sb-it svg, .nav-item svg { width: 18px; height: 18px; stroke-width: 1.6; flex-shrink: 0; transition: all 0.25s; }
.sb-it:hover, .nav-item:hover { background: rgba(212, 165, 116, 0.05); color: var(--text); }
.sb-it.active, .nav-item.active {
  background: linear-gradient(90deg, rgba(232, 183, 117, 0.14), rgba(212, 165, 116, 0.04));
  color: var(--gold-light); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border2), inset 0 0 30px rgba(212, 165, 116, 0.08);
  animation: breathe 4s ease-in-out infinite;
}
.sb-it.active::before, .nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 14px var(--gold-glow-strong, rgba(232,183,117,.65));
}
.sb-it.active svg, .nav-item.active svg { color: var(--gold-light); filter: drop-shadow(0 0 6px var(--gold-glow)); }
.sb-it .sb-badge, .nav-badge {
  margin-left: auto; background: rgba(232, 183, 117, 0.16);
  color: var(--gold-light); font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(232, 183, 117, 0.18);
}
.nav-logout { margin-top: auto; color: var(--red); border-top: 1px solid var(--border); padding-top: 14px !important; margin-top: 18px; }
.nav-logout:hover { background: rgba(199, 116, 100, 0.06) !important; color: var(--red) !important; }
.nav-logout svg { filter: drop-shadow(0 0 4px rgba(199, 116, 100, 0.4)); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; position: relative; }
.brand::after { content: ''; position: absolute; bottom: -1px; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-glow), transparent); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold-deep) 80%); display: grid; place-items: center; font-family: var(--font-ui); font-weight: 500; color: #1A1310; font-size: 19px; box-shadow: 0 0 28px rgba(232, 183, 117, 0.40), inset 0 1px 0 rgba(255,255,255,0.30); position: relative; overflow: hidden; flex-shrink: 0; }
.brand-mark::after { content: ''; position: absolute; top: -100%; left: -100%; width: 100%; height: 100%; background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%); animation: shimmer 6s ease-in-out infinite; }
.brand-name { font-family: var(--font-ui); font-weight: 400; font-size: 17px; letter-spacing: -0.01em; color: var(--text); }
.brand-name span { display: block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gold-deep); margin-top: 3px; }
.sidebar-footer { padding: .7rem 1.3rem; border-top: 1px solid var(--border) }
.sf-p { font-size: .52rem; color: var(--text3) }
.sf-out {
  background: none; border: none; color: var(--text3); font-size: .58rem;
  cursor: pointer; font-family: inherit; padding: .2rem .5rem; border-radius: 4px;
}
.sf-out:hover { color: var(--red); background: rgba(248, 113, 113, .08) }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .3s }
.sidebar-overlay.show { opacity: 1; pointer-events: all }

/* ─── PAGES (slide transitions) ─── */
.page { display: none }
.page.active { display: block; animation: pageSlideIn .35s cubic-bezier(.22, 1, .36, 1) }
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateX(24px) }
  to { opacity: 1; transform: translateX(0) }
}
@keyframes pageSlideOut {
  from { opacity: 1; transform: translateX(0) }
  to { opacity: 0; transform: translateX(-24px) }
}
.page-header { margin-bottom: 1.5rem }
.page-header h2 { font-family: var(--font-ui); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em }
.page-header p { color: var(--text2); font-size: .85rem; margin-top: .35rem }

/* ─── CARDS (glassmorphism) ─── */
.card {
  background: var(--bg2);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 1.3rem;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border2) }
.card-title {
  font-size: .68rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: .8rem;
}
.cd {
  background: var(--bg2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: .95rem; overflow: hidden;
  margin-bottom: 1rem; transition: all var(--transition);
}
.cd:hover { border-color: rgba(212, 165, 116, .12) }

/* ─── STAT CARDS (KPIs) ─── */
/* ─── KPI STAT CARDS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem }
.stat-card, .sc {
  background: linear-gradient(155deg, rgba(31, 27, 23, 0.85) 0%, rgba(22, 19, 16, 0.85) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.stat-card::before, .sc::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 183, 117, 0.20), transparent);
}
.stat-card:hover, .sc:hover {
  border-color: var(--border2);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 24px rgba(232, 183, 117, 0.10);
  transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1 }
.stat-label { font-size: .54rem; color: var(--text2); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin-bottom: .4rem }
.stat-value {
  font-family: 'JetBrains Mono', monospace; font-size: 1.65rem; font-weight: 700;
  margin-top: .1rem; letter-spacing: -.03em; line-height: 1.15;
  background: linear-gradient(135deg, var(--text) 30%, var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-sub { font-size: .58rem; color: var(--text3); margin-top: .35rem }
.stat-sub.su { color: var(--green) }

/* ─── COMPTA STAT CARDS ─── */
.sg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem }
/* .sc styles merged into .stat-card rule above */
.sl { font-size: .54rem; color: var(--text2); text-transform: uppercase; letter-spacing: .12em; font-weight: 700 }
.sv {
  font-family: 'JetBrains Mono', monospace; font-size: 1.35rem; font-weight: 700; margin-top: .2rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ss { font-size: .56rem; margin-top: .12rem }
.st { font-family: var(--font-ui); font-size: .82rem; font-weight: 700; margin-bottom: .55rem; display: flex; align-items: center; gap: .45rem }

/* ─── SECTION TITLES ─── */
.section { margin-bottom: 1.5rem }
.section-title {
  font-family: var(--font-ui); font-size: .76rem; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: .12em; margin-bottom: .8rem;
}

/* ─── GRIDS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1.3rem }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; margin-bottom: 1.3rem }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem }
@media(max-width:768px) { .grid-2, .grid-3, .g2 { grid-template-columns: 1fr } .quick-nav { grid-template-columns: 1fr 1fr } }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm) }
table { width: 100%; border-collapse: collapse; font-size: .76rem }
thead th {
  text-align: left; padding: .7rem .75rem; font-size: .62rem; font-weight: 700;
  color: var(--text2); text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 2px solid rgba(212, 165, 116, .25); background: rgba(255, 255, 255, .03);
}
tbody td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); transition: background .15s }
tbody tr { transition: all .15s }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .015) }
tbody tr:hover { background: rgba(212, 165, 116, .04) }
/* Action menu column */
th.col-actions, td.col-actions { width: 40px; text-align: center; padding: 0 4px !important; vertical-align: middle }
td.col-actions > div { display: flex; justify-content: center }
.cd table { width: 100%; border-collapse: collapse; font-size: .67rem }
.cd th { text-align: left; padding: .5rem .55rem; font-size: .52rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid rgba(212, 165, 116, .15); background: transparent }
.cd td { padding: .42rem .55rem; border-bottom: 1px solid rgba(255, 255, 255, .03); font-size: .65rem }
.cd .tr { text-align: right }
.mono { font-family: 'JetBrains Mono', monospace; font-size: .76rem }
.text-right { text-align: right }

/* ─── BADGES ─── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .66rem; font-weight: 600; letter-spacing: .01em }
.badge-blue { background: rgba(212, 165, 116, .12); color: var(--accent); border: 1px solid rgba(212, 165, 116, .15) }
.badge-orange { background: rgba(255, 140, 50, .12); color: var(--ohm); border: 1px solid rgba(255, 140, 50, .15) }
.badge-green { background: rgba(52, 211, 153, .12); color: var(--green); border: 1px solid rgba(52, 211, 153, .15) }
.badge-red { background: rgba(248, 113, 113, .12); color: var(--red); border: 1px solid rgba(248, 113, 113, .15) }
.badge-yellow { background: rgba(251, 191, 36, .12); color: var(--yellow); border: 1px solid rgba(251, 191, 36, .15) }
.badge-purple { background: rgba(212, 165, 116, .12); color: var(--accent2); border: 1px solid rgba(212, 165, 116, .15) }
.bd { display: inline-block; padding: .1rem .4rem; border-radius: 4px; font-size: .5rem; font-weight: 700 }
.bd.bg { background: rgba(52, 211, 153, .1); color: var(--green); border: 1px solid rgba(52, 211, 153, .12) }
.bd.br { background: rgba(248, 113, 113, .1); color: var(--red); border: 1px solid rgba(248, 113, 113, .12) }
.bd.by { background: rgba(251, 191, 36, .1); color: var(--yellow); border: 1px solid rgba(251, 191, 36, .12) }
.bd.bb { background: rgba(212, 165, 116, .1); color: var(--accent); border: 1px solid rgba(212, 165, 116, .12) }

/* ─── PROGRESS ─── */
.progress-bg { width: 100%; height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden }
.progress-bar { height: 100%; border-radius: 3px; transition: width .8s cubic-bezier(.22, 1, .36, 1); position: relative }
.progress-bar::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 20px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.2)); border-radius: 3px }

/* ─── RANKINGS ─── */
.rank-item { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--border) }
.rank-item:last-child { border: none }
.rank-pos { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: var(--bg4); color: var(--text2) }
.rank-pos.gold { background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(251, 191, 36, .08)); color: var(--yellow); box-shadow: 0 0 10px rgba(251, 191, 36, .15) }
.rank-pos.silver { background: rgba(192, 192, 192, .12); color: var(--silver) }
.rank-pos.bronze { background: rgba(205, 127, 50, .12); color: var(--bronze) }
.rank-name { font-weight: 600; font-size: .88rem; min-width: 80px }
.rank-bar-bg { flex: 2; height: 8px; background: var(--bg4); border-radius: 4px; overflow: hidden }
.rank-bar { height: 100%; border-radius: 4px; transition: width .8s cubic-bezier(.22, 1, .36, 1) }
.rank-val { font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 500; min-width: 50px; text-align: right }

/* ─── CHARTS ─── */
.chart-container { position: relative; height: 220px }

/* ─── QUICK NAV ─── */
.quick-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1.3rem }
.quick-card {
  background: var(--bg2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 1.2rem; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 1rem;
}
.quick-card:hover { background: rgba(212, 165, 116, .05); border-color: var(--border-glow); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.2) }
.quick-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0 }
.quick-card h3 { font-size: .88rem; font-weight: 600 }
.quick-card span { font-size: .72rem; color: var(--text2) }

/* ─── BUTTONS ─── */
.bp {
  background: var(--accent); color: #fff; border: none;
  padding: .6rem 1.2rem; border-radius: 10px;
  font-family: inherit; font-size: .72rem; font-weight: 700; cursor: pointer;
  transition: all .2s;
}
.bp:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(212,165,116,.25); transform: translateY(-1px); }
.bp:active { transform: translateY(0); box-shadow: none; }
.bp-outline {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
  padding: .55rem 1.1rem; border-radius: 10px;
  font-family: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.bp-outline:hover { background: rgba(212,165,116,.08); }
.bp-danger {
  background: transparent; color: var(--red); border: 1px solid rgba(239,68,68,.3);
  padding: .55rem 1.1rem; border-radius: 10px;
  font-family: inherit; font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.bp-danger:hover { background: var(--red); color: #fff; }
.ba {
  background: none; border: 1px solid var(--border2); color: var(--text2);
  padding: .3rem .6rem; border-radius: 6px; font-family: inherit; font-size: .6rem;
  cursor: pointer; transition: all .2s;
}
.ba:hover { background: rgba(212,165,116,.06); color: var(--accent); border-color: rgba(212,165,116,.2); }
.hb {
  background: var(--accent); color: #fff; text-align: center;
  padding: .6rem; border-radius: 10px;
  font-size: .68rem; font-weight: 700; margin-top: .5rem; cursor: pointer;
  border: none; width: 100%; font-family: inherit; transition: all .2s;
}
.hb:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(212,165,116,.25); transform: translateY(-1px); }

/* ─── INPUTS ─── */
.fi {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem .85rem; color: var(--text);
  font-family: inherit; font-size: .78rem;
  outline: none; transition: all .2s; -webkit-appearance: none;
}
.fi:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212,165,116,.15); }
.fi::placeholder { color: var(--text3); font-style: italic; }
select.fi {
  appearance: none; cursor: pointer;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
textarea.fi { resize: vertical; min-height: 60px; }
.search-bar {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem 1rem .7rem 2.4rem; color: var(--text); font-family: inherit; font-size: .78rem;
  width: 100%; max-width: 360px; outline: none; transition: all .2s;
}
.search-bar:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212,165,116,.15); }
.search-bar::placeholder { color: var(--text3); font-style: italic; }

/* ─── PILLS / FILTERS ─── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: transparent; border: 1px solid var(--border); border-radius: 20px;
  padding: .45rem 1rem; font-size: .68rem; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .2s; font-family: inherit; white-space: nowrap;
}
.pill:hover { background: rgba(212,165,116,.08); color: var(--text); border-color: rgba(212,165,116,.2); }
.pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(212,165,116,.2);
}

/* ─── PLACEHOLDER ─── */
.placeholder { border: 1px dashed var(--border2); border-radius: var(--radius); padding: 3rem 2rem; text-align: center; color: var(--text3) }

/* ─── CREDENTIALS ─── */
.cred-user { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .95rem; margin-bottom: .4rem }
.cred-user-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer }
.cred-user-header span:first-child { font-weight: 600; font-size: .85rem }
.cred-details { display: none; margin-top: .6rem }
.cred-details.open { display: flex; flex-direction: column; gap: .4rem }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem }
.cred-row small { font-size: .62rem; color: var(--text3); text-transform: uppercase; letter-spacing: .06em }
.cred-row code { font-family: 'JetBrains Mono', monospace; font-size: .76rem; word-break: break-all }
.copy-btn { background: var(--bg4); border: 1px solid var(--border2); color: var(--accent); border-radius: 6px; padding: 3px 12px; font-size: .64rem; cursor: pointer; font-family: inherit; flex-shrink: 0; transition: all .2s }
.copy-btn:hover { background: rgba(212, 165, 116, .1); border-color: var(--accent-glow) }
.copy-btn.ok { background: rgba(52, 211, 153, .12); color: var(--green); border-color: rgba(52, 211, 153, .2) }

/* ─── LINK CARDS ─── */
.link-card {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem;
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: all var(--transition); cursor: pointer;
}
.link-card:hover { background: rgba(212, 165, 116, .04); border-color: var(--border-glow); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.2) }
.link-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: var(--white); flex-shrink: 0 }
.link-card h3 { font-size: .9rem; font-weight: 600 }
.link-card span { font-size: .72rem; color: var(--text2) }

/* audit-* classes removed (dead code) */

/* ─── PIN LOCK ─── */
.pin-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--bg4); border: 1.5px solid var(--border2); transition: all .2s }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow) }
.pin-dot.error { background: var(--red); border-color: var(--red); box-shadow: 0 0 8px var(--red-glow) }
.pin-dot.success { background: var(--green); border-color: var(--green); box-shadow: 0 0 8px var(--green-glow) }
.pin-key {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg3);
  border: 1px solid var(--border2); color: var(--text); font-family: inherit;
  font-size: 1.3rem; font-weight: 600; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.pin-key:hover { background: var(--bg4); border-color: var(--accent-glow); box-shadow: 0 0 12px rgba(212, 165, 116, .08) }
.pin-key:active { background: var(--accent); color: #fff; transform: scale(.93) }

/* ─── HOVER CARD ─── */
.hover-card { transition: all var(--transition); cursor: pointer }
.hover-card:hover { border-color: var(--accent) !important; box-shadow: 0 6px 24px rgba(212, 165, 116, .12); transform: translateY(-2px) }
.hover-card:active { transform: translateY(0); box-shadow: none }

/* ─── MODALS ─── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); z-index: 200; align-items: center; justify-content: center; padding: 1rem }
.modal-overlay.open { display: flex }
.modal {
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: 16px; width: 100%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; padding: 1.5rem; box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.modal-title { font-family: var(--font-ui); font-size: 1.15rem; font-weight: 700; margin-bottom: .3rem }
.modal-sub { font-size: .8rem; color: var(--text2); margin-bottom: 1.2rem }
.modal-form { display: flex; flex-direction: column; gap: .7rem }
.modal-row { display: flex; gap: .6rem }
.modal-row > * { flex: 1 }
.modal-group { display: flex; flex-direction: column; gap: .25rem }
.modal-group label { font-size: .66rem; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; font-weight: 600 }
.modal-group input, .modal-group select, .modal-group textarea { background: rgba(6, 8, 13, .5); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: .52rem .7rem; color: var(--text); font-family: inherit; font-size: .82rem; outline: none; transition: all .25s }
.modal-group input:focus, .modal-group select:focus, .modal-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 165, 116, .1) }
.modal-group select option { background: var(--bg2) }
.modal-group textarea { resize: vertical; min-height: 50px }
.modal-group input[readonly] { color: var(--text3); background: var(--bg4) }
.modal-actions { display: flex; gap: .6rem; margin-top: .8rem }
.modal-btn { flex: 1; padding: .7rem; border-radius: var(--radius-sm); font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .2s; border: none }
.modal-btn-submit { background: linear-gradient(135deg, var(--green), #10b981); color: #fff }
.modal-btn-submit:hover { box-shadow: 0 4px 16px var(--green-glow); transform: translateY(-1px) }
.modal-btn-cancel { background: var(--bg3); color: var(--text); border: 1px solid var(--border2) }
.modal-btn-cancel:hover { background: var(--bg4) }

.mo { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity .3s }
.mo.open { opacity: 1; pointer-events: all }
.md { background: var(--bg2); border: 1px solid var(--glass-border); border-radius: 18px; width: 100%; max-width: 460px; padding: 2rem; position: relative; transform: translateY(15px) scale(.97); transition: all .3s cubic-bezier(.22, 1, .36, 1); box-shadow: 0 24px 64px rgba(0,0,0,.5) }
.mo.open .md { transform: translateY(0) scale(1) }
.md-close { position: absolute; top: .85rem; right: .85rem; background: none; border: none; color: var(--text3); font-size: 1.1rem; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all .15s }
.md-close:hover { background: var(--bg4); color: var(--text) }
.md h3 { font-family: var(--font-ui); font-size: 1.15rem; font-weight: 700; margin-bottom: 1.2rem }
.fg { margin-bottom: .9rem }
.fg label, .fl { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); font-weight: 600; margin-bottom: .35rem; }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem }
.md-submit {
  width: 100%;
  background: var(--accent);
  color: var(--white); border: none; padding: .72rem; border-radius: 10px;
  font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
  margin-top: .5rem; transition: all .2s;
}
.md-submit:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(212,165,116,.25); transform: translateY(-1px); }

/* ─── COMPTA ─── */
.co-tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 22px; background: rgba(31, 27, 23, 0.5); border: 1px solid var(--border); border-radius: 999px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex-wrap: wrap; }
.co-tabs::-webkit-scrollbar { display: none; }
.co-tabs .pill { font-size: 12px; padding: 8px 16px; white-space: nowrap; border-radius: 999px; font-weight: 500; transition: all 0.2s; background: transparent; border: none; color: var(--text2); cursor: pointer; font-family: var(--font-ui); }
.co-tabs .pill:hover { color: var(--text); background: rgba(212, 165, 116, 0.04); }
.co-tabs .pill.active { background: linear-gradient(180deg, var(--gold-bright, #E8B775), var(--gold-deep, #A67C4D)); color: #1A1310; font-weight: 600; box-shadow: 0 2px 8px rgba(232, 183, 117, 0.20); }
.co-tab { display: none } .co-tab.active { display: block }
.rv-view { display: none } .rv-view.active { display: block }
.ch-view { display: none } .ch-view.active { display: block }
#chargesCatGrid { background: var(--bg-opaque); border-radius: var(--radius); padding: .2rem; }
#ch-mois .cd { background: var(--bg-opaque); backdrop-filter: none; -webkit-backdrop-filter: none; }
.co-amount-pos { color: var(--green); font-weight: 700; }
.co-amount-neg { color: var(--red); font-weight: 700; }
.grav-haute { color: var(--red); font-weight: 700 }
.grav-moyenne { color: var(--yellow); font-weight: 600 }
.grav-basse { color: var(--text3); font-weight: 500 }

/* ─── AI AGENTS ─── */
.agent-card {
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: .75rem; cursor: pointer;
  transition: all var(--transition);
}
.agent-card:hover { border-color: rgba(212, 165, 116, .2); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.2) }
.agent-card.active { border-color: var(--accent); background: rgba(212, 165, 116, .06); box-shadow: 0 0 16px rgba(212, 165, 116, .08) }
.agent-card-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem }
.agent-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0 }
.agent-info { flex: 1; min-width: 0 }
.agent-name { font-family: var(--font-ui); font-weight: 700; font-size: .76rem }
.agent-role { font-size: .52rem; color: var(--text3) }
.agent-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
.agent-status.online { background: var(--green); box-shadow: 0 0 8px var(--green-glow), 0 0 2px var(--green) }
.agent-status.offline { background: var(--red); box-shadow: 0 0 8px var(--red-glow) }
.agent-desc { font-size: .58rem; color: var(--text2); margin-bottom: .4rem; line-height: 1.4 }
.agent-tags { display: flex; gap: .25rem; flex-wrap: wrap }
.agent-tags span { background: var(--bg4); color: var(--text3); font-size: .44rem; padding: .12rem .38rem; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em }
.ai-msg { display: flex; gap: .5rem; align-items: flex-start; animation: fadeIn .25s; max-width: 90%; }
.ai-msg.ai-bot { align-self: flex-start; }
.ai-msg.ai-user { align-self: flex-end; flex-direction: row-reverse; }
.ai-av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #818cf8); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .7rem; color: #fff; flex-shrink: 0; font-family: var(--font-ui); }
.ai-av-u { background: var(--bg3); color: var(--text2); }
.ai-bbl { padding: .6rem .85rem; border-radius: 12px; font-size: .75rem; line-height: 1.6; background: var(--bg3); border: 1px solid var(--border); color: var(--text); }
.ai-bbl-u { background: var(--accent); border-color: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.ai-msg.ai-bot .ai-bbl { border-bottom-left-radius: 3px; }
.ai-bbl strong { color: var(--accent); }
.ai-bbl-u strong { color: var(--white); }
.ai-typing { display: flex; gap: 4px; padding: 4px 0; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text3); animation: aiDot 1.2s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%,80%,100%{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.1)} }
.ai-action-bar { display: flex; gap: .3rem; }
.ai-suggest { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .65rem; font-size: .6rem; color: var(--text2); cursor: pointer; font-family: inherit; transition: all .2s; text-align: left }
.ai-suggest:hover { border-color: var(--accent); color: var(--accent); background: rgba(212, 165, 116, .06) }

/* ─── LEAFLET MAP ─── */
#sectMap { position: relative; z-index: 0 }
.leaflet-pane { z-index: 1 !important }
.leaflet-top, .leaflet-bottom { z-index: 2 !important }

/* ─── TOGGLE ─── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0 }
.toggle input { opacity: 0; width: 0; height: 0 }
.toggler { position: absolute; cursor: pointer; inset: 0; background: var(--bg4); border-radius: 22px; transition: .25s }
.toggler:before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: var(--text3); border-radius: 50%; transition: .25s }
.toggle input:checked + .toggler { background: var(--accent) }
.toggle input:checked + .toggler:before { transform: translateX(18px); background: var(--white) }

/* ─── FORM EDITOR ─── */
.form-item { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .65rem .85rem; cursor: pointer; transition: all .2s }
.form-item:hover { border-color: rgba(212, 165, 116, .2) }
.form-item.active { border-color: var(--accent); background: rgba(212, 165, 116, .06); box-shadow: 0 0 10px rgba(212, 165, 116, .06) }
.form-item-name { font-size: .72rem; font-weight: 600 }
.form-item-count { font-size: .55rem; color: var(--text3); margin-top: .1rem }
.form-field { display: flex; align-items: center; gap: .6rem; padding: .52rem .65rem; border-bottom: 1px solid var(--border); transition: opacity .2s }
.form-field.disabled { opacity: .4 }
.ff-drag { color: var(--text3); font-size: .7rem; cursor: grab; user-select: none; width: 16px; flex-shrink: 0 }
.ff-info { flex: 1; min-width: 0 }
.ff-name { font-size: .72rem; font-weight: 600 }
.ff-req { font-size: .5rem; color: var(--accent); font-weight: 600 }
.ff-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0 }

/* ─── PLANNING ─── */
#page-planning { margin: 0 -1.5rem; padding: 0 1.5rem; max-width: none; width: calc(100% + 3rem) }
#page-planning #plan-grid { width: 100% }

/* ─── TOAST & SUCCESS ─── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--green), #059669); color: #fff;
  padding: .75rem 1.6rem; border-radius: 50px; font-size: .78rem; font-weight: 600;
  z-index: 300; animation: toastIn .4s cubic-bezier(.22, 1, .36, 1); pointer-events: none;
  box-shadow: 0 8px 24px rgba(52, 211, 153, .25);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px) } to { opacity: 1; transform: translate(-50%, 0) } }

.success-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; pointer-events: none }
.success-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.5);
  background: var(--bg2); border: 2px solid var(--green);
  border-radius: 22px; padding: 2rem 2.5rem; text-align: center;
  animation: successIn .4s cubic-bezier(.34, 1.56, .64, 1) forwards; z-index: 1000; pointer-events: none;
  box-shadow: 0 0 40px var(--green-glow);
}
.success-box.out { animation: successOut .3s ease forwards }
.success-box svg { width: 64px; height: 64px; margin-bottom: .6rem }
.success-box .success-circle { stroke: var(--success); stroke-width: 3; fill: none; stroke-dasharray: 314; stroke-dashoffset: 314; animation: circleDraw .5s .1s ease forwards }
.success-box .success-check { stroke: var(--success); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: checkDraw .4s .4s ease forwards }
.success-box .success-msg { font-weight: 700; font-size: .95rem; color: var(--text); margin-top: .2rem }
.success-box .success-sub { font-size: .72rem; color: var(--green); margin-top: .2rem }
.btn-success-pulse { animation: successPulse .6s ease }
@keyframes successIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5) } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1) } }
@keyframes successOut { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1) } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.85) } }
@keyframes checkDraw { to { stroke-dashoffset: 0 } }
@keyframes circleDraw { to { stroke-dashoffset: 0 } }
@keyframes successPulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .4) } 70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0) } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0) } }

/* ═══ LIGHT MODE ═══ */
/* body.light removed — use [data-theme="light"] only */

/* ═══ PREMIUM EFFECTS ═══ */

/* Animated background gradient */
@keyframes bgShift {
  0% { background-position: 50% 0% }
  50% { background-position: 50% 100% }
  100% { background-position: 50% 0% }
}
body:not(.light) {
  background-size: 100% 400%;
  animation: bgShift 45s ease-in-out infinite;
}

/* 3D card tilt on hover */
.stat-card:hover, .sc:hover, .quick-card:hover, .agent-card:hover, .weekly-card:hover {
  transform: perspective(600px) rotateX(1deg) rotateY(-1.5deg) translateY(-2px);
}
.hover-card:hover {
  transform: perspective(600px) rotateX(1.5deg) rotateY(-2deg) translateY(-2px) !important;
}

/* Sidebar logo glow pulse */
/* sb-avatar + logoGlow removed (replaced by .brand-mark) */

/* Sidebar active item animated gradient */
.sb-it.active {
  background: linear-gradient(90deg, rgba(232, 183, 117, .14), rgba(212, 165, 116, .04));
  box-shadow: inset 0 0 0 1px var(--border2), inset 0 0 30px rgba(212, 165, 116, .08);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { box-shadow: inset 0 0 0 1px var(--border2), inset 0 0 30px rgba(212, 165, 116, .05); }
  50% { box-shadow: inset 0 0 0 1px rgba(212, 165, 116, .28), inset 0 0 40px rgba(212, 165, 116, .15); }
}
@keyframes activeShimmer {
  0% { background-position: 200% 0 }
  100% { background-position: -200% 0 }
}

/* Animated gradient buttons */
.bp-animated {
  background: linear-gradient(135deg, var(--accent), var(--accent2), #9b6cff, var(--accent)) !important;
  background-size: 300% 300% !important;
  animation: gradientMove 4s ease infinite;
}
@keyframes gradientMove {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

/* Table row stagger animation (from effects.js) */
.sr-init { opacity: 0; transform: translateY(8px); transition: all .3s cubic-bezier(.22, 1, .36, 1) }
.sr-in { opacity: 1; transform: translateY(0) }

/* Enhanced toast with progress bar */
.toast {
  box-shadow: 0 12px 32px rgba(52, 211, 153, .3);
  overflow: hidden;
}
.toast::after {
  content: ''; position: absolute; bottom: 0; left: 0; height: 3px;
  background: rgba(255,255,255,.4); border-radius: 0 0 50px 50px;
  animation: toastProgress 2.4s linear forwards;
}
@keyframes toastProgress { from { width: 100% } to { width: 0% } }

/* Enhanced modal transitions */
.mo .md {
  box-shadow: 0 32px 80px rgba(0,0,0,.5), 0 0 1px rgba(255,255,255,.1) inset;
}
.modal-overlay.open .modal {
  animation: modalIn .35s cubic-bezier(.22, 1, .36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.94) translateY(12px) }
  to { opacity: 1; transform: scale(1) translateY(0) }
}

/* Enhanced input focus glow */
.fi:focus, .modal-group input:focus, .modal-group select:focus, .modal-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, .15), 0 0 12px rgba(212, 165, 116, .06);
}

/* Particle from effects.js */
.sat-particle {
  position: fixed; pointer-events: none; z-index: 1001;
  border-radius: 50%; will-change: transform, opacity;
  transition: all .6s cubic-bezier(.22, 1, .36, 1);
}

/* S loader overlay */
.sat-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg); display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity .4s;
}
.sat-loader.fade-out { opacity: 0; pointer-events: none }
.sat-loader svg { filter: drop-shadow(0 0 20px var(--accent-glow)) }
@keyframes drawS {
  to { stroke-dashoffset: 0 }
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 12px var(--accent-glow)) }
  50% { filter: drop-shadow(0 0 30px var(--accent-glow)) drop-shadow(0 0 60px rgba(212,165,116,.15)) }
}
@keyframes shakeS {
  0%, 100% { transform: translateX(0) }
  20%, 60% { transform: translateX(-6px) }
  40%, 80% { transform: translateX(6px) }
}

/* Success S animation */
.sat-success-s { animation: drawS 0.6s ease forwards, glowPulse 1s .6s ease infinite }
.sat-error-s { animation: drawS 0.4s ease forwards, shakeS 0.4s .4s ease }

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body:not(.light) { animation: none }
  .sb-avatar { animation: none }
  .sb-it.active { animation: none }
  .bp-animated { animation: none !important }
}

/* ═══ RESPONSIVE TABLET ═══ */
@media(max-width:1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; gap: .8rem !important }
  .sg { grid-template-columns: repeat(2, 1fr) !important; gap: .8rem !important }
  .grid-2 { grid-template-columns: 1fr !important }
  .grid-3 { grid-template-columns: 1fr 1fr !important }
  .dir-top { padding: .5rem 1rem }
  .main { padding: 1rem }
  table { font-size: .68rem }
  th, td { padding: .35rem .45rem }
  .cd { padding: .65rem .75rem }
  .co-tab .cd { overflow-x: auto }
}

/* ═══ RESPONSIVE MOBILE ═══ */
@media(max-width:768px) {
  .sidebar { display: none }
  .sidebar.collapsed { display: flex }
  .sidebar:not(.collapsed) { display: flex; transform: translateX(0) }
  .dir-main, .dir-main.expanded { margin-left: 0 }
}
@media(max-width:600px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: .65rem !important }
  .sg { grid-template-columns: 1fr 1fr !important; gap: .65rem !important }
  .stat-card { padding: .9rem 1rem }
  .stat-value { font-size: 1.3rem !important }
  .stat-label { font-size: .5rem }
  .sc { padding: .85rem .9rem }
  .sv { font-size: 1.15rem !important }
  .sl { font-size: .48rem }
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; gap: .5rem !important }
  .main { padding: .65rem }
  .dir-top { padding: .4rem .7rem }
  .dir-top-t { font-size: .74rem }
  .section-title { font-size: .65rem }
  .card, .cd { border-radius: 11px; margin-bottom: .6rem }
  .wl { flex-direction: column; gap: .5rem }
  .wl h2 { font-size: .9rem }
  table { font-size: .6rem }
  th, td { padding: .25rem .3rem; white-space: nowrap }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
  .ch { height: 180px !important }
  .pill { font-size: .55rem; padding: .25rem .5rem }
  .bp { font-size: .65rem; padding: .42rem .8rem }
  .fi { font-size: .7rem; padding: .45rem .6rem }
  .fg label { font-size: .55rem }
  .fr { flex-direction: column }
  .modal { max-width: 95vw !important; margin: .5rem; max-height: 90vh; overflow-y: auto }
  .modal-form { padding: 1rem }
  .md-submit { font-size: .72rem; padding: .55rem }
  .ba { font-size: .5rem; padding: 2px 6px }
  .bd { font-size: .5rem; padding: .12rem .3rem }
  .toast { font-size: .68rem; padding: .55rem 1rem; bottom: 1rem }
  .progress-bg { height: 4px }
  #login-screen > div { padding: 0 1rem }
  .sidebar { width: 220px }
  .sb-it { font-size: .7rem; padding: .5rem .7rem }
  .sb-sec { font-size: .46rem; padding: .6rem .7rem .2rem }
  .agent-card { padding: .6rem }
  #agentChatPanel { width: 100% !important; max-width: none !important }
  .weekly-card { padding: .6rem .8rem }
  .weekly-amount { font-size: 1rem }
  .sg { grid-template-columns: repeat(2, 1fr) }
}

/* ═══ SMALL MOBILE ═══ */
@media(max-width:380px) {
  .stats-grid { grid-template-columns: 1fr !important }
  .stat-card { padding: .65rem .75rem }
  .stat-value { font-size: 1.1rem !important }
  .main { padding: .4rem }
  table { font-size: .52rem }
  th, td { padding: .2rem .25rem }
  .pill { font-size: .48rem; padding: .2rem .4rem }
  .modal { margin: .3rem }
  .sg { grid-template-columns: 1fr }
}

/* ═══ SMS — PREMIUM UX ═══ */

/* Tabs */
.mailing-tab-btn { transition: all .2s; }
.mailing-tab-btn.active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }
.mailing-tab-btn:hover:not(.active) { color: var(--text2) !important; }

/* ── Step bar ── */
.sms-steps-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 1.8rem; padding: 1.2rem 1.5rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sms-step-indicator {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
}
.sms-step-num {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .88rem;
  background: var(--bg3); color: var(--text3);
  border: 2px solid var(--border); transition: all .3s;
}
.sms-step-indicator.active .sms-step-num {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 0 20px rgba(212,165,116,.35);
}
.sms-step-indicator.done .sms-step-num {
  background: var(--green); color: #fff; border-color: var(--green);
  box-shadow: 0 0 12px rgba(52,211,153,.25);
}
.sms-step-label {
  font-size: .62rem; color: var(--text3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.sms-step-indicator.active .sms-step-label { color: var(--accent); }
.sms-step-indicator.done .sms-step-label { color: var(--green); }
.sms-step-line {
  flex: 1; max-width: 100px; height: 2px;
  background: var(--border); margin: 0 .6rem; margin-bottom: 1.4rem;
  transition: background .4s;
}
.sms-step-line.done { background: var(--green); }

.sms-step-content { display: none; }
.sms-step-content.active { display: block; animation: fadeIn .35s ease; }

/* ── Step header ── */
.sms-step-header { margin-bottom: 1.2rem; }
.sms-step-title {
  font-family: var(--font-ui); font-weight: 700; font-size: 1rem;
  margin-bottom: .2rem;
}
.sms-step-sub { font-size: .7rem; color: var(--text3); }

/* ── Template cards ── */
.sms-templates-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .8rem;
}
.sms-template-card {
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; cursor: pointer;
  transition: all .25s ease; position: relative; overflow: hidden;
}
.sms-template-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--tpl-color, var(--accent)); opacity: 0; transition: opacity .25s;
}
.sms-template-card:hover {
  border-color: var(--tpl-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.sms-template-card:hover::before { opacity: 1; }
.sms-template-card.selected {
  border-color: var(--accent);
  background: rgba(212,165,116,.04);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(212,165,116,.12);
}
.sms-template-card.selected::before { opacity: 1; background: var(--accent); }
.sms-tpl-top {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
}
.sms-tpl-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.sms-tpl-badge { flex: 1; }
.sms-tpl-check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 800; flex-shrink: 0;
  animation: fadeIn .2s ease;
}
.sms-tpl-name {
  font-weight: 700; font-size: .82rem; font-family: var(--font-ui);
  margin-bottom: .35rem;
}
.sms-tpl-preview { font-size: .65rem; color: var(--text3); line-height: 1.55; }

/* ── Filter cards (step 2) ── */
.sms-filter-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
  margin-bottom: 1rem;
}
.sms-filter-card {
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .5rem;
  text-align: center; cursor: pointer; transition: all .2s;
}
.sms-filter-card:hover { border-color: var(--accent); background: rgba(212,165,116,.03); }
.sms-filter-card.active {
  border-color: var(--accent); background: rgba(212,165,116,.06);
  box-shadow: 0 0 0 1px var(--accent);
}
.sms-filter-icon { font-size: 1.3rem; margin-bottom: .25rem; }
.sms-filter-label { font-size: .62rem; font-weight: 700; line-height: 1.3; }
.sms-filter-count {
  font-family: var(--font-ui); font-weight: 800; font-size: .82rem;
  color: var(--accent); margin-top: .2rem;
}
.sms-filter-card.active .sms-filter-count { color: var(--accent); }

/* ── Search + controls (step 2) ── */
.sms-recip-controls { margin-bottom: .8rem; }
.sms-search-wrap {
  position: relative; margin-bottom: .5rem;
}
.sms-search-icon {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  font-size: .72rem; pointer-events: none;
}
.sms-search-input {
  width: 100%; padding: .6rem .8rem .6rem 2.2rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .78rem; outline: none; transition: border-color .2s;
}
.sms-search-input:focus { border-color: var(--accent); }
.sms-select-actions {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.sms-select-btn {
  padding: .3rem .7rem; font-size: .62rem; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text2); cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.sms-select-btn:hover { border-color: var(--accent); color: var(--accent); }
.sms-count-badge {
  font-size: .65rem; font-weight: 700; color: var(--accent);
  background: rgba(212,165,116,.08); padding: .3rem .8rem;
  border-radius: 20px; white-space: nowrap; margin-left: auto;
}
.sms-count-num {
  font-family: var(--font-ui); font-size: .78rem;
}

/* ── Client list ── */
.sms-clients-list {
  max-height: 380px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2);
}
.sms-client-row {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem;
  cursor: pointer; transition: background .12s;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.sms-client-row:last-child { border-bottom: none; }
.sms-client-row:hover { background: rgba(255,255,255,.02); }
.sms-client-row.selected { background: rgba(212,165,116,.04); }
.sms-client-check { flex-shrink: 0; }
.sms-check-inner {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 800; color: var(--white);
  transition: all .15s;
}
.sms-client-row.selected .sms-check-inner {
  background: var(--accent); border-color: var(--accent);
}
.sms-client-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .72rem;
  flex-shrink: 0;
}
.sms-client-info { flex: 1; min-width: 0; }
.sms-client-name { font-weight: 600; font-size: .75rem; }
.sms-client-tel { font-size: .62rem; color: var(--text3); }
.sms-no-tel { color: var(--red); font-size: .58rem; }
.sms-client-offre { flex-shrink: 0; }
.sms-empty-list {
  text-align: center; padding: 2rem; color: var(--text3);
  font-size: .75rem;
}
.sms-empty-icon { font-size: 1.5rem; margin-bottom: .3rem; }

/* ── Navigation bar ── */
.sms-nav-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.sms-nav-back {
  padding: .5rem 1rem; font-size: .72rem; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.sms-nav-back:hover { border-color: var(--accent); color: var(--accent); }
.sms-nav-next {
  padding: .6rem 1.4rem; font-size: .75rem; font-weight: 700;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: #fff; cursor: pointer;
  transition: all .2s; font-family: inherit;
  display: flex; align-items: center; gap: .3rem;
}
.sms-nav-next:hover { box-shadow: 0 4px 16px rgba(212,165,116,.3); transform: translateY(-1px); }
.sms-nav-next.disabled {
  background: var(--bg3); color: var(--text3); cursor: not-allowed;
  box-shadow: none; transform: none;
}
.sms-nav-arrow { font-size: .85rem; }

/* ── Preview (step 3) ── */
.sms-preview-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-bottom: 1.2rem;
}
.sms-preview-col { }
.sms-preview-label {
  font-size: .62rem; color: var(--text3); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700; margin-bottom: .6rem;
}

/* Phone frame */
.sms-phone-frame {
  background: var(--sms-header-bg); border: 2px solid rgba(255,255,255,.08);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.sms-phone-header {
  display: flex; gap: 4px; padding: .4rem .6rem;
  background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.04);
}
.sms-phone-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.15);
}
.sms-phone-screen { padding: .8rem; }
.sms-bubble-time {
  text-align: center; font-size: .55rem; color: var(--text3);
  margin-bottom: .6rem;
}
.sms-bubble {
  background: linear-gradient(135deg, var(--success-light), var(--success));
  color: var(--white); padding: .8rem 1rem; border-radius: 14px 14px 4px 14px;
  font-size: .72rem; line-height: 1.6;
  box-shadow: 0 4px 12px rgba(52,211,153,.15);
  max-width: 95%;
}
.sms-preview-info {
  font-size: .65rem; color: var(--text3); margin-top: .6rem;
  text-align: center;
}

/* Recap list */
.sms-recap-list {
  max-height: 280px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2);
}
.sms-recap-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .7rem; border-bottom: 1px solid rgba(255,255,255,.02);
}
.sms-recap-row:last-child { border-bottom: none; }
.sms-recap-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .58rem; flex-shrink: 0;
}
.sms-recap-name { font-size: .68rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-recap-tel { font-size: .62rem; color: var(--text3); flex-shrink: 0; }

/* Warnings & notices */
.sms-warning {
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.15);
  border-radius: var(--radius-sm); padding: .6rem .8rem;
  font-size: .7rem; color: var(--orange); margin-bottom: .8rem;
}
.sms-desktop-notice {
  background: rgba(212,165,116,.04); border: 1px solid rgba(212,165,116,.1);
  border-radius: var(--radius); padding: 1.2rem;
  text-align: center; margin-bottom: .8rem;
}
.sms-desktop-icon { font-size: 2rem; margin-bottom: .4rem; }
.sms-desktop-text { font-size: .75rem; color: var(--text2); line-height: 1.5; }

/* Send button */
.sms-send-btn {
  width: 100%; padding: .85rem; font-size: .88rem; font-weight: 700;
  background: linear-gradient(135deg, var(--success-light), var(--success));
  color: #fff; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .2s; font-family: inherit;
  margin-bottom: .4rem;
  box-shadow: 0 4px 16px rgba(52,211,153,.2);
}
.sms-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52,211,153,.3);
}
.sms-send-btn:active { transform: translateY(0); }
.sms-send-test {
  background: var(--bg3); color: var(--text2);
  box-shadow: none; border: 1px solid var(--border);
}
.sms-send-test:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* ── History ── */
.sms-history-empty {
  text-align: center; padding: 2rem; color: var(--text3);
  font-size: .75rem; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.sms-history-list {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); overflow: hidden;
}
.sms-history-item {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .1s;
}
.sms-history-item:last-child { border-bottom: none; }
.sms-history-item:hover { background: rgba(255,255,255,.02); }
.sms-hist-left { flex-shrink: 0; }
.sms-hist-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(52,211,153,.08); display: flex;
  align-items: center; justify-content: center; font-size: .85rem;
}
.sms-hist-mid { flex: 1; min-width: 0; }
.sms-hist-tpl { font-weight: 600; font-size: .72rem; }
.sms-hist-names { font-size: .62rem; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-hist-right { text-align: right; flex-shrink: 0; }
.sms-hist-count { font-weight: 700; font-size: .7rem; }
.sms-hist-date { font-size: .58rem; color: var(--text3); }

/* ── Config (settings page) ── */
.sms-tpl-config-row {
  display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem;
  border-bottom: 1px solid var(--border); background: var(--bg2);
  border-radius: var(--radius-sm); margin-bottom: .3rem;
}

/* ── Responsive ── */
@media(max-width:768px) {
  .sms-templates-grid { grid-template-columns: repeat(2, 1fr); }
  .sms-filter-grid { grid-template-columns: repeat(2, 1fr); }
  .sms-preview-layout { grid-template-columns: 1fr; }
  .sms-step-line { max-width: 50px; }
}
@media(max-width:500px) {
  .sms-templates-grid { grid-template-columns: 1fr; }
  .sms-filter-grid { grid-template-columns: 1fr 1fr; }
  .sms-steps-bar { padding: .8rem .5rem; }
  .sms-step-num { width: 32px; height: 32px; font-size: .75rem; }
  .sms-step-label { font-size: .5rem; }
  .sms-step-line { max-width: 30px; }
}

/* ═══ ACTUALITES ENERGIE ═══ */
.actu-section { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin-bottom: .8rem; }
.actu-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; gap: .3rem; }
.actu-hdr-title { font-family: var(--font-ui); font-weight: 700; font-size: .85rem; }

/* Article */
.actu-heading { font-family: var(--font-ui); font-weight: 700; font-size: .8rem; color: var(--accent); margin: .7rem 0 .25rem; }
.actu-p { font-size: .75rem; line-height: 1.8; color: var(--text); margin-bottom: .5rem; }
.actu-bullet { font-size: .73rem; line-height: 1.7; color: var(--text); padding-left: .8rem; position: relative; margin-bottom: .3rem; }
.actu-bullet::before { content: '›'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.actu-num { font-weight: 700; color: var(--accent); font-size: .78rem; }
.actu-meta { font-size: .58rem; color: var(--text3); margin-top: .6rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.actu-stale { font-size: .6rem; color: var(--orange); margin-top: .3rem; padding: .3rem .5rem; background: rgba(245,158,11,.04); border: 1px solid rgba(245,158,11,.1); border-radius: 4px; }
.actu-banner { font-size: .6rem; color: var(--accent); padding: .25rem .5rem; background: rgba(212,165,116,.04); border-radius: 4px; margin-bottom: .4rem; text-align: center; }

/* Skeleton */
.skel-wrap { padding: .3rem 0; }
.skel-line { height: 11px; background: linear-gradient(90deg, var(--bg3) 25%, rgba(212,165,116,.05) 50%, var(--bg3) 75%); background-size: 200% 100%; border-radius: 3px; margin-bottom: 8px; animation: skelPulse 1.5s ease infinite; }
@keyframes skelPulse { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Prix — split charts */
.prix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
.prix-col { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem; }
.prix-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: .5rem; }
.prix-current { }
.prix-val { font-family: var(--font-ui); font-weight: 800; font-size: 1.4rem; }
.prix-val-elec { color: var(--elec-color); }
.prix-val-gaz { color: var(--gaz-color); }
.prix-unit { font-size: .6rem; color: var(--text3); margin-left: .15rem; }
.prix-var { font-size: .6rem; }
.prix-chart-wrap { height: 160px; position: relative; }
.prix-recap { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.prix-recap-card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.prix-recap-label { font-size: .6rem; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.prix-recap-val { font-weight: 700; font-size: .78rem; }
.prix-recap-elec .prix-recap-val { color: var(--elec-color); }
.prix-recap-gaz .prix-recap-val { color: var(--gaz-color); }
.prix-recap-change { font-size: .58rem; }
.var-up { color: var(--red); font-weight: 600; }
.var-down { color: var(--green); font-weight: 600; }
.var-flat { color: var(--text3); font-weight: 600; }

/* Tarifs table */
.tarif-table { width: 100%; font-size: .7rem; border-collapse: collapse; }
.tarif-table th { font-size: .58rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); padding: .5rem .5rem; border-bottom: 2px solid var(--border); font-weight: 700; white-space: nowrap; }
.tarif-table td { padding: .5rem .5rem; border-bottom: 1px solid rgba(255,255,255,.03); vertical-align: middle; }
.tarif-table tr:hover { background: rgba(212,165,116,.02); }
.apf-row { transition: background .15s; }
.apf-row:hover { background: rgba(212,165,116,.08) !important; cursor: pointer; }
#page-apf tbody tr { transition: background .15s; }
#page-apf tbody tr:hover { background: rgba(212,165,116,.06) !important; }
.tarif-best { background: rgba(52,211,153,.03) !important; }
.tarif-rank-cell { font-weight: 700; font-size: .7rem; color: var(--text3); width: 30px; text-align: center; }
.tarif-name-cell { font-weight: 700; font-size: .72rem; white-space: nowrap; }
.tarif-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.tarif-offre-cell { font-size: .63rem; color: var(--text2); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarif-prix-cell { font-size: .75rem; }
.tarif-prix-cell strong { color: var(--accent); }
.tarif-na { color: var(--text3); font-size: .6rem; }
.tarif-nc { color: var(--text3); font-size: .55rem; font-style: italic; }
.tarif-loading { color: var(--accent); font-size: .55rem; font-style: italic; animation: skelPulse 1.5s ease infinite; background: linear-gradient(90deg, var(--accent) 25%, rgba(212,165,116,.4) 50%, var(--accent) 75%); background-size: 200% 100%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Timeline */
.tl { position: relative; padding-left: 20px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: .8rem; }
.tl-dot { position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg2); }
.tl-content { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.tl-title { font-weight: 700; font-size: .75rem; margin-bottom: .2rem; color: var(--accent); }
.tl-body { font-size: .7rem; line-height: 1.6; color: var(--text2); }
.tl-body strong { color: var(--text); }

.prix-col-label { font-size: .6rem; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: .3rem; }

@media(max-width:768px) {
  .prix-grid, .prix-recap { grid-template-columns: 1fr; }
  .actu-section { padding: .8rem; margin-bottom: .6rem; }
  .tarif-offre-cell { max-width: 80px; }
  .prix-val { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN SYSTEM v42.0 — AURORA / DOT GRID / GRAIN
   ═══════════════════════════════════════════════════════════════ */

.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0.45; }
.aurora::before, .aurora::after, .aurora-blob {
  content: ''; position: absolute; border-radius: 50%; will-change: transform;
}
.aurora::before {
  top: -20%; left: -10%; width: 60%; height: 80%;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.18) 0%, rgba(212, 165, 116, 0.08) 30%, transparent 60%);
  filter: blur(80px);
  animation: float-1 28s ease-in-out infinite;
}
.aurora::after {
  bottom: -20%; right: -10%; width: 70%; height: 90%;
  background: radial-gradient(circle, rgba(232, 183, 117, 0.14) 0%, rgba(232, 183, 117, 0.06) 30%, transparent 60%);
  filter: blur(100px);
  animation: float-2 35s ease-in-out infinite;
}
.aurora-blob {
  top: 30%; left: 40%; width: 50%; height: 60%;
  background: radial-gradient(circle, rgba(166, 124, 77, 0.12) 0%, rgba(166, 124, 77, 0.04) 35%, transparent 65%);
  filter: blur(90px);
  animation: float-3 42s ease-in-out infinite;
}
@keyframes float-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8%,12%) scale(1.1); } }
@keyframes float-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-10%,-8%) scale(1.15); } }
@keyframes float-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(5%,-10%) scale(0.95); } }

/* body.light aurora rule removed — handled by [data-theme="light"] */

.dot-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(212, 165, 116, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.83 0 0 0 0 0.65 0 0 0 0 0.45 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ensure content is above aurora */
.dir-layout { position: relative; }
.dir-main { position: relative; z-index: 2; }
#s-loader { z-index: 99999; }
#login-screen { z-index: 999; }

/* ═══ TOPBAR GLASSMORPHISM ENHANCED ═══ */
.dir-top::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px; background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
}

/* ═══ SIDEBAR ACTIVE GLOW BAR ═══ */
.sb-it.active::before {
  content: ''; position: absolute; left: -1px; top: 20%; height: 60%; width: 3px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 14px var(--gold-glow-strong);
}

/* ═══ CARD TOP GLOW LINE ═══ */
.cd::before, .stat-card::before, .sc::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 183, 117, 0.25), transparent);
  z-index: 1;
}

/* ═══ 3D KPI CAROUSEL (page accueil uniquement) ═══ */

.kpi-3d-section {
  position: relative; height: 480px; perspective: 2400px;
  perspective-origin: center 50%; overflow: visible; margin-bottom: 20px;
  mask-image: linear-gradient(180deg, black 0%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 92%, transparent 100%);
}
.kpi-3d-section-header {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px;
}
.kpi-3d-section-header h2 {
  font-family: var(--font-ui); font-weight: 400; font-size: 18px;
  color: var(--text); letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px;
}
.kpi-3d-section-header .auto-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-deep);
  padding: 3px 10px; border: 1px solid var(--border2); border-radius: 999px;
}
.kpi-3d-section-header .auto-tag::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px var(--gold-glow-strong);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}
.kpi-3d-floor {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 1200px; height: 220px;
  background: radial-gradient(ellipse at center, rgba(232, 183, 117, 0.18), transparent 70%);
  filter: blur(50px); z-index: 1; pointer-events: none;
}
.kpi-3d-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 3; transform-style: preserve-3d;
}
.kpi-3d-carousel {
  position: relative; width: 320px; height: 220px;
  transform-style: preserve-3d;
  animation: carousel-spin 90s linear infinite;
}
@keyframes carousel-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

.kpi-3d-card {
  position: absolute; inset: 0; border-radius: 18px; overflow: hidden;
  background: linear-gradient(155deg, rgba(42, 37, 32, 0.95) 0%, rgba(22, 19, 16, 0.95) 100%);
  border: 1px solid var(--border2);
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6), 0 0 40px rgba(232, 183, 117, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 22px; display: flex; flex-direction: column; justify-content: space-between;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  will-change: transform; transform-style: preserve-3d;
  cursor: pointer; transition: filter 0.3s, box-shadow 0.3s, border-color 0.3s;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.kpi-3d-card:hover {
  filter: brightness(1.15) saturate(1.1); border-color: rgba(212, 165, 116, .28);
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6), 0 0 80px rgba(232, 183, 117, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.kpi-3d-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 183, 117, 0.50), transparent);
}
.kpi-3d-card::after {
  content: ''; position: absolute; top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(232, 183, 117, 0.10), transparent 60%);
  pointer-events: none;
}
.kpi-3d-card:nth-child(1) { transform: rotateY(0deg) translateZ(540px); }
.kpi-3d-card:nth-child(2) { transform: rotateY(45deg) translateZ(540px); }
.kpi-3d-card:nth-child(3) { transform: rotateY(90deg) translateZ(540px); }
.kpi-3d-card:nth-child(4) { transform: rotateY(135deg) translateZ(540px); }
.kpi-3d-card:nth-child(5) { transform: rotateY(180deg) translateZ(540px); }
.kpi-3d-card:nth-child(6) { transform: rotateY(225deg) translateZ(540px); }
.kpi-3d-card:nth-child(7) { transform: rotateY(270deg) translateZ(540px); }
.kpi-3d-card:nth-child(8) { transform: rotateY(315deg) translateZ(540px); }

.k3d-head { display: flex; align-items: center; justify-content: space-between; }
.k3d-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold-deep);
}
.k3d-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gold-soft); display: grid; place-items: center;
  color: var(--gold-light); border: 1px solid var(--border2);
}
.k3d-icon svg { width: 16px; height: 16px; stroke-width: 1.7; }
.k3d-value {
  font-family: var(--font-ui); font-weight: 300;
  font-size: 44px; letter-spacing: -0.025em; color: var(--text); line-height: 1;
  display: flex; align-items: baseline; gap: 4px;
}
.k3d-value .unit { font-size: 22px; color: var(--gold); font-weight: 300; }
.k3d-trend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }
.k3d-trend-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.k3d-trend-pill.up { background: rgba(143, 175, 106, 0.12); color: var(--green); border: 1px solid rgba(143, 175, 106, 0.20); }
.k3d-trend-pill.down { background: rgba(199, 116, 100, 0.12); color: var(--red); border: 1px solid rgba(199, 116, 100, 0.20); }
.k3d-mini-chart { display: flex; align-items: flex-end; gap: 4px; height: 38px; margin-top: 8px; }
.k3d-mini-chart .b {
  flex: 1; background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  border-radius: 2px; box-shadow: 0 0 6px var(--gold-glow);
}
.k3d-mini-chart .b.dim { background: linear-gradient(180deg, var(--chart-bar-dim-1), var(--chart-bar-dim-2)); box-shadow: none; }
.k3d-progress { height: 4px; background: rgba(212, 165, 116, 0.08); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.k3d-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
  border-radius: 999px; box-shadow: 0 0 8px var(--gold-glow);
}

/* ═══ SCROLLBAR (gold) ═══ */
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg5); }

/* ═══ SELECTION (gold) ═══ */
::selection { background: rgba(212, 165, 116, .3); color: var(--white); }

/* ═══ RESPONSIVE: hide carousel on mobile ═══ */
@media(max-width:1024px) {
  .kpi-3d-section { height: 380px; }
  .kpi-3d-card { width: 280px; }
}
@media(max-width:768px) {
  .kpi-3d-section { display: none; }
}

/* ═══ FIX 5: SCORE CARDS (commerciaux) ═══ */
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 18px 0; }
.score-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: rgba(31, 27, 23, 0.5); border: 1px solid var(--border); border-radius: var(--r-sm, 8px); transition: all 0.2s; }
.score-card:hover { border-color: var(--border2); background: rgba(31, 27, 23, 0.7); }
.score-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.av-luka { background: linear-gradient(135deg, var(--av-luka-1), var(--av-luka-2)); }
.av-noa { background: linear-gradient(135deg, var(--av-noa-1), var(--av-noa-2)); }
.av-naoki { background: linear-gradient(135deg, var(--av-naoki-1), var(--av-naoki-2)); }
.av-jeremie { background: linear-gradient(135deg, var(--av-jeremie-1), var(--av-jeremie-2)); }
.score-info { flex: 1; min-width: 0; }
.score-name { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.score-progress { height: 5px; background: var(--bg); border-radius: 999px; overflow: hidden; position: relative; }
.score-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep, #A67C4D), var(--gold-light, #F0CB8E)); border-radius: 999px; box-shadow: 0 0 8px var(--gold-glow, rgba(232,183,117,.4)); position: relative; }
.score-progress-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer-bar 3s linear infinite; }
@keyframes shimmer-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.score-meta { font-family: var(--font-mono, monospace); font-size: 10.5px; color: var(--text3); margin-top: 4px; letter-spacing: 0.04em; }
.score-value { font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--gold-light, #F0CB8E); min-width: 70px; text-align: right; }

/* ═══ FIX 6: DONUT CHART ═══ */
.donut-card { display: flex; flex-direction: column; }
.donut-wrap { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 24px; padding: 24px 22px; align-items: center; }
.donut-svg { width: 180px; height: 180px; }
.donut-svg circle { fill: none; stroke-width: 16; transform: rotate(-90deg); transform-origin: center; }
.donut-bg { stroke: rgba(212, 165, 116, 0.06); }
.donut-seg-1 { stroke: url(#donutGrad1); filter: drop-shadow(0 0 6px rgba(232, 183, 117, 0.40)); }
.donut-seg-2 { stroke: url(#donutGrad2); filter: drop-shadow(0 0 4px rgba(212, 165, 116, 0.20)); }
.donut-center { display: grid; place-items: center; pointer-events: none; }
.donut-total { font-family: var(--font-ui); font-weight: 400; font-size: 32px; color: var(--text); letter-spacing: -0.02em; line-height: 1; }
.donut-sublabel { font-family: var(--font-mono, monospace); font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text3); margin-top: 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 14px; }
.legend-row { display: flex; align-items: center; gap: 12px; }
.legend-row .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-row .swatch.s1 { background: linear-gradient(135deg, var(--gold-light, #F0CB8E), var(--gold-deep, #A67C4D)); box-shadow: 0 0 8px var(--gold-glow, rgba(232,183,117,.4)); }
.legend-row .swatch.s2 { background: linear-gradient(135deg, var(--copper, #B8704A), #8B5234); }
.legend-label { font-size: 13px; color: var(--text); flex: 1; }
.legend-pct { font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 500; color: var(--gold, #D4A574); }

/* ═══ FIX 8: ANIMATIONS reveal + pulse ═══ */
.reveal { opacity: 0; transform: translateY(12px); animation: reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.25s; }
.reveal:nth-child(4) { animation-delay: 0.35s; }
.reveal:nth-child(5) { animation-delay: 0.45s; }
.reveal:nth-child(6) { animation-delay: 0.55s; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* ═══ FIX 9: HOVER GLOW on cards ═══ */
.stat-card:hover, .cd:hover, .card:hover {
  border-color: var(--border2) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 32px rgba(232, 183, 117, 0.12) !important;
}

/* ═══ SPARKLINE (FIX 4) ═══ */
.sparkline { width: 100%; height: 32px; margin-top: 8px; position: relative; }
.sparkline svg { width: 100%; height: 100%; overflow: visible; }
.sparkline path { fill: none; stroke: url(#sparkGrad); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(232,183,117,.4)); stroke-dasharray: 200; stroke-dashoffset: 200; animation: spark-draw 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.sparkline .sparkline-area { fill: url(#sparkArea); stroke: none; opacity: 0; animation: spark-fade 0.6s ease 0.8s forwards; }
.sparkline.down path { stroke: url(#sparkGradDown); filter: drop-shadow(0 0 4px rgba(199, 116, 100, 0.3)); }
.sparkline circle.dot { fill: var(--gold-light, #F0CB8E); stroke: var(--bg, #0E0B09); stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(232,183,117,.65)); opacity: 0; animation: spark-fade 0.4s ease 1.2s forwards; }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
@keyframes spark-fade { to { opacity: 1; } }

/* ═══ STATUS PILL DOT GLOW (FIX 13 from audit) ═══ */
.badge-green::before, .badge-blue::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; margin-right: 4px; vertical-align: middle; }

/* ═══ TOPBAR enrichie (FIX 10) ═══ */
.dir-top .search { margin-left: auto; position: relative; width: 280px; }
.dir-top .search input { width: 100%; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px 7px 36px; color: var(--text); font-family: inherit; font-size: 13px; outline: none; transition: all 0.25s; }
.dir-top .search input::placeholder { color: var(--text3); }
.dir-top .search input:focus { border-color: var(--border2); box-shadow: 0 0 0 4px rgba(232, 183, 117, 0.08); }
.dir-top .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text3); }
.dir-top .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono, monospace); font-size: 10px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--bg); }
.dir-top .icon-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; color: var(--text2); transition: all 0.25s; position: relative; }
.dir-top .icon-btn:hover { border-color: var(--border2); color: var(--gold-light, #F0CB8E); }
.dir-top .icon-btn svg { width: 15px; height: 15px; }
.dir-top .icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--gold-light, #F0CB8E); border-radius: 50%; box-shadow: 0 0 8px var(--gold-glow, rgba(232,183,117,.65)); animation: pulse 2s ease-in-out infinite; }
.dir-top .profile { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: all 0.25s; }
.dir-top .profile:hover { border-color: var(--border2); }
.dir-top .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--av-default-1), var(--av-default-2)); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--white); }
.dir-top .profile-name { font-size: 12px; font-weight: 500; color: var(--text); }
.dir-top .btn { padding: 7px 12px; border-radius: 8px; font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.dir-top .btn svg { width: 14px; height: 14px; stroke-width: 2; }
.dir-top .btn-primary { background: linear-gradient(180deg, var(--gold-light, #F0CB8E), var(--gold, #D4A574) 50%, var(--gold-deep, #A67C4D)); color: #1A1310; box-shadow: 0 0 0 1px var(--gold-deep, #A67C4D), 0 4px 12px rgba(232, 183, 117, 0.25); }
.dir-top .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--gold-deep, #A67C4D), 0 8px 20px rgba(232, 183, 117, 0.35); }
.dir-top .btn-secondary { background: rgba(31, 27, 23, 0.6); color: var(--text); border: 1px solid var(--border2); }
.dir-top .btn-secondary:hover { border-color: var(--border2); box-shadow: 0 0 16px rgba(232, 183, 117, 0.08); }

/* ═══ ACTIVITY LIVE ═══ */
.activity-card { display: flex; flex-direction: column; }
.live-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; background: rgba(143, 175, 106, 0.10); color: var(--green); border: 1px solid rgba(143, 175, 106, 0.25); }
.live-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s ease-in-out infinite; }
.activity-list { padding: 8px 0; }
.activity-item { display: grid; grid-template-columns: 12px 1fr; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); align-items: start; transition: background 0.15s; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(212, 165, 116, 0.03); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); margin-top: 6px; }
.activity-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-text strong { color: var(--gold-light); font-weight: 600; }
.activity-amount { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--gold-light); margin-top: 2px; }
.activity-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

/* ═══ CARD HEIGHT ALIGNMENT ═══ */
.grid-2, .g2 { align-items: stretch; }
.grid-2 > div > .card, .g2 > div > .card, .grid-2 > div > .cd, .g2 > div > .cd { height: 100%; display: flex; flex-direction: column; }
.grid-2 .table-wrap, .g2 .table-wrap, .grid-2 .donut-wrap, .g2 .donut-wrap { flex: 1; min-height: 0; }
.memo-card { max-height: none !important; }

/* ═══ SECTION ROW (accueil layout) ═══ */
.section-row { display: grid; gap: 22px; align-items: stretch; margin-bottom: 22px; }
.section-row.split-50-50 { grid-template-columns: 1fr 1fr; }
.section-row > .card { height: 100%; display: flex; flex-direction: column; min-height: 320px; }
.section-row .card-head { flex-shrink: 0; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.section-row .card-title { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-row .card-title-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-deep); padding: 2px 8px; border: 1px solid var(--border2); border-radius: 999px; }
.section-row .card-action { font-size: 11px; color: var(--gold); text-decoration: none; font-weight: 500; cursor: pointer; margin-left: auto; }
.section-row .table-wrap, .section-row .donut-wrap, .section-row .activity-list, .section-row .ch, .section-row #memo-entries { flex: 1; min-height: 0; overflow-y: auto; }
@media(max-width:768px) { .section-row.split-50-50 { grid-template-columns: 1fr; } }

/* ═══ THEME TOGGLE ═══ */
.theme-toggle { background: rgba(31, 27, 23, 0.6); border: 1px solid var(--border); border-radius: 999px; padding: 4px; cursor: pointer; flex-shrink: 0; transition: all 0.2s; outline: none; }
.theme-toggle:hover { border-color: var(--border2); box-shadow: 0 0 16px rgba(232, 183, 117, 0.10); }
.theme-toggle-track { display: block; width: 52px; height: 28px; border-radius: 999px; position: relative; background: rgba(15, 12, 10, 0.6); overflow: hidden; }
.theme-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, rgba(60, 55, 48, 0.9), rgba(40, 36, 32, 0.9)); display: grid; place-items: center; transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
[data-theme="light"] .theme-toggle { background: rgba(255, 255, 255, 0.30); border-color: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .theme-toggle:hover { border-color: rgba(255, 255, 255, 0.80); box-shadow: 0 0 16px rgba(140, 165, 195, 0.15); }
[data-theme="light"] .theme-toggle-track { background: rgba(255, 255, 255, 0.20); }
[data-theme="light"] .theme-toggle-thumb { left: calc(100% - 26px); background: rgba(255, 255, 255, 0.60); box-shadow: 0 2px 8px rgba(60, 70, 90, 0.12); }
.theme-icon { width: 13px; height: 13px; position: absolute; transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.theme-icon-moon { color: var(--gold-light); opacity: 1; transform: rotate(0); }
.theme-icon-sun { color: var(--gold); opacity: 0; transform: rotate(180deg); }
[data-theme="light"] .theme-icon-moon { opacity: 0; transform: rotate(-180deg); }
[data-theme="light"] .theme-icon-sun { opacity: 1; transform: rotate(0); color: var(--copper); }

/* Light theme variables: see css/theme-vars.css */
/* Light theme component overrides: */
/* === PHASE 2.2.a — LIGHT SIDEBAR + TOPBAR + AURORA (mockup v7) === */
[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.20); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border-right: 1px solid rgba(255, 255, 255, 0.55); box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.5), 4px 0 24px rgba(60, 70, 90, 0.04); }
[data-theme="light"] .sidebar::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent); height: 1px; top: 0; left: 10%; right: 10%; bottom: auto; }
[data-theme="light"] .nav-item, [data-theme="light"] .sb-it { background: rgba(255, 255, 255, 0.30); backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 8px rgba(60, 70, 90, 0.04); color: #4A5160; }
[data-theme="light"] .nav-item:hover, [data-theme="light"] .sb-it:hover { background: rgba(255, 255, 255, 0.40); }
[data-theme="light"] .nav-item.active, [data-theme="light"] .sb-it.active { background: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.80); color: #2C3038; }
[data-theme="light"] .nav-item svg, [data-theme="light"] .sb-it svg { color: #6B7280; }
[data-theme="light"] .nav-badge { background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(10px); border: 1px solid rgba(180, 195, 210, 0.50); color: #6B7280; }
[data-theme="light"] .brand-mark { background: rgba(255, 255, 255, 0.50); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.85); color: #4A5160; box-shadow: none; }
[data-theme="light"] .brand-mark::after { background: none; }
[data-theme="light"] .brand-name span { color: #6B7280; }
[data-theme="light"] .topbar, [data-theme="light"] .dir-top { background: rgba(255, 255, 255, 0.30); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 4px 16px rgba(60, 70, 90, 0.06); }
[data-theme="light"] .search input, [data-theme="light"] .dir-top .search input { background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.55); color: #2C3038; backdrop-filter: blur(20px); }
[data-theme="light"] .btn-primary { background: rgba(140, 165, 195, 0.90); color: #fff; border-color: rgba(140, 165, 195, 0.95); }
[data-theme="light"] .dir-top .btn-primary { background: rgba(140, 165, 195, 0.90); background-image: none; color: #fff; border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 8px rgba(60, 70, 90, 0.08); }
[data-theme="light"] .btn-secondary, [data-theme="light"] .bp { background: rgba(255, 255, 255, 0.30); color: #4A5160; border: 1px solid rgba(255, 255, 255, 0.55); backdrop-filter: blur(20px); }
[data-theme="light"] .icon-btn { background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.55); color: #6B7280; backdrop-filter: blur(20px); }
[data-theme="light"] .icon-btn .dot { background: rgba(220, 100, 100, 0.85); box-shadow: none; }
[data-theme="light"] .aurora { opacity: 1; }
[data-theme="light"] .aurora::before { background: radial-gradient(circle, rgba(220, 200, 205, 0.40) 0%, rgba(220, 200, 205, 0.16) 30%, transparent 60%); filter: blur(160px); }
[data-theme="light"] .aurora::after { background: radial-gradient(circle, rgba(180, 195, 210, 0.45) 0%, rgba(180, 195, 210, 0.18) 30%, transparent 60%); filter: blur(160px); }
[data-theme="light"] .aurora-blob { background: radial-gradient(circle, rgba(200, 195, 215, 0.35) 0%, rgba(200, 195, 215, 0.12) 35%, transparent 65%); filter: blur(160px); }
[data-theme="light"] .dot-grid, [data-theme="light"] .grain { display: none; }

/* === PHASE 2.2.b — LIGHT THEME OVERRIDES (cards + carrousel 3D) === */
[data-theme="light"] .kpi-3d-card { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(80px) saturate(220%); -webkit-backdrop-filter: blur(80px) saturate(220%); border: 1px solid rgba(255, 255, 255, 0.50); box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 20px 60px rgba(60,70,90,0.12), 0 4px 16px rgba(60,70,90,0.06); }
[data-theme="light"] .kpi-3d-card:hover { filter: brightness(1.05); border-color: rgba(255,255,255,0.80); box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 24px 64px rgba(60,70,90,0.16), 0 6px 20px rgba(60,70,90,0.08); }
[data-theme="light"] .kpi-3d-card::before { background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.10) 40%, transparent 100%); height: 60%; top: 0; left: 0; right: 0; }
[data-theme="light"] .kpi-3d-card::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent); width: auto; height: 1px; top: 0; left: 10%; right: 10%; border-radius: 0; }
[data-theme="light"] .k3d-icon { background: rgba(255,255,255,0.35); backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.70); color: #4A5160; }
[data-theme="light"] .k3d-label { color: var(--text3); }
[data-theme="light"] .k3d-value .unit { color: var(--text3); }
[data-theme="light"] .k3d-mini-chart .b { background: linear-gradient(180deg, rgba(180,195,210,0.85), rgba(150,165,185,0.85)); box-shadow: none; opacity: 0.55; }
[data-theme="light"] .k3d-mini-chart .b:last-child { background: linear-gradient(180deg, rgba(120,140,165,0.95), rgba(90,110,140,0.95)); opacity: 1; }
[data-theme="light"] .k3d-progress { background: rgba(255,255,255,0.45); }
[data-theme="light"] .k3d-progress-fill { background: linear-gradient(90deg, rgba(150,170,190,0.85), rgba(120,140,165,0.85)); box-shadow: none; }
[data-theme="light"] .k3d-progress-fill.alert { background: linear-gradient(90deg, rgba(220,130,130,0.85), rgba(200,100,100,0.85)); }
[data-theme="light"] .stat-card, [data-theme="light"] .sc { background: rgba(255,255,255,0.20); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid rgba(255,255,255,0.55); box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 4px 16px rgba(60,70,90,0.04); }
[data-theme="light"] .stat-card::before, [data-theme="light"] .sc::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent); }
[data-theme="light"] .stat-card:hover, [data-theme="light"] .sc:hover { border-color: rgba(255,255,255,0.80); box-shadow: inset 0 1px 0 rgba(255,255,255,0.90), 0 8px 24px rgba(60,70,90,0.08); }

/* Donut fournisseurs */
[data-theme="light"] .donut-seg-1 { stroke: #8FA88E; filter: drop-shadow(0 0 6px rgba(143, 168, 142, 0.30)); }
[data-theme="light"] .donut-seg-2 { stroke: rgba(140, 165, 195, 0.95); filter: drop-shadow(0 0 4px rgba(140, 165, 195, 0.20)); }
[data-theme="light"] .donut-bg { stroke: rgba(140, 165, 195, 0.08); }
[data-theme="light"] .swatch.s1 { background: #8FA88E; box-shadow: none; }
[data-theme="light"] .swatch.s2 { background: rgba(140, 165, 195, 0.95); }

/* === REMAINING LIGHT OVERRIDES (tables, inputs, etc.) === */
[data-theme="light"] .stat-value, [data-theme="light"] .sv { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: unset; background-clip: unset; color: var(--text); }
[data-theme="light"] .fi { background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: none; backdrop-filter: blur(20px); }
[data-theme="light"] .sc:hover, [data-theme="light"] .stat-card:hover { box-shadow: 0 8px 24px rgba(60, 70, 90, 0.08); }
[data-theme="light"] .cd:hover { border-color: rgba(255, 255, 255, 0.75); }
[data-theme="light"] .mo { background: rgba(255, 255, 255, 0.25); backdrop-filter: blur(20px); }
[data-theme="light"] .toast { box-shadow: 0 8px 24px rgba(60, 70, 90, 0.10); }
[data-theme="light"] tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.15); }
[data-theme="light"] tbody tr:hover { background: rgba(255, 255, 255, 0.25); }
[data-theme="light"] .success-box { box-shadow: 0 0 40px rgba(60, 70, 90, 0.08); }

/* === PHASE 2.2.c — LIGHT COMPOSANTS SECONDAIRES === */
[data-theme="light"] .cd { background: rgba(255, 255, 255, 0.20); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border-color: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .modal-overlay { background: rgba(60, 70, 90, 0.35); backdrop-filter: blur(8px); }
[data-theme="light"] .sidebar-overlay { background: rgba(60, 70, 90, 0.20); backdrop-filter: blur(6px); }
[data-theme="light"] .success-overlay { background: rgba(255, 255, 255, 0.60); backdrop-filter: blur(8px); }
[data-theme="light"] .notif-dropdown { background: rgba(255, 255, 255, 0.40); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.55); box-shadow: 0 24px 48px rgba(60, 70, 90, 0.12); }
[data-theme="light"] .notif-dropdown::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent); }
[data-theme="light"] .pill { background: rgba(255, 255, 255, 0.20); border-color: rgba(255, 255, 255, 0.55); color: var(--text2); }
[data-theme="light"] .pill:hover { background: rgba(255, 255, 255, 0.35); color: var(--text); }
[data-theme="light"] .pill.active { background: rgba(255, 255, 255, 0.55); color: var(--text); border-color: rgba(255, 255, 255, 0.80); }
[data-theme="light"] .co-tabs { background: rgba(255, 255, 255, 0.30); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.55); }
[data-theme="light"] .co-tabs .pill:hover { background: rgba(255, 255, 255, 0.30); color: var(--text); }
[data-theme="light"] .co-tabs .pill.active { background: rgba(140, 165, 195, 0.85); color: #fff; box-shadow: 0 2px 8px rgba(60, 70, 90, 0.10); }
[data-theme="light"] .progress-bg { background: rgba(255, 255, 255, 0.35); }
[data-theme="light"] .progress-bar { background: linear-gradient(90deg, rgba(150, 170, 190, 0.85), rgba(120, 140, 165, 0.85)); }
[data-theme="light"] .progress-bar::after { background: none; }
[data-theme="light"] .agent-card { background: rgba(255, 255, 255, 0.20); border-color: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .agent-card:hover { border-color: rgba(255, 255, 255, 0.80); box-shadow: 0 8px 20px rgba(60, 70, 90, 0.08); }
[data-theme="light"] .form-item { background: rgba(255, 255, 255, 0.20); border-color: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .form-item:hover { border-color: rgba(255, 255, 255, 0.75); }
[data-theme="light"] .bank-actions-bar { background: rgba(255, 255, 255, 0.30); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.55); }
[data-theme="light"] thead th { border-bottom-color: rgba(140, 165, 195, 0.20); background: rgba(255, 255, 255, 0.15); }
[data-theme="light"] .cd th { border-bottom-color: rgba(140, 165, 195, 0.15); }
[data-theme="light"] .search input:focus { box-shadow: 0 0 0 3px rgba(140, 165, 195, 0.15); }
[data-theme="light"] .btn-secondary:hover { box-shadow: 0 0 16px rgba(140, 165, 195, 0.10); }
[data-theme="light"] .hover-card:hover { box-shadow: 0 6px 24px rgba(60, 70, 90, 0.08); }
[data-theme="light"] .btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 16px rgba(60, 70, 90, 0.12); }
[data-theme="light"] .activity-amount { color: var(--text); }
[data-theme="light"] .section-row .card-title-tag, [data-theme="light"] .card-title-tag, [data-theme="light"] .kpi-3d-section-header .auto-tag { border-color: rgba(140, 165, 195, 0.35); background: rgba(140, 165, 195, 0.08); }
[data-theme="light"] .nav-item.active svg, [data-theme="light"] .sb-it.active svg { color: var(--text); filter: none; }

/* ═══ PERF BLOCK TITLES ═══ */
.perf-block-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gold-deep); padding: 24px 0 12px; border-top: 1px solid var(--border); margin-top: 32px; display: flex; align-items: center; gap: 10px; }
.perf-block-title::before { content: ''; width: 4px; height: 14px; background: linear-gradient(180deg, var(--gold-light), var(--gold-deep)); border-radius: 2px; }
.perf-block-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* ═══ EMPTY STATE ═══ */
.empty-state { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state-icon { width: 40px; height: 40px; opacity: 0.3; color: var(--gold); }
.empty-state-title { font-size: 14px; color: var(--text2); font-weight: 500; }
.empty-state-desc { font-size: 12px; color: var(--text3); max-width: 280px; line-height: 1.5; }

/* === COMPTA CLASSES (used by compta.js innerHTML) === */
.compta-alert-positive { background: rgba(80, 180, 100, .06); border-left: 4px solid var(--alert-positive); padding: .8rem; border-radius: var(--radius); margin-top: .5rem; }
.compta-alert-positive-title { color: var(--alert-positive); font-weight: 700; font-size: .72rem; }
.compta-alert-positive-body { font-size: .62rem; color: var(--text2); }

.compta-alert-negative { background: rgba(220, 80, 80, .06); border-left: 4px solid var(--alert-negative); padding: .8rem; border-radius: var(--radius); margin-top: .5rem; }
.compta-alert-negative-title { color: var(--alert-negative); font-weight: 700; font-size: .72rem; margin-bottom: .3rem; }
.compta-alert-negative-body { font-size: .62rem; color: var(--text2); line-height: 1.5; }

.compta-alert-warning { background: rgba(212, 165, 116, .06); border-left: 4px solid var(--gold); padding: .8rem; border-radius: var(--radius); margin-top: .5rem; }
.compta-alert-warning-title { color: var(--gold); font-weight: 700; font-size: .72rem; }
.compta-alert-warning-body { font-size: .62rem; color: var(--text2); }

.compta-categoriser-box { padding: .7rem .9rem; margin-bottom: .8rem; background: rgba(212, 165, 116, .06); border: 1px solid rgba(212, 165, 116, .15); border-radius: var(--radius); }
.compta-config-warning { padding: .5rem; background: rgba(212, 165, 116, .08); border: 1px solid rgba(212, 165, 116, .2); border-radius: 6px; font-size: .58rem; color: var(--gold); margin-bottom: .6rem; }

/* ═══ BANK TABLE ═══ */
.bank-actions-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: rgba(31, 27, 23, 0.4); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px; }
.bank-sync-status { display: flex; align-items: center; gap: 8px; }
.bank-sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s ease-in-out infinite; }
.bank-sync-dot.syncing { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.bank-sync-dot.error { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
.bank-sync-label { font-size: 12px; color: var(--text2); font-family: var(--font-mono); letter-spacing: 0.04em; }
.btn-compact { padding: 7px 14px !important; font-size: 12px !important; }

/* Config sections */
.config-section { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.config-section:last-child { border-bottom: none; }
.config-section-head { margin-bottom: 16px; }
.config-section-title { font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.config-section-desc { font-size: 12.5px; color: var(--text3); line-height: 1.5; max-width: 600px; }
