/* ============================================================================
   ui.css – kitul vizual Priveghi = cnb-ui (platforme/cnb-ui/cnb-ui.css), identic,
   cu două abateri marcate „Priveghi” (.form-row pe o coloană, inputuri 16 px pe tactil)
   Același limbaj ca site-ul cnbadmin.ro (tokenii din site/src/styles/global.css,
   skill cnb-brand), adaptat la densitatea unei aplicații: text 14 px, rânduri
   compacte, tabele, formulare, panouri.

   Cuprins (caută '====' ):
   - FONTURI ȘI TOKENI       - SHELL (bară laterală + conținut)
   - BAZĂ ȘI TIPOGRAFIE      - ANTET DE PAGINĂ, TABURI
   - BUTOANE                 - CARDURI, STATISTICI, FILTRE
   - FORMULARE               - TABELE, BADGE-URI
   - ECRAN DE LOGIN          - MODAL, TOAST, STĂRI GOALE
   - UTILITARE, RESPONSIVE
   Fișierul se copiază identic în fiecare aplicație (assets/cnb-ui/). Sursa: platforme/cnb-ui/.
   ============================================================================ */

/* ============================================================================
   FONTURI ȘI TOKENI
   ============================================================================ */
@font-face { font-family: "Jakarta"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/plus-jakarta-sans-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: "Jakarta"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/plus-jakarta-sans-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; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/manrope-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: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/manrope-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; }

:root {
  color-scheme: light;
  /* culorile logo-ului */
  --cyan: #3cb0e0; --blue: #146cb8; --deep: #0858ac; --navy: #28388c; --brand: #0c2474;
  --night: #050b22; --night-2: #0a1438;
  /* suprafețe și text */
  --paper: #f9fafb; --paper-2: #eef3f9; --card: #ffffff;
  --ink: #071033; --muted: #4a5571; --line: #dde4ee; --line-2: #b9c4d6;
  --mist: #e4e7ec; --haze: #9ca3af;
  --hair: rgba(60,176,224,.18); --hair-2: #1b2c66;
  /* semantice */
  --ok: #12683c; --ok-bg: #e6f4ec; --warn: #9a5b00; --warn-bg: #fdf3e0; --err: #b3211d; --err-bg: #fdecec;
  --info: var(--deep); --info-bg: #e8f1fb;

  /* aliasuri pentru codul existent al aplicațiilor (nume din vechile foi de stil) */
  --primary: var(--deep); --primary-dark: var(--brand); --primary-light: var(--info-bg);
  --success: var(--ok); --success-light: var(--ok-bg);
  --warning: var(--warn); --warning-light: var(--warn-bg);
  --danger: var(--err); --danger-light: var(--err-bg);
  --gray-50: var(--paper); --gray-100: var(--paper-2); --gray-200: var(--line); --gray-300: var(--line-2);
  --gray-400: var(--haze); --gray-500: #6b7a99; --gray-600: var(--muted); --gray-700: #2f3a5c;
  --gray-800: #15204a; --gray-900: var(--ink);

  --radius: 10px; --radius-sm: 7px; --radius-lg: 14px; --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(12,36,116,.06);
  --shadow: 0 2px 6px -2px rgba(12,36,116,.08), 0 1px 2px rgba(12,36,116,.05);
  --shadow-md: 0 12px 30px -14px rgba(12,36,116,.14), 0 2px 6px -2px rgba(12,36,116,.06);
  --shadow-lg: 0 30px 60px -24px rgba(5,11,34,.45), 0 4px 10px -4px rgba(5,11,34,.2);
  --ease: cubic-bezier(.32,.72,0,1);

  --font-display: "Jakarta", system-ui, sans-serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-w: 248px;
}

/* ============================================================================
   BAZĂ ȘI TIPOGRAFIE
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.012em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .75em; }
a { color: var(--deep); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--brand); text-decoration: underline; }
strong, b { font-weight: 600; }
code, kbd, .text-mono { font-family: var(--font-mono); font-size: .92em; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); background: #fff; font-size: 11px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
:focus-visible { outline: 3px solid rgba(60,176,224,.55); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--cyan); color: var(--night); }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Logo: imaginile din kit (logo/). Pe fundal închis se folosește varianta -inchis. */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { display: block; height: 28px; width: auto; }
.brand-sub { display: block; font-size: 11px; color: var(--haze); letter-spacing: .02em; margin-top: 3px; }

/* ============================================================================
   BUTOANE (clasele vechi păstrate: btn-primary/secondary/success/danger/warning/link, btn-sm/large/block/icon)
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 14px; border-radius: var(--radius);
  font: 600 13px/1.2 var(--font-sans); color: var(--ink);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .35s var(--ease), background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out, box-shadow .35s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(var(--blue), var(--deep)); color: #fff; box-shadow: 0 8px 18px -10px rgba(8,88,172,.7); }
.btn-primary:hover:not(:disabled) { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(8,88,172,.8); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--deep); color: var(--deep); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover:not(:disabled) { background: #0e5631; color: #fff; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #961b18; color: #fff; }
.btn-warning { background: #fff; color: var(--warn); border-color: #e7c58a; }
.btn-warning:hover:not(:disabled) { background: var(--warn-bg); color: var(--warn); }
.btn-link { background: none; color: var(--muted); border: 0; padding: 4px 8px; min-height: 0; font-size: 12px; }
.btn-link:hover { color: var(--deep); text-decoration: underline; }
.btn-large { min-height: 46px; padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-icon { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.btn .ic { width: 1.15em; height: 1.15em; vertical-align: 0; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }

/* buton rotund doar cu iconiță (căutare, notificări) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer; position: relative; transition: background-color .2s ease-out, border-color .2s ease-out; }
.icon-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn .count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ============================================================================
   FORMULARE
   ============================================================================ */
label { display: block; margin-bottom: 14px; }
label > span { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
label.required > span::after { content: " *"; color: var(--err); }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="date"],
input[type="tel"], input[type="search"], input[type="url"], input[type="time"], input[type="month"], input:not([type]), textarea, select, .input {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: inherit; font-size: 13px; color: var(--ink); background: #fff;
  transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%234a5571'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
select[multiple] { background-image: none; padding-right: 11px; }
input:focus, textarea:focus, select:focus, .input:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px rgba(60,176,224,.4); }
input:disabled, textarea:disabled, select:disabled { background: var(--paper-2); color: var(--muted); }
input[aria-invalid="true"], .is-invalid { border-color: var(--err); background: #fdf3f2; }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input[type="file"] { padding: 6px; font-size: 12px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--deep); vertical-align: -3px; margin: 0 6px 0 0; }
label.inline, .check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; }
/* Priveghi: .form-row = etichetă + câmp, unul sub altul (App.f); rândurile cu mai multe câmpuri folosesc .form-grid */
.form-row { display: grid; gap: 6px; grid-template-columns: 1fr; }
.form-help, .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err-msg, .form-error { font-size: 12px; color: var(--err); font-weight: 600; margin-top: 4px; }
.form-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.card > .form-section:first-child, .card > form > .form-section:first-child, .modal-body > .form-section:first-child, .modal-body > form > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--deep); margin-bottom: 12px; }
.input-group { display: flex; gap: 8px; align-items: flex-end; }
.input-group > label { flex: 1; margin: 0; }

/* opțiune tip card (ca pe site) */
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; margin: 0; font-weight: 500; transition: border-color .2s ease-out, box-shadow .2s ease-out, background-color .2s ease-out; }
.choice:hover { border-color: #9fb3d1; }
.choice:has(input:checked) { border-color: var(--deep); background: #f3f8fd; box-shadow: 0 0 0 1px var(--deep); }
.choice input { margin-top: 2px; flex: none; }

/* ============================================================================
   ECRAN DE LOGIN
   ============================================================================ */
.login-screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; background: var(--night); color: #fff; }
.login-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(60,176,224,.6) 1.4px, transparent 1.7px); background-size: 18px 18px; -webkit-mask: radial-gradient(60% 60% at 50% 45%, #000, transparent 75%); mask: radial-gradient(60% 60% at 50% 45%, #000, transparent 75%); opacity: .55; }
.login-screen::after { content: ""; position: absolute; left: 30%; top: 25%; width: 40%; height: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(60,176,224,.5), rgba(20,108,184,.28) 45%, transparent 72%); filter: blur(30px); }
.login-card { position: relative; z-index: 1; background: #fff; color: var(--ink); padding: 36px 32px 28px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; border: 1px solid rgba(255,255,255,.4); }
.login-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.login-logo img { height: 40px; width: auto; }
.login-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; text-align: center; margin: 0 0 2px; }
.login-subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-error { margin-top: 12px; padding: 10px 12px; background: var(--err-bg); color: var(--err); border-radius: var(--radius); font-size: 13px; text-align: center; display: none; }
.login-error.show { display: block; }
.login-foot { position: relative; z-index: 1; margin-top: 18px; font-size: 12px; color: var(--haze); text-align: center; }

/* ============================================================================
   SHELL: bară laterală + conținut
   ============================================================================ */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--night-2), var(--night) 55%); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; border-right: 1px solid var(--hair-2); }
.sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--hair-2); }
.sidebar-header .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-logo { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.sidebar-logo img { display: block; height: 26px; width: auto; }
.sidebar-subtitle { font-size: 11px; color: var(--haze); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #253a7c transparent; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; color: var(--mist); text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 2px; border: 1px solid transparent; transition: background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(60,176,224,.14); border-color: rgba(60,176,224,.35); color: #fff; }
.nav-item.active .nav-icon { color: var(--cyan); }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--haze); flex: none; }
.nav-icon .ic { width: 19px; height: 19px; vertical-align: 0; }
.nav-group { font-size: 11px; color: var(--haze); letter-spacing: .02em; padding: 12px 11px 4px; }
.sidebar-footer { padding: 12px 14px 14px; border-top: 1px solid var(--hair-2); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.user-avatar { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid var(--hair-2); display: flex; align-items: center; justify-content: center; color: var(--cyan); font-weight: 600; font-size: 13px; flex: none; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: var(--haze); text-transform: capitalize; }
.sidebar .btn-link { color: var(--mist); }
.sidebar .btn-link:hover { color: var(--cyan); }
.sidebar .version { font-size: 10px; color: #6b7a99; text-align: center; margin-top: 8px; }
.main-content { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.view-container { max-width: 1400px; margin: 0 auto; }

/* bara de sus pe mobil (buton meniu + logo) */
.topbar { display: none; position: sticky; top: 0; z-index: 90; align-items: center; gap: 10px; padding: 10px 14px; background: var(--night); color: #fff; border-bottom: 1px solid var(--hair-2); }
.topbar img { height: 24px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(5,11,34,.6); z-index: 95; }

/* ============================================================================
   ANTET DE PAGINĂ, TABURI
   ============================================================================ */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 16px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0; color: var(--ink); letter-spacing: -.015em; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 9px 13px; border: 0; background: none; color: var(--muted); font: 600 13px/1.2 var(--font-sans); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--deep); border-bottom-color: var(--deep); }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ============================================================================
   CARDURI, STATISTICI, FILTRE
   ============================================================================ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -20px -20px 16px; padding: 13px 20px; border-bottom: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--deep); }
.card-dk { background: linear-gradient(180deg, rgba(12,36,116,.62), rgba(5,11,34,.94)); border-color: var(--hair-2); color: #fff; box-shadow: inset 0 12px 36px -16px rgba(255,255,255,.22); }
.card-dk .card-title, .card-dk h3 { color: #fff; }
.card-dk .text-muted { color: var(--mist); }

.stats-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--deep)); opacity: .9; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

.filters-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 12px; background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.filters-bar input, .filters-bar select { width: auto; min-width: 140px; min-height: 34px; padding: 6px 10px; }
.filters-bar select { padding-right: 30px; }
.filters-bar .filter-label { font-size: 12px; font-weight: 600; color: var(--muted); }

/* notă / alertă în pagină */
.note { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.note .ic { flex: none; margin-top: 2px; }
.note-info { background: var(--info-bg); border-color: #c5dbf2; color: var(--brand); }
.note-ok { background: var(--ok-bg); border-color: #b9dcc7; color: var(--ok); }
.note-warn { background: var(--warn-bg); border-color: #efd7a4; color: var(--warn); }
.note-err { background: var(--err-bg); border-color: #f1bdbb; color: var(--err); }

/* ============================================================================
   TABELE, BADGE-URI
   ============================================================================ */
.table-wrap { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); overflow-x: auto; box-shadow: var(--shadow-sm); }
table.data, table.cnb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.cnb th { text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td, table.cnb td { padding: 10px 14px; border-bottom: 1px solid var(--paper-2); vertical-align: middle; }
table.data tr:last-child td, table.cnb tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td, table.cnb tbody tr:hover td { background: #f4f8fc; }
table.data td.numeric, table.cnb td.numeric, .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td, table.cnb tfoot td { font-weight: 600; background: var(--paper); border-top: 2px solid var(--line-2); }
table.data a, table.cnb a { font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.3; }
.badge-blue { background: var(--info-bg); color: var(--deep); }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-red { background: var(--err-bg); color: var(--err); }
.badge-gray { background: var(--paper-2); color: var(--muted); }
.badge-purple { background: #ece9fb; color: #4b3aa3; }
.badge-navy { background: var(--brand); color: #fff; }
.firma-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--info-bg); color: var(--deep); }

/* ============================================================================
   MODAL, TOAST, STĂRI GOALE
   ============================================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,11,34,.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; animation: fadeIn .15s ease; }
.modal-content { background: #fff; border-radius: var(--radius-xl); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp .3s var(--ease); }
.modal-content.modal-wide { max-width: 900px; }
.modal-content.modal-narrow { max-width: 440px; }
.modal-header { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0; color: var(--ink); }
.modal-close { background: none; border: 0; cursor: pointer; font-size: 22px; color: var(--haze); line-height: 1; padding: 0 4px; border-radius: 6px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--paper); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.toast-container { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--night-2); color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; border: 1px solid var(--hair-2); animation: slideInRight .3s var(--ease); }
.toast.success { background: var(--ok); border-color: transparent; }
.toast.error { background: var(--err); border-color: transparent; }
.toast.warning { background: #7a4800; border-color: transparent; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-icon { display: flex; justify-content: center; margin-bottom: 12px; color: var(--deep); opacity: .55; font-size: 40px; }
.empty-icon .ic { width: 44px; height: 44px; }
.empty-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.loading { display: flex; justify-content: center; align-items: center; padding: 56px; color: var(--haze); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--deep); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   UTILITARE
   ============================================================================ */
.text-muted { color: var(--muted); } .text-success { color: var(--ok); } .text-danger { color: var(--err); } .text-warning { color: var(--warn); }
.text-bold { font-weight: 600; } .text-right { text-align: right; } .text-center { text-align: center; } .text-small { font-size: 12px; }
.text-display { font-family: var(--font-display); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.no-print { }
@media print { .sidebar, .topbar, .toast-container, .no-print, .page-actions { display: none !important; } .main-content { padding: 0; } .card, .table-wrap { box-shadow: none; } }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 860px) {
  .topbar { display: flex; }
  .app-shell { flex-direction: column; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 100; transform: translateX(-100%); transition: transform .35s var(--ease); width: min(var(--sidebar-w), 86vw); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar.open ~ .sidebar-backdrop, .sidebar-backdrop.show { display: block; }
  .main-content { padding: 16px 14px 80px; }
  .page-header { align-items: flex-start; }
  .page-title { font-size: 21px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  table.data, table.cnb { font-size: 12px; }
  table.data td, table.data th, table.cnb td, table.cnb th { padding: 8px 10px; white-space: nowrap; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal-content { max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-footer { border-radius: 0; }
  .login-card { padding: 28px 20px 22px; }
}

/* Priveghi: inputuri de 16 px pe ecrane tactile (fără zoom la focus pe iOS), datetime-local stilizat ca restul */
input[type="datetime-local"] { font: inherit; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); width: 100%; }
@media (max-width: 900px) { input, select, textarea { font-size: 16px !important; } }
