/* ============================================================
   RIMCO Assurance Auto — powered by OLEA
   Identité OLEA : Orange soleil #F8AF3C · Latérite #B7482B ·
   Gris institutionnel #666 · fonds blancs épurés, premium panafricain.
   ============================================================ */
:root {
  --orange: #F8AF3C;
  --orange-soft: #fdeccd;
  --laterite: #B7482B;
  --laterite-deep: #97391f;
  --laterite-soft: #f6e4de;
  --grey: #666666;
  --brown: #432918;
  --sable: #CBBBA0;
  --turquoise: #5FB7B1;
  --rimco: #C7382F;
  --ink: #2b211b;
  --muted: #938a80;
  --line: #ece6df;
  --line-soft: #f4efe9;
  --page: #faf8f5;
  --surface: #ffffff;
  --shadow-sm: 0 1px 2px rgba(67,41,24,.05), 0 2px 10px rgba(67,41,24,.05);
  --shadow: 0 12px 34px rgba(67,41,24,.09);
  --shadow-lg: 0 28px 64px rgba(67,41,24,.16);
  --radius: 14px;
  --radius-sm: 10px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- LOGIN ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-hero {
  position: relative; padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(165deg, #5a2a18 0%, var(--laterite) 48%, var(--laterite-deep) 72%, #7a3a20 100%);
  overflow: hidden;
}
.login-hero::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  right: -150px; top: -120px; background: radial-gradient(circle, var(--orange) 0, transparent 70%); opacity: .5;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background: repeating-linear-gradient(120deg, #fff 0 1px, transparent 1px 30px);
}
.login-hero > * { position: relative; z-index: 1; }
.login-logo { background: #fff; border-radius: 14px; padding: 16px 20px; width: max-content; box-shadow: var(--shadow); }
.login-logo img { height: 44px; display: block; }
.login-hero h1 { font-size: 37px; line-height: 1.12; max-width: 13ch; margin: 0 0 14px; font-weight: 800; }
.login-hero p { font-size: 16px; opacity: .94; max-width: 42ch; line-height: 1.55; }
.login-kicker { text-transform: uppercase; letter-spacing: 2.5px; font-size: 12px; font-weight: 700; color: var(--orange); }
.login-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.login-badges span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); padding: 6px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-card { width: 100%; max-width: 384px; }
.login-card h2 { font-size: 25px; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #5b524a; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fdfbf9; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(248,175,60,.22); background: #fff;
}
.demo-accounts { margin-top: 22px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; line-height: 1.9; }
.demo-accounts code { background: var(--laterite-soft); color: var(--laterite-deep); padding: 2px 7px; border-radius: 6px; cursor: pointer; }
.error-msg { color: var(--laterite); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- BUTTONS ---------- */
.lang-switch { display: inline-flex; gap: 4px; }
.lang-btn { font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 4px 10px; border-radius: 6px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.lang-btn:hover { border-color: var(--orange); }
.lang-btn.active { background: var(--laterite); color: #fff; border-color: var(--laterite); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--laterite); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--laterite-deep); }
.btn-rimco { background: var(--orange); color: var(--brown); }
.btn-rimco:hover { background: #f0a022; }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--orange); color: var(--laterite); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- APP SHELL ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0,1fr); min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; gap: 6px; }
.rail-brand { padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rail-brand img { height: 30px; display: block; }
.rail-brand .sub { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: .3px; }
.rail-section { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 16px 10px 4px; font-weight: 700; }
.rail a.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: #5d544b; text-decoration: none; transition: background .12s, color .12s; }
.rail a.nav:hover { background: var(--line-soft); color: var(--ink); }
.rail a.nav.active { background: var(--laterite-soft); color: var(--laterite-deep); }
.rail a.nav.active .ico { color: var(--laterite); }
.rail a.nav .ico { width: 18px; text-align: center; color: var(--muted); font-size: 15px; }
.rail-foot { margin-top: auto; padding: 14px; border-radius: 12px; background: var(--page); border: 1px solid var(--line); font-size: 12.5px; }
.rail-foot b { color: var(--ink); display: block; }
.rail-foot .role-chip { display: inline-block; margin-top: 8px; font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--laterite); color: #fff; font-weight: 600; }
.rail-foot button { color: var(--muted); font-size: 12.5px; margin-top: 12px; text-decoration: underline; }
.rail-foot button:hover { color: var(--laterite); }

main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--laterite); font-weight: 700; }
.topbar h1 { font-size: 22px; margin: 2px 0 0; }
.topbar .actions { display: flex; gap: 10px; margin-left: auto; }
.back-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); transition: background .15s, border-color .15s; }
.back-btn:hover { background: #faf2ea; border-color: var(--laterite); }
.back-btn[hidden] { display: none; }
.content { padding: 28px 32px 60px; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- KPI CARDS ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 26px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--laterite); }
.kpi.rimco::after { background: var(--orange); }
.kpi.gold::after { background: var(--turquoise); }
.kpi p { margin: 0; font-size: 13px; color: var(--muted); }
.kpi strong { display: block; font-size: 29px; margin: 6px 0 2px; letter-spacing: -.5px; color: var(--ink); }
.kpi span { font-size: 12px; color: var(--muted); }


/* ---------- PANELS / TABLES ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 17px; }
.panel-head .kicker { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--laterite); font-weight: 700; }
.panel-body { padding: 22px; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 22px; border-bottom: 1px solid var(--line); font-weight: 600; }
tbody td { padding: 14px 22px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
tbody tr:hover { background: #fdfaf7; }
tbody tr:last-child td { border-bottom: none; }
.search { padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fdfbf9; min-width: 240px; }
.search:focus { outline: none; border-color: var(--orange); }

/* ---------- BADGES ---------- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 30px; font-size: 12px; font-weight: 600; }
.badge.slate { background: #f0ece7; color: #7a6f64; }
.badge.amber { background: var(--orange-soft); color: #99670c; }
.badge.blue { background: #e0f0ef; color: #2f7d77; }
.badge.green { background: #e4f3df; color: #4a7a35; }
.badge.red { background: var(--laterite-soft); color: var(--laterite-deep); }

/* ---------- DEVIS BUILDER ---------- */
.builder { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 22px; align-items: start; }
.stepper { display: flex; gap: 8px; margin-bottom: 20px; }
.step { flex: 1; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; font-size: 12px; }
.step.active { border-color: var(--laterite); color: var(--laterite-deep); }
.step.active .n { background: var(--laterite); color: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.phone-row { display: flex; gap: 6px; }
.phone-row select { max-width: 140px; flex: 0 0 auto; }
.phone-row input { flex: 1; min-width: 0; }
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.report-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-filters input[type="date"] { padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fdfbf9; }

/* prime card */
.prime-card { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.prime-top { background: linear-gradient(140deg, var(--laterite-deep), var(--laterite)); color: #fff; padding: 22px; position: relative; }
.prime-top::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--orange), transparent 70%); opacity: .45; }
.prime-top small { text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; opacity: .9; position: relative; }
.prime-amount { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin: 4px 0; position: relative; }
.prime-top .valid { font-size: 12.5px; opacity: .9; position: relative; }
.prime-lines { padding: 18px 22px; }
.prime-lines .l { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.prime-lines .l span { color: var(--muted); }
.prime-actions { padding: 0 22px 22px; display: grid; gap: 10px; }
.covers-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 7px; }
.covers-list li { font-size: 13.5px; padding-left: 24px; position: relative; line-height: 1.4; }
.covers-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--laterite); font-weight: 800; }
.cover-franchise { color: var(--muted); font-size: 12px; }

/* ---------- CATALOG ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.cat-card .cat-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--laterite); font-weight: 700; }
.cat-card h4 { margin: 6px 0 2px; font-size: 17px; }
.cat-card .specs { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.cat-card .val { font-weight: 700; font-size: 16px; }

/* ---------- DETAIL ---------- */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; }
.timeline b { font-size: 14px; } .timeline small { color: var(--muted); display: block; font-size: 12px; }
.breakdown .l { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.breakdown .l.sensitive { color: var(--laterite); }
.breakdown .l.total { font-weight: 800; font-size: 16px; border-top: 2px solid var(--ink); border-bottom: none; padding-top: 12px; }
.breakdown .l.section { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 1px; border: none; padding-bottom: 2px; padding-top: 14px; }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--brown); color: #fff; padding: 13px 22px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; opacity: 0; transition: .3s; z-index: 50; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { background: var(--laterite); }

/* ---------- MOBILE NAV (masqué sur desktop) ---------- */
.mobile-menu-btn { display: none; }
.mobile-drawer, .mobile-overlay { display: none; }

@media (max-width: 1080px) {
  .builder { grid-template-columns: 1fr; } .prime-card { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .rail { display: none; }
  .login { grid-template-columns: 1fr; } .login-hero { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 16px 18px; gap: 12px; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 20px 18px 60px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
  .report-grid { grid-template-columns: 1fr !important; }
  .stepper { flex-wrap: wrap; }

  .mobile-menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; flex: 0 0 auto;
  }
  .mobile-menu-btn span { display: block; height: 2px; width: 20px; background: var(--ink); margin: 0 auto; border-radius: 2px; }

  .mobile-overlay { display: block; position: fixed; inset: 0; background: rgba(43,33,27,.45); z-index: 40; }
  .mobile-overlay[hidden] { display: none; }

  .mobile-drawer {
    display: flex; flex-direction: column; gap: 6px; padding: 20px 16px;
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; max-width: 82vw; background: var(--surface);
    border-right: 1px solid var(--line); z-index: 41; transform: translateX(-100%);
    transition: transform .25s ease; overflow-y: auto; box-shadow: var(--shadow-lg);
  }
  .mobile-drawer.open { transform: translateX(0); }
  .mobile-drawer .rail-brand img { height: 26px; }
  .mobile-drawer nav { display: grid; gap: 6px; }
  .mobile-drawer a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; color: #5d544b; text-decoration: none; }
  .mobile-drawer a.nav.active { background: var(--laterite-soft); color: var(--laterite-deep); }
  .mobile-drawer a.nav .ico { width: 18px; text-align: center; color: var(--muted); }
}
@media (min-width: 861px) { .mobile-drawer, .mobile-overlay, .mobile-menu-btn { display: none !important; } }

/* ---------- LOGOS (RIMCO × OLEA × AREA) + repli texte ---------- */
.login-logo { display: flex; align-items: center; gap: 14px; }
.login-logo .brand-logo { height: 40px; max-width: 150px; object-fit: contain; }
.brand-x { color: var(--muted); font-weight: 700; font-size: 18px; }
.brand-fallback { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-weight: 900; letter-spacing: .5px; color: var(--laterite-deep); font-size: 20px; padding: 4px 10px; border: 2px solid var(--laterite-soft); border-radius: 8px; }
.brand-fallback small { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: var(--muted); }
.brand-fallback.sm { font-size: 14px; padding: 3px 7px; }
.rail-logos { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; cursor: pointer; }
.rail-logos:hover { opacity: .85; }
.rail-logos .brand-logo { height: 26px; max-width: 92px; object-fit: contain; }

/* ---------- BTN GOLD ---------- */
.btn-gold { background: linear-gradient(135deg, var(--orange), #e0902a); color: var(--brown); box-shadow: var(--shadow-sm); }
.btn-gold:hover { filter: brightness(1.04); }

/* ---------- WIZARD COTATION ---------- */
.stepper .step { cursor: pointer; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.hint.exo-note { color: var(--laterite); background: var(--laterite-soft); padding: 8px 12px; border-radius: 8px; margin: 8px 0 0; }
.check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin-bottom: 0; color: #5b524a; }
.check input[type="checkbox"] { width: auto !important; margin: 0; }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.veh-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fffdfb; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.row span { color: var(--muted); }
.row b { text-align: right; }

/* ---------- CHARTS (SVG maison) ---------- */
.chart-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-legend { display: grid; gap: 6px; font-size: 13px; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; color: #5b524a; }
.donut-legend .lg b { margin-left: auto; padding-left: 14px; }
.donut-legend .dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .bl { color: #5b524a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bt { background: var(--line-soft); border-radius: 30px; height: 12px; overflow: hidden; }
.bar-row .bf { height: 100%; border-radius: 30px; transition: width .4s ease; }
.bar-row .bv { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---------- DÉTAIL : blocs garanties / récap ---------- */
.bk-block { border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px 12px; margin-bottom: 12px; background: #fffdfb; }
.bk-block .l.section { margin-top: 8px; }

/* ---------- PIÈCES : checklist ---------- */
.doc-req { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.doc-req .doc-tick { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line-soft); color: var(--muted); }
.doc-req .doc-tick.ok { background: #e4f3df; color: #4a7a35; }
.doc-req .doc-label { flex: 1; }
.doc-req .badge { flex: 0 0 auto; }
.docs-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 16px 0 6px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.doc-row .doc-tick { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line-soft); color: var(--muted); font-size: 12px; }
.doc-row .doc-tick.ok { background: #e4f3df; color: #4a7a35; }
.doc-row .doc-main { flex: 1; min-width: 0; font-size: 13.5px; }
.doc-row .doc-file { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.doc-row .doc-act { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- ACTIONS compartimentées ---------- */
.act-group { margin-bottom: 14px; }
.act-group:last-child { margin-bottom: 0; }
.act-group .act-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }

/* ---------- DASHBOARD riche + fond sobre ---------- */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(248,175,60,.10), transparent 55%),
    linear-gradient(180deg, #ffffff, #fdfbf8);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 24px; margin-bottom: 22px; position: relative; overflow: hidden;
}
.dash-welcome::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(120deg, rgba(183,72,43,.05) 0 1px, transparent 1px 26px);
}
.dash-welcome > * { position: relative; z-index: 1; }
.dash-welcome .kicker { text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; color: var(--laterite); font-weight: 700; }
.dash-welcome h2 { margin: 6px 0 4px; font-size: 22px; }
.dash-welcome p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }
.dash-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-welcome::after {
  content: ""; position: absolute; right: -10px; top: 0; bottom: 0; width: 220px; opacity: .14; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 48'><path fill='%23B7482B' d='M12 34c1-7 6-12 14-13l10-8c5-4 11-6 18-6h16c8 0 15 3 21 9l9 9c6 1 11 3 13 6 2 2 2 7 2 9 0 2-2 3-4 3h-9a8 8 0 00-16 0H44a8 8 0 00-16 0h-9c-3 0-6-2-7-5z'/></svg>") right center / contain no-repeat;
}

/* ============================================================
   PREMIUM — ambiance, animations, micro-interactions
   ============================================================ */
body { background:
  radial-gradient(900px 520px at 100% -8%, rgba(248,175,60,.10), transparent 60%),
  radial-gradient(720px 520px at -8% 112%, rgba(183,72,43,.06), transparent 60%),
  var(--page); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.content { animation: fadeUp .28s ease both; }
.kpi { animation: fadeUp .4s ease both; transition: transform .16s ease, box-shadow .16s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpis .kpi:nth-child(2) { animation-delay: .05s; } .kpis .kpi:nth-child(3) { animation-delay: .1s; }
.kpis .kpi:nth-child(4) { animation-delay: .15s; } .kpis .kpi:nth-child(5) { animation-delay: .2s; }
.kpi strong { transition: color .2s; }
.panel { animation: fadeUp .35s ease both; }
.cat-card { transition: transform .16s ease, box-shadow .16s ease; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.btn { transition: transform .08s, box-shadow .15s, background .15s, filter .15s; }
.btn-primary:hover, .btn-rimco:hover, .btn-gold:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.bar-row .bf { animation: growBar .6s cubic-bezier(.22,1,.36,1) both; transform-origin: left; }
@keyframes growBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.btn-danger { background: var(--laterite-deep); color: #fff; }
.btn-danger:hover { background: #7e2f19; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- MODALES / POP-UPS ---------- */
.modal-ov { position: fixed; inset: 0; background: rgba(43,33,27,.5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 60; opacity: 0; transition: opacity .2s ease; padding: 20px; }
.modal-ov.show { opacity: 1; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: 24px; animation: popIn .24s ease both; }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 16px; color: #5b524a; font-size: 14px; line-height: 1.5; }
.modal-input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fdfbf9; margin-bottom: 16px; }
.modal-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(248,175,60,.22); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal.modal-wide { max-width: 760px; }
.modal-scroll { max-height: 60vh; overflow: auto; margin-bottom: 16px; }
.modal-scroll table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.modal-scroll table td { font-size: 13px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
tr.rclick { cursor: pointer; }
tr.rclick:hover { background: #fdf3e6; }
/* Aperçu de document (devis/facture/CP) */
.doc-modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: min(940px, 96vw); height: min(92vh, 1180px); display: flex; flex-direction: column; overflow: hidden; animation: popIn .24s ease both; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.doc-head b { font-size: 15px; }
.doc-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.doc-frame { flex: 1; width: 100%; border: 0; background: #dcdfe0; }
@media (max-width: 640px) { .doc-head { flex-wrap: wrap; } .doc-head-actions { width: 100%; } .doc-head-actions .btn { flex: 1; } }
