/* =============================================================================
   Avi-Vest IFS · design system
   Fundament vizual comun: tokens, tipografie, butoane, formulare, layout, carduri,
   KPI, badge-uri, tabele, progres, banner-e, dialoguri și autentificare.
   -----------------------------------------------------------------------------
   1.  Tokens                        10. Badge-uri, chip-uri, avatar
   2.  Reset & bază                  11. Tabele
   3.  Butoane                       12. Progres & inel
   4.  Formulare                     13. Calendar & legendă
   5.  Layout helpers                14. Banner-e, timeline, task-uri, empty
   6.  Tipografie                    15. Dialoguri, toast, toolbar, skeleton, grafic
   7.  Carduri & KPI                 16. Autentificare
   8.  Liste                         17. Utilitare
   9.  Shell (sidebar/topbar/page)   se completează mai jos, după nucleu
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --green-950: #0E3314;
  --green-900: #13451B;
  --green-850: #174D18;
  --green-800: #1C5812;
  --green-700: #2C621D;
  --green-600: #3A7A26;
  --green-500: #4E8A2A;
  --green-100: #EAF3E4;
  --green-50:  #F3F8EF;

  --lime-500: #74AE1C;
  --lime-400: #84C224;
  --lime-200: #DCEDBF;
  --lime-100: #EFF8DE;

  /* Galbenul oficial avi-vest.ro — culoarea secundară globală */
  --yellow-500: #F2C000;
  --yellow-400: #FFCC29;
  --yellow-300: #FFD84D;

  --sidebar-bg: #FFCC29;
  --sidebar-text: #282828;
  --sidebar-muted: #5A5326;
  --sidebar-hover: rgba(30, 70, 22, .10);
  --sidebar-active-bg: #1E4616;
  --sidebar-active-fg: #FFCC29;

  --amber-500: #E2A400;
  --amber-400: #F8B800;
  --amber-200: #FFE9A8;
  --amber-100: #FFF6DA;
  --amber-900: #6A4A00;

  --red-700: #B31219;
  --red-600: #E01820;
  --red-200: #F6C7C9;
  --red-100: #FCE8E9;

  --info-700: #1C4E72;
  --info-600: #25628C;
  --info-500: #2B6CA3;
  --info-200: #C9DEF1;
  --info-100: #E9F1F8;

  --charcoal: #282828;

  /* Semantice */
  --text: #242C25;
  --text-soft: #4C554D;
  --muted: #6B756C;
  --line: #E3E6E8;
  --line-strong: #CFD5D0;
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --surface-2: #FBFCFB;
  --focus: #2C621D;

  /* Formă */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Ritm de spațiere (folosit de pagini și de noile componente) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-h: 38px;

  --shadow-xs: 0 1px 1px rgba(28, 42, 28, .04);
  --shadow-sm: 0 1px 2px rgba(28, 42, 28, .05), 0 2px 6px -2px rgba(28, 42, 28, .06);
  --shadow-md: 0 4px 12px -2px rgba(28, 42, 28, .10), 0 12px 28px -12px rgba(28, 42, 28, .14);
  --shadow-lg: 0 28px 56px -20px rgba(14, 34, 16, .38);

  /* Layout */
  --banner-h: 0px;
  --topbar-h: 56px;
  --sidebar-w: 248px;
  --page-max: 1500px;

  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --font-num: "Segoe UI Variable Text", "Segoe UI", ui-monospace, "Cascadia Mono",
    Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* -----------------------------------------------------------------------------
   2. RESET & BAZĂ
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, p, figure, dl, dd { margin: 0; }
h1, h2, h3, h4, h5 { line-height: 1.25; }
h1:focus, h2:focus, h3:focus { outline: none; }

/* Păstrăm marcatorii impliciți: paginile existente folosesc liste simple. */
ul, ol { margin: 0; padding-left: 20px; }

img { max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-size: 12px;
  background: var(--green-100);
  padding: 1px 4px;
  border-radius: 4px;
}

::selection { background: var(--lime-200); color: var(--green-900); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

hr, .divider {
  height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

svg.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.75;
}
svg.ico-lg { width: 22px; height: 22px; }
svg.ico-sm { width: 15px; height: 15px; }

/* -----------------------------------------------------------------------------
   3. BUTOANE
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background .15s var(--ease), border-color .15s var(--ease),
    color .15s var(--ease), box-shadow .15s var(--ease), transform .06s var(--ease);
}

a.btn, a.btn:hover, .btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn svg.ico { width: 16px; height: 16px; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn-primary {
  background: var(--green-700);
  border-color: #27561A;
  color: #fff;
  box-shadow: 0 1px 1px rgba(16, 34, 18, .12);
}
.btn-primary:hover { background: #255417; color: #fff; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: #2A342B;
}
.btn-secondary:hover { background: #F5F7F4; border-color: #B9C2BA; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { background: #F1F4F0; color: var(--green-700); }

.btn-subtle {
  background: var(--green-100);
  border-color: #D3E6C4;
  color: #25571A;
}
.btn-subtle:hover { background: #E1EFD6; }

.btn-danger {
  background: var(--surface);
  border-color: var(--red-200);
  color: var(--red-700);
}
.btn-danger:hover { background: var(--red-100); border-color: #EDACB0; }

.btn-link {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-700);
  font-weight: 600;
}

.btn-sm { min-height: 30px; height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-sm svg.ico { width: 14px; height: 14px; }
.btn-lg { min-height: 46px; height: 46px; padding: 0 22px; font-size: 15px; border-radius: 9px; }
.btn-lg svg.ico { width: 19px; height: 19px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

.btn[disabled], .btn.is-disabled, .btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* -----------------------------------------------------------------------------
   4. FORMULARE
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field + .field { margin-top: 12px; }
.row + .field, .grid + .field, .form-grid + .field, .field-row + .field { margin-top: 12px; }
.field + .btn, .field + .btn-block, .field + .field-row { margin-top: 12px; }
.row > .field, .row > .field + .field,
.field-row > .field, .field-row > .field + .field,
.grid > .field + .field, .form-grid > .field + .field { margin-top: 0; }

.label,
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: #3A443B;
  letter-spacing: .005em;
}

.req { color: var(--red-600); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #D5DAD6;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), background .14s;
}

.textarea {
  height: auto;
  min-height: 76px;
  padding: 9px 10px;
  line-height: 1.45;
  resize: vertical;
}

.select,
select.input {
  padding-right: 30px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B756C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

.input[type="date"],
.input[type="time"] { padding-right: 8px; }

.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: .55;
  cursor: pointer;
}

.input::placeholder, .textarea::placeholder { color: #949F97; }

.input:hover, .select:hover, .textarea:hover { border-color: #BFC8C1; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(132, 194, 36, .26);
}

.input[disabled], .select[disabled], .textarea[disabled], .input[readonly] {
  background: #F4F6F3;
  color: #77817A;
  cursor: not-allowed;
}

.input-sm { min-height: 32px; height: 32px; padding: 4px 8px; font-size: 13px; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .input { padding-left: 32px; }
.input-group svg.ico {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

/* Câmp cu buton de dezvăluire (parolă) */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 46px; }
.input-reveal {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.input-reveal:hover { background: #F1F4F0; color: var(--green-700); }
.input-reveal:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input-reveal svg { width: 18px; height: 18px; }

.hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.err-text { font-size: 11.5px; color: var(--red-700); font-weight: 500; }

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(224, 24, 32, .12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* checkbox / radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.check input[type="checkbox"],
.check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
  flex: 0 0 auto;
  cursor: pointer;
}

/* switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: #D5DAD6;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
  transition: transform .18s var(--ease);
}
.switch input:checked { background: var(--green-600); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* segmented control */
.segmented {
  display: inline-flex;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #EFF2EF;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.seg-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s var(--ease), color .14s var(--ease), box-shadow .14s;
}
.seg-opt:hover { color: var(--green-700); background: rgba(255, 255, 255, .72); text-decoration: none; }
.seg-opt.selected,
.seg-opt:has(input:checked) {
  background: var(--surface);
  color: var(--green-700);
  box-shadow: 0 1px 2px rgba(28, 42, 28, .13), 0 0 0 1px rgba(44, 98, 29, .09);
}
.seg-opt input[type="radio"],
.seg-opt input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.segmented-block { display: flex; width: 100%; }
.segmented-block .seg-opt { flex: 1 1 0; }

/* vertical two-state toggle (e.g. V/X inspection result) */
.segmented-stack {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  padding: 3px;
  border-radius: 12px;
  overflow: visible;
}
.segmented-stack::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 26px;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(28, 42, 28, .13), 0 0 0 1px rgba(44, 98, 29, .09);
  transition: transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.segmented-stack:has(input[value="X"]:checked)::before {
  transform: translateY(28px);
  background: var(--red-600);
  box-shadow: 0 1px 2px rgba(120, 20, 20, .25);
}
.segmented-stack .seg-opt {
  z-index: 1;
  height: 26px;
  min-height: 26px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.segmented-stack .seg-opt:hover { background: transparent; }
.segmented-stack .seg-opt.seg-danger:not(:has(input:checked)):hover { color: var(--red-700); }
.segmented-stack .seg-opt:has(input:checked) {
  background: transparent;
  box-shadow: none;
}
.segmented-stack .seg-opt.seg-danger:has(input:checked) { color: #fff; }

/* -----------------------------------------------------------------------------
   5. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grow, .flex-1 { flex: 1 1 auto; min-width: 0; }
.ml-auto { margin-left: auto; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.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-tight { gap: 8px; }
.grid-loose { gap: 16px; }

/* conținut + coloană laterală (filtre, sumar, acțiuni) */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 12px;
  align-items: start;
}
/* `.page` este containerul care derulează; offsets-ul rămâne mic și sigur. */
.split-aside {
  position: sticky;
  top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
@media (max-width: 1023.98px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-aside { position: static; top: auto; }
}

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 10px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* -----------------------------------------------------------------------------
   6. TIPOGRAFIE
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-height: 38px;
  margin: 0 0 12px;
}

.page-head-actions,
.page-head .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.page-title {
  font-size: 21px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.021em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-sub {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1023.98px) {
  .page-title { font-size: 19px; }
  .page-sub { font-size: 11.5px; }
  .page-head { margin-bottom: 10px; }
}

.section { margin-top: 16px; }
.section:first-child { margin-top: 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #6C756D;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.section-head .section-title { margin: 0; }

h2, .h2 { font-size: 16px; font-weight: 700; letter-spacing: -.012em; }
h3, .h3 { font-size: 14.5px; font-weight: 650; letter-spacing: -.008em; }

.link-quiet { color: var(--text-soft); }
.link-quiet:hover { color: var(--green-700); }

/* -----------------------------------------------------------------------------
   7. CARDURI & KPI
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  /* Păstrat: colțurile rotunjite taie tabelele și rândurile lipite de margini. */
  overflow: hidden;
}

.card-pad { padding: 18px; }

.settings-card { max-width: 560px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.005em;
  color: var(--text);
}
.card-title svg.ico { width: 16px; height: 16px; color: var(--green-600); }

.card-sub { margin-top: 1px; font-size: 11.5px; color: var(--muted); }

.card-body { padding: 14px 16px; }
.card-body-tight { padding: 4px 0; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}

.card-hover { transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease); }
.card-hover:hover {
  border-color: #D2DAD3;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

a.card, a.card:hover { text-decoration: none; color: inherit; }

.card-accent { border-left: 3px solid var(--kpi-accent, var(--green-500)); }

/* tabel lipit de marginile cardului (fără ramă dublă) */
.card > .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 1023.98px) {
  .card-pad { padding: 14px; }
  .card-head { padding: 10px 13px; }
  .card-body { padding: 12px 13px; }
  .card-foot { padding: 8px 13px; }
}

/* --- KPI ------------------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Padding compact, chiar și când `.card-pad` este prezent. */
  padding: 11px 14px 12px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--kpi-accent, #DCE1DB);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

a.kpi { transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
a.kpi:hover {
  border-color: #D2DAD3;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.kpi-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6C756D;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.kpi-value small,
.kpi-value .unit {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.kpi-note { font-size: 11.5px; color: var(--muted); }
.kpi-note.is-alarm { color: var(--red-700); font-weight: 600; }

.kpi-icon {
  position: absolute;
  top: 10px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green-50);
  color: var(--green-600);
}
.kpi-icon svg.ico { width: 15px; height: 15px; }

.kpi-ok { --kpi-accent: var(--green-500); }
.kpi-warn { --kpi-accent: var(--amber-400); }
.kpi-err { --kpi-accent: var(--red-600); }
.kpi-info { --kpi-accent: var(--info-500); }
.kpi-muted { --kpi-accent: #C9D1CA; }

.kpi-warn .kpi-icon { background: var(--amber-100); color: var(--amber-900); }
.kpi-err .kpi-icon { background: var(--red-100); color: var(--red-700); }
.kpi-info .kpi-icon { background: var(--info-100); color: var(--info-600); }
.kpi-muted .kpi-icon { background: #F1F3F1; color: var(--muted); }

@media (max-width: 600px) {
  .kpi { padding: 9px 11px 10px; }
  .kpi-value { font-size: 23px; }
  .kpi-label { font-size: 10px; letter-spacing: .06em; }
  .kpi-icon { display: none; }
}

/* -----------------------------------------------------------------------------
   8. LISTE
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; min-width: 0; }

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  min-width: 0;
}
.list-item:first-child { border-top: 0; }
.list-item.is-unread { background: var(--amber-100); }
.list-item.is-unread .list-title { font-weight: 700; }

.list-title { font-weight: 600; min-width: 0; }
.list-meta { font-size: 11.5px; color: var(--muted); }
.list-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* -----------------------------------------------------------------------------
   9. BANNER-E
   -------------------------------------------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--banner-accent, #C9D1CA);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
}
.banner:last-child { margin-bottom: 0; }
.banner svg.ico { width: 16px; height: 16px; margin-top: 1px; color: var(--banner-accent, var(--muted)); }
.banner strong { font-weight: 650; }
.banner .banner-body { min-width: 0; flex: 1 1 auto; }
.banner .banner-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-self: center; }

.banner-warn {
  --banner-accent: var(--amber-500);
  background: var(--amber-100);
  border-color: #F2E1AB;
  color: #634500;
}
.banner-warn svg.ico { color: #9A6E00; }

.banner-info {
  --banner-accent: var(--info-500);
  background: var(--info-100);
  border-color: var(--info-200);
  color: var(--info-700);
}
.banner-info svg.ico { color: var(--info-600); }

.banner-ok, .banner-success {
  --banner-accent: var(--green-500);
  background: var(--green-100);
  border-color: #CFE3C0;
  color: #234F13;
}
.banner-ok svg.ico { color: var(--green-600); }

.banner-err, .banner-danger {
  --banner-accent: var(--red-600);
  background: var(--red-100);
  border-color: #F2C3C6;
  color: #96121A;
}
.banner-err svg.ico { color: var(--red-600); }

.banner-muted {
  --banner-accent: #B9C2BA;
  background: #F4F6F3;
  border-color: #E4E8E3;
  color: #5A625B;
}
.banner-muted svg.ico { color: var(--muted); }

.banner-backfill {
  --banner-accent: var(--amber-500);
  background: var(--amber-100);
  border-color: #F2E1AB;
  color: #634500;
}

/* -----------------------------------------------------------------------------
   10. BADGE-URI, CHIP-URI, AVATAR, DOT
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-icon {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  font-size: 9.5px;
  line-height: 1;
}
.badge-text { display: inline-block; }

.badge-ok { background: var(--green-100); color: #255017; border-color: #CFE3C0; }
.badge-warn { background: var(--amber-100); color: #6A4A00; border-color: #F0DCA0; }
.badge-err { background: var(--red-100); color: #A5121A; border-color: #F2C3C6; }
.badge-info { background: var(--info-100); color: #1E527A; border-color: var(--info-200); }
.badge-muted { background: #F1F3F2; color: #5A625B; border-color: #E1E5E1; }

.badge-lg { height: 24px; min-height: 24px; padding: 0 9px; font-size: 12px; }
.badge-lg .badge-icon { width: 13px; height: 13px; font-size: 11px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.chip-primary { background: var(--green-100); color: #24510F; border-color: #CFE3C0; }
.chip-backup { background: var(--info-100); color: #1B4C71; border-color: var(--info-200); }
.chip-missing { background: var(--red-100); color: #A5121A; border-color: #F2C3C6; }
.chip-warn { background: var(--amber-100); color: #6A4A00; border-color: #F0DCA0; }
.chip-muted { background: #F1F3F2; color: #5A625B; border-color: #E1E5E1; }
.chip-lime { background: var(--lime-100); color: #3E6B12; border-color: #D8E9BA; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
  opacity: .9;
}
.dot-ok { background: var(--green-500); }
.dot-warn { background: var(--amber-500); }
.dot-err { background: var(--red-600); }
.dot-info { background: var(--info-500); }
.dot-muted { background: #B9C2BA; }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  flex: 0 0 auto;
  text-transform: uppercase;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 13px; }

/* -----------------------------------------------------------------------------
   11. TABELE
   -------------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-xs);
}

.table-wrap--sticky { max-height: 62vh; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6C756D;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid #F1F3F1;
  vertical-align: middle;
  text-align: left;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) td { background: #FBFCFB; }
.table tbody tr:hover td { background: #F6F8F5; }

.table th.num, .table td.num { text-align: right; }
.table td.wrap-cell { white-space: normal; min-width: 160px; }
.table-sm th { padding: 6px 10px; }
.table-sm td { padding: 6px 10px; font-size: 12.5px; }

.table .cell-title { font-weight: 600; }
.table .cell-sub { font-size: 11.5px; color: var(--muted); }

.table tr.is-muted td { color: #8A928B; }
.table tr.is-selected td { background: #F2F8EC; }
.table tr.is-clickable { cursor: pointer; }

/* rând semnalat (depășiri, neconformități) — folosit de paginile existente */
.table tr.row-alert > td { background: var(--red-100); }
.table tr.row-alert:hover > td { background: #FBE1E3; }

.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

.matrix-table td { vertical-align: top; min-width: 130px; }
.matrix-table th { white-space: nowrap; }

/* -----------------------------------------------------------------------------
   12. PROGRES & INEL
   -------------------------------------------------------------------------- */
.progress {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #E9EDE8;
  overflow: hidden;
}
.progress > span,
.progress > .progress-bar {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-600), var(--lime-400));
  transition: width .5s var(--ease);
}

.progress-lg { height: 10px; }
.progress-sm { height: 4px; }

.progress-ok > span, .progress-ok > .progress-bar {
  background: linear-gradient(90deg, var(--green-600), var(--lime-400));
}
.progress-warn > span, .progress-warn > .progress-bar,
.progress-warn .progress-bar {
  background: linear-gradient(90deg, var(--amber-500), var(--amber-400));
}
.progress-err > span, .progress-err > .progress-bar,
.progress-err .progress-bar {
  background: linear-gradient(90deg, var(--red-700), var(--red-600));
}
.progress-muted > span, .progress-muted > .progress-bar,
.progress-muted .progress-bar { background: #BFC7C0; }

.progress-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* inel de progres — procentul se setează cu style="--p:44" (0–100) */
.ring, .progress-ring {
  --p: 0;
  --size: 64px;
  --weight: 7px;
  --ring-color: var(--green-700);
  --ring-track: #E6EAE5;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--ring-color) calc(var(--p) * 1%), var(--ring-track) 0);
  transition: background .45s var(--ease);
}
.ring::before, .progress-ring::before {
  content: "";
  position: absolute;
  inset: var(--weight);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(40, 40, 40, .035);
}
.ring > *, .progress-ring > * { position: relative; z-index: 1; }
.ring-value {
  font-size: calc(var(--size) * .26);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.ring-label {
  font-size: calc(var(--size) * .135);
  color: var(--muted);
  line-height: 1.1;
  margin-top: 1px;
}
.ring-sm { --size: 46px; --weight: 6px; }
.ring-lg { --size: 86px; --weight: 9px; }
.ring-warn { --ring-color: var(--amber-400); }
.ring-err { --ring-color: var(--red-600); }
.ring-ok { --ring-color: var(--green-600); }
.ring-lime { --ring-color: var(--lime-400); }

/* -----------------------------------------------------------------------------
   13. CALENDAR & LEGENDĂ
   -------------------------------------------------------------------------- */
.cal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: capitalize;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar > .cal-weekdays {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 2px;
}
.calendar > .cal-weekdays > span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #7B857D;
}

.cal-cell, .calendar-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 66px;
  padding: 6px 7px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
a.cal-cell:hover, button.cal-cell:hover {
  border-color: #C3CCC4;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.cal-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.cal-daynum {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
  line-height: 1.1;
}

.cal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
  min-width: 0;
}
.cal-meta strong { font-weight: 700; color: inherit; }

/* stări semantice — culoare + glifă + text, niciodată doar culoare */
.cal-cell.ok, .calendar-cell.ok { background: var(--green-100); border-color: #CFE3C0; color: #1F4A12; }
.cal-cell.warn, .calendar-cell.warn { background: var(--amber-100); border-color: #F1DFA6; color: #6A4A00; }
.cal-cell.err, .calendar-cell.err { background: var(--red-100); border-color: #F2C3C6; color: #96121A; }
.cal-cell.na, .calendar-cell.na {
  background: #F1F3F2;
  border-color: #E1E5E1;
  color: #6F7871;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(120, 132, 122, .07) 0 4px,
    transparent 4px 8px
  );
}
.cal-cell.ok .cal-meta { color: #33641F; }
.cal-cell.warn .cal-meta { color: #7A5A00; }
.cal-cell.err .cal-meta { color: #8F1118; }

.cal-cell.ok::after,
.cal-cell.warn::after,
.cal-cell.err::after,
.cal-cell.na::after {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.cal-cell.ok::after { content: "✓"; background: var(--green-500); color: #fff; }
.cal-cell.warn::after { content: "!"; background: var(--amber-400); color: #4A3300; }
.cal-cell.err::after { content: "!"; background: var(--red-600); color: #fff; }
.cal-cell.na::after { content: "–"; background: #DDE2DD; color: #6F7871; }

.cal-cell.err { box-shadow: inset 3px 0 0 var(--red-600); }

.cal-cell.today, .calendar-cell.today {
  border-color: var(--green-700);
  box-shadow: inset 0 0 0 1px var(--green-700);
}
.cal-cell.err.today { box-shadow: inset 3px 0 0 var(--red-600), inset 0 0 0 1px var(--green-700); }
.cal-cell.today .cal-daynum::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--lime-500);
  vertical-align: 2px;
}
.cal-cell.selected, .calendar-cell.selected {
  border-color: var(--green-700);
  outline: 2px solid var(--green-700);
  outline-offset: 1px;
}

.cal-cell.is-empty,
.cal-blank {
  min-height: 66px;
  border: 1px dashed #E6EAE6;
  border-radius: var(--radius-lg);
  background: transparent;
}
.cal-cell.is-outside { opacity: .55; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: #5A625B;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(40, 40, 40, .1);
  background: #fff;
  flex: 0 0 auto;
}
.legend-item.ok .legend-swatch { background: var(--green-100); border-color: #BED9AE; }
.legend-item.warn .legend-swatch { background: var(--amber-100); border-color: #EBD494; }
.legend-item.err .legend-swatch { background: var(--red-100); border-color: #EFB7BA; }
.legend-item.na .legend-swatch { background: #F1F3F2; border-color: #DDE2DD; }
.legend-item.today .legend-swatch { background: #fff; border: 2px solid var(--green-700); }

@media (max-width: 767.98px) {
  .calendar { gap: 4px; }
  .calendar > .cal-weekdays { gap: 4px; }
  .cal-cell, .calendar-cell { min-height: 46px; padding: 4px 5px; border-radius: var(--radius); gap: 1px; }
  .cal-daynum { font-size: 11.5px; }
  .cal-meta { font-size: 9px; }
  .cal-cell.ok::after, .cal-cell.warn::after,
  .cal-cell.err::after, .cal-cell.na::after { width: 11px; height: 11px; font-size: 8px; top: 3px; right: 3px; }
  .calendar > .cal-weekdays > span { font-size: 9px; letter-spacing: .04em; }
  .legend { font-size: 11px; gap: 5px 10px; }
}

/* -----------------------------------------------------------------------------
   14. TIMELINE, TASK-URI, EMPTY
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  margin: 0;
  padding-left: 22px;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 14px;
  min-width: 0;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--green-500);
  box-shadow: 0 0 0 2px var(--surface);
}
.timeline-item.is-muted::before { border-color: #BFC7C0; }
.timeline-item.is-current::before { border-color: var(--green-700); background: var(--green-700); }
.timeline-item.is-err::before { border-color: var(--red-600); }

.timeline-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
}
.timeline-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.timeline-text {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.45;
}
.timeline-meta { margin-top: 2px; font-size: 11px; color: var(--muted); }

/* rânduri de activitate / verificări */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.task::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #DCE1DB;
}
.task.is-blocking::before { background: var(--red-600); }
.task.is-ok::before { background: var(--green-500); }
.task.is-warn::before { background: var(--amber-400); }
.task.is-done { background: #FCFDFB; }
.task.is-done .task-title { color: var(--text-soft); }

.task-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #F2F5F0;
  color: var(--green-700);
}
.task-icon svg.ico { width: 16px; height: 16px; }
.task.is-blocking .task-icon { background: var(--red-100); color: var(--red-700); }
.task.is-ok .task-icon { background: var(--green-100); color: var(--green-600); }
.task.is-warn .task-icon { background: var(--amber-100); color: #8A6200; }

.task-main { flex: 1 1 auto; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .task { flex-wrap: wrap; padding: 9px 11px; }
  .task-actions { width: 100%; justify-content: flex-start; padding-left: 40px; }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #F1F4F0;
  color: #7C877E;
}
.empty-icon svg.ico { width: 20px; height: 20px; }
.empty-title { font-size: 13.5px; font-weight: 650; color: var(--text-soft); }
.empty-text { max-width: 46ch; font-size: 12px; line-height: 1.45; }
.empty .btn { margin-top: 8px; }

/* -----------------------------------------------------------------------------
   15. DIALOGURI, TOAST, TOOLBAR, SKELETON, GRAFIC
   -------------------------------------------------------------------------- */
dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(86vh, 780px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog::backdrop {
  background: rgba(13, 32, 16, .48);
  backdrop-filter: blur(2px);
}
dialog[open] { animation: dialog-in .18s var(--ease) both; }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-title { font-size: 15px; font-weight: 700; letter-spacing: -.012em; line-height: 1.3; }
.dialog-sub { margin-top: 1px; font-size: 11.5px; color: var(--muted); }

.dialog-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -4px -6px 0 0;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.dialog-close:hover { background: #F1F4F0; color: var(--text); }
.dialog-close svg.ico { width: 16px; height: 16px; }

.dialog-body {
  padding: 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: calc(86vh - 130px);
  font-size: 13px;
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.dialog-sm { width: min(420px, calc(100vw - 28px)); }
.dialog-lg { width: min(760px, calc(100vw - 28px)); }
.dialog-full { width: min(980px, calc(100vw - 28px)); }

/* dialog suprapus, fără <dialog> nativ (paginile interactive) */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  /* rândul explicit 1fr face înălțimea zonei de așezare definitorie, ca
     max-height: 100% al panoului să se raporteze mereu la spațiul disponibil */
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
  background: rgba(13, 32, 16, .48);
  backdrop-filter: blur(2px);
  animation: dialog-in .16s var(--ease) both;
}

/* Shell-ul web are sidebar fix și topbar lipit. Stratul rămâne peste tot
   viewport-ul (sidebar-ul și topbar-ul se estompează uniform), dar zona în care
   se așază panoul se aliniază la coloana de conținut: la dreapta sidebar-ului
   și sub topbar. Așa dialogul e centrat pe conținut, nu pe fereastră. */
@media (min-width: 1024px) {
  .app-shell--web .modal-layer {
    padding: calc(var(--topbar-h) + 16px) 16px 16px calc(var(--sidebar-w) + 16px);
  }
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(100%, 780px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: dialog-in .18s var(--ease) both;
}
.modal-panel > .dialog-head,
.modal-panel > .dialog-foot { flex: 0 0 auto; }
.modal-panel > .dialog-body { flex: 1 1 auto; max-height: none; }
.modal-panel.dialog-sm { width: min(420px, 100%); }
.modal-panel.dialog-lg { width: min(760px, 100%); }

.dialog-back { align-self: flex-start; margin: -2px 0 10px -6px; }

@media (max-width: 640px) {
  dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: 90vh;
    margin: 0;
    border-radius: 14px 14px 0 0;
    animation: sheet-up .22s var(--ease) both;
  }
  .dialog-body { max-height: calc(90vh - 132px); }
  .dialog-foot { padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px)); }
  .modal-layer { padding: 0; align-items: end; }
  .modal-panel,
  .modal-panel.dialog-sm,
  .modal-panel.dialog-lg {
    width: 100%;
    max-width: none;
    /* foaia nu depășește niciodată spațiul stratului, oricât ar da 92vh */
    max-height: min(100%, 92vh);
    border-radius: 14px 14px 0 0;
    animation: sheet-up .22s var(--ease) both;
  }
  .modal-panel > .dialog-body { max-height: none; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes sheet-up {
  from { transform: translateY(14px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

/* toast */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(360px, calc(100vw - 24px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green-600);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  color: var(--text);
  animation: toast-in .2s var(--ease) both;
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast svg.ico { width: 16px; height: 16px; color: var(--green-600); margin-top: 1px; }
.toast-ok { border-left-color: var(--green-500); }
.toast-warn { border-left-color: var(--amber-500); }
.toast-warn svg.ico { color: var(--amber-500); }
.toast-err { border-left-color: var(--red-600); }
.toast-err svg.ico { color: var(--red-600); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1023.98px) {
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    max-width: none;
  }
}

/* toolbar / filtre */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .input, .toolbar .select { height: 32px; min-height: 32px; font-size: 13px; width: auto; min-width: 150px; }

/* spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(44, 98, 29, .22);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* grafic pe coloane — înălțimea barei se dă inline cu style="height:42%" */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  min-width: 0;
  padding: 6px 2px 0;
}
.chart-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  height: 100%;
}
.chart-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--green-500), var(--green-700));
  transition: height .4s var(--ease), background .2s var(--ease);
}
.chart-bar.is-ok { background: linear-gradient(180deg, var(--green-500), var(--green-700)); }
.chart-bar.is-warn { background: linear-gradient(180deg, var(--amber-400), var(--amber-500)); }
.chart-bar.is-err { background: linear-gradient(180deg, var(--red-600), var(--red-700)); }
.chart-bar.is-muted { background: #DCE1DB; }
.chart-col:hover .chart-bar { filter: saturate(1.15) brightness(1.03); }
.chart-label {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* listă cheie–valoare */
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  font-size: 12.5px;
}
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }

/* skeleton de încărcare */
.skeleton {
  position: relative;
  min-height: 12px;
  border-radius: var(--radius-sm);
  background: #EDF0EC;
  overflow: hidden;
}
.skeleton + .skeleton { margin-top: 8px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: skeleton-sweep 1.4s var(--ease) infinite;
}
.skeleton-title { height: 16px; width: 42%; }
.skeleton-text { height: 11px; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

/* -----------------------------------------------------------------------------
   16. AUTENTIFICARE
   -------------------------------------------------------------------------- */
.auth-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 28px 16px;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 10% -12%, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(820px 520px at 106% 112%, rgba(242, 192, 0, .55) 0%, rgba(242, 192, 0, 0) 62%),
    linear-gradient(158deg, var(--yellow-300) 0%, var(--yellow-400) 45%, var(--yellow-500) 100%);
  overflow-x: hidden;
}

.auth-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(40, 40, 40, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .55;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(424px, 100%);
  margin: 0 auto;
}

/* Paginile publice (chestionar, kiosk) au nevoie de mai mult spațiu. */
.auth-shell:has(.login-shell) { width: min(820px, 100%); }
.login-shell { min-width: 0; }

.auth-body .card {
  border-color: rgba(40, 40, 40, .10);
  box-shadow: 0 28px 56px -28px rgba(74, 58, 0, .35);
}

.auth-brand {
  display: block;
  align-self: center;
  height: 58px;
  width: auto;
  margin: 0 auto 6px;
}

.auth-tag {
  margin: 0 auto 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  color: #3F3A1C;
}

/* păstrat pentru paginile publice care își compun propriul card */
.auth-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-logo img { height: 56px; width: auto; }

.auth-card {
  position: relative;
  padding: 26px 24px 22px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(40, 40, 40, .10);
  border-radius: 16px;
  box-shadow: 0 32px 64px -24px rgba(74, 58, 0, .38), 0 2px 0 rgba(255, 255, 255, .5) inset;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-700), var(--lime-400));
}

.auth-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.022em;
  text-align: center;
  color: var(--text);
}
.auth-sub {
  margin: 3px 0 16px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}

.auth-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.auth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #98A29A;
}
.auth-sep::before, .auth-sep::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.auth-roles { display: flex; flex-direction: column; gap: 7px; }

.auth-body .btn { height: 42px; min-height: 42px; }
.auth-body .auth-roles .btn,
.auth-body .role-pill {
  display: flex;
  width: 100%;
  height: 42px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #DDE3DC;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s;
}
.auth-body .auth-roles .btn:hover,
.auth-body .role-pill:hover {
  background: var(--green-50);
  border-color: #BFD6AF;
  text-decoration: none;
}
.auth-body .role-name,
.role-pill .role-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-body .role-tag,
.role-pill .role-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Blocul de indicii pentru mediul demonstrativ */
.auth-demo {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed #E1D5A6;
  border-radius: var(--radius);
  background: #FFFDF4;
  font-size: 11.5px;
  line-height: 1.45;
  color: #5A5326;
}
.auth-demo-tag {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--amber-400);
  color: #3B2900;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-foot {
  margin-top: 16px;
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--sidebar-muted);
}

.auth-body .banner { margin-bottom: 14px; }

@media (max-width: 480px) {
  .auth-body { padding: 18px 12px; }
  .auth-brand { height: 50px; margin-bottom: 4px; }
  .auth-tag { margin-bottom: 12px; font-size: 9.5px; }
  .auth-card { padding: 22px 18px 18px; border-radius: 14px; }
  .auth-title { font-size: 17.5px; }
  .auth-sub { font-size: 12px; }
}

/* animații de intrare, discrete */
@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.page-head, .card, .kpi, .table-wrap, .banner, .task {
  animation: rise .3s var(--ease) both;
}
.page-head { animation-delay: .01s; }
.kpi-grid > *:nth-child(1) { animation-delay: .03s; }
.kpi-grid > *:nth-child(2) { animation-delay: .06s; }
.kpi-grid > *:nth-child(3) { animation-delay: .09s; }
.kpi-grid > *:nth-child(4) { animation-delay: .12s; }
.kpi-grid > *:nth-child(n+5) { animation-delay: .15s; }

/* -----------------------------------------------------------------------------
   SHELL-UL APLICAȚIEI
   Blocul de mai jos păstrează modelul de derulare existent (`.page` este
   containerul care derulează în shell-ul web).
   -------------------------------------------------------------------------- */

/* ---------- shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  color: var(--sidebar-text);
  background:
    radial-gradient(120% 55% at 8% 0%, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(170deg, var(--yellow-300) 0%, var(--yellow-400) 48%, var(--yellow-500) 100%);
  border-right: 1px solid rgba(40, 40, 40, .12);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(40, 40, 40, .16);
}

.sidebar-logo { height: 42px; width: auto; display: block; margin-bottom: 6px; }

.sidebar-logo-text {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.sidebar-tag {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #3A3520;
  font-weight: 500;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.nav-link:hover {
  background: rgba(30, 70, 22, .10);
  color: var(--green-900);
  text-decoration: none;
}

.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(30, 70, 22, .14);
  color: #1E4616;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nav-badge-alarm { background: #D6242C; color: #fff; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 18px;
  border-top: 1px solid rgba(40, 40, 40, .14);
}

.sidebar-user-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.crumb { font-weight: 600; color: var(--text-soft); }

.topbar-date { font-size: 12px; color: var(--muted); }

.page {
  padding: 20px;
  max-width: 1280px;
  width: 100%;
}

/* ---------- web shell: sidebar cu navigare grupată ---------- */
.app-shell--web {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-2);
}

.app-shell--web .sidebar {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  border-right: 1px solid rgba(40, 40, 40, .14);
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 40, 40, .22) transparent;
  z-index: 30;
}

/* Textura punctată din mockup, estompată spre baza sidebar-ului. */
.app-shell--web .sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(40, 40, 40, .10) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0) 70%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0) 70%);
}

.app-shell--web .sidebar-brand {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
}

.app-shell--web .sidebar-logo {
  height: 44px;
  min-width: 0;
  margin-bottom: 2px;
  object-fit: contain;
  object-position: left center;
}

.app-shell--web .sidebar-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.app-shell--web .sidebar-close {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(40, 40, 40, .22);
  border-radius: 9px;
  background: rgba(255, 255, 255, .35);
  color: #1E4616;
  cursor: pointer;
}

.app-shell--web .sidebar-close:hover { background: rgba(255, 255, 255, .65); }
.app-shell--web .sidebar-close:focus-visible { outline: 2px solid #1E4616; outline-offset: 2px; }
.app-shell--web .sidebar-close svg { width: 17px; height: 17px; }

/* Zona de navigare derulează singură; brandul și subsolul rămân fixe. */
.app-shell--web .nav {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 40, 40, .22) transparent;
}

.app-shell--web .nav::-webkit-scrollbar { width: 8px; }
.app-shell--web .nav::-webkit-scrollbar-track { background: transparent; }
.app-shell--web .nav::-webkit-scrollbar-thumb {
  background: rgba(40, 40, 40, .2);
  border-radius: 999px;
}
.app-shell--web .nav::-webkit-scrollbar-thumb:hover { background: rgba(40, 40, 40, .34); }

.app-shell--web .sidebar-foot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(40, 40, 40, .16);
  background: linear-gradient(180deg, rgba(242, 192, 0, 0) 0%, rgba(242, 192, 0, .22) 100%);
}

/* --- grupe pliabile --- */
.app-shell--web .nav-group {
  border-top: 1px solid rgba(40, 40, 40, .14);
  margin-top: 6px;
  padding-top: 6px;
}

.app-shell--web .nav-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.app-shell--web .nav-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--sidebar-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.app-shell--web .nav-group > summary::-webkit-details-marker { display: none; }
.app-shell--web .nav-group > summary:hover { background: rgba(30, 70, 22, .08); color: #1E4616; }
.app-shell--web .nav-group > summary:focus-visible { outline: 2px solid #1E4616; outline-offset: 2px; }
.app-shell--web .nav-group[open] > summary { color: #1E4616; }

.app-shell--web .nav-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  opacity: .8;
}

.app-shell--web .nav-group-icon svg { display: block; width: 18px; height: 18px; }

.app-shell--web .nav-group-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell--web .nav-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  width: 15px;
  height: 15px;
  opacity: .6;
  transition: transform .2s var(--ease);
}

.app-shell--web .nav-group[open] .nav-chevron { transform: rotate(180deg); }

.app-shell--web .nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 0 6px 8px;
}

.app-shell--web .nav-group[open] .nav-sub { animation: nav-group-reveal .2s var(--ease); }

@keyframes nav-group-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.app-shell--web .nav-link {
  gap: 9px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.25;
}

/* Coloană fixă de pictograme: textul pornește la aceeași coordonată în toate grupele. */
.app-shell--web .nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  opacity: .85;
}

.app-shell--web .nav-link-icon svg { display: block; width: 18px; height: 18px; }
.app-shell--web .nav-link:hover .nav-link-icon,
.app-shell--web .nav-link.active .nav-link-icon { opacity: 1; }

.app-shell--web .nav-link:hover { background: rgba(30, 70, 22, .10); color: #1E4616; text-decoration: none; }
.app-shell--web .nav-link:focus-visible { outline: 2px solid #1E4616; outline-offset: -1px; }

.app-shell--web .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(30, 70, 22, .22);
}

/* Bara de 3px din mockup, desenată pe marginea din stânga a rândului activ. */
.app-shell--web .nav-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1E4616;
}

.app-shell--web .nav-link-text { min-width: 0; }

.app-shell--web .nav-link.active .nav-badge-alarm { background: var(--yellow-400); color: #1E4616; }

/* --- main + topbar --- */
.app-shell--web .main {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-shell--web .topbar {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  height: var(--topbar-h);
  padding: 0 16px;
  gap: 12px;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: saturate(1.35) blur(8px);
  backdrop-filter: saturate(1.35) blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.app-shell--web .topbar-left { flex: 1 1 auto; min-width: 0; gap: 10px; }
.app-shell--web .topbar-right { flex: 0 0 auto; gap: 6px; }
.app-shell--web .topbar-right > .help-details { flex: 0 0 auto; }

.app-shell--web .menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-left: -6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.app-shell--web .menu-btn:hover { background: var(--surface-2); color: var(--green-700); }
.app-shell--web .menu-btn:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.app-shell--web .menu-btn svg { width: 21px; height: 21px; }

.app-shell--web .crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.app-shell--web .crumb a {
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-shell--web .crumb a:hover { color: var(--green-700); text-decoration: none; }
.app-shell--web .crumb-sep { color: #C4CBC5; font-size: 11px; }
.app-shell--web .crumb-current {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell--web .topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.app-shell--web .topbar-date svg { width: 14px; height: 14px; opacity: .72; }

.app-shell--web .bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-soft);
  text-decoration: none;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.app-shell--web .bell:hover { background: var(--surface-2); color: var(--green-700); text-decoration: none; }
.app-shell--web .bell:focus-visible { outline: 2px solid var(--green-700); outline-offset: -2px; }
.app-shell--web .bell svg { width: 21px; height: 21px; }

.app-shell--web .bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #D6242C;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--green-100);
  border: 1px solid #CFE2C5;
  color: var(--green-700);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.avatar-sm { width: 30px; height: 30px; font-size: 11px; }

.app-shell--web .user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 3px 12px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.app-shell--web .user-chip-meta { min-width: 0; line-height: 1.15; }

.app-shell--web .user-chip-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell--web .user-chip-role {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
}

.app-shell--web .logout-form { display: inline-flex; margin: 0; }

.app-shell--web .logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}

.app-shell--web .logout-link:hover { background: var(--red-100); color: var(--red-700); }
.app-shell--web .logout-link:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.app-shell--web .logout-link svg { width: 18px; height: 18px; }

/* --- pagina derulează independent de topbar --- */
.app-shell--web .page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px 22px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 40, 40, .22) transparent;
}

.app-shell--web .page::-webkit-scrollbar { width: 10px; }
.app-shell--web .page::-webkit-scrollbar-track { background: transparent; }
.app-shell--web .page::-webkit-scrollbar-thumb {
  background: rgba(40, 40, 40, .18);
  border-radius: 999px;
}
.app-shell--web .page::-webkit-scrollbar-thumb:hover { background: rgba(40, 40, 40, .3); }

.skip-link {
  position: absolute;
  left: 10px;
  top: -56px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--green-900);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s var(--ease);
}

.skip-link:focus { top: 10px; text-decoration: none; }

.mobile-only { display: none; }
.nav-backdrop { display: none; }

body.nav-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .app-shell--web .nav-sub,
  .app-shell--web .nav-chevron,
  .skip-link { animation: none !important; transition: none !important; }
}

/* ---------- help button & panel (plan 18) ---------- */
.help-details {
  position: relative;
  display: inline-block;
}

.help-details > summary {
  list-style: none;
}

.help-details > summary::-webkit-details-marker {
  display: none;
}

.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green-700);
  cursor: pointer;
  transition: background .16s var(--ease), box-shadow .16s var(--ease);
}

.help-button:hover { background: var(--yellow-400); color: var(--sidebar-text); }
.help-button:focus-visible { outline: 3px solid rgba(44, 98, 29, .35); outline-offset: 2px; }
.help-button.is-open { background: var(--yellow-400); color: var(--sidebar-text); }
.help-button svg { width: 20px; height: 20px; }

.help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 20, .35);
  z-index: 90;
}

.help-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: min(460px, 92vw);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  z-index: 95;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.help-close-hint {
  font-size: 13px;
  color: rgba(40, 40, 40, .55);
}

.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--yellow-400);
  color: var(--sidebar-text);
}

.help-title { font-size: 17px; font-weight: 800; }
.help-summary { margin-top: 4px; font-size: 12.5px; color: #4A4426; }

.help-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(40, 40, 40, .2);
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
}
.help-close svg { width: 18px; height: 18px; }

.help-body { padding: 16px 18px; overflow: auto; display: grid; gap: 14px; }

.help-foot { margin-top: auto; padding: 10px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.help-manual-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #2F6B4F);
  text-decoration: none;
}
.help-manual-link:hover { text-decoration: underline; }

.help-text { font-size: 13.5px; }

.help-block-heading { margin-top: 6px; font-size: 15px; font-weight: 700; }

.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; }

.help-callout {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 13px;
  background: var(--surface-2);
}
.help-callout-icon {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--green-700); color: #fff;
  font-size: 12px; font-weight: 700;
}
.help-callout-tip { background: var(--green-100); border-color: #CFE2C5; }
.help-callout-warning { background: var(--amber-100); border-color: #F0DCA0; }
.help-callout-danger { background: var(--red-100); border-color: #EDACB0; }

.help-figure { margin: 0; display: grid; gap: 8px; }

.help-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.help-flow-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
}
.help-flow-arrow { color: var(--muted); font-size: 13px; }

.help-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.help-field { display: grid; gap: 4px; font-size: 12.5px; }
.help-field-label { font-weight: 600; }
.help-field-input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 7px 10px;
  font-weight: 600;
}
.help-field-hint { color: var(--muted); font-size: 11.5px; }

.help-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.help-table th,
.help-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.help-table th { color: var(--muted); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }

.help-figure-caption { margin-top: 6px; font-size: 12px; color: var(--muted); }

.help-shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.help-shot img { display: block; width: 100%; height: auto; }
.help-shot-placeholder {
  min-height: 110px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; padding: 12px; text-align: center;
}

.help-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--red-600); color: #fff;
  font-size: 11px; font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}

.help-spot-list { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--text-soft); }

.help-figure figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }

.help-sample-wrap {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-2);
}
.help-sample-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.sample-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sample-field { display: grid; gap: 4px; font-size: 12.5px; }
.sample-input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 7px 10px;
  font-weight: 600;
}
.sample-hint { color: var(--muted); font-size: 11.5px; }
.help-sample-missing { color: var(--red-700); font-size: 12px; }

.help-divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.severity-badge {
  display: inline-flex; align-items: center;
  min-height: 20px; padding: 0 8px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.severity-info { background: var(--green-100); color: var(--green-700); border-color: #CFE2C5; }
.severity-warning { background: var(--amber-100); color: var(--amber-900); border-color: #F0DCA0; }
.severity-alarm { background: var(--red-100); color: var(--red-700); border-color: #EDACB0; }
.severity-critical { background: var(--red-600); color: #fff; border-color: var(--red-700); }

/* Clopoțel notificări în topbar (plan 14 §5.5) */
.topbar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(40, 40, 40, .16);
  background: #fff;
  color: #2a2a2a;
  text-decoration: none;
}

.topbar-bell:hover { background: #f6f6f6; }

.topbar-bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c2262e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* Calendar lunar (plan 03) */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6a6a6a;
  padding: 4px 6px;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(40, 40, 40, .12);
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.cal-cell:hover { background: #f7f7f7; }
.cal-empty { background: transparent; border: 0; }
.cal-day { font-weight: 700; }
.cal-count { font-size: 12px; color: #4a4a4a; }
.cal-ok { background: #e9f7ec; border-color: #b6e2c1; }
.cal-warn { background: #fff6e0; border-color: #f0d59a; }
.cal-err { background: #fdeaea; border-color: #f0b8b8; }
.cal-none { background: #fafafa; }
.cal-cell.is-today { outline: 2px solid #ffcc29; outline-offset: 1px; }
.cal-cell.is-selected { box-shadow: 0 0 0 2px #2a2a2a inset; }

/* Semnătură grafică (plan 04 §6) */
.signature-pad {
  display: block;
  border: 1px dashed rgba(40, 40, 40, .35);
  border-radius: 10px;
  background: #fff;
  max-width: 100%;
  touch-action: none;
}

.signature-image {
  max-height: 64px;
  max-width: 180px;
  border: 1px solid rgba(40, 40, 40, .16);
  border-radius: 6px;
  background: #fff;
  padding: 2px 4px;
}

.attachment-image {
  max-height: 120px;
  max-width: 220px;
  margin-top: 6px;
  border: 1px solid rgba(40, 40, 40, .16);
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

/* Matrice de formulare (plan 04) */
.matrix-table td { vertical-align: top; min-width: 130px; }
.matrix-table th { white-space: nowrap; }
.input-sm { padding: 4px 6px; font-size: 13px; min-height: 30px; }

.callout { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.callout-info { background: #eef6ff; border: 1px solid #c8def5; }

/* ---------- rapoarte: carduri A4 + previzualizare (plan 07) ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reports-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* Grila paginii de rapoarte (utilare locală, ca să nu afecteze alte pagini). */
.reports-page .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.reports-page .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.report-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}

.report-card:hover {
  border-color: #D2DAD3;
  box-shadow: 0 10px 24px -18px rgba(20, 30, 20, .45);
  transform: translateY(-1px);
}

.report-card.is-active {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(44, 98, 29, .12);
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.report-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.report-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 0 0 auto;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border: 1px solid #E1E5E1;
  border-radius: 999px;
  background: #F1F3F2;
  color: #5A625B;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.report-chip-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

.report-chip-a4 {
  background: var(--green-100);
  border-color: #CFE3C0;
  color: #24510F;
}

.report-card-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.report-card-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.report-card-field {
  flex: 1 1 auto;
  min-width: 0;
}

.report-card-form .input { min-width: 0; }
.report-card-form .btn { flex: 0 0 auto; }

.report-card-form .btn:focus-visible,
.report-preview-actions .btn:focus-visible {
  outline: 3px solid rgba(44, 98, 29, .35);
  outline-offset: 2px;
}

.report-hash-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- previzualizare A4 în pagină ---------- */
.report-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-margin-top: 12px;
}

.report-preview-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.report-preview-head {
  flex: 1 1 340px;
  min-width: 0;
}

.report-preview-eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--green-700);
}

.report-preview-title {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  outline: none;
}

.report-preview-title:focus-visible {
  outline: 2px solid rgba(44, 98, 29, .35);
  outline-offset: 3px;
  border-radius: 4px;
}

.report-preview-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.report-preview-period {
  font-weight: 600;
  color: var(--text-soft);
}

.report-preview-note { color: var(--muted); }

.report-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 1 auto;
}

.report-preview-actions .btn { white-space: nowrap; }

.report-preview-ico {
  width: 16px;
  height: 16px;
  flex: none;
}

.report-preview-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 18px;
  background: #E9EDE8;
}

.report-preview-sheet {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #DCE1DA;
  box-shadow: 0 2px 6px rgba(20, 30, 20, .10), 0 24px 48px -24px rgba(20, 30, 20, .30);
  overflow: hidden;
}

.report-preview-frame {
  display: block;
  width: 100%;
  height: max(620px, 70vh);
  border: 0;
  background: #fff;
}

.report-preview-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, .94);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.report-preview-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(44, 98, 29, .18);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: report-preview-spin .8s linear infinite;
}

@keyframes report-preview-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .report-card { transition: none; }
  .report-card:hover { transform: none; }
  .report-preview-spinner { animation-duration: 2.4s; }
}

@media (max-width: 900px) {
  .reports-page .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .report-preview-stage { padding: 10px; }
  .report-preview-bar { padding: 12px; }
}

@media (max-width: 600px) {
  .report-preview-actions { flex: 1 1 100%; }
  .report-preview-actions .btn { flex: 1 1 auto; }
  .report-card-head { flex-direction: column; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* Shell-ul aplicației mobile (Blazor Hybrid) rămâne o coloană simplă. */
  .app-shell:not(.app-shell--web) { grid-template-columns: minmax(0, 1fr); }
  .app-shell:not(.app-shell--web) .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(40, 40, 40, .12);
  }
  .app-shell:not(.app-shell--web) .nav { flex-direction: row; flex-wrap: wrap; padding: 8px 10px; }
  .app-shell:not(.app-shell--web) .nav-link { padding: 0 10px; min-height: 36px; font-size: 13px; }
  .app-shell:not(.app-shell--web) .sidebar-foot { display: none; }
  .app-shell:not(.app-shell--web) .page { padding: 14px 12px 24px; }
  .help-panel { width: 100vw; }
}

/* ---------- web shell: drawer pe tabletă și telefon ---------- */
@media (max-width: 1023.98px) {
  .app-shell--web {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  /* Fără JavaScript sidebar-ul rămâne o coloană verticală utilizabilă, deasupra conținutului. */
  .app-shell--web .sidebar {
    grid-column: 1;
    height: auto;
    max-height: 68dvh;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid rgba(40, 40, 40, .14);
  }

  .app-shell--web .nav { padding: 8px 10px 12px; }
  .app-shell--web .nav-group > summary { min-height: 38px; }
  .app-shell--web .nav-link { min-height: 40px; }

  .app-shell--web .main { grid-column: 1; grid-row: auto; height: auto; min-height: 0; overflow: visible; }
  .app-shell--web .page {
    max-width: none;
    overflow: visible;
    padding: 14px 12px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell--web .topbar { position: sticky; top: 0; height: 52px; padding: 0 12px; gap: 8px; }
  .app-shell--web .topbar-date { display: none; }
  .app-shell--web .user-chip { display: none; }
  .app-shell--web .logout-link { width: 38px; min-width: 38px; padding: 0; }
  .app-shell--web .logout-link > span { display: none; }

  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex; }

  /* Cu JavaScript: sidebar-ul devine sertar, iar pagina se derulează sub topbar. */
  html.nav-js .app-shell--web { height: 100dvh; overflow: hidden; }
  html.nav-js .app-shell--web .menu-btn { display: inline-flex; }
  html.nav-js .app-shell--web .sidebar-close { display: inline-flex; }

  html.nav-js .app-shell--web .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 286px;
    max-width: 88vw;
    height: 100dvh;
    max-height: none;
    border-bottom: 0;
    transform: translateX(-103%);
    transition: transform .26s var(--ease);
    box-shadow: 0 30px 60px -24px rgba(14, 34, 16, .45);
    z-index: 60;
  }

  html.nav-js body.nav-open .app-shell--web .sidebar { transform: none; }

  html.nav-js .app-shell--web .main { height: 100dvh; overflow: hidden; }
  html.nav-js .app-shell--web .page { flex: 1 1 auto; overflow-y: auto; }
  html.nav-js .app-shell--web .topbar { position: relative; top: auto; }

  html.nav-js .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(11, 30, 14, .46);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
  }

  html.nav-js body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
}

/* -----------------------------------------------------------------------------
   17. UTILITARE
   -------------------------------------------------------------------------- */
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: 12px; line-height: 1.45; }
.tiny { font-size: 11px; line-height: 1.4; }
.strong { font-weight: 650; }
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--red-700); }
.nowrap { white-space: nowrap; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full, .w-100 { width: 100%; }
.hide { display: none !important; }
.ms-2 { margin-left: 8px; }

/* statistici compacte în carduri de sumar */
.stat {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* rădăcini de pagină (Lane 2–4): stivă verticală consistentă */
.p-home, .p-precheck, .p-review, .p-record, .p-calendar, .p-documents,
.p-reports, .p-notifications, .p-admin, .p-settings, .p-daily,
.p-planning, .p-page {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.print-only { display: none; }

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

/* contrast sporit pentru utilizatorii care îl cer */
@media (prefers-contrast: more) {
  :root { --muted: #4C554D; --line: #C6CDC7; }
  .badge, .chip { border-width: 1px; }
}

/* Manualul de utilizator (iframe cu site-ul static ro/hu) */
.manual-frame {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  margin: calc(-1 * var(--page-pad, 20px));
  background: #fff;
}
.manual-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #FAFBF9;
}
.manual-back {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #2F6B4F);
  text-decoration: none;
}
.manual-back:hover { text-decoration: underline; }
.manual-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.manual-iframe { flex: 1; width: 100%; border: 0; background: #fff; }

