/* =====================================================================
   Mbigu Renum — Front-office abonnés
   Charte AFUP Technology (vert #0B9F17, encre #0F1210, titres Montserrat)
   ===================================================================== */
:root {
  --brand: #0B9F17;
  --brand-dark: #087A12;
  --brand-deep: #055A0D;
  --brand-tint: #E9F7EA;
  --brand-tint2: #C8EBCB;
  --ink: #0F1210;
  --ink2: #222823;
  --bg: #F6F8F6;
  --surface: #FFFFFF;
  --surface2: #F6F8F6;
  --border: #E3E8E4;
  --text: #0F1210;
  --light: #464D47;
  --muted: #747B75;
  --ok: #0B8043;
  --ok-tint: #E3F5EE;
  --warn: #B45309;
  --warn-tint: #FEF3E2;
  --info: #2563EB;
  --info-tint: #E8EFFD;
  --danger: #C62828;
  --danger-tint: #FDECEC;
  --danger-tint2: #F6C9C9;
  --shadow: 0 1px 2px rgba(15,18,16,.04), 0 8px 24px rgba(15,18,16,.06);
  --radius: 12px;
  --sidebar-w: 248px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.6; font-feature-settings: 'tnum';
  min-height: 100vh;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, .poppins { font-family: 'Montserrat', sans-serif; color: var(--ink); line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ── BOUTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 13px; line-height: 1.2;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .1s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(11,159,23,.22); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-tint2); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--brand-dark); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ── FORMULAIRES ─────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field > label, .label {
  display: block; font-size: 12px; font-weight: 600; color: var(--light); margin-bottom: 6px;
}
.field .req { color: var(--brand); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; padding: 10px 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font: inherit; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 120px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,159,23,.12);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error-msg { font-size: 12px; color: var(--danger); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--light); }
.check input { accent-color: var(--brand); margin-top: 3px; }
.field > label.check { font-weight: 400; font-size: 13px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* ── ALERTES / BADGES ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
  border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: var(--ok-tint); border-color: #BFE6D5; color: #0B6B4A; }
.alert-error   { background: var(--danger-tint); border-color: var(--danger-tint2); color: #8E1C1C; }
.alert-warning { background: var(--warn-tint); border-color: #F8D9A8; color: #8A4006; }
.alert-info    { background: var(--info-tint); border-color: #C9D9FA; color: #1E4FBF; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  white-space: nowrap; line-height: 1.6;
}
.badge-ok     { background: var(--ok-tint); color: var(--ok); }
.badge-warn   { background: var(--warn-tint); color: var(--warn); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-info   { background: var(--info-tint); color: var(--info); }
.badge-muted  { background: #EDF0ED; color: var(--muted); }
.badge-brand  { background: var(--brand); color: #fff; }

/* ── APP SHELL ────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50;
  border-top: 4px solid var(--brand); transition: transform .25s;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff !important; text-decoration: none !important; }
.sidebar-brand img { height: 30px; width: auto; background: #fff; border-radius: 6px; padding: 3px 5px; }
.brand-text { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: .5px; line-height: 1.1; }
.brand-text span { color: var(--brand); }
.brand-text small { display: block; font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500; color: rgba(255,255,255,.55); letter-spacing: .3px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.4); padding: 16px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: rgba(255,255,255,.75); font-size: 13.5px; font-weight: 500; text-decoration: none; margin-bottom: 2px;
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active svg { opacity: 1; }
.sidebar-plan {
  margin: 0 12px 14px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.7);
}
.sidebar-plan strong { color: #fff; font-family: 'Montserrat', sans-serif; font-size: 14px; display: block; }
.sidebar-plan a { color: #5FD468; font-weight: 600; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; overflow-x: clip; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 16px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle { display: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--ink); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; font: inherit; color: var(--ink); padding: 4px; border-radius: 10px; }
.user-btn:hover { background: var(--surface2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-meta { text-align: left; line-height: 1.25; }
.user-meta b { display: block; font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 6px; display: none;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; color: var(--ink);
  font: inherit; font-size: 13px; background: none; border: none; cursor: pointer; text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface2); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

.content { padding: 28px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backdrop { display: none; }

/* ── CARTES ───────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-body { padding: 20px; }
.card + .card { margin-top: 20px; }
.cards { display: grid; gap: 20px; align-content: start; }
.cards > .card + .card, .cards > .alert,
.cols-2 > .card + .card, .cols-main > .card + .card { margin-top: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -.3px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-top: 3px solid var(--brand); }
.kpi.accent .v { color: var(--brand); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.empty h3 { margin-bottom: 4px; }
.empty p { margin-bottom: 16px; }

/* ── TABLES ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #FBFCFB; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell form { display: inline; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.filters .field { margin: 0; min-width: 160px; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 20px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; color: var(--ink); text-decoration: none; background: #fff; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── AUTH ─────────────────────────────────────────────────────── */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-aside {
  background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  border-top: 4px solid var(--brand); position: relative; overflow: hidden;
}
.auth-aside::after {
  content: ''; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,159,23,.35), transparent 65%); pointer-events: none;
}
.auth-aside h2 { color: #fff; font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -.8px; line-height: 1.15; margin: 40px 0 16px; }
.auth-aside h2 span { color: var(--brand); }
.auth-aside p { color: rgba(255,255,255,.7); max-width: 440px; font-size: 15px; }
.auth-aside ul { list-style: none; margin-top: 28px; display: grid; gap: 10px; position: relative; z-index: 1; }
.auth-aside li { display: flex; gap: 10px; color: rgba(255,255,255,.85); font-size: 14px; }
.auth-aside li::before { content: '✓'; color: var(--brand); font-weight: 700; }
.auth-aside .foot { font-size: 12px; color: rgba(255,255,255,.45); position: relative; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 560px; }
.auth-box h1 { font-size: 26px; margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.auth-box .alt { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-logo { display: none; margin-bottom: 24px; }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px !important; }
.pwd-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label { border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; text-align: center; font-size: 12px; color: var(--light); transition: all .2s; }
.seg label b { display: block; font-family: 'Montserrat', sans-serif; color: var(--ink); font-size: 13px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── SIMULATEUR ───────────────────────────────────────────────── */
.sim { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 20px; align-items: start; }
.sim-form { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; }
.sim-form .card-body { padding: 18px; }
.step { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.step h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--light); }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.parts-box { display: flex; justify-content: space-between; align-items: center; background: var(--brand-tint); border: 1px solid var(--brand-tint2); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--brand-deep); }
.parts-box b { font-family: 'Montserrat', sans-serif; font-size: 18px; }
.conv-info { background: var(--info-tint); border: 1px solid #C9D9FA; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--light); }

.rub-search { margin-bottom: 10px; }
.rub-cat { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.rub-cat > summary {
  list-style: none; padding: 10px 14px; background: var(--surface2); cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.rub-cat > summary::-webkit-details-marker { display: none; }
.rub-cat > summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.rub-cat[open] > summary::after { transform: rotate(180deg); }
.rub-cat .count { background: var(--brand); color: #fff; border-radius: 10px; font-size: 10px; padding: 0 7px; margin-left: auto; }
.rub-list { padding: 4px 12px; }
.rub { padding: 8px 0; border-bottom: 1px solid var(--border); }
.rub:last-child { border-bottom: none; }
.rub-line { display: flex; align-items: center; gap: 8px; }
.rub-line label { flex: 1; font-size: 13px; color: var(--light); cursor: pointer; }
.rub-line input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; flex-shrink: 0; }
.rub-line input[type=number] { width: 130px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; text-align: right; display: none; }
.rub-line input[type=number]:focus { border-color: var(--brand); outline: none; }
.rub.on .rub-line input[type=number] { display: block; }
.rub.on .rub-line label { color: var(--ink); font-weight: 500; }
.rub-badges { display: none; gap: 4px; flex-wrap: wrap; margin: 6px 0 0 23px; }
.rub.on .rub-badges { display: flex; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.tag-oui { background: var(--ok-tint); color: var(--ok); }
.tag-non { background: #EDF0ED; color: var(--muted); }
.tag-cond { background: var(--warn-tint); color: var(--warn); }
.tag-note { background: #F1ECFD; color: #6D4BC9; font-weight: 500; }
.sim-actions { position: sticky; bottom: 0; background: #fff; padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

.result-empty { text-align: center; padding: 80px 30px; color: var(--muted); }
.result-empty .icon { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.tab { padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
a.tab { text-decoration: none !important; }
.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }
.tab-panel .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tab-panel .kpi .v { font-size: 19px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; font-size: 12px; }
.bar-row .lbl { color: var(--light); }
.bar-track { height: 22px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; color: #fff; font-size: 11px; display: flex; align-items: center; padding-left: 8px; white-space: nowrap; transition: width .5s; }
.bar-fill.net { background: var(--ok); }
.bar-fill.irpp { background: var(--brand); }
.bar-fill.tcs { background: #F59E0B; }
.bar-fill.cnss { background: var(--ink2); }
.bar-fill.cnamgs { background: #6366F1; }
.bar-row .pct { text-align: right; color: var(--muted); }
.obligations { display: grid; gap: 8px; }
.obligations li { list-style: none; display: flex; gap: 8px; font-size: 13px; color: var(--light); padding: 8px 12px; background: var(--surface2); border-radius: 8px; }
.obligations li::before { content: '•'; color: var(--brand); font-weight: 700; }

.breakdown { width: 100%; border-collapse: collapse; }
.breakdown td, .breakdown th { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.breakdown th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); text-align: left; background: var(--surface2); }
.breakdown .sec td { background: var(--surface2); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; color: var(--brand-dark); }
.breakdown .num { text-align: right; white-space: nowrap; }
.breakdown .ded { color: var(--danger); }
.breakdown .tot td { font-weight: 700; background: #FAFBFA; }
.breakdown .net td { background: var(--brand); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 16px; padding: 14px; border: none; }
.breakdown .sub { display: block; font-size: 11px; color: var(--muted); }
.breakdown .muted-row td { color: var(--muted); }

/* ── BULLETIN (fiche de paie) ─────────────────────────────────── */
.slip { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.slip-top { background: var(--ink); color: #fff; padding: 22px 26px; border-bottom: 4px solid var(--brand); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.slip-top h2 { color: #fff; font-size: 20px; }
.slip-top .co { font-size: 12px; color: rgba(255,255,255,.65); }
.slip-top .ref { text-align: right; font-size: 12px; color: rgba(255,255,255,.65); }
.slip-top .ref b { color: #fff; display: block; font-size: 14px; font-family: 'Montserrat', sans-serif; }
.slip-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.slip-meta > div { padding: 12px 20px; border-right: 1px solid var(--border); }
.slip-meta > div:last-child { border-right: none; }
.slip-meta .k { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.slip-meta .v { font-weight: 600; color: var(--ink); }
.slip-foot { padding: 14px 20px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }

/* ── PLANS ────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; }
.plan.featured { border: 2px solid var(--brand); }
.plan.current { background: linear-gradient(180deg, var(--brand-tint) 0%, #fff 40%); }
.plan .ribbon { position: absolute; top: -11px; left: 24px; }
.plan h3 { font-size: 18px; }
.plan .aud { color: var(--muted); font-size: 12px; min-height: 36px; }
.plan .price { font-family: 'Montserrat', sans-serif; font-size: 28px; font-weight: 700; color: var(--ink); margin: 14px 0 2px; letter-spacing: -.5px; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan .year { font-size: 12px; color: var(--ok); min-height: 18px; }
.plan ul { list-style: none; margin: 18px 0 22px; display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 13px; color: var(--light); }
.plan li::before { content: '✓'; color: var(--brand); font-weight: 700; }
.cycle-toggle { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.cycle-toggle a { padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none !important; }
.cycle-toggle a.active { background: var(--ink); color: #fff; }

.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pay-methods input { position: absolute; opacity: 0; pointer-events: none; }
.pay-methods label { border: 1px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; display: block; font-size: 12px; color: var(--muted); }
.pay-methods label b { display: block; color: var(--ink); font-size: 14px; font-family: 'Montserrat', sans-serif; }
.pay-methods input:checked + label { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.pay-methods input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.summary-line:last-child { border: none; }
.summary-line.total { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }

/* ── CALENDRIER ───────────────────────────────────────────────── */
.timeline { list-style: none; position: relative; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.date-chip { background: var(--surface2); border-radius: 10px; text-align: center; padding: 8px 4px; line-height: 1.1; }
.date-chip b { display: block; font-family: 'Montserrat', sans-serif; font-size: 22px; color: var(--ink); }
.date-chip span { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.timeline li.next .date-chip { background: var(--brand); }
.timeline li.next .date-chip b, .timeline li.next .date-chip span { color: #fff; }
.timeline li.past { opacity: .55; }
.deadline-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ── TICKETS ──────────────────────────────────────────────────── */
.thread { display: grid; gap: 14px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); }
.msg.me { justify-self: end; background: var(--brand-tint); border-color: var(--brand-tint2); }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }

/* ── PROGRESS / USAGE ─────────────────────────────────────────── */
.usage { display: grid; gap: 14px; }
.usage-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.progress { height: 8px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 6px; }
.progress.full > div { background: var(--danger); }

.list-plain { list-style: none; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list-plain li:last-child { border-bottom: none; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 200;
  transform: translateY(20px); opacity: 0; transition: all .25s; pointer-events: none; max-width: calc(100vw - 48px);
}
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--danger); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .sim { grid-template-columns: 380px minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,18,16,.45); z-index: 45; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .sim { grid-template-columns: minmax(0, 1fr); }
  .sim-form { position: static; max-height: none; }
  .cols-main, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-logo { display: flex; align-items: center; gap: 10px; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .user-meta { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .v { font-size: 17px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 1fr; }
  .slip-meta { grid-template-columns: 1fr 1fr; }
  .slip-meta > div:nth-child(2) { border-right: none; }
  .slip-meta > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .bar-row { grid-template-columns: 70px 1fr 46px; }
  .pay-methods { grid-template-columns: 1fr; }
  .page-head .actions { width: 100%; }
  .msg { max-width: 100%; }
  .table th, .table td { padding: 10px 12px; }
  .hide-sm { display: none; }
}

/* ── IMPRESSION ───────────────────────────────────────────────── */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .page-head .actions, .no-print, .toast, .backdrop { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card, .slip { box-shadow: none; }
  .slip-top, .breakdown .net td, .breakdown .sec td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
