/* emma brand fonts (self-hosted, no CDN). Body/UI = Inter · Display/KPI/logo = Baloo 2.
   Decizie 2026-06-07: UI-ul operational trece pe Inter (lizibilitate la 13-14px,
   cifre tabulare in coloanele de sume); Baloo 2 ramane semnatura de brand pe
   wordmark / titluri / KPI. Nunito ramane inregistrat pentru sabloanele PDF
   care il folosesc (alegerea per sablon a tenantului nu se schimba). */
/* build: 2026-06-04 tenant logo standard (portal 48/240, settings 96/288, pdf 77/192) */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../vendor/fonts/nunito/Nunito.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../vendor/fonts/nunito/Nunito-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../vendor/fonts/baloo2/Baloo2.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter/InterVariable.woff2") format("woff2");
}

:root {
  /* Fonts */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Baloo 2", var(--font-ui);
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Brand — Ink (ex navy) */
  --em-navy: #0d1321;
  --em-navy-alt: #0a0f1c;
  --em-navy-soft: #19223a;
  /* Brand — Spark (ex coral) */
  --em-coral-start: #ff7a4d;
  --em-coral-mid: #ff6a3d;
  --em-coral-bg: #fdeae2;
  --em-coral-border: #fbd3c4;
  /* Brand — Mint (accent activ / automatizari) */
  --em-mint: #19c8a0;
  --em-mint-deep: #0e9c7c;
  --em-mint-bg: #e4f7f0;
  --em-mint-border: #bdeede;
  /* Brand — Spark adancit (hover / depth pe suprafete dark) */
  --em-spark-deep: #e8521f;
  /* Brand — Cream (foreground pe suprafete dark, ex. login) */
  --em-cream: #fffcf6;
  /* Slate (text neutru pe suprafete dark) */
  --em-slate-300: #c7ccd8;
  --em-slate-400: #9aa2b4;
  --em-slate-500: #6b7488;
  /* Linii subtile pe suprafete dark */
  --em-ink-line: rgba(255, 252, 246, 0.12);
  --em-ink-line-strong: rgba(255, 252, 246, 0.22);
  /* Neutrale */
  --em-muted: #5a6173;
  --em-muted-light: #8a91a1;

  --color-bg: #f3f0e9;
  --color-surface: #ffffff;
  --color-surface-soft: #f6f3ec;
  --color-border: #e7e2d7;
  --color-border-soft: #efeae0;
  --color-title: var(--em-navy);
  --color-text: #0d1321;
  --color-muted: var(--em-muted);
  --color-primary: var(--em-coral-mid);

  --color-success: #0b7355;
  --color-success-bg: #e4f7f0;
  --color-success-border: #bdeede;
  --color-warning: #8a6200;
  --color-warning-deep: #6b4c00;
  --color-warning-bg: #fbf1d6;
  --color-warning-border: #f4e1a8;
  --color-danger: #b42a2e;
  --color-danger-deep: #8f1f23;
  --color-danger-bg: #fceaea;
  --color-danger-border: #f5c2c4;
  --color-info: #1b4db3;
  --color-info-bg: #e9f0fd;
  --color-info-border: #c5d8fb;

  /* Inel de focus pentru inputuri/selecturi/textarea (box-shadow 3px). */
  --color-focus-ring: var(--em-coral-bg);

  /* Calendar status tokens: sursa unica pentru carduri si legenda. */
  --calendar-status-completed-bg: var(--color-success-bg);
  --calendar-status-completed-text: var(--color-success);
  --calendar-status-completed-border: var(--color-success-border);
  --calendar-status-completed-accent: var(--em-mint);
  --calendar-status-progress-bg: var(--color-info-bg);
  --calendar-status-progress-text: var(--color-info);
  --calendar-status-progress-border: var(--color-info-border);
  --calendar-status-progress-accent: var(--color-info);
  --calendar-status-progress-ring: rgba(27, 77, 179, 0.38);
  --calendar-status-progress-ring-transparent: rgba(27, 77, 179, 0);
  --calendar-status-scheduled-bg: var(--color-warning-bg);
  --calendar-status-scheduled-text: var(--color-warning);
  --calendar-status-scheduled-border: var(--color-warning-border);
  --calendar-status-scheduled-accent: var(--color-warning);

  --shadow-shell: 0 18px 55px rgba(13, 19, 33, 0.08);

  /* === Limbaj vizual extins (2026-05-30) — carduri/shell/butoane calde,
        inspirat din pagina de prezentare. Tokenii operationali existenti
        (containere de tabel/formulare) raman neschimbati ca densitate. === */
  --r-card: 16px;
  --r-card-lg: 22px;
  /* === Decizie 2026-05-31 (anti-pill): standardul global pill a fost scos.
        Toate controalele (butoane, inputs, badge-uri, toggle-uri, icon-only,
        chip-uri) devin rectangulare cu colturi rotunjite uniforme. Vezi
        DESIGN_SYSTEM.md sectiunea „Reguli De Dimensionare".
        Actualizare 2026-07-11: valoarea creste 8px -> 12px pentru un aer mai
        moale (decizie Marian, dupa mockup-ul comutatorului). Experimentul
        pill global (999px) a fost incercat si RESPINS in aceeasi zi:
        platforma ramane unitara, anti-pill, fara exceptii. === */
  --radius-control: 12px;    /* DEFAULT pentru butoane, inputs, chip-uri, icon-only */
  --radius-control-sm: 4px;  /* badge-uri mici, count-uri, thumb toggle */
  /* Token vechi, ALIAS la radius-control. NU se mai foloseste direct in cod
     nou. Pastrat doar pentru compatibilitate cu CSS-ul vechi care zice
     var(--r-pill); orice astfel de referinta devine rectangular automat. */
  --r-pill: var(--radius-control);
  --card-padding: 24px;
  --card-padding-compact: 20px;
  --card-gap: 16px;
  --section-gap: 24px;
  --shadow-card: 0 1px 2px rgba(13, 19, 33, 0.04), 0 8px 24px -16px rgba(13, 19, 33, 0.18);
  /* Umbra topbar-ului: difuza, DOAR in jos (bara e full-width, colturi drepte). */
  --shadow-topbar: 0 10px 18px -14px rgba(13, 19, 33, 0.45);
  --shadow-card-hover: 0 18px 40px -22px rgba(13, 19, 33, 0.3);
  --shadow-card-soft: 0 1px 2px rgba(13, 19, 33, 0.04);
  --shadow-drawer: -24px 0 70px rgba(13, 19, 33, 0.18);
  --overlay-backdrop: rgba(13, 19, 33, 0.42);
  --line-warm: rgba(13, 19, 33, 0.08);

  /* === Tokeni unici de dimensionare (2026-05-31) ===
     Regula: NU se hardcodeaza pixel-values pentru icoane, butoane sau chenare.
     Toate clasele folosesc tokenii de mai jos. Documentat in DESIGN_SYSTEM.md
     sectiunea "Reguli De Dimensionare". */

  /* Iconite — 6 trepte, fiecare cu rol clar */
  --icon-xs: 12px;   /* meta tag-uri, etichete foarte mici */
  --icon-sm: 14px;   /* randuri compacte de tabel, meta in liste, timeline meta */
  --icon-base: 16px; /* DEFAULT: butoane, body text, calls la $icon() fara size */
  --icon-md: 18px;   /* sidebar nav, topbar icon-button, page-back */
  --icon-lg: 20px;   /* iconite in tile/KPI head (in container 32px) */
  --icon-xl: 28px;   /* iconite in splash/feature (in container 70px) */

  /* Butoane — inaltime unica obligatorie.
     Decizie 2026-07-10 (audit mefi, ANALIZA_UI_MEFI_2026-07-10.md): 40px -> 36px.
     Principiul "o singura inaltime pentru toate controalele cu chenar" ramane;
     doar valoarea scade, pentru un aer mai dens/profesional. */
  --btn-h: 36px;          /* default — primary, secondary, icon-only, inputuri, selecturi */
  --btn-h-compact: 32px;  /* doar in toolbar-uri de tabel, contexte dense */
  --btn-padding-x: 16px;  /* orizontal default (redus odata cu inaltimea) */
  --btn-padding-x-compact: 12px;

  /* Umbra micro pe controale (decizie 2026-07-10, audit mefi): inputuri,
     selecturi, textarea si butoane primesc o umbra de 1px la ~5% — controalele
     "stau pe pagina" in loc sa fie desenate pe ea. Focus ring-ul coral o
     inlocuieste la focus (box-shadow-ul de focus are prioritate). */
  --shadow-control: 0 1px 2px rgba(13, 19, 33, 0.05);

  /* Chenare — 3 grosimi */
  --border-thin: 1px;       /* default — carduri, input-uri, separator-uri */
  --border-emphasis: 1.5px; /* sec-head bottom, dashed accents, secondary button */
  --border-strong: 2px;     /* checkbox custom, focus rings */
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

/* Inaltime/radius unic pentru controalele native fara stil propriu
   (decizie 2026-06-29). Specificitate mica: orice regula de modul o
   suprascrie; rolul ei e doar sa nu mai existe select-uri/inputuri
   "browser default" de 38px. Checkbox/radio/file/range/color excluse,
   textarea exclus (creste pe verticala). */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select {
  min-height: var(--btn-h);
  border-radius: var(--radius-control);
}

img,
svg {
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 12px;
  background: var(--em-navy);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 176px;
  max-height: 46px;
  object-fit: contain;
}

.brand strong {
  font-size: 18px;
  line-height: 1;
}

.brand strong,
.brand-logo,
.tenant-switch strong,
.tenant-switch small,
.user-chip strong,
.user-chip small {
  display: block;
}

.tenant-switch small,
.user-chip small {
  color: var(--em-muted-light);
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 600;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 122, 61, 0.16);
  color: #fff;
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: currentColor;
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.main-shell {
  min-width: 0;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  /* tenant-switch | quick-search | quick-actions (user/logout au plecat in sidebar) */
  grid-template-columns: max-content minmax(220px, 1fr) max-content;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.tenant-switch,
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tenant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--em-coral-bg);
}

.quick-search input {
  width: 100%;
  height: var(--btn-h);
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--color-text);
  outline: none;
}

.quick-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.quick-actions-menu {
  position: relative;
}

.quick-actions-menu summary {
  list-style: none;
  cursor: pointer;
}

.quick-actions-menu summary::-webkit-details-marker {
  display: none;
}

/* Buton + din topbar — Spark, ca .button-primary standard (decizie 2026-07-03,
   inlocuieste override-ul mint din trecut); pastram doar inelul pe starea [open]. */
.topbar-actions .quick-actions-menu[open] > summary.button-primary {
  background: var(--em-coral-start);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.quick-actions-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: 238px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 63, 0.16);
}

.quick-actions-panel a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 9px;
  border-radius: 6px;
  color: var(--em-navy);
  font-weight: 800;
}

.quick-actions-panel a:hover {
  background: var(--em-coral-bg);
  color: var(--em-navy);
}

.quick-actions-panel svg {
  width: 17px;
  height: 17px;
  color: var(--color-muted);
  stroke-width: 2.2;
}

.flatpickr-calendar {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(6, 17, 66, 0.16);
  color: var(--color-text);
  font-family: inherit;
}

.flatpickr-months,
.flatpickr-weekdays {
  color: var(--color-title);
}

.flatpickr-current-month,
.flatpickr-current-month input.cur-year {
  color: var(--color-title);
  font-weight: 800;
}

.flatpickr-day {
  border-radius: 6px;
  color: var(--color-text);
}

.flatpickr-day.today {
  border-color: var(--em-coral-mid);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
  border-color: var(--em-coral-mid);
  background: var(--em-coral-mid);
  color: #fff;
}

.flatpickr-day:hover {
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg);
}

.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm {
  color: var(--color-title);
  font-weight: 700;
}

.user-chip span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--em-navy);
  color: #fff;
  font-weight: 700;
}

.content-shell {
  padding: 24px;
}

.page-stack {
  display: grid;
  gap: 16px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.page-header:has(.page-kpi-strip) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.page-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-header-copy {
  min-width: 0;
}

.page-eyebrow {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 4px 0 0;
  color: var(--color-title);
  font-size: 24px;
  line-height: 1.2;
}

.page-header p {
  margin: 4px 0 0;
  color: var(--color-muted);
  line-height: 1.4;
}

.page-back-button {
  flex: 0 0 42px;
}

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

/* Formularul de trimitere WhatsApp din fisa facturii sta inline intre
   celelalte actiuni din header (decizie 2026-07-09). */
.invoice-wa-send-form {
  display: contents;
}

.page-kpi-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-soft);
}

.page-kpi-item {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--color-border-soft);
  border-left: 4px solid var(--em-coral-mid);
  border-radius: 7px;
  background: var(--color-surface-soft);
}

.page-kpi-item span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.page-kpi-item strong {
  color: var(--color-title);
  font-size: 22px;
  line-height: 1;
}

.page-kpi-item small {
  color: var(--color-muted);
  font-size: 12px;
}

.env-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: var(--radius-control-sm);
  font-size: 11px;
  font-weight: 800;
}

.env-pill {
  background: var(--em-coral-bg);
  color: var(--em-navy);
  border: 1px solid var(--em-coral-border);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* =====================================================================
   Subnav module (decizie 2026-06-07): bara de navigare interna a
   modulelor (Documente / Gestiune / Financiar) — stil editorial cu
   underline, fara container. Tab activ = text Ink + underline Spark;
   contoarele informative sunt cifre discrete (Spark pe tabul activ),
   contorul de ATENTIE (lucru in asteptare) ramane badge amber.
   Actiunile stau la dreapta, pe butoanele standard (primary cu text).
   ===================================================================== */
.subnav {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.subnav-tabs {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav-tabs::-webkit-scrollbar {
  display: none;
}

.subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 10px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--em-muted);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}

.subnav-tab:hover {
  color: var(--em-navy);
}

.subnav-tab:focus-visible {
  outline: none;
  border-radius: var(--radius-control-sm);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.subnav-tab.is-active {
  color: var(--em-navy);
  border-bottom-color: var(--em-coral-mid);
}

.subnav-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--em-muted-light);
}

.subnav-tab.is-active .subnav-count {
  color: var(--em-coral-mid);
}

.subnav-count-attn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.subnav-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  padding-bottom: 8px;
}

@media (max-width: 720px) {
  .subnav {
    flex-wrap: wrap;
    border-bottom: 0;
  }

  .subnav-tabs {
    flex-basis: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .subnav-actions {
    flex-basis: 100%;
    padding: 10px 0 0;
  }

  .subnav-actions .button:first-child {
    flex: 1;
    justify-content: center;
  }
}

/* Financiar: linii factura (invoice_new). Tabel adaptiv la continut, fara
   latimi hardcodate: coloanele numerice se dimensioneaza dupa continut
   (atributul `size` = numar de caractere + `field-sizing: content` acolo
   unde browserul il suporta), iar Denumirea ia tot spatiul ramas. */
.billing-lines-table td,
.billing-lines-table th {
  vertical-align: top;
  white-space: nowrap;
}

.billing-lines-table .form-control {
  max-width: none;
  min-width: 0;
  font: inherit;
  padding-left: 6px;
  padding-right: 6px;
}

/* Doar campurile mici cresc dupa continut (size = minimul lor); cand cresc,
   constrang Denumirea — niciodata display-ul. */
.billing-lines-table input[name="line_unit[]"],
.billing-lines-table input[name="line_quantity[]"],
.billing-lines-table input[name="line_price[]"],
.billing-lines-table input[name="line_vat[]"],
.billing-lines-table select[name="line_tax_included[]"] {
  width: auto;
  field-sizing: content;
}

.billing-lines-table input[name="line_quantity[]"],
.billing-lines-table input[name="line_price[]"],
.billing-lines-table input[name="line_vat[]"] {
  text-align: right;
}

/* Denumirea ia tot spatiul liber si e singura coloana care se strange;
   inputul si textarea o umplu complet si se pot ingusta oricat. */
.billing-line-col-description {
  width: 100%;
}

.billing-line-input-wide,
.line-note-row .form-control {
  width: 100%;
}

/* „+ Descriere" per linie: deschide randul-pereche de sub linia produsului.
   `display: flex` (bloc) il tine garantat SUB inputul de denumire — celulele
   tabelului au white-space: nowrap, deci un element inline ar ramane calare
   pe acelasi rand, peste coloanele vecine. */
.billing-line-note-toggle {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--em-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.billing-line-note-toggle:hover {
  color: var(--color-text);
}

/* Randul de descriere: pereche a liniei, pe toata latimea, colapsat implicit. */
.line-note-row {
  display: none;
}

.line-note-row.is-open {
  display: table-row;
}

.line-note-row td {
  border-top: 0;
  padding-top: 0;
}

/* Valoare / TVA calculate live + randul de totaluri. */
.billing-line-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Cu vertical-align: top, textul calculat si cosul de stergere se aliniaza
   cu mijlocul inputurilor de pe rand. */
.billing-lines-table tbody .billing-line-amount {
  padding-top: 18px;
}

.billing-lines-table tbody .button-table-action {
  margin-top: 8px;
}

/* Bara de sumar de sub tabel: butonul de adaugare stanga, totalurile dreapta. */
.billing-lines-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-lines-summary {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--em-muted);
}

.billing-lines-summary strong {
  color: var(--color-text);
}

.billing-lines-summary-gross {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
}

/* Incaseaza acum: campurile apar doar cand optiunea e bifata. */
.billing-collect-toggle {
  margin-bottom: 12px;
}

.billing-collect-fields {
  display: none;
  margin-bottom: 12px;
}

.billing-collect-fields.is-open {
  display: grid;
}

/* Camp de formular aliniat jos in grila (ex. butonul de incasare). */
.form-field-self-end {
  align-self: end;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-metric-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 96px;
  padding: 13px 14px 13px 12px;
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.dashboard-metric-card strong {
  display: block;
  margin: 3px 0 2px;
  color: var(--color-title);
  font-size: 28px;
  line-height: 1;
}

.dashboard-metric-card small {
  color: var(--color-muted);
  font-size: 12px;
}

.dashboard-metric-icon,
.dashboard-list-icon,
.dashboard-activity-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex: 0 0 auto;
}

.dashboard-metric-icon {
  width: 34px;
  height: 34px;
}

.dashboard-metric-icon svg,
.dashboard-list-icon svg,
.dashboard-activity-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.dashboard-tone-info {
  border-left-color: var(--color-info);
}

.dashboard-tone-info .dashboard-metric-icon {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.dashboard-tone-warning {
  border-left-color: var(--color-warning);
}

.dashboard-tone-warning .dashboard-metric-icon {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.dashboard-tone-success {
  border-left-color: var(--color-success);
}

.dashboard-tone-success .dashboard-metric-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.dashboard-tone-danger {
  border-left-color: var(--color-danger);
}

.dashboard-tone-danger .dashboard-metric-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.dashboard-main-column,
.dashboard-split {
  display: grid;
  gap: 12px;
}

.dashboard-split {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.dashboard-panel .panel-header {
  min-height: 72px;
}

.dashboard-agenda,
.dashboard-list,
.dashboard-activity-list {
  display: grid;
}

.dashboard-agenda {
  padding: 0 16px 16px;
}

.dashboard-agenda-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.dashboard-agenda-item:last-child {
  border-bottom: 0;
}

.dashboard-agenda-item time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 6px;
  background: var(--color-surface-soft);
  color: var(--em-navy);
  font-weight: 900;
}

.dashboard-agenda-item strong,
.dashboard-list-item strong,
.dashboard-alert-grid strong,
.dashboard-compact-table strong,
.dashboard-activity-item strong {
  color: var(--color-title);
}

.dashboard-agenda-item span:not(.badge),
.dashboard-agenda-item small,
.dashboard-list-item small,
.dashboard-alert-grid small {
  display: block;
  color: var(--color-muted);
}

.dashboard-list {
  padding: 0 16px 16px;
}

.dashboard-list-item,
.dashboard-alert-grid article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.dashboard-list-item:last-child,
.dashboard-alert-grid article:last-child {
  border-bottom: 0;
}

.dashboard-list-icon {
  width: 34px;
  height: 34px;
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.dashboard-compact-table {
  display: grid;
  padding: 0 16px 16px;
}

.dashboard-compact-table div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 4px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.dashboard-compact-table div:last-child {
  border-bottom: 0;
}

.dashboard-compact-table span {
  color: var(--color-muted);
  font-size: 12px;
}

.dashboard-compact-table em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--em-navy);
  font-style: normal;
  font-weight: 900;
}

.dashboard-alert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.dashboard-alert-grid article {
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: start;
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.dashboard-alert-grid .badge {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 4px;
}

.dashboard-activity-column {
  position: sticky;
  top: 80px;
}

.dashboard-activity-list {
  padding: 0 16px 16px;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.dashboard-activity-item:last-child {
  border-bottom: 0;
}

.dashboard-activity-icon {
  width: 36px;
  height: 36px;
  background: var(--em-coral-bg);
  color: var(--em-navy);
}

.dashboard-activity-item span {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-activity-item small,
.dashboard-activity-item time {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
}

.dashboard-activity-item time {
  font-size: 12px;
  font-weight: 800;
}

.kpi-card,
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-shell);
}

.kpi-card {
  display: grid;
  gap: 5px;
  padding: 16px;
}

.kpi-label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-card strong {
  color: var(--color-title);
  font-size: 28px;
  line-height: 1;
}

.kpi-card small {
  color: var(--em-muted);
  font-size: 12px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h2,
.empty-state h2 {
  margin: 0;
  color: var(--color-title);
  font-size: 16px;
}

.panel-header p,
.empty-state p {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.panel-body {
  padding: 16px;
}

.muted-text {
  margin: 0;
  color: var(--color-muted);
}

.reports-coming-soon {
  margin-top: var(--section-gap, 16px);
}

.table-shell {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border: 1px solid var(--color-border-soft);
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  padding: 12px 16px;
  border: 1px solid var(--color-border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 1px solid var(--color-border-soft);
}

.professional-table-shell {
  padding: 12px 16px 16px;
}

/* Cand DataTables responsive sub-colapseaza (ex. banda 540-700px), celula
   tabelului deruleaza orizontal in loc sa taie ultima coloana. Doar zona
   tabelului (.dt-layout-full), nu toolbar-ul/paginarea. Acopera toate
   wrapper-ele de tabel operational. (2026-06-10) */
.professional-table-shell .dt-layout-full,
.table-shell .dt-layout-full,
.gestiune-shell .dt-layout-full {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.client-profile-table-shell {
  padding: 0;
}

.dt-container {
  color: var(--color-text);
}

.dt-container .dt-layout-row {
  align-items: center;
  margin: 0 0 12px;
}

.dt-container .dt-search input,
.dt-container .dt-length select,
.dt-container .dt-input {
  min-height: var(--btn-h);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-text);
}

.dt-container .dt-search input {
  min-width: 260px;
  padding: 8px 10px;
}

.dt-container .dt-length select {
  padding: 6px 8px;
}

.dt-container .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dt-container button.dt-button,
.dt-container div.dt-button,
.dt-container a.dt-button {
  min-height: var(--btn-h);
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--em-navy);
  font-weight: 700;
}

.dt-container button.dt-button:hover,
.dt-container div.dt-button:hover,
.dt-container a.dt-button:hover {
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg);
}

.dt-container table.dataTable > thead > tr > th,
.dt-container table.dataTable > tbody > tr > td {
  border: 1px solid var(--color-border-soft);
  border-color: var(--color-border-soft);
}

.dt-container table.dataTable {
  border: 1px solid var(--color-border-soft);
  border-collapse: collapse !important;
  border-spacing: 0;
  /* Inter (2026-06-07): cifre tabulare — sumele si cantitatile se aliniaza
     vertical pe coloana, indiferent de cifrele continute. */
  font-variant-numeric: tabular-nums;
}

.dt-container table.dataTable > thead > tr > th {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.dt-container table.dataTable > thead > tr > th.dt-orderable-asc,
.dt-container table.dataTable > thead > tr > th.dt-orderable-desc,
.dt-container table.dataTable > thead > tr > td.dt-orderable-asc,
.dt-container table.dataTable > thead > tr > td.dt-orderable-desc {
  cursor: grab;
}

.dt-container table.dataTable > thead > tr > th.dt-orderable-asc:active,
.dt-container table.dataTable > thead > tr > th.dt-orderable-desc:active,
.dt-container table.dataTable > thead > tr > td.dt-orderable-asc:active,
.dt-container table.dataTable > thead > tr > td.dt-orderable-desc:active {
  cursor: grabbing;
}

.dt-container table.dataTable > thead > tr > th .dt-column-title,
.dt-container table.dataTable > thead > tr > td .dt-column-title {
  padding-right: 8px;
}

.dt-container table.dataTable > thead > tr > th .dt-column-order,
.dt-container table.dataTable > thead > tr > td .dt-column-order {
  color: var(--em-navy);
  display: inline-grid;
  margin-left: 6px;
  place-items: center;
}

.dt-container table.dataTable > thead > tr > th.dt-orderable-asc .dt-column-order::before,
.dt-container table.dataTable > thead > tr > th.dt-orderable-desc .dt-column-order::after,
.dt-container table.dataTable > thead > tr > td.dt-orderable-asc .dt-column-order::before,
.dt-container table.dataTable > thead > tr > td.dt-orderable-desc .dt-column-order::after {
  opacity: 0.42;
}

.dt-container table.dataTable > thead > tr > th.dt-ordering-asc .dt-column-order::before,
.dt-container table.dataTable > thead > tr > th.dt-ordering-desc .dt-column-order::after,
.dt-container table.dataTable > thead > tr > td.dt-ordering-asc .dt-column-order::before,
.dt-container table.dataTable > thead > tr > td.dt-ordering-desc .dt-column-order::after {
  opacity: 1;
}

.dt-container table.dataTable > tbody > tr:hover > * {
  /* Fara highlight „paper" la hover: randul/cardul ramane alb. Token de
   * platforma, nu hardcodat. */
  background: var(--color-surface);
}

.dt-container .dt-info {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.dt-container .dt-paging .dt-paging-button {
  border-radius: 6px;
  color: var(--em-navy) !important;
}

.dt-container .dt-paging .dt-paging-button.current {
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg) !important;
  color: var(--em-navy) !important;
}

.table-meta {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
}

.table-link {
  color: var(--em-navy);
  font-weight: 800;
}

.table-link:hover {
  color: var(--color-primary);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-actions form {
  margin: 0;
}

/* Formularul „email de test" din Setari > Sabloane email: select-ul de
   sablon si butonul stau pe acelasi rand, in randul de actiuni al paginii. */
.settings-test-send-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-test-send-form select {
  height: var(--btn-h, 40px);
  max-width: 220px;
}

.task-filter-popover {
  position: absolute;
  right: 28px;
  margin-top: -10px;
  width: min(420px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 24, 63, 0.16);
  z-index: 20;
}

.task-filter-form {
  display: grid;
  gap: 10px;
}

.task-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-view-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.task-view-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--btn-h);
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
  color: var(--color-muted);
  font-weight: 850;
  cursor: pointer;
}

.task-view-tabs button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.task-view-tabs button.is-active {
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg);
  color: var(--em-navy);
}

.task-tab-panel {
  padding: 0;
}

.task-calendar-shell {
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

/* FullCalendar isi randeaza grila ca <table>; regula globala mobila
   `table { min-width: 640px }` (pentru DataTables) o impingea peste ecran si
   o taia (SAM/DUM). Calendarul trebuie sa incapa la 100%, nu sa scrolleze. */
.fc table {
  min-width: 0;
}

.task-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.task-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.task-dot-danger { background: var(--color-danger); }
.task-dot-warning { background: var(--color-warning); }
.task-dot-success { background: var(--color-success); }
.task-dot-info { background: var(--color-info); }
.task-dot-muted { background: var(--em-muted-light); }

/* Toolbar-ul FullCalendar e ascuns (headerToolbar: false, decizie 2026-07-02):
   bara de control e cea comuna cu Calendarul (.calendar-toolbar in view). */

#tasks-calendar .fc-daygrid-event {
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 11px;
  font-weight: 800;
}

#tasks-calendar .task-calendar-event {
  cursor: pointer;
}

.task-create-modal {
  width: min(980px, calc(100% - 32px));
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-muted {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--em-coral-bg);
  color: var(--em-navy);
  font-weight: 800;
}

.empty-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.empty-actions {
  margin-top: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  /* Padding vertical 6px (era 8px): cu .button-icon de 22px inauntru,
     8+22+8+2px bordura dadea 40px si butoanele cu iconita ignorau tokenul.
     6+22+6+2 = 36px = var(--btn-h). */
  padding: 6px var(--btn-padding-x);
  border-radius: var(--radius-control);
  font-weight: 700;
  text-align: center;
}

/* Umbra micro globala pe controale (decizie 2026-07-10, audit mefi).
   Se aplica pe toate controalele cu chenar; regulile de :focus care seteaza
   box-shadow (inelul coral) o inlocuiesc natural la focus. Checkbox/radio
   raman in afara (selectori pe tip). */
.button,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
  box-shadow: var(--shadow-control);
}

.button-with-icon {
  gap: 8px;
}

.button-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  flex: 0 0 22px;
}

.button-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.3;
}

.button-primary {
  background: var(--color-primary);
  color: #fff;
}

.button-primary .button-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.button-secondary {
  background: #fff;
  color: var(--em-navy);
  border: 1px solid var(--color-border);
}

.button-secondary .button-icon {
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

/* Suma restanta (2026-07-11): rest de plata > 0 in fisa facturii si totalul
   facturilor neincasate din lista — rosu, sa sara in ochi. */
.amount-due {
  color: var(--color-danger);
  font-weight: 700;
}

/* Text potential foarte lung in celule de tabel (nume clienti etc.,
   2026-07-11): limitare cu ellipsis, textul complet ramane in title
   (tooltip la hover). Pe mobil (card) limita se anuleaza in
   responsive-tables.css. Refolosibil in orice tabel operational. */
.cell-clip {
  display: inline-block;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Meta-ul de sub valoare (ex. adresa sub locatie, Sarcini) ramane pe randul
   lui si cand primeste clip. */
.table-meta.cell-clip {
  display: block;
}

/* Celula de actiuni din tabelele gestiune/documente (2026-07-11): butoanele
   stau pe un singur rand, nu se mai infasoara cand o coloana vecina e lata. */
.actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Iconuri colorate pe butoane neutre (fisa factura, 2026-07-11): butonul
   ramane secondary, doar cipul iconului semnalizeaza canalul (Spark = email,
   Mint = WhatsApp). Refolosibile oriunde e nevoie de acelasi semnal. */
.button .button-icon.button-icon-spark {
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.button .button-icon.button-icon-mint {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.button-danger {
  /* Contur vizibil ca la secondary (decizie 2026-07-11); era rgba 0.24,
     practic invizibil pe fundal alb. */
  border: 1px solid var(--color-danger);
  background: #fff;
  color: var(--color-danger);
}

/* Danger icon-only in afara tabelelor: chenar vizibil, aceeasi greutate
   vizuala ca butoanele secondary — altfel par icoane libere langa ele
   (normalizare 2026-06-12; in tabele ramane icon liber .button-table-action). */
.button-danger.button-icon-only:not(.button-table-action) {
  border-color: var(--color-danger);
}

.button-danger .button-icon {
  background: rgba(220, 38, 38, 0.08);
  color: var(--color-danger);
}

.button-icon-only {
  display: inline-grid;
  width: var(--btn-h);
  min-height: var(--btn-h);
  place-items: center;
  padding: 0;
}

.button-icon-only svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

/* Actiuni icon-only in randuri de tabel: icon liber, fara chenar/fundal
   (decizie 2026-06-07, paginile Financiar). Sensul ramane descoperibil prin
   title + aria-label; hover-ul schimba doar culoarea. */
.button.button-icon-only.button-table-action {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--em-muted);
}

.button.button-icon-only.button-table-action:hover,
.button.button-icon-only.button-table-action:focus-visible {
  background: none;
  box-shadow: none;
  color: var(--color-text);
}

.button.button-primary.button-icon-only.button-table-action {
  color: var(--color-primary);
}

.button.button-primary.button-icon-only.button-table-action:hover,
.button.button-primary.button-icon-only.button-table-action:focus-visible {
  color: var(--em-spark-deep);
}

.button.button-danger.button-icon-only.button-table-action {
  color: var(--color-danger);
}

.button.button-danger.button-icon-only.button-table-action:hover,
.button.button-danger.button-icon-only.button-table-action:focus-visible {
  color: var(--color-danger-deep);
}

.button.button-success.button-icon-only.button-table-action {
  color: var(--color-success);
}

.button.button-success.button-icon-only.button-table-action:hover,
.button.button-success.button-icon-only.button-table-action:focus-visible {
  color: var(--em-mint-deep);
}

.button.button-warning.button-icon-only.button-table-action {
  color: var(--color-warning);
}

.button.button-warning.button-icon-only.button-table-action:hover,
.button.button-warning.button-icon-only.button-table-action:focus-visible {
  color: var(--color-warning-deep);
}

.button-icon-only.button-table-action svg {
  width: 17px;
  height: 17px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.filter-bar-compact {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.clients-filter-bar {
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, 1fr)) auto;
}

.leads-filter-bar {
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto;
}

.filter-field {
  display: grid;
  gap: 6px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: var(--btn-h);
  padding: 0 12px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  min-height: var(--btn-h);
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--em-navy);
  cursor: pointer;
  font-weight: 700;
  /* Aceeasi umbra micro ca butoanele — altfel clopotelul pare alt tip de
     control decat + de langa el (raportat 2026-07-10). */
  box-shadow: var(--shadow-control);
}

.logout-form {
  margin: 0;
}

.public-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 16px 12px;
  background: var(--color-bg);
  overflow-x: hidden;
}

.public-shell {
  width: 100%;
  max-width: 420px;
}

.public-shell-wide {
  max-width: 1040px;
}

/* Pagina publica legala (politica de confidentialitate). Foloseste exclusiv
   tokenii :root, fara hex/radius/spacing hardcodate. */
.legal-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--card-padding);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-card-lg);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.legal-doc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--card-gap);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.legal-doc h1 {
  font-family: var(--font-display);
  color: var(--color-title);
  margin: 0 0 4px;
}

.legal-doc .legal-doc-updated {
  display: block;
  margin-bottom: var(--section-gap);
  color: var(--color-muted);
  font-size: 14px;
}

.legal-doc h2 {
  font-family: var(--font-display);
  color: var(--color-title);
  margin: var(--section-gap) 0 8px;
  font-size: 18px;
}

.legal-doc p,
.legal-doc li {
  line-height: 1.6;
}

.legal-doc ul {
  margin: 8px 0;
  padding-left: 20px;
}

.legal-doc a {
  color: var(--color-primary);
}

.client-portal-page {
  display: grid;
  gap: 18px;
}

.client-portal-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(6, 17, 66, 0.08);
}

.client-portal-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--em-navy);
  font-weight: 900;
}

.client-portal-brand span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: var(--em-coral);
  color: #fff;
}

.client-portal-header p {
  margin: 0 0 4px;
  color: var(--em-coral);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-portal-header h1 {
  margin: 0;
  color: var(--color-title);
  font-size: 28px;
  line-height: 1.15;
}

.client-portal-header span {
  display: block;
  margin-top: 8px;
  color: var(--color-text);
  font-weight: 650;
}

.client-portal-card {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(6, 17, 66, 0.06);
}

.client-portal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.client-portal-card-header h2,
.client-portal-card-header p {
  margin: 0;
}

.client-portal-card-header h2 {
  color: var(--color-title);
  font-size: 20px;
}

.client-portal-card-header p {
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 700;
}

.client-portal-files {
  display: grid;
  gap: 10px;
}

.client-portal-sections {
  display: grid;
  gap: 14px;
}

.client-portal-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
}

.client-portal-section header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.client-portal-section header > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-soft);
  color: var(--em-navy);
}

.client-portal-section header svg {
  width: 21px;
  height: 21px;
}

.client-portal-section h3,
.client-portal-section p {
  margin: 0;
}

.client-portal-section h3 {
  color: var(--color-title);
  font-size: 17px;
}

.client-portal-section p {
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 700;
  line-height: 1.35;
}

.client-portal-section em {
  display: grid;
  min-width: 30px;
  height: 28px;
  place-items: center;
  padding: 0 8px;
  border-radius: var(--radius-control-sm);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-style: normal;
  font-weight: 900;
}

.client-portal-empty-line {
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  color: var(--color-muted);
  font-weight: 700;
}

.client-portal-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.client-portal-file strong,
.client-portal-file span {
  display: block;
}

.client-portal-file strong {
  color: var(--color-title);
}

.client-portal-file span {
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 700;
}

.auth-panel {
  display: grid;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--em-navy);
}

.auth-brand strong {
  font-size: 24px;
  line-height: 1;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-shell);
}

.auth-card h1 {
  margin: 4px 0 0;
  color: var(--color-title);
  font-size: 24px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: var(--btn-h);
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-text);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.alert-danger {
  border: 1px solid var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.alert-success {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.alert-warning {
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* Alerta cu actiune in dreapta (ex. link spre documentul existent). */
.alert-with-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.alert-with-actions .alert-action {
  margin-left: auto;
  white-space: nowrap;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.settings-hub-main {
  display: grid;
  gap: 16px;
}

.settings-card-list {
  display: grid;
  padding: 8px;
}

.settings-card-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content 28px;
  gap: 10px;
  align-items: center;
  /* 2026-06-07: cardurile au ramas doar cu titlu (fara descrieri) — rand dens. */
  min-height: 46px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border-soft);
}

.settings-card-row:last-child {
  border-bottom: 0;
}

.settings-card-row:hover {
  background: var(--color-surface-soft);
}

/* =====================================================================
   Curatare platforma (owner-only, /platform/cleanup)
   Lista de categorii cu checkbox + contor; rand dens, aliniat cu
   settings-card-row. 2026-06-07.
   ===================================================================== */
/* Link-ul din user-chip (sidebar footer) catre schimbarea parolei proprii. */
.user-chip-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.user-chip-link:hover .user-chip-meta strong {
  text-decoration: underline;
}

.cleanup-category-list {
  display: grid;
  padding: 8px;
}

.cleanup-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border-soft);
}

.cleanup-category-list > .cleanup-category-row:last-child {
  border-bottom: 0;
}

.cleanup-category-row .emma-check span:last-child {
  display: grid;
  gap: 2px;
}

.cleanup-category-row small {
  color: var(--color-muted);
  font-size: 12px;
}

/* Optiunea imbricata (ex. reset serii) sta sub randul parinte, indentata.
   Nu e o categorie de sine statatoare, deci renunta la "cutia" emma-check
   (bordura/fundal) ca sa nu para un rand sarit: ramane un simplu checkbox
   cu eticheta, lipit sub randul Documente. */
.cleanup-category-sub {
  padding: 4px 8px 12px 34px;
  border-bottom: 1px solid var(--color-border-soft);
}

.cleanup-category-sub .emma-check {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.cleanup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

/* Sumarul selectiei din modalul de confirmare. */
.cleanup-summary-list {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.settings-authorization-box {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
}

.settings-authorization-box header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-authorization-box h3,
.settings-authorization-box p {
  margin: 0;
}

.settings-authorization-box h3 {
  color: var(--color-title);
  font-size: 17px;
}

.settings-authorization-box p {
  margin-top: 4px;
  color: var(--color-muted);
  font-weight: 700;
}

.settings-authorization-upload {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto);
  gap: 14px;
  align-items: end;
}

.settings-upload-field {
  display: grid;
  gap: 4px;
}

.settings-authorization-box:has(input[name="authorization_enabled"]):not(:has(input[name="authorization_enabled"]:checked)) .settings-authorization-upload {
  display: none;
}

.settings-authorization-box:has(input[name="stamp_enabled"]):not(:has(input[name="stamp_enabled"]:checked)) .settings-authorization-upload {
  display: none;
}

.settings-authorization-box:has(input[name="logo_enabled"]):not(:has(input[name="logo_enabled"]:checked)) .settings-authorization-upload {
  display: none;
}

.settings-authorization-current {
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-muted);
  font-weight: 800;
}

.settings-authorization-current svg {
  width: 20px;
  height: 20px;
  color: var(--color-success);
}

.settings-authorization-current strong {
  overflow: hidden;
  color: var(--color-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-logo-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.platform-logo-preview {
  display: grid;
  gap: 8px;
}

.platform-logo-preview > span,
.platform-logo-preview small {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.platform-logo-preview-surface {
  display: grid;
  align-items: center;
  min-height: 84px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.platform-logo-preview-surface.is-sidebar {
  width: 248px;
  background: var(--em-navy);
}

.platform-logo-preview-surface.is-mark {
  width: 84px;
  justify-items: center;
  background: var(--em-navy);
}

.platform-logo-preview-surface img {
  display: block;
  width: auto;
  max-width: 200px;
  max-height: 56px;
  object-fit: contain;
}

.platform-logo-preview-surface.is-mark img {
  max-width: 44px;
  max-height: 44px;
}

.platform-logo-preview-surface strong {
  color: #fff;
  font-size: 20px;
}

.platform-email-panel {
  display: grid;
  gap: 18px;
}

.platform-email-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--em-mint-border);
  border-radius: 8px;
  background: var(--em-mint-bg);
  color: var(--em-navy);
}

.platform-email-note svg {
  flex: 0 0 auto;
  color: var(--em-mint-deep);
  margin-top: 1px;
}

.platform-email-note p {
  margin: 0;
  color: var(--em-navy);
  font-size: 14px;
  font-weight: 700;
}

.platform-email-key-field {
  grid-column: 1 / -1;
}

.platform-email-test-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.settings-card-icon,
.settings-card-arrow,
.settings-note-icon {
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.settings-card-icon {
  width: 34px;
  height: 34px;
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.settings-card-icon svg,
.settings-card-arrow svg,
.settings-note-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.settings-card-copy {
  min-width: 0;
}

.settings-card-copy strong {
  display: block;
  color: var(--color-title);
}

.settings-card-copy small {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  line-height: 1.35;
}

.settings-card-arrow {
  width: 28px;
  height: 28px;
  color: var(--em-muted-light);
}

.settings-note .panel-body {
  display: grid;
  gap: 8px;
}

.settings-note-icon {
  width: 36px;
  height: 36px;
  background: var(--em-coral-bg);
  color: var(--em-navy);
}

.settings-note strong {
  color: var(--color-title);
}

.settings-note p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.45;
}

.settings-form-group {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-soft);
}

.settings-form-group:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

/* `display: grid` de mai sus anuleaza atributul `hidden` pus de visible_when
   (settings-forms.js) — fara regula asta grupurile conditionate raman vizibile. */
.settings-form-group[hidden] {
  display: none;
}

/* Grupuri marcate cu `card => true` in SettingsCatalog: variante alternative
   (ex. metoda de trimitere email) incadrate vizual in chenar propriu. */
.settings-form-group-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 16px;
}

.settings-form-group-card:last-of-type {
  padding-bottom: 16px;
}

.settings-form-group header h3 {
  margin: 0;
  color: var(--color-title);
  font-size: 16px;
}

.settings-form-group header p {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.settings-readonly-summary {
  display: grid;
  gap: 14px;
}

.settings-summary-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  overflow: hidden;
}

.settings-summary-head {
  padding: 16px 18px 14px;
  background: var(--color-surface-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.settings-summary-head h3 {
  margin: 0;
  color: var(--color-title);
  font-size: 15px;
}

.settings-summary-head p {
  margin: 3px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
}

.settings-summary-table-wrap {
  overflow-x: auto;
}

.settings-summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.settings-summary-table tr {
  border-top: 1px solid var(--color-border-soft);
}

.settings-summary-table tr:first-child {
  border-top: 0;
}

.settings-summary-table th,
.settings-summary-table td {
  padding: 10px 14px;
  vertical-align: middle;
  line-height: 1.35;
}

.settings-summary-table th {
  width: 44%;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.settings-summary-table td {
  color: var(--color-title);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .settings-summary-table,
  .settings-summary-table tbody,
  .settings-summary-table tr,
  .settings-summary-table th,
  .settings-summary-table td {
    display: block;
    width: 100%;
  }

  .settings-summary-table th {
    padding-bottom: 2px;
  }

  .settings-summary-table td {
    padding-top: 0;
    text-align: left;
  }
}

/* ===== Layout unificat pagini de setari (decizie 2026-07-04) =====
   Nav de sectiuni in stanga (doar la 3+ sectiuni vizibile) + carduri cu
   eticheta deasupra valorii si editare per sectiune (?edit=N). Vechile
   clase .settings-summary-* / .settings-form-group raman pentru paginile
   custom (Import, Corelare) pana la Etapa 2 de unificare. */
.settings-shell {
  display: grid;
  gap: var(--card-gap, 16px);
  align-items: start;
}

.settings-shell-with-nav {
  grid-template-columns: 220px minmax(0, 1fr);
}

.settings-side-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card, 16px);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.settings-side-nav-title {
  margin: 2px 10px 6px;
  color: var(--em-muted-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-side-nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-control, 8px);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-side-nav-link:hover {
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.settings-side-nav-link.is-active {
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.settings-cards {
  display: grid;
  gap: var(--card-gap, 16px);
  min-width: 0;
}

.settings-card {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card, 16px);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
  /* Ancorele #sectiune-N nu trebuie sa intre sub topbarul sticky. */
  scroll-margin-top: 90px;
}

.settings-card.is-editing {
  border-color: var(--em-coral-mid);
}

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

.settings-card-copy { min-width: 0; }

.settings-card-copy h3 {
  margin: 0;
  color: var(--color-title);
  font-size: 16px;
}

.settings-card-copy p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
}

.settings-card-notice { font-style: italic; }

.settings-card-editing-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-control-sm, 4px);
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

.settings-card-edit { flex-shrink: 0; }

.settings-card-form { margin-top: 14px; }

/* Continut generic in cardurile paginilor custom (Companie etc.). */
.settings-card > .form-grid,
.settings-card > .settings-authorization-upload,
.settings-card > .table-shell {
  margin-top: 14px;
}

.settings-card-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-soft);
}

.settings-field {
  display: grid;
  gap: 3px;
  justify-items: start;
}

.settings-field-label {
  color: var(--em-muted-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-field-value {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.settings-field-value.is-empty {
  color: var(--em-muted-light);
  font-weight: 500;
}

@media (max-width: 900px) {
  .settings-shell-with-nav {
    grid-template-columns: 1fr;
  }

  .settings-side-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .settings-side-nav-title {
    width: 100%;
    margin: 0 4px 4px;
  }
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.settings-nav {
  align-self: start;
  display: grid;
  gap: 4px;
  padding: 8px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--color-muted);
  font-weight: 700;
}

.settings-nav-item svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.settings-nav-item.is-active {
  background: var(--em-coral-bg);
  color: var(--em-navy);
}

.settings-nav-item.is-disabled {
  opacity: 0.48;
}

.compact-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

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

.form-grid.one-column {
  grid-template-columns: 1fr;
}

/* KPI de instruire care semnaleaza atentie (blocati / autorizari expirate). */
.kpi-card-alert strong { color: var(--color-danger); }

/* Sub-titlu de sectiune in formularele compacte (grupeaza campurile ca sa nu
   para un zid de input-uri). Sta intre blocurile .form-grid. */
.form-subhead {
  margin: 2px 0 -4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--em-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Variante de raspuns la intrebare: radio "corect" langa fiecare varianta
   (mai intuitiv decat un dropdown A/B/C separat). Radio-ul e fortat la marime
   nativa, ca sa nu il umfle stilul global de input (width:100%). */
.q-options-field {
  display: grid;
  gap: 6px;
}

.q-options {
  display: grid;
  gap: 8px;
}

.q-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-option-row .q-correct {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
  padding: 0;
  margin: 0;
}

.q-option-row input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--color-primary);
}

.q-option-row .q-correct > span {
  min-width: 12px;
  font-weight: 700;
  color: var(--em-muted);
  text-align: center;
}

.q-option-row .q-opt-input {
  flex: 1 1 auto;
  min-width: 0;
}

/* Setarile numerice ale procedurii: cluster dens pe 3 coloane (numere scurte). */
.proc-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .proc-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Setari > Date companie: grila compacta pe 4 coloane (randuri de 2 si 4
   campuri, inaltimi egale). Statusul ANAF sta pe linia etichetei CUI ca sa
   nu modifice inaltimea randului. */
.company-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.company-form-grid label {
  position: relative;
  align-content: start;
}

.company-form-grid .client-anaf-status {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  max-width: calc(100% - 40px);
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: none;
}

@media (max-width: 1020px) {
  .company-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lead-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lead-form-grid label {
  position: relative;
  align-content: start;
  min-height: 86px;
}

/* Controalele stau pe inaltimea standard --btn-h (decizia 2026-06-29);
   fara override-ul istoric de 38px, care facea leads sa arate diferit. */
.lead-form-grid .input-with-button button {
  height: var(--btn-h);
}

.lead-form-grid textarea {
  resize: vertical;
}

.lead-form-grid .client-anaf-status {
  position: absolute;
  top: 64px;
  left: 0;
  min-height: 16px;
  transform: none;
}

/* Fisa cererii (leads/show): card de citire cu editare la cerere.
   Obiectul cererii (notes) e continutul principal; campurile devin
   vizibile doar in modul de editare (data-lead-edit / leads-show.js). */

.lead-request-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-request-panel .panel-body,
.lead-read-view {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.lead-request-text {
  margin: 0;
  color: var(--color-title);
  font-size: 14px;
  line-height: 1.6;
}

.lead-request-empty {
  color: var(--color-muted);
  font-size: 13px;
}

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

.lead-request-meta svg {
  width: 14px;
  height: 14px;
}

.lead-request-selects {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-contact-actions {
  display: flex;
  flex-flow: row wrap;
  gap: 8px;
}

.lead-contact-actions .button {
  max-width: 100%;
}

.lead-contact-actions .button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-fiscal summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.lead-fiscal summary::-webkit-details-marker {
  display: none;
}

.lead-fiscal summary div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lead-fiscal summary strong {
  color: var(--color-title);
  font-size: 14px;
}

.lead-fiscal summary div span {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-fiscal-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

.lead-fiscal[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.lead-fiscal[open] .lead-fiscal-chevron {
  transform: rotate(180deg);
}

.lead-form .lead-edit-fields {
  display: none;
  width: 100%;
}

.lead-form .lead-section.is-editing .lead-edit-fields {
  display: grid;
}

.lead-form .lead-section.is-editing .lead-read-view {
  display: none;
}

/* Specificitate 0-2-0 ca sa bata .form-actions { display:flex } definit
   mai jos in fisier; altfel bara Renunta/Salveaza ramane mereu vizibila. */
.lead-form .lead-form-save {
  display: none;
}

.lead-form.is-editing .lead-form-save {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .lead-request-selects {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-grid label {
  display: grid;
  /* align-content: start — fara el, randurile implicite se intind pe
     inaltimea celulei (align-content: stretch), iar inputul dintr-o celula
     fara hint devine mai inalt decat vecinul cu hint => randuri decalate
     (bug raportat 2026-07-14 pe Adauga tenant). */
  align-content: start;
  gap: 6px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Hintul si eroarea de sub camp nu mostenesc bold-ul etichetei. */
.form-grid label .field-hint,
.form-grid label .field-error {
  font-weight: 400;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: var(--btn-h);
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.emma-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.emma-upload:hover,
.emma-upload:focus-within,
.emma-upload.is-dragover {
  border-color: var(--em-coral-mid);
  background: var(--em-coral-bg);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.emma-upload.is-dragover {
  border-style: solid;
}

/* Varianta compacta: upload-ul sta pe acelasi rand cu inputurile (42px). */
.emma-upload-compact {
  min-height: var(--btn-h);
  padding: 4px 10px;
  gap: 8px;
}

.emma-upload-compact .emma-upload-icon {
  width: var(--btn-h-compact);
  height: var(--btn-h-compact);
  flex: 0 0 var(--btn-h-compact);
}

/* Stare goala pentru sectiunile dashboard (DESIGN_SYSTEM: text scurt, un CTA). */
.section-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 13px;
}

.section-empty a {
  color: var(--color-primary);
  font-weight: 700;
}

.emma-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.emma-upload-icon {
  display: inline-grid;
  width: var(--btn-h);
  height: var(--btn-h);
  flex: 0 0 var(--btn-h);
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--em-navy);
}

.emma-upload-icon svg {
  width: var(--icon-md);
  height: var(--icon-md);
}

.emma-upload-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.emma-upload-copy strong {
  overflow: hidden;
  color: var(--color-title);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emma-upload-copy small {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emma-upload.has-file .emma-upload-file {
  color: var(--em-navy);
}

.emma-upload-current {
  display: grid;
  grid-template-columns: var(--btn-h-compact) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
  font-weight: 800;
}

.emma-upload-current svg {
  width: 18px;
  height: 18px;
  color: var(--color-success);
}

.emma-upload-current strong {
  overflow: hidden;
  color: var(--color-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Setari > Date companie: chip-ul "curent" pentru logo / autorizatie /
   stampila — aceeasi inaltime cu zona de upload, optional cu miniatura. */
.settings-asset-current {
  grid-template-columns: auto auto minmax(0, 1fr);
  min-height: 64px;
  align-self: stretch;
}

.settings-asset-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
}

.settings-asset-thumb img {
  display: block;
  max-width: 88px;
  max-height: 36px;
  object-fit: contain;
}

.emma-toggle {
  position: relative;
  display: inline-grid;
  gap: 6px;
  justify-items: start;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.emma-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.emma-toggle-track {
  position: relative;
  display: block;
  width: 48px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.emma-toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
  box-shadow: 0 1px 4px rgba(6, 17, 66, 0.22);
  content: "";
  transition: transform 150ms ease;
}

.emma-toggle input:focus-visible + .emma-toggle-track {
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

/* Stil UNIC pentru toate comutatoarele (decizie 2026-07-04): oprit = neutru
   (gri cald, stilul de baza al track-ului), pornit = verde mint — tokenul de
   brand pentru "activ". NU se mai suprascrie culoarea per context; variantele
   vechi (ink la pornit, rosu la oprit) au fost eliminate. */
.emma-toggle input:checked + .emma-toggle-track {
  border-color: var(--em-mint);
  background: var(--em-mint);
}

.emma-toggle input:checked + .emma-toggle-track::after {
  transform: translateX(22px);
}

.emma-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 800;
  cursor: pointer;
}

.emma-check input[type="hidden"] {
  display: none;
}

.emma-check input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.emma-check-box {
  position: relative;
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
}

.emma-check-box::after {
  width: 10px;
  height: 6px;
  border-bottom: 2px solid var(--color-surface);
  border-left: 2px solid var(--color-surface);
  content: "";
  opacity: 0;
  transform: rotate(-45deg) translateY(-1px);
}

.emma-check input[type="checkbox"]:focus-visible + .emma-check-box {
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.emma-check input[type="checkbox"]:checked + .emma-check-box {
  border-color: var(--em-navy);
  background: var(--em-navy);
}

.emma-check input[type="checkbox"]:checked + .emma-check-box::after {
  opacity: 1;
}

.form-grid .emma-upload,
.form-grid .emma-check {
  display: flex;
}

.form-grid .emma-check {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
}

/* Caseta checkbox (ex. „SMS activ") sta pe acelasi rand cu un input etichetat.
   Fara asta se intinde pe toata inaltimea randului (align-items: stretch) si
   pare mai inalta. O fixam la inaltimea unui control si o aliniem la baza, ca
   sa fie la nivelul input-ului vecin. */
.form-grid .emma-check,
.form-grid .emma-upload {
  align-self: end;
  min-height: var(--btn-h);
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  min-height: var(--btn-h);
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-control-sm);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control input:checked + span,
.segmented-control label.is-active span {
  background: var(--color-surface);
  color: var(--em-navy);
  box-shadow: var(--shadow-card-soft);
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.compact-form .form-actions {
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.settings-row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.form-label-note {
  color: var(--em-muted);
  font-weight: 500;
}

.word-counter.is-over-limit {
  color: var(--color-danger);
  font-weight: 700;
}

.settings-services-table {
  width: 100%;
}

#svc-form-panel {
  scroll-margin-top: 80px;
  transition: box-shadow 0.3s, border-color 0.3s;
}

#svc-form-panel.is-editing {
  border-color: var(--em-coral-mid);
  box-shadow: 0 0 0 3px var(--em-coral-bg), 0 12px 32px rgba(232, 82, 31, 0.15);
  animation: svcEditPulse 1.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes svcEditPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 61, 0.55); }
  60% { box-shadow: 0 0 0 14px rgba(255, 106, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 106, 61, 0); }
}

.svc-opt-group {
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
}

.svc-opt-group legend {
  padding: 0 6px;
  color: var(--em-navy);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.svc-opt-help {
  margin: 0 0 8px;
  color: var(--em-muted);
  font-size: 11.5px;
}

.svc-opt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.svc-opt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.svc-opt-row input {
  height: var(--btn-h);
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 14px;
}

.svc-opt-row input:focus {
  border-color: var(--em-coral-mid);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
  outline: none;
}

.template-content-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  min-height: 540px;
  align-items: stretch;
}

.template-editor-main {
  min-width: 0;
  padding: 20px;
}

.template-token-sidebar {
  align-self: stretch;
  min-height: 100%;
  border-left: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  padding: 18px 16px;
  overflow: auto;
}

.template-form-actions {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.template-form-actions-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--em-muted);
  font-size: 13px;
  font-weight: 600;
}

.template-form-actions-note svg {
  flex: 0 0 auto;
  color: var(--em-navy);
}

.template-form-actions-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .template-content-pane {
    grid-template-columns: 1fr;
  }

  .template-token-sidebar {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  .template-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .template-form-actions-buttons,
  .template-form-actions-buttons .button {
    width: 100%;
  }
}

.activity-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border-soft);
}

.activity-item strong {
  color: var(--color-title);
}

.activity-item small {
  color: var(--color-muted);
}

.summary-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.summary-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.summary-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-list span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-list strong {
  color: var(--color-title);
  font-size: 14px;
}

.client-create-form {
  display: grid;
  gap: 22px;
}

.client-form-card {
  display: grid;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.client-form-switches {
  grid-template-columns: 260px 260px minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: start;
  gap: 28px;
}

.client-type-field {
  grid-column: span 2;
}

.client-type-segmented {
  width: 100%;
}

.client-type-segmented label {
  flex: 1 1 0;
}

.client-type-segmented span {
  display: block;
  text-align: center;
}

.client-form-card h2 {
  margin: 0;
  color: var(--color-title);
  font-size: 18px;
}

.client-form-grid {
  display: grid;
  gap: 20px;
  align-items: start;
}

.client-form-grid.four-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-form-grid.five-columns {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.client-field {
  position: relative;
  display: grid;
  grid-template-rows: 20px minmax(var(--btn-h), auto);
  gap: 6px;
  align-items: start;
  color: var(--em-muted-light);
  font-size: 14px;
  font-weight: 800;
}

.client-field > span {
  display: flex;
  align-items: center;
  min-height: 20px;
}

.client-field-title-with-action {
  justify-content: space-between;
  gap: 12px;
}

.client-field-title-with-action button {
  border: 0;
  background: transparent;
  color: var(--em-navy);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.client-field em {
  color: var(--em-coral-mid);
  font-style: normal;
}

.client-field input,
.client-field select,
.client-field textarea {
  width: 100%;
  height: var(--btn-h);
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-text);
  outline: none;
}

.client-field textarea {
  min-height: 112px;
  height: auto;
  resize: vertical;
  line-height: 1.5;
}

.client-field input:focus,
.client-field select:focus,
.client-field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.input-with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  position: relative;
}

.input-with-button input,
.input-with-button select {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-with-button button {
  display: grid;
  height: var(--btn-h);
  place-items: center;
  border: 1px solid var(--color-border);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #fff;
  color: var(--color-title);
  cursor: pointer;
  font-weight: 900;
}

.input-with-button button:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
}

.input-with-button button svg {
  width: 18px;
  height: 18px;
}

.location-contact-input {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.location-contact-input button {
  padding: 0 12px;
  font-size: 12px;
}

.client-location-representative {
  display: grid;
  gap: 14px;
}

.client-location-representative h3 {
  margin: 0;
  color: var(--color-title);
  font-size: 15px;
}

.client-anaf-status {
  position: absolute;
  top: 70px;
  left: 0;
  min-height: 16px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-1px);
}

.client-anaf-status.is-error {
  color: var(--color-danger);
}

.client-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.client-profile-page {
  display: grid;
  gap: 18px;
}

.client-profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.client-breadcrumb {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--color-muted);
  font-weight: 800;
}

.client-profile-top h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--color-title);
  font-size: 24px;
  line-height: 1.2;
}

.client-profile-top h1 span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  font-size: 13px;
}

.client-profile-top p {
  margin: 8px 0 0;
  color: var(--color-text);
  font-weight: 600;
}

.client-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Comutatorul „Notificari pe mobil" din randul de actiuni al clientului
   foloseste componenta unica .emma-toggle si doar schimba alinierea etichetei. */
.client-notify-toggle-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.client-notify-toggle-form .emma-toggle {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.client-module-tabs {
  display: grid;
  grid-template-columns: repeat(11, minmax(92px, 1fr));
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.client-module-tabs a {
  position: relative;
  display: grid;
  min-height: 78px;
  place-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-title);
  font-weight: 800;
}

.client-module-tabs a.is-active {
  border: 2px solid var(--em-navy);
  color: var(--em-navy);
}

.client-module-tabs strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.client-module-tabs strong svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.client-module-tabs a.is-active strong {
  border-color: var(--em-navy);
  background: var(--color-surface-soft);
  color: var(--em-navy);
}

.client-module-tabs span {
  font-size: 12px;
  text-align: center;
}

.client-module-tabs em {
  position: absolute;
  top: 7px;
  right: 10px;
  display: grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: var(--radius-control-sm);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.client-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.client-profile-main {
  display: grid;
  gap: 16px;
}

.client-profile-card {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(6, 17, 66, 0.04);
}

.client-profile-card h2 {
  margin: 0 0 14px;
  color: var(--color-title);
  font-size: 18px;
}

.client-profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "company company tax phone"
    "address address contact email";
  gap: 10px;
}

.client-profile-summary-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.client-profile-summary-item.is-wide {
  grid-column: span 2;
}

.client-profile-summary-company {
  grid-area: company;
}

.client-profile-summary-tax {
  grid-area: tax;
}

.client-profile-summary-address {
  grid-area: address;
}

.client-profile-summary-contact {
  grid-area: contact;
}

.client-profile-summary-phone {
  grid-area: phone;
}

.client-profile-summary-email {
  grid-area: email;
}

.client-profile-summary-item span,
.client-profile-location-item dt {
  display: block;
  margin-bottom: 5px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-profile-summary-item strong {
  display: block;
  color: var(--color-title);
  font-size: 14px;
  line-height: 1.35;
}

/* ===== Card "Comunicari" — un rand per canal, cu destinatia efectiva
   vizibila si un singur comutator per canal, salvat automat la clic
   (redesign 2026-07-13; inlocuieste formularul consolidat din 2026-07-08). ===== */
.client-comms-intro {
  margin: -6px 0 14px;
  font-size: 12.5px;
  color: var(--em-muted);
}

.client-comms-channels {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border-soft);
}

.client-comms-channel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.client-comms-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--color-title);
}

.client-comms-channel-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.client-comms-channel-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-title);
}

.client-comms-channel-dest {
  font-size: 12.5px;
  color: var(--em-muted);
  overflow-wrap: anywhere;
}

.client-comms-channel-dest em {
  font-style: normal;
  color: var(--em-muted-light);
}

.client-comms-channel-missing {
  color: var(--color-warning);
}

.client-comms-channel-missing a {
  font-weight: 600;
  color: var(--color-primary);
}

.client-comms-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.client-comms-edit[hidden] {
  display: none;
}

.client-comms-edit input {
  max-width: 260px;
}

.client-comms-channel > .button-icon-only {
  flex-shrink: 0;
}

.client-comms-channel-toggle {
  flex-shrink: 0;
}

.client-comms-channel-toggle input:disabled + .emma-toggle-track {
  opacity: 0.45;
  cursor: not-allowed;
}

.client-comms-channel-toggle .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.client-comms-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--em-muted-light);
}

.client-comms-status.is-saved {
  color: var(--color-success);
}

.client-comms-status.is-error {
  color: var(--color-danger);
}

.client-profile-location-list {
  display: grid;
  gap: 10px;
}

.client-profile-location-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface);
}

.client-profile-location-item > div,
.client-profile-location-item dl > div {
  min-width: 0;
}

.client-profile-location-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-title);
  font-size: 14px;
}

.client-profile-location-item > div > span {
  display: block;
  color: var(--color-muted);
  font-size: 12.5px;
}

.client-profile-location-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.client-profile-location-item dt {
  margin-bottom: 2px;
}

.client-profile-location-item dd {
  margin: 0;
  color: var(--color-title);
  font-size: 13px;
  font-weight: 700;
}

.client-profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.client-profile-card-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.client-profile-card-header h2 span {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  font-size: 13px;
}

.client-section {
  display: grid;
  gap: 16px;
}

.client-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.client-section-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-title);
  font-size: 22px;
}

.client-section-header h2 span {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  font-size: 13px;
}

.client-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-section-note {
  margin: 0;
  color: var(--color-text);
  font-weight: 700;
}

.client-section-subtitle {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.client-section-subtitle h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-title);
  font-size: 22px;
}

.client-section-subtitle span {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  font-size: 13px;
}

.client-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 32px;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-muted);
  text-align: center;
}

.client-empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--em-navy);
}

.client-empty-state strong {
  color: var(--color-title);
}

.client-files-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: stretch;
}

/* Adauga fisier: campurile in stanga, drop-box inalt in dreapta. */
.client-file-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.client-file-upload-fields {
  display: grid;
  gap: 20px;
  align-content: start;
}

.client-file-upload-drop {
  grid-template-rows: 20px minmax(42px, 1fr);
}

.client-file-upload-drop .emma-upload {
  height: 100%;
  justify-content: center;
}

.client-location-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tile facturare pe dashboard (decizie 2026-06-12): total + sparkline + perioade. */
.tile-billing-chart {
  display: block;
  width: 100%;
  height: 56px;
  margin: 8px 0 10px;
  color: var(--color-primary);
}

.tile-billing-line {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-billing-area {
  fill: currentColor;
  opacity: 0.12;
}

.tile-range {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tile-range-btn {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: transparent;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.tile-range-btn:hover {
  color: var(--color-text);
}

.tile-range-btn.is-active {
  border-color: var(--color-primary);
  color: var(--color-title);
}

.client-portal-card {
  gap: 14px;
  align-content: start;
}

.client-portal-card,
.client-file-upload-form {
  display: grid;
}

.client-file-upload-form {
  gap: 14px;
}

.client-profile-card td form {
  margin: 0;
}

.client-file-visibility {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-right: 8px;
  padding: 5px 9px;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 900;
}

.client-file-visibility.is-visible {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.client-file-visibility.is-hidden {
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.client-note-composer {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.client-note-composer form {
  display: grid;
  gap: 14px;
}

.client-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-note-list {
  display: grid;
  gap: 12px;
}

.client-note-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.client-note-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-note-card-link:hover,
.client-note-card-link:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.client-note-card-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.client-note-card.is-pinned {
  border-left: 3px solid var(--color-primary);
}

.client-note-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
}

.client-note-card header strong {
  color: var(--color-title);
}

.client-note-card header em {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: var(--radius-control-sm);
  background: var(--color-info-bg);
  color: var(--color-text);
  font-style: normal;
  font-size: 12px;
}

.client-note-card p {
  margin: 0;
  color: var(--color-text);
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.client-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 34px 18px;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.72);
}

.client-modal {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(6, 17, 66, 0.28);
}

.client-modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  color: var(--color-title);
}

.client-modal-close svg {
  width: 24px;
  height: 24px;
}

.client-modal-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-title);
}

.client-modal-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.client-modal h2 {
  margin: 0;
  color: var(--color-title);
  font-size: 20px;
}

.client-modal > p {
  margin: -8px 0 0;
  color: var(--color-muted);
  font-weight: 800;
}

.client-contact-form {
  display: grid;
  gap: 20px;
}

.client-location-modal {
  width: min(700px, 100%);
}

.client-map-modal {
  width: min(1040px, 100%);
}

.client-map-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.client-map-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
}

.client-map-location {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.client-map-location.is-active {
  border-color: var(--em-navy);
  box-shadow: 0 0 0 1px rgba(47, 40, 152, 0.08);
}

.client-map-location strong {
  color: var(--color-title);
  font-size: 14px;
}

.client-map-location span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.client-map-frame {
  display: grid;
  gap: 10px;
}

.client-map-frame iframe {
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.client-map-frame .button {
  justify-self: end;
}

.client-task-prompt-modal {
  width: min(520px, 100%);
}

.client-task-prompt-body {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.client-task-prompt-body strong {
  color: var(--color-title);
  font-size: 16px;
}

.client-task-prompt-body span {
  color: var(--color-muted);
  font-weight: 700;
  line-height: 1.45;
}

.client-location-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(78px, 1fr));
  gap: 18px;
}

.client-location-street,
.client-location-postal,
.client-location-country {
  grid-column: span 2;
}

.client-contact-form-switches {
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr) 220px;
  gap: 18px;
  align-items: end;
}

.client-contact-form .client-toggle-field {
  min-height: var(--btn-h);
  align-content: center;
}

.client-modal-permissions {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(160px, auto));
  align-items: center;
  border: 1px solid var(--em-navy);
  background: var(--color-surface);
}

.client-modal-permissions header {
  display: grid;
  grid-template-rows: 42px minmax(62px, auto);
  min-height: 104px;
  padding: 0;
}

.client-modal-permissions header strong {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  background: var(--em-navy);
  color: var(--color-surface);
  font-size: 16px;
}

.client-modal-permissions header span {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 12px 18px;
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.45;
}

.client-modal-permissions .emma-check {
  min-height: 104px;
  justify-content: center;
  padding: 14px;
  border-left: 1px solid var(--color-surface-soft);
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

.client-modal-permissions .emma-check > span:last-child {
  max-width: 110px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.25;
}

.client-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-call {
  background: var(--color-primary);
}

.dot-sms {
  background: var(--em-coral-border);
}

.dot-whatsapp {
  background: var(--em-coral-border);
}

.dot-email {
  background: var(--color-surface-soft);
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

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

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-activity-column {
    position: static;
  }

  .client-form-switches,
  .client-form-grid.four-columns,
  .client-form-grid.three-columns,
  .client-form-grid.five-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-profile-layout {
    grid-template-columns: 1fr;
  }

  .client-module-tabs {
    grid-template-columns: repeat(11, 110px);
  }

  .client-contact-form-switches,
  .client-files-grid,
  .client-location-form-grid,
  .client-map-layout,
  .client-modal-permissions {
    grid-template-columns: 1fr;
  }

  .client-location-street,
  .client-location-postal,
  .client-location-country {
    grid-column: auto;
  }

  .client-modal-permissions .emma-check {
    justify-content: flex-start;
    border-top: 1px solid var(--color-surface-soft);
    border-left: 0;
  }
}

/* Tableta (721-1020px): sidebar = bara-rail compacta, doar iconite.
   Ascundem textele (nu le taiem) si centram iconitele/avatarul. Sub 720px
   sidebar-ul devine drawer off-canvas (app-shell.css) si isi reafiseaza
   etichetele din stilurile de baza, deci ascunderea de mai jos NU se aplica. */
@media (min-width: 721px) and (max-width: 1020px) {
  .sidebar {
    padding: 12px 10px;
  }

  /* Rail-ul are padding orizontal 10px (nu 14px): compensarea scroll
     container-ului din .sidebar-nav se aliniaza la acest padding. */
  .sidebar-nav {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  /* `aside.sidebar` (nu doar `.sidebar`): blocul de restyle de mai jos in
     fisier redeclara `display` pe .brand-logo-img si .user-chip-meta cu
     aceeasi specificitate, iar pozitia ulterioara castiga — textele
     reapareau in rail si se revarsau peste continut (incident 2026-07-12). */
  aside.sidebar .brand-wm,
  aside.sidebar .brand-logo-img,
  aside.sidebar .nav-label,
  aside.sidebar .nav-item > span,
  aside.sidebar .user-chip-meta {
    display: none;
  }

  .sidebar .brand,
  .sidebar .nav-item {
    justify-content: center;
    gap: 0;
  }

  /* Rail-ul are ~56px utili: avatarul (34px) si butonul de logout (34px) nu
     incap unul langa altul — se stivuiesc vertical, centrate. Fara asta
     logout-ul iesea din rail si devenea invizibil pe fundalul deschis. */
  aside.sidebar .sidebar-footer .user-chip {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
  }

  .sidebar .brand {
    padding: 6px 0 18px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
    min-height: auto;
    margin: 0;
    /* Edge-to-edge lipit sus: padding orizontal = padding-ul .content-shell
       (12px la <=720, 10px la <=420) ca bara sa se alinieze cu continutul. */
    padding: 10px 12px;
  }

  .tenant-switch,
  .user-chip {
    min-width: 0;
  }

  .tenant-switch > div,
  .user-chip > div {
    min-width: 0;
  }

  .tenant-switch strong,
  .tenant-switch small,
  .user-chip strong,
  .user-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-chip > div {
    display: none;
  }

  .quick-search {
    grid-column: 1 / -1;
    order: 4;
  }

  .quick-search input {
    height: 42px;
  }

  .quick-actions-panel {
    right: 0;
    width: min(238px, calc(100vw - 24px));
  }

  .content-shell {
    padding: 14px 12px 18px;
  }

  .page-header,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .page-header-main {
    width: 100%;
  }

  .page-kpi-strip {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .dashboard-metrics,
  .dashboard-layout,
  .dashboard-split,
  .dashboard-alert-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-activity-column {
    position: static;
  }

  .settings-card-row {
    grid-template-columns: 34px minmax(0, 1fr) 28px;
  }

  .settings-authorization-box header,
  .settings-authorization-upload {
    display: grid;
    grid-template-columns: 1fr;
  }

  .platform-logo-preview-grid {
    grid-template-columns: 1fr;
  }

  .settings-card-row .badge {
    grid-column: 2;
    justify-self: start;
  }

  .settings-card-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .dashboard-agenda-item,
  .dashboard-list-item,
  .dashboard-alert-grid article {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-agenda-item time,
  .dashboard-agenda-item .badge,
  .dashboard-list-item .badge {
    justify-self: start;
  }

  .page-actions,
  .panel-header .page-actions {
    width: 100%;
  }

  .page-actions .button:not(.button-icon-only),
  .panel-header .button:not(.button-icon-only) {
    flex: 1 1 150px;
  }

  .button,
  .icon-button,
  .dt-container button.dt-button,
  .dt-container div.dt-button,
  .dt-container a.dt-button {
    min-height: 42px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .settings-layout,
  .detail-layout,
  .filter-bar,
  .leads-filter-bar,
  .lead-summary-strip,
  .form-grid,
  .lead-form-grid,
  .client-form-switches,
  .client-form-grid.four-columns,
  .client-form-grid.three-columns,
  .client-form-grid.two-columns,
  .client-form-grid.five-columns,
  .client-files-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .button {
    justify-content: center;
    width: 100%;
  }

  .panel-body,
  .professional-table-shell,
  .client-profile-card {
    padding: 12px;
  }

  .table-shell {
    margin-inline: -4px;
    padding-bottom: 4px;
  }

  table {
    min-width: 640px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .dt-container .dt-layout-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .dt-container .dt-layout-cell {
    width: 100%;
  }

  .dt-container .dt-buttons,
  .dt-container .dt-search {
    width: 100%;
  }

  .dt-container .dt-search input,
  .dt-container .dt-length select,
  .dt-container .dt-input {
    width: 100%;
    min-width: 0;
  }

  .dt-container .dt-paging {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
  }

  .lead-form-grid label {
    min-height: auto;
  }

  .lead-form-grid .client-anaf-status {
    position: static;
    margin-top: 2px;
  }

  .lead-flow-note {
    align-items: flex-start;
    margin: 12px;
  }

  .lead-summary-strip div {
    min-height: auto;
  }

  .span-2 {
    grid-column: auto;
  }

  .client-form-actions {
    flex-direction: column;
  }

  .client-form-actions .button {
    justify-content: center;
  }

  .client-profile-top,
  .client-section-header,
  .client-profile-card-header,
  .client-section-actions,
  .client-modal-actions,
  .client-note-actions {
    flex-direction: column;
  }

  /* Actiunile fisei (Inapoi / Optiuni / Editare) raman pe acelasi rand pe
   * mobil, nu stivuite vertical; se infasoara daca nu incap, iar butoanele se
   * dimensioneaza dupa continut. */
  .client-profile-actions {
    flex-wrap: wrap;
  }

  .client-profile-actions .button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .client-profile-top h1 {
    flex-wrap: wrap;
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .client-module-tabs {
    grid-template-columns: repeat(11, 116px);
    gap: 8px;
  }

  .client-module-tabs a {
    min-height: 74px;
    padding: 8px;
  }

  .client-profile-summary-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .client-profile-summary-item.is-wide {
    grid-column: auto;
  }

  .client-profile-summary-item {
    grid-area: auto;
  }

  .client-comms-channel {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .client-comms-edit {
    align-items: stretch;
    flex-direction: column;
  }

  .client-comms-edit input {
    max-width: none;
  }

  .client-profile-location-item,
  .client-profile-location-item dl {
    grid-template-columns: 1fr;
  }

  .client-section-actions,
  .client-modal-actions,
  .client-note-actions,
  .client-section-actions .button,
  .client-modal-actions .button,
  .client-note-actions .button {
    width: 100%;
  }

  .client-modal {
    width: min(100%, calc(100vw - 18px));
    max-height: calc(100vh - 18px);
    padding: 16px;
    overflow-y: auto;
  }

  .client-map-frame iframe {
    min-height: 320px;
  }

  .client-map-frame .button {
    justify-self: stretch;
  }

  .public-body {
    place-items: start center;
  }

  .client-portal-header,
  .client-portal-section header,
  .client-portal-file {
    grid-template-columns: 1fr;
  }

  .client-portal-header {
    align-items: start;
  }

  .client-portal-file {
    display: grid;
  }

  .client-portal-file .button {
    justify-content: center;
    width: 100%;
  }

}

@media (max-width: 420px) {
  .topbar {
    top: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .logout-form {
    grid-column: 2;
    grid-row: 1;
  }

  .user-chip {
    display: none;
  }

  .content-shell {
    padding-inline: 10px;
  }

  .topbar {
    padding-inline: 10px;
  }

  .panel-header,
  .panel-body,
  .professional-table-shell,
  .client-profile-card {
    padding: 10px;
  }

  .button:not(.button-icon-only),
  .filter-actions,
  .filter-actions .button {
    width: 100%;
  }

  .public-shell {
    max-width: 100%;
  }

  .auth-card {
    padding: 20px;
  }
}

/* emma brand: Baloo 2 pentru wordmark, titluri de pagina, titluri de sectiune,
   titluri de card si valori KPI. Restul ramane pe fontul UI (Inter). */
.brand strong,
.page-header h1,
.panel-header h2,
.panel-header h3,
.section-title,
.card-title,
.kpi-card strong,
.kpi-card-value,
.page-kpi-item span,
.client-portal-brand,
.dashboard-agenda-item time {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.page-eyebrow,
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--em-mint-deep);
  font-weight: 500;
}

/* =============================================================
   STRAT VIZUAL EXTINS — 2026-05-30
   Aplica limbajul cald/rotunjit inspirat din pagina de prezentare
   pe shell, page-header, carduri, KPI, butoane, badge-uri, empty
   states, sidebar si topbar. Tabelele si formularele raman dense.
   Acest bloc suprascrie regulile anterioare doar acolo unde
   schimbam radius/padding/umbre/font de titlu; tot ce nu apare
   aici pastreaza valorile operationale standard.
   ============================================================= */

/* Page stack: ritm mai aerisit intre sectiuni */
.page-stack {
  gap: var(--section-gap);
}

/* Document emission forms: centered A4-like work surface, not full-bleed. */
.document-a4-form {
  --document-a4-width: 980px;
  display: flex;
  flex-direction: column;
  gap: calc(var(--section-gap) + 14px);
}

.document-a4-form.document-a4-form-wide {
  --document-a4-width: 1180px;
}

.document-a4-form > :where(.page-header, .document-a4-form-el, .document-a4-block, .edit-banner, .alert) {
  width: min(100%, var(--document-a4-width));
  margin-inline: auto;
  box-sizing: border-box;
}

.document-a4-form-el {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
}

.document-final-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.document-final-actions-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--em-muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .document-final-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .document-final-actions-note {
    margin-right: 0;
  }

  .document-final-actions .button {
    width: 100%;
  }
}

/* Documents schema pending banner */
.documents-schema-pending {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: var(--section-gap);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--r-card);
}

.documents-schema-pending-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--color-surface);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-control);
}

.documents-schema-pending-copy {
  flex: 1;
}

.documents-schema-pending-copy strong {
  display: block;
  color: var(--em-navy);
  font-size: 14px;
  font-weight: 700;
}

.documents-schema-pending-copy small {
  color: var(--color-warning);
  font-size: 12px;
}

.documents-schema-pending-copy code {
  font-family: var(--font-mono);
}

/* Documents start chooser */
.doc-start { display: flex; flex-direction: column; gap: var(--section-gap); }
/* Carduri compacte (decizie 2026-06-11): auto-fit ca toate tipurile sa
   incapa pe un rand pe ecrane largi, fara inaltime minima fortata. */
.doc-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.doc-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
  color: inherit;
  text-decoration: none;
}
.doc-choice:hover {
  border-color: var(--em-coral-border);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.doc-choice-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--em-navy);
}
.doc-choice.is-mint .doc-choice-icon { background: var(--em-mint-bg); color: var(--em-mint-deep); }
.doc-choice.is-coral .doc-choice-icon { background: var(--em-coral-bg); color: var(--em-spark-deep); }
.doc-choice.is-blue .doc-choice-icon { background: var(--color-info-bg); color: var(--color-info); }
.doc-choice h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.15;
}
.doc-choice p {
  margin: 0;
  color: var(--em-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.doc-choice ol {
  margin: 0;
  padding-left: 16px;
  color: var(--em-navy);
  font-size: 12px;
  line-height: 1.6;
}
.doc-choice-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--em-coral-mid);
  font-size: 13px;
  font-weight: 800;
}
.doc-start-settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface-soft);
}
.doc-start-settings p { margin: 0; color: var(--em-muted); font-size: 13px; }
.doc-start-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Service report subtype chooser */
.pv-chooser { display: flex; flex-direction: column; gap: var(--section-gap); }
.pv-chooser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.pv-chooser-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-card-lg);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow-card-soft);
}
.pv-chooser-card:hover {
  transform: translateY(-2px);
  border-color: var(--em-coral-border);
  box-shadow: var(--shadow-card-hover);
}
.pv-chooser-card .icon-box {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
  border-radius: var(--radius-control);
}
.pv-chooser-card.is-mint .icon-box {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}
.pv-chooser-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}
.pv-chooser-card p {
  margin: 0;
  color: var(--em-muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.pv-chooser-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--em-navy);
  font-size: 13px;
  line-height: 1.7;
}
.pv-chooser-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--em-coral-mid);
  font-size: 13.5px;
  font-weight: 700;
}
.pv-chooser-card.is-mint .cta { color: var(--em-mint-deep); }
.pv-chooser-card:hover .cta { color: var(--em-spark-deep); }
.pv-chooser-note {
  color: var(--em-muted);
  font-size: 13px;
  text-align: center;
}

/* Document series form */
.series-form {
  padding: 0;
}

.series-form-panel {
  overflow: hidden;
}

.series-form-panel .panel-header {
  align-items: flex-start;
  gap: 16px;
}

.series-token-help {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.series-token-help code,
.series-example code {
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface-soft);
  color: var(--em-navy);
  font-family: var(--font-mono);
  font-size: 12px;
}

.series-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.series-form-grid .field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  grid-column: span 4;
}

.series-form-grid .field.span-6 { grid-column: span 6; }
.series-form-grid .field.span-8 { grid-column: span 8; }
.series-form-grid .field.span-12 { grid-column: 1 / -1; }

.series-form-grid label {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .01em;
}

.series-form-grid input,
.series-form-grid select,
.series-form-grid textarea {
  width: 100%;
  min-height: var(--btn-h);
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.series-form-grid input:focus,
.series-form-grid select:focus,
.series-form-grid textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.series-form-grid .helper {
  color: var(--em-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.series-mono-input,
.series-readonly-counter {
  font-family: var(--font-mono);
}

.series-mono-uppercase {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.series-readonly-counter {
  background: var(--color-surface-soft);
}

.series-preview-box {
  display: flex;
  align-items: center;
  min-height: var(--btn-h);
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid var(--em-mint-border);
  border-radius: var(--radius-control);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-family: var(--font-mono);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-example {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 18px 18px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--em-muted);
  font-size: 12px;
  line-height: 1.45;
}

.series-form-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--color-border-soft);
}

.series-form-actions .left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--em-muted);
  font-size: 12px;
}

/* Document template form */
.template-identity-grid {
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(150px, 1fr);
  gap: 10px 12px;
  padding: 0;
}

.template-identity-grid label {
  min-height: auto;
}

.template-identity-description {
  grid-column: 1 / -1;
}

.template-editor-panel {
  padding: 0;
  overflow: hidden;
}

.template-body-field,
.template-token-group {
  margin-bottom: 14px;
}

.template-body-helper {
  margin-bottom: 6px;
}

.template-page-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 10px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface-soft);
  color: var(--em-muted);
  font-size: 11px;
}

.template-token-sidebar-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 14px;
}

.template-token-sidebar-copy {
  margin: 0 0 14px;
  color: var(--em-muted);
  font-size: 11.5px;
}

.template-token-group-title {
  margin-bottom: 6px;
  color: var(--em-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.template-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.emma-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .doc-start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .series-form-grid .field,
  .series-form-grid .field.span-6,
  .series-form-grid .field.span-8 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 880px) {
  .pv-chooser-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .template-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .doc-start-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .template-identity-grid {
    grid-template-columns: 1fr;
  }
}

/* Generic document issue form */
.emit-page {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.emit-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--em-coral-border);
  border-radius: var(--r-card);
  background: var(--em-coral-bg);
  font-size: 12.5px;
  font-weight: 700;
}

.emit-steps .step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  color: var(--em-spark-deep);
}

.emit-steps .step.done { color: var(--em-mint-deep); }
.emit-steps .step.todo { color: var(--em-muted-light); font-weight: 600; }
.emit-steps .step.current { color: var(--em-navy); }
.emit-steps .step .icon { width: 14px; height: 14px; }
.emit-steps .arrow { padding: 0 2px; color: var(--em-muted-light); }

.emit-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.emit-pane {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.emit-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.emit-pane-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
}

.emit-pane-head .meta {
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.emit-pane-body {
  padding: 18px 20px;
}

.emit-preview-pane {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.emit-preview-pane .emit-pane-body {
  overflow: auto;
}

.emit-page .field-group {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
}

.emit-page .field-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.emit-page .field-group-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
}

.emit-page .field-group-body {
  padding: 16px;
}

.emit-page .field-group-body.is-flush {
  padding: 0;
}

.emit-page .field-group.is-context .field-group-head {
  border-bottom-color: var(--em-mint-border);
  background: var(--em-mint-bg);
}

.emit-page .field-group.is-context .field-group-head h3 {
  color: var(--em-mint-deep);
}

.emit-page .field-group.is-context input[readonly],
.emit-page .field-group.is-context input:read-only,
.emit-page .field-group.is-context textarea[readonly] {
  border-color: var(--em-mint-border) !important;
  background: var(--em-mint-bg) !important;
  color: var(--em-navy);
  cursor: not-allowed;
}

.tag-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-control-sm);
  background: var(--line-warm);
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-source.is-mint {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.emit-page .compact-form .form-grid.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.emit-page .compact-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.emit-page .compact-form .field.span-2 { grid-column: span 2; }
.emit-page .compact-form .field.span-3 { grid-column: span 3; }

.emit-page .compact-form label {
  color: var(--em-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.emit-page .compact-form label .req {
  color: var(--em-coral-mid);
}

.emit-page .compact-form input[type="text"],
.emit-page .compact-form input[type="number"],
.emit-page .compact-form input[type="email"],
.emit-page .compact-form input[type="date"],
.emit-page .compact-form select,
.emit-page .compact-form textarea {
  width: 100%;
  min-height: var(--btn-h);
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 14px;
}

.emit-page .compact-form textarea {
  min-height: 96px;
  line-height: 1.5;
  resize: vertical;
}

.emit-page .compact-form input:focus,
.emit-page .compact-form select:focus,
.emit-page .compact-form textarea:focus {
  border-color: var(--em-coral-mid);
  outline: none;
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.emit-page .compact-form .helper {
  color: var(--em-muted-light);
  font-size: 11.5px;
}

.emit-resolved-context {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--em-mint-border);
}

.emit-resolved-context-title {
  margin-bottom: 10px;
  color: var(--em-mint-deep);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.doc-body-textarea {
  min-height: 380px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.doc-token-code {
  font-family: var(--font-mono);
}

.emit-preview-body {
  padding: 20px;
  background: var(--color-bg);
}

.emit-preview-doc {
  min-height: 400px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
}

.emit-preview-doc h1 { margin: 0 0 10px; font-family: var(--font-display); font-size: 22px; }
.emit-preview-doc h2 { margin: 14px 0 6px; font-family: var(--font-display); font-size: 15px; }
.emit-preview-doc h3 { margin: 10px 0 4px; font-family: var(--font-display); font-size: 13px; }
.emit-preview-doc table { width: 100%; margin: 6px 0 12px; border-collapse: collapse; font-size: 12.5px; }
.emit-preview-doc th,
.emit-preview-doc td { padding: 5px 8px; border: 1px solid var(--color-border); vertical-align: top; }
.emit-preview-doc th { background: var(--color-surface-soft); font-weight: 700; }
.emit-preview-doc .doc-meta { color: var(--em-muted); font-family: var(--font-mono); font-size: 11.5px; }
.emit-preview-doc .doc-signatures { display: flex; gap: 24px; margin-top: 24px; padding-top: 12px; border-top: 1px dashed var(--color-border); }
.emit-preview-doc .doc-signatures .sig { flex: 1; }
.emit-preview-doc .doc-signatures .sig-line { height: 38px; margin-bottom: 4px; border-bottom: 1px solid var(--color-border); }
.emit-preview-doc .doc-signatures .sig-label { color: var(--em-muted); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.emit-preview-doc .doc-qr-placeholder {
  display: inline-block;
  padding: 3px 8px;
  border: 1px dashed var(--em-mint-border);
  border-radius: var(--radius-control-sm);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.emit-preview-doc .empty-table { color: var(--em-muted-light); font-size: 11.5px; font-style: italic; }

.emit-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emit-preview-empty {
  color: var(--em-muted);
}

.emit-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.emit-preview-status.is-loading { color: var(--em-coral-mid); }
.emit-preview-status.is-error { color: var(--color-danger); }

.emit-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 10px 14px;
  border: 1px solid var(--em-mint-border);
  border-radius: var(--radius-control);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-size: 12px;
}

.emit-callout .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--em-mint-deep);
}

.emit-page > header.page-header .page-actions .button {
  white-space: nowrap;
}

.doc-dtable-shell {
  overflow: auto;
  border-top: 1px solid var(--color-border);
}

.doc-dtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.doc-dtable thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--em-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.doc-dtable tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-soft);
  vertical-align: middle;
}

.doc-dtable tbody tr:last-child td {
  border-bottom: 1px solid var(--color-border);
}

.doc-dtable input[type="text"],
.doc-dtable input[type="number"],
.doc-dtable select {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
  font-family: var(--font-ui);
  font-size: 12.5px;
}

.doc-dtable select:focus,
.doc-dtable input:focus {
  border-color: var(--em-coral-mid);
  outline: none;
  box-shadow: 0 0 0 2px var(--em-coral-bg);
}

.doc-dtable .cell-meta {
  display: block;
  margin-top: 3px;
  color: var(--em-muted-light);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
}

.doc-dtable .cell-meta strong {
  color: var(--em-muted);
  font-weight: 600;
}

.doc-dtable .doc-dtable-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-h-compact);
  height: var(--btn-h-compact);
  padding: 0;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
  color: var(--color-danger);
  cursor: pointer;
}

.doc-dtable .doc-dtable-row-remove:hover {
  background: var(--color-danger-bg);
}

.doc-dtable-empty {
  padding: 18px 14px !important;
  color: var(--em-muted-light);
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

.doc-dtable .num-input {
  font-family: var(--font-mono);
  text-align: right;
}

.doc-dtable .total-cell {
  color: var(--em-navy);
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
}

.doc-dtable-col-name { width: 45%; }
.doc-dtable-col-date { width: 15%; }
.doc-dtable-col-quantity-wide { width: 20%; }
.doc-dtable-col-material { width: 70%; }
.doc-dtable-col-quantity { width: 25%; }
.doc-dtable-col-small { width: 12%; }
.doc-dtable-col-price { width: 14%; }
.doc-dtable-col-action { width: 42px; }

.doc-dtable-lot-wrap {
  margin-top: 6px;
}

.doc-dtable-lot-select {
  font-size: 11.5px;
}

.doc-dtable-readonly-mint {
  background: var(--em-mint-bg);
}

.doc-dtable-unit-pair {
  display: flex;
  gap: 4px;
}

.doc-dtable-unit-input {
  width: 60px;
}

.emit-page .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
}

.emit-page .form-actions .left {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--em-muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .emit-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .emit-page .compact-form .form-grid.lead-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Contract issue form */
.contract-form { display: flex; flex-direction: column; gap: var(--section-gap); }
.contract-shell {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.contract-intro {
  padding: 14px 22px;
  border-bottom: 1px solid var(--color-border);
  color: var(--em-muted);
  font-size: 13.5px;
}
.contract-step {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}
.contract-step:last-child { border-bottom: 0; }
.contract-step-no {
  color: var(--em-coral-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.contract-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}
.contract-step-body {
  padding: 20px 22px;
}
.contract-step-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.contract-step-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.15;
  color: var(--em-navy);
}
.contract-step-title span {
  color: var(--em-muted);
  font-size: 13px;
}
.contract-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.contract-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.contract-field.span-2 { grid-column: span 2; }
.contract-field.span-4 { grid-column: span 4; }
.contract-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--em-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contract-field label .req { color: var(--em-coral-mid); }
.contract-field input,
.contract-field select,
.contract-field textarea {
  width: 100%;
  min-height: var(--btn-h);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 9px 12px;
}
.contract-field textarea {
  resize: vertical;
  line-height: 1.45;
}
.contract-field input[type="text"].addendum-title-warning:not(.emma-field-state-incomplete) {
  border-color: var(--color-warning-border) !important;
  background: var(--color-warning-bg) !important;
}
.contract-field input:focus,
.contract-field select:focus,
.contract-field textarea:focus {
  outline: none;
  border-color: var(--em-coral-mid);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
.contract-field input[type="text"].addendum-title-warning:not(.emma-field-state-incomplete):focus {
  border-color: var(--color-warning) !important;
  box-shadow: 0 0 0 3px var(--color-warning-bg) !important;
}
.contract-field .helper {
  color: var(--em-muted);
  font-size: 11.5px;
}
.contract-line-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.contract-subsection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract-subsection + .contract-subsection {
  margin-top: 18px;
}
.contract-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contract-subsection-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--em-navy);
}
.contract-table-shell {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--color-surface);
}
.contract-lines-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}
.contract-lines-table th {
  background: var(--color-surface-soft);
  color: var(--em-muted);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--radius-control) var(--btn-padding-x-compact);
  border-bottom: 1px solid var(--color-border);
}
.contract-lines-table td {
  padding: var(--radius-control) var(--btn-padding-x-compact);
  border-bottom: 1px solid var(--color-border-soft);
  vertical-align: middle;
}
.contract-lines-table tr:last-child td { border-bottom: 1px solid var(--color-border); }
.contract-lines-table input,
.contract-lines-table select,
.contract-lines-table textarea {
  width: 100%;
  min-height: var(--btn-h-compact);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 12.5px;
  padding: calc(var(--radius-control-sm) + 2px) var(--radius-control);
}
.contract-lines-table textarea {
  min-height: calc(var(--btn-h-compact) * 2);
  resize: vertical;
}
.contract-line-description-row td {
  padding-top: 0;
}
.contract-line-description {
  line-height: 1.4;
}
.contract-lines-table input[type=number] {
  text-align: right;
  font-family: var(--font-mono);
}
.contract-lines-table .nr {
  color: var(--em-muted);
  font-weight: 800;
  text-align: center;
}
.contract-lines-table--recurring .contract-col-nr { width: 4%; }
.contract-lines-table--recurring .contract-col-location { width: 26%; }
.contract-lines-table--recurring .contract-col-service { width: 28%; }
.contract-lines-table--recurring .contract-col-mp { width: 9%; }
.contract-lines-table--recurring .contract-col-frequency { width: 13%; }
.contract-lines-table--recurring .contract-col-price { width: 20%; }
.contract-lines-table--supplemental .contract-col-nr { width: 4%; }
.contract-lines-table--supplemental .contract-col-service { width: 35%; }
.contract-lines-table--supplemental .contract-col-unit { width: 11%; }
.contract-lines-table--supplemental .contract-col-quantity { width: 11%; }
.contract-lines-table--supplemental .contract-col-price { width: 16%; }
.contract-lines-table--supplemental .contract-col-total { width: 23%; }
.addendum-items-table .add-col-name { width: 40%; }
.addendum-items-table .add-col-unit { width: 10%; }
.addendum-items-table .add-col-qty { width: 12%; }
.addendum-items-table .add-col-price { width: 16%; }
.addendum-items-table .add-col-total { width: 16%; }
.addendum-items-table .add-col-actions { width: 6%; }
.contract-cell-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--btn-h-compact);
  gap: var(--radius-control);
  align-items: center;
}
.contract-row-delete {
  display: inline-grid;
  place-items: center;
  width: var(--btn-h-compact);
  height: var(--btn-h-compact);
  min-height: var(--btn-h-compact);
  min-width: var(--btn-h-compact);
  padding: 0;
  background: var(--color-surface);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-control-sm);
  cursor: pointer;
}
.contract-row-delete .icon {
  width: var(--icon-base);
  height: var(--icon-base);
  stroke-width: 2.2;
}
.contract-row-delete:hover,
.contract-row-delete:focus {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}
.contract-row-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  color: var(--em-muted);
  font-size: 11px;
  font-weight: 800;
}
.contract-row-tag.is-extra {
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}
.contract-lines-foot {
  padding: 12px 20px;
  color: var(--em-muted);
  font-size: 13px;
  border-top: 1px solid var(--color-border-soft);
}
.contract-empty-lines {
  padding: 18px;
  color: var(--em-muted);
  font-size: 13px;
}
.contract-submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.contract-actions-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--em-muted);
  font-size: 13px;
}
.contract-hidden { display: none !important; }
@media (max-width: 900px) {
  .contract-grid { grid-template-columns: 1fr; }
  .contract-field.span-2 { grid-column: span 1; }
  .contract-field.span-4 { grid-column: span 1; }
  .contract-step-head { align-items: flex-start; flex-direction: column; }
  .contract-submit-row { justify-content: stretch; flex-direction: column; }
  .contract-submit-row .button { width: 100%; }
  .contract-table-shell { overflow-x: auto; }
  .contract-lines-table--recurring { min-width: calc(var(--btn-h) * 19); }
  .contract-lines-table--supplemental { min-width: calc(var(--btn-h) * 16); }
}

/* Offer issue form */
.off-form {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.off-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.off-card.is-incomplete {
  border-color: var(--color-warning-border);
}

.off-card.is-complete {
  border-color: var(--color-success-border);
}

.off-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.off-card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
}

.off-card-head .off-step {
  color: var(--em-coral-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.off-card.is-complete .off-step {
  color: var(--em-mint);
}

.off-card-body {
  padding: 20px 22px;
}

.off-lines-card {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.off-lines-card .contract-table-shell {
  overflow: visible;
}

.off-lines-card .emma-cbx-list {
  z-index: 80;
}

.off-lines-card.is-service-list-open .contract-table-shell {
  padding-bottom: 180px;
}

.off-lines-table td.is-cbx-open {
  position: relative;
  z-index: 90;
}

.off-grid {
  display: grid;
  gap: 14px;
}

.off-grid.col-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.off-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.off-field.span-2 {
  grid-column: span 2;
}

.off-field.span-3 {
  grid-column: span 3;
}

.off-field.has-top-gap {
  margin-top: 14px;
}

.off-field label {
  color: var(--em-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.off-field label .req {
  color: var(--em-coral-mid);
}

.off-field input[type="text"],
.off-field input[type="number"],
.off-field input[type="date"],
.off-field select,
.off-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--btn-h);
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  font-family: var(--font-ui);
  font-size: 14px;
}

.off-field textarea {
  resize: vertical;
}

.off-field input[type="text"].off-title-warning:not(.emma-field-state-incomplete) {
  border-color: var(--color-warning-border) !important;
  background: var(--color-warning-bg) !important;
  color: var(--em-navy);
}

.off-field input[type="text"].off-title-warning:not(.emma-field-state-incomplete):focus {
  border-color: var(--color-warning) !important;
  box-shadow: 0 0 0 3px var(--color-warning-bg) !important;
}

.off-field input:focus,
.off-field select:focus,
.off-field textarea:focus {
  border-color: var(--em-coral-mid);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.off-field .helper {
  color: var(--em-muted);
  font-size: 11.5px;
}

.off-field .helper.is-mint {
  color: var(--em-mint);
}

.off-field .pv-billing-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  font-size: 14px;
}

.off-field .pv-billing-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--em-coral-mid);
}

.off-field .field-error,
.contract-subsection .field-error {
  display: none;
  color: var(--color-danger);
  font-size: 11.5px;
  font-weight: 700;
}

.off-field.has-error .field-error,
.contract-subsection.has-error .field-error {
  display: block;
}

.off-field.has-error input,
.off-field.has-error select,
.off-field.has-error textarea,
.off-field.has-error .off-seg,
.contract-subsection.has-error .contract-table-shell,
.off-field.has-error .contract-table-shell {
  border-color: var(--color-danger-border) !important;
  background: var(--color-danger-bg) !important;
  box-shadow: 0 0 0 2px rgba(214, 62, 62, .08) !important;
}

.off-items td.num {
  color: var(--color-text);
  font-weight: 600;
  text-align: right;
}

.off-items td.actions {
  width: 32px;
  min-width: 32px;
  text-align: center;
}

.off-lines-table .off-col-name { width: 42%; }
.off-lines-table .off-col-unit { width: 9%; }
.off-lines-table .off-col-qty { width: 9%; }
.off-lines-table .off-col-price { width: 12%; }
.off-lines-table .off-col-total { width: 12%; }
.off-lines-table .off-col-actions { width: 32px; }

.off-lines-table th,
.off-lines-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.off-lines-table input,
.off-lines-table select {
  box-sizing: border-box;
  min-width: 0;
}

.off-lines-table th.actions,
.off-lines-table td.actions {
  padding-left: 4px;
  padding-right: 4px;
}

.off-lines-table td.actions .contract-row-delete {
  margin: 0 auto;
}

.off-lines-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--section-gap-sm, 14px);
  background: var(--color-surface-soft);
}

.off-lines-foot strong {
  display: inline-flex;
  align-items: center;
  gap: var(--radius-control);
  color: var(--em-navy);
  font-weight: 700;
}

.off-lines-foot strong span {
  color: var(--em-coral-mid);
  font-size: 15px;
}

.off-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
}

.off-seg label {
  flex: 1;
  cursor: pointer;
}

.off-seg input {
  display: none;
}

.off-seg span {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  color: var(--em-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.off-seg input:checked + span {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-card-soft);
}

.off-input-suffix {
  position: relative;
}

.off-input-suffix.has-top-gap {
  margin-top: 8px;
}

.off-input-suffix.is-muted {
  opacity: 0.6;
}

.off-input-suffix input {
  padding-right: 46px;
}

.off-input-suffix span.suffix {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--em-muted);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  transform: translateY(-50%);
}

.off-readonly input {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--em-mint);
  font-weight: 700;
}

.off-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-control);
  background: var(--color-success-bg);
}

.off-toggle-row.is-disabled {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  opacity: 0.75;
}

.off-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--em-mint);
  font-size: 13px;
  font-weight: 700;
}

.off-toggle-row.is-disabled .off-toggle-label {
  color: var(--em-muted);
}

.off-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-control);
  background: var(--em-mint);
  cursor: pointer;
  transition: background 0.18s;
}

.off-switch.off {
  background: var(--color-border);
}

.off-switch.disabled {
  background: var(--color-border);
  cursor: not-allowed;
}

.off-switch::after {
  position: absolute;
  top: 2px;
  left: 22px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-control-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
  content: "";
  transition: left 0.18s;
}

.off-switch.off::after,
.off-switch.disabled::after {
  left: 2px;
}

.off-settings-link {
  color: var(--em-mint);
  font-weight: 600;
}

.off-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.off-actions-buttons {
  display: flex;
  gap: 10px;
}

.off-items-payload {
  display: none;
}

@media (max-width: 880px) {
  .off-grid.col-3,
  .off-grid.col-2 {
    grid-template-columns: 1fr;
  }
}

/* Page header — devine card cald cu colturi mai rotunjite */
.page-header {
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card-soft);
}

.page-header h1 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
}

.page-eyebrow {
  /* override fata de definitia generica: pe page-header culoarea
     trebuie sa fie Spark (sectiunea/modulul), nu Mint */
  color: var(--em-coral-mid);
  font-weight: 700;
}

/* KPI strip integrat in page-header */
.page-kpi-strip {
  gap: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-warm);
}

.page-kpi-item {
  padding: 12px 14px;
  border: 1px solid var(--color-border-soft);
  border-left: 3px solid var(--em-coral-mid);
  border-radius: 12px;
  background: var(--color-surface-soft);
}

.page-kpi-item span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.page-kpi-item strong {
  font-size: 26px;
  font-weight: 800;
}

/* Carduri / panel-uri din pagina */
.kpi-card,
.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.kpi-card {
  padding: var(--card-padding-compact);
  gap: 6px;
}

.kpi-card strong {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-card.is-link {
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.22s;
}

.kpi-card.is-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--em-coral-border);
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-warm);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.panel-body {
  padding: 20px 24px;
}

/* Containere de tabel: pastram radius operational pentru ca
   tabelul interior trebuie sa ramana dens si scanabil; primesc
   doar bordura calda si umbra carduri. */
.table-shell,
.professional-table-shell {
  border-radius: var(--r-card);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Butoane principale — pill cald, Baloo 2 700 */
.button {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.18s cubic-bezier(0.2, 0.7, 0.2, 1),
              background 0.18s, border-color 0.18s;
}

.button-primary {
  min-height: var(--btn-h);
  padding: 6px var(--btn-padding-x);
  border-radius: var(--radius-control);
  background: var(--em-coral-mid);
  color: #fff;
  border: 1px solid transparent;
}

.button-primary:hover {
  background: var(--em-coral-start);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(232, 82, 31, 0.55);
}

.button-secondary {
  border-radius: var(--radius-control);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--em-navy);
  font-weight: 600;
}

.button-secondary:hover {
  border-color: var(--em-navy-soft);
}

.button-danger {
  border-radius: var(--radius-control);
}

/* Icon-only: dimensiuni fixe si padding 0 indiferent de varianta.
   Specificitatea mai mare invinge override-ul de padding de la .button-primary. */
.button-icon-only,
.button-primary.button-icon-only,
.button-secondary.button-icon-only,
.button-danger.button-icon-only {
  /* Tokenizat 2026-07-10: era 42px + radius 12px hardcodat si, avand
     specificitate mai mare, batea blocul "inaltime unica" de mai jos —
     sagetile din calendar, + din topbar si setarile ramaneau mari. */
  width: var(--btn-h);
  min-width: var(--btn-h);
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0;
  border-radius: var(--radius-control);
  display: inline-grid;
  place-items: center;
}

.button-icon-only svg,
.button-icon-only > i > svg,
.button-icon-only > i {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

/* Sidebar: Ink cald cu accent Spark pe item activ */
.sidebar {
  padding: 18px 14px 14px;
  background: var(--em-navy);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 252, 246, 0.08);
  display: grid;
  gap: 8px;
}

.sidebar-footer .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.04);
}

.sidebar-footer .user-chip-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--em-coral-mid);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
}

.sidebar-footer .user-chip-meta {
  display: grid;
  min-width: 0;
}

.sidebar-footer .user-chip-meta strong {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .user-chip-meta small {
  color: rgba(255, 252, 246, 0.55);
  font-size: 11px;
  text-transform: lowercase;
}

.sidebar-footer .logout-form {
  margin: 0;
}

.sidebar-logout-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 252, 246, 0.1);
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 252, 246, 0.78);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.sidebar-logout-button:hover {
  background: rgba(255, 106, 61, 0.14);
  color: #fff;
  border-color: rgba(255, 106, 61, 0.4);
}

.sidebar-logout-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.brand {
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 12px;
}

.brand strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand .emma-spark {
  margin-left: 2px;
  flex: 0 0 auto;
}

.brand-mark {
  border-radius: 10px;
}

.nav-list {
  gap: 2px;
  margin-top: 20px;
}

.nav-item {
  position: relative;
  min-height: 34px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}

.nav-item:hover {
  background: rgba(255, 252, 246, 0.06);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(255, 106, 61, 0.14);
  color: #fff;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--em-coral-mid);
}

.nav-icon {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active .nav-icon {
  background: rgba(255, 106, 61, 0.22);
  color: #fff;
}

/* Badge de numar (ex. mesaje necitite la Discutii) impins la dreapta randului. */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-control);
  background: var(--em-coral-mid);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-badge[hidden] { display: none; }

/* Topbar: bordura calda + spatiere identica */
.topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line-warm);
}

.tenant-dot {
  box-shadow: 0 0 0 4px var(--em-mint-bg);
  background: var(--em-mint);
}

.quick-search input {
  border-radius: var(--r-pill);
  background: var(--color-surface-soft);
}

.quick-actions-panel {
  border-radius: 14px;
  box-shadow: var(--shadow-card-hover);
  border: 1px solid var(--line-warm);
}

/* Badge-uri pe pill cu paleta calda — variantele existente raman
   bazate pe tokenii semantici, doar geometria devine consecventa */
.badge,
.env-pill {
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
}

/* Empty state — card prietenos cu scanteia ca accent */
.empty-state {
  padding: 56px 24px;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.empty-state .emma-spark {
  color: var(--em-coral-mid);
  margin: 0 auto 4px;
  display: block;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Documents operational lists */
.documents-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--section-gap);
}

.documents-kpi-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface);
}

.documents-kpi-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--em-coral-mid);
  content: "";
}

.documents-kpi-card.is-mint::before { background: var(--em-mint); }
.documents-kpi-card.is-info::before { background: var(--color-info); }
.documents-kpi-card.is-warn::before { background: var(--color-warning); }

.documents-kpi-label {
  color: var(--em-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.documents-kpi-value {
  margin-top: 8px;
  color: var(--em-navy);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.documents-kpi-sub {
  margin-top: 6px;
  color: var(--em-muted);
  font-size: 12px;
}

.documents-empty-panel {
  padding: 48px 28px;
  text-align: center;
}

.documents-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: var(--radius-control);
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.documents-empty-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
}

.documents-empty-copy {
  max-width: 60ch;
  margin: 0 auto 18px;
  color: var(--em-muted);
}

.documents-empty-hint {
  display: inline-block;
  margin: 0 auto 18px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-surface-soft);
  text-align: left;
}

.documents-empty-hint-title {
  display: block;
  margin-bottom: 8px;
  color: var(--em-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.documents-empty-hint-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.7;
}

.documents-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.documents-inline-form {
  display: inline-block;
}

.documents-header-actions {
  display: flex;
  gap: 8px;
}

.documents-inline-actions {
  display: inline-flex;
  gap: 8px;
}

.documents-list-empty {
  padding: 32px 16px;
  color: var(--em-muted);
  text-align: center;
}

.documents-list-empty p {
  margin: 8px 0 0;
}

.documents-list-empty .button {
  margin-top: 8px;
}

.document-type-badge,
.document-status-badge,
.document-default-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-control-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-type-badge {
  border: 1px solid var(--em-coral-border);
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.document-status-badge.is-draft {
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--em-muted);
}

.document-status-badge.is-issued {
  border: 1px solid var(--color-info-border);
  background: var(--color-info-bg);
  color: var(--color-info);
}

.document-status-badge.is-sent {
  border: 1px solid var(--em-mint-border);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.document-status-badge.is-signed {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}

.document-status-badge.is-cancelled {
  border: 1px solid var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.document-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--em-muted);
}

.document-status-dot.is-issued { background: var(--color-info); }
.document-status-dot.is-sent { background: var(--em-mint-deep); }
.document-status-dot.is-signed { background: var(--color-success); }
.document-status-dot.is-cancelled { background: var(--color-danger); }

.documents-muted {
  color: var(--em-muted);
  font-size: 12.5px;
}

.documents-code {
  font-family: var(--font-mono);
}

.documents-empty-value {
  color: var(--em-muted-light);
  font-style: italic;
}

.document-default-badge {
  color: var(--em-mint-deep);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.document-show-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 320px;
  gap: 18px;
  align-items: flex-start;
}

.document-snapshot-panel {
  overflow: hidden;
  padding: 0;
}

.document-snapshot-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.document-snapshot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.document-snapshot-note {
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Numar contract + client pe acelasi rand, aceeasi marime (cerinta 2026-07-02). */
.document-snapshot-header h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.document-snapshot-client-sep {
  color: var(--em-muted-light);
  font-weight: 400;
}

.document-snapshot-client {
  color: var(--color-info);
  text-decoration: none;
}

.document-snapshot-client:hover,
.document-snapshot-client:focus-visible {
  text-decoration: underline;
}

.document-snapshot-shell {
  padding: 24px;
  background: var(--color-surface-soft);
  /* Pagina A4 sta centrata in panou (decizie 2026-06-11). */
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.document-snapshot-empty {
  color: var(--em-muted);
}

.doc-snapshot {
  /* Proportii A4 portret pe ecran (decizie 2026-06-11): 794px = 210mm la
     96dpi; aspect-ratio tine inaltimea minima de pagina (297mm), iar
     documentele mai lungi cresc natural in jos. Marginile interioare
     aproximeaza marja de tipar a PDF-ului. */
  width: min(794px, 100%);
  flex-shrink: 0;
  box-sizing: border-box;
  aspect-ratio: 210 / 297;
  height: auto;
  padding: 57px 60px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--em-navy);
  box-shadow: var(--shadow-card-soft);
  font-family: var(--font-ui);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .doc-snapshot { padding: 28px 24px; }
}

.doc-snapshot h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
}

.doc-snapshot h2 {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
}

.doc-snapshot h3 {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 14px;
}

.doc-snapshot p {
  margin: 6px 0;
}

.doc-snapshot ul,
.doc-snapshot ol {
  margin: 6px 0 6px 20px;
}

.doc-snapshot .doc-meta {
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.doc-snapshot table {
  max-width: 100%;
  border-collapse: collapse;
}

.doc-snapshot th,
.doc-snapshot td {
  vertical-align: top;
}

.doc-snapshot .doc-table {
  width: 100%;
  max-width: 100%;
  margin: 8px 0 14px;
  border-collapse: collapse;
  /* Regula unica pentru toate tabelele din documente (decizie 2026-06-11):
     dimensionare dupa continut. !important e necesar ca sa normalizeze si
     snapshot-urile vechi, inghetate cu table-layout:fixed scris inline. */
  table-layout: auto !important;
  font-size: 12px;
}

.doc-snapshot .doc-table th,
.doc-snapshot .doc-table td {
  padding: 5px 6px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

/* Textul lung (denumiri, descrieri) se infasoara natural in celule... */
.doc-snapshot .doc-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ...dar antetele si celulele numerice nu se rup NICIODATA la mijloc de cuvant. */
.doc-snapshot .doc-table th,
.doc-snapshot .doc-table td.text-right {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* Header tabele standard ink + text alb (decizie 2026-07-03), identic cu
   PdfRenderer, ca vizualizarea web si PDF-ul sa arate la fel. */
.doc-snapshot .doc-table th {
  background: var(--em-navy);
  border-color: var(--em-navy);
  color: #ffffff;
  font-weight: 700;
}

/* Fix 2026-07-03, perechea regulii din PdfRenderer::composeFullHtml():
   snapshot-urile vechi au font-family inline din TinyMCE (toolbarul avea
   fontfamily) care batea fonturile documentului. PDF-ul curata inline-ul la
   randare; aici fortam inherit ca web-ul sa arate identic. */
.doc-snapshot [style*="font-family"] {
  font-family: inherit !important;
}

.doc-snapshot .doc-stamp,
.doc-snapshot .doc-client-signature {
  display: block;
  width: auto;
  height: auto;
  max-width: 114px;
  max-height: 114px;
  object-fit: contain;
}

.doc-snapshot .text-right {
  text-align: right;
}

.doc-snapshot .doc-table-total td {
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.doc-snapshot .doc-signatures {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border);
}

.doc-snapshot .doc-signatures .sig {
  flex: 1;
}

.doc-snapshot .doc-signatures .sig-line {
  height: 42px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.doc-snapshot .doc-signatures .sig-label {
  color: var(--em-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-snapshot .doc-qr-placeholder {
  display: inline-block;
  padding: 4px 10px;
  border: 1px dashed var(--em-mint-border);
  border-radius: var(--radius-control-sm);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-family: var(--font-mono);
  font-size: 11px;
}

.doc-snapshot .empty-table {
  color: var(--em-muted);
  font-size: 12.5px;
}

.doc-task-coverage {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-control);
  background: var(--color-warning-bg);
  color: var(--em-navy);
}

.doc-task-coverage.is-complete {
  border-color: var(--em-mint-border);
  background: var(--em-mint-bg);
}

.doc-task-coverage strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.doc-task-coverage span,
.doc-task-coverage li {
  color: var(--em-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.doc-task-coverage ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-task-coverage a {
  justify-self: start;
}

/* Butonul "Genereaza in Sarcini": Spark cu text si icon albe (cerinta 2026-07-02).
   Regula generica ".doc-task-coverage span" (text muted) castiga la aplicare pe
   span-urile din interiorul butonului, deci suprascriem explicit pe span. */
.doc-task-coverage .button-primary,
.doc-task-coverage .button-primary span {
  color: #fff;
}

.doc-task-coverage .button-primary .button-icon {
  color: #fff;
}

.document-side-panel {
  padding: 18px 20px;
}

.document-side-panel + .document-side-panel {
  margin-top: 14px;
}

.document-side-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
}

.document-meta-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  row-gap: 8px;
  column-gap: 14px;
  margin: 0;
  font-size: 13px;
}

.document-meta-list dt {
  color: var(--em-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-meta-list dd {
  margin: 0;
  color: var(--em-navy);
  font-weight: 600;
}

.document-meta-link {
  color: var(--em-coral-mid);
  font-weight: 700;
}

.document-meta-link a {
  color: inherit;
}

/* ===== Meta document — header comprimat (redesign 2026-07-08) ===== */
.document-meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.document-meta-number {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--em-navy);
}

.document-meta-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--em-muted);
  font-weight: 500;
}

/* Clientul ca rand pe fundal soft, cu numele in albastrul de link. */
.document-meta-client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--color-surface-soft);
  border-radius: var(--radius-control);
  text-decoration: none;
}

.document-meta-client-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-info);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-meta-client-row:hover .document-meta-client-name {
  text-decoration: underline;
}

.document-meta-client-row .icon {
  color: var(--em-muted-light);
}

.document-meta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 8px 0 0;
  font-size: 12px;
}

.document-meta-links a {
  color: var(--em-coral-mid);
  font-weight: 700;
  text-decoration: none;
}

.document-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border);
}

/* Perechi de butoane (PDF, canale de trimitere) pe doua coloane. */
.document-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.document-actions-grid .document-action-button {
  justify-content: center;
}

.document-actions-grid .document-send-channel {
  justify-content: flex-start;
}

/* Un singur element in pereche (ex. draft, fara "Vezi PDF") ocupa tot randul. */
.document-actions-grid > :only-child {
  grid-column: 1 / -1;
}

/* Randul PDF retras cu padding-ul zonei de trimitere: toate cele patru
   butoane (Vezi PDF / Descarca / Email / WhatsApp) au latimi identice. */
.document-actions-grid--inset {
  padding: 0 12px;
}

.document-send-form {
  margin: 0;
  min-width: 0;
}

.document-send-form .document-action-button {
  width: 100%;
}

/* Zona de trimitere: fundal soft care separa actiunea principala a cardului. */
.document-send-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  background: var(--color-surface-soft);
  border-radius: var(--radius-control);
}

.document-send-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--em-muted);
}

/* Canalele de trimitere: acelasi buton ca perechea PDF, cu icon de
   expediere mint. Dimensiuni identice cu Vezi PDF / Descarca. */
.document-send-channel {
  justify-content: center;
}

.document-send-icon {
  color: var(--em-mint-deep);
}

.document-send-channel:disabled {
  cursor: not-allowed;
  background: transparent;
  border-style: dashed;
  color: var(--em-muted-light);
}

.document-send-channel:disabled .document-send-icon {
  color: var(--em-muted-light);
}

/* Starea AJAX „Trimis" (fill mint din document-send.js): text lizibil pe verde. */
.document-send-channel.is-sent .document-send-icon {
  color: inherit;
}

/* Un singur rand contextual cand WhatsApp e indisponibil. */
.document-wa-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--color-warning-deep);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-control);
}

.document-wa-note a {
  margin-left: auto;
  color: var(--color-warning);
  font-weight: 700;
}

/* Cazul rar (alt email) sta ascuns sub un link discret. */
.document-alt-email summary {
  font-size: 12px;
  color: var(--em-muted);
  text-decoration: underline;
  cursor: pointer;
  width: fit-content;
}

.document-alt-email[open] summary {
  margin-bottom: 6px;
}

.document-alt-email .document-email-input {
  width: 100%;
}

/* Operatiuni secundare: actiuni text in subsolul cardului. */
.document-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}

.document-footer-form {
  margin: 0;
  display: contents;
}

.document-footer-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--em-navy);
  cursor: pointer;
}

.document-footer-action:hover {
  color: var(--em-coral-mid);
}

.document-footer-action.is-danger {
  color: var(--color-danger);
}

.document-footer-action.is-danger:hover {
  color: var(--color-danger-deep);
}

.document-action-button {
  width: 100%;
  justify-content: flex-start;
}

.document-danger-button {
  margin-top: 6px;
}

.document-email-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.document-email-input {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  font-family: var(--font-ui);
  font-size: 13px;
}

.document-email-hint {
  color: var(--em-muted);
  font-size: 11px;
}

.document-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.document-timeline-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px dashed var(--color-border);
}

.document-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--em-muted);
}

.document-timeline-dot.is-success,
.document-timeline-dot.is-mint {
  background: var(--em-mint);
}

.document-timeline-dot.is-info {
  background: var(--color-info);
}

.document-timeline-dot.is-danger {
  background: var(--color-danger);
}

.document-timeline-label {
  color: var(--em-navy);
  font-size: 13px;
  font-weight: 600;
}

.document-timeline-meta {
  color: var(--em-muted);
  font-size: 11.5px;
}

.document-timeline-date {
  color: var(--em-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 1020px) {
  .documents-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-show-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .documents-kpi-row {
    grid-template-columns: 1fr;
  }

  .document-snapshot-shell {
    padding: 12px;
  }

  .doc-snapshot {
    padding: 16px;
  }

  .doc-snapshot .doc-signatures,
  .document-snapshot-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .document-meta-list,
  .document-timeline-row {
    grid-template-columns: 1fr;
  }

  .document-timeline-date {
    white-space: normal;
  }
}

/* Dashboard list items: hover lift discret pe carduri clicabile */
.dashboard-agenda-item,
.dashboard-list-item,
.dashboard-activity-item {
  border-radius: 12px;
  border: 1px solid var(--line-warm);
  background: var(--color-surface);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.dashboard-agenda-item:hover,
.dashboard-list-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-soft);
  border-color: var(--em-coral-border);
}

.dashboard-agenda-item time {
  color: var(--em-coral-mid);
}

/* Flash / alert: bordura calda + radius card */
.flash,
.alert {
  border-radius: var(--r-card);
  border: 1px solid var(--line-warm);
}

/* Emma spark — comportament default al componentei comune */
.emma-spark {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.spark-mint {
  color: var(--em-mint);
}

.spark-spark {
  color: var(--em-coral-mid);
}

/* Hint scurt sub un camp de formular (ex. Choose file) */
.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* =============================================================
   STRAT VIZUAL — 2026-05-31 — Editorial / Bento (template v2)
   Aplicatia trece pe limbajul editorial:
   - sidebar dark cu colt dreapta rotunjit + nav grupat pe sectiuni
   - topbar minimalist cu backdrop blur (tenant + search + actiuni)
   - page-header fara card chrome (editorial, ink underline pe KPI strip)
   - componente noi: bento KPI tiles, timeline, task-sticker, activity-list
   Tabelele si formularele PASTREAZA densitatea operationala.
   Detalii in DESIGN_SYSTEM.md sectiunea "Editorial Shell".
   ============================================================= */

/* === SIDEBAR (dark, rotunjit dreapta, sectiuni) === */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--em-navy);
  color: var(--em-cream);
  padding: 18px 14px;
  gap: 6px;
  border-radius: 0 var(--r-card-lg) var(--r-card-lg) 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  text-decoration: none;
  flex: 0 0 auto;
}

.sidebar .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--em-coral-mid), var(--em-spark-deep));
  display: grid;
  place-items: center;
  color: var(--em-cream);
  flex: 0 0 auto;
}

.sidebar .brand-logo svg {
  width: 22px;
  height: 22px;
}

.sidebar .brand-logo-img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border-radius: 0;
  flex: 0 0 auto;
}

/* Cand brand-ul afiseaza logo-ul de platforma (200px), brand-ul nu mai are
   gap si padding stranse — lasa logo-ul sa respire. */
.sidebar .brand:has(.brand-logo-img) {
  padding: 8px 8px 20px;
  gap: 0;
}

.sidebar .brand-wm {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--em-cream);
}

.sidebar .brand-dot {
  color: var(--em-coral-mid);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  /* Cand meniul e mai inalt decat ecranul (mobil/tableta), nav-ul scrolleaza
     intern in loc sa se reverse peste footer-ul cu utilizatorul (incident
     S24/tablete 2026-07-12). Marginea negativa + padding-ul compenseaza
     scroll container-ul: bara de item activ (::before la left -14px) ramane
     vizibila in interiorul scrollport-ului, aliniata la muchia sidebar-ului. */
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-inline: -14px;
  padding-inline: 14px;
}

.sidebar .nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar .nav-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 252, 246, 0.4);
  padding: 9px 12px 4px;
  font-weight: 500;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255, 252, 246, 0.78);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.sidebar .nav-item i,
.sidebar .nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: rgba(255, 252, 246, 0.6);
  transition: color 0.2s;
}

.sidebar .nav-item:hover {
  background: rgba(255, 252, 246, 0.06);
  color: var(--em-cream);
}

.sidebar .nav-item:hover i,
.sidebar .nav-item:hover svg {
  color: var(--em-mint);
}

.sidebar .nav-item.is-active {
  background: rgba(25, 200, 160, 0.12);
  color: var(--em-cream);
}

.sidebar .nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--em-coral-mid);
}

.sidebar .nav-item.is-active i,
.sidebar .nav-item.is-active svg {
  color: var(--em-mint);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 252, 246, 0.08);
  flex: 0 0 auto;
}

.sidebar .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.2s;
  background: transparent;
}

.sidebar .user-chip:hover {
  background: rgba(255, 252, 246, 0.05);
}

.sidebar .user-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  background: linear-gradient(135deg, var(--em-mint), var(--em-mint-deep));
  display: grid;
  place-items: center;
  color: var(--em-navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}

.sidebar .user-chip-meta {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}

.sidebar .user-chip-meta strong {
  font-size: 13.5px;
  color: var(--em-cream);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .user-chip-meta small {
  font-size: 11px;
  color: rgba(255, 252, 246, 0.5);
  font-weight: 500;
}

.sidebar .logout-form {
  margin: 0;
  flex: 0 0 auto;
}

.sidebar .sidebar-logout-button {
  width: var(--btn-h-compact);
  height: var(--btn-h-compact);
  min-height: var(--btn-h-compact);
  padding: 0;
  border-radius: 10px;
  color: rgba(255, 252, 246, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.sidebar .sidebar-logout-button:hover {
  color: var(--em-coral-mid);
  background: rgba(255, 106, 61, 0.08);
}

.sidebar .sidebar-logout-button i,
.sidebar .sidebar-logout-button svg {
  width: 16px;
  height: 16px;
}

/* === TOPBAR (minimalist, sticky, aero) === */
.topbar {
  position: sticky;
  /* Bara full-width lipita sus (decizie 2026-07-03, inlocuieste varianta
     „plutitoare" din 2026-06-27): colturi drepte, fara margini, separarea
     de continut o face doar umbra difuza de dedesubt (--shadow-topbar). */
  top: 0;
  /* Peste continutul paginii (ex. header-ul sticky al calendarului are z-index:20),
     dar sub overlay-uri/modale (>=50), ca dropdown-ul "+" sa nu intre sub calendar. */
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  /* Padding orizontal = padding-ul .content-shell (24px), ca elementele barei
     sa se alinieze cu continutul paginii. */
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow-topbar);
  min-height: auto;
}

.topbar .tenant {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-title);
  letter-spacing: -0.005em;
}

.topbar .tenant-support-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--em-coral-border);
  border-radius: var(--radius-control-sm);
  background: var(--em-coral-bg);
  color: var(--em-navy);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar .tenant-support-label svg {
  width: 14px;
  height: 14px;
}

.topbar .tenant-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--em-mint);
  box-shadow: 0 0 0 3px var(--em-mint-bg);
  flex: 0 0 auto;
}

.topbar .quick-search {
  flex: 1 1 auto;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.topbar .quick-search i,
.topbar .quick-search svg {
  position: absolute;
  left: 16px;
  color: var(--color-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.topbar .quick-search input {
  width: 100%;
  /* Inaltimea vine din token (era height:auto + padding 10px => ~42px). */
  height: var(--btn-h);
  padding: 0 18px 0 42px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-family: var(--font-ui);
  background: var(--color-surface-soft);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.topbar .quick-search input::placeholder {
  color: var(--em-muted-light);
}

.topbar .quick-search input:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.topbar .owner-support-exit {
  display: flex;
  align-items: center;
  margin: 0;
}

.topbar .topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .icon-button {
  width: var(--btn-h);
  height: var(--btn-h);
  min-height: var(--btn-h);
  border-radius: var(--radius-control);
  display: grid;
  place-items: center;
  color: var(--color-title);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  padding: 0;
}

.topbar .icon-button:hover {
  background: rgba(13, 19, 33, 0.06);
}

.topbar .icon-button i,
.topbar .icon-button svg {
  width: 18px;
  height: 18px;
}

.topbar .notification-menu {
  position: relative;
}

/* Pip-ul s-a transformat in badge cu numar de necitite (hidratat din feed). */
.topbar .notification-pip {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--em-coral-mid);
  color: #fff;
  font: 500 11px/16px var(--font-ui);
  text-align: center;
  box-shadow: 0 0 0 2px var(--color-bg);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
  z-index: 60;
  overflow: hidden;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: var(--border-thin);
  color: var(--color-title);
}

.notification-readall {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-primary);
  font: 500 12px/1 var(--font-ui);
}

.notification-readall:hover {
  text-decoration: underline;
}

.notification-panel-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--border-thin);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

.notification-item:hover {
  background: var(--color-surface-soft);
}

.notification-item.is-unread {
  background: var(--color-info-bg);
}

.notification-item-main {
  min-width: 0;
}

.notification-item-title {
  font: 500 13px/1.4 var(--font-ui);
  color: var(--color-title);
}

.notification-item-text {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-muted);
  /* Digestul de birou trimite body pe mai multe randuri (bullets) — pastram
     newline-urile la randare (decizie lizibilitate 2026-07-03). */
  white-space: pre-line;
}

.notification-item-time {
  margin-top: 3px;
  font-size: 11px;
  color: var(--color-muted);
}

.notification-empty {
  margin: 0;
  padding: 20px 14px;
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}

.notification-panel-footer {
  display: block;
  padding: 10px 14px;
  text-align: center;
  border-top: var(--border-thin);
  color: var(--color-primary);
  text-decoration: none;
  font: 500 12px/1 var(--font-ui);
}

.notification-panel-footer:hover {
  background: var(--color-surface-soft);
}

.notification-push-optin {
  padding: 8px 14px;
  border-bottom: var(--border-thin);
  background: var(--color-surface-soft);
}

.notification-push-enable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-primary);
  font: 500 12px/1.4 var(--font-ui);
}

.notification-push-enable:hover {
  text-decoration: underline;
}

.notification-push-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--color-muted);
}

/* Punct de severitate, comun dropdown-ului si paginii /notifications. */
.notif-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--color-info);
}

.notif-dot-info { background: var(--color-info); }
.notif-dot-success { background: var(--color-success); }
.notif-dot-warning { background: var(--color-warning); }
.notif-dot-danger { background: var(--color-danger); }

/* Pagina /notifications: lista de istoric. */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: var(--border-thin);
}

.notif-item.is-unread .notif-title {
  font-weight: 600;
}

.notif-body {
  min-width: 0;
}

.notif-title {
  color: var(--color-title);
  font-size: 14px;
}

.notif-title a {
  color: var(--color-primary);
  text-decoration: none;
}

.notif-title a:hover {
  text-decoration: underline;
}

.notif-text {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 13px;
  /* Body pe mai multe randuri (digest birou) — vezi .notification-item-text. */
  white-space: pre-line;
}

.notif-meta {
  margin-top: 4px;
}

.notif-time {
  color: var(--color-muted);
  font-size: 12px;
}

.topbar .sidebar-toggle {
  display: none;
}

/* === PAGE HEADER editorial (fara card chrome) === */
.page-header {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 4px 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  position: relative;
  overflow: visible;
}

.page-header::after,
.page-header::before {
  display: none;
}

.page-header-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.page-header .page-back-button {
  display: inline-grid;
  place-items: center;
  width: var(--btn-h);
  height: var(--btn-h);
  min-width: 0;
  padding: 0;
  border-radius: var(--radius-control);
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  color: var(--color-title);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex: 0 0 auto;
  margin-top: 6px;
}

.page-header .page-back-button:hover {
  background: var(--em-navy);
  color: var(--em-cream);
  border-color: var(--em-navy);
}

.page-header .page-back-button i,
.page-header .page-back-button svg {
  width: 16px;
  height: 16px;
}

.page-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--em-coral-mid);
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--color-title);
  margin: 6px 0 8px;
}

.page-header h1 .page-title-dot {
  color: var(--em-coral-mid);
}

.page-header p {
  color: var(--em-muted);
  font-size: 15px;
  max-width: 580px;
  margin: 0;
}

.page-header p b {
  color: var(--color-title);
  font-weight: 700;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* KPI strip integrat in page-header — restilizat editorial */
.page-header .page-kpi-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1.5px solid var(--em-navy);
  background: transparent;
  border-bottom: none;
}

.page-header .page-kpi-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--em-coral-mid);
  border-radius: var(--r-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-header .page-kpi-item span {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--em-muted);
  font-weight: 600;
}

.page-header .page-kpi-item strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--color-title);
  line-height: 1;
}

.page-header .page-kpi-item small {
  font-size: 12px;
  color: var(--em-muted);
}

/* === BUTOANE uniforme (pill, Baloo 2, spark/ink) === */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  /* Inaltime unica din token (36px, decizie 2026-07-10): padding vertical 6px
     + min-height din token — cu .button-icon de 22px inauntru, 8px dadea 40px
     real si ignora tokenul. */
  min-height: var(--btn-h);
  padding: 6px var(--btn-padding-x);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.25s;
  line-height: 1;
}

.button-primary {
  background: var(--em-coral-mid);
  color: #fff;
  border-color: var(--em-coral-mid);
  box-shadow: 0 8px 18px -8px rgba(255, 106, 61, 0.5);
}

.button-primary:hover {
  background: var(--em-spark-deep);
  border-color: var(--em-spark-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(255, 106, 61, 0.6);
}

.button-secondary {
  background: transparent;
  color: var(--em-navy);
  border-color: var(--em-navy);
}

.button-secondary:hover {
  background: var(--em-navy);
  color: var(--em-cream);
  transform: translateY(-1px);
}

.button-icon i,
.button-icon svg,
.button-icon-only i,
.button-icon-only svg {
  width: 16px;
  height: 16px;
}

.button-icon-only {
  width: var(--btn-h);
  height: var(--btn-h);
  padding: 0;
  border-radius: var(--radius-control);
}

/* === SECTION HEAD editorial (titlu cu linie ink dedesubt) === */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 8px;
  border-bottom: 1.5px solid var(--em-navy);
  margin-bottom: 6px;
}

.section-head-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--em-navy);
  line-height: 1;
}

.section-head .section-count {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--em-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.section-head-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-filter {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--em-muted);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chip-filter:hover {
  color: var(--em-navy);
}

.chip-filter.is-active {
  background: var(--em-navy);
  color: var(--em-cream);
}

/* === BENTO KPI === */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(110px, auto);
  gap: 14px;
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card-lg);
  padding: 20px 22px;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.tile:hover {
  transform: translateY(-3px);
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tile-eyebrow {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.tile-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  color: var(--em-navy);
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.tile-num small {
  font-family: var(--font-ui);
  font-size: 13px;
  margin-left: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  vertical-align: middle;
  text-transform: uppercase;
}

.tile-label {
  font-size: 13px;
  color: var(--em-muted);
  font-weight: 600;
  margin-top: 2px;
}

.tile-hero {
  grid-column: span 2;
  grid-row: span 2;
  background: linear-gradient(135deg, var(--em-coral-mid) 0%, var(--em-spark-deep) 100%);
  color: var(--em-cream);
  box-shadow: 0 1px 1px rgba(13, 19, 33, 0.04), 0 24px 50px -28px rgba(13, 19, 33, 0.25);
}

.tile-hero::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.08);
  top: -80px;
  right: -70px;
}

.tile-hero::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.06);
  bottom: -40px;
  left: -25px;
}

.tile-hero .tile-head {
  position: relative;
  z-index: 1;
}

.tile-hero .tile-eyebrow {
  color: var(--em-cream);
  opacity: 0.85;
}

.tile-hero .tile-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--em-cream);
  box-shadow: 0 0 0 0 rgba(255, 252, 246, 0.8);
  animation: tile-pulse 2.2s infinite;
  flex: 0 0 auto;
}

@keyframes tile-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 252, 246, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 252, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 252, 246, 0); }
}

.tile-hero .tile-big {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 84px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 6px 0;
  color: var(--em-cream);
}

.tile-hero .tile-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.tile-hero .tile-foot p {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  margin: 0;
}

.tile-hero .tile-next {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 252, 246, 0.18);
  width: 100%;
  font-weight: 600;
}

.tile-hero .tile-next strong {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: none;
  margin-top: 4px;
}

.tile-mint {
  grid-column: span 2;
  background: var(--em-mint-bg);
  color: var(--em-navy);
  border: 1px solid var(--em-mint-border);
}

.tile-mint .tile-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--em-mint);
  color: var(--em-cream);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.tile-mint .tile-ico i,
.tile-mint .tile-ico svg {
  width: 18px;
  height: 18px;
}

.tile-mint .tile-eyebrow {
  color: var(--em-mint-deep);
  font-weight: 700;
}

.tile-mint .tile-num small {
  color: var(--em-mint-deep);
}

.tile-outline {
  grid-column: span 2;
  background: transparent;
  border: 1.5px dashed var(--color-border);
  color: var(--em-navy);
}

.tile-outline .tile-head {
  display: flex;
  justify-content: space-between;
}

.tile-outline .tile-eyebrow {
  color: var(--em-muted);
}

.tile-outline .tile-chip {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
  font-weight: 600;
}

.tile-ink {
  grid-column: span 4;
  background: var(--em-navy);
  color: var(--em-cream);
  position: relative;
  overflow: hidden;
}

.tile-ink::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(25, 200, 160, 0.18);
  bottom: -80px;
  right: -60px;
  filter: blur(20px);
}

.tile-ink .tile-head {
  position: relative;
  z-index: 1;
}

.tile-ink .tile-eyebrow {
  color: var(--em-mint);
  font-weight: 700;
}

.tile-ink .tile-num {
  position: relative;
  z-index: 1;
  color: var(--em-cream);
  font-size: 40px;
}

.tile-ink .tile-label {
  position: relative;
  z-index: 1;
  color: rgba(255, 252, 246, 0.65);
}

.tile-cream {
  grid-column: span 6;
  background: var(--em-cream);
  border: 1px solid var(--color-border-soft);
  color: var(--em-navy);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.tile-cream .tile-splash {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--em-coral-bg), #FFFFFF);
  border: 1px solid var(--em-coral-border);
  display: grid;
  place-items: center;
  color: var(--em-spark-deep);
  position: relative;
  flex: 0 0 auto;
}

.tile-cream .tile-splash i,
.tile-cream .tile-splash svg {
  width: 28px;
  height: 28px;
}

.tile-cream .tile-splash::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--em-coral-mid);
  top: -4px;
  right: -4px;
  border: 2px solid var(--color-bg);
}

.tile-cream .tile-body strong {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--em-navy);
  display: block;
  line-height: 1.3;
}

.tile-cream .tile-body p {
  font-size: 13px;
  color: var(--em-muted);
  margin: 4px 0 0;
  max-width: 480px;
}

.tile-cream .tile-arrow {
  width: var(--btn-h-compact);
  height: var(--btn-h-compact);
  border-radius: var(--radius-control);
  background: var(--em-navy);
  color: var(--em-cream);
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}

.tile-cream:hover .tile-arrow {
  background: var(--em-coral-mid);
  transform: rotate(-45deg);
}

.tile-cream .tile-arrow i,
.tile-cream .tile-arrow svg {
  width: 16px;
  height: 16px;
}

/* === SPLIT (timeline + side-stack) === */
.editorial-split {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
  align-items: start;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* === TIMELINE === */
.timeline {
  padding: 14px 4px 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 96px;
  width: 1px;
  background-image: linear-gradient(to bottom, var(--color-border) 50%, transparent 50%);
  background-size: 1px 8px;
}

.tl-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
  position: relative;
  transition: transform 0.2s;
}

.tl-row:hover {
  transform: translateX(4px);
}

.tl-row:hover .tl-dot {
  transform: translateY(-50%) scale(1.4);
}

.tl-time {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 18px;
  color: var(--em-navy);
  text-align: right;
  letter-spacing: 0.02em;
  line-height: 1;
}

.tl-time small {
  display: block;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 10.5px;
  color: var(--em-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.tl-dot {
  position: absolute;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--em-cream);
  border: 3px solid var(--em-mint);
  transition: transform 0.2s;
  z-index: 1;
}

.tl-dot.is-pending {
  border-color: var(--em-coral-mid);
}

.tl-dot.is-done {
  border-color: var(--em-muted-light);
  background: var(--color-bg);
}

.tl-body {
  padding-left: 22px;
  min-width: 0;
}

.tl-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--em-navy);
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.tl-body .tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--em-muted);
}

.tl-body .tl-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tl-body .tl-meta i,
.tl-body .tl-meta svg {
  width: 13px;
  height: 13px;
}

.tl-tag {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
  align-self: center;
}

.tl-tag.is-confirmed {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.tl-tag.is-pending {
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.tl-tag.is-done {
  background: rgba(13, 19, 33, 0.05);
  color: var(--em-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--em-muted-light);
}

/* === TASK STICKER === */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.task-sticker {
  position: relative;
  background: var(--em-cream);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
}

.task-sticker:nth-child(odd) {
  transform: rotate(-0.3deg);
}

.task-sticker:nth-child(even) {
  transform: rotate(0.4deg);
}

.task-sticker:hover {
  transform: rotate(0) translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(13, 19, 33, 0.25);
  border-color: var(--em-navy);
}

.task-sticker::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 14px;
  background: repeating-linear-gradient(135deg, rgba(255, 106, 61, 0.35) 0 4px, transparent 4px 8px);
  border-radius: 2px;
}

.task-sticker.is-urgent::before {
  background: repeating-linear-gradient(135deg, rgba(255, 106, 61, 0.55) 0 4px, transparent 4px 8px);
}

.task-sticker.is-mid::before {
  background: repeating-linear-gradient(135deg, rgba(25, 200, 160, 0.55) 0 4px, transparent 4px 8px);
}

.task-sticker .ts-check {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 1.8px solid var(--em-navy);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  transition: background 0.2s, border-color 0.2s;
  background: var(--color-surface);
}

.task-sticker:hover .ts-check {
  background: var(--em-mint);
  border-color: var(--em-mint);
}

.task-sticker .ts-body {
  flex: 1 1 auto;
  min-width: 0;
}

.task-sticker .ts-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--em-navy);
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 3px;
  line-height: 1.2;
}

.task-sticker .ts-body span {
  font-size: 12px;
  color: var(--em-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-sticker .ts-body span i,
.task-sticker .ts-body span svg {
  width: 12px;
  height: 12px;
}

.task-sticker .ts-tag {
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--em-muted);
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2px;
}

.task-sticker .ts-tag.is-hi {
  color: var(--em-spark-deep);
}

.task-sticker .ts-tag.is-mid {
  color: var(--em-mint-deep);
}

/* === ACTIVITY LIST === */
.activity-list {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line-warm);
  transition: transform 0.2s;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-row:hover {
  transform: translateX(3px);
}

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(13, 19, 33, 0.06);
  color: var(--em-navy);
}

.activity-icon.is-mint {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.activity-icon.is-spark {
  background: var(--em-coral-bg);
  color: var(--em-spark-deep);
}

.activity-icon i,
.activity-icon svg {
  width: 16px;
  height: 16px;
}

.activity-body {
  min-width: 0;
}

.activity-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--em-navy);
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-body .activity-action {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
  color: var(--em-navy);
}

.activity-body .activity-action.is-book {
  color: var(--em-mint-deep);
}

.activity-body .activity-action.is-send {
  color: var(--em-spark-deep);
}

.activity-time {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--em-muted-light);
  white-space: nowrap;
}

/* === RESPONSIVE editorial === */
@media (max-width: 1200px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
  }
  .tile-hero { grid-column: span 2; grid-row: span 2; }
  .tile-mint, .tile-outline { grid-column: span 2; }
  .tile-ink { grid-column: span 4; }
  .tile-cream { grid-column: span 4; }
}

@media (max-width: 1000px) {
  .editorial-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    /* Orizontal aliniat cu .content-shell pe mobil (12px). */
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar .sidebar-toggle {
    display: grid;
    order: 0;
  }
  .topbar .tenant {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
  }
  .topbar .tenant strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .tenant-support-label {
    flex: 0 0 auto;
  }
  .topbar .owner-support-exit {
    order: 3;
  }
  .topbar .topbar-actions {
    order: 4;
    margin-left: 0;
  }
  .topbar .quick-search {
    order: 5;
    flex: 1 1 100%;
    max-width: none;
  }
  .page-header {
    grid-template-columns: 1fr;
    padding: 4px 4px 6px;
  }
  .page-header h1 {
    font-size: 28px;
  }
  .page-actions {
    margin-top: 8px;
  }
  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .tile-hero, .tile-mint, .tile-outline, .tile-ink, .tile-cream {
    grid-column: span 1;
    grid-row: span 1;
  }
  .tile-hero .tile-big {
    font-size: 72px;
  }
  .tile-cream {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 0;
  }
  .tl-row {
    grid-template-columns: auto 1fr;
    gap: 14px;
  }
  .tl-time {
    text-align: left;
    font-size: 16px;
  }
  .tl-dot {
    display: none;
  }
  .tl-body {
    padding-left: 0;
  }
  .tl-tag {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* =============================================================
   REGULI DE DIMENSIONARE — ICOANE, BUTOANE, CHENARE (2026-05-31)
   Sursa unica de adevar. Orice valoare numerica de dimensiune
   trebuie sa vina din tokenii --icon-*, --btn-* sau --border-*.
   Documentat in DESIGN_SYSTEM.md sectiunea "Reguli De Dimensionare".
   ============================================================= */

/* === ICOANE ===
   Helper-ul $icon() emite <svg class="icon" width="16" height="16" ...>.
   Atributele width/height sunt doar hint; clasele de mai jos castiga
   prin CSS si stabilesc dimensiunea finala pentru fiecare context. */

.icon {
  width: var(--icon-base);
  height: var(--icon-base);
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: middle;
  display: inline-block;
}

/* Sidebar: 18px */
.sidebar .nav-item .icon,
.sidebar .brand .icon {
  width: var(--icon-md);
  height: var(--icon-md);
}
.sidebar .sidebar-logout-button .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* Topbar: 18px pentru actiuni, 16px pentru search, 16px in buton primary */
.topbar .icon-button .icon,
.topbar .sidebar-toggle .icon {
  width: var(--icon-md);
  height: var(--icon-md);
}
.topbar .quick-search .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}
.topbar .button .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* Page header / butoane */
.page-header .page-back-button .icon,
.button .icon,
.button-icon .icon,
.button-icon-only > .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* Bento tile heads — 18px in containere 32px */
.tile-mint .tile-ico .icon,
.tile-outline .tile-ico .icon {
  width: var(--icon-md);
  height: var(--icon-md);
}

/* Bento splash — 28px in container 70px */
.tile-cream .tile-splash .icon {
  width: var(--icon-xl);
  height: var(--icon-xl);
}

/* Bento arrow circle — 16px in container 36px */
.tile-cream .tile-arrow .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* Timeline meta — 14px */
.tl-body .tl-meta .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

/* Task sticker meta — 12px */
.task-sticker .ts-body span .icon {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

/* Activity row icon — 16px in container 34px */
.activity-icon .icon {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* Sidebar list — pip-uri sau notificari mici */
.sidebar .nav-item .badge .icon {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

/* === BUTOANE — inaltime unica obligatorie === */

.button {
  min-height: var(--btn-h);
  padding-left: var(--btn-padding-x);
  padding-right: var(--btn-padding-x);
}

.button-icon-only {
  width: var(--btn-h);
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0;
}

.topbar .icon-button {
  width: var(--btn-h);
  height: var(--btn-h);
}

/* Optional: butoane compacte in toolbar-uri de tabel */
.button.button-compact {
  min-height: var(--btn-h-compact);
  padding-left: var(--btn-padding-x-compact);
  padding-right: var(--btn-padding-x-compact);
  font-size: 13px;
}

/* === CHENARE — 3 grosimi === */

/* Chenarele default vin din .card, .panel, .auth-card etc. — au deja 1px.
   Aici codificam emfazele speciale ca sa nu mai apara hardcodate. */

.section-head,
.page-header .page-kpi-strip {
  border-bottom-width: var(--border-emphasis);
}

.button-secondary,
.tile-outline {
  border-width: var(--border-emphasis);
}

.task-sticker .ts-check {
  border-width: var(--border-emphasis);
}

.tl-dot {
  border-width: var(--border-emphasis);
}

/* Border 1px este default-ul intregului sistem — nu mai inventam alte valori. */

/* =============================================================
   EDIT BANNER — sub page-header, deasupra cardurilor
   Vizibil doar in modul edit ca utilizatorul sa stie ce edit-eaza.
   Toate culorile/spatierile vin din tokeni :root.
   ============================================================= */
.edit-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: var(--section-gap);
  background: var(--em-coral-bg);
  border: 1px solid var(--em-coral-border);
  border-radius: var(--radius-control);
}

.edit-banner-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--em-spark-deep);
}

.edit-banner-sep {
  color: var(--em-spark);
  font-weight: 800;
}

.edit-banner-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--em-navy);
  line-height: 1.2;
}

.edit-banner-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-banner-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-control-sm);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.edit-banner-chip-spark {
  background: var(--em-cream);
  color: var(--em-spark-deep);
  border-color: var(--em-coral-border);
}

.edit-banner-chip-mint {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  border-color: var(--em-mint-border);
}

.edit-banner-chip-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info-border, var(--color-border));
}

.edit-banner-chip-muted {
  background: var(--color-surface-soft);
  color: var(--em-muted);
  border-color: var(--color-border);
}

.edit-banner-chip-navy {
  background: var(--em-navy);
  color: var(--em-cream);
  border-color: var(--em-navy);
}

/* Mesaje de eroare langa input-uri, populate prin Session::flashErrors() +
   helperul $fieldError() in view. Ramane discret, nu intra in spatiul layout. */
.field-error {
  display: block;
  margin-top: 4px;
  color: var(--color-danger);
  font-size: 0.78rem;
  line-height: 1.3;
}

/* === Combobox unic Emma (live search) — componenta comuna pentru toate
   formularele (client, reprezentant, servicii etc.). Logica: EmmaUI.combobox
   in ui-components.js. Inlocuieste fostele .pv-combobox / .off-cbx / .contract-cbx. === */
.emma-cbx { position: relative; }

.emma-cbx [data-cbx-input] { padding-right: 30px; }

.emma-cbx .emma-cbx-caret {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--em-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.emma-cbx-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 25;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
}

.emma-cbx-list.is-open { display: block; }

.emma-cbx-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-control-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--em-navy);
}

.emma-cbx-item:hover,
.emma-cbx-item.is-active { background: var(--color-surface-soft); }

.emma-cbx-item small { color: var(--em-muted); font-size: 11px; }

.emma-cbx-item.is-message {
  cursor: default;
  font-style: italic;
  color: var(--em-muted);
}

.emma-cbx-new {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-control-sm);
  background: var(--color-success-bg);
  color: var(--em-mint);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Field completion states: red required/invalid, yellow optional empty, green completed. */
:where(input, select, textarea).emma-field-state-incomplete {
  border-color: var(--color-danger-border) !important;
  background: var(--color-danger-bg) !important;
  box-shadow: 0 0 0 2px rgba(214, 62, 62, .08) !important;
}

:where(input, select, textarea).emma-field-state-optional {
  border-color: var(--color-warning-border) !important;
  background: var(--color-warning-bg) !important;
  box-shadow: 0 0 0 2px rgba(245, 179, 59, .10) !important;
}

:where(input, select, textarea).emma-field-state-complete {
  border-color: var(--color-success-border) !important;
  background: var(--color-success-bg) !important;
  box-shadow: 0 0 0 2px rgba(35, 180, 138, .10) !important;
}

:where(input, select, textarea).emma-field-state-incomplete:focus {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 3px var(--color-danger-bg) !important;
}

:where(input, select, textarea).emma-field-state-optional:focus {
  border-color: var(--color-warning) !important;
  box-shadow: 0 0 0 3px var(--color-warning-bg) !important;
}

:where(input, select, textarea).emma-field-state-complete:focus {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px var(--color-success-bg) !important;
}

.emma-upload.emma-field-state-incomplete,
.emma-check.emma-field-state-incomplete,
.pv-billing-toggle.emma-field-state-incomplete,
.off-seg.emma-field-state-incomplete,
.segmented-control.emma-field-state-incomplete {
  border-color: var(--color-danger-border) !important;
  background: var(--color-danger-bg) !important;
  box-shadow: 0 0 0 2px rgba(214, 62, 62, .08) !important;
}

.emma-upload.emma-field-state-optional,
.emma-check.emma-field-state-optional,
.pv-billing-toggle.emma-field-state-optional,
.off-seg.emma-field-state-optional,
.segmented-control.emma-field-state-optional {
  border-color: var(--color-warning-border) !important;
  background: var(--color-warning-bg) !important;
  box-shadow: 0 0 0 2px rgba(245, 179, 59, .10) !important;
}

.emma-upload.emma-field-state-complete,
.emma-check.emma-field-state-complete,
.pv-billing-toggle.emma-field-state-complete,
.off-seg.emma-field-state-complete,
.segmented-control.emma-field-state-complete {
  border-color: var(--color-success-border) !important;
  background: var(--color-success-bg) !important;
  box-shadow: 0 0 0 2px rgba(35, 180, 138, .10) !important;
}

/* Toggle-urile binare (Semnez digital, Nu se factureaza) pastreaza doar
   border-ul si fundalul de stare; umbra ingrosa vizual chenarul. */
.pv-billing-toggle.emma-field-state-incomplete,
.pv-billing-toggle.emma-field-state-optional,
.pv-billing-toggle.emma-field-state-complete {
  box-shadow: none !important;
}

.emma-check.emma-field-state-incomplete .emma-check-box {
  border-color: var(--color-danger-border);
}

.emma-check.emma-field-state-complete .emma-check-box {
  border-color: var(--color-success);
  background: var(--color-success);
}

/* =============================================================
   Portal client public (vedere documente).
   Decizie 2026-06-02: identitate tenant in header (logo + nume +
   contact), layout modern pentru fisiere. Foloseste tokenii Ink /
   Spark / Mint din :root; nu hardcoda hex.
   ============================================================= */

.client-portal-page {
  display: grid;
  gap: var(--section-gap, 24px);
}

/* Header tenant reorganizat (decizie 2026-07-04): o singura coloana —
   randul 1 imparte latimea intre eyebrow si logo, apoi numele (elementul
   principal), tagline si contactele sub divider. */
.portal-tenant-header {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card-lg, 22px);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.portal-tenant-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

/* Logo tenant in portal — standard 2026-07-04: semnatura vizuala discreta,
   inaltime fixa 28px pe randul eyebrow-ului (aceeasi ancora si pentru
   logourile patrate 28x28, si pentru landscape pana la 120px latime). */
.portal-tenant-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  height: 28px;
  max-width: 120px;
  flex-shrink: 0;
}

.portal-tenant-logo img {
  height: 100%;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

/* Fallback initiale: patrat 28x28, aliniat la inaltimea randului. */
.portal-tenant-logo-initials {
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: var(--radius-control-sm, 4px);
  background: var(--em-mint-bg);
  border: 1px solid var(--em-mint-border);
  font-family: var(--font-display, inherit);
  font-size: 13px;
  font-weight: 700;
  color: var(--em-navy);
}

.portal-tenant-eyebrow {
  margin: 0;
  color: var(--em-coral, var(--color-primary));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Numele tenantului, vizibil ca text chiar si cand exista logo —
   clientul trebuie sa stie imediat al cui portal este (decizie 2026-07-04). */
.portal-tenant-name {
  margin: 6px 0 0;
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-title);
}

.portal-tenant-address {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

/* Contact tenant compact (decizie 2026-07-04): telefonul ramane vizibil
   (grupat 0700 000 000), email si site sunt chip-uri doar-icon cu
   title/aria-label — identitatea de contact fara sa incarce header-ul. */
.portal-tenant-contact {
  list-style: none;
  padding: 14px 0 0;
  margin: 14px 0 0;
  border-top: 1px solid var(--color-border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.portal-contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.portal-contact-chip:hover { border-color: var(--em-coral, var(--color-primary)); color: var(--em-coral, var(--color-primary)); }

.portal-contact-chip-icon-only { padding: 5px; }

.portal-contact-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control-sm, 4px);
  background: var(--color-surface);
  color: var(--em-navy);
}

/* Card de bun venit (decizie 2026-07-04): inlocuieste vechiul
   portal-client-card. Suprafata ink cu salut personalizat + o fraza care
   explica pagina si chip-uri de sinteza (numar fisiere, ultima
   actualizare). Clientul intelege din prima despre ce e vorba. */
.portal-welcome {
  padding: var(--card-padding, 24px);
  border-radius: var(--r-card-lg, 22px);
  background: var(--em-navy);
  box-shadow: var(--shadow-card);
}

.portal-welcome-eyebrow {
  margin: 0;
  color: var(--em-mint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-welcome-title {
  margin: 6px 0 0;
  font-family: var(--font-display, inherit);
  color: var(--em-cream);
  font-size: 24px;
  line-height: 1.2;
}

.portal-welcome-text {
  margin: 8px 0 0;
  color: var(--em-slate-300);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 640px;
}

.portal-welcome-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.portal-welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-control, 8px);
  background: var(--em-navy-soft);
  border: 1px solid var(--em-ink-line);
  color: var(--em-cream);
  font-size: 0.82rem;
  font-weight: 600;
}

.portal-welcome-chip-icon {
  display: inline-flex;
  color: var(--em-mint);
}

.portal-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--r-card, 16px);
  background: var(--color-surface-soft);
  text-align: center;
}

.portal-empty-lockout { background: var(--color-surface); }

.portal-empty-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--em-navy);
  border: 1px solid var(--color-border);
}

.portal-empty strong {
  font-family: var(--font-display, inherit);
  color: var(--color-title);
  font-size: 1.05rem;
}

.portal-empty span:last-child {
  color: var(--color-muted);
  max-width: 480px;
}

.portal-sections {
  display: grid;
  gap: var(--section-gap, 24px);
}

.portal-section {
  padding: 18px 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-card, 16px);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.portal-section-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 14px;
}

.portal-section-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control, 8px);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  border: 1px solid var(--em-mint-border);
}

.portal-section-copy h3 {
  margin: 0;
  font-family: var(--font-display, inherit);
  color: var(--color-title);
  font-size: 17px;
}

.portal-section-copy p {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.portal-section-count {
  display: inline-flex;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 0.85rem;
}

.portal-section-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  border: 1px dashed var(--color-border);
  font-size: 0.88rem;
}

.portal-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.portal-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-file-card:hover {
  border-color: var(--em-coral, var(--color-primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.portal-file-card-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface-soft);
  color: var(--em-navy);
  border: 1px solid var(--color-border);
}

.portal-file-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.portal-file-card-body strong {
  font-family: var(--font-display, inherit);
  color: var(--color-title);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-file-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.portal-file-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--radius-control-sm, 4px);
  background: var(--color-surface-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 600;
}

.portal-file-date::before,
.portal-file-size::before {
  content: '·';
  margin-right: 6px;
  color: var(--color-border);
}

.portal-file-card-action {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control, 8px);
  background: var(--em-coral, var(--color-primary));
  color: #fff;
  flex: 0 0 36px;
}

/* Liste lungi (decizie 2026-07-04): peste 5 intrari intr-o sectiune,
   randurile 6+ se ascund si apare "Vezi toate cele N documente" /
   "Arata mai putin". CSS-only: checkbox ascuns vizual (ramane focusabil
   pentru tastatura) + label; fara JS pe pagina publica. */
.portal-more-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.portal-more-toggle:not(:checked) ~ .portal-file-grid-collapsible .portal-file-card:nth-child(n + 6) {
  display: none;
}

.portal-more-label {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.portal-more-label > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface);
  color: var(--em-spark-deep);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.portal-more-label > span:hover { border-color: var(--em-coral, var(--color-primary)); }

.portal-more-toggle:focus-visible ~ .portal-more-label > span {
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.portal-more-toggle:not(:checked) ~ .portal-more-label .portal-more-hide { display: none; }

.portal-more-toggle:checked ~ .portal-more-label .portal-more-show { display: none; }

.portal-footer {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 14px 18px;
  border-radius: var(--r-card, 16px);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 0.82rem;
  text-align: center;
}

.portal-footer strong { color: var(--color-text); }

/* Semnatura emma in portal (decizie 2026-07-04): badge discret in subsol,
   singurul loc unde apare platforma — header-ul ramane al tenantului
   (ARCHITECTURE.md). Foloseste scanteia din components/spark.php. */
.portal-emma-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-control, 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.portal-emma-badge:hover { border-color: var(--em-coral-mid); }

.portal-emma-badge strong { color: var(--color-text); }

@media (max-width: 720px) {
  .portal-section-header {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .portal-section-count {
    grid-column: 2;
    justify-self: end;
  }
  .portal-file-grid { grid-template-columns: 1fr; }
}

/* ===== Modal generic Emma =====
   Componenta comuna pentru confirmari si formulare scurte in modal:
   backdrop + panou cu head/body/foot, inchidere pe Escape/backdrop prin
   ui-components.js ([data-emma-modal]). Primul consumator: anularea
   documentului din fisa (document-show). */
.emma-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(13, 19, 33, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.emma-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.emma-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 81;
  display: flex;
  width: 560px;
  max-width: calc(100% - 32px);
  max-height: 86vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--color-surface);
  box-shadow: 0 30px 80px rgba(13, 19, 33, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.2s, transform 0.2s;
}

.emma-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.emma-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--em-coral-border);
  background: var(--em-coral-bg);
}

.emma-modal.is-danger .emma-modal-head {
  border-bottom-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.emma-modal-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--em-navy);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.emma-modal.is-danger .emma-modal-head h2 {
  color: var(--color-danger);
}

.emma-modal-close {
  display: grid;
  width: var(--btn-h);
  height: var(--btn-h);
  place-items: center;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--em-navy);
  cursor: pointer;
}

.emma-modal-close:hover {
  background: rgba(13, 19, 33, 0.08);
}

.emma-modal-body {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  padding: 16px 18px;
}

.emma-modal-intro {
  margin: 0 0 14px;
  color: var(--em-muted);
  font-size: 13px;
}

.emma-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emma-modal-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--em-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.emma-modal-field label .req {
  color: var(--em-coral-mid);
}

.emma-modal-field textarea,
.emma-modal-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  font-family: var(--font-ui);
  font-size: 14px;
}

.emma-modal-field .helper {
  color: var(--em-muted);
  font-size: 12px;
}

.emma-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

@media (max-width: 720px) {
  .emma-modal {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
}

/* ============================================================
   Trimitere email document — buton care se umple progresiv cu verde (AJAX).
   In loc de banner verde, butonul .document-action-button[data-document-send-button]
   se umple cu mint in timpul cererii si ramane verde la succes (.is-sent).
   ============================================================ */
.document-action-button[data-document-send-button] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.document-action-button[data-document-send-button] > * {
  position: relative;
  z-index: 1;
}
.document-action-button[data-document-send-button]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  z-index: 0;
  background: var(--em-mint);
  transition: width .2s linear;
}
.document-action-button.is-sending::after {
  width: 90%;
  transition: width 1.8s cubic-bezier(.15, .7, .25, 1);
}
.document-action-button.is-sent {
  border-color: var(--em-mint-deep);
  color: #fff;
}
.document-action-button.is-sent::after {
  width: 100%;
  background: var(--em-mint);
  transition: width .25s ease;
}
.document-action-button.is-error {
  border-color: var(--color-danger);
}
.document-action-button.is-error::after {
  width: 0;
}

/* ============================================================
   Communications — WhatsApp inbox.
   ============================================================ */
.whatsapp-inbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: var(--section-gap, 16px);
  align-items: stretch;
  /* Fara scroll de pagina (decizie 2026-07-10): grila are inaltimea exacta a
     spatiului ramas sub header, calculata in JS (chat.js seteaza --wa-h din
     pozitia reala a grilei). Scrolleaza DOAR lista de conversatii si firul de
     mesaje. Fallback fara JS: estimare dvh. */
  height: var(--wa-h, calc(100dvh - 260px));
  min-height: 360px;
}

/* Panourile umplu grila si isi gestioneaza intern continutul. */
.whatsapp-thread-panel,
.whatsapp-conversation-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Lista de conversatii si firul de mesaje sunt singurele zone care scrolleaza. */
.whatsapp-thread-list,
.whatsapp-conversation-panel .chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header-ele de panou, pager-ul si composer-ul raman fixe (nu se comprima). */
.whatsapp-thread-panel .panel-header,
.whatsapp-conversation-panel .panel-header,
.whatsapp-thread-pager,
.whatsapp-conversation-panel .chat-composer {
  flex: 0 0 auto;
}

.whatsapp-thread-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--color-border-soft);
  margin-top: auto;
}

.whatsapp-thread-pager-info {
  color: var(--color-muted);
  font-size: 12px;
}

.whatsapp-thread-pager .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.whatsapp-thread-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-title);
  text-decoration: none;
}

.whatsapp-thread-item:hover,
.whatsapp-thread-item.is-active {
  background: var(--color-surface-soft);
}

.whatsapp-thread-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--em-navy);
  background: var(--em-mint-soft);
}

.whatsapp-thread-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.whatsapp-thread-main strong,
.whatsapp-thread-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-thread-main strong {
  font-size: 14px;
}

.whatsapp-thread-main small,
.whatsapp-thread-item time {
  color: var(--color-muted);
  font-size: 12px;
}

.whatsapp-thread-item time {
  align-self: start;
  white-space: nowrap;
}

/* Conversatie cu mesaje necitite: titlu accentuat + bulina cu contorul
   (aceeasi componenta nav-badge ca in sidebar). */
.whatsapp-thread-item.is-unread .whatsapp-thread-main strong {
  font-weight: 700;
}

.whatsapp-thread-item.is-unread .whatsapp-thread-main small {
  color: var(--color-title);
}

.whatsapp-thread-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  align-self: start;
}


.whatsapp-conversation-header {
  min-height: 73px;
}

/* Back catre lista de conversatii — vizibil doar pe mobil, unde conversatia
   selectata ascunde lista (master-detail, decizie 2026-07-09).
   Specificitate 0-2-0 (fix 2026-07-13): simplul `.wa-back-link` era batut de
   `.button-secondary.button-icon-only { display: inline-grid }` si butonul
   aparea permanent, inclusiv pe desktop. */
.whatsapp-conversation-panel .wa-back-link {
  display: none;
}

/* Firul de mesaje foloseste componentele chat-* din chat.css (identic cu
   Chat intern, decizie 2026-07-08); aici raman doar adaptarile de layout
   pentru panoul cu doua coloane. */
.whatsapp-conversation-panel {
  display: flex;
  flex-direction: column;
}

.whatsapp-conversation-panel .chat-thread {
  flex: 1 1 auto;
}

.whatsapp-conversation-panel .empty-state {
  margin: auto;
}

.whatsapp-conversation-panel .chat-composer textarea:disabled {
  background: var(--color-surface-soft);
  color: var(--color-muted);
  cursor: not-allowed;
}

.wa-chat-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  font-style: italic;
}

/* Fisiere atasate in conversatii (decizie 2026-07-08): imagini inline,
   vocale/video cu player, documente ca link. Tokeni :root, fara valori dure. */
.wa-chat-media-image {
  display: block;
  max-width: 280px;
}

.wa-chat-media-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-control);
}

.wa-chat-media-audio {
  display: block;
  width: 240px;
  max-width: 100%;
}

.wa-chat-media-video {
  display: block;
  max-width: 280px;
  border-radius: var(--radius-control);
}

.wa-chat-media-doc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.wa-chat-media-doc small {
  color: var(--color-muted);
  white-space: nowrap;
}

/* Composer: inputul de fisier e ascuns, agrafa e butonul vizibil. */
.wa-composer-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wa-composer-filename {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  margin-bottom: 4px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .whatsapp-inbox-layout {
    grid-template-columns: 1fr;
  }

  .whatsapp-thread-panel,
  .whatsapp-conversation-panel {
    min-height: 0;
  }

  .whatsapp-thread-list,
  .whatsapp-conversation-panel .chat-thread {
    max-height: none;
  }

  /* Master-detail: conversatia selectata ascunde lista; butonul back din
     header revine la lista de conversatii. */
  .whatsapp-inbox-layout.has-selection .whatsapp-thread-panel {
    display: none;
  }

  /* Pe index (fara selectie explicita din URL), mobilul arata DOAR lista —
     auto-selectia primei conversatii ramane un comportament de desktop.
     Fara aceasta regula, lista si conversatia se stivuiau amandoua pe mobil
     (fix 2026-07-13, comportament "ca WhatsApp-ul real"). */
  .whatsapp-inbox-layout:not(.has-selection) .whatsapp-conversation-panel {
    display: none;
  }

  .whatsapp-inbox-layout.has-selection .wa-back-link {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .whatsapp-conversation-header {
    justify-content: flex-start;
  }

  .whatsapp-conversation-header > div {
    flex: 1;
    min-width: 0;
  }
}

/* ===== Emma Assist — drawer conversational, exclusiv Dashboard ===== */
body.emma-assist-open {
  overflow: hidden;
}

.emma-assist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(13, 19, 33, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

/* Companion non-modal pe desktop: fara scrim, aplicatia ramane interactiva.
   Doar pe ecrane mici devine bottom-sheet cu scrim real. */
@media (max-width: 640px) {
  .emma-assist-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

.emma-assist-drawer {
  position: fixed;
  right: 20px;
  top: 72px;
  bottom: 20px;
  z-index: 91;
  display: flex;
  width: min(400px, calc(100vw - 32px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-shell);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 200ms ease;
}

.emma-assist-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
  .emma-assist-drawer {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: min(78vh, 640px);
  }
}

.emma-assist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border-soft);
  background: var(--em-cream);
}

.emma-assist-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.emma-assist-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--em-mint-border);
  border-radius: 9px;
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.emma-assist-heading h2,
.emma-assist-section-title h3 {
  margin: 0;
  color: var(--color-title);
}

.emma-assist-heading h2 {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.15;
}

.emma-assist-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  font-size: 11px;
  color: var(--em-muted);
}

.emma-assist-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--em-mint);
}

.emma-assist-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 12px 0 9px;
  border: 1px solid var(--em-mint-border);
  border-radius: var(--radius-control);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.emma-assist-launch:hover,
.emma-assist-launch:focus-visible {
  border-color: var(--em-mint);
  background: var(--em-mint);
  color: var(--em-navy);
  outline: none;
}

.emma-assist-launch-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--em-mint-deep);
}

.emma-assist-launch:hover .emma-assist-launch-mark,
.emma-assist-launch:focus-visible .emma-assist-launch-mark {
  background: var(--em-navy);
  color: var(--em-mint);
}

@media (max-width: 720px) {
  .emma-assist-launch-label {
    display: none;
  }
  .emma-assist-launch {
    padding: 0 6px;
  }
}

.emma-assist-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--em-muted);
  cursor: pointer;
}

.emma-assist-close:hover,
.emma-assist-close:focus-visible {
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-title);
  outline: none;
}

.emma-assist-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  background: var(--color-surface);
}

.emma-assist-quick-section {
  padding: 13px 16px 14px;
  border-bottom: 1px solid var(--color-border-soft);
  background: var(--color-surface);
}

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

.emma-assist-section-title h3 {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.emma-assist-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.emma-assist-quick-action {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-title);
  font: 700 11px/1.25 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.emma-assist-quick-action:hover,
.emma-assist-quick-action:focus-visible {
  border-color: var(--em-mint-border);
  background: var(--em-mint-bg);
  color: var(--em-navy);
  outline: none;
}

.emma-assist-quick-action.is-action {
  border-color: var(--em-mint-border);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.emma-assist-quick-action.is-action:hover,
.emma-assist-quick-action.is-action:focus-visible {
  background: var(--em-mint);
  color: var(--em-navy);
}

.emma-assist-quick-action .icon {
  flex: 0 0 14px;
  color: var(--em-mint);
}

.emma-assist-quick-action:disabled,
.emma-assist-composer button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.emma-assist-chat {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  background:
    radial-gradient(circle at 100% 0, rgba(25, 200, 160, 0.08), transparent 34%),
    #f4f7f6;
}

.emma-assist-messages {
  display: flex;
  flex: 1 1 auto;
  min-height: 180px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: var(--color-border) transparent;
}

.emma-assist-message {
  width: fit-content;
  max-width: 92%;
  padding: 10px 11px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(13, 19, 33, 0.05);
}

.emma-assist-message.is-user {
  align-self: flex-end;
  border-color: var(--em-mint-border);
  background: var(--em-mint-bg);
}

.emma-assist-message-author {
  display: block;
  margin-bottom: 3px;
  color: var(--em-mint);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.emma-assist-message p {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.emma-assist-message.is-loading p {
  color: var(--color-muted);
}

.emma-assist-message.is-loading p::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 7px 0 currentColor, 14px 0 currentColor;
}

.emma-assist-response-title {
  display: block;
  margin-bottom: 5px;
  color: var(--color-title);
  font-size: 13px;
}

.emma-assist-card {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--color-border-soft);
  border-left: 2px solid var(--em-mint);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.emma-assist-card.is-warning {
  border-left-color: var(--em-mint);
}

.emma-assist-card.is-success {
  border-left-color: var(--em-mint);
}

.emma-assist-card.is-draft,
.emma-assist-card.is-action {
  border-left-color: var(--em-mint);
}

.emma-assist-card > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--color-title);
  font-size: 12px;
}

.emma-assist-card > p {
  color: var(--color-muted);
  font-size: 12px;
}

.emma-assist-card-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin-top: 8px;
  padding: 5px 9px;
  border: 1px solid var(--em-mint-border);
  border-radius: 7px;
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-size: 11px;
  font-weight: 800;
}

.emma-assist-card-link:hover,
.emma-assist-card-link:focus-visible {
  border-color: var(--em-mint);
  background: var(--em-mint);
  color: var(--em-navy);
  outline: none;
}

.emma-assist-confirmation {
  display: block;
  margin-top: 9px;
  color: var(--em-mint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.emma-assist-confirm {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--em-mint-border);
  border-radius: 8px;
  background: var(--em-mint-bg);
}

.emma-assist-confirm.is-done {
  opacity: 0.6;
  pointer-events: none;
}

.emma-assist-confirm-summary {
  margin-bottom: 8px;
  color: var(--color-title);
  font-size: 12px;
}

.emma-assist-confirm-controls {
  display: flex;
  gap: 8px;
}

.emma-assist-confirm-yes,
.emma-assist-confirm-no {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.emma-assist-confirm-yes {
  border: 1px solid var(--em-mint);
  background: var(--em-mint);
  color: var(--em-navy);
}

.emma-assist-confirm-yes:hover,
.emma-assist-confirm-yes:focus-visible {
  background: var(--em-mint-deep);
  color: var(--color-surface);
  outline: none;
}

.emma-assist-confirm-no {
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  color: var(--color-muted);
}

.emma-assist-confirm-no:hover,
.emma-assist-confirm-no:focus-visible {
  border-color: var(--color-muted);
  outline: none;
}

.emma-assist-confirm-yes:disabled,
.emma-assist-confirm-no:disabled {
  opacity: 0.6;
  cursor: default;
}

.emma-assist-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.emma-assist-composer textarea {
  width: 100%;
  min-height: var(--btn-h);
  max-height: 120px;
  resize: vertical;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  font: 14px/1.45 var(--font-ui);
}

.emma-assist-composer textarea:focus {
  border-color: var(--em-mint);
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 200, 160, 0.12);
}

.emma-assist-composer textarea::placeholder {
  color: var(--em-muted-light);
}

.emma-assist-composer .button-icon-only {
  flex: 0 0 var(--btn-h);
}

.emma-assist-composer .button-with-icon {
  flex: 0 0 auto;
  border-color: var(--em-mint);
  background: var(--em-mint);
  color: var(--em-navy);
  white-space: nowrap;
}

.emma-assist-composer .button-with-icon:hover,
.emma-assist-composer .button-with-icon:focus-visible {
  border-color: var(--em-mint-deep);
  background: var(--em-mint-deep);
  color: var(--em-navy);
  box-shadow: 0 8px 20px -12px var(--em-mint);
}

.emma-assist-disclaimer {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--color-border-soft);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .emma-assist-drawer {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    height: auto;
    border: 1px solid rgba(13, 19, 33, 0.18);
    border-radius: 14px;
  }

  .emma-assist-header {
    padding: 16px;
  }

  .emma-assist-quick-section {
    padding: 14px 16px;
  }

  .emma-assist-messages {
    padding: 16px;
  }
}

/* === CENTRU DE COMANDA (dashboard, directia C, 2026-06-27) =================
   Hero = stare programari (donut + contoare) + lista de atentie unificata;
   lateral = valoare facturata + agenda. Toate culorile/razele/spatierile vin
   din tokeni (DESIGN_SYSTEM.md). Severitatea atentiei e purtata de icon, nu de
   fundalul randului — randul ramane operational. */
.cmd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: var(--card-gap);
  align-items: stretch;
}

.cmd-hero,
.cmd-money,
.cmd-agenda,
.cmd-financial {
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card-lg);
}

.cmd-hero {
  padding: 0;
  overflow: hidden;
}

/* --- stare programari --- */
.cmd-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  background: var(--em-coral-mid);
  color: var(--em-cream);
}

.cmd-donut {
  position: relative;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
}

.cmd-donut-track {
  stroke: var(--em-ink-line-strong);
}

.cmd-donut-val {
  stroke: var(--em-mint);
}

.cmd-donut-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--em-cream);
}

.cmd-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  flex: 1;
}

.cmd-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cmd-stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  color: var(--em-cream);
}

.cmd-stat-num.is-done {
  color: var(--em-mint);
}

.cmd-stat-num.is-progress {
  color: var(--em-cream);
}

.cmd-stat-lbl {
  font-size: 11px;
  color: rgba(255, 252, 246, 0.82);
  font-weight: 500;
}

/* --- lista de atentie --- */
.cmd-attn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.cmd-attn-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-title);
  margin: 0;
}

.cmd-attn-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-danger);
  background: var(--color-danger-bg);
  padding: 3px 9px;
  border-radius: var(--radius-control-sm);
}

.cmd-attn-count.is-ok {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.cmd-attn-empty {
  margin: 0;
  padding: 4px 20px 14px;
  font-size: 13px;
  color: var(--color-muted);
}

.cmd-attn {
  display: flex;
  flex-direction: column;
}

.cmd-attn-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 18px;
  gap: 13px;
  align-items: center;
  padding: 13px 20px;
  border-top: var(--border-thin) solid var(--color-border);
  transition: background 0.18s;
}

.cmd-attn-row:hover {
  background: var(--color-surface-soft);
}

.cmd-attn-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cmd-attn-ico i,
.cmd-attn-ico svg {
  width: var(--icon-md);
  height: var(--icon-md);
}

.cmd-attn-body {
  min-width: 0;
}

.cmd-attn-body strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-title);
  line-height: 1.25;
}

.cmd-attn-body span {
  font-size: 11.5px;
  color: var(--color-muted);
}

.cmd-attn-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--color-title);
  text-align: right;
  white-space: nowrap;
}

.cmd-attn-val small {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 10px;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.cmd-attn-go {
  color: var(--em-muted-light);
  display: grid;
  place-items: center;
}

.cmd-attn-row.is-danger .cmd-attn-ico {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.cmd-attn-row.is-warning .cmd-attn-ico {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.cmd-attn-row.is-mint .cmd-attn-ico {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.cmd-attn-row.is-info .cmd-attn-ico {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.cmd-attn-row.is-muted .cmd-attn-ico {
  background: var(--color-surface-soft);
  color: var(--em-muted);
}

/* placeholder: randul de restante ramane inactiv pana la urmarirea platii */
.cmd-attn-row.is-placeholder {
  cursor: default;
}

.cmd-attn-row.is-placeholder:hover {
  background: transparent;
}

.cmd-attn-row.is-placeholder .cmd-attn-body strong,
.cmd-attn-row.is-placeholder .cmd-attn-val {
  color: var(--em-muted-light);
}

.cmd-attn-row.is-placeholder .cmd-attn-ico {
  opacity: 0.55;
}

.cmd-attn-row.is-placeholder .cmd-attn-go {
  visibility: hidden;
}

/* --- lateral: valoare facturata --- */
.cmd-side {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.cmd-money {
  padding: var(--card-padding-compact);
}

.cmd-money-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--em-muted-light);
}

.cmd-chip {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-control-sm);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
  font-weight: 600;
}

.cmd-money-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: var(--color-title);
  line-height: 1;
  margin: 10px 0 2px;
}

.cmd-money-sub {
  font-size: 12px;
  color: var(--color-muted);
}

.cmd-money-chart {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  display: block;
}

.cmd-range {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.cmd-range-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h-compact);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control-sm);
  padding: 0 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

@media (max-width: 720px) {
  .cmd-range-btn {
    height: var(--btn-h);
  }
}

.cmd-range-btn:hover {
  color: var(--color-title);
}

.cmd-range-btn.is-active {
  background: var(--em-navy);
  color: var(--em-cream);
  border-color: var(--em-navy);
}

/* --- lateral: agenda --- */
.cmd-agenda {
  display: flex;
  flex-direction: column;
  padding: var(--card-padding-compact);
}

.cmd-ag-range {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-bottom: 10px;
}

.cmd-ag-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.cmd-act::-webkit-scrollbar,
.cmd-rep::-webkit-scrollbar,
.cmd-ag-list::-webkit-scrollbar {
  width: 6px;
}

.cmd-act::-webkit-scrollbar-thumb,
.cmd-rep::-webkit-scrollbar-thumb,
.cmd-ag-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 6px;
}

.cmd-card-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cmd-card-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-title);
  margin: 0;
}

.cmd-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--em-muted-light);
}

.cmd-empty {
  font-size: 12.5px;
  color: var(--color-muted);
  margin: 8px 0 0;
}

.cmd-empty a {
  color: var(--em-spark-deep);
  font-weight: 600;
}

.cmd-ag-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 0;
  border-top: var(--border-thin) solid var(--color-border-soft);
}

.cmd-ag-row:first-of-type {
  border-top: none;
}

.cmd-ag-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-title);
}

.cmd-ag-body {
  min-width: 0;
}

.cmd-ag-body strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-title);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-ag-body span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

.cmd-ag-body span i,
.cmd-ag-body span svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.cmd-ag-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-control-sm);
  white-space: nowrap;
}

.cmd-ag-tag.is-mint {
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.cmd-ag-tag.is-amber {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.cmd-ag-tag.is-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* --- responsive --- */
@media (max-width: 1020px) {
  .cmd-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .cmd-status {
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
  }

  .cmd-status-grid {
    gap: 16px;
  }

  .cmd-attn-head {
    padding: 14px 16px 6px;
  }

  .cmd-attn-empty {
    padding: 4px 16px 12px;
  }

  .cmd-attn-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: 12px 16px;
  }

  .cmd-attn-go {
    display: none;
  }
}

/* --- sectiune secundara: activitate + rapoarte + tehnicieni (etapa 2) --- */
.cmd-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
  margin-top: var(--card-gap);
  align-items: stretch;
}

.cmd-panel {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card-lg);
  padding: var(--card-padding-compact);
}

.cmd-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--em-spark-deep);
}

.cmd-act {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.cmd-act-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: var(--border-thin) solid var(--color-border-soft);
}

.cmd-act-row:first-child {
  border-top: none;
}

.cmd-act-ico {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--em-muted);
  display: grid;
  place-items: center;
}

.cmd-act-ico i,
.cmd-act-ico svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.cmd-act-body {
  min-width: 0;
}

.cmd-act-body strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-act-body span {
  display: block;
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-act-time {
  font-size: 10.5px;
  color: var(--em-muted-light);
  white-space: nowrap;
}

.cmd-rep {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.cmd-rep-row {
  padding: 11px 0;
  border-top: var(--border-thin) solid var(--color-border-soft);
}

.cmd-rep-row:first-child {
  border-top: none;
}

.cmd-rep-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cmd-rep-head strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-title);
}

.cmd-rep-time {
  font-size: 10.5px;
  color: var(--em-muted-light);
  white-space: nowrap;
}

.cmd-rep-note {
  margin: 5px 0 6px;
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cmd-rep-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-muted);
}

.cmd-rep-meta i,
.cmd-rep-meta svg {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.cmd-tech {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  margin-top: 6px;
}

.cmd-tech-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cmd-tech-top strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-title);
}

.cmd-tech-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--color-title);
}

.cmd-tech-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--color-surface-soft);
  margin: 5px 0;
  overflow: hidden;
}

.cmd-tech-bar span {
  display: block;
  height: 100%;
  background: var(--em-mint);
  border-radius: 6px;
}

.cmd-tech-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--color-muted);
}

.cmd-tech-flag {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-warning);
  background: var(--color-warning-bg);
  padding: 2px 7px;
  border-radius: var(--radius-control-sm);
  white-space: nowrap;
}

@media (max-width: 1020px) {
  .cmd-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cmd-secondary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- rand 3: financiar pe latime (etapa 2, rearanjare) --- */
.cmd-financial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 22px;
  margin-top: var(--card-gap);
  padding: var(--card-padding-compact);
}

.cmd-fin-main {
  min-width: 0;
}

.cmd-fin-chart {
  width: 100%;
  height: 64px;
  margin-top: 10px;
  display: block;
}

.cmd-fin-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: var(--border-thin) solid var(--color-border);
  padding-left: 22px;
}

.cmd-fin-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cmd-fin-stat.is-muted .cmd-fin-lbl,
.cmd-fin-stat.is-muted .cmd-fin-val {
  color: var(--em-muted-light);
}

.cmd-fin-lbl {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--em-muted-light);
}

.cmd-fin-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--color-title);
  line-height: 1.1;
}

.cmd-fin-val small {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.cmd-fin-sub {
  font-size: 11.5px;
  color: var(--color-muted);
}

a.cmd-fin-stat:hover .cmd-fin-val {
  color: var(--em-spark-deep);
}

@media (max-width: 720px) {
  .cmd-financial {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .cmd-fin-rail {
    flex-direction: row;
    gap: 18px;
    border-left: none;
    border-top: var(--border-thin) solid var(--color-border);
    padding-left: 0;
    padding-top: 14px;
  }

  .cmd-fin-stat {
    flex: 1;
  }
}

/* === RAPOARTE — analiza (rework 2026-06-27) ===============================
   Componente comune: filtru cu chips de perioada, KPI carduri, grafic de bare,
   leaderboard. Toate pe tokeni (DESIGN_SYSTEM.md). Tabelele de drill-down
   raman .professional-table + DataTables. */
.rep-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.rep-period {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  height: var(--btn-h);
  gap: 4px;
  background: var(--color-surface-soft);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 3px;
}

.rep-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-control-sm);
  padding: 0 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.rep-chip:hover {
  color: var(--color-title);
}

.rep-chip.is-active {
  background: var(--color-surface);
  color: var(--em-navy);
  box-shadow: var(--shadow-card-soft);
}

.rep-custom {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.rep-actions {
  display: flex;
  align-self: flex-end;
  gap: 8px;
}

/* Campurile de filtru (data/status/tehnician) — stilul emma de form-field
   e scopat la .form-grid; il replicam pentru bara de filtre a rapoartelor. */
.rep-filters .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-filters .form-field > label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.rep-filters input,
.rep-filters select {
  height: var(--btn-h);
  padding: 0 12px;
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
}

/* Toate controalele din bara au exact inaltimea standard --btn-h. */
.rep-filters .button {
  height: var(--btn-h);
  min-height: var(--btn-h);
}

.rep-filters input {
  width: 150px;
}

.rep-filters select {
  min-width: 140px;
}

.rep-filters input:focus,
.rep-filters select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--em-coral-bg);
}

.rep-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.rep-kpi {
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card);
  padding: 14px 16px;
}

.rep-kpi-lbl {
  font-size: 11px;
  color: var(--em-muted-light);
  font-weight: 600;
}

.rep-kpi-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--color-title);
  line-height: 1;
  margin: 7px 0 3px;
}

.rep-kpi-num small {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
}

.rep-kpi-sub {
  font-size: 11px;
  color: var(--color-muted);
}

.rep-kpi-sub.is-up {
  color: var(--em-mint-deep);
}

.rep-kpi-sub.is-down {
  color: var(--color-danger);
}

.rep-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.rep-card {
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card);
  padding: 16px;
}

.rep-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-title);
  margin: 0;
}

.rep-card-meta {
  font-size: 11px;
  color: var(--em-muted-light);
  margin: 2px 0 12px;
}

.rep-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}

.rep-bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rep-bar-stack {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100px;
}

.rep-bar {
  width: 22px;
  max-width: 40%;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.rep-bar.is-total {
  background: var(--em-coral-bg);
}

.rep-bar.is-done {
  background: var(--em-coral-mid);
}

.rep-bar.is-single {
  width: 28px;
  max-width: 50%;
  background: var(--em-mint);
}

.rep-bar-x {
  font-size: 9.5px;
  color: var(--em-muted-light);
  font-weight: 600;
}

.rep-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-muted);
}

.rep-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rep-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.rep-lead {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.rep-lead-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.rep-lead-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-title);
}

.rep-lead-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--color-title);
  white-space: nowrap;
}

.rep-lead-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--color-surface-soft);
  margin-top: 5px;
  overflow: hidden;
}

.rep-lead-bar span {
  display: block;
  height: 100%;
  background: var(--em-mint);
  border-radius: 6px;
}

.rep-empty {
  font-size: 13px;
  color: var(--color-muted);
  margin: 0;
}

@media (max-width: 1000px) {
  .rep-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .rep-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* === TOAST notificari (pop-up automat, 2026-06-28) =======================
   Apare cand soseste o notificare noua cat timp emma e deschisa. Peste topbar
   (z 40), sub modale (>=50). Tokeni: suprafata/raza/umbra. */
.emma-toasts {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 48;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

.emma-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 13px 14px;
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-shell);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.emma-toast.is-in {
  transform: translateX(0);
  opacity: 1;
}

.emma-toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex: 0 0 auto;
  background: var(--color-info);
}

.emma-toast-success .emma-toast-dot {
  background: var(--em-mint);
}

.emma-toast-warning .emma-toast-dot {
  background: var(--color-warning);
}

.emma-toast-danger .emma-toast-dot {
  background: var(--color-danger);
}

.emma-toast-main {
  min-width: 0;
}

.emma-toast-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-title);
  line-height: 1.25;
}

.emma-toast-text {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

.emma-toast-close {
  background: none;
  border: none;
  color: var(--em-muted-light);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.emma-toast-close:hover {
  color: var(--color-title);
}

@media (max-width: 720px) {
  .emma-toasts {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* === CERERI — inbox de triere (board pe status, 2026-06-28) =============== */
.lead-viewtoggle {
  display: inline-flex;
  align-items: stretch;
  height: var(--btn-h);
  gap: 3px;
  background: var(--color-surface-soft);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 3px;
}

.lead-vt {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  padding: 0 14px;
  border-radius: var(--radius-control-sm);
}

.lead-vt.is-active {
  background: var(--color-surface);
  color: var(--em-navy);
  box-shadow: var(--shadow-card-soft);
}

.lead-board {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  overflow-x: auto;
  /* Aliniat cu .professional-table-shell: board-ul nu atinge bara de filtre. */
  padding: 12px 16px 16px;
}

.lead-col {
  flex: 1 0 210px;
  min-width: 210px;
  max-width: 320px;
  background: var(--color-surface-soft);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--r-card);
  padding: 10px;
}

.lead-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 2px;
}

.lead-col-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-title);
}

.lead-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.lead-dot.is-spark {
  background: var(--em-coral-mid);
}

.lead-dot.is-amber {
  background: var(--color-warning);
}

.lead-dot.is-mint {
  background: var(--em-mint);
}

.lead-dot.is-muted {
  background: var(--em-muted-light);
}

.lead-dot.is-danger {
  background: var(--color-danger);
}

.lead-col-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--em-muted-light);
}

.lead-col-empty {
  margin: 4px 0 2px;
  text-align: center;
  color: var(--em-muted-light);
  font-size: 14px;
}

.lead-card {
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: 12px;
  padding: 10px 11px;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lead-card:hover {
  border-color: var(--border-strong, var(--em-navy));
  box-shadow: var(--shadow-card-soft);
}

.lead-card-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-title);
  line-height: 1.25;
}

.lead-card-meta {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 3px;
}

.lead-fu {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-control-sm);
  margin-top: 8px;
}

.lead-fu.is-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.lead-fu.is-amber {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.lead-fu.is-muted {
  background: var(--color-surface-soft);
  color: var(--color-muted);
}

.lead-card-acts {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  border-top: var(--border-thin) solid var(--color-border-soft);
  padding-top: 8px;
}

.lead-act {
  flex: 1;
  height: 28px;
  display: grid;
  place-items: center;
  border: var(--border-thin) solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-muted);
}

.lead-act:hover {
  color: var(--color-title);
}

.lead-act.is-call {
  color: var(--em-mint-deep);
  border-color: var(--em-mint-border);
  background: var(--em-mint-bg);
}

.lead-act.is-convert {
  color: var(--em-spark-deep);
  border-color: var(--em-coral-border);
  background: var(--em-coral-bg);
}

.lead-act i,
.lead-act svg {
  width: var(--icon-base);
  height: var(--icon-base);
}

/* === Zona de drag & drop pentru upload fisiere ([data-file-dropzone]) === */
.file-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 14px 16px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-dropzone:hover {
  border-color: var(--em-coral-mid);
}

.file-dropzone.is-dragover {
  border-color: var(--em-coral-mid);
  background: var(--color-surface);
}

.file-dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-dropzone-icon {
  display: inline-flex;
  color: var(--color-muted);
}

.file-dropzone-text {
  font-size: 13px;
}

.file-dropzone-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--em-navy);
  word-break: break-all;
}

.file-dropzone.has-file .file-dropzone-text {
  display: none;
}

.file-dropzone:not(.has-file) .file-dropzone-name {
  display: none;
}

/* ============================================================
   Setari > WhatsApp — pagina dedicata (decizie 2026-07-08)
   Card compact de conexiune + tabel de template-uri grupat.
   ============================================================ */
.wa-conn {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.wa-conn-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--em-mint-border);
  border-radius: var(--radius-control);
  background: var(--em-mint-bg);
  color: var(--em-mint-deep);
}

.wa-conn-icon svg {
  width: 22px;
  height: 22px;
}

.wa-conn-main {
  flex: 1;
  min-width: 220px;
}

.wa-conn-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-conn-number {
  color: var(--color-title);
  font-size: 16px;
  font-weight: 600;
}

.wa-conn-ids {
  margin-top: 5px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.wa-conn-toggle {
  display: flex;
  align-items: center;
}

.wa-conn-error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-control);
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-size: 12.5px;
}

.wa-tpl-search {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  font-size: 12.5px;
  color: var(--color-text);
}

.wa-tpl-search:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.wa-tpl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wa-tpl-table th {
  padding: 8px 20px 8px 0;
  text-align: left;
  color: var(--em-muted-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-surface-soft);
}

.wa-tpl-table th:first-child,
.wa-tpl-table td:first-child {
  padding-left: 12px;
}

.wa-tpl-col-lang {
  width: 10%;
}

.wa-tpl-col-status {
  width: 20%;
}

.wa-tpl-category td {
  padding: 12px 0 4px;
  color: var(--em-muted-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wa-tpl-row td {
  padding: 10px 20px 10px 0;
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-text);
}

.wa-tpl-row[data-wa-tpl-expandable] {
  cursor: pointer;
}

.wa-tpl-row[data-wa-tpl-expandable]:hover td {
  background: var(--color-surface-soft);
}

.wa-tpl-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--color-focus-ring);
}

.wa-tpl-label {
  font-weight: 500;
  color: var(--color-title);
}

.wa-tpl-chevron {
  display: inline-grid;
  place-items: center;
  vertical-align: -2px;
  color: var(--color-muted);
  transition: transform 150ms ease;
}

.wa-tpl-row.is-expanded .wa-tpl-chevron {
  transform: rotate(180deg);
}

.wa-tpl-name,
.wa-tpl-lang {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.wa-tpl-preview td {
  padding: 0 20px 12px 12px;
}

.wa-tpl-preview-box {
  padding: 10px 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-control);
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.55;
}

.wa-tpl-preview-box p {
  margin: 0;
}

.wa-tpl-preview-box p + p {
  margin-top: 5px;
}

.wa-tpl-var {
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.wa-tpl-preview-rejection {
  color: var(--color-danger);
}

.wa-tpl-empty {
  margin: 12px 0 0;
  color: var(--color-muted);
  font-size: 12.5px;
}

.wa-tpl-col-actions {
  width: 25%;
}

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

.wa-tpl-label .wa-tpl-preview-box {
  margin-top: 8px;
  font-weight: 400;
}

/* Bife de canal per automatizare (Email / SMS / WhatsApp), tip `channels`. */
.settings-channels {
  display: grid;
  gap: 8px;
}

.settings-channels-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* =====================================================================
   Anti-zoom iOS pe controale (decizie 2026-07-12).
   Safari pe iOS face zoom automat la focus pe orice control cu font sub
   16px; body-ul e 14px si controalele mostenesc (font: inherit). Pe
   dispozitive tactile (iPhone/iPad/Android) ridicam controalele la 16px —
   desktopul ramane dens, neatins. Checkbox/radio/file/range/color raman
   excluse (nu primesc focus de tastatura virtuala, nu declanseaza zoom).
   `!important` e intentionat si necesar: multe module seteaza font-size
   pe controale cu specificitate mai mare (.pv-field input 14px, calendar
   12px, .dt-search input etc.) si fiecare ar reactiva zoom-ul. Sub 16px
   pe touch nu e niciodata legitim — zoom-ul iOS ar strica oricum layout-ul.
   (chat.css si pv-form.css au fix-uri locale de 16px mai vechi; raman
   inofensive.) Blocul sta la FINALUL fisierului (capcana cascadei).
   ===================================================================== */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}
