/* ================================================================
   Kopra One — Design System v7
   Inspiré DSFR · Sobre · Épuré · Institutionnel
   ================================================================ */

:root {
  /* -- Surfaces -- */
  --bg:            #F6F6F6;
  --bg-deep:       #EEEEEE;
  --surface:       #FFFFFF;
  --surface-2:     #F5F5F5;
  --border:        #E5E5E5;
  --border-strong: #CCCCCC;

  /* -- Text -- */
  --text:          #161616;
  --text-muted:    #666666;
  --text-faint:    #929292;

  /* -- Brand palette — Bleu France (DSFR) -- */
  --primary:        #000091;
  --primary-dark:   #00006D;
  --primary-deeper: #000074;
  --primary-soft:   #E3E3FD;
  --primary-border: #CACAFB;
  --accent:         #0063CB;
  --accent-2:       #417DC4;

  --danger:      #CE0500;
  --danger-soft:  #FEE9E7;
  --warn:        #B34000;
  --warn-soft:    #FFE9D3;
  --ok:          #18753C;
  --ok-soft:      #B8FEC9;

  /* -- Radii — DSFR uses minimal radii -- */
  --radius-sm: 4px;
  --radius:    4px;
  --radius-lg: 8px;
  --radius-xl: 8px;

  /* -- Font -- */
  --font-sans: 'Inter', 'Marianne', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* -- Transition -- */
  --transition: 0.15s ease;

  /* -- Shadows — minimal, borders preferred -- */
  --shadow-xs:  none;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-primary: 0 2px 6px rgba(0,0,145,0.12);
  --shadow-glow: 0 0 0 2px rgba(0,0,145,0.20);

  --grad-primary: linear-gradient(135deg, #000091 0%, #0063CB 100%);
  --grad-accent:  linear-gradient(135deg, #0063CB 0%, #417DC4 100%);
  --grad-mesh:    none;

  /* -- Sidebar -- */
  --sidebar-w: 240px;
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #666666;
  --sidebar-text-active: #000091;
  --sidebar-hover: #F5F5F5;
  --sidebar-active: #E3E3FD;
}

/* ================================================================
   Reset & Base
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.6;
}
body { overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); color: var(--primary-deeper); }

/* ================================================================
   Layout
   ================================================================ */
.container    { max-width: 720px;  margin: 0 auto; padding: 36px 24px 64px; }
.container-md { max-width: 880px;  margin: 0 auto; padding: 36px 24px 64px; }
.container-lg { max-width: 1100px; margin: 0 auto; padding: 36px 28px 64px; }
.section    { padding: 72px 0; position: relative; }
.section-sm { padding: 44px 0; position: relative; }

/* ================================================================
   Typography — crisp hierarchy, generous breathing room
   ================================================================ */
h1 { font-size: 24px; font-weight: 700; letter-spacing: 0; line-height: 1.3; color: var(--text); }
h2 { font-size: 18px; font-weight: 700; letter-spacing: 0; color: var(--text); }
h3 { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
p  { color: var(--text-muted); line-height: 1.7; }
.lead { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-top: 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 5px 14px; border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.muted { color: var(--text-faint); }
code {
  background: var(--surface-2); padding: 2px 8px; border-radius: 6px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px; color: var(--text);
}
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ================================================================
   Topbar (landing pages — sticky glass)
   ================================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad-primary);
  color: white; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.spacer { flex: 1; }
.topbar a {
  font-size: 13px; color: var(--text-muted); padding: 7px 12px;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.topbar a:hover { color: var(--primary); background: var(--primary-soft); }
.topbar a.btn {
  color: #fff; background: var(--primary); padding: 8px 18px;
  font-weight: 500; border: none;
}
.topbar a.btn:hover {
  color: #fff; background: var(--primary-dark);
}
.topbar-nav { display: contents; }
.topbar-burger {
  display: none;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 15px;
  align-items: center; justify-content: center;
}

/* ================================================================
   Buttons — refined, subtle depth
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; background: var(--primary); color: white; border: 0;
  border-radius: 4px; font-weight: 500; font-size: 14px; cursor: pointer;
  transition: background 0.15s ease;
  letter-spacing: 0; line-height: 1.5;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:active { background: var(--primary-deeper); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--block { width: 100%; padding: 10px 20px; }
.btn--lg { padding: 12px 24px; font-size: 15px; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--ghost {
  background: transparent; color: var(--primary); border: 1px solid var(--primary);
}
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn--icon { padding: 8px 14px; font-size: 13px; }
.btn--xl { padding: 14px 28px; font-size: 16px; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #B10500; }

/* ================================================================
   Card
   ================================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title h2 { font-size: 15px; }
.card-title .muted { font-size: 12px; }

/* ================================================================
   Forms — generous spacing, soft borders
   ================================================================ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; position: relative; }
.field.full { grid-column: 1 / -1; }
label, .field-label { font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.01em; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: -2px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], input:not([type]),
textarea, select {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ================================================================
   Chips / radios
   ================================================================ */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; user-select: none; transition: all var(--transition);
}
.chip input { display: none; }
.chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ================================================================
   Alerts
   ================================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.alert--ok  { background: var(--ok-soft); color: #065F46; border: 1px solid #A7F3D0; }
.alert--err { background: var(--danger-soft); color: #991B1B; border: 1px solid #FECACA; }
.alert--warn { background: var(--warn-soft); color: #92400E; border: 1px solid #FDE68A; }
.alert.hidden { display: none; }

/* ================================================================
   Stepper
   ================================================================ */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--text-faint); font-size: 12px; font-weight: 500; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-faint);
  display: grid; place-items: center; font-weight: 700; font-size: 11px;
  border: 2px solid var(--border); flex-shrink: 0;
}
.step.is-active { color: var(--text); }
.step.is-active .step-num { background: var(--primary); color: white; border-color: var(--primary); }
.step.is-done   .step-num { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.step-bar { flex: 1; height: 2px; background: var(--border); margin: 0 10px; border-radius: 2px; transition: background .3s; }
.step-bar.is-done { background: var(--primary); }
.step-screen { display: none; }
.step-screen.is-active { display: block; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-actions .btn { min-width: 130px; }

/* ================================================================
   Address grid / halls
   ================================================================ */
.address-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr auto; gap: 10px; align-items: end; }
.address-grid .field { margin-bottom: 0; }
@media (max-width: 720px) { .address-grid { grid-template-columns: 1fr; } }

.icon-btn {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-faint); border-radius: var(--radius-sm);
  width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center;
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.checkbox {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
  transition: all var(--transition); font-size: 13px;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.checkbox:hover { border-color: var(--border-strong); background: var(--surface-2); }
.checkbox.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* ================================================================
   Suggestions registre
   ================================================================ */
.suggestions { margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.suggestion { padding: 12px 16px; cursor: pointer; border-top: 1px solid var(--border); transition: background .1s; }
.suggestion:first-child { border-top: 0; }
.suggestion:hover, .suggestion.is-active { background: var(--primary-soft); }
.suggestion-name { font-weight: 600; font-size: 13px; color: var(--text); }
.suggestion-meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* ================================================================
   Address autocomplete
   ================================================================ */
.address-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 50; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  max-height: 260px; overflow-y: auto;
}
.address-suggest-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.address-suggest-item:last-child { border-bottom: 0; }
.address-suggest-item:hover, .address-suggest-item.is-active { background: var(--primary-soft); }
.address-suggest-item i { color: var(--primary); margin-top: 2px; font-size: 13px; }
.address-suggest-label { font-size: 13px; color: var(--text); font-weight: 500; line-height: 1.3; }
.address-suggest-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ================================================================
   Segmented control
   ================================================================ */
.seg-control {
  display: inline-flex; padding: 4px;
  background: var(--bg-deep); border-radius: var(--radius);
  gap: 2px; margin-bottom: 18px; border: 1px solid var(--border);
}
.seg-btn {
  padding: 8px 20px; border: 0; background: transparent;
  border-radius: var(--radius-sm); font-weight: 500; font-size: 13px;
  cursor: pointer; color: var(--text-muted); transition: all var(--transition);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   Entity card
   ================================================================ */
.entity-card {
  position: relative;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 18px 52px 18px 20px;
  margin-bottom: 14px;
}
.entity-card-name { font-weight: 700; font-size: 14px; color: var(--text); }
.entity-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.entity-card-clear {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: white; border: 1px solid var(--primary-border);
  cursor: pointer; color: var(--text-faint);
  display: grid; place-items: center; font-size: 11px; transition: all var(--transition);
}
.entity-card-clear:hover { color: var(--danger); border-color: var(--danger); }

.team-card {
  background: var(--surface-2); border: 0;
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.team-card h4 {
  margin-bottom: 14px; font-size: 12px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.team-card h4 i { font-size: 12px; }

/* ================================================================
   Equipments
   ================================================================ */
.equip-search-wrap { position: relative; margin-bottom: 18px; }
.equip-search-wrap i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 14px; pointer-events: none; }
.equip-search-wrap input { padding-left: 40px; }

.equip-cat { margin-bottom: 24px; }
.equip-cat.is-empty { display: none; }
.equip-cat-head {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.equip-cat-head .cat-count { margin-left: auto; font-size: 11px; color: var(--text-faint); letter-spacing: 0; text-transform: none; font-weight: 500; }

.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.equip-card {
  position: relative; display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all var(--transition); font-family: inherit; text-align: left;
}
.equip-card:hover { border-color: var(--border-strong); background: var(--surface-2); box-shadow: var(--shadow-xs); }
.equip-card.is-active { border-color: var(--primary); background: var(--primary-soft); }
.equip-card.is-active .equip-label { color: var(--primary); font-weight: 600; }
.equip-card.is-hidden { display: none; }

.equip-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-muted);
  display: grid; place-items: center; font-size: 14px;
  border: 1px solid var(--border); transition: all var(--transition);
}
.equip-card:hover .equip-icon { background: var(--surface); }
.equip-card.is-active .equip-icon { background: white; color: var(--primary); border-color: var(--primary-border); }
.equip-label { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }

.equip-empty {
  text-align: center; padding: 36px 18px;
  color: var(--text-faint); font-size: 13px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}

/* ================================================================
   Recap
   ================================================================ */
.recap-section { margin-bottom: 20px; }
.recap-section h3 { margin-bottom: 10px; }
.recap-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 18px; font-size: 13px; }
.recap-grid dt { color: var(--text-faint); font-size: 12px; }
.recap-grid dd { color: var(--text); font-weight: 500; }
@media (max-width: 600px) { .recap-grid { grid-template-columns: 1fr; gap: 2px 0; } .recap-grid dd { margin-bottom: 8px; } }

.price-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.price-card-label { font-size: 12px; color: var(--primary); font-weight: 600; }
.price-card-amount { font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.price-card-tax { font-size: 11px; color: var(--text-faint); }

/* ================================================================
   LANDING: Hero, Features, etc.
   ================================================================ */

/* ===== Hero ===== */
.hero {
  position: relative; padding: 96px 24px 80px; overflow: hidden; isolation: isolate;
}
.hero-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; }
@media (max-width: 960px) { .hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; } }
.hero h1 { font-size: 48px; line-height: 1.06; letter-spacing: -0.04em; margin: 16px 0 18px; font-weight: 700; }
.hero h1 .accent { color: var(--primary); }
.hero p { font-size: 17px; color: var(--text-muted); max-width: 500px; margin-bottom: 30px; line-height: 1.7; }
@media (max-width: 960px) { .hero p { margin-left: auto; margin-right: auto; } }
@media (max-width: 600px) { .hero h1 { font-size: 36px; } }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 960px) { .hero-cta { justify-content: center; } }

.hero-trust { display: flex; align-items: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; font-size: 12px; color: var(--text-faint); }
@media (max-width: 960px) { .hero-trust { justify-content: center; } }
.hero-trust .pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.hero-trust .pill i { color: var(--primary); }

.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora::before, .aurora::after, .aurora .blob {
  content: ''; position: absolute; border-radius: 50%; filter: blur(130px); opacity: 0.25;
}
.aurora::before { width: 440px; height: 440px; left: -130px; top: -110px; background: radial-gradient(circle, #C7D2FE 0%, transparent 70%); }
.aurora::after  { width: 540px; height: 540px; right: -160px; top: 80px; background: radial-gradient(circle, #DDD6FE 0%, transparent 70%); }
.aurora .blob   { width: 440px; height: 440px; left: 30%; bottom: -190px; background: radial-gradient(circle, #E0E7FF 0%, transparent 70%); opacity: 0.2; }

.hero-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(99,102,241,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0.45), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0.45), transparent 70%);
}

.mockup { position: relative; perspective: 1400px; display: flex; justify-content: center; }
.mockup-card {
  width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 22px;
}
@media (max-width: 960px) { .mockup-card { max-width: 380px; } }
.mockup-head { display: flex; align-items: center; gap: 7px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.mockup-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.mockup-dot:nth-child(1) { background: #FCA5A5; }
.mockup-dot:nth-child(2) { background: #FCD34D; }
.mockup-dot:nth-child(3) { background: #86EFAC; }
.mockup-title { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--text); }
.mockup-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.mockup-row:last-child { border-bottom: 0; }
.mockup-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.mockup-row-title { font-weight: 600; font-size: 13px; color: var(--text); }
.mockup-row-meta { font-size: 11px; color: var(--text-faint); }
.mockup-row-status { margin-left: auto; font-size: 10px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.mockup-row-status.is-warn { background: var(--warn-soft); color: var(--warn); }
.mockup-row-status.is-ok   { background: var(--ok-soft); color: var(--ok); }

.float-badge {
  position: absolute; top: -10px; right: -10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text);
}
.float-badge i { color: var(--primary); }
@media (max-width: 960px) { .float-badge { display: none; } }

.stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 18px;
  padding: 26px 36px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  margin: -28px auto 0; max-width: 1000px; position: relative; z-index: 2;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -0.03em; }
.stat-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2,1fr); margin: 20px 20px 0; } }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 14px 0 14px; line-height: 1.12; }
.section-head p { font-size: 16px; line-height: 1.7; }
@media (max-width: 600px) { .section-head h2 { font-size: 24px; } }

.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }
.feature {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.feature:hover { border-color: var(--border-strong); }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 18px; margin-bottom: 18px;
}
.feature h3 { font-size: 15px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: -0.01em; margin-bottom: 8px; }
.feature p { font-size: 13px; }

.roles { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 900px) { .roles { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 500px) { .roles { grid-template-columns: 1fr; } }
.role { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; transition: all var(--transition); }
.role:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.role-icon { font-size: 20px; color: var(--primary); margin-bottom: 14px; }
.role h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.role p { font-size: 12px; }

.howto { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; position: relative; }
@media (max-width: 900px) { .howto { grid-template-columns: 1fr; } }
.howto-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; position: relative; }
.howto-num { width: 32px; height: 32px; border-radius: 10px; background: var(--grad-primary); color: white; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.howto-step h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.howto-step p { font-size: 13px; }

.cta-bottom { background: var(--text); border-radius: var(--radius-xl); padding: 56px 44px; text-align: center; color: white; }
.cta-bottom > * { position: relative; }
.cta-bottom h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 14px; color: #fff; }
.cta-bottom p { color: rgba(255,255,255,0.6); margin-bottom: 24px; font-size: 16px; }
.cta-bottom .btn { background: white; color: var(--text); }
.cta-bottom .btn:hover { background: var(--surface-2); }
@media (max-width: 600px) { .cta-bottom { padding: 40px 24px; } .cta-bottom h2 { font-size: 24px; } }

.footer { padding: 36px 24px; text-align: center; color: var(--text-faint); font-size: 12px; }
.footer a { color: var(--text-muted); }

/* ================================================================
   APP SHELL: sidebar + main
   ================================================================ */
.app-shell {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh; background: var(--bg);
}
.sb-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.35); backdrop-filter: blur(6px);
  z-index: 40;
}
.sb-backdrop.is-open { display: block; }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .main { padding-bottom: 72px !important; }
  .breadcrumb { display: none !important; }
}

/* -- Sidebar — Light minimal -- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
@media (max-width: 960px) { .sidebar { position: relative; height: auto; } }

.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 20px 20px; position: relative;
}
.sb-brand .brand-logo { width: 22px; height: auto; flex-shrink: 0; }
.sb-brand .brand-label { font-size: 16px; font-weight: 300; color: var(--text); letter-spacing: 0.04em; }
.sb-brand .brand-label strong { font-weight: 600; }
.sb-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); }

.sb-copro {
  padding: 14px 16px; margin: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  user-select: none;
}
.sb-copro:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.sb-copro.is-open { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-bottom-color: transparent; }
.sb-copro-label {
  font-size: 10px; font-weight: 500; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px;
  display: flex; align-items: center; gap: 5px;
}
.sb-copro-label i { font-size: 10px; }
.sb-copro-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 4px; }
.sb-copro-ref {
  font-size: 10px; font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  color: var(--text-faint); background: var(--bg-deep);
  display: inline-block; padding: 2px 8px; border-radius: 4px;
}

/* Copro panel (dropdown) */
.sb-copro-panel {
  margin: 0 12px; border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface);
}
.sb-copro-panel-inner { padding: 12px 14px; }
.sb-panel-section { margin-bottom: 12px; }
.sb-panel-section:last-child { margin-bottom: 0; }
.sb-panel-label {
  font-size: 10px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
}
.sb-panel-label i { font-size: 10px; }
.sb-panel-ref-row {
  display: flex; align-items: center; gap: 6px;
}
.sb-panel-ref-code {
  flex: 1; font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  color: var(--primary); background: var(--primary-soft);
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
}
.sb-panel-copy {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; display: grid; place-items: center;
  font-size: 12px; transition: all .15s;
}
.sb-panel-copy:hover { border-color: var(--primary-border); color: var(--primary); background: var(--primary-soft); }
.sb-panel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; margin-bottom: 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all .15s; font-family: inherit; text-align: left;
}
.sb-panel-btn:last-child { margin-bottom: 0; }
.sb-panel-btn:hover { border-color: var(--primary-border); color: var(--primary); background: var(--primary-soft); }
.sb-panel-btn i { font-size: 11px; width: 16px; text-align: center; }

.sb-nav { padding: 16px 10px; flex: 1; }
.sb-nav-section-title {
  font-size: 10px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 18px 12px 6px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  color: var(--sidebar-text); font-size: 13px; font-weight: 450;
  text-decoration: none; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sb-item i { width: 18px; text-align: center; font-size: 13px; color: var(--text-faint); transition: color 0.12s; }
.sb-item:hover { background: var(--sidebar-hover); color: var(--text); }
.sb-item:hover i { color: var(--text-muted); }
.sb-item.is-active {
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
  border-left-color: var(--primary);
}
.sb-item.is-active i { color: var(--primary); }
.sb-item .sb-badge { margin-left: auto; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--primary); color: white; }
.sb-item .sb-soon  { margin-left: auto; font-size: 9px; font-weight: 500; padding: 2px 7px; border-radius: 4px; background: var(--bg-deep); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }

.sb-foot { border-top: 1px solid var(--border); padding: 12px; margin-top: auto; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); margin-bottom: 4px; }
.sb-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: grid; place-items: center; font-weight: 600; font-size: 11px; flex-shrink: 0;
}
.sb-user-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.2; }
.sb-user-email { font-size: 11px; color: var(--text-faint); margin-top: 1px; }

/* -- Main pane -- */
.main { padding: 0; background: var(--bg); min-width: 0; max-width: none; width: 100%; }
.main-topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(250,250,250,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.breadcrumb { font-size: 13px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border-strong); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

.hamburger {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 15px;
  place-items: center; justify-content: center;
}
@media (max-width: 960px) { .hamburger { display: grid; } }
.topbar-title-mobile { display: none; font-weight: 600; font-size: 14px; color: var(--text); }
@media (max-width: 960px) { .topbar-title-mobile { display: block; } }

.search-global {
  flex: 1; max-width: 340px;
  background: var(--surface) !important; border: 1px solid var(--border) !important;
  font-size: 13px !important; padding: 9px 16px !important;
  border-radius: var(--radius) !important;
}
.icon-pill {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: transparent; border: none;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-faint); position: relative;
}
.icon-pill:hover { color: var(--text-muted); }
.icon-pill .dot-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); border: 2px solid var(--surface); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* ── Notifications (cloche + panneau) ── */
.notif-wrap { position: relative; }
.notif-panel { position: absolute; top: 42px; right: 0; width: 360px; max-width: 92vw; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 60; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-readall { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2, #f6f6f6); }
.notif-item.is-unread { background: #f0f3ff; }
.notif-ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: #e8edff; color: var(--primary); font-size: 13px; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-t { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-m { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-faint); font-size: 13px; margin: 0; }

/* -- Page header -- */
.page { padding: 28px 36px 48px; width: 100%; max-width: none; }
@media (max-width: 720px) { .page { padding: 22px 18px 52px; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.page-head-meta { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* -- Global clickable cursor -- */
.is-clickable, tr.is-clickable td,
[data-id], [data-f], [data-act], [data-tab], [data-mode],
.list-row, .kpi-tile.is-clickable,
a[href], [role="button"] { cursor: pointer; }

/* -- KPI strip -- */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.kpi-tile .label { font-size: 11px; font-weight: 500; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-tile .value { font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.03em; line-height: 1.2; }
.kpi-tile .delta { font-size: 11px; color: var(--text-faint); margin-top: 2px; font-weight: 400; }
.kpi-tile .delta.up { color: var(--ok); }
.kpi-tile .delta.warn { color: var(--warn); }
.kpi-tile .delta.danger { color: var(--danger); }
.kpi-tile .ico {
  position: absolute; right: 16px; top: 16px;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-deep); color: var(--text-faint);
  display: grid; place-items: center; font-size: 14px;
}

/* -- Alert banner -- */
.alert-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin-bottom: 22px;
  background: var(--warn-soft);
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  color: #78350F;
}
.alert-banner i { color: #D97706; font-size: 18px; }
.alert-banner-msg { font-size: 13px; flex: 1; line-height: 1.55; }
.alert-banner-msg strong { color: #78350F; font-weight: 700; }

/* -- Widget grid -- */
.widget-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 20px; }
.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0;
  display: flex; flex-direction: column; min-width: 0;
  overflow: hidden;
}
.widget-grid > .widget { grid-column: span 12; }
.widget.col-4  { grid-column: span 4; }
.widget.col-6  { grid-column: span 6; }
.widget.col-8  { grid-column: span 8; }
.widget.col-12 { grid-column: span 12; }
@media (max-width: 1100px) { .widget.col-4 { grid-column: span 6; } .widget.col-8 { grid-column: span 12; } }
@media (max-width: 760px) { .widget.col-4, .widget.col-6, .widget.col-8 { grid-column: span 12; } }

.widget-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.widget-title { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.widget-title i { color: var(--text-faint); font-size: 13px; }
.widget-link { font-size: 12px; color: var(--text-muted); font-weight: 500; text-decoration: none; transition: color 0.12s; }
.widget-link:hover { color: var(--primary); }
.widget-body { flex: 1; min-width: 0; padding: 16px 20px; }
.demo-tag { display: inline-block; font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--border); margin-left: 6px; }

/* -- Lists / rows in widgets -- */
.list-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-deep); color: var(--text-faint);
  display: grid; place-items: center; font-size: 12px;
}
.list-icon.warn   { background: var(--warn-soft); color: var(--warn); }
.list-icon.danger { background: var(--danger-soft); color: var(--danger); }
.list-icon.ok     { background: var(--ok-soft); color: var(--ok); }
.list-icon.info   { background: #EEF2FF; color: var(--primary); }
.list-icon.muted  { background: var(--surface-2); color: var(--text-faint); }
.list-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35; }
.list-meta  { font-size: 11px; color: var(--text-faint); margin-top: 3px; line-height: 1.4; }
.list-trail { font-size: 11px; color: var(--text-faint); white-space: nowrap; font-weight: 500; }

/* -- Status pills -- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 4px; }
.pill-warn   { background: var(--warn-soft); color: var(--warn); border: 1px solid #F4C36A; }
.pill-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #F5A29E; }
.pill-ok     { background: var(--ok-soft); color: var(--ok); border: 1px solid #6EE7A0; }
.pill-info   { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.pill-muted  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.pill-primary { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }

/* -- Budget bars -- */
.budget-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.budget-row:last-child { border-bottom: 0; }
.budget-label { font-size: 13px; font-weight: 600; color: var(--text); }
.budget-val { font-size: 12px; color: var(--text-faint); white-space: nowrap; font-weight: 500; }
.budget-bar { grid-column: 1 / -1; height: 6px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; }
.budget-bar-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .5s ease; }
.budget-bar-fill.warn   { background: var(--warn); }
.budget-bar-fill.danger { background: var(--danger); }

/* -- Donut -- */
.donut { width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; position: relative; }
.donut::after { content: ''; position: absolute; inset: 10px; background: var(--surface); border-radius: 50%; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center .num { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.donut-center .lbl { font-size: 9px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; }

/* -- Tantieme ring cards (overview) -- */
.tantieme-ring {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.tantieme-ring:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.tantieme-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tantieme-info .label { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tantieme-info .name { font-size: 13px; font-weight: 500; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tantieme-info .val { font-size: 11px; color: var(--text-faint); }

/* -- Search / filter bar for tantiemes overview -- */
.tan-search-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.tan-search-bar input[type="search"] {
  flex: 1; max-width: 380px;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13px; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tan-search-bar input[type="search"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.tan-search-wrap {
  position: relative; flex: 1; max-width: 380px;
}
.tan-search-wrap i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-faint); pointer-events: none;
}
.tan-search-wrap input { width: 100%; }
.tan-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.tan-filter-pill {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.tan-filter-pill:hover { border-color: var(--primary-border); color: var(--primary); }
.tan-filter-pill.is-active { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); font-weight: 600; }

/* -- Lot number badge -- */
.lot-num-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 3px 10px;
  background: var(--primary-soft); color: var(--primary-deeper);
  border: 1px solid var(--primary-border); border-radius: 6px;
  font-weight: 800; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/* -- Building / floor tag -- */
.loc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted);
}
.loc-tag i { font-size: 10px; color: var(--text-faint); }
.loc-tag .loc-building { font-weight: 600; color: var(--text); }

/* -- Owner distribution bar -- */
.owner-bar {
  display: flex; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--bg-deep); margin-top: 8px;
}
.owner-bar-seg {
  height: 100%; transition: width 0.4s ease;
}
.owner-dist-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px;
}
.owner-dist-item {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted);
}
.owner-dist-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* -- Highlight row on search match -- */
.tbl-pro tbody tr.is-highlight { background: rgba(99,102,241,.06); }
.tbl-pro tbody tr.is-dimmed { opacity: 0.35; }

/* -- Chat preview -- */
.chat-msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.chat-msg:last-child { border-bottom: 0; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700; font-size: 10px; }
.chat-author { font-size: 12px; font-weight: 600; color: var(--text); }
.chat-time { font-size: 10px; color: var(--text-faint); margin-left: 8px; }
.chat-body { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-top: 2px; }

/* -- Empty state -- */
.widget-empty {
  text-align: center; padding: 32px 18px; color: var(--text-faint); font-size: 13px;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.widget-empty i { font-size: 24px; color: var(--text-faint); display: block; margin-bottom: 10px; }

/* -- Pending request mini -- */
.req-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: center; }
.req-row:last-child { border-bottom: 0; }
.req-name { font-size: 13px; font-weight: 600; color: var(--text); }
.req-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.req-btn { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-family: inherit; transition: all var(--transition); }
.req-btn.approve { background: var(--primary); color: white; border-color: var(--primary); }
.req-btn.approve:hover { background: var(--primary-dark); }
.req-btn.reject:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* ================================================================
   Dashboard alerts
   ================================================================ */
.dash-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: 12px;
  font-size: 13px; line-height: 1.55;
  margin-bottom: 10px;
}

/* ================================================================
   Quick actions
   ================================================================ */
.quick-action {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; text-decoration: none;
  transition: all var(--transition);
}
.quick-action i { font-size: 14px; color: var(--text-faint); }
.quick-action:hover { border-color: var(--primary-border); color: var(--primary); background: var(--primary-soft); }
.quick-action:hover i { color: var(--primary); }

/* ================================================================
   Onboarding card
   ================================================================ */
.onboarding-card {
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: 16px; padding: 24px; margin-bottom: 20px;
}

/* ================================================================
   PAGES MODULES
   ================================================================ */

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.filter-bar input, .filter-bar select { padding: 8px 14px !important; font-size: 13px !important; flex: 0 0 auto; width: auto; min-width: 150px; }
.filter-bar .filter-search { flex: 1 1 200px; min-width: 180px; }
.filter-bar .filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.filter-bar .filter-tag.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); font-weight: 600; }

/* Two-pane layout */
.two-pane { display: grid; grid-template-columns: minmax(300px,1.1fr) 2fr; gap: 16px; min-height: 460px; }
@media (max-width: 1100px) { .two-pane { grid-template-columns: 1fr; } }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs); }
.pane-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pane-head .title { font-size: 14px; font-weight: 700; color: var(--text); }
.pane-body { flex: 1; overflow-y: auto; }
.pane-body.padded { padding: 20px; }

.pane-list .pane-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center;
  padding: 13px 18px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.pane-list .pane-row:last-child { border-bottom: 0; }
.pane-list .pane-row:hover { background: var(--bg-deep); }
.pane-list .pane-row.is-selected { background: var(--primary-soft); border-left: 3px solid var(--primary); padding-left: 15px; }
.pane-list .pane-row .row-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.pane-list .pane-row .row-meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* Severity badges */
.sev { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sev-low    { background: var(--surface-2); color: var(--text-muted); }
.sev-normal { background: #EEF2FF; color: var(--primary); }
.sev-high   { background: var(--warn-soft); color: #92400E; }
.sev-urgent { background: var(--danger-soft); color: var(--danger); }

/* Detail header */
.detail-head { padding: 20px; border-bottom: 1px solid var(--border); }
.detail-head h2 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 11px; color: var(--text-faint); }

/* Pro table */
.tbl-pro {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.tbl-pro th, .tbl-pro td { padding: 14px 18px; text-align: left; }
.tbl-pro thead { background: #F0F1F4; }
.tbl-pro thead th { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; }
.tbl-pro tbody tr { border-top: 1px solid var(--border); transition: background var(--transition); }
.tbl-pro tbody tr:hover { background: rgba(67,56,202,0.02); }

/* Message thread (chat) */
.thread {
  display: flex; flex-direction: column;
  height: calc(100vh - 200px); min-height: 440px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.thread-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.thread-head h2 { font-size: 15px; font-weight: 700; }
.thread-list { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.thread-msg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: flex-start; }
.thread-msg.is-mine { grid-template-columns: 1fr 36px; }
.thread-msg .avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.thread-msg.is-mine .avatar { grid-column: 2; background: var(--text-faint); }
.thread-bubble { background: var(--surface-2); padding: 12px 16px; border-radius: 16px; font-size: 13px; color: var(--text); line-height: 1.6; word-wrap: break-word; max-width: 80%; }
.thread-msg.is-mine .thread-bubble { background: var(--primary-soft); color: var(--text); border: 1px solid var(--primary-border); justify-self: end; }
.thread-msg .author-line { font-size: 11px; color: var(--text-faint); margin-bottom: 4px; font-weight: 600; }
.thread-msg.is-mine .author-line { text-align: right; }
.thread-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface); }
.thread-form textarea { min-height: 42px; max-height: 120px; }
.thread-form .btn { padding: 10px 20px; height: 42px; align-self: end; }

/* Link cards */
.link-section { margin-bottom: 24px; }
.link-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.link-section-head h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.link-card {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: flex-start;
  padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-decoration: none; color: inherit; transition: all var(--transition); position: relative;
  box-shadow: var(--shadow-xs);
}
.link-card:hover { border-color: var(--border-strong); }
.link-card .lk-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 16px; }
.link-card.kind-phone .lk-icon { background: var(--warn-soft); color: var(--warn); }
.link-card.kind-tip   .lk-icon { background: #F5F3FF; color: #7C3AED; }
.link-card .lk-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.link-card .lk-desc  { font-size: 12px; color: var(--text-faint); margin-top: 4px; line-height: 1.45; }
.link-card .lk-go    { color: var(--primary); }
.link-card .lk-actions { position: absolute; top: 12px; right: 12px; display: none; gap: 4px; }
.link-card:hover .lk-actions { display: flex; }
.link-card .lk-actions button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: white; cursor: pointer; color: var(--text-faint); display: grid; place-items: center; font-size: 11px; }
.link-card .lk-actions button:hover { color: var(--primary); border-color: var(--primary); }
.link-card .lk-actions .delete:hover { color: var(--danger); border-color: var(--danger); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.4); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 150; padding: 20px; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--surface); border-radius: 20px; max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: -0.015em; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); border: 0; cursor: pointer; font-size: 13px; transition: all var(--transition); }
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

.modal-xl { max-width: 820px !important; }

/* ================================================================
   Drawer lateral
   ================================================================ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; background: var(--bg);
  border-left: 0;
  box-shadow: -8px 0 28px rgba(15,23,42,0.08);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  padding: 18px 32px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 2;
  box-shadow: 0 1px 0 var(--border);
}
.drawer-head-inner { width: 100%; }
.drawer-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drawer-head h2 { font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--text); letter-spacing: -0.02em; margin-top: 8px; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.drawer-meta span { display: inline-flex; align-items: center; gap: 5px; }

.drawer-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px 8px 14px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.drawer-back:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.drawer-back i { font-size: 12px; }
.drawer-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.drawer-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); border: 0; cursor: pointer;
  font-size: 15px; display: grid; place-items: center; transition: all var(--transition);
}
.drawer-close:hover { background: var(--danger-soft); color: var(--danger); }

.drawer-body { flex: 1; overflow-y: auto; padding: 28px 32px 56px; }
.drawer-body-inner { width: 100%; }
@media (max-width: 720px) {
  .drawer-head { padding: 16px 18px; }
  .drawer-body { padding: 22px 18px 52px; }
  .drawer { width: 100vw !important; border-radius: 0; border-left: 0; }
}
.drawer-section { margin-bottom: 26px; }
.drawer-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.drawer-section-title i { color: var(--text-faint); font-size: 12px; }

/* Money tiles */
.money-tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media (max-width: 600px) { .money-tiles { grid-template-columns: 1fr; } }
.money-tile { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.money-tile.is-primary { background: var(--primary-soft); border-color: var(--primary-border); }
.money-tile.is-ok      { background: var(--ok-soft); border-color: #A7F3D0; }
.money-tile.is-warn    { background: var(--warn-soft); border-color: #FDE68A; }
.money-tile .lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); }
.money-tile.is-primary .lbl { color: var(--primary); }
.money-tile.is-ok .lbl      { color: var(--ok); }
.money-tile.is-warn .lbl    { color: #92400E; }
.money-tile .val { font-size: 20px; font-weight: 700; margin-top: 4px; color: var(--text); }
.money-tile .sub { font-size: 10px; color: var(--text-faint); margin-top: 3px; }

/* Actor cards */
.actor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .actor-grid { grid-template-columns: 1fr; } }
.actor-box { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; border-radius: var(--radius); display: flex; align-items: flex-start; gap: 12px; }
.actor-box .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.actor-box .role { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.actor-box .nm { font-weight: 600; font-size: 13px; margin-top: 3px; color: var(--text); }
.actor-box .ln { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* People cards */
.people-section { margin-bottom: 26px; }
.people-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.people-section-head .ico { width: 28px; height: 28px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.people-section-head .lbl { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.07em; }
.people-section-head .sub { font-size: 11px; color: var(--text-faint); font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.people-section-head .count { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 2px 8px; background: var(--surface-2); color: var(--text-faint); font-size: 11px; font-weight: 600; border-radius: 999px; border: 1px solid var(--border); }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.people-card {
  display: grid;
  grid-template-areas: "avatar header actions" "avatar meta meta";
  grid-template-columns: 44px 1fr auto;
  gap: 4px 14px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--transition); position: relative;
  box-shadow: var(--shadow-xs);
}
.people-card:hover { border-color: var(--border-strong); }
.people-avatar {
  grid-area: avatar; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 16px; align-self: flex-start;
}
.people-card:hover .people-avatar { border-color: var(--primary-border); color: var(--primary); }
.people-avatar.is-insurer { color: var(--primary); }
.people-header { grid-area: header; min-width: 0; padding-top: 2px; }
.people-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25; letter-spacing: -0.01em; }
.people-role { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; }
.people-actions { grid-area: actions; display: flex; gap: 5px; align-self: flex-start; padding-top: 2px; }
.people-quick {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; text-decoration: none;
  display: grid; place-items: center; font-size: 12px; transition: all var(--transition);
}
.people-quick:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.people-meta {
  grid-area: meta; font-size: 12px; color: var(--text-muted);
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: grid; gap: 5px; line-height: 1.45;
}
.people-card:hover .people-meta { border-top-color: var(--primary-border); }
.people-meta-row { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.people-meta-row i { width: 16px; height: 16px; color: var(--text-faint); font-size: 11px; flex-shrink: 0; display: grid; place-items: center; }
.people-meta-row span, .people-meta-row a { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.people-meta-row a:hover { color: var(--primary); }
.people-meta-row .lbl { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-right: 4px; }

/* ================================================================
   Timeline
   ================================================================ */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border); border-radius: 2px;
}
.tl-item {
  position: relative; padding: 14px 16px 14px 10px;
  border-radius: var(--radius); margin-bottom: 6px; transition: background var(--transition);
}
.tl-item:hover { background: var(--surface-2); }
.tl-item::before {
  content: ''; position: absolute; left: -27px; top: 18px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  z-index: 1; box-shadow: 0 0 0 4px var(--bg);
}
.tl-item .tl-icon {
  position: absolute; left: -25px; top: 20px;
  width: 14px; height: 14px; font-size: 8px;
  display: grid; place-items: center; z-index: 2; color: white; pointer-events: none;
}
.tl-item.is-created::before  { background: var(--primary); border-color: var(--primary); }
.tl-item.is-status::before   { background: var(--primary-dark); border-color: var(--primary-dark); }
.tl-item.is-photo::before    { background: #6366F1; border-color: #6366F1; }
.tl-item.is-comment::before  { background: var(--surface); border-color: var(--border-strong); }
.tl-item.is-comment .tl-icon { color: var(--text-faint); }
.tl-item.is-closed::before   { background: var(--ok); border-color: var(--ok); }
.tl-item.is-pending          { opacity: 0.6; }
.tl-item.is-pending::before  { background: var(--surface); border-color: var(--warn); border-style: dashed; }
.tl-item.is-pending .tl-icon { color: var(--warn); }

.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.tl-time { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-left: auto; white-space: nowrap; }

.tl-actor {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 3px 10px 3px 4px; border-radius: 999px; margin-top: 4px;
}
.tl-actor-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: white;
  display: grid; place-items: center; font-size: 8px; font-weight: 700; flex-shrink: 0;
}
.tl-actor.is-anonymous .tl-actor-dot { background: var(--text-faint); }

.tl-body {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin-top: 8px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); border-left: 3px solid var(--primary-border);
}
.tl-item.is-comment .tl-body { border-left-color: var(--border-strong); }
.tl-item.is-closed .tl-body  { border-left-color: var(--ok); background: var(--ok-soft); color: #065F46; }

.tl-status-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; }
.tl-status-pill .tl-from { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-faint); text-decoration: line-through; font-weight: 500; }
.tl-status-pill .tl-arrow { color: var(--text-faint); font-size: 11px; }
.tl-status-pill .tl-to { padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); font-weight: 600; }

/* ================================================================
   Drawer tabs
   ================================================================ */
.drawer-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  background: var(--bg-deep); border-top: 1px solid var(--border);
  padding: 0 32px; margin: 16px -32px -16px;
}
.drawer-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 13px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-faint); border: 0; background: transparent; cursor: pointer;
  border-bottom: 2px solid transparent; font-family: inherit;
  transition: all var(--transition); position: relative; bottom: -1px;
}
.drawer-tab i { font-size: 13px; }
.drawer-tab:hover { color: var(--text); background: var(--surface); }
.drawer-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); font-weight: 600; }
.drawer-tab .tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 7px;
  background: var(--surface-2); color: var(--text-faint);
  font-size: 10px; font-weight: 600; border-radius: 999px; border: 1px solid var(--border);
}
.drawer-tab.is-active .tab-count { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }

.drawer-pane { display: none; }
.drawer-pane.is-active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .drawer-tabs { padding: 0 18px; margin: 14px -18px -14px; overflow-x: auto; flex-wrap: nowrap; }
  .drawer-tab { padding: 10px 12px; white-space: nowrap; }
}

/* ================================================================
   Form sections
   ================================================================ */
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 16px; }
.form-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-section-num { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.form-section-head h4 { font-size: 14px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: -0.01em; margin: 0; }
.form-section-head .hint-inline { font-size: 11px; color: var(--text-faint); margin-left: auto; }

/* ================================================================
   Viewer HD
   ================================================================ */
.hd-viewer { position: fixed; inset: 0; background: rgba(15,23,42,0.92); z-index: 200; display: flex; flex-direction: column; }
.hd-viewer-head { display: flex; align-items: center; gap: 14px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.hd-viewer-head .name { font-weight: 700; font-size: 14px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-viewer-head .meta { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.hd-viewer-head .actions { display: flex; gap: 8px; }
.hd-viewer-head .actions a, .hd-viewer-head .actions button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; text-decoration: none; font-family: inherit; transition: all var(--transition); }
.hd-viewer-head .actions a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.hd-viewer-head .actions .close { color: white; background: var(--danger); border-color: var(--danger); }
.hd-viewer-body { flex: 1; display: grid; place-items: center; overflow: auto; padding: 24px; }
.hd-viewer-body iframe { width: min(96vw,1100px); height: calc(100vh - 90px); border: 0; background: white; border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.hd-viewer-body img { max-width: 96vw; max-height: calc(100vh - 90px); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.hd-viewer-body .unsupported { background: var(--surface); padding: 40px 32px; border-radius: var(--radius-lg); text-align: center; max-width: 420px; }
.hd-viewer-body .unsupported i { font-size: 32px; color: var(--text-faint); margin-bottom: 16px; }

/* ================================================================
   Documents
   ================================================================ */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.folder-card {
  display: grid; grid-template-columns: 46px 1fr; gap: 14px;
  padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; transition: all var(--transition);
  text-decoration: none; color: inherit; position: relative; box-shadow: var(--shadow-xs);
}
.folder-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.folder-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 20px; }
.folder-card.is-cs .folder-icon { background: #F5F3FF; color: #7C3AED; }
.folder-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.folder-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.folder-stats { font-size: 10px; color: var(--text-faint); margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.folder-stats span { white-space: nowrap; }
.folder-stats strong { color: var(--text-muted); font-weight: 600; }
.folder-vis-pill { position: absolute; top: 14px; right: 14px; font-size: 9px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.folder-vis-public { background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border); }
.folder-vis-cs { background: #F5F3FF; color: #7C3AED; border: 1px solid #DDD6FE; }
.folder-actions { position: absolute; top: 14px; right: 14px; display: none; gap: 4px; }
.folder-card:hover .folder-actions { display: flex; }
.folder-card:hover .folder-vis-pill { display: none; }
.folder-actions button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-faint); display: grid; place-items: center; font-size: 11px; }
.folder-actions button:hover { color: var(--primary); border-color: var(--primary); }
.folder-actions button.delete:hover { color: var(--danger); border-color: var(--danger); }

.folder-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 16px; text-decoration: none;
}
.folder-back:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.dropzone-large {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; background: var(--surface-2);
  cursor: pointer; transition: all var(--transition); margin-bottom: 18px;
}
.dropzone-large:hover, .dropzone-large.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-large i { font-size: 28px; color: var(--primary); display: block; margin-bottom: 14px; }
.dropzone-large .dz-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dropzone-large .dz-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.file-list { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: all var(--transition); }
.file-row > div:nth-child(2) { flex: 1; min-width: 0; }
.file-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row:hover { border-color: var(--primary-border); box-shadow: var(--shadow-xs); }
.file-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 15px; }
.file-icon.pdf   { background: #FEF2F2; color: #DC2626; }
.file-icon.image { background: #EEF2FF; color: var(--primary); }
.file-icon.sheet { background: var(--ok-soft); color: var(--ok); }
.file-icon.word  { background: #EEF2FF; color: var(--primary); }
.file-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.file-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.file-action { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; display: grid; place-items: center; font-size: 12px; text-decoration: none; transition: all var(--transition); }
.file-action:hover { border-color: var(--primary); color: var(--primary); }
.file-action.delete:hover { border-color: var(--danger); color: var(--danger); }

/* ================================================================
   Discussions / forum
   ================================================================ */
.topic-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); overflow: hidden; }
.topic-card {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px;
  padding: 14px 18px; cursor: pointer; transition: background 0.12s;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.topic-card:last-child { border-bottom: 0; }
.topic-card:hover { background: var(--surface-2); }
.topic-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.topic-main { min-width: 0; }
.topic-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-snippet { font-size: 13px; color: var(--text-muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.topic-meta { font-size: 12px; color: var(--text-faint); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topic-meta strong { color: var(--text-muted); font-weight: 600; }
.topic-stats { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; justify-content: center; }
.topic-replies { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.topic-replies i { color: var(--text-faint); font-size: 11px; }
.topic-time { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* Topic detail */
.thread-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 18px; text-decoration: none;
}
.thread-back:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.thread-topic-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 18px; box-shadow: var(--shadow-xs); }
.thread-topic-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 14px; }
.thread-topic-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-faint); padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.thread-topic-body { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

.thread-replies { display: grid; gap: 12px; margin-bottom: 18px; }
.thread-reply {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.thread-reply.is-mine { background: var(--primary-soft); border-color: var(--primary-border); }
.thread-reply .avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.thread-reply .author-line { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-reply .author-time { font-weight: 400; color: var(--text-faint); font-size: 11px; }
.thread-reply .reply-body { font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

.reply-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.reply-form textarea { min-height: 80px; }
.reply-form .reply-actions { display: flex; justify-content: flex-end; margin-top: 12px; gap: 8px; }

/* Required marker */
.req { color: var(--danger); font-weight: 700; }

/* Input with icon */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; pointer-events: none; z-index: 1; }
.input-icon > input { padding-left: 40px !important; }
.input-icon > input[type="date"] { padding-left: 40px !important; padding-right: 16px !important; }
.input-icon > input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.5; padding: 4px; }
.input-icon > input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.input-icon-suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 11px; font-weight: 600; pointer-events: none; }
.input-icon > input.has-suffix { padding-right: 52px !important; }

/* Subgroup */
.subgroup { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 6px; }
.subgroup + .subgroup { margin-top: 14px; }
.subgroup-title { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.subgroup-title i { color: var(--text-faint); font-size: 12px; }
.subgroup .field { margin-bottom: 0; }

/* PDF upload zone */
.pdf-dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px 18px; text-align: center; background: var(--surface-2); cursor: pointer; transition: all var(--transition); }
.pdf-dropzone:hover, .pdf-dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.pdf-dropzone i { font-size: 24px; color: var(--primary); display: block; margin-bottom: 10px; }
.pdf-dropzone .pdz-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pdf-dropzone .pdz-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.pdf-list { margin-top: 14px; display: grid; gap: 8px; }
.pdf-item { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pdf-item .pdf-ic { width: 36px; height: 36px; border-radius: 10px; background: #FEF2F2; color: #DC2626; display: grid; place-items: center; font-size: 13px; }
.pdf-item .pdf-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.pdf-item .pdf-meta { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.pdf-item .pdf-role { font-size: 10px; padding: 0; }
.pdf-item .pdf-role select { padding: 4px 8px !important; font-size: 11px !important; min-width: auto; width: auto; }
.pdf-item .pdf-remove { background: transparent; border: 1px solid var(--border); color: var(--text-faint); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; font-size: 11px; transition: all var(--transition); }
.pdf-item .pdf-remove:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* ================================================================
   AI insight
   ================================================================ */
.ai-empty { text-align: center; padding: 40px 24px; background: var(--surface-2); border: 1.5px dashed var(--border); border-radius: var(--radius-lg); }
.ai-empty .ai-icon { width: 50px; height: 50px; border-radius: 50%; background: var(--grad-primary); color: white; display: grid; place-items: center; font-size: 20px; margin: 0 auto 16px; }
.ai-empty h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; text-transform: none; letter-spacing: -0.01em; color: var(--text); }
.ai-empty p { font-size: 13px; max-width: 420px; margin: 0 auto 18px; color: var(--text-muted); }

.ai-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; }
.ai-header { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.ai-header .ai-spark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad-primary); color: white; display: grid; place-items: center; font-size: 13px; }
.ai-header .ai-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ai-header .ai-conf { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text-faint); padding: 4px 12px; border-radius: 999px; background: var(--surface-2); }

.ai-summary { font-size: 13px; line-height: 1.7; color: var(--text); padding: 14px 16px; background: var(--primary-soft); border-radius: var(--radius); margin-bottom: 18px; }
.ai-summary strong { color: var(--primary); font-weight: 700; }

.ai-block { margin-top: 18px; }
.ai-block-title { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ai-block-title i { color: var(--text-faint); }

.ai-dates { display: grid; gap: 8px; }
.ai-date-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius); border-left: 3px solid var(--border); }
.ai-date-row.is-info { border-left-color: var(--primary); }
.ai-date-row.is-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.ai-date-row.is-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.ai-date-row .ai-date-label { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-date-row .ai-date-val { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.ai-date-row .ai-date-rel { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.ai-date-row.is-warn .ai-date-rel { color: #92400E; }
.ai-date-row.is-danger .ai-date-rel { color: var(--danger); font-weight: 600; }

.ai-deductibles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ai-deductible { background: var(--surface-2); border: 1px solid var(--border); padding: 14px 16px; border-radius: var(--radius); }
.ai-deductible .lbl { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.ai-deductible .amt { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 3px; }
.ai-deductible .amt.is-zero { color: var(--ok); }
.ai-deductible .nt { font-size: 10px; color: var(--text-faint); margin-top: 4px; line-height: 1.45; }

.ai-alerts { display: grid; gap: 8px; }
.ai-alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius); }
.ai-alert.is-info { background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary-deeper); }
.ai-alert.is-warn { background: var(--warn-soft); border: 1px solid #FDE68A; color: #92400E; }
.ai-alert.is-danger { background: var(--danger-soft); border: 1px solid #FECACA; color: var(--danger); }
.ai-alert i { font-size: 14px; margin-top: 1px; }
.ai-alert .ai-alert-title { font-size: 13px; font-weight: 700; }
.ai-alert .ai-alert-msg { font-size: 12px; line-height: 1.6; margin-top: 3px; }

.ai-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.ai-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--text); padding: 8px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ai-list li::before { content: '\2022'; color: var(--primary); font-weight: 700; flex-shrink: 0; }

/* ================================================================
   Scrollbar
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ================================================================
   Responsive sidebar mobile
   ================================================================ */
@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 50;
    transform: translateX(-100%);
    transition: transform .35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sb-close-mobile { display: grid; }
}
@media (min-width: 961px) {
  .sb-close-mobile { display: none; }
}

.sb-close-mobile {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-deep); border: none;
  color: var(--text-faint); cursor: pointer; font-size: 12px;
  place-items: center; justify-content: center;
}
.sb-close-mobile:hover { background: var(--border); color: var(--text); }

/* ═══════════════════════════════════════════════════════════════════
   Harmonized Date Inputs
   ═══════════════════════════════════════════════════════════════════ */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  min-height: 42px;
  width: 100%;
  box-sizing: border-box;
}

input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="month"]:hover,
input[type="week"]:hover,
input[type="time"]:hover {
  border-color: var(--primary-border);
}

input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Calendar icon styling */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  filter: invert(30%) sepia(80%) saturate(2000%) hue-rotate(230deg);
  transition: opacity var(--transition);
}

input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Placeholder color when empty */
input[type="date"]:invalid,
input[type="date"][value=""] {
  color: var(--text-muted);
}

/* ================================================================
   Mobile-first responsive enhancements
   ================================================================ */

/* -- Bottom tab bar (mobile only) -- */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: var(--surface);
  border-top: 1px solid var(--border);
  display: none; z-index: 60;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 960px) {
  .bottom-bar { display: flex; justify-content: space-around; align-items: center; }
}
.bottom-bar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 0; min-width: 56px;
  font-size: 10px; font-weight: 500; color: var(--text-faint);
  text-decoration: none; transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.bottom-bar-item i { font-size: 18px; line-height: 1; }
.bottom-bar-item.is-active { color: var(--primary); }
.bottom-bar-item:hover { color: var(--primary); }

/* -- Modals → bottom-sheet on mobile -- */
@media (max-width: 600px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 85vh; overflow-y: auto;
    animation: slide-up .25s ease;
  }
  @keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
}

/* -- Modal size variants -- */
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 640px; }

/* -- Filter pills horizontal scroll on mobile -- */
@media (max-width: 720px) {
  .chip-row, .in-filters, .filter-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 6px; padding-bottom: 4px; }
  .chip-row::-webkit-scrollbar, .in-filters::-webkit-scrollbar, .filter-bar::-webkit-scrollbar { display: none; }
  .chip, .in-filter, .in-view-toggle, .filter-tag { flex-shrink: 0; }
}

/* -- Loading spinner -- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: grid; place-items: center; padding: 48px; }

/* -- KPI tiles mobile -- */
@media (max-width: 600px) {
  .stat-box { padding: 12px 14px; }
  .stat-box .value, .stat-box span[style*="font-size:28px"], .stat-box span[style*="font-size: 28px"] { font-size: 22px !important; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-tile { padding: 14px 16px; }
  .kpi-tile .value { font-size: 22px; }
  .kpi-tile .ico { width: 28px; height: 28px; font-size: 12px; right: 12px; top: 12px; }
}

/* ================================================================
   Responsive — Tablette (768px - 960px)
   ================================================================ */
@media (max-width: 960px) and (min-width: 601px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .dash-main { grid-template-columns: 1fr !important; }
  .page { padding: 20px; }
}

/* ================================================================
   Responsive — Mobile (< 600px)
   ================================================================ */
@media (max-width: 600px) {
  h1 { font-size: 20px !important; }
  h2 { font-size: 16px !important; }
  .page { padding: 16px 14px 72px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-box .s-val { font-size: 24px; }
  .stat-box .s-label { font-size: 10px; }
  .dash-main { grid-template-columns: 1fr !important; }
  .dash-greeting h1 { font-size: 20px !important; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn--lg { padding: 12px 20px; }
  .topbar-inner { padding: 10px 16px; }
  .topbar-nav { gap: 4px; }
  .topbar-nav a { padding: 6px 8px; font-size: 12px; }

  /* Dashboard actions rapides */
  .copro-actions { gap: 8px !important; }
  .copro-action { padding: 12px 14px !important; }

  /* Modals */
  .modal-backdrop { padding: 0 !important; align-items: flex-end !important; }
  .modal { max-width: 100% !important; margin: 0 !important; border-radius: 8px 8px 0 0 !important; max-height: 90vh; overflow-y: auto; }

  /* Tables */
  .mc-table { font-size: 11px; }
  .mc-table th, .mc-table td { padding: 8px 6px; }

  /* Drawer */
  .drawer { width: 100vw !important; border-radius: 0 !important; }
}

/* ================================================================
   Responsive — Très petit écran (< 400px)
   ================================================================ */
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
  .topbar-nav a span { display: none; }
}

/* ── Champ mot de passe avec bouton afficher/masquer ── */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { width: 100%; padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: none; cursor: pointer; color: var(--text-faint, #888);
  border-radius: 6px;
}
.pwd-toggle:hover { color: var(--text-muted, #555); background: rgba(0,0,0,.04); }
