@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root,
:root[data-theme="light"] {
  --font: 'Outfit', 'Poppins', system-ui, -apple-system, sans-serif;

  --page-bg:    #E9E8F3;
  --bg-deep:    #EDECF6;
  --bg-base:    #F7F7FB;

  --surface-1:  #FFFFFF;
  --surface-2:  #F5F5FA;
  --surface-3:  #EDEDF5;
  --surface-4:  #E2E1EC;

  --border:      #ECEBF3;
  --border-soft: #F2F1F7;
  --border-strong: #DDDCE8;
  --border-focus: rgba(91,76,245,.45);

  --brand:      #5B4CF5;
  --brand-2:    #4A3BE3;
  --brand-3:    #5144E8;
  --brand-soft: #8E84FA;
  --brand-glow: rgba(91,76,245,.22);
  --brand-bg:   #EFEDFF;
  --brand-bg2:  #F6F5FF;

  --ink:        #1A1930;
  --ink-2:      #24233D;
  --ink-3:      #2E2D4A;
  --ink-text:   #F3F2FF;
  --ink-muted:  #A3A1C2;

  --text-1: #16152B;
  --text-2: #4A4964;
  --text-3: #8B8AA3;
  --text-4: #B8B7CB;

  --green:     #0FA97B;
  --green-bg:  #E5F7F0;
  --green-glow: rgba(15,169,123,.25);
  --red:       #EC4359;
  --red-bg:    #FDECEE;
  --red-glow:  rgba(236,67,89,.22);
  --yellow:    #E59A0B;
  --yellow-bg: #FEF4E2;
  --accent:    #3B7BF6;
  --accent-bg: #E9F0FE;
  --accent-glow: rgba(59,123,246,.22);
  --cyan:      #0AA5C2;
  --cyan-bg:   #E3F6FA;
  --orange:    #F2702E;
  --orange-bg: #FEEEE5;
  --pink:      #E2488A;
  --pink-bg:   #FDEAF2;
  --purple:    #8B5CF6;
  --purple-light: #F1EBFE;

  --r-xs:  6px;
  --r-sm:  12px;
  --r:     18px;
  --r-lg:  24px;
  --r-xl:  30px;
  --r-2xl: 36px;

  --sh-sm: 0 1px 2px rgba(22,21,43,.04), 0 1px 3px rgba(22,21,43,.04);
  --sh:    0 6px 24px -8px rgba(22,21,43,.10);
  --sh-lg: 0 18px 48px -14px rgba(22,21,43,.18);
  --sh-xl: 0 30px 80px -20px rgba(22,21,43,.28);
  --sh-brand: 0 10px 28px -8px rgba(91,76,245,.55);
  --sh-green: 0 10px 28px -8px rgba(15,169,123,.45);

  --header-h: 84px;
  --logo-fill: linear-gradient(135deg, #3B62E3 0%, #5644D4 62%, #5A3FD6 100%);
  --illu-ink: #2A2940; --illu-ink-2: #1F1E33; --illu-screen: #3A3858;
  --nav-pill: #1A1930;
  --frame-w: 1520px;
}

:root[data-theme="dark"] {
  --page-bg:    #0B0A16;
  --bg-deep:    #0E0D1C;
  --bg-base:    #12111F;

  --surface-1:  #1A1930;
  --surface-2:  #201F38;
  --surface-3:  #292844;
  --surface-4:  #343353;

  --border:      rgba(255,255,255,.07);
  --border-soft: rgba(255,255,255,.04);
  --border-strong: rgba(255,255,255,.14);
  --border-focus: rgba(142,132,250,.55);

  --brand-3:    #A79FFF;
  --brand-bg:   rgba(91,76,245,.18);
  --brand-bg2:  rgba(91,76,245,.10);

  --ink:        #0F0E1F;
  --ink-2:      #1C1B33;
  --ink-3:      #27264280;

  --text-1: #F1F0FB;
  --text-2: #B9B8D3;
  --text-3: #7F7E9C;
  --text-4: #4F4E6C;

  --green:     #2CCB98;  --green-bg:  rgba(44,203,152,.13);
  --red:       #FF5D72;  --red-bg:    rgba(255,93,114,.13);
  --yellow:    #FFB938;  --yellow-bg: rgba(255,185,56,.13);
  --accent:    #5E96FF;  --accent-bg: rgba(94,150,255,.13);
  --cyan:      #2BC7E3;  --cyan-bg:   rgba(43,199,227,.13);
  --orange:    #FF8A4C;  --orange-bg: rgba(255,138,76,.13);
  --pink:      #FF6AA7;  --pink-bg:   rgba(255,106,167,.13);
  --purple-light: rgba(139,92,246,.15);

  --sh-sm: 0 1px 3px rgba(0,0,0,.4);
  --sh:    0 8px 28px -10px rgba(0,0,0,.6);
  --sh-lg: 0 18px 50px -14px rgba(0,0,0,.7);
  --sh-xl: 0 30px 80px -20px rgba(0,0,0,.8);
  --nav-pill: #08071A;
  --logo-fill: #FFFFFF;
  --illu-ink: #8C89B8; --illu-ink-2: #6E6B9C; --illu-screen: #4B4880;
}

:root {
  --gray-50:  var(--surface-2);
  --gray-100: var(--surface-3);
  --gray-200: var(--surface-4);
  --gray-300: var(--surface-4);
  --gray-400: var(--text-4);
  --gray-500: var(--text-3);
  --gray-600: var(--text-3);
  --gray-700: var(--text-2);
  --gray-800: var(--text-2);
  --gray-900: var(--text-1);
  --t1: var(--text-1); --t2: var(--text-2); --t3: var(--text-3);
  --s1: var(--surface-1); --s2: var(--surface-2); --s3: var(--surface-3);
  --b-soft: var(--border-soft);
  --gbg: var(--green-bg);
}

:root {
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-mono: var(--mono);
  --r-full: 9999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: .15s; --dur: .22s; --dur-slow: .35s;

  --bg: var(--bg-base);
  --surface: var(--surface-1);
  --surface-light: var(--surface-2);
  --text: var(--text-1);
  --text-muted: var(--text-2);
  --text-faint: var(--text-3);
  --brand-light: var(--brand-3);
  --brand-dark: var(--brand-2);
  --brand-subtle: var(--brand-bg);
  --primary: var(--brand);
  --primary-light: var(--brand-3);
  --primary-dark: var(--brand-2);
  --primary-glow: var(--brand-glow);
  --primary-bg: var(--brand-bg);
  --success: var(--green);
  --success-light: var(--green-bg);
  --danger: var(--red);
  --danger-light: var(--red-bg);
  --warning: var(--yellow);
  --warning-light: var(--yellow-bg);
  --info: var(--accent);
  --info-light: var(--accent-bg);
  --green-light: var(--green-bg);
  --red-light: var(--red-bg);
  --yellow-light: var(--yellow-bg);
  --cyan-light: var(--cyan-bg);
  --blue: var(--accent);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r);
  --radius-lg: var(--r-lg);
  --radius-full: var(--r-full);
  --shadow: var(--sh);
  --shadow-sm: var(--sh-sm);
  --shadow-lg: var(--sh-lg);
  --shadow-xl: var(--sh-xl);
  --tr: var(--dur) var(--ease);
  --transition: all var(--dur) var(--ease);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; }
body { line-height: 1.6; min-height: 100vh; overflow-x: visible; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { text-decoration: none; transition: color var(--dur) var(--ease); }
img, video, canvas, svg { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; background: none; color: inherit; }
ul, ol { list-style: none; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
pre, code { overflow-x: auto; max-width: 100%; white-space: pre-wrap; }
table { border-collapse: collapse; }
.mono { font-family: var(--mono); }

.grid { display: grid; gap: 18px; }
.grid > *, [class*="grid-"] > * { min-width: 0; min-height: 0; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
@media (max-width: 1280px) { .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.d-flex { display: flex; } .d-none { display: none !important; } .d-block { display: block; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; } .flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; } .gap-4 { gap: 22px; }
.w-full { width: 100%; } .h-full { height: 100%; }
.text-center { text-align: center; } .text-right { text-align: right; }
.me-2 { margin-right: 10px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.text-1 { color: var(--text-1) !important; } .text-2 { color: var(--text-2) !important; } .text-3 { color: var(--text-3) !important; }
.text-green { color: var(--green) !important; } .text-red { color: var(--red) !important; } .text-brand { color: var(--brand-3) !important; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.overflow-hidden { overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); line-height: 1.2; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap; user-select: none;
  color: var(--text-1); background: var(--surface-2);
}
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-purple { background: var(--purple) !important; border-color: var(--purple) !important; color: #fff !important; }

.form-group { margin-bottom: 22px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: flex; gap: 20px; }
.form-row > .form-group { flex: 1; min-width: 0; margin-bottom: 0; }
.form-row { margin-bottom: 22px; }
.form-row:last-child { margin-bottom: 0; }
.form-group { display: flex; flex-direction: column; min-width: 0; }
.form-group > .form-label { margin-top: auto; }
.form-group > .form-label + * { margin-top: 0; }
.form-group > :is(button, .btn, img, a, .badge) { align-self: flex-start; }
.form-label { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.form-label .req, .form-label .required, .required { color: var(--red); margin-left: 2px; }
.form-control, .fc { width: 100%; outline: none; line-height: 1.5; min-height: 46px; font-family: var(--font); }
textarea.form-control, textarea.fc { min-height: 110px; resize: vertical; line-height: 1.6; }
select.form-control, select.fc { cursor: pointer; }
.form-control:disabled, .form-control[readonly] { opacity: .7; cursor: not-allowed; }
.form-hint { font-size: .76rem; color: var(--text-3); margin-top: 6px; }
.form-error { font-size: .76rem; color: var(--red); margin-top: 6px; }
.form-section { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 8px; }
.form-section-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.input-group { display: flex; align-items: stretch; }
.input-group > .form-control { flex: 1; min-width: 0; }
.input-group-text { display: flex; align-items: center; padding: 0 16px; font-size: .86rem; white-space: nowrap; }
.check, .f-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input, .f-check input { width: 16px; height: 16px; cursor: pointer; }
@media (max-width: 640px) { .form-row { flex-direction: column; gap: 0; } .form-row > .form-group { margin-bottom: 22px; } .form-row > .form-group:last-child { margin-bottom: 0; } }

.table { width: 100%; }
.table th { text-align: left; }
.table td { vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none !important; }
.table-responsive, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; line-height: 1.3; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert i { flex-shrink: 0; margin-top: 2px; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 1050;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 580px; max-height: min(94vh, 1000px);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.96) translateY(14px); transition: transform .25s var(--ease-spring);
}
.modal-overlay.open .modal { transform: none; }
.modal-sm { max-width: 440px; } .modal-lg { max-width: 800px; } .modal-xl { max-width: 1000px; }
.modal > form, .modal > .modal-form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.modal-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 26px; position: relative; z-index: 2; }
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-title i { color: var(--brand); }
.modal-title { color: var(--text-1) !important; min-width: 0; }
.modal-title span { color: inherit; }
.modal-header[data-tone] .modal-title > i:first-child {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: .95rem;
  background: var(--brand-bg); color: var(--brand-3, var(--brand)) !important;
}
.modal-header[data-tone="green"] .modal-title > i:first-child { background: var(--green-bg); color: var(--green) !important; }
.modal-header[data-tone="amber"] .modal-title > i:first-child { background: var(--yellow-bg); color: var(--yellow) !important; }
.modal-header[data-tone="red"]   .modal-title > i:first-child { background: var(--red-bg); color: var(--red) !important; }
.modal-close { flex-shrink: 0; cursor: pointer; font-size: .85rem; transition: all var(--dur-fast); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px; }
.modal-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 26px; position: relative; z-index: 2; }
.modal-footer .btn { min-width: 110px; }
.modal-footer:not(:has(*)) { display: none !important; }
.modal-footer > :only-child { margin-left: auto; }
.modal-footer.wz-footer { justify-content: flex-end !important; }
.wz-left { display: flex; align-items: center; gap: 14px; margin-right: auto; min-width: 0; }
.wz-step { font-size: .78rem; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.wz-done::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7em; margin-left: 7px; color: var(--green); }
.tab-btn.active.wz-done::after, .prof-tab-btn.active.wz-done::after { color: inherit; }
@media (max-width: 480px) { .wz-step { display: none; } }
.modal .file-drop { padding: 18px 14px; }
@media (max-width: 640px) { .modal-body { padding: 18px; } .modal-header, .modal-footer { padding: 16px 18px; } }

.tab-content { display: none; }
.tab-content.active { display: block; animation: nvFade .2s ease both; }
.tab-btn, .fiche-tab-btn, .prof-tab-btn { font-family: var(--font); white-space: nowrap; }

.page-btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font); transition: all var(--dur-fast); }
.page-btn:disabled { opacity: .35; pointer-events: none; }

.file-drop { padding: 26px 20px; text-align: center; cursor: pointer; }
.file-drop .fd-ico { font-size: 1.6rem; color: var(--brand-3); margin-bottom: 10px; display: block; }
.file-drop h5 { font-size: .86rem; color: var(--text-1); font-weight: 600; }
.file-drop p { font-size: .78rem; color: var(--text-3); margin-top: 4px; }
.file-drop input { display: none; }
.file-name { font-size: .78rem; color: var(--brand-3); font-weight: 600; margin-top: 6px; }

.spinner { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--surface-4); border-top-color: var(--brand); animation: spin .65s linear infinite; }
.spin-sm, .sp-sm { width: 16px !important; height: 16px !important; }
.spin-md, .sp-md { width: 24px !important; height: 24px !important; }
.spin-lg, .sp-lg, .spinner-lg { width: 38px !important; height: 38px !important; border-width: 3.5px !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.progress { height: 6px; overflow: hidden; }
.progress-bar { height: 100%; transition: width 1.2s var(--ease-out); background: var(--brand); }
.progress-bar.success { background: var(--green); } .progress-bar.danger { background: var(--red); }
.progress-bar.warning { background: var(--yellow); } .progress-bar.info { background: var(--accent); }
.stat-progress { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.stat-progress-bar { height: 100%; border-radius: 99px; background: var(--brand); transition: width 1.2s var(--ease-out); }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.stat-trend.up { background: var(--green-bg); color: var(--green); } .stat-trend.down { background: var(--red-bg); color: var(--red); }

.avatar { display: flex; align-items: center; justify-content: center; font-weight: 600; overflow: hidden; flex-shrink: 0; position: relative; isolation: isolate; }
.avatar img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: 100% !important; object-fit: cover; border-radius: 50%; }
.avatar-xs { width: 24px; height: 24px; min-width: 24px; font-size: .62rem; }
.avatar-sm { width: 32px; height: 32px; min-width: 32px; font-size: .72rem; }
.avatar-md { width: 40px; height: 40px; min-width: 40px; font-size: .85rem; }
.avatar-lg { width: 52px; height: 52px; min-width: 52px; font-size: 1rem; }
.avatar-xl { width: 96px; height: 96px; min-width: 96px; font-size: 1.8rem; }
.avatar-2xl { width: 120px; height: 120px; min-width: 120px; font-size: 2.2rem; }

.empty-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state h4 { font-size: .95rem; font-weight: 600; }
.empty-state p { font-size: .84rem; max-width: 300px; line-height: 1.5; }

.steps { display: flex; }
.step { flex: 1; text-align: center; position: relative; }
.step::after { content: ''; position: absolute; top: 16px; left: 50%; right: -50%; height: 2px; background: var(--surface-4); z-index: 0; }
.step:last-child::after { display: none; }
.step.done::after { background: var(--green); }
.step-circle { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; margin: 0 auto 8px; position: relative; z-index: 1; transition: all var(--dur); }
.step.done .step-label { color: var(--green); }

.transaction-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.transaction-row:last-child { border-bottom: none; }
.trx-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; flex-shrink: 0; }
.trx-icon.revenu { background: var(--green-bg); color: var(--green); } .trx-icon.depense { background: var(--red-bg); color: var(--red); }
.trx-info { flex: 1; min-width: 0; }
.trx-title { font-size: .88rem; font-weight: 500; color: var(--text-1); }
.trx-subtitle { font-size: .76rem; color: var(--text-3); }
.trx-amount { font-size: .9rem; font-weight: 600; } .trx-amount.revenu { color: var(--green); } .trx-amount.depense { color: var(--red); }
.trx-date { font-size: .72rem; color: var(--text-3); }

.budget-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.budget-bar-info { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; }
.budget-bar-title { color: var(--text-2); }
.budget-bar-pct { font-weight: 600; } .budget-bar-pct.ok { color: var(--green); } .budget-bar-pct.warning { color: var(--yellow); } .budget-bar-pct.danger { color: var(--red); }
.budget-details { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text-3); margin-top: 4px; }

.stat-card-mini { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: flex; align-items: center; gap: 14px; min-width: 0; box-shadow: var(--sh); }
.stat-card-mini .sc-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.stat-card-mini .sc-val { font-size: 1.3rem; font-weight: 600; color: var(--text-1); line-height: 1; }
.stat-card-mini .sc-lbl { font-size: .76rem; color: var(--text-3); margin-top: 4px; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.print-header { display: none; }

@media print {
  .page-header-actions, .filters-bar, .pagination, .btn, button, .modal-overlay, .toast-wrap { display: none !important; }
  html, body { background: #fff !important; color: #111 !important; font-size: 11px !important; }
  .page-content { padding: 0 !important; }
  .card { border: 1px solid #e5e7eb !important; box-shadow: none !important; break-inside: avoid; background: #fff !important; }
  table { border-collapse: collapse !important; width: 100% !important; }
  th { background: #1A1930 !important; color: #fff !important; padding: 6px 8px !important; font-size: 10px !important; }
  td { padding: 5px 8px !important; border-bottom: 1px solid #e5e7eb !important; font-size: 10px !important; color: #111 !important; }
  .print-header { display: block !important; margin-bottom: 16px; }
  .badge { border: 1px solid #ccc !important; background: #f3f4f6 !important; color: #374151 !important; }
  @page { margin: 1.5cm; size: A4; }
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text-1);
  letter-spacing: -.005em;
}
body, button, input, select, textarea { font-family: var(--font); }
a { color: var(--brand-3); }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; }
::selection { background: var(--brand); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-soft); background-clip: padding-box; }

.app-layout {
  --layout-pad: 18px;
  display: block;
  min-height: 100vh;
  padding: var(--layout-pad);
}
.main-content {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: var(--frame-w);
  margin: 0 auto !important;
  min-height: calc(100vh - 120px);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(255,255,255,.6) inset;
  display: flex; flex-direction: column;
  height: auto !important;
  overflow: visible !important;
}
:root[data-theme="dark"] .main-content { box-shadow: var(--sh-lg), 0 0 0 1px rgba(255,255,255,.04) inset; }
.page-content {
  flex: 1;
  padding: 30px 36px 40px !important;
  max-width: none;
  overflow: visible !important;
  animation: none !important; transform: none !important;
}
#sidebar.sidebar { display: none; }
.sidebar-overlay { display: none; }

.nv-header {
  position: -webkit-sticky; position: sticky; top: 12px; z-index: 900;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 16px;
  max-width: var(--frame-w); margin: 0 auto 18px;
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  box-shadow: var(--sh);
  transition: box-shadow .2s;
}
.nv-header.scrolled { box-shadow: var(--sh-lg); }
.nv-header::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: calc(-1 * var(--layout-pad)); right: calc(-1 * var(--layout-pad)); bottom: calc(100% + 1px); height: 40px;
  background: var(--page-bg);
}
.nv-left { grid-column: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.nv-header .nv-nav { grid-column: 2; justify-self: center; }
.nv-header .nv-actions { grid-column: 3; justify-self: end; }
.nv-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; flex-shrink: 0; padding: 4px 6px; border-radius: 12px; }
.nv-brand:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nv-logo {
  display: inline-block; flex-shrink: 0; vertical-align: middle;
  background: var(--logo-fill);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: left center; mask-position: left center;
  transition: background .25s ease;
}
.nv-logo-fallback { display: inline-grid; place-items: center; color: var(--brand); font-size: 1.1rem; }
.nv-brand-logo {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(140deg, var(--brand) 0%, #8E7CFF 100%);
  color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: -.5px;
  box-shadow: var(--sh-brand);
}
.nv-brand-logo.has-img { background: linear-gradient(140deg, #24233D 0%, var(--ink) 100%); box-shadow: 0 10px 24px -10px rgba(26,25,48,.7); }
.nv-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.nv-brand-logo.wide { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 46px; height: 50px; padding: 0 16px; border-radius: 16px; }
.nv-brand-logo.wide img { display: block; width: auto; height: 30px; max-width: 160px; padding: 0; object-fit: contain; }
.nv-brand-logo.wide.sm { height: 34px; padding: 0 12px; border-radius: 11px; box-shadow: none; }
.nv-brand-logo.wide.sm img { height: 20px; }
.nv-brand-logo i { font-size: 1.1rem; }
.nv-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nv-brand-text strong { font-size: 1.32rem; font-weight: 700; color: var(--text-1); letter-spacing: -.03em; }
.nv-brand-text small  { font-size: .7rem; color: var(--text-3); font-weight: 500; margin-top: 3px; white-space: nowrap; }

.nv-chip {
  height: 46px; min-width: 46px; padding: 0 14px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-1); font-weight: 600; font-size: .95rem;
  box-shadow: var(--sh-sm); flex-shrink: 0;
}

.nv-nav {
  display: flex; align-items: center; gap: 2px;
  padding: 5px; border-radius: 99px;
  background: var(--nav-pill);
  box-shadow: 0 12px 30px -12px rgba(26,25,48,.55);
  min-width: 0;
}
.nv-nav-item { position: relative; }
.nv-nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 99px;
  color: rgba(255,255,255,.72); font-size: .86rem; font-weight: 500;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  background: transparent; border: none;
  transition: background .18s, color .18s;
}
.nv-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nv-nav-link.active {
  color: #fff; background: var(--brand);
  box-shadow: 0 6px 18px -4px rgba(91,76,245,.8);
}
.nv-nav-link .nv-caret { font-size: .58rem; opacity: .7; transition: transform .2s; }
.nv-nav-item.open .nv-caret { transform: rotate(180deg); }
.nv-nav-link .nv-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: #fff; color: var(--brand); font-size: .66rem; font-weight: 700;
  display: inline-grid; place-items: center;
}

.nv-menu {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 6px); opacity: 0; pointer-events: none;
  min-width: 270px; padding: 8px;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--sh-xl);
  transition: opacity .18s, transform .18s;
  z-index: 400;
}
.nv-nav-item.open .nv-menu { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.nv-menu-title { font-size: .68rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px 6px; }
.nv-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 14px;
  color: var(--text-1); text-decoration: none; font-size: .88rem; font-weight: 500;
  transition: background .15s;
}
.nv-menu a:hover { background: var(--surface-2); }
.nv-menu a.active { background: var(--brand-bg); color: var(--brand-3); }
.nv-menu a .nv-mi {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--brand-3); font-size: .88rem;
}
.nv-menu a.active .nv-mi { background: var(--brand); color: #fff; }
.nv-menu a .nv-mtxt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.nv-menu a .nv-mtxt small { font-size: .72rem; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.nv-menu a .nv-mbadge { margin-left: auto; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; border-radius: 99px; padding: 2px 7px; }

.nv-spacer { flex: 1; }
.nv-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nv-icon-btn {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-1); font-size: 1rem; cursor: pointer;
  box-shadow: var(--sh-sm); text-decoration: none;
  transition: transform .15s, background .15s, color .15s;
}
.nv-icon-btn:hover { transform: translateY(-1px); color: var(--brand-3); }
.nv-icon-btn .nv-dot {
  position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--surface-1);
}
.nv-icon-group { display: flex; gap: 8px; }
.nv-avatar {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(140deg, var(--brand), #9C8CFF);
  color: #fff; font-weight: 700; font-size: .9rem;
  box-shadow: 0 0 0 3px var(--surface-1), var(--sh);
}
.nv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nv-burger { display: none; }
.nv-search-trigger { gap: 10px; padding: 0 16px 0 14px; color: var(--text-3); font-weight: 400; font-size: .85rem; cursor: pointer; }
.nv-search-trigger kbd {
  font-family: var(--font); font-size: .68rem; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 2px 6px;
}

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 12px);
  min-width: 250px; padding: 8px;
  background: var(--surface-1) !important; border: 1px solid var(--border) !important;
  border-radius: 20px !important; box-shadow: var(--sh-xl) !important;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .18s, transform .18s; z-index: 500;
}
.dropdown-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.d-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-size: .86rem; font-weight: 500; text-decoration: none;
}
.d-item i { width: 18px; text-align: center; color: var(--text-3); }
.d-item:hover { background: var(--surface-2); color: var(--text-1); }
.d-item.danger, .d-item.danger i { color: var(--red); }
.d-item.danger:hover { background: var(--red-bg); }
.d-divider { height: 1px; background: var(--border); margin: 6px 4px; }

.notif-panel {
  position: absolute; right: 0; top: calc(100% + 12px);
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface-1) !important; border: 1px solid var(--border) !important;
  border-radius: 24px !important; box-shadow: var(--sh-xl) !important; overflow: hidden;
  z-index: 500;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.notif-panel.open { opacity: 1; pointer-events: auto; transform: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.notif-head h5 { font-size: .95rem; font-weight: 600; color: var(--text-1); display: flex; gap: 8px; align-items: center; }
.notif-head h5 i { color: var(--brand); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item:hover { background: var(--surface-2) !important; }
.notif-foot { padding: 12px; text-align: center; border-top: 1px solid var(--border); }
.notif-foot a { font-size: .8rem; font-weight: 600; color: var(--brand-3); }

.nv-drawer-overlay {
  position: fixed; inset: 0; background: rgba(15,14,31,.45); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 900;
}
.nv-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 310px; max-width: 86vw;
  background: var(--surface-1); z-index: 901; padding: 18px 14px 24px;
  transform: translateX(-110%); visibility: hidden;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s linear .25s;
  overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--sh-xl);
  border-radius: 0 28px 28px 0;
  scrollbar-width: none;
}
.nv-drawer::-webkit-scrollbar { display: none; }
body.nv-drawer-open .nv-drawer { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s; }
body.nv-drawer-open { overflow: hidden; }
@media (min-width: 1181px) {
  .nv-drawer, .nv-drawer-overlay { display: none !important; }
  body.nv-drawer-open { overflow: auto; }
}
body.nv-drawer-open .nv-drawer-overlay { opacity: 1; pointer-events: auto; }
.nv-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.nv-drawer .nv-menu-title { padding: 14px 10px 6px; }
.nv-drawer a.nv-dlink {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  color: var(--text-2); font-size: .9rem; font-weight: 500; text-decoration: none;
}
.nv-drawer a.nv-dlink i { width: 20px; text-align: center; color: var(--text-3); }
.nv-drawer a.nv-dlink:hover { background: var(--surface-2); color: var(--text-1); }
.nv-drawer a.nv-dlink.active { background: var(--brand); color: #fff; }
.nv-drawer a.nv-dlink.active i { color: #fff; }
.nv-drawer a.nv-dlink .nv-mbadge { margin-left: auto; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; border-radius: 99px; padding: 2px 7px; }

.nv-cmdk {
  position: fixed; inset: 0; z-index: 2000; display: none;
  background: rgba(15,14,31,.45); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.nv-cmdk.open { display: flex; animation: nvFade .15s ease; }
.nv-cmdk-box {
  width: 100%; max-width: 620px; background: var(--surface-1);
  border-radius: 24px; box-shadow: var(--sh-xl); border: 1px solid var(--border); overflow: hidden;
}
.nv-cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.nv-cmdk-input i { color: var(--text-3); }
.nv-cmdk-input input { flex: 1; border: none; outline: none; background: transparent; font-size: 1.02rem; color: var(--text-1); }
.nv-cmdk-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.nv-cmdk-group { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 10px 12px 4px; }
.nv-cmdk-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  color: var(--text-1); text-decoration: none; font-size: .9rem; cursor: pointer;
}
.nv-cmdk-item .nv-mi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-3); flex-shrink: 0; }
.nv-cmdk-item small { display: block; color: var(--text-3); font-size: .74rem; }
.nv-cmdk-item.sel, .nv-cmdk-item:hover { background: var(--brand-bg); }
.nv-cmdk-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: .88rem; }
.nv-cmdk-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-3); }
.nv-cmdk-foot kbd { font-family: var(--font); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }

@keyframes nvFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes nvUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.app-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 36px 24px !important; margin: 0 !important;
  background: transparent !important; border-top: 1px solid var(--border) !important;
  font-size: .78rem; color: var(--text-3);
  position: static !important;
}

.page-header {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  gap: 18px !important; flex-wrap: wrap;
  margin: 6px 0 28px !important; padding: 0 !important;
  background: none !important; border: none !important; box-shadow: none !important;
}
.page-header-left { display: flex; flex-direction: column; min-width: 0; }
.page-header-left h1, .page-header-left h2 {
  font-size: 2.35rem !important; font-weight: 600 !important; letter-spacing: -.035em !important;
  color: var(--text-1) !important; line-height: 1.1 !important;
  display: flex !important; align-items: center !important; gap: 16px !important; margin: 0 !important;
}
.page-header-left h1 > i:first-child, .page-header-left h2 > i:first-child {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid !important; place-items: center;
  background: var(--surface-1); box-shadow: var(--sh); border: 1px solid var(--border);
  font-size: 1.05rem !important; margin: 0 !important;
}
.page-header-left p {
  font-size: .95rem !important; color: var(--text-3) !important; margin: 8px 0 0 66px !important;
}
.page-header-left p strong { color: var(--text-1); font-weight: 600; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh) !important;
  overflow: hidden;
}
.card-header, .card-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 24px 14px !important;
  border-bottom: none !important; background: transparent !important;
}
.card-title {
  font-size: 1.02rem !important; font-weight: 600 !important; color: var(--text-1) !important;
  display: flex; align-items: center; gap: 10px; letter-spacing: -.01em;
}
.card-title i {
  width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--brand-bg); color: var(--brand-3) !important; font-size: .82rem !important;
}
.card-body { padding: 8px 24px 24px !important; }
.card-footer, .card-foot {
  padding: 14px 24px !important; background: var(--surface-2) !important;
  border-top: 1px solid var(--border) !important;
}

.stat-card {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "label head" "value value" "sub sub";
  align-items: start; row-gap: 14px; column-gap: 12px;
  min-height: 148px;
  padding: 20px 22px !important;
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-sm) !important;
  position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}
.stat-card:not(:has(.stat-value)) { display: block !important; min-height: 0; }
.stat-card > * { grid-column: 1 / -1; }
.stat-card, .stat-card[class] { border-top: 1px solid var(--border) !important; border-top-color: var(--border) !important; }
.stat-card::before { display: none !important; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sh) !important; border-color: var(--border-strong) !important; }
.stat-card .stat-label {
  grid-area: label; order: -1; align-self: center;
  font-size: .86rem !important; font-weight: 500 !important; color: var(--text-2) !important;
  text-transform: none !important; letter-spacing: 0 !important; margin: 0 !important;
  white-space: normal !important; line-height: 1.3;
}
.stat-card .stat-card-header { grid-area: head; display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin: 0 !important; }
.stat-card .stat-value {
  grid-area: value; align-self: start; margin-top: 4px !important;
  font-size: clamp(1.45rem, 1.05rem + .8vw, 1.9rem) !important;
  font-weight: 600 !important; letter-spacing: -.03em !important; line-height: 1.1 !important;
  color: var(--text-1); margin: 0;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-value .sv-cur  { font-size: .52em; font-weight: 500; color: var(--text-3); letter-spacing: .02em; margin-right: .38em; }
.stat-value .sv-unit { font-size: .58em; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: .12em; }
.stat-value.sv-zero .sv-num { color: var(--text-3); }
.stat-card .stat-sublabel {
  grid-area: sub; align-self: end; font-size: .76rem !important; color: var(--text-3) !important;
  padding-top: 10px; border-top: 1px dashed var(--border); white-space: normal !important;
}
.stat-icon {
  width: 40px !important; height: 40px !important; border-radius: 12px !important;
  display: grid !important; place-items: center; font-size: .9rem !important; flex-shrink: 0;
  background: var(--surface-2) !important; color: var(--text-2);
}
.stat-icon.success, .stat-icon.green   { color: var(--green) !important;  background: var(--green-bg) !important; }
.stat-icon.danger,  .stat-icon.red     { color: var(--red) !important;    background: var(--red-bg) !important; }
.stat-icon.primary, .stat-icon.brand   { color: var(--brand-3) !important; background: var(--brand-bg) !important; }
.stat-icon.warning, .stat-icon.yellow  { color: var(--yellow) !important; background: var(--yellow-bg) !important; }
.stat-icon.info,    .stat-icon.accent  { color: var(--accent) !important; background: var(--accent-bg) !important; }
.stat-icon.purple { color: var(--purple) !important; background: var(--purple-light) !important; }
.stat-card-header .badge { font-size: .68rem !important; padding: 4px 9px !important; }

.stat-card.feature, .nv-feature {
  background: linear-gradient(160deg, #6A5CFF 0%, var(--brand) 55%, #4A3BE3 100%) !important;
  border-color: transparent !important; color: #fff;
  box-shadow: var(--sh-brand) !important;
}
.stat-card.feature .stat-label, .stat-card.feature .stat-value, .stat-card.feature .stat-sublabel, .stat-card.feature .sv-cur, .stat-card.feature .sv-unit { color: #fff !important; }

.btn {
  border-radius: 99px !important;
  padding: 11px 22px; font-size: .86rem; font-weight: 500 !important;
  gap: 8px; letter-spacing: 0;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.btn-sm { padding: 8px 16px !important; font-size: .8rem !important; }
.btn > i, button > i { flex-shrink: 0; }
button:has(> i):not(.nv-type-card) { white-space: nowrap; }
.btn-lg { padding: 14px 28px; font-size: .95rem; }
.btn-icon { padding: 0 !important; width: 40px; height: 40px; border-radius: 50% !important; }
.btn-icon.btn-sm { width: 34px; height: 34px; }
.btn i { font-size: .9em; }

.btn-primary, .btn-brand {
  background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important;
  box-shadow: var(--sh-brand) !important;
}
.btn-primary:hover, .btn-brand:hover { background: var(--brand-2) !important; transform: translateY(-1px); }
.btn-success, .btn-green { background: var(--green) !important; border-color: var(--green) !important; color: #fff !important; box-shadow: var(--sh-green) !important; }
.btn-danger, .btn-red { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; box-shadow: 0 10px 24px -10px var(--red) !important; }
.btn-warning, .btn-yellow { background: var(--yellow) !important; border-color: var(--yellow) !important; color: #fff !important; }
.btn-info, .btn-accent { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.btn-dark, .btn-ink { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }
.btn-dark:hover, .btn-ink:hover { transform: translateY(-1px); }
.btn-success:hover, .btn-danger:hover, .btn-warning:hover, .btn-info:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-light, .btn-secondary, .btn-surface {
  background: var(--surface-1) !important; color: var(--text-1) !important;
  border: 1px solid var(--border) !important; box-shadow: var(--sh-sm) !important;
}
.btn-light:hover, .btn-secondary:hover, .btn-surface:hover { background: var(--surface-2) !important; }
.btn-ghost {
  background: transparent !important; color: var(--text-2) !important; border-color: transparent !important;
}
.btn-ghost:hover { background: var(--surface-2) !important; color: var(--text-1) !important; }
.btn-outline-secondary {
  background: var(--surface-1) !important; color: var(--text-1) !important;
  border: 1px solid var(--border) !important; box-shadow: var(--sh-sm);
}
.btn-outline-secondary:hover { background: var(--surface-2) !important; border-color: var(--surface-4) !important; }
.btn-outline-primary, .btn-outline { background: transparent !important; color: var(--brand-3) !important; border-color: var(--brand) !important; }
.btn-outline-primary:hover, .btn-outline { background: var(--brand-bg) !important; }
.btn-outline-success { color: var(--green) !important; border-color: var(--green) !important; background: transparent !important; }
.btn-outline-danger, .btn-outline-red { color: var(--red) !important; border-color: var(--red) !important; background: transparent !important; }
.btn-white { background: #fff !important; color: var(--ink) !important; border-color: #fff !important; box-shadow: 0 8px 20px -8px rgba(0,0,0,.35) !important; }

.form-label {
  font-size: .82rem !important; font-weight: 500 !important; color: var(--text-2) !important;
}
.form-control, .fc {
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  color: var(--text-1) !important;
  padding: 12px 16px !important;
  font-size: .9rem !important;
  transition: border-color .15s, box-shadow .15s, background .15s !important;
}
.form-control:hover, .fc:hover { border-color: var(--border) !important; }
.form-control:focus, .fc:focus {
  background: var(--surface-1) !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px var(--brand-glow) !important;
}
.form-control::placeholder { color: var(--text-4) !important; }
select.form-control option, .filter-select option { background: var(--surface-1); color: var(--text-1); }
.form-control.err { border-color: var(--red) !important; box-shadow: 0 0 0 4px var(--red-bg) !important; }
.input-group-text {
  background: var(--surface-3) !important; border: 1px solid transparent !important; color: var(--text-2) !important;
  border-radius: 14px 0 0 14px !important;
}
.input-group .form-control:last-child { border-radius: 0 14px 14px 0 !important; }
.input-group .form-control:first-child:not(:last-child) { border-radius: 14px 0 0 14px !important; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.form-control::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
:root[data-theme="dark"] .form-control::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .75; }
.form-control::-webkit-datetime-edit { color: var(--text-1); }
input.form-control:-webkit-autofill, input.form-control:-webkit-autofill:hover, input.form-control:-webkit-autofill:focus,
textarea.form-control:-webkit-autofill, select.form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset !important;
  caret-color: var(--text-1); transition: background-color 9999s ease-out 0s;
}
.form-text, .form-hint, small.text-muted { color: var(--text-3) !important; }

.file-drop {
  border: 2px dashed var(--surface-4) !important; border-radius: 20px !important;
  background: var(--surface-2) !important; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.over { border-color: var(--brand) !important; background: var(--brand-bg2) !important; }

.filters-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px !important; border-bottom: 1px solid var(--border) !important;
  background: transparent !important;
}
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-box input {
  width: 100%; height: 46px; padding: 0 44px 0 18px !important;
  background: var(--surface-1) !important; border: 1px solid var(--border) !important;
  border-radius: 99px !important; color: var(--text-1) !important; font-size: .86rem;
  box-shadow: var(--sh-sm);
}
.search-box input:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-glow) !important; outline: none; }
.search-box i { position: absolute; top: 50%; transform: translateY(-50%); left: auto !important; right: 18px !important; color: var(--text-2) !important; font-size: .9rem !important; pointer-events: none; }
.filter-select {
  height: 46px; padding: 0 40px 0 18px !important;
  background-color: var(--surface-1) !important; border: 1px solid var(--border) !important;
  border-radius: 99px !important; color: var(--text-1) !important; font-size: .84rem !important;
  box-shadow: var(--sh-sm); outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B8AA3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 16px center !important;
}
input[type="date"].filter-select, input[type="month"].filter-select, input.filter-select { background-image: none !important; padding-right: 16px !important; }
.filter-select:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-glow) !important; }

.table { border-collapse: separate !important; border-spacing: 0; font-size: .87rem !important; }
.table th {
  background: transparent !important; color: var(--text-3) !important;
  font-size: .74rem !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important;
  padding: 14px 13px !important; border-bottom: 1px solid var(--border) !important;
  white-space: nowrap;
}
.table td {
  padding: 14px 13px !important; color: var(--text-1) !important;
  border-bottom: 1px solid var(--border-soft) !important; background: transparent;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: var(--surface-2) !important; }
.table tbody tr:hover td:first-child { border-radius: 14px 0 0 14px; }
.table tbody tr:hover td:last-child  { border-radius: 0 14px 14px 0; }
.table-responsive { padding: 0 10px 6px; }
.table td { white-space: nowrap; }
.table td .wrap, .table td.wrap { white-space: normal; }
.table td div[style*="flex-wrap:wrap"], .table td div[style*="flex-wrap: wrap"] { flex-wrap: nowrap !important; }

.badge {
  border-radius: 99px !important; padding: 5px 11px !important;
  font-size: .72rem !important; font-weight: 500 !important; letter-spacing: 0 !important;
  border: none !important; background: var(--surface-3); color: var(--text-2);
}
.badge-success, .badge-green, .b-green   { background: var(--green-bg) !important;  color: var(--green) !important; }
.badge-danger,  .badge-red,   .b-red     { background: var(--red-bg) !important;    color: var(--red) !important; }
.badge-warning, .badge-yellow,.b-yellow  { background: var(--yellow-bg) !important; color: var(--yellow) !important; }
.badge-primary, .badge-brand, .b-brand   { background: var(--brand-bg) !important;  color: var(--brand-3) !important; }
.badge-info,    .badge-accent,.b-accent  { background: var(--accent-bg) !important; color: var(--accent) !important; }
.badge-secondary, .badge-gray, .b-gray   { background: var(--surface-3) !important; color: var(--text-2) !important; }
.b-cyan { background: var(--cyan-bg) !important; color: var(--cyan) !important; }
.b-orange { background: var(--orange-bg) !important; color: var(--orange) !important; }
.b-pink { background: var(--pink-bg) !important; color: var(--pink) !important; }

.alert { border-radius: 18px !important; border: none !important; padding: 14px 18px !important; font-size: .86rem; }
.alert-success, .alert-green  { background: var(--green-bg) !important;  color: var(--green) !important; }
.alert-danger,  .alert-red    { background: var(--red-bg) !important;    color: var(--red) !important; }
.alert-warning, .alert-yellow { background: var(--yellow-bg) !important; color: var(--yellow) !important; }
.alert-info,    .alert-brand  { background: var(--brand-bg) !important;  color: var(--brand-3) !important; }

.tabs {
  display: inline-flex !important; gap: 4px !important; padding: 5px !important;
  background: var(--surface-2) !important; border: 1px solid var(--border) !important;
  border-radius: 99px !important; flex-wrap: wrap; margin-bottom: 18px;
  border-bottom: 1px solid var(--border) !important;
}
.tab-btn, .fiche-tab-btn, .prof-tab-btn {
  border: none !important; background: transparent !important;
  padding: 9px 18px !important; border-radius: 99px !important;
  color: var(--text-2) !important; font-size: .84rem !important; font-weight: 500 !important;
  margin: 0 !important; cursor: pointer; transition: background .15s, color .15s;
  border-bottom: none !important;
}
.tab-btn:hover, .fiche-tab-btn:hover, .prof-tab-btn:hover { color: var(--text-1) !important; background: var(--surface-1) !important; }
.tab-btn.active, .fiche-tab-btn.active, .prof-tab-btn.active {
  background: var(--brand) !important; color: #fff !important;
  box-shadow: 0 6px 16px -6px rgba(91,76,245,.8);
}

.modal-overlay { background: rgba(15,14,31,.42) !important; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal {
  background: var(--surface-1) !important; border: 1px solid var(--border) !important;
  border-radius: 28px !important; box-shadow: var(--sh-xl) !important;
}
.modal-header {
  background: var(--surface-1) !important; border-bottom: 1px solid var(--border) !important;
  border-radius: 28px 28px 0 0 !important;
}

.modal-title { font-size: 1.12rem !important; font-weight: 600 !important; color: var(--text-1); letter-spacing: -.02em; }
.modal-footer { background: var(--surface-2) !important; border-top: 1px solid var(--border) !important; border-radius: 0 0 28px 28px !important; }
.modal-close {
  width: 38px !important; height: 38px !important; border-radius: 50% !important;
  background: var(--surface-2) !important; border: 1px solid var(--border) !important; color: var(--text-2) !important;
  display: grid !important; place-items: center;
}
.modal-close:hover { background: var(--red-bg) !important; color: var(--red) !important; border-color: transparent !important; }

.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px !important; border-top: 1px solid var(--border) !important; background: transparent !important;
}
.pagination-info { font-size: .8rem; color: var(--text-3); }
.pagination-buttons { display: flex; gap: 6px; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 99px !important;
  background: var(--surface-1) !important; border: 1px solid var(--border) !important;
  color: var(--text-2) !important; font-size: .8rem; font-weight: 500; cursor: pointer;
}
.page-btn:hover { background: var(--surface-2) !important; color: var(--text-1) !important; }
.page-btn.active { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }
:root[data-theme="dark"] .page-btn.active { background: var(--brand) !important; border-color: var(--brand) !important; }

.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink) !important; color: #fff !important; border: none !important;
  border-radius: 20px !important; box-shadow: var(--sh-xl) !important; min-width: 300px; max-width: 400px;
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px !important; position: relative; overflow: hidden;
  animation: nvUp .25s ease both;
}
.toast .toast-title { color: #fff !important; font-weight: 600; font-size: .88rem; }
.toast .toast-msg { color: rgba(255,255,255,.72) !important; font-size: .8rem; }
.toast .toast-close { color: rgba(255,255,255,.6) !important; background: none; border: none; cursor: pointer; }
.toast .toast-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin: 0 !important;
  background: rgba(255,255,255,.1); font-size: .9rem;
}
.toast.t-green .toast-icon  { background: var(--green); color: #fff; }
.toast.t-red .toast-icon    { background: var(--red); color: #fff; }
.toast.t-yellow .toast-icon { background: var(--yellow); color: #fff; }
.toast.t-brand .toast-icon  { background: var(--brand); color: #fff; }
.toast .toast-border { display: none; }
.toast .toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand-soft); animation-name: nvProg; animation-timing-function: linear; animation-fill-mode: forwards; }
.toast.removing { opacity: 0; transform: translateX(20px); transition: all .25s; }
@keyframes nvProg { from { width: 100% } to { width: 0 } }

.progress { background: var(--surface-3) !important; border-radius: 99px !important; }
.progress-bar { border-radius: 99px !important; }
.progress-bar.primary { background: var(--brand) !important; }
.spinner { border-color: var(--surface-4) !important; border-top-color: var(--brand) !important; }

.empty-state { padding: 54px 20px !important; }
.empty-state-icon, .empty-ico {
  width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 6px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--brand-bg) !important; color: var(--brand-3) !important;
}
.empty-state p, .empty-state h4 { color: var(--text-3); }

.avatar { border-radius: 50% !important; background: linear-gradient(140deg, var(--brand), #9C8CFF); color: #fff; }

.step-circle {
  border-radius: 50% !important; background: var(--surface-3) !important; color: var(--text-3) !important;
  border: 2px solid var(--surface-1) !important; box-shadow: 0 0 0 1px var(--border);
}
.step.active .step-circle { background: var(--brand) !important; color: #fff !important; box-shadow: 0 0 0 5px var(--brand-glow); }
.step.done .step-circle { background: var(--green) !important; color: #fff !important; }
.step-label { color: var(--text-3); font-size: .76rem; }
.step.active .step-label { color: var(--brand-3); font-weight: 600; }

.info-item, .info-card { border-radius: 16px !important; }
.section-head, .section-title { color: var(--text-1); }
.section-icon { border-radius: 12px !important; }

.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px !important;
  background: var(--surface-2) !important; border: 1px solid transparent !important;
  border-radius: 20px !important; text-decoration: none; transition: transform .15s, background .15s, border-color .15s;
}
.quick-action:hover { transform: translateY(-3px); background: var(--surface-1) !important; border-color: var(--border) !important; box-shadow: var(--sh); }
.quick-action .qa-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-bg); color: var(--brand-3); font-size: 1.05rem; }
.quick-action .qa-label { font-size: .8rem; font-weight: 500; color: var(--text-1); text-align: center; }
.qa-success .qa-icon { background: var(--green-bg);  color: var(--green); }
.qa-danger  .qa-icon { background: var(--red-bg);    color: var(--red); }
.qa-warning .qa-icon { background: var(--yellow-bg); color: var(--yellow); }
.qa-info    .qa-icon { background: var(--accent-bg); color: var(--accent); }
.qa-purple  .qa-icon { background: var(--purple-light); color: var(--purple); }
.qa-cyan    .qa-icon { background: var(--cyan-bg);   color: var(--cyan); }

.chart-container { position: relative; }

.nv-grid { display: grid; gap: 20px; }
.nv-kpis { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 26px; }
.nv-kpi {
  position: relative; overflow: hidden;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh);
  padding: 22px 24px 0; min-height: 330px;
  display: flex; flex-direction: column;
  animation: nvUp .4s ease both;
}
.nv-kpi:nth-child(2) { animation-delay: .05s } .nv-kpi:nth-child(3) { animation-delay: .1s } .nv-kpi:nth-child(4) { animation-delay: .15s }
.nv-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; }
.nv-kpi-head > span { display: flex; align-items: center; gap: 10px; }
.nv-kpi-head .nv-round-link { width: 32px; height: 32px; font-size: .78rem; box-shadow: none; }
.nv-kpi-label { font-size: .92rem; font-weight: 500; color: var(--text-1); }
.nv-kpi-ico { font-size: 1.05rem; }
.nv-kpi-value { font-size: 2.05rem; font-weight: 600; letter-spacing: -.04em; color: var(--text-1); margin-top: 18px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-kpi-value .cur { font-size: 1.05rem; font-weight: 500; color: var(--text-3); margin-right: 4px; letter-spacing: 0; }
.nv-kpi-value .unit { font-size: 1.15rem; font-weight: 400; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.nv-kpi-trend { margin-top: 12px; font-size: .8rem; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.nv-kpi-trend b { font-weight: 600; }
.nv-kpi-trend .up   { color: var(--green); }
.nv-kpi-trend .down { color: var(--red); }
.nv-kpi-trend .bad  { color: var(--red); }
.nv-kpi-visual { flex: 1; position: relative; margin: 16px -24px 0; min-height: 150px; }
.nv-kpi-visual canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

.nv-photo { position: absolute; inset: 0; overflow: hidden; }
.nv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; display: block; transition: transform .6s ease; }
.nv-kpi:hover .nv-photo img { transform: scale(1.04); }
.nv-photo::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--surface-1) 0%, rgba(255,255,255,0) 22%); }
:root[data-theme="dark"] .nv-photo img { filter: brightness(.82) saturate(.95); }
:root[data-theme="dark"] .nv-photo::after { background: linear-gradient(180deg, var(--surface-1) 0%, rgba(26,25,48,0) 24%); }

.nv-bars { position: absolute; inset: 10px 22px 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.nv-bar { flex: 1; max-width: 22px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--brand) 0%, #8B80FB 100%); position: relative; min-height: 6px; transition: height 1s cubic-bezier(.2,.8,.2,1); }
.nv-bar.soft { background: linear-gradient(180deg, #C9C3FD 0%, #E3E0FE 100%); }
:root[data-theme="dark"] .nv-bar.soft { background: linear-gradient(180deg, #4A4380 0%, #2F2B58 100%); }
.nv-bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .62rem; color: var(--text-3); white-space: nowrap; }
.nv-bar::after { content: attr(data-v); position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: .66rem; font-weight: 600; background: var(--ink); color: #fff; border-radius: 8px; padding: 2px 7px; opacity: 0; pointer-events: none; transition: opacity .15s; white-space: nowrap; }
.nv-bar:hover::after { opacity: 1; }

.nv-illu {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to bottom,
    var(--surface-3) 0%, var(--surface-2) calc(100% - 36px),
    #D9D4CC calc(100% - 36px), #D9D4CC calc(100% - 32px),
    var(--surface-4) calc(100% - 32px), var(--surface-4) 100%);
}
:root[data-theme="dark"] .nv-illu { background: linear-gradient(to bottom,
    var(--surface-3) 0%, var(--surface-2) calc(100% - 36px),
    #3A3858 calc(100% - 36px), #3A3858 calc(100% - 32px),
    var(--surface-4) calc(100% - 32px), var(--surface-4) 100%); }
.nv-illu svg { width: 100%; height: 170px; max-height: 170px; }

.nv-methods { position: absolute; inset: 0 14px 0 14px; display: flex; align-items: flex-end; gap: 10px; }
.nv-method .pct { font-size: .7rem; font-weight: 600; color: var(--text-2); }
.nv-method span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.nv-method.on .pct { color: rgba(255,255,255,.85); }
.nv-method .bar { height: 4px; border-radius: 99px; background: var(--surface-4); overflow: hidden; margin-top: 6px; }
.nv-method .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.nv-method.on .bar { background: rgba(255,255,255,.25); } .nv-method.on .bar i { background: #fff; }
.nv-kpi-empty {
  position: absolute; inset: 8px 24px 24px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: var(--text-3); font-size: .8rem; line-height: 1.35;
  border: 1.5px dashed var(--border-strong); border-radius: 18px; background: var(--surface-2);
}
.nv-kpi-empty i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-1); color: var(--text-3); font-size: .95rem; box-shadow: var(--sh-sm); }
.nv-kpi-visual.is-empty > :not(.nv-kpi-empty) { display: none !important; }
.nv-method {
  flex: 1; height: 112px; border-radius: 18px 18px 0 0; padding: 14px 12px;
  background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between;
  font-size: .72rem; color: var(--text-3); transition: height .4s cubic-bezier(.2,.8,.2,1);
  cursor: default; min-width: 0;
}
.nv-method strong { font-size: .86rem; color: var(--text-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-method.on { height: 140px; background: linear-gradient(180deg, #6D60FF 0%, var(--brand) 100%); color: rgba(255,255,255,.75); box-shadow: var(--sh-brand); }
.nv-method.on strong { color: #fff; }
.nv-kpi-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.nv-kpi-cta .nv-kpi-trend { margin-top: 0; }
.nv-pill-btn.sm { padding: 7px 12px !important; font-size: .74rem !important; box-shadow: none !important; }
.nv-kpi-trend { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1400px) { .nv-hide-md { display: none; } }
.nv-pill-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap;
  background: var(--ink); color: #fff; border-radius: 99px; padding: 10px 16px; font-size: .78rem; font-weight: 500;
  text-decoration: none; box-shadow: 0 10px 22px -8px rgba(26,25,48,.7);
}
:root[data-theme="dark"] .nv-pill-btn { background: #fff; color: var(--ink); }
.nv-tag { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); font-size: .74rem; font-weight: 600; color: var(--text-1); }
.nv-round-link { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-1); box-shadow: var(--sh-sm); text-decoration: none; }
.nv-round-link:hover { color: var(--brand-3); }

.nv-mail-banner { align-items: center; margin-bottom: 20px !important; }
.nv-mail-close { width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(0,0,0,.06); color: inherit; cursor: pointer; flex-shrink: 0; }

.nv-chart-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 20px;
  border: 1.5px dashed var(--border-strong); border-radius: 20px; background: var(--surface-2);
}
.nv-chart-empty i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-1); color: var(--brand-3); font-size: 1.05rem; box-shadow: var(--sh-sm); margin-bottom: 4px; }
.nv-chart-empty strong { font-size: .9rem; font-weight: 600; color: var(--text-1); }
.nv-chart-empty span { font-size: .78rem; color: var(--text-3); max-width: 300px; }

.nv-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.nv-filters-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; color: var(--text-1); margin-right: 8px; }
.nv-filters-label .n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.nv-filters .filter-select, .nv-filters .nv-field { flex: 1; min-width: 160px; }
.nv-field { position: relative; }
.nv-field input { width: 100%; height: 46px; padding: 0 44px 0 18px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-1); box-shadow: var(--sh-sm); font-size: .84rem; outline: none; }
.nv-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.nv-field i { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }

.nv-dark {
  position: relative; background: var(--ink); color: var(--ink-text);
  border-radius: var(--r-xl); padding: 26px; box-shadow: var(--sh-lg);
  margin-bottom: 26px;
}
.nv-dark-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.nv-dark-title { font-size: 1.08rem; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 10px; }
.nv-dark-title small { font-size: .8rem; color: var(--ink-muted); font-weight: 400; }
.nv-seg { display: inline-flex; padding: 5px; gap: 4px; border-radius: 99px; background: #fff; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4); }
:root[data-theme="dark"] .nv-seg { background: var(--surface-2); }
.nv-seg button {
  border: none; background: transparent; border-radius: 99px; padding: 9px 18px;
  font-size: .84rem; font-weight: 500; color: var(--text-1); cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.nv-seg button .c { font-size: .72rem; font-weight: 600; color: var(--text-3); }
.nv-seg button.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -6px rgba(91,76,245,.8); }
.nv-seg button.active .c { background: #fff; color: var(--brand); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.nv-dark-tools { display: flex; gap: 8px; }
.nv-dark-tools a, .nv-dark-tools button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.08); text-decoration: none; cursor: pointer; }
.nv-dark-tools a:hover, .nv-dark-tools button:hover { background: rgba(255,255,255,.12); }
.nv-dark-body { display: grid; grid-template-columns: minmax(0, 37%) minmax(0, 1fr); gap: 22px; }

.nv-list { display: flex; flex-direction: column; gap: 10px; max-height: 470px; overflow-y: auto; padding-right: 4px; }
.nv-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.nv-row {
  display: grid; grid-template-columns: 46px minmax(0,1fr) auto auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 20px; background: var(--ink-2);
  color: var(--ink-text); cursor: pointer; border: 1px solid transparent;
  transition: background .15s, transform .15s; text-align: left; width: 100%; font-family: var(--font);
}
.nv-row:hover { background: #2B2A48; }
.nv-row.active { background: linear-gradient(120deg, #6D60FF, var(--brand)); box-shadow: var(--sh-brand); }
.nv-row-av { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(140deg,#8E84FA,#5B4CF5); color: #fff; font-weight: 600; font-size: .85rem; border: 2px solid rgba(255,255,255,.15); }
.nv-row-av img { width: 100%; height: 100%; object-fit: cover; }
.nv-row-main { min-width: 0; }
.nv-row-main strong { display: block; font-size: .88rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-row-main small { font-size: .74rem; color: var(--ink-muted); }
.nv-row.active .nv-row-main small { color: rgba(255,255,255,.78); }
.nv-row-status { font-size: .72rem; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.06); color: var(--ink-muted); white-space: nowrap; }
.nv-row.active .nv-row-status { background: #fff; color: var(--ink); font-weight: 600; }
.nv-row-amt { font-size: .95rem; font-weight: 600; color: #fff; white-space: nowrap; }

.nv-detail {
  border-radius: 26px; padding: 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #6C5FF7 0%, #5848E8 55%, #4C3DD8 100%);
  box-shadow: 0 24px 50px -20px rgba(91,76,245,.7);
  display: flex; flex-direction: column; gap: 20px;
}
.nv-detail::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -140px; top: -180px; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); pointer-events: none; }
.nv-detail-top { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 18px; align-items: start; position: relative; }
.nv-detail-lbl { font-size: .78rem; color: rgba(255,255,255,.7); margin-bottom: 10px; }
.nv-detail-big { font-size: 1.85rem; font-weight: 600; letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; line-height: 1.1; }
.nv-detail-big .nv-chip-s { font-size: .7rem; font-weight: 500; padding: 5px 11px; background: rgba(255,255,255,.14); border-radius: 99px; letter-spacing: 0; }
.nv-detail-company { font-size: 1.3rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.nv-person { display: flex; align-items: center; gap: 12px; }
.nv-person .nv-row-av { width: 48px; height: 48px; }
.nv-person strong { display: block; font-size: .9rem; font-weight: 600; }
.nv-person small { font-size: .76rem; color: rgba(255,255,255,.72); }
.nv-items { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; position: relative; }
.nv-item {
  border-radius: 20px; padding: 18px; min-height: 118px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14); display: flex; flex-direction: column; justify-content: space-between;
  transition: background .15s, transform .15s;
}
.nv-item:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.nv-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.nv-item-amt { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.nv-item-amt.paid { opacity: .55; text-decoration: line-through; }
.nv-item small { font-size: .78rem; color: rgba(255,255,255,.75); }
.nv-item.add { border: 1.5px dashed rgba(255,255,255,.35); background: transparent; align-items: center; justify-content: center; text-align: center; gap: 6px; color: #fff; text-decoration: none; }
.nv-item.add i { font-size: 1.2rem; }
.nv-detail-foot { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 28px; align-items: end; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); position: relative; }
.nv-detail-foot .lbl { font-size: .76rem; color: rgba(255,255,255,.7); }
.nv-detail-foot .val { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.nv-detail-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.nv-ghost-round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); color: #fff; text-decoration: none; background: transparent; cursor: pointer; }
.nv-ghost-round:hover { background: rgba(255,255,255,.12); }
.nv-detail-empty { display: grid; place-items: center; text-align: center; min-height: 360px; color: rgba(255,255,255,.8); }

.nv-feed { display: flex; flex-direction: column; }
.nv-feed-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.nv-feed-row:last-child { border-bottom: none; }
.nv-feed-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: .9rem; }
.nv-feed-main { flex: 1; min-width: 0; }
.nv-feed-main strong { display: block; font-size: .88rem; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-feed-main small { font-size: .76rem; color: var(--text-3); }
.nv-feed-amt { font-weight: 600; font-size: .9rem; white-space: nowrap; }

.nv-2col { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 20px; margin-bottom: 26px; }
.nv-3col { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin-bottom: 26px; }

.nv-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); }
.nv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nv-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

@media (max-width: 1500px) {
  .nv-year { display: none !important; }
  .nv-search-trigger span, .nv-search-trigger kbd { display: none; }
  .nv-search-trigger { width: 46px; padding: 0; }
  .nv-brand-text small { display: none; }
}
@media (max-width: 1400px) {
  .nv-header { gap: 12px; }
  .nv-nav-link { padding: 0 12px; font-size: .82rem; }
  .nv-brand-text { display: none; }
  .nv-actions { gap: 8px; }
}
@media (max-width: 1180px) {
  .nv-nav { display: none; }
  .nv-brand-text { display: flex; }
  .nv-burger { display: grid; }
  .nv-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nv-dark-body { grid-template-columns: 1fr; }
  .nv-2col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nv-items { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nv-detail-top { grid-template-columns: 1fr 1fr; }
  .nv-detail-foot { grid-template-columns: repeat(3, 1fr); }
  .nv-detail-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .nv-3col { grid-template-columns: 1fr; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
@media (max-width: 760px) {
  .app-layout { --layout-pad: 10px; }
  .main-content { border-radius: 24px; min-height: 100vh; }
  .nv-header { top: 8px; border-radius: 24px; padding: 8px 10px; gap: 8px; margin-bottom: 10px; }
  .nv-brand-text { display: none; }
  .nv-icon-group, .nv-chip.nv-year { display: none; }
  .nv-icon-btn, .nv-avatar, .nv-chip { width: 42px; height: 42px; min-width: 42px; }
  .page-content { padding: 20px 16px 32px !important; }
  .app-footer { padding: 16px !important; }
  .page-header-left h1, .page-header-left h2 { font-size: 1.7rem !important; gap: 12px !important; }
  .page-header-left h1 > i:first-child, .page-header-left h2 > i:first-child { width: 42px; height: 42px; }
  .page-header-left p { margin-left: 0 !important; }
  .nv-kpis, .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr !important; }
  .nv-detail-top { grid-template-columns: 1fr; }
  .nv-items { grid-template-columns: 1fr 1fr; }
  .nv-dark { padding: 16px; border-radius: 24px; }
  .nv-row { grid-template-columns: 42px minmax(0,1fr) auto; }
  .nv-row-status { display: none; }
  .nv-detail { padding: 18px; border-radius: 22px; }
  .nv-detail-big { font-size: 1.45rem; }
  .nv-item { padding: 14px; min-height: 96px; }
  .nv-item-amt { font-size: .98rem; }
  .nv-detail-foot { grid-template-columns: 1fr 1fr; gap: 14px; }
  .nv-detail-foot .val { font-size: 1.05rem; }
  .nv-seg { width: 100%; justify-content: space-between; }
  .nv-seg button { padding: 8px 12px; }
  .nv-dark-head { gap: 12px; }
  .nv-filters .filter-select, .nv-filters .nv-field { min-width: 100%; }
  .search-box { max-width: none; }
  .toast-wrap { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 760px) {
  .grid-4:has(> .stat-card), .grid-5:has(> .stat-card), .grid-3:has(> .stat-card), .grid:has(> .stat-card) { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 12px !important; }
  .stat-card { min-height: 118px; padding: 15px 15px !important; row-gap: 10px; }
  .stat-card .stat-label { font-size: .78rem !important; }
  .stat-card .stat-value { font-size: 1.3rem !important; }
  .stat-icon { width: 32px !important; height: 32px !important; border-radius: 10px !important; font-size: .78rem !important; }
  .stat-card-header .badge { display: none; }
  .grid > [style*="span 2"], .grid > .span-2, .grid > .span-3, [class*="grid-"] > [style*="span 2"] { grid-column: 1 / -1 !important; }
  .steps { gap: 2px; }
  .step-label { font-size: .6rem !important; line-height: 1.25; display: block; padding: 0 2px; }
  .step-circle { width: 28px !important; height: 28px !important; font-size: .7rem !important; }
  .step::after { top: 13px; }
  .page-header-actions { width: 100%; }
  .page-header-left p { font-size: .85rem !important; }
  .card-header { padding: 16px 16px 10px !important; }
  .card-body { padding: 6px 16px 18px !important; }
  .filters-bar { padding: 14px 16px !important; }
  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 24px !important; }
}
@media (max-width: 360px) {
  .grid-4:has(> .stat-card), .grid-5:has(> .stat-card), .grid-3:has(> .stat-card), .grid:has(> .stat-card) { grid-template-columns: 1fr !important; }
}

@media print {
  .nv-header, .nv-drawer, .nv-drawer-overlay, .nv-cmdk, .app-footer { display: none !important; }
  .app-layout { padding: 0 !important; }
  .main-content { box-shadow: none !important; border-radius: 0 !important; background: #fff !important; }
  .nv-dark, .nv-detail { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.sf { display: flex; flex-direction: column; gap: 18px; }
.sf-hero { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, var(--brand-bg) 0%, var(--surface-2) 70%); border: 1px solid var(--border); flex-wrap: wrap; }
.sf-avatar { position: relative; width: 84px; height: 84px; border-radius: 22px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #3B62E3); color: #fff; font-size: 1.6rem; font-weight: 700; border: 3px solid var(--surface-1); box-shadow: var(--sh-md); }
.sf-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sf-id { flex: 1; min-width: 200px; }
.sf-name { font-size: 1.45rem; font-weight: 500; letter-spacing: -.02em; color: var(--text-1); line-height: 1.2; }
.sf-name b { font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; align-items: center; }
.sf-mat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: var(--surface-1); border: 1px solid var(--border); font-family: Consolas, Menlo, monospace; font-size: .8rem; font-weight: 700; color: var(--brand-3); }
.sf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: var(--surface-1); border: 1px solid var(--border); font-size: .78rem; font-weight: 500; color: var(--text-2); }
.sf-chip i, .sf-mat i { font-size: .75em; }
.sf-sub { margin-top: 8px; font-size: .86rem; color: var(--text-3); }
.sf-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sf-kpi { padding: 14px 16px; border-radius: 18px; background: var(--surface-1); border: 1px solid var(--border); min-width: 0; }
.sf-kpi span { display: block; font-size: .74rem; color: var(--text-3); font-weight: 500; }
.sf-kpi strong { display: block; margin-top: 5px; font-size: 1.12rem; font-weight: 700; color: var(--text-1); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-kpi strong.g { color: var(--green); } .sf-kpi strong.r { color: var(--red); }
.sf-bar { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sf-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--green)); }
.sf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sf-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sf-sec { padding: 16px 18px; border-radius: 18px; background: var(--surface-1); border: 1px solid var(--border); }
.sf-sec h4 { margin: 0 0 12px; display: flex; align-items: center; gap: 9px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sf-sec h4 i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-bg); color: var(--brand-3); font-size: .78rem; }
.sf-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.sf-item { min-width: 0; }
.sf-item dt { font-size: .72rem; color: var(--text-3); font-weight: 500; }
.sf-item dd { margin: 3px 0 0; font-size: .9rem; font-weight: 600; color: var(--text-1); word-break: break-word; }
.sf-item dd.mono { font-family: Consolas, Menlo, monospace; letter-spacing: .02em; }
.sf-side { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 10px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border); }
.sf-side-title { align-self: stretch; padding: 0 8px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.sf-card-slot { display: flex; justify-content: center; }
.sf-card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-self: stretch; padding: 0 6px; }
.sf-stats div { padding: 10px 12px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); }
.sf-stats span { display: block; font-size: .7rem; color: var(--text-3); }
.sf-stats strong { display: block; margin-top: 3px; font-size: .9rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) { .sf-grid { grid-template-columns: 1fr; } .sf-side { position: static; } .sf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sf-dl { grid-template-columns: 1fr; } .sf-actions { justify-content: flex-start; } .sf-name { font-size: 1.2rem; } .sf-card-slot .ig-card { zoom: .88; } }

html.nv-scroll-lock, html.nv-scroll-lock body { overflow: hidden !important; overscroll-behavior: none; }
.modal, .modal-body, .modal > form, .nv-cmdk-box, .nv-drawer, #sharedCropModal, #cropModal { overscroll-behavior: contain; }
html, body { touch-action: manipulation; }
@media (max-width: 760px) {
  input.form-control, select.form-control, textarea.form-control, .fc, .filter-select, input[type="search"] { font-size: 16px !important; }
}

.nv-header { background: transparent; border-color: transparent; }
.nv-header::before {
  top: -80px; bottom: 50%; height: auto;
  left: calc(50% - 50vw); right: auto; width: 100vw;
  z-index: -2; background: var(--page-bg);
}
.nv-header::after {
  content: ''; position: absolute; inset: -1px; z-index: -1; pointer-events: none;
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: inherit;
}

.nv-drawer { display: flex; flex-direction: column; overflow: hidden; padding: 18px 14px 0; }
.nv-drawer-head { flex-shrink: 0; margin-bottom: 0; }
.nv-drawer-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 8px 0 24px; scrollbar-width: none;
}
.nv-drawer-body::-webkit-scrollbar { display: none; }
