/* ==========================================================================
   Facturare: design system
   Fără build, fără dependențe. Compatibil CSP strict (style-src 'self').
   Secțiuni:
     1. Fonturi            8. Formulare            15. Paletă de comenzi
     2. Tokeni (luminos)   9. Tabele               16. Stări (gol, skeleton, progres)
     3. Tokeni (întunecat) 10. Filtre / paginare   17. Stepper, KV, timeline, grafic
     4. Bază               11. Dropdown, taburi    18. Autentificare
     5. Shell aplicație    12. Modal, drawer       19. Utilitare
     6. Butoane            13. Toast, alertă       20. Animații, mișcare redusă, print
     7. Badge, chip, card  14. Stat card
   ========================================================================== */

/* 1. Fonturi ------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokeni: mod luminos ------------------------------------------------- */
:root {
  color-scheme: light;

  /* Suprafețe */
  --bg: #f6f7f9;
  --bg-tint: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --surface-elevated: #ffffff;
  --overlay: rgba(16, 24, 40, 0.48);

  /* Margini */
  --border: #e4e7ec;
  --border-soft: #eef0f3;
  --border-strong: #d0d5dd;
  --input-bg: #ffffff;
  --input-border: #d0d5dd;
  --input-border-hover: #b3bac6;

  /* Text */
  --text: #101828;
  --text-2: #344054;
  --text-muted: #667085;
  --text-placeholder: #6b7385;
  --text-inverse: #ffffff;

  /* Accent (indigo) */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-soft: #eef2ff;
  --primary-soft-2: #e0e7ff;
  --primary-text: #4338ca;
  --primary-border: #c7d2fe;
  --link: #4f46e5;
  --ring: rgba(79, 70, 229, 0.22);
  --focus: #4f46e5;

  /* Stări */
  --success: #079455;
  --success-solid: #079455;
  --success-soft: #ecfdf3;
  --success-text: #067647;
  --success-border: #abefc6;
  --warning: #dc6803;
  --warning-solid: #dc6803;
  --warning-soft: #fffaeb;
  --warning-text: #b54708;
  --warning-border: #fedf89;
  --danger: #d92d20;
  --danger-solid: #d92d20;
  --danger-hover: #b42318;
  --danger-soft: #fef3f2;
  --danger-text: #b42318;
  --danger-border: #fecdca;
  --danger-ring: rgba(217, 45, 32, 0.18);
  --info: #1570ef;
  --info-soft: #eff8ff;
  --info-text: #175cd3;
  --info-border: #b2ddff;
  --neutral-soft: #f2f4f7;
  --neutral-text: #344054;
  --neutral-border: #e4e7ec;
  --test-soft: #fef0c7;
  --test-soft-2: #fde7a6;
  --test-text: #93370d;
  --test-border: #fec84b;
  --banner-bg: #fffaeb;
  --banner-border: #fedf89;
  --banner-text: #93370d;

  /* Grafice (validat: CVD + contrast față de suprafață) */
  --chart-1: #4f46e5;
  --chart-2: #0d9488;
  --chart-3: #d97706;
  --chart-4: #db2777;
  --chart-grid: #eceef2;
  --chart-axis: #d0d5dd;
  --chart-band: rgba(79, 70, 229, 0.06);

  /* Diverse */
  --row-hover: #f9fafb;
  --row-selected: #f5f6ff;
  --skeleton: #eef0f3;
  --skeleton-hi: #f7f8fa;
  --scrollbar: #d0d5dd;
  --nav-active-bg: #eef2ff;
  --nav-active-text: #3730a3;
  --nav-hover-bg: #f2f4f7;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #4338ca 100%);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* Umbre */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 14px 28px -8px rgba(16, 24, 40, 0.16), 0 4px 8px -4px rgba(16, 24, 40, 0.05);
  --shadow-xl: 0 24px 56px -12px rgba(16, 24, 40, 0.24), 0 6px 12px -6px rgba(16, 24, 40, 0.06);
  --shadow-primary: 0 1px 2px rgba(55, 48, 163, 0.28), 0 2px 6px -1px rgba(79, 70, 229, 0.28);

  /* Rază, spațiere, tipografie */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.875rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;

  /* Layout */
  --sidebar-w: 252px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --content-max: 1440px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 0.16s;
}

/* 3. Tokeni: mod întunecat ----------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-tint: #10131b;
  --surface: #12151c;
  --surface-2: #161a22;
  --surface-3: #1d222c;
  --surface-elevated: #171b24;
  --overlay: rgba(2, 4, 8, 0.66);
  --border: #252b37;
  --border-soft: #1e232d;
  --border-strong: #333b4a;
  --input-bg: #0f1218;
  --input-border: #333b4a;
  --input-border-hover: #46506280;
  --text: #eceef3;
  --text-2: #c4c9d4;
  --text-muted: #949db0;
  --text-placeholder: #7b8396;
  --primary: #5b54e8;
  --primary-hover: #6a64ee;
  --primary-active: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.14);
  --primary-soft-2: rgba(99, 102, 241, 0.22);
  --primary-text: #c7d2fe;
  --primary-border: rgba(129, 140, 248, 0.38);
  --link: #a5b4fc;
  --ring: rgba(129, 140, 248, 0.32);
  --focus: #a5b4fc;
  --success: #47cd89;
  --success-solid: #079455;
  --success-soft: rgba(23, 178, 106, 0.13);
  --success-text: #75e0a7;
  --success-border: rgba(71, 205, 137, 0.3);
  --warning: #fdb022;
  --warning-solid: #dc6803;
  --warning-soft: rgba(247, 144, 9, 0.13);
  --warning-text: #fec84b;
  --warning-border: rgba(253, 176, 34, 0.3);
  --danger: #f97066;
  --danger-solid: #d92d20;
  --danger-hover: #f04438;
  --danger-soft: rgba(240, 68, 56, 0.13);
  --danger-text: #fda29b;
  --danger-border: rgba(249, 112, 102, 0.32);
  --danger-ring: rgba(249, 112, 102, 0.25);
  --info: #53b1fd;
  --info-soft: rgba(46, 144, 250, 0.13);
  --info-text: #84caff;
  --info-border: rgba(83, 177, 253, 0.3);
  --neutral-soft: #1d222c;
  --neutral-text: #c4c9d4;
  --neutral-border: #2b3240;
  --test-soft: rgba(253, 176, 34, 0.14);
  --test-soft-2: rgba(253, 176, 34, 0.24);
  --test-text: #fec84b;
  --test-border: rgba(253, 176, 34, 0.42);
  --banner-bg: #2a1f0c;
  --banner-border: #4a3410;
  --banner-text: #fedf89;
  --chart-1: #6366f1;
  --chart-2: #0d9488;
  --chart-3: #d97706;
  --chart-4: #db2777;
  --chart-grid: #1f2430;
  --chart-axis: #333b4a;
  --chart-band: rgba(129, 140, 248, 0.08);
  --row-hover: #161a22;
  --row-selected: #181b2e;
  --skeleton: #1b2029;
  --skeleton-hi: #232935;
  --scrollbar: #333b4a;
  --nav-active-bg: rgba(99, 102, 241, 0.16);
  --nav-active-text: #e0e7ff;
  --nav-hover-bg: #1a1f28;
  --brand-grad: linear-gradient(135deg, #818cf8 0%, #6366f1 45%, #4f46e5 100%);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23949db0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-xl: 0 28px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-primary: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -2px rgba(91, 84, 232, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --bg-tint: #10131b;
    --surface: #12151c;
    --surface-2: #161a22;
    --surface-3: #1d222c;
    --surface-elevated: #171b24;
    --overlay: rgba(2, 4, 8, 0.66);
    --border: #252b37;
    --border-soft: #1e232d;
    --border-strong: #333b4a;
    --input-bg: #0f1218;
    --input-border: #333b4a;
    --input-border-hover: #46506280;
    --text: #eceef3;
    --text-2: #c4c9d4;
    --text-muted: #949db0;
    --text-placeholder: #7b8396;
    --primary: #5b54e8;
    --primary-hover: #6a64ee;
    --primary-active: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.14);
    --primary-soft-2: rgba(99, 102, 241, 0.22);
    --primary-text: #c7d2fe;
    --primary-border: rgba(129, 140, 248, 0.38);
    --link: #a5b4fc;
    --ring: rgba(129, 140, 248, 0.32);
    --focus: #a5b4fc;
    --success: #47cd89;
    --success-solid: #079455;
    --success-soft: rgba(23, 178, 106, 0.13);
    --success-text: #75e0a7;
    --success-border: rgba(71, 205, 137, 0.3);
    --warning: #fdb022;
    --warning-solid: #dc6803;
    --warning-soft: rgba(247, 144, 9, 0.13);
    --warning-text: #fec84b;
    --warning-border: rgba(253, 176, 34, 0.3);
    --danger: #f97066;
    --danger-solid: #d92d20;
    --danger-hover: #f04438;
    --danger-soft: rgba(240, 68, 56, 0.13);
    --danger-text: #fda29b;
    --danger-border: rgba(249, 112, 102, 0.32);
    --danger-ring: rgba(249, 112, 102, 0.25);
    --info: #53b1fd;
    --info-soft: rgba(46, 144, 250, 0.13);
    --info-text: #84caff;
    --info-border: rgba(83, 177, 253, 0.3);
    --neutral-soft: #1d222c;
    --neutral-text: #c4c9d4;
    --neutral-border: #2b3240;
    --test-soft: rgba(253, 176, 34, 0.14);
    --test-soft-2: rgba(253, 176, 34, 0.24);
    --test-text: #fec84b;
    --test-border: rgba(253, 176, 34, 0.42);
    --banner-bg: #2a1f0c;
    --banner-border: #4a3410;
    --banner-text: #fedf89;
    --chart-1: #6366f1;
    --chart-2: #0d9488;
    --chart-3: #d97706;
    --chart-4: #db2777;
    --chart-grid: #1f2430;
    --chart-axis: #333b4a;
    --chart-band: rgba(129, 140, 248, 0.08);
    --row-hover: #161a22;
    --row-selected: #181b2e;
    --skeleton: #1b2029;
    --skeleton-hi: #232935;
    --scrollbar: #333b4a;
    --nav-active-bg: rgba(99, 102, 241, 0.16);
    --nav-active-text: #e0e7ff;
    --nav-hover-bg: #1a1f28;
    --brand-grad: linear-gradient(135deg, #818cf8 0%, #6366f1 45%, #4f46e5 100%);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23949db0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-xl: 0 28px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-primary: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -2px rgba(91, 84, 232, 0.45);
  }
}

/* 4. Bază ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h, 60px) + 16px);
  scrollbar-color: var(--scrollbar) transparent;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--text); font-weight: 600; line-height: 1.25; letter-spacing: -0.011em; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.022em; }
h2 { font-size: var(--fs-xl); letter-spacing: -0.017em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
small { font-size: var(--fs-sm); }
strong, b { font-weight: 600; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
code { padding: 0.12em 0.4em; border-radius: var(--radius-xs); background: var(--surface-3); color: var(--text-2); }
pre { margin: 0; padding: var(--s-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; font-size: var(--fs-sm); line-height: 1.6; }
pre code { padding: 0; background: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft-2); color: var(--text); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
}
.icon-sm { width: 0.875rem; height: 0.875rem; }
.icon-md { width: 1.25rem; height: 1.25rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 2rem; height: 2rem; }
.icon-spin { animation: spin 0.9s linear infinite; }

/* Link „sari la conținut” */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 200;
  padding: var(--s-2) var(--s-4);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { top: var(--s-3); text-decoration: none; }

/* 5. Shell aplicație ----------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s var(--ease);
}
.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--topbar-h);
  padding: 0 var(--s-4) 0 18px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 1px 2px rgba(55, 48, 163, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 14px -6px rgba(79, 70, 229, 0.55);
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { font-weight: 650; font-size: var(--fs-md); letter-spacing: -0.015em; }
.brand-company {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.btn.sidebar-close { display: none; margin-left: auto; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--s-2) var(--s-3) var(--s-4);
  scrollbar-width: thin;
}
.nav-section-label {
  margin: var(--s-4) 0 var(--s-1);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur), color var(--dur);
}
.nav-link .icon { width: 18px; height: 18px; color: var(--text-muted); transition: color var(--dur); }
.nav-link:hover { background: var(--nav-hover-bg); color: var(--text); text-decoration: none; }
.nav-link:hover .icon { color: var(--text-2); }
.nav-link.is-active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 600;
}
.nav-link.is-active .icon { color: var(--primary-text); }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
}
.sidebar-foot {
  padding: var(--s-3);
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.sidebar-toggle .icon { transition: transform 0.22s var(--ease); }
.sidebar-collapsed .sidebar-toggle .icon { transform: rotate(180deg); }

/* Meniu restrâns (doar desktop) */
@media (min-width: 1024px) {
  .sidebar-collapsed .sidebar-head { padding: 0; justify-content: center; }
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-badge,
  .sidebar-collapsed .nav-section-label { display: none; }
  .sidebar-collapsed .sidebar-nav { padding-left: var(--s-3); padding-right: var(--s-3); overflow: visible; }
  .sidebar-collapsed .sidebar { overflow: visible; }
  .sidebar-collapsed .nav-link { justify-content: center; padding: 0; }
  .sidebar-collapsed .nav-link.is-active::before { left: -12px; }
  .sidebar-collapsed .nav-link[data-tooltip]:hover::after,
  .sidebar-collapsed .nav-link[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 9px;
    border-radius: var(--radius-xs);
    background: #101828;
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    z-index: 60;
    animation: fade-in 0.12s var(--ease);
  }
}

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: var(--topbar-h);
  padding: 0 var(--s-8);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--bg); }
}
.btn.topbar-menu { display: none; }
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 440px;
  margin: 0;
}
.topbar-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.topbar-search-input {
  width: 100%;
  height: 38px;
  padding: 0 72px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.topbar-search-input::placeholder { color: var(--text-placeholder); }
.topbar-search-input:hover { border-color: var(--border-strong); }
.topbar-search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.topbar-search-input::-webkit-search-cancel-button { display: none; }
.topbar-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.btn.topbar-search-btn { display: none; }
.topbar-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.topbar-bell { position: relative; }
.count-dot {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--danger-solid);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid var(--bg);
  font-variant-numeric: tabular-nums;
}
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 var(--s-1); }

.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px 0 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  transition: background-color var(--dur), border-color var(--dur);
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { background: var(--surface); border-color: var(--border); }
.user-trigger-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.user-trigger-name { font-size: var(--fs-sm); font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger-role { font-size: 11.5px; color: var(--text-muted); }
.user-trigger > .icon { width: 16px; height: 16px; color: var(--text-muted); }
.user-menu { width: 296px; }
.user-menu-role { margin-top: 6px; }
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.user-menu-head .avatar { width: 38px; height: 38px; font-size: var(--fs-sm); }
.user-menu-name { font-weight: 600; font-size: var(--fs-base); line-height: 1.3; }
.user-menu-email { font-size: var(--fs-xs); color: var(--text-muted); word-break: break-all; }
.theme-switch-label { display: block; padding: 6px 10px 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.theme-switch, .theme-switch.segmented-block { margin: 0 6px 6px; display: flex; width: auto; }
.theme-switch .segmented-item { flex: 1; }
.theme-switch.segmented button.segmented-item { gap: 5px; padding: 0 6px; font-size: var(--fs-xs); }
.theme-switch .segmented-item .icon { width: 14px; height: 14px; }

.test-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 7px var(--s-4);
  background: var(--banner-bg);
  border-bottom: 1px solid var(--banner-border);
  color: var(--banner-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
}
.test-banner .icon { width: 16px; height: 16px; }
.test-banner a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-8) var(--s-8) var(--s-12);
  animation: content-in 0.28s var(--ease);
}
.content-narrow { max-width: 880px; }
.content-wide { max-width: none; }

/* Antet pagină */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  flex-wrap: wrap;
  margin-bottom: var(--s-6);
}
.page-header-main { min-width: 0; flex: 1 1 320px; }
.page-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.page-title { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.024em; line-height: 1.2; }
.page-subtitle { margin: 6px 0 0; color: var(--text-muted); font-size: var(--fs-md); max-width: 72ch; }
.page-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.page-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--s-2); font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.page-back:hover { color: var(--text); text-decoration: none; }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 var(--s-2);
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: 0.6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.breadcrumbs a { color: var(--text-muted); font-weight: 500; }
.breadcrumbs a:hover { color: var(--text); text-decoration: none; }
.breadcrumbs [aria-current="page"] { color: var(--text-2); font-weight: 500; }

.section { margin-bottom: var(--s-8); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.section-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.014em; }
.section-subtitle { color: var(--text-muted); font-size: var(--fs-sm); margin: 2px 0 0; }

/* Mobil / tabletă: meniu off-canvas */
.sidebar-backdrop { display: none; }
@media (max-width: 1023px) {
  .app-shell, .sidebar-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(296px, 86vw);
    height: 100%;
    transform: translateX(-102%);
    transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
    z-index: 70;
  }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-xl); }
  .btn.sidebar-close { display: inline-flex; }
  .sidebar-foot .sidebar-toggle { display: none; }
  .sidebar-foot:not(:has(> :not(.sidebar-toggle))) { display: none; }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease);
  }
  .nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--s-4); gap: var(--s-2); }
  .btn.topbar-menu { display: inline-flex; }
  .content { padding: var(--s-6) var(--s-5) var(--s-10); }
}
@media (max-width: 767px) {
  .topbar-search { display: none; }
  .btn.topbar-search-btn { display: inline-flex; }
  .topbar-actions { gap: 4px; }
  .topbar-new .btn-label { display: none; }
  .btn.topbar-new { width: 38px; padding: 0; }
  .user-trigger-text, .user-trigger > .icon, .topbar-divider { display: none; }
  .user-trigger { padding: 0; height: 38px; }
  .content { padding: var(--s-5) var(--s-4) var(--s-10); }
  .page-header { margin-bottom: var(--s-5); align-items: flex-start; }
  .page-title { font-size: 1.375rem; }
  .page-actions { width: 100%; }
  .page-actions > .btn { flex: 1 1 auto; }
  .test-banner { font-size: var(--fs-xs); padding: 6px var(--s-3); }
}

/* 6. Butoane ------------------------------------------------------------- */
.btn {
  --btn-h: 36px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.006em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform 0.08s;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled):not(.is-loading) { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background-color: var(--primary);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  border-color: var(--primary-active);
  color: #fff;
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover { background-color: var(--primary-hover); color: #fff; }
.btn-primary:active { background-color: var(--primary-active); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--input-border-hover); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-danger {
  background-color: var(--danger-solid);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  border-color: var(--danger-hover);
  color: #fff;
  box-shadow: 0 1px 2px rgba(180, 35, 24, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-danger:hover { background-color: var(--danger-hover); color: #fff; }
.btn-danger-ghost { color: var(--danger-text); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger-text); }
.btn-success { background: var(--success-solid); color: #fff; border-color: var(--success-solid); }
.btn-link { height: auto; padding: 0; color: var(--link); font-weight: 550; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn-xs { --btn-h: 26px; padding: 0 8px; font-size: var(--fs-xs); border-radius: var(--radius-xs); gap: 4px; }
.btn-xs .icon { width: 14px; height: 14px; }
.btn-sm { --btn-h: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: var(--radius-sm); gap: 6px; }
.btn-lg { --btn-h: 44px; padding: 0 20px; font-size: var(--fs-md); border-radius: 12px; }
.btn-lg .icon { width: 18px; height: 18px; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-icon .icon { width: 18px; height: 18px; }
.btn-sm.btn-icon .icon, .btn-xs.btn-icon .icon { width: 16px; height: 16px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn.is-disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn.is-loading { cursor: progress; pointer-events: none; }
.btn.is-loading > .icon { display: none; }
.btn.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group > .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.inline-form { display: inline-flex; margin: 0; }
.actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.actions-end { justify-content: flex-end; }

/* 7. Badge, chip, kbd, avatar, card -------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--neutral-border);
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--neutral-text);
  font-size: var(--fs-xs);
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.badge .icon { width: 12px; height: 12px; }
.badge-dot::before, .badge[data-status]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-primary { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-border); }
.badge-success { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.badge-info { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral-text); border-color: var(--neutral-border); }
.badge-outline { background: transparent; }
.badge-test {
  background: repeating-linear-gradient(-45deg, var(--test-soft) 0 5px, var(--test-soft-2) 5px 10px);
  color: var(--test-text);
  border: 1px dashed var(--test-border);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  height: 20px;
  padding: 0 7px;
}
.badge-pulse::before { animation: pulse-dot 1.6s ease-in-out infinite; }
.badge-lg { height: 26px; padding: 0 10px; font-size: var(--fs-sm); }
.badge-count { min-width: 20px; height: 20px; padding: 0 6px; justify-content: center; font-size: 11px; font-weight: 650; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur);
}
a.chip:hover, button.chip:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-text); }
.chip .icon { width: 14px; height: 14px; }
.chip-remove {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: -4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  padding: 0;
}
.chip-remove:hover { background: var(--surface-3); }
.chip-remove .icon { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  text-transform: uppercase;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-soft { background: var(--primary-soft); color: var(--primary-text); box-shadow: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-soft);
  min-height: 56px;
}
.card-header-plain { border-bottom: 0; padding-bottom: 0; min-height: 0; }
.card-title { margin: 0; font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.012em; display: flex; align-items: center; gap: var(--s-2); }
.card-title .icon { color: var(--text-muted); width: 16px; height: 16px; }
.card-subtitle { margin: 2px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.card-body { padding: var(--s-5); }
.card-body-flush { padding: 0; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-link { color: inherit; text-decoration: none; transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur); display: block; }
.card-link:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-accent { border-color: var(--primary-border); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%); }
.card + .card { margin-top: var(--s-5); }
.grid > .card + .card, .card-grid > .card + .card,
.stack > .card + .card, .stack-sm > .card + .card, .stack-lg > .card + .card { margin-top: 0; }

/* 8. Formulare ----------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: var(--s-5); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-1 { grid-template-columns: minmax(0, 1fr); }
.form-grid > .field-full, .form-grid > .col-full { grid-column: 1 / -1; }
.form-section { padding: var(--s-6) 0; border-top: 1px solid var(--border-soft); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-head { margin-bottom: var(--s-4); }
.form-section-title { font-size: var(--fs-md); font-weight: 600; }
.form-section-text { color: var(--text-muted); font-size: var(--fs-sm); margin: 2px 0 0; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-soft);
}
.form-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 calc(var(--s-5) * -1);
  padding: var(--s-3) var(--s-5);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
@media (max-width: 767px) {
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-actions > .btn { flex: 1 1 auto; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-inline { flex-direction: row; align-items: center; gap: var(--s-3); }
.label { font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--danger); font-weight: 600; }
.label .optional { color: var(--text-muted); font-weight: 400; font-size: var(--fs-xs); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.help { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }
.error {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--danger-text);
  line-height: 1.45;
}
.error .icon { width: 14px; height: 14px; margin-top: 1px; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background-color: var(--input-bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.4;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--input-border-hover); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.input:disabled, .select:disabled, .textarea:disabled,
.input[readonly] { background-color: var(--surface-3); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }
.input[readonly] { cursor: default; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select {
  padding-right: 36px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 16px;
  cursor: pointer;
  text-overflow: ellipsis;
}
.select[multiple] { height: auto; padding: 6px; background-image: none; }
.input-sm, .select-sm { height: 32px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.input-w10 { max-width: 10rem; }
.select-sm { padding-right: 32px; background-position: right 9px center; }
.input-lg { height: 46px; font-size: var(--fs-md); border-radius: 12px; }
.input-num, .input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input[type="date"], .input[type="time"] { min-width: 0; }
.input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.input[type="file"] { height: auto; padding: 6px; }
.input[type="file"]::file-selector-button {
  margin-right: 10px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}

.has-error .input, .has-error .select, .has-error .textarea, .has-error .input-group,
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.has-error .input:focus, .has-error .select:focus, .has-error .textarea:focus, .has-error .input-group:focus-within,
.input[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--danger-ring);
}

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 38px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
  overflow: hidden;
}
.input-group:hover { border-color: var(--input-border-hover); }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input-group > .input, .input-group > .select {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background-color: transparent;
}
.input-group > .input:focus, .input-group > .select:focus { box-shadow: none; }
.input-group > .select { flex: 0 0 auto; width: auto; border-left: 1px solid var(--border); }
.input-addon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 550;
  white-space: nowrap;
}
.input-addon:first-child { border-right: 1px solid var(--border); }
.input-addon:last-child { border-left: 1px solid var(--border); }
.input-addon .icon { width: 16px; height: 16px; }
.input-group-sm { height: 32px; border-radius: var(--radius-sm); }

.search-input { position: relative; min-width: 0; }
.search-input > .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input > .input { padding-left: 36px; }

/* Checkbox și radio (nativ, stilizat) */
input[type="checkbox"]:not(.switch-input):not(.sr-only),
input[type="radio"]:not(.sr-only) {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  display: inline-grid;
  place-content: center;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--dur), border-color var(--dur), box-shadow var(--dur);
}
input[type="checkbox"]:not(.switch-input):not(.sr-only) { border-radius: 5px; }
input[type="radio"]:not(.sr-only) { border-radius: 50%; }
input[type="checkbox"]:not(.switch-input):not(.sr-only)::before {
  content: "";
  width: 12px;
  height: 12px;
  background: #fff;
  transform: scale(0);
  transition: transform 0.12s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="checkbox"]:not(.switch-input):not(.sr-only):indeterminate::before {
  -webkit-mask: none;
  mask: none;
  height: 2px;
  width: 9px;
  border-radius: 2px;
  transform: scale(1);
}
input[type="radio"]:not(.sr-only)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.12s var(--ease);
}
input[type="checkbox"]:not(.switch-input):not(.sr-only):checked,
input[type="checkbox"]:not(.switch-input):not(.sr-only):indeterminate,
input[type="radio"]:not(.sr-only):checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:not(.switch-input):not(.sr-only):checked::before,
input[type="radio"]:not(.sr-only):checked::before { transform: scale(1); }
input[type="checkbox"]:not(.switch-input):not(.sr-only):hover:not(:checked):not(:disabled),
input[type="radio"]:not(.sr-only):hover:not(:checked):not(:disabled) { border-color: var(--primary); }
input[type="checkbox"]:not(.switch-input):not(.sr-only):focus-visible,
input[type="radio"]:not(.sr-only):focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--primary); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: 0.5; cursor: not-allowed; }
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.4;
}
.check > input { margin-top: 1px !important; }
.check-text { display: flex; flex-direction: column; gap: 2px; }
.check-help { color: var(--text-muted); font-size: var(--fs-xs); }
.check-list { display: flex; flex-direction: column; gap: var(--s-3); }

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  line-height: 1.4;
}
.switch-input { position: absolute; opacity: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.18s var(--ease), box-shadow var(--dur);
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2), 0 1px 2px rgba(16, 24, 40, 0.1);
  transition: transform 0.18s var(--ease);
}
.switch-input:checked + .switch-track { background: var(--primary); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--ring); }
.switch-input:disabled + .switch-track { opacity: 0.5; }
.switch-input:disabled ~ .switch-text { opacity: 0.6; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-size: var(--fs-base); font-weight: 500; color: var(--text); }
.switch-help { font-size: var(--fs-xs); color: var(--text-muted); }
.switch-sm .switch-track { width: 30px; height: 17px; }
.switch-sm .switch-thumb { width: 13px; height: 13px; }
.switch-sm .switch-input:checked + .switch-track .switch-thumb { transform: translateX(13px); }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border-soft);
}
.switch-row:last-child { border-bottom: 0; }

/* Segmented control */
.segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented-item { position: relative; display: flex; }
.segmented-item > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented-item > span, a.segmented-item, button.segmented-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.segmented-item .icon { width: 15px; height: 15px; }
.segmented-item > span:hover, a.segmented-item:hover, button.segmented-item:hover { color: var(--text); text-decoration: none; }
.segmented-item > input:checked + span,
a.segmented-item.is-active, a.segmented-item[aria-current],
button.segmented-item[aria-pressed="true"], button.segmented-item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .segmented-item > input:checked + span,
:root[data-theme="dark"] a.segmented-item.is-active,
:root[data-theme="dark"] button.segmented-item[aria-pressed="true"] { background: var(--surface-elevated); box-shadow: 0 0 0 1px var(--border-strong); }
.segmented-item > input:focus-visible + span { box-shadow: 0 0 0 2px var(--focus); }
.segmented-block { display: flex; width: 100%; }
.segmented-block > .segmented-item { flex: 1; }
.segmented-block .segmented-item > span, .segmented-block > a.segmented-item, .segmented-block > button.segmented-item { padding: 0 8px; }

/* Radio cards */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); }
.radio-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radio-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .radio-cards-2, .radio-cards-3 { grid-template-columns: minmax(0, 1fr); } }
.radio-card { position: relative; display: flex; cursor: pointer; }
.radio-card > input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-card-body {
  position: relative;
  display: flex;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-4);
  padding-right: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur);
}
.radio-card:hover .radio-card-body { border-color: var(--input-border-hover); }
.radio-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-2);
  transition: background-color var(--dur), color var(--dur);
}
.radio-card-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.radio-card-title { font-weight: 600; color: var(--text); font-size: var(--fs-base); }
.radio-card-text { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.45; }
.radio-card-check {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--input-border);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background-color var(--dur), border-color var(--dur);
}
.radio-card-check .icon { width: 12px; height: 12px; opacity: 0; transform: scale(0.6); transition: opacity var(--dur), transform var(--dur); stroke-width: 3; }
.radio-card > input:checked + .radio-card-body {
  border-color: var(--primary);
  background: var(--row-selected);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}
.radio-card > input:checked + .radio-card-body .radio-card-icon { background: var(--primary-soft-2); color: var(--primary-text); }
.radio-card > input:checked + .radio-card-body .radio-card-check { background: var(--primary); border-color: var(--primary); }
.radio-card > input:checked + .radio-card-body .radio-card-check .icon { opacity: 1; transform: none; }
.radio-card > input:focus-visible + .radio-card-body { box-shadow: 0 0 0 3px var(--ring); border-color: var(--primary); }
.radio-card > input:disabled + .radio-card-body { opacity: 0.55; cursor: not-allowed; }

/* Autosave status */
.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  min-height: 20px;
}
.autosave-status .icon { width: 14px; height: 14px; }
.autosave-status[data-state="saving"] .icon { animation: spin 0.9s linear infinite; }
.autosave-status[data-state="saved"] { color: var(--success-text); }
.autosave-status[data-state="error"], .autosave-status[data-state="conflict"] { color: var(--danger-text); }

/* 9. Tabele -------------------------------------------------------------- */
.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  -webkit-overflow-scrolling: touch;
}
.card > .table-wrap, .card-body-flush > .table-wrap { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-base);
  color: var(--text-2);
}
.table th {
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 550;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.table thead th:first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); }
.table thead th:last-child { border-top-right-radius: calc(var(--radius-lg) - 1px); }
.card .table thead th { border-radius: 0; }
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.1s; }
.table tbody tr:hover td { background: var(--row-hover); }
.table tbody tr.is-selected td { background: var(--row-selected); }
.table tfoot td, .table tfoot th {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
}
.table th.num, .table td.num, .table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.center, .table td.center { text-align: center; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.table .col-check { width: 44px; padding-right: 0; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table td.cell-primary { min-width: 200px; }
.table-sm th { padding: 8px 12px; }
.table-sm td { padding: 9px 12px; }
.table-lg td { padding: 16px; }
.table-striped tbody tr:nth-child(even) td { background: var(--surface-2); }
.cell-title { display: block; color: var(--text); font-weight: 550; line-height: 1.35; }
a.cell-title:hover { color: var(--link); text-decoration: none; }
.cell-sub { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.35; }
.cell-mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.cell-actions { width: 1%; white-space: nowrap; text-align: right; }
.cell-actions .actions { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.cell-muted { color: var(--text-muted); }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; }
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
.sort-link:hover { color: var(--text); text-decoration: none; }
.sort-link .icon { width: 13px; height: 13px; opacity: 0.35; transition: opacity var(--dur), transform var(--dur); }
th[aria-sort] .sort-link { color: var(--text); }
th[aria-sort] .sort-link .icon { opacity: 1; color: var(--primary-text); }
th[aria-sort="descending"] .sort-link .icon { transform: rotate(180deg); }
th.num .sort-link { flex-direction: row-reverse; }
.is-col-hidden { display: none !important; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-soft);
}
.table-summary { font-size: var(--fs-sm); color: var(--text-muted); }
.table-loading { opacity: 0.55; pointer-events: none; transition: opacity var(--dur); }

/* Bani și cifre */
.money, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-neg, .num-neg { color: var(--danger-text); }
.money-pos { color: var(--success-text); }
.money-muted { color: var(--text-muted); }
.currency { color: var(--text-muted); font-size: 0.86em; font-weight: 500; margin-left: 2px; }
.amount-lg { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; color: var(--text); }

/* Coloane configurabile */
.column-chooser .dropdown-menu { width: 240px; max-height: 360px; overflow-y: auto; }
.column-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
}
.column-option:hover { background: var(--surface-3); color: var(--text); }

/* Tabel → carduri pe mobil */
@media (max-width: 767px) {
  .table-wrap:has(> .table-cards) { overflow: visible; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
  .card > .table-wrap:has(> .table-cards) { padding: var(--s-3); }
  .table-cards, .table-cards tbody, .table-cards tfoot { display: block; width: 100%; }
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-cards tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--s-3);
    margin-bottom: var(--s-3);
    padding: var(--s-3) var(--s-4) var(--s-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
  }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    padding: 7px 0;
    border: 0;
    border-top: 1px dashed var(--border-soft);
    text-align: right;
    min-height: 36px;
  }
  .table-cards td::before {
    content: attr(data-label);
    flex-shrink: 0;
    max-width: 48%;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    text-align: left;
  }
  .table-cards td.num { justify-content: space-between; }
  .table-cards td:first-child, .table-cards td:last-child { padding-left: 0; padding-right: 0; }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
  .table-cards td.cell-primary {
    order: -2;
    display: block;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 2px 0 10px;
    border-top: 0;
    text-align: left;
    font-size: var(--fs-md);
  }
  .table-cards td.cell-primary::before { display: none; }
  .table-cards td.cell-badge { order: -1; width: auto; padding: 2px 0 10px; border-top: 0; justify-content: flex-end; }
  .table-cards td.cell-badge::before { display: none; }
  .table-cards td.col-check { order: -3; width: auto; padding: 2px 0 10px; border-top: 0; }
  .table-cards td.col-check::before { display: none; }
  .table-cards td.cell-actions { justify-content: flex-end; padding-top: 10px; }
  .table-cards td.cell-actions::before { display: none; }
  .table-cards td.cell-actions .actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .table-cards .is-col-hidden { display: none !important; }
  .table-cards tfoot tr { background: var(--surface-2); }
}

/* 10. Filtre și paginare ------------------------------------------------- */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.card > .filters-bar { margin: 0; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-soft); }
.filters-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.filters-row .search-input { flex: 1 1 260px; max-width: 380px; }
.filters-row .select { width: auto; min-width: 150px; max-width: 220px; }
.filters-row .field { flex: 0 0 auto; }
.filters-spacer { flex: 1; }
.filters-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.filters-advanced {
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: slide-down 0.18s var(--ease);
}
.filters-advanced-foot { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-4); }
.filter-toggle[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.filter-toggle .badge { height: 18px; min-width: 18px; padding: 0 5px; justify-content: center; background: var(--primary); color: #fff; border-color: transparent; font-size: 10.5px; }
.filters-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 767px) {
  .filters-row .search-input { flex: 1 1 100%; max-width: none; }
  .filters-row .select { flex: 1 1 calc(50% - var(--s-2)); max-width: none; min-width: 0; }
  .filters-actions { margin-left: 0; width: 100%; }
  .filters-actions > * { flex: 1; }
  .filters-actions > .dropdown > .btn { width: 100%; }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.table-wrap + .pagination { padding-left: 0; padding-right: 0; }
.card > .table-wrap + .pagination { padding-left: var(--s-4); padding-right: var(--s-4); }
.card .pagination { border-top: 1px solid var(--border-soft); }
.pagination-info { margin: 0; }
.pagination-info strong { color: var(--text-2); font-weight: 600; }
.pagination-pages { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.page-link {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color var(--dur), border-color var(--dur);
}
.page-link:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.page-link.is-active { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.page-link.is-disabled { opacity: 0.4; pointer-events: none; }
.page-link .icon { width: 16px; height: 16px; }
.page-gap { min-width: 24px; text-align: center; }
.pagination-size { display: flex; align-items: center; gap: var(--s-2); }
.pagination-size .select { width: auto; }
@media (max-width: 640px) {
  .pagination { justify-content: center; }
  .pagination-pages .page-num:not(.is-active) { display: none; }
  .pagination-pages .page-gap { display: none; }
  .pagination-size { display: none; }
}

/* 11. Dropdown, taburi --------------------------------------------------- */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  padding: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform-origin: top left;
  animation: pop-in 0.14s var(--ease);
}
.dropdown-menu:focus { outline: none; }
.dropdown-menu-end { left: auto; right: 0; transform-origin: top right; }
.dropdown-menu-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.dropdown-item .icon { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--surface-3); color: var(--text); text-decoration: none; outline: none; }
.dropdown-item:hover .icon { color: var(--text-2); }
.dropdown-item.is-danger { color: var(--danger-text); }
.dropdown-item.is-danger .icon { color: var(--danger-text); }
.dropdown-item.is-danger:hover { background: var(--danger-soft); }
.dropdown-item.is-active { color: var(--primary-text); background: var(--primary-soft); }
.dropdown-item .kbd { margin-left: auto; }
.dropdown-item-meta { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); }
.dropdown-divider { height: 1px; margin: 6px -6px; background: var(--border-soft); border: 0; }
.dropdown-header { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.dropdown-form { margin: 0; }
.dropdown-empty { padding: 10px; color: var(--text-muted); font-size: var(--fs-sm); }

.tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--s-5);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--dur);
}
.tab .icon { width: 16px; height: 16px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.2s var(--ease);
}
.tab.is-active, .tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--text); }
.tab.is-active::after, .tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { transform: scaleX(1); }
.tab-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab-count, .tab[aria-selected="true"] .tab-count, .tab[aria-current="page"] .tab-count { background: var(--primary-soft); color: var(--primary-text); }
.tab-panel { animation: fade-in 0.18s var(--ease); }
.tab-panel:focus-visible { outline-offset: 4px; }

/* 12. Modal, drawer ------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.18s var(--ease);
}
.modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-in 0.22s var(--ease);
}
.modal-sm .modal-dialog { max-width: 420px; }
.modal-lg .modal-dialog { max-width: 760px; }
.modal-xl .modal-dialog { max-width: 1040px; }
.modal-header { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-6) 0; }
.modal-header-text { flex: 1; min-width: 0; }
.modal-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.015em; }
.modal-description { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.modal-close { margin: -6px -10px 0 0; }
.modal-body { padding: var(--s-5) var(--s-6); overflow-y: auto; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary-text);
}
.modal-icon .icon { width: 22px; height: 22px; }
.modal-icon-danger { background: var(--danger-soft); color: var(--danger-text); }
.modal-icon-warning { background: var(--warning-soft); color: var(--warning-text); }
.modal-icon-success { background: var(--success-soft); color: var(--success-text); }
.modal.is-closing .modal-backdrop { animation: fade-out 0.16s var(--ease) forwards; }
.modal.is-closing .modal-dialog { animation: modal-out 0.16s var(--ease) forwards; }
.confirm-dialog .modal-header { padding-top: var(--s-6); }
.confirm-dialog .modal-body { padding-top: var(--s-2); color: var(--text-2); }
.confirm-dialog .modal-body:empty { display: none; }
@media (max-width: 640px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog, .modal-sm .modal-dialog, .modal-lg .modal-dialog, .modal-xl .modal-dialog {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: 0;
    animation: sheet-in 0.26s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal.is-closing .modal-dialog { animation: sheet-out 0.18s var(--ease) forwards; }
  .modal-footer { border-radius: 0; }
  .modal-footer > .btn { flex: 1 1 auto; }
  .modal-dialog::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 4px;
    background: var(--border-strong);
  }
}
body.has-overlay { overflow: hidden; }

.drawer { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  animation: fade-in 0.2s var(--ease);
}
.drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  height: 100%;
  background: var(--surface-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  animation: drawer-in 0.26s var(--ease);
}
.drawer-lg .drawer-panel { width: min(720px, 100vw); }
.drawer-left { justify-content: flex-start; }
.drawer-left .drawer-panel { border-left: 0; border-right: 1px solid var(--border); animation-name: drawer-in-left; }
.drawer-header {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border-soft);
}
.drawer-title { font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.drawer-description { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-6); }
.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom));
}
.drawer.is-closing .drawer-backdrop { animation: fade-out 0.18s var(--ease) forwards; }
.drawer.is-closing .drawer-panel { animation: drawer-out 0.2s var(--ease) forwards; }
.drawer-left.is-closing .drawer-panel { animation-name: drawer-out-left; }

/* 13. Toast și alertă ---------------------------------------------------- */
.toast-region {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(392px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 13px 14px 13px 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: var(--fs-base);
  pointer-events: auto;
  overflow: hidden;
  animation: toast-in 0.26s var(--ease);
}
.toast-icon {
  width: 28px;
  height: 28px;
  margin: -2px 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--info-soft);
  color: var(--info-text);
}
.toast-icon .icon { width: 16px; height: 16px; }
.toast-success .toast-icon { background: var(--success-soft); color: var(--success-text); }
.toast-warning .toast-icon { background: var(--warning-soft); color: var(--warning-text); }
.toast-error .toast-icon, .toast-danger .toast-icon { background: var(--danger-soft); color: var(--danger-text); }
.toast-content { flex: 1; min-width: 0; padding-top: 2px; }
.toast-title { font-weight: 600; line-height: 1.35; }
.toast-message { color: var(--text-2); line-height: 1.45; word-wrap: break-word; }
.toast-title + .toast-message { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); }
.toast-action { margin-top: 6px; }
.toast-close { margin: -4px -6px -4px 0; color: var(--text-muted); }
.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: currentColor;
  opacity: 0.25;
  transform-origin: left;
  animation: toast-timer linear forwards;
}
.toast-success .toast-timer { color: var(--success); }
.toast-error .toast-timer, .toast-danger .toast-timer { color: var(--danger); }
.toast-warning .toast-timer { color: var(--warning); }
.toast-info .toast-timer { color: var(--info); }
.toast:hover .toast-timer { animation-play-state: paused; }
.toast.is-leaving { animation: toast-out 0.2s var(--ease) forwards; }
@media (max-width: 640px) {
  .toast-region { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: auto; }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 14px 16px;
  border: 1px solid var(--info-border);
  border-radius: var(--radius-lg);
  background: var(--info-soft);
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.5;
}
.alert > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--info-text); }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.alert-text { color: var(--text-2); }
.alert-text p { margin-bottom: 4px; }
.alert-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: 10px; }
.alert-close { margin: -6px -8px -6px 0; }
.alert-info { background: var(--info-soft); border-color: var(--info-border); }
.alert-info > .icon { color: var(--info-text); }
.alert-success { background: var(--success-soft); border-color: var(--success-border); }
.alert-success > .icon { color: var(--success-text); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); }
.alert-warning > .icon { color: var(--warning-text); }
.alert-danger { background: var(--danger-soft); border-color: var(--danger-border); }
.alert-danger > .icon { color: var(--danger-text); }
.alert-neutral { background: var(--surface-2); border-color: var(--border); }
.alert-neutral > .icon { color: var(--text-muted); }
.alert-compact { padding: 10px 12px; font-size: var(--fs-sm); }
.alert + .alert { margin-top: var(--s-3); }

/* Flash fără JS: afișate doar dacă JS lipsește (vezi nojs.css) */
.flash-seed { display: none; }

/* 14. Stat card ---------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1180px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stat-grid, .stat-grid-3, .stat-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  min-width: 0;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}
a.stat-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.stat-card-label { font-size: var(--fs-sm); font-weight: 550; color: var(--text-muted); }
.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary-text);
}
.stat-card-icon .icon { width: 17px; height: 17px; }
.stat-card-value {
  font-size: 1.625rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card-value .currency { font-size: 0.55em; font-weight: 550; letter-spacing: 0; margin-left: 4px; }
.stat-card-values { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text-2); font-weight: 550; }
.stat-card-foot { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-top: auto; padding-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--neutral-soft);
  color: var(--neutral-text);
}
.delta .icon { width: 12px; height: 12px; }
.delta-up { background: var(--success-soft); color: var(--success-text); }
.delta-down { background: var(--danger-soft); color: var(--danger-text); }
.stat-card-success .stat-card-icon { background: var(--success-soft); color: var(--success-text); }
.stat-card-warning .stat-card-icon { background: var(--warning-soft); color: var(--warning-text); }
.stat-card-danger .stat-card-icon { background: var(--danger-soft); color: var(--danger-text); }
.stat-card-info .stat-card-icon { background: var(--info-soft); color: var(--info-text); }
.stat-card-neutral .stat-card-icon { background: var(--surface-3); color: var(--text-2); }
.stat-card-danger.is-alert { border-color: var(--danger-border); }
.stat-card-warning.is-alert { border-color: var(--warning-border); }
.stat-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--primary-soft), transparent);
  opacity: 0.7;
  pointer-events: none;
}
.stat-card-success::after { background: radial-gradient(closest-side, var(--success-soft), transparent); }
.stat-card-warning::after { background: radial-gradient(closest-side, var(--warning-soft), transparent); }
.stat-card-danger::after { background: radial-gradient(closest-side, var(--danger-soft), transparent); }
.stat-card-info::after { background: radial-gradient(closest-side, var(--info-soft), transparent); }
.stat-card-neutral::after { display: none; }
.stat-card > * { position: relative; z-index: 1; }

/* 15. Paletă de comenzi -------------------------------------------------- */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh var(--s-4) var(--s-4); }
.palette-backdrop { position: absolute; inset: 0; background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in 0.16s var(--ease); }
.palette-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modal-in 0.18s var(--ease);
}
.palette-search { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5); border-bottom: 1px solid var(--border-soft); }
.palette-search > .icon { width: 20px; height: 20px; color: var(--text-muted); }
.palette-input {
  flex: 1;
  height: 58px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-lg);
  outline: none;
}
.palette-input::placeholder { color: var(--text-placeholder); }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-spinner { width: 18px; height: 18px; color: var(--text-muted); animation: spin 0.8s linear infinite; }
.palette-results { flex: 1; overflow-y: auto; padding: var(--s-2); scroll-padding: var(--s-2); }
.palette-group + .palette-group { margin-top: var(--s-2); }
.palette-group-label { padding: 8px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.palette-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.palette-item:hover { text-decoration: none; }
.palette-item[aria-selected="true"] { background: var(--primary-soft); }
.palette-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-soft);
}
.palette-item-icon .icon { width: 16px; height: 16px; }
.palette-item[aria-selected="true"] .palette-item-icon { background: var(--surface); color: var(--primary-text); border-color: var(--primary-border); }
.palette-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-item-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item-title mark { background: transparent; color: var(--primary-text); font-weight: 700; }
.palette-item-sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item-enter { opacity: 0; color: var(--text-muted); }
.palette-item[aria-selected="true"] .palette-item-enter { opacity: 1; }
.palette-empty { padding: var(--s-10) var(--s-6); text-align: center; color: var(--text-muted); }
.palette-empty .icon { width: 28px; height: 28px; margin-bottom: var(--s-2); opacity: 0.7; }
.palette-empty-title { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.palette-footer {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 10px var(--s-5);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.palette-footer span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .palette { padding: var(--s-3); align-items: flex-start; }
  .palette-dialog { max-height: 86vh; }
  .palette-footer { display: none; }
}

/* 16. Stări: gol, încărcare, progres ------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s-12) var(--s-6);
  gap: 6px;
}
.empty-state-icon {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: var(--s-3);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), 0 0 0 6px var(--surface-2), 0 0 0 7px var(--border-soft);
  color: var(--primary-text);
}
.empty-state-icon .icon { width: 24px; height: 24px; }
.empty-state-title { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.empty-state-text { margin: 0; max-width: 440px; color: var(--text-muted); font-size: var(--fs-base); }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-4); }
.empty-state-sm { padding: var(--s-8) var(--s-4); }
.empty-state-sm .empty-state-icon { width: 44px; height: 44px; border-radius: 12px; box-shadow: var(--shadow-xs); }
.empty-state-sm .empty-state-icon .icon { width: 20px; height: 20px; }
.empty-state-error .empty-state-icon { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-border); }
.empty-state-success .empty-state-icon { color: var(--success-text); background: var(--success-soft); border-color: var(--success-border); }
.empty-state-warning .empty-state-icon { color: var(--warning-text); background: var(--warning-soft); border-color: var(--warning-border); }
.empty-state-bordered { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }

.skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 40%, var(--skeleton) 80%);
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-text { height: 12px; margin: 6px 0; }
.skeleton-title { height: 18px; width: 40%; margin-bottom: var(--s-3); }
.skeleton-circle { width: 32px; height: 32px; border-radius: 50%; }
.skeleton-block { height: 120px; border-radius: var(--radius); }
.skeleton-btn { height: 36px; width: 120px; border-radius: var(--radius); }
.skeleton-badge { height: 20px; width: 72px; border-radius: 999px; }
.skeleton-row { display: flex; align-items: center; gap: var(--s-4); padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.skeleton-row:last-child { border-bottom: 0; }
.skeleton-stack { display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.w-10 { width: 10%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-40 { width: 40%; }
.w-50 { width: 50%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-full { width: 100%; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-10); color: var(--text-muted); }
.loading-inline { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-muted); font-size: var(--fs-sm); }

.progress {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--primary);
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; transition: width 0.4s var(--ease); }
.progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }
.progress-success::-webkit-progress-value { background: var(--success); }
.progress-success::-moz-progress-bar { background: var(--success); }
.progress-warning::-webkit-progress-value { background: var(--warning); }
.progress-warning::-moz-progress-bar { background: var(--warning); }
.progress-danger::-webkit-progress-value { background: var(--danger); }
.progress-danger::-moz-progress-bar { background: var(--danger); }
.progress:indeterminate {
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--primary) 40%, var(--surface-3) 80%);
  background-size: 250% 100%;
  animation: progress-indeterminate 1.4s ease-in-out infinite;
}
.progress:indeterminate::-webkit-progress-bar { background: transparent; }
.progress:indeterminate::-moz-progress-bar { background: transparent; }
.progress-field { display: flex; flex-direction: column; gap: 6px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); }
.progress-label { color: var(--text-2); font-weight: 550; }
.progress-value { color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Bară cu lățime setată din JS (data-value) */
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--primary); transition: width 0.4s var(--ease); }
.meter-stack { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.meter-stack > span { width: 0; transition: width 0.4s var(--ease); }
.meter-success { background: var(--success); }
.meter-warning { background: var(--warning); }
.meter-danger { background: var(--danger); }
.meter-primary { background: var(--primary); }

/* 17. Stepper, listă cheie-valoare, timeline, grafic --------------------- */
.stepper {
  list-style: none;
  display: flex;
  align-items: flex-start;
  margin: 0 0 var(--s-6);
  padding: 0;
  counter-reset: step;
}
.step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  text-align: center;
  min-width: 0;
}
.step::before {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(-50% + 22px);
  right: calc(50% + 22px);
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}
.step:first-child::before { display: none; }
.step.is-complete::before, .step.is-current::before { background: var(--primary); }
.step-marker {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.step-marker .icon { width: 16px; height: 16px; }
.step.is-current .step-marker { border-color: var(--primary); color: var(--primary-text); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.step.is-complete .step-marker { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.step.is-current .step-label, .step.is-complete .step-label { color: var(--text); }
.step-desc { font-size: var(--fs-xs); color: var(--text-muted); max-width: 200px; }
a.step-link { color: inherit; text-decoration: none; display: contents; }
@media (max-width: 560px) {
  .step-desc { display: none; }
  .step-label { font-size: var(--fs-xs); }
}

.kv { margin: 0; display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); }
.kv-row { display: contents; }
.kv dt, .kv dd { padding: 10px 0; border-bottom: 1px solid var(--border-soft); margin: 0; }
.kv dt { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; padding-right: var(--s-4); }
.kv dd { color: var(--text); font-size: var(--fs-base); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; align-content: flex-start; gap: var(--s-2); flex-wrap: wrap; }
.kv .kv-row:last-child dt, .kv .kv-row:last-child dd { border-bottom: 0; }
.kv dd.num { justify-content: flex-start; }
.kv-mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.kv-2 { grid-template-columns: repeat(2, minmax(100px, 0.6fr) minmax(0, 1fr)); column-gap: var(--s-6); }
.kv-stacked { grid-template-columns: minmax(0, 1fr); }
.kv-stacked dt { padding-bottom: 0; border-bottom: 0; font-size: var(--fs-xs); }
.kv-stacked dd { padding-top: 2px; }
.copy-btn { color: var(--text-muted); }
.copy-btn.is-copied { color: var(--success-text); }
@media (max-width: 767px) {
  .kv-2 { grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); column-gap: 0; }
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; display: flex; gap: var(--s-3); padding-bottom: var(--s-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--border-soft);
}
.timeline-item:last-child::before { display: none; }
.timeline-marker {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-3);
  color: var(--text-muted);
  box-shadow: 0 0 0 4px var(--surface);
}
.timeline-marker .icon { width: 14px; height: 14px; }
.timeline-success .timeline-marker { background: var(--success-soft); color: var(--success-text); }
.timeline-warning .timeline-marker { background: var(--warning-soft); color: var(--warning-text); }
.timeline-danger .timeline-marker { background: var(--danger-soft); color: var(--danger-text); }
.timeline-info .timeline-marker { background: var(--info-soft); color: var(--info-text); }
.timeline-primary .timeline-marker { background: var(--primary-soft); color: var(--primary-text); }
.timeline-body { flex: 1; min-width: 0; padding-top: 3px; }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.timeline-title { font-weight: 550; color: var(--text); }
.timeline-time { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-text { margin: 3px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.timeline-meta { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-muted); }

.chart-card .card-body { padding-top: var(--s-4); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0 0 var(--s-3); padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--chart-1); }
.legend-swatch.s2 { background: var(--chart-2); }
.legend-swatch.s3 { background: var(--chart-3); }
.legend-swatch.s4 { background: var(--chart-4); }
.chart { position: relative; width: 100%; }
.chart-plot { position: relative; width: 100%; height: 280px; }
.chart-sm .chart-plot { height: 200px; }
.chart-lg .chart-plot { height: 360px; }
.chart-plot:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: var(--radius-sm); }
.chart-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-baseline { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis text { fill: var(--text-muted); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--chart-1); transition: opacity 0.15s; }
.chart-bar.s2 { fill: var(--chart-2); }
.chart-bar.s3 { fill: var(--chart-3); }
.chart-bar.s4 { fill: var(--chart-4); }
.chart-band { fill: var(--chart-band); opacity: 0; transition: opacity 0.12s; }
.chart-group.is-active .chart-band { opacity: 1; }
.chart.has-active .chart-group:not(.is-active) .chart-bar { opacity: 0.55; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  min-width: 168px;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  font-size: var(--fs-sm);
  transition: opacity 0.12s, transform 0.12s var(--ease);
}
.chart-tooltip-title { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.chart-tooltip-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.chart-tooltip-key { width: 12px; height: 3px; border-radius: 2px; background: var(--chart-1); flex-shrink: 0; }
.chart-tooltip-key.s2 { background: var(--chart-2); }
.chart-tooltip-key.s3 { background: var(--chart-3); }
.chart-tooltip-key.s4 { background: var(--chart-4); }
.chart-tooltip-value { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tooltip-name { color: var(--text-muted); margin-left: auto; padding-left: var(--s-3); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); font-size: var(--fs-sm); }
.chart-note { margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--text-muted); }

/* 18. Autentificare ------------------------------------------------------ */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(99, 102, 241, 0.16), transparent 62%),
    radial-gradient(900px 520px at 108% 8%, rgba(14, 165, 233, 0.1), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(79, 70, 229, 0.08), transparent 60%),
    var(--bg);
}
:root[data-theme="dark"] .auth-body {
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(99, 102, 241, 0.22), transparent 62%),
    radial-gradient(900px 520px at 108% 8%, rgba(14, 165, 233, 0.1), transparent 60%),
    var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .auth-body {
    background:
      radial-gradient(1100px 560px at 12% -12%, rgba(99, 102, 241, 0.22), transparent 62%),
      radial-gradient(900px 520px at 108% 8%, rgba(14, 165, 233, 0.1), transparent 60%),
      var(--bg);
  }
}
.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  padding: var(--s-10) var(--s-4);
  isolation: isolate;
}
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 20%, transparent 75%);
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.auth-brand:hover { text-decoration: none; }
.auth-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.auth-brand .brand-mark .icon { width: 22px; height: 22px; }
.auth-brand .brand-name { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.025em; }
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--s-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-in 0.32s var(--ease);
}
.auth-card-wide { max-width: 560px; }
.auth-card h1, .auth-title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-card h1 + p, .auth-subtitle { color: var(--text-muted); margin: 0 0 var(--s-6); }
.auth-card form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-card .btn-primary { width: 100%; height: 42px; margin-top: var(--s-1); }
.auth-card .alert { margin-bottom: var(--s-4); }
.auth-links { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); }
.auth-foot { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--fs-xs); text-align: center; }
.auth-foot .icon { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .auth-card { padding: var(--s-6) var(--s-5); border-radius: var(--radius-lg); }
  .auth-shell { justify-content: flex-start; padding-top: var(--s-12); }
}

/* Pagini de eroare / stări întregi */
.state-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--s-10) var(--s-4); }
.state-page-code { font-size: 4rem; font-weight: 750; letter-spacing: -0.04em; line-height: 1; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 19. Utilitare ---------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.grid { display: grid; gap: var(--s-5); }
.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-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-side-main { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main-side, .grid-side-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.cluster-lg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.flex-1 { flex: 1; min-width: 0; }
.items-start { align-items: flex-start; }
.ml-auto { margin-left: auto; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); } .mb-6 { margin-bottom: var(--s-6); } .mb-8 { margin-bottom: var(--s-8); }
.p-0 { padding: 0 !important; }
.text-muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }
.text-strong { color: var(--text); font-weight: 600; }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }
.text-primary { color: var(--primary-text); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.break-all { word-break: break-all; }
.divider { height: 1px; background: var(--border-soft); margin: var(--s-5) 0; border: 0; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.link { color: var(--link); font-weight: 550; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-muted { color: var(--text-muted); }
.link-muted:hover { color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.dot-success { background: var(--success); } .dot-warning { background: var(--warning); } .dot-danger { background: var(--danger); } .dot-info { background: var(--info); } .dot-primary { background: var(--primary); }
.icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary-text);
}
.icon-box .icon { width: 18px; height: 18px; }
.icon-box-success { background: var(--success-soft); color: var(--success-text); }
.icon-box-warning { background: var(--warning-soft); color: var(--warning-text); }
.icon-box-danger { background: var(--danger-soft); color: var(--danger-text); }
.icon-box-neutral { background: var(--surface-3); color: var(--text-2); }
/* pagina „CRM-ul se actualizează”: iconița mare, rotindu-se mai liniștit decât pe butoane */
.icon-box-lg { width: 56px; height: 56px; border-radius: 16px; }
.icon-box-lg .icon { width: 28px; height: 28px; }
.icon-box-lg .icon-spin { animation-duration: 1.6s; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-divided > * + * { border-top: 1px solid var(--border-soft); }
.list-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-5); }
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover { background: var(--row-hover); text-decoration: none; }
.swatch { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); }
.hide-mobile { }
.show-mobile { display: none !important; }
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: revert !important; }
}
.js-only { }
.no-js-only { display: none !important; }
.is-hidden { display: none !important; }

/* 20. Animații, mișcare redusă, print ------------------------------------ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes drawer-in-left { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes drawer-out-left { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes content-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes progress-indeterminate { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes highlight { from { background-color: var(--primary-soft-2); } to { background-color: transparent; } }
.flash-highlight { animation: highlight 1.6s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *:not(.spinner):not(.palette-spinner):not(.icon-spin),
  *:not(.is-loading)::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spinner, .palette-spinner, .icon-spin, .btn.is-loading::before { animation-duration: 1.6s !important; }
  .skeleton { animation: none !important; }
  .toast-timer { display: none; }
}

@media (forced-colors: active) {
  .btn, .input, .select, .textarea, .card, .badge, .table-wrap, .modal-dialog, .dropdown-menu, .toast { border: 1px solid CanvasText; }
  .nav-link.is-active { outline: 2px solid Highlight; }
  .chart-bar { fill: CanvasText; }
  .chart-bar.s2 { fill: Highlight; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; }
  .sidebar, .topbar, .test-banner, .toast-region, .page-actions, .filters-bar, .pagination, .no-print, .sidebar-backdrop { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; animation: none; }
  .card, .table-wrap, .stat-card { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
  body { font-size: 12px; }
}

/* Ghid de stil (/stil) ---------------------------------------------------- */
.sg-nav { margin-bottom: var(--s-8); }
.sg-section { scroll-margin-top: calc(var(--topbar-h) + var(--s-4)); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-4); }
.sg-swatch { display: flex; flex-direction: column; gap: 4px; }
.sg-swatch .swatch { width: 100%; height: 44px; margin-bottom: 4px; }
.sg-swatch-primary { background: var(--primary); }
.sg-swatch-success { background: var(--success); }
.sg-swatch-warning { background: var(--warning); }
.sg-swatch-danger { background: var(--danger); }
.sg-swatch-info { background: var(--info); }
.sg-swatch-surface { background: var(--surface); }
.sg-swatch-bg { background: var(--bg); }
.sg-swatch-border { background: var(--border-strong); }
.sg-swatch-text { background: var(--text); }
.sg-swatch-muted { background: var(--text-muted); }
.sg-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-4); align-items: center; padding-bottom: var(--s-4); border-bottom: 1px solid var(--border-soft); }
.sg-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sg-row-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sg-row-label code { font-weight: 500; color: var(--text-muted); }
.sg-due { display: inline-flex; gap: 4px; align-items: flex-start; }
@media (max-width: 767px) {
  .sg-row { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .table-cards .sg-due { align-items: flex-end; }
}
