/* ============================================================
   AGREMIN FLEET — GLOBAL APP SHELL  ·  v2 (2026-07-13)
   Design tokens · Layout · Sidebar · Header · Componente
   ------------------------------------------------------------
   O SINGURĂ definiție per componentă. Versiunea anterioară avea
   două generații paralele în același fișier (.btn, .field,
   .modal-* definite de două ori, cu valori diferite), iar a doua
   o anula pe prima — de aceea .btn-secondary și .btn-danger se
   randau FĂRĂ bordură. Aici nu se mai repetă nimic.

   Numele vechi (.btn-primary, .modal-bg, .modal-footer…) sunt
   păstrate ca ALIAS-uri, la final, ca să nu se rupă cele 50 de
   pagini. Sunt schelă: dispar după migrarea paginilor.

   Referință vizuală + test de regresie: /design-system
   ============================================================ */

/* ── Fonturi ────────────────────────────────────────────────
   SERVITE LOCAL, nu de la Google. Înainte, fiecare pagină trebuia
   să includă manual link-ul Google Fonts, iar 30 din 50 uitau —
   deci jumătate din aplicație se randa cu fontul de sistem.
   Declarat aici, în shell.css, o pagină nu mai POATE să-l uite.
   ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-latin-ext.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: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-sans-600-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-sans-600-latin-ext.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: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/ibm-plex-sans-700-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/ibm-plex-sans-700-latin-ext.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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin-ext.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: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-mono-600-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-mono-600-latin-ext.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;
}


/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Tipografie */
  --font:      'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --font-main: var(--font);   /* alias vechi, folosit în sidebar */

  /* Scară tipografică — bază 14px.
     Înainte nu exista: circulau 90 de mărimi distincte în cod, 36 de reguli sub 11px. */
  --fs-2xs: 11px;   /* etichete majuscule, badge-uri, capete de tabel */
  --fs-xs:  12px;   /* text auxiliar */
  --fs-sm:  13px;   /* rânduri de tabel, butoane, navigație */
  --fs-md:  14px;   /* BAZĂ — inputuri, text de citit */
  --fs-lg:  16px;   /* subtitluri */
  --fs-xl:  18px;   /* titlu de pagină */
  --fs-2xl: 22px;
  --fs-3xl: 28px;   /* cifre KPI */

  /* Spațiere — scară de 4px. Înainte: inexistentă. */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;

  /* Straturi. Valorile sunt IDENTICE cu cele folosite până acum
     (schimbarea lor ar rupe z-index-urile din pagini) — doar au nume. */
  --z-dropdown: 100;
  --z-header:   100;
  --z-overlay:  190;
  --z-sidebar:  200;
  --z-modal:    500;
  --z-toast:   9999;

  /* Durate */
  --t-fast: .13s;
  --t-base: .2s;
  --t-slow: .3s;

  /* IDENTITATE — verdele Agremin. Nu e culoare de acțiune (verdele
     înseamnă „succes" în badge-uri); e culoarea firmei. */
  --c-brand:        #1a6828;
  --c-brand-deep:   #0b3015;
  --c-brand-light:  #a8d4a6;

  /* Sidebar */
  --sidebar-bg:
    linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 25%),
    linear-gradient(180deg, #0b3015 0%, #0f3c1a 15%, #1a6828 36%, #1e7230 50%, #1a6828 64%, #0f3c1a 85%, #0b3015 100%);
  --sidebar-darker:    #0a2c12;
  --sidebar-border:    rgba(255,255,255,.09);
  --sidebar-hover:     rgba(255,255,255,.10);
  --sidebar-active:    rgba(168,212,166,.20);
  --sidebar-text:      rgba(255,255,255,.92);
  --sidebar-text-dim:  rgba(255,255,255,.68);   /* era .42 → 2.42:1, ilizibil */
  --sidebar-indicator: var(--c-brand-light);
  --sidebar-w:         220px;
  --sidebar-collapsed: 64px;

  /* Header */
  --header-h: 56px;

  /* ── CULORI SEMANTICE ────────────────────────────────────────
     Fiecare valoare a fost ALEASĂ prin calcul de contrast, ca să
     treacă WCAG AA (4.5:1) în TOATE utilizările ei simultan:
     ca text pe alb, ca fundal cu text alb peste, și ca text pe
     perechea ei -light. Vezi tabelul viu din /design-system.  */

  /* Acțiune — UN SINGUR albastru. Înainte circulau patru
     (#2563eb, #3b82f6, #1a73e8, #1e40af) plus un verde-oliv
     (#4a6948) folosit ca inel de focus pe 7 pagini.
     #1d4ed8: link pe alb 6.70 · alb pe el 6.70 · pe -light 5.49 */
  --c-accent:       #1d4ed8;
  --c-accent-hover: #1e40af;
  --c-accent-light: #dbeafe;

  --c-green:        #15803d;   /* pe -light 4.57 · alb pe el 5.02 */
  --c-green-light:  #dcfce7;
  --c-red:          #b91c1c;   /* pe -light 5.30 */
  --c-red-light:    #fee2e2;
  --c-warn:         #c2410c;   /* pe -light 4.52 */
  --c-warn-light:   #ffedd5;
  --c-purple:       #6d28d9;   /* pe -light 5.98 */
  --c-purple-light: #ede9fe;
  --c-teal:         #0369a1;   /* pe -light 5.17 */
  --c-teal-light:   #e0f2fe;

  /* Suprafețe */
  --c-bg:            #eef2f8;
  --c-surface:       #ffffff;
  --c-surface-2:     #f8fafc;
  --c-border:        #e2e8f0;
  --c-border-strong: #cbd5e1;

  /* Textul așezat PESTE o culoare plină (buton primar, badge plin, toast).
     E separat de --c-surface: dacă schimbi suprafața aplicației pe închis,
     textul de pe butoane trebuie să rămână deschis. */
  --c-on-accent: #ffffff;

  /* Text — toate trec AA pe alb ȘI pe --c-bg */
  --c-text:   #0f172a;   /* 17.85:1 */
  --c-text-2: #475569;   /*  7.58:1 */
  --c-text-3: #5b6a7d;   /*  5.52:1  (era #94a3b8 = 2.56:1) */
  --c-text-4: #64748b;   /*  4.76:1  (era #cbd5e1 = 1.48:1, invizibil) */

  /* Forme */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 18px;  --r-full: 999px;

  /* Umbre */
  --sh-xs: 0 1px 2px rgba(15,23,42,.06);
  --sh-sm: 0 1px 4px rgba(15,23,42,.08);
  --sh-md: 0 2px 10px rgba(15,23,42,.10);
  --sh-lg: 0 6px 24px rgba(15,23,42,.14);
  --sh-xl: 0 12px 48px rgba(15,23,42,.18);

  /* Inel de focus — unul singur, în toată aplicația */
  --focus-ring: 0 0 0 3px rgba(29,78,216,.35);
}


/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--c-text);
  background: var(--c-bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  /* `letter-spacing: .025em` global a dispărut: era o compensare pentru Comfortaa,
     un font de titlu, rotunjit și lat. Plex e proiectat pentru interfețe dense. */
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Cifrele se aliniază în coloane. Fleet-ul e plin de litri, km și prețuri;
   până acum coloanele de numere „dansau" pentru că fontul avea cifre proporționale. */
.tbl td, .data-table td, .kpi-num, .stock-val, .summary-val, .rp-li-val,
.metric-num, .num, td.num { font-variant-numeric: tabular-nums; }

/* Numere de înmatriculare, serii, VIN-uri, coduri de piesă */
.mono, .nr-auto, .cod, .serie, .vin { font-family: var(--font-mono); letter-spacing: .01em; }

/* ── Focus vizibil — o singură regulă, peste tot ─────────────
   Înainte: design system-ul nu definea NICIUN :focus-visible.
   Navigarea la tastatură se baza pe inelul implicit al browserului,
   pe care `outline: none` din pagini îl ștergea local. */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.app-sidebar :focus-visible { outline-color: var(--c-brand-light); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ── App Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: var(--mf-appvh, 100dvh);
  overflow: hidden;
  position: relative;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.app-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: var(--mf-appvh, 100dvh);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .22s ease, min-width .22s ease;
  position: relative;
  z-index: var(--z-sidebar);
  flex-shrink: 0;
}
.app-sidebar.collapsed { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }

.sidebar-logo-area { position: relative; flex-shrink: 0; }
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  height: calc(var(--header-h) + 1px);
}
.sidebar-logo-icon { display: none; }
.sidebar-logo-text {
  width: 100%;
  overflow: hidden;
  transition: opacity .18s, transform .18s;
  transform-origin: left center;
}
.app-sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; transform: scaleX(.7); }
.sidebar-logo-img {
  width: 100%; height: auto; max-width: none;
  object-fit: contain; display: block;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.55));
  margin-bottom: 2px;
}
.sidebar-logo-name,
.sidebar-logo-name-fallback {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
  letter-spacing: .14em;
  white-space: nowrap;
  line-height: 1.2;
}
.sidebar-logo-name { text-transform: uppercase; }
.sidebar-logo-name-fallback { text-transform: lowercase; }
.sidebar-logo-sub {
  font-size: 9px;
  color: var(--sidebar-text-dim);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 1px;
}

.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: calc(var(--header-h) / 2);
  transform: translateY(-50%);
  width: 22px; height: 22px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--sh-md);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  color: var(--c-text-3);
}
.sidebar-toggle:hover { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.sidebar-toggle .ms-icon { font-size: 13px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 2px; }

.nav-group-hdr {
  padding: 12px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sidebar-text-dim);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .18s;
}
.app-sidebar.collapsed .nav-group-hdr { opacity: 0; pointer-events: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin: 1px 5px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--sidebar-text);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast);
}
/* Navigația e făcută din <a href> (destinații) și <button> (grupuri pliabile), nu din <div onclick>.
   Un <button> nu se întinde singur pe toată lățimea; marginea laterală e 5px de fiecare parte. */
button.nav-item, button.nav-sub-item {
  width: calc(100% - 10px);
  text-align: left;
  font-family: var(--font);
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 3px;
  background: var(--sidebar-indicator);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 20px; min-width: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  opacity: .9;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .18s, transform .18s;
  transform-origin: left center;
}
.nav-item.active .nav-label { font-weight: 600; }
.app-sidebar.collapsed .nav-label { opacity: 0; transform: scaleX(.6); pointer-events: none; }

.nav-chevron {
  width: 14px; min-width: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  opacity: .6;
  transition: transform var(--t-base), opacity .18s;
}
.nav-item.expanded .nav-chevron { transform: rotate(90deg); }
.app-sidebar.collapsed .nav-chevron { opacity: 0; pointer-events: none; }

.app-sidebar.collapsed .nav-item { justify-content: center; padding: 8px; }
.app-sidebar.collapsed .nav-icon { margin: 0; }

.nav-sub { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.nav-sub.open { max-height: 600px; }
.app-sidebar.collapsed .nav-sub { display: none; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 36px;
  margin: 1px 5px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: var(--fs-xs);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  transition: background var(--t-fast);
}
.nav-sub-item:hover { background: var(--sidebar-hover); }
.nav-sub-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-sub-item.active::before {
  content: '';
  position: absolute;
  left: 22px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sidebar-indicator);
}

.sidebar-footer { border-top: 1px solid var(--sidebar-border); padding: 8px 6px; flex-shrink: 0; }
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--sidebar-text-dim);
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-logout-btn .ms-icon { font-size: 18px; flex-shrink: 0; }
.sidebar-logout-btn:hover { background: rgba(220,38,38,.18); color: #fca5a5; }
.sidebar-logout-lbl { transition: opacity .18s; white-space: nowrap; }
.app-sidebar.collapsed .sidebar-logout-lbl { opacity: 0; pointer-events: none; }
.app-sidebar.collapsed .sidebar-logout-btn { justify-content: center; }


/* ── APP BODY ───────────────────────────────────────────────── */
.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: var(--mf-appvh, 100dvh);
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1.5px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
  z-index: var(--z-header);
}
.header-menu-btn {
  display: none;
  width: 40px; height: 40px; min-width: 40px;
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-2);
  flex-shrink: 0;
}
.header-menu-btn .ms-icon { font-size: 22px; }

.header-breadcrumbs { flex: 1; min-width: 0; }
.breadcrumbs-trail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-2xs);
  color: var(--c-text-3);
  margin-bottom: 2px;
}
.breadcrumbs-trail span { white-space: nowrap; }
.breadcrumbs-trail .bc-sep { opacity: .5; margin: 0 1px; }
.breadcrumbs-trail .bc-cur { color: var(--c-text-2); font-weight: 600; }
.breadcrumbs-trail .bc-link { color: var(--c-text-3); cursor: pointer; }
.breadcrumbs-trail .bc-link:hover { color: var(--c-accent); text-decoration: underline; }

.header-back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-2);
  cursor: pointer; flex-shrink: 0; margin-right: 8px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.header-back-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.header-back-btn .ms-icon { font-size: 20px; }

.page-title-h {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 6px 12px;
  white-space: nowrap;
  cursor: default;
}
.header-date .ms-icon { font-size: 15px; }

.header-icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-2);
  position: relative;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.header-icon-btn:hover { background: var(--c-accent-light); border-color: var(--c-accent); color: var(--c-accent); }
.header-icon-btn:disabled { opacity: 1; cursor: default; background: var(--c-accent-light); border-color: var(--c-accent); color: var(--c-accent); }
.header-icon-btn .ms-icon { font-size: 19px; }

.notif-dot {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-surface);
  font-variant-numeric: tabular-nums;
}

.header-user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 3px 10px 3px 4px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.header-user-chip:hover { background: var(--c-accent-light); border-color: var(--c-accent); }
.header-user-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-brand), #2f9d47);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: var(--fs-2xs); font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.header-user-name { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text); line-height: 1.2; }
.header-user-role { font-size: 10px; color: var(--c-text-3); line-height: 1.25; }


/* ── APP MAIN ───────────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}
/* Scalarea fontului (slider Profil): conținutul crește mai mult decât chrome-ul. */
.app-main > * { zoom: var(--mf-cz, 1); }
.app-main::after { content: ""; display: block; flex: 0 0 auto; height: var(--mf-botpad, 0); }
.app-main::-webkit-scrollbar { width: 6px; height: 6px; }
.app-main::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 3px; }
.app-main::-webkit-scrollbar-track { background: transparent; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: var(--z-overlay);
  backdrop-filter: blur(2px);
}

.page-wrap    { padding: var(--sp-5); }
.page-wrap-sm { padding: var(--sp-3) var(--sp-5); }


/* ── DASHBOARD — KPI ────────────────────────────────────────── */
.kpi-bar { display: flex; gap: 10px; padding: 16px 20px 0; flex-wrap: wrap; }
.kpi-card {
  flex: 1;
  min-width: 130px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--sh-xs);
  cursor: default;
  transition: box-shadow .15s, transform .12s;
}
.kpi-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}
.kpi-icon.red    { background: var(--c-red-light);    color: var(--c-red); }
.kpi-icon.orange { background: var(--c-warn-light);   color: var(--c-warn); }
.kpi-icon.blue   { background: var(--c-accent-light); color: var(--c-accent); }
.kpi-icon.green  { background: var(--c-green-light);  color: var(--c-green); }
.kpi-icon.teal   { background: var(--c-teal-light);   color: var(--c-teal); }
.kpi-icon.purple { background: var(--c-purple-light); color: var(--c-purple); }
.kpi-icon.navy   { background: #e8edff;               color: #2440b8; }
.kpi-num { font-size: var(--fs-3xl); font-weight: 700; color: var(--c-text); line-height: 1; letter-spacing: -.02em; }
.kpi-lbl { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-3); margin-top: 3px; }


/* ── DASHBOARD GRID ─────────────────────────────────────────── */
.dash-area { padding: 14px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.dash-row { display: grid; gap: 14px; }
.dash-row.cols-2     { grid-template-columns: repeat(2, 1fr); }
.dash-row.cols-3     { grid-template-columns: repeat(3, 1fr); }
.dash-row.cols-4     { grid-template-columns: repeat(4, 1fr); }
.dash-row.cols-2-1   { grid-template-columns: 2fr 1fr; }
.dash-row.cols-1-2   { grid-template-columns: 1fr 2fr; }
.dash-row.cols-3-1   { grid-template-columns: 3fr 1fr; }
.dash-row.cols-1-2-1 { grid-template-columns: 1fr 2fr 1fr; }

.dash-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dash-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.dash-card-title {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-text-3);
  display: flex; align-items: center; gap: 6px;
}
.dash-card-cnt {
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-card-cnt.orange { background: var(--c-warn); }
.dash-card-cnt.red    { background: var(--c-red); }
.dash-card-cnt.green  { background: var(--c-green); }
.dash-card-link {
  font-size: var(--fs-xs);
  color: var(--c-accent);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.dash-card-link:hover { color: var(--c-accent-hover); text-decoration: underline; }
.dash-card-body { padding: 12px 16px; flex: 1; overflow: hidden; }

/* Alerte */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 -16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background .12s;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--c-surface-2); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.alert-dot.crit { background: var(--c-red); }
.alert-dot.warn { background: var(--c-warn); }
.alert-dot.info { background: var(--c-accent); }
.alert-dot.teal { background: var(--c-teal); }
.alert-body  { flex: 1; min-width: 0; }
.alert-title { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-sub   { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 1px; }
.alert-time  { font-size: var(--fs-2xs); color: var(--c-text-4); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }

/* Acțiuni */
.action-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.action-item:last-child { border-bottom: none; }
.action-cb {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--c-border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}
.action-cb.done { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.action-info { flex: 1; min-width: 0; }
.action-name { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-sub  { font-size: var(--fs-xs); color: var(--c-text-3); }
.action-date { font-size: var(--fs-2xs); color: var(--c-text-3); white-space: nowrap; flex-shrink: 0; }

/* Badge-uri de stare — 11px (erau 8.5px), contrast AA */
.badge-sm {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-sm.blue   { background: var(--c-accent-light); color: var(--c-accent); }
.badge-sm.orange { background: var(--c-warn-light);   color: var(--c-warn); }
.badge-sm.green  { background: var(--c-green-light);  color: var(--c-green); }
.badge-sm.red    { background: var(--c-red-light);    color: var(--c-red); }
.badge-sm.purple { background: var(--c-purple-light); color: var(--c-purple); }
.badge-sm.teal   { background: var(--c-teal-light);   color: var(--c-teal); }

/* Fluide */
.fluid-item {
  border-left: 3px solid var(--c-teal);
  background: var(--c-teal-light);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.fluid-item:last-child { margin-bottom: 0; }
.fluid-type { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-teal); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.fluid-name { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); margin-bottom: 3px; }
.fluid-desc { font-size: var(--fs-xs); color: var(--c-text-2); line-height: 1.5; margin-bottom: 6px; }
.fluid-btn  {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-size: var(--fs-2xs); font-weight: 600;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  cursor: pointer;
  transition: all .12s;
  background: var(--c-surface);
}
.fluid-btn:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-light); }

/* Stoc */
.stock-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--c-border); }
.stock-item:last-child { border-bottom: none; }
.stock-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.stock-info { flex: 1; min-width: 0; }
.stock-name { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); }
.stock-note { font-size: var(--fs-2xs); color: var(--c-warn); font-weight: 600; }
.stock-val  { font-size: var(--fs-md); font-weight: 700; color: var(--c-text); white-space: nowrap; }
.stock-unit { font-size: var(--fs-2xs); color: var(--c-text-3); display: block; text-align: right; }

/* Indicatoare */
.gauge-widget {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--sh-xs);
  margin-bottom: 10px;
}
.gauge-widget:last-child { margin-bottom: 0; }
.gauge-widget svg { width: 100%; max-width: 150px; height: auto; display: block; }
.gauge-name { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text); text-align: center; }
.gauge-val  { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); text-align: center; font-variant-numeric: tabular-nums; }

/* Sumar */
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: var(--fs-sm); }
.summary-row:last-child { border-bottom: none; }
.summary-lbl { color: var(--c-text-2); display: flex; align-items: center; gap: 6px; }
.summary-val { font-weight: 700; color: var(--c-text); }

.stat-donut-wrap { display: flex; align-items: center; gap: 12px; }
.stat-donut svg { width: 70px; height: 70px; }
.stat-donut-legend { display: flex; flex-direction: column; gap: 5px; }
.stat-dot-row { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--c-text-2); }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }


/* ── COMPONENTE COMUNE ──────────────────────────────────────── */
.section-hdr {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Verdele de brand iese din sidebar: un semn discret, în fiecare titlu de secțiune. */
.section-hdr::before {
  content: '';
  width: 3px; height: 12px;
  background: var(--c-brand);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-hdr .cnt {
  background: var(--c-bg);
  color: var(--c-text-2);
  border-radius: var(--r-full);
  padding: 1px 8px;
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-sm);
  padding: var(--sp-4);
}

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.empty .empty-ico { font-size: 32px; margin-bottom: 8px; color: var(--c-text-4); }
.empty .empty-ico .ms-icon { font-size: 32px; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── TABELE — un singur sistem (.tbl) ───────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th {
  text-align: left;
  padding: 9px 12px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border-strong);
  background: var(--c-bg);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--c-surface-2); }
.tbl--compact td, .tbl--compact th { padding: 6px 9px; }
.tbl--striped tbody tr:nth-child(even) td { background: var(--c-surface-2); }


/* ── BUTOANE — un singur sistem ─────────────────────────────
   Înainte, `.btn` era definit de DOUĂ ori; a doua definiție avea
   `border: none` și îl bătea pe primul, deci `.btn-secondary` și
   `.btn-danger` își pierdeau bordura (140 de utilizări afectate).
   Aici bordura e declarată o singură dată și fiecare variantă o
   colorează. ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ms-icon { font-size: 18px; }

.btn--primary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn--primary:hover:not(:disabled) { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }

.btn--success { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.btn--success:hover:not(:disabled) { background: #14532d; border-color: #14532d; }

.btn--danger  { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.btn--danger:hover:not(:disabled) { background: #991b1b; border-color: #991b1b; }

.btn--outline { background: var(--c-surface); color: var(--c-text-2); border-color: var(--c-border-strong); }
.btn--outline:hover:not(:disabled) { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-light); }

.btn--ghost   { background: transparent; color: var(--c-accent); border-color: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--c-accent-light); }

/* Butonul „periculos, dar discret" — contur roșu, fund alb */
.btn--danger-outline { background: var(--c-surface); color: var(--c-red); border-color: #fca5a5; }
.btn--danger-outline:hover:not(:disabled) { background: var(--c-red-light); border-color: var(--c-red); }

/* Mărimi. Minimul de 36px e păstrat: aceste butoane sunt apăsate
   de mecanici, în hală, uneori cu mănuși. Vechiul .btn-xs avea
   font 9.5px și padding 3px. */
.btn--sm { padding: 5px 12px; min-height: 32px; font-size: var(--fs-xs); }
.btn--lg { padding: 11px 22px; min-height: 44px; font-size: var(--fs-md); }
.btns { display: flex; gap: 8px; align-items: center; }

/* Buton doar-iconiță: ținta rămâne 36px, chiar dacă iconița e mică */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.btn-icon:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-light); }
.btn-icon .ms-icon { font-size: 19px; }


/* ── FORMULARE — un singur sistem ───────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--sp-3); }
.field-label,
.field > label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-text-3);
}
/* Câmpul obligatoriu se VEDE că e obligatoriu */
.field-label.req::after,
.field > label.req::after { content: ' *'; color: var(--c-red); font-weight: 700; }

.field-input, .field-select, .field-textarea,
.field > input, .field > select, .field > textarea {
  min-height: 40px;
  padding: 8px 11px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-md);
  width: 100%;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-textarea, .field > textarea { min-height: 80px; padding: 10px 11px; resize: vertical; }

.field-input:focus, .field-select:focus, .field-textarea:focus,
.field > input:focus, .field > select:focus, .field > textarea:focus {
  border-color: var(--c-accent);
  box-shadow: var(--focus-ring);
}
.field-input:disabled, .field-select:disabled, .field-textarea:disabled {
  background: var(--c-bg); color: var(--c-text-3); cursor: not-allowed;
}
.field-hint { font-size: var(--fs-xs); color: var(--c-text-3); }

/* Starea de eroare. Înainte era stilizată în CSS dar NICIODATĂ aplicată
   din JS — cod mort. Acum are și iconiță, ca să nu depindă doar de culoare
   (daltonism: roșu/verde). */
.field-error .field-input,
.field-error .field-select,
.field-error .field-textarea,
.field-error > input,
.field-error > select { border-color: var(--c-red); background: #fffafa; }
.field-error .field-input:focus,
.field-error .field-select:focus { box-shadow: 0 0 0 3px rgba(185,28,28,.2); }
.field-error .field-hint { color: var(--c-red); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.field-error .field-hint::before {
  content: 'error';
  font-family: 'Material Symbols Outlined', 'Material Symbols Rounded';
  font-size: 14px;
  font-variation-settings: 'FILL' 1;
}

.fields-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.fields-row .field { flex: 1; min-width: 180px; }


/* ── MODALE — un singur sistem ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  max-height: calc(var(--mf-appvh, 100dvh) - 40px);
  overflow: hidden;
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.modal-title { font-size: var(--fs-lg); font-weight: 600; color: var(--c-text); }
.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--c-red-light); color: var(--c-red); }
.modal-close .ms-icon { font-size: 20px; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  font-size: var(--fs-md);
}
.modal-ftr {
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}


/* ── TOAST — un singur sistem ───────────────────────────────
   Erau trei: `#__toast` (api.js, jos-centru, stiluri inline),
   `.shell-toast` (jos-dreapta) și toast-uri proprii în 3 pagini.
   Poziția jos-centru e aleasă pentru că butonul flotant de chat
   (eliminat) ocupa colțul dreapta-jos. */
.shell-toast, #__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--c-text);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--sh-lg);
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  pointer-events: none;
  max-width: min(560px, calc(100vw - 32px));
}
.shell-toast.visible, #__toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.shell-toast--success { background: var(--c-green); }
.shell-toast--error   { background: var(--c-red); }
.shell-toast--warn    { background: var(--c-warn); }


/* ── ICONIȚE ────────────────────────────────────────────────
   Outlined, nu Rounded: setul rotunjit fusese ales ca să se
   potrivească cu Comfortaa (font de titlu, rotunjit), care a ieșit.
   „Rounded" rămâne în stivă ca rezervă, pentru paginile care încă
   îl încarcă singure în <head> — aceleași ligaturi, deci nimic nu se rupe. */
.ms-icon {
  font-family: 'Material Symbols Outlined', 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.ms-icon.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }


/* ── PANOU DREAPTA ──────────────────────────────────────────── */
.app-right-panel {
  width: 220px;
  min-width: 220px;
  height: var(--mf-appvh, 100dvh);
  overflow-y: auto;
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.app-right-panel::-webkit-scrollbar { width: 3px; }
.app-right-panel::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

.rp-panel-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: var(--header-h);
  min-height: var(--header-h);
  border-bottom: 1.5px solid var(--c-border);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-text-3);
  flex-shrink: 0;
  background: var(--c-surface);
}
.rp-panel-hdr .ms-icon { font-size: 16px; }
.rp-panel-content { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }

.rp-unconfigured {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 12px; text-align: center;
  color: var(--c-text-3);
}
.rp-unconfigured .ms-icon { font-size: 34px; opacity: .5; }
.rp-unc-title { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }
.rp-unc-sub   { font-size: var(--fs-xs); line-height: 1.5; color: var(--c-text-3); }

.rp-section-lbl {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-text-3);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 2px 2px;
}
.rp-section-lbl .ms-icon { font-size: 13px; }
.rp-gauge-wrap { width: 100%; padding: 2px 4px; }
.rp-gauge-wrap svg { width: 100%; height: auto; display: block; }
.rp-loading { display: flex; justify-content: center; padding: 20px; }
.rp-empty { font-size: var(--fs-xs); color: var(--c-text-3); text-align: center; padding: 20px 4px; }

.rp-mot-header { display: grid; grid-template-columns: 60% 1fr; gap: 5px; margin-bottom: 2px; }
.rp-ab-hdr { justify-content: center; }
.rp-motor-pair {
  display: grid;
  grid-template-columns: 60% 1fr;
  grid-template-rows: auto auto;
  gap: 2px 5px;
  padding: 4px 0;
  border-bottom: 1px solid var(--c-border);
}
.rp-motor-pair:last-child { border-bottom: none; padding-bottom: 0; }
.rp-motor-pair + .rp-motor-pair { border-top: 2px solid var(--c-border-strong); }

.rp-loc-name {
  grid-column: 1 / -1;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text-2);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 1px 0 3px;
}
.rp-adblue-col { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; }
.rp-ab-val {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-accent);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.rp-ab-track {
  flex: 1;
  width: 12px;
  min-height: 50px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.rp-ab-fill { width: 100%; background: var(--c-accent); transition: height .5s ease; }

.rp-level-item { padding: 5px 2px; border-bottom: 1px solid var(--c-border); }
.rp-level-item:last-child { border-bottom: none; }
.rp-li-row  { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.rp-li-name {
  font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-2);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 5px;
}
.rp-li-val  { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text); white-space: nowrap; flex-shrink: 0; }
.rp-li-track {
  height: 10px;
  background: #1a2332;
  border: 1px solid #2d3f55;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.rp-li-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 1px; }
.rp-li-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.28); z-index: 2; }


/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .dash-row.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .kpi-card { min-width: 120px; }
  .app-right-panel { display: none !important; }
}
@media (max-width: 900px) {
  .dash-row.cols-3,
  .dash-row.cols-1-2-1 { grid-template-columns: 1fr 1fr; }
  .dash-row.cols-3-1,
  .dash-row.cols-2-1,
  .dash-row.cols-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: 260px !important;
    min-width: 260px !important;
    z-index: 200;
  }
  .app-sidebar.mobile-open { transform: translateX(0); box-shadow: var(--sh-xl); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .22s; }
  .sidebar-overlay.visible { opacity: 1; pointer-events: all; }
  .header-menu-btn { display: flex; }
  .header-date { display: none; }
  .dash-row.cols-2, .dash-row.cols-3, .dash-row.cols-4,
  .dash-row.cols-2-1, .dash-row.cols-1-2, .dash-row.cols-3-1,
  .dash-row.cols-1-2-1 { grid-template-columns: 1fr; }
  .kpi-bar  { padding: 12px 14px 0; gap: 8px; }
  .kpi-card { min-width: calc(50% - 4px); }
  .dash-area { padding: 12px 14px 20px; }
  .app-main { overflow-y: auto; }
}
@media (max-width: 480px) {
  .kpi-card { min-width: 100%; }
  .header-user-meta { display: none; }
  .kpi-num { font-size: var(--fs-2xl); }
  /* modalul devine bottom-sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; }
  .shell-toast, #__toast { bottom: 16px; max-width: calc(100vw - 24px); }
}


/* ══════════════════════════════════════════════════════════════
   ALIAS-URI DEPRECATE — schelă pentru migrare
   ──────────────────────────────────────────────────────────────
   Numele vechi, folosite de paginile încă nemigrate. NU le folosi
   în cod nou. Se șterg după ce toate cele 50 de pagini trec pe
   convenția de mai sus.
     .btn-primary/-secondary/-danger/-sm/-xs  →  .btn--*
     .modal-bg                                →  .modal-overlay
     .modal-footer                            →  .modal-ftr
     .data-table                              →  .tbl
   ══════════════════════════════════════════════════════════════ */
.btn-primary   { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-primary:hover:not(:disabled) { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }
.btn-secondary { background: var(--c-surface); color: var(--c-text-2); border-color: var(--c-border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-light); }
.btn-danger    { background: var(--c-surface); color: var(--c-red); border-color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: var(--c-red-light); border-color: var(--c-red); }
.btn-sm { padding: 5px 12px; min-height: 32px; font-size: var(--fs-xs); }
.btn-xs { padding: 4px 10px; min-height: 30px; font-size: var(--fs-2xs); border-radius: var(--r-sm); }

/* .modal-bg: sistemul vechi era `display:flex` mereu, ascuns prin style inline
   din pagină. Îl păstrăm așa, altfel modalele acelor 6 utilizări s-ar deschide singure. */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table th {
  text-align: left; padding: 9px 12px;
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--c-text-3);
  border-bottom: 2px solid var(--c-border); background: var(--c-bg); white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-surface-2); }


/* ── Compatibilitate cu layout-urile vechi de pagină ────────── */
.app-main > .app {
  height: calc(var(--mf-appvh, 100dvh) - var(--header-h));
  min-height: 0;
}
.app-main .hero,
.app-main > .app > .hero { display: none !important; }
.app-main .btn-menu { display: none !important; }
.app-main > .header:first-child,
.app-main > header:first-child { display: none !important; }
.app-main .btn-back[onclick*="history"],
.app-main .btn-back[onclick*="location"] { display: none; }
