/* ========================================
   TRX Nova BackOffice — stiluri proprii
   Shell modern (topbar + rail + flyout) + nomenclatoare
   ======================================== */

:root {
    --fc-top: 56px;
    --fc-rail: 178px;

    --fc-indigo: #39316e;   /* topbar */
    --fc-side: #342c64;     /* sidebar rail */
    --fc-flyout: #2c2557;   /* submeniu lateral */
    --fc-accent: #7c6df2;   /* mov accent */

    --fc-bg: #f4f5f9;
    --fc-card: #ffffff;
    /* Text pe 3 trepte, toate lizibile pe alb (contrast ≥ 4.5:1). NU folosi gri mai deschis decât --fc-faint
       pentru text — gri-ul „șters" de dinainte (#8a90a8 / #9aaac0, contrast ~3:1) obosea ochii. */
    --fc-ink: #1f2133;      /* text principal */
    --fc-muted: #545a72;    /* text secundar: etichete, antete de tabel, explicații */
    --fc-faint: #6b7188;    /* text terțiar: „niciun rezultat", indicii, valori lipsă */
    --fc-line: #ececf3;
}

/* touch-action, text-size-adjust și box-sizing sunt aplicate global din Shared/app.css.
   Aici doar override-urile vizuale specifice BackOffice. */
html, body {
    margin: 0; padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--fc-bg);
    color: var(--fc-ink);
    font-size: 14px;
    /* Blocare „mută fereastra" pe mobil/fullscreen (overscroll/rubber-band) — ca la POS.
       Documentul nu scrollează; scroll-ul real e în .fc-main / .bo-page-body. */
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ════════════════════════════════════════════════
   SHELL — grid app (topbar fix, rail fix, main scroll)
   ════════════════════════════════════════════════ */
.fc-shell {
    height: 100vh;
    height: 100dvh;   /* pe mobil 100vh include zona de sub bara browserului → ultimul rând tăiat; dvh = vizibil real */
    overflow: hidden;
    display: grid;
    grid-template-columns: var(--fc-rail) 1fr;
    grid-template-rows: var(--fc-top) 1fr;
    grid-template-areas:
        "top  top"
        "side main";
}

/* ── TOPBAR ──────────────────────────────────── */
.fc-topbar {
    grid-area: top;
    background: var(--fc-indigo);
    display: flex; align-items: center; gap: 14px;
    padding: 0 16px;
    color: #fff;
    z-index: 70;
}
.fc-icon-btn {
    background: transparent; border: 0; color: #cfcbe8;
    width: 38px; height: 38px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .12s, color .12s;
}
.fc-icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.fc-icon-btn.activ { background: rgba(255,255,255,.18); color: #fff; }   /* ex. ⚙ cu meniul Setări deschis */
.fc-brand { display: flex; align-items: center; height: 100%; text-decoration: none; }
.fc-brand img { height: 34px; width: auto; object-fit: contain; }
.fc-brand-ver {
    align-self: flex-end; margin: 0 0 10px 6px;
    font-size: .7rem; font-weight: 600; letter-spacing: .3px; color: rgba(255,255,255,.72);
}
.fc-search {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.12);
    border-radius: 9px; padding: 7px 12px;
    max-width: 380px; flex: 1; color: #d7d3ef; margin-left: 8px;
    position: relative;
}
.fc-search input {
    background: transparent; border: 0; outline: 0; color: #fff;
    font-size: .88rem; flex: 1; min-width: 0;
}
.fc-search input::placeholder { color: #b9b4dd; }

/* Dropdown rezultate căutare globală */
.fc-search-scrim { position: fixed; inset: 0; z-index: 1190; }
.fc-search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200;
    background: #fff; color: var(--fc-ink); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20,12,50,.28); border: 1px solid var(--fc-line);
    max-height: min(70vh, 520px); overflow-y: auto; padding: 6px;
    min-width: 320px;
}
.fc-search-empty { padding: 14px 12px; color: var(--fc-muted); font-size: .85rem; text-align: center; }
.fc-search-group { padding: 4px 0; }
.fc-search-group + .fc-search-group { border-top: 1px solid var(--fc-line); }
.fc-search-group-title {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--fc-accent); padding: 6px 10px 3px;
}
.fc-search-item {
    display: flex; align-items: baseline; gap: 8px; width: 100%;
    background: none; border: 0; cursor: pointer; text-align: left;
    padding: 7px 10px; border-radius: 6px; font-size: .88rem; color: var(--fc-ink);
}
.fc-search-item:hover { background: #f2f0fb; }
.fc-search-item-t { font-weight: 600; }
.fc-search-item-s { color: var(--fc-muted); font-size: .78rem; margin-left: auto; white-space: nowrap; }
.fc-top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.fc-avatar-wrap { position: relative; }
.fc-avatar {
    background: linear-gradient(135deg, #7c6df2, #9b8bff);
    border: 0; color: #fff;
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; margin-left: 6px;
}
.fc-usermenu-scrim { position: fixed; inset: 0; z-index: 80; }
.fc-usermenu {
    position: absolute; right: 0; top: 46px;
    background: #fff; border: 1px solid var(--fc-line);
    border-radius: 10px; box-shadow: 0 8px 28px rgba(30,20,70,.18);
    min-width: 200px; z-index: 90; overflow: hidden;
}
.fc-usermenu-head { padding: 12px 14px; border-bottom: 1px solid var(--fc-line); }
.fc-usermenu-name { font-weight: 700; color: var(--fc-ink); }
.fc-usermenu-role { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--fc-muted); }
.fc-usermenu-ver { padding: 8px 14px; border-bottom: 1px solid var(--fc-line); font-size: .75rem; color: var(--fc-muted); }
.fc-usermenu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; background: transparent; border: 0;
    padding: 11px 14px; font-size: .88rem; color: #c0392b; cursor: pointer;
}
.fc-usermenu-item:hover { background: #fdecea; }

/* ── SIDEBAR RAIL ─────────────────────────────── */
.fc-sidebar {
    grid-area: side;
    background: var(--fc-side);
    overflow-y: auto; overflow-x: hidden;
}
.fc-rail { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.fc-rail-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; background: transparent; border: 0;
    border-radius: 9px; padding: 10px 12px;
    color: #c4bfe4; cursor: pointer; font-size: .82rem;
    text-align: left; position: relative;
    transition: background .12s, color .12s;
}
.fc-rail-ic { flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; }
.fc-rail-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-rail-chev { opacity: .45; display: inline-flex; }
.fc-rail-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.fc-rail-item.open { background: rgba(255,255,255,.12); color: #fff; }
.fc-rail-item.active { background: rgba(255,255,255,.14); color: #fff; }
.fc-rail-item.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--fc-accent);
}

/* Collapsed (icon-only) */
.fc-shell.collapsed { --fc-rail: 66px; }
.fc-shell.collapsed .fc-rail-label,
.fc-shell.collapsed .fc-rail-chev { display: none; }
.fc-shell.collapsed .fc-rail-item { justify-content: center; padding: 12px 0; }

/* ── FLYOUT SUBMENU ───────────────────────────── */
.fc-flyout-scrim {
    position: fixed; top: var(--fc-top); left: var(--fc-rail);
    right: 0; bottom: 0; z-index: 55;
}
.fc-flyout {
    position: fixed; top: var(--fc-top); left: var(--fc-rail);
    width: 252px; height: calc(100vh - var(--fc-top));
    background: var(--fc-flyout); z-index: 60;
    overflow-y: auto; box-shadow: 6px 0 24px rgba(20,12,50,.25);
    animation: fcFly .16s ease;
}
@keyframes fcFly {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: none; }
}
.fc-flyout-head {
    position: sticky; top: 0; background: var(--fc-flyout);
    color: #fff; font-weight: 700; font-size: .9rem;
    padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: 10px;
}
/* Buton „înapoi" — afișat doar pe mobil (unde flyout-ul acoperă rail-ul) */
.fc-flyout-back {
    display: none; background: rgba(255,255,255,.1); border: 0;
    color: #fff; width: 32px; height: 32px; border-radius: 8px;
    align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto;
}
.fc-flyout-back:hover { background: rgba(255,255,255,.2); }
.fc-flyout-items { padding: 6px 0 16px; display: flex; flex-direction: column; }
.fc-flyout-sep {
    padding: 13px 18px 5px; font-size: .62rem; text-transform: uppercase;
    letter-spacing: .8px; color: #8c85b3; font-weight: 700;
    border-top: 1px solid rgba(255,255,255,.06); margin-top: 4px;
}
.fc-flyout-sep:first-child { border-top: none; margin-top: 0; }
.fc-flyout-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 18px; color: #cbc6e6; text-decoration: none;
    font-size: .84rem; border-left: 3px solid transparent;
    cursor: pointer; transition: background .1s, color .1s;
}
.fc-flyout-item:hover:not(.disabled) { background: rgba(255,255,255,.08); color: #fff; }
.fc-flyout-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--fc-accent); }
.fc-flyout-item.disabled { color: #837da6; cursor: default; }
.fc-soon {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .5px;
    background: rgba(255,255,255,.08); color: #a79fce;
    padding: 2px 7px; border-radius: 9px; font-weight: 700; white-space: nowrap;
}

/* ── MAIN (scroll independent) ────────────────── */
.fc-main { grid-area: main; overflow-y: auto; padding: 10px 28px 28px; }
/* Pe paginile-listă (.bo-page): fc-main devine flex column care NU scrollează → .bo-page o umple
   (flex:1) și DOAR .bo-page-body scrollează. Altfel ar scrolla fc-main, târând capul de tabel sticky. */
.fc-main:has(.bo-page) { overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 0; }

/* Pagina de listă = coloană flex pe toată înălțimea: header FIX sus + tabel care scrollează.
   Astfel atât header-ul (titlu/căutare/adăugare) CÂT ȘI capul de tabel (thead) rămân ancorate. */
/* flex:1 în fc-main (flex column) — umple înălțimea fiabil, fără percentage-height (height:100% nu
   constrângea mereu .bo-page-body → scrolla fc-main și fugea thead-ul). Fallback height:100% pt. orice context non-flex. */
.bo-page { flex: 1 1 auto; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.bo-page-head {
    flex: 0 0 auto; padding-bottom: 12px;
    display: flex; flex-wrap: wrap; align-items: baseline;
}
/* Titlu stânga + explicație (mică, ștearsă, la dreapta) pe același rând; toolbar pe rândul de jos. */
.bo-page-head > h1 { margin-bottom: 0; }
.bo-page-head > .bo-page-hint {
    margin: 0 0 0 auto; text-align: right; max-width: 62%;
    font-size: 0.76rem; font-weight: 400; color: var(--fc-muted); line-height: 1.3;
}
.bo-page-head > .bo-msg-eroare,
.bo-page-head > .bo-msg-ok { flex: 0 0 100%; margin-top: 10px; margin-bottom: 0; }
.bo-page-head > .bo-toolbar { flex: 0 0 100%; margin: 12px 0 0; }
/* Zona scrollabilă care conține tabelul */
.bo-page-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 16px; overscroll-behavior: contain; }

/* ════════════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════════════ */
.fc-dash { max-width: 1400px; }

.fc-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.fc-kpi {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--fc-line);
    border-radius: 12px; padding: 16px 18px;
    text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.fc-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(40,30,90,.08); }
.fc-kpi-ic {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex: 0 0 auto;
}
.fc-kpi-body { display: flex; flex-direction: column; }
.fc-kpi-val { font-size: 1.6rem; font-weight: 800; color: var(--fc-ink); line-height: 1.1; }
.fc-kpi-label { font-size: .8rem; color: var(--fc-muted); }

/* Accent gradients (KPI + quick + alte iconițe) */
.fc-kpi.accent-purple .fc-kpi-ic, .fc-quick-ic.accent-purple { background: linear-gradient(135deg, #7c6df2, #9b8bff); }
.fc-kpi.accent-green  .fc-kpi-ic, .fc-quick-ic.accent-green  { background: linear-gradient(135deg, #14c79a, #3ee0b3); }
.fc-kpi.accent-blue   .fc-kpi-ic, .fc-quick-ic.accent-blue   { background: linear-gradient(135deg, #4b9bff, #6fb0ff); }
.fc-kpi.accent-orange .fc-kpi-ic, .fc-quick-ic.accent-orange { background: linear-gradient(135deg, #ff9f43, #ffb86b); }

.fc-dash-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 18px; }
.fc-panel { background: #fff; border: 1px solid var(--fc-line); border-radius: 12px; padding: 18px 20px; }
.fc-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; color: var(--fc-ink); font-size: 1rem; margin-bottom: 14px;
}
.fc-panel-head span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.fc-panel-head svg { color: var(--fc-accent); }
.fc-panel-sub { font-size: .78rem; color: var(--fc-muted); font-weight: 500; }

.fc-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px 20px; color: var(--fc-muted);
}
.fc-empty svg { color: #c5c2dd; }
.fc-empty p { margin: 12px 0 4px; color: var(--fc-ink); font-weight: 600; }
.fc-empty-sub { font-size: .82rem; }

.fc-quick { display: flex; flex-direction: column; gap: 8px; }
.fc-quick-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: 10px; text-decoration: none;
    color: var(--fc-ink); transition: background .12s;
}
.fc-quick-item:hover { background: #f4f5f9; }
.fc-quick-ic {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto;
}
.fc-quick-txt { display: flex; flex-direction: column; flex: 1; }
.fc-quick-txt b { font-size: .9rem; }
.fc-quick-txt small { font-size: .75rem; color: var(--fc-muted); }
.fc-quick-item > svg { color: var(--fc-muted); }

/* ── PAGE HEADING (folosit de paginile de nomenclator) ── */
.bo-page h1 { font-size: 1.5rem; margin: 0 0 8px; color: var(--fc-ink); font-weight: 700; }
.bo-page-hint { color: var(--fc-muted); margin: 0 0 24px; font-size: 0.95rem; }

/* ════════════════════════════════════════════════
   TABLE + TOOLBAR (nomenclatoare) — reutilizat ca atare
   ════════════════════════════════════════════════ */
.bo-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.bo-toolbar-check {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; font-weight: normal; color: var(--fc-ink); user-select: none;
}
.bo-toolbar input {
    flex: 1; max-width: 320px; padding: 8px 12px;
    border: 1px solid #c9d6e9; border-radius: 6px; background: #fff; font-size: 0.9rem;
}
.bo-btn {
    padding: 8px 16px; border: 0; border-radius: 6px;
    background: var(--fc-indigo); color: #fff; font-weight: 600;
    cursor: pointer; font-size: 0.9rem; transition: background 0.12s;
}
.bo-btn:hover  { background: #2f2860; }
.bo-btn.orange { background: var(--fc-accent); }
.bo-btn.orange:hover { background: #6657e0; }
.bo-btn.ghost  { background: transparent; color: var(--fc-ink); border: 1px solid #c9d6e9; }
.bo-btn.ghost:hover { background: #eef3fa; }
.bo-btn.danger { background: #c62828; }
.bo-btn.danger:hover { background: #a52020; }
.bo-btn.sm { padding: 4px 10px; font-size: 0.8rem; }
/* Buton dezactivat = GRI, peste orice variantă (lipsea: „Creează toate” inactiv arăta activ — 2026-11-13). Selector cu
   :disabled + :hover ca să bată și regulile :hover ale variantelor (orange / ghost / danger). */
.bo-btn:disabled, .bo-btn:disabled:hover, .bo-btn.orange:disabled:hover, .bo-btn.ghost:disabled:hover, .bo-btn.danger:disabled:hover {
    background: #dde2ea; color: var(--fc-muted); border-color: #cfd6e2; cursor: not-allowed; box-shadow: none;
}

/* Acțiunile din listele de documente (PDF | NIR): sloturi de lățime fixă, același contur → coloană simetrică.
   NIR de făcut = plin (mov), NIR existent / PDF = contur. */
.doc-act { display: grid; grid-auto-flow: column; grid-auto-columns: 86px; gap: 6px; justify-content: end; }
.doc-act-btn, .doc-act-gol { height: 28px; box-sizing: border-box; }
.doc-act-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid #c9d6e9; border-radius: 6px; background: #fff;
    color: var(--fc-ink); font-size: 0.8rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.doc-act-btn.doc-act-nou { background: var(--fc-accent); border-color: var(--fc-accent); color: #fff; }
.doc-act-btn.doc-act-ciorna { background: #eef1f6; border: 1px dashed #7d8db0; color: #2f3d58; }   /* NIR ciornă: aceeași culoare ca eticheta „Ciornă” */
@media (hover: hover) and (pointer: fine) {
    .doc-act-btn:hover { background: #eef3fa; }
    .doc-act-btn.doc-act-nou:hover { background: #6657e0; border-color: #6657e0; }
    .doc-act-btn.doc-act-ciorna:hover { background: #e2e7f0; }
}

.bo-table {
    /* separate (NU collapse) — `position:sticky` pe <th>/<thead> e instabil cu border-collapse:collapse. */
    width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
    border: 1px solid #e1e7ef; border-top: none;
    /* ⚠ FĂRĂ `overflow:hidden` aici! Pe tabel ar deveni scroll-container și ar rupe `position:sticky`
       de pe thead (header-ul fuge la scroll).
       border-top: none → chenarul de sus îl dă thead-ul (sticky), ca să nu scrolleze/dispară.
       FĂRĂ border-radius: colțul rotunjit al thead-ului lăsa un triunghi transparent prin care
       transpărea accentul portocaliu al rândului „brut SPV" la scroll (bleed). Colțuri drepte = thead acoperă complet. */
}
.bo-table th, .bo-table td {
    text-align: left; padding: 4px 14px; border-bottom: 1px solid #f0f2f5;
    font-size: 0.9rem; vertical-align: middle; color: var(--fc-ink);
}
.bo-table th {
    background: #f7f8fb; color: var(--fc-muted); font-weight: 700;
    font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px;
}
/* Capul de tabel ancorat sus în zona de scroll (.bo-page-body).
   box-shadow ține linia de jos (border-collapse o pierde la sticky). */
.bo-table thead { position: sticky; top: 0; z-index: 3; }
.bo-table thead th {
    position: relative;   /* containing block pt. resize-handle; sticky stă pe <thead> */
    border-top: 1px solid #e1e7ef;        /* chenarul de sus al tabelului — stă pe thead (sticky) → mereu vizibil */
    box-shadow: inset 0 -1px 0 #e1e7ef;   /* linia de jos a antetului */
}
/* Coloana „nume" (denumire produs/grupă) — vedetă: bold, mai închisă, puțin mai mare */
.bo-table td.bo-cell-name { font-weight: 700; color: var(--fc-ink); font-size: 0.94rem; }

/* Input „vedetă" în formular (ex. Denumire produs) — mai mare + îngroșat */
.bo-form-row input.bo-input-strong { font-size: 1.05rem; font-weight: 700; }
.bo-table tr:hover td { background: #f9fafd; }
/* Rând inactiv — clar vizibil: accent roșu + badge „INACTIV" lângă nume (fără italic). */
.bo-table tr.inactiv td { color: #8a90a8; background: #fdf3f2; }
.bo-table tr.inactiv:hover td { background: #fbe9e7; }
.bo-table tr.inactiv td:first-child { box-shadow: inset 3px 0 0 #e74c3c; }
.bo-table tr.inactiv td.bo-cell-name { color: #1a2744; font-style: normal; font-weight: 600; }
.bo-table tr.inactiv td.bo-cell-name::after {
    content: "Inactiv";
    display: inline-block; margin-left: 8px; vertical-align: middle;
    background: #fdecea; color: #c0392b; border: 1px solid #e6b0aa;
    font-size: 0.64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 1px 7px; border-radius: 10px;
}

/* ── DOCUMENTE (facturi intrare/ieșire etc.) — stare + color-coding ─────── */
/* Badge de stare în listă. */
.fac-badge {
    display: inline-block; padding: 2px 9px; border-radius: 10px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    white-space: nowrap; border: 1px solid transparent;
}
.fac-brut     { background: #fff3e0; color: #e65100; border-color: #ffcc80; } /* descărcat din SPV, neprocesat */
.fac-procesat { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; } /* document real înregistrat */
.fac-legat    { background: #fff8e1; color: #8a6100; border-color: #ffd54f; } /* recepționat cu un NIR introdus manual, legat apoi de factură */
.fac-total-nir { color: #c62828; font-size: 0.8em; font-weight: 600; white-space: nowrap; }       /* totalul NIR ≠ totalul facturii */
.fac-ciorna   { background: #eef1f6; color: #2f3d58; border: 1px dashed #7d8db0; } /* NIR salvat ca ciornă — nu e încă în stoc */
.fac-eroare   { background: #fdecea; color: #c0392b; border-color: #e6b0aa; }

/* ── Vânzări (bonuri POS + comenzi HORECA) ── */
.vz-anulat td { text-decoration: line-through; color: var(--fc-faint); }
.vz-anulat td .fac-badge { text-decoration: none; }
.vz-deschisa td { background: #fffaf0; }
.vz-badge-deschisa { margin-left: 6px; background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.vz-anulat td .fac-badge { margin-left: 6px; }
.vz-linie-anulata td { text-decoration: line-through; color: #c0392b; }
.vz-sumar .vz-plata, .vz-sumar .vz-nota { margin-left: 12px; white-space: nowrap; }
.vz-plata { color: var(--fc-muted); }
.vz-plata b, .vz-sumar > b { color: var(--fc-ink); }
.vz-nota { color: var(--fc-faint); }
.perioada { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.perioada-rapid { display: flex; flex-wrap: wrap; gap: 4px; }
.perioada-rapid .bo-btn.activ { background: var(--fc-indigo); color: #fff; border-color: var(--fc-indigo); }
.pv-total-row td { font-weight: 700; color: var(--fc-ink); background: #f4f6fb; border-top: 2px solid #c9d6e9; }
.pv-ambalaj { margin-left: 6px; }
@media (max-width: 768px) { .bo-table td.vz-gol { display: none; } }
.fac-ignorat  { background: #eceff1; color: #607d8b; border-color: #cfd8dc; }
/* Accent stânga pe rând după stare (rândul brut = portocaliu, eroare = roșu). */
.bo-table tr.fac-rand-brut   td:first-child { box-shadow: inset 3px 0 0 #fb8c00; }
.bo-table tr.fac-rand-ciorna td:first-child { box-shadow: inset 3px 0 0 #7d8db0; }   /* NIR ciornă */
.bo-table tr.fac-rand-eroare td:first-child { box-shadow: inset 3px 0 0 #e74c3c; }
.bo-table tr.fac-rand-eroare td { background: #fefafa; }
/* Rândul selectat în vederea split-screen (documentul ale cărui linii sunt afișate jos). */
.bo-table tr.doc-rand.selected td        { background: #e8eefc; }
.bo-table tr.doc-rand.selected:hover td  { background: #dfe8fb; }
.bo-table tr.doc-rand.selected td:first-child { box-shadow: inset 3px 0 0 var(--fc-indigo); }

/* ── DOCUMENTE — lățimi coloane: „conținut + o singură coloană flexibilă (Client)" ──
   Implicit (table-layout:auto): fiecare coloană = lățimea conținutului (Data nu scade sub „14.05.2026",
   Sumă/Index/Număr la fel — nowrap din `.bo-table td`). Coloana Client (Partener) primește width:100% →
   absoarbe restul spațiului și se redimensionează cu lățimea ecranului.
   După primul resize manual, JS adaugă clasa `.doc-fixed` (table-layout:fixed + lățimi px pe coloane);
   Client rămâne fără lățime → tot el absoarbe restul (responsive). */
/* Doar pe desktop (pe telefon tabelul devine carduri — vezi @media max-width:768px mai jos). */
@media (min-width: 769px) {
    .doc-table { table-layout: auto; min-width: 0; }
    .doc-table.doc-fixed { table-layout: fixed; }              /* JS comută aici după măsurarea lățimilor */
    .doc-table td[data-label] { max-width: none; }             /* auto-layout: conținutul dictează lățimea */
    .doc-table.doc-fixed td[data-label] { max-width: 0; }      /* fixed: lățimea din <th> (ellipsis pe depășire) */
    /* Rânduri goale la final (truc SAGA) — semnalează sfârșitul listei; ne-interactive. */
    .doc-table tr.doc-rand-gol td        { background: #fff; cursor: default; }
    .doc-table tr.doc-rand-gol:hover td  { background: #fff; }
}

/* ════════════════════════════════════════════════
   VEDERE SPLIT-SCREEN documente (sus lista / jos liniile) — ca SAGA
   ════════════════════════════════════════════════ */
/* În mod split, pagina nu mai pune body+paginare direct; .doc-split umple înălțimea rămasă. */
.doc-split { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.doc-pane  { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* Panoul de sus = lista (bo-page-body scrollează) + paginare fixă jos. */
.doc-pane-top .bo-page-body { flex: 1 1 auto; }
.doc-pane-top .bo-paginare  { padding-top: 8px; padding-bottom: 8px; }

/* Bara de tras dintre panouri. */
.doc-split-bar {
    flex: 0 0 9px; cursor: row-resize; position: relative;
    background: #eef1f7; border-top: 1px solid #dfe4ee; border-bottom: 1px solid #dfe4ee;
    display: flex; align-items: center; justify-content: center;
}
.doc-split-bar:hover { background: #e3e8f3; }
.doc-split-grip { width: 46px; height: 3px; border-radius: 3px; background: #b7c0d4; }
.doc-split-bar:hover .doc-split-grip { background: var(--fc-accent); }

/* Panoul de jos = antet compact + zona cu liniile (scroll propriu). */
.doc-pane-bottom { background: #fff; border: 1px solid #e1e7ef; border-radius: 8px; }
.doc-lines-head {
    flex: 0 0 auto; display: flex; align-items: baseline; gap: 10px;
    padding: 8px 14px; border-bottom: 1px solid #eef0f5; background: #f7f8fb;
    border-radius: 8px 8px 0 0;
}
.doc-lines-title { font-size: .9rem; color: var(--fc-ink); font-weight: 600; }
.doc-lines-title b { color: var(--fc-indigo); }
.doc-lines-part  { color: var(--fc-muted); font-weight: 500; }
.doc-lines-count { margin-left: auto; font-size: .76rem; color: var(--fc-muted); }
.doc-lines-hint  { font-size: .85rem; color: var(--fc-faint); font-style: italic; }
.doc-lines-body  { flex: 1 1 auto; min-height: 0; overflow: auto; }
.doc-lines-msg   { padding: 18px 16px; color: var(--fc-faint); font-size: .88rem; }
.doc-lines-msg.eroare { color: #c0392b; }

/* Tabelul de linii (simplu, fără resize — set fix „ca SAGA").
   table-layout:fixed + colgroup cu lățimi → coloanele NU se mai recalculează din conținut,
   deci rămân identice la schimbarea facturii (cerință user). */
.doc-lines-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.doc-lines-table th, .doc-lines-table td {
    padding: 5px 12px; border-bottom: 1px solid #f0f2f5; font-size: .86rem; color: var(--fc-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-lines-table thead th {
    position: sticky; top: 0; z-index: 2; background: #eef1f7; color: var(--fc-muted);
    font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; text-align: left;
}
.doc-lines-table td.num, .doc-lines-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-lines-table td.den { white-space: normal; font-weight: 600; color: var(--fc-ink); }
.doc-lines-table tbody tr:hover td { background: #f9fafd; }
.doc-lines-table tfoot td {
    position: sticky; bottom: 0; background: #f4f6fb; font-weight: 700; color: var(--fc-ink);
    border-top: 1px solid #dfe4ee; border-bottom: none;
}

/* Mobil: split-screen devine O SINGURA coloana care scrolleaza (NU 2 zone de scroll separate —
   imposibil de folosit pe touch; asta rupea scroll-ul). `.doc-split` = unicul scroller; panourile curg
   natural in interior; splitter-ul ascuns (nu se trage cu degetul). Tabelul de linii scrolleaza orizontal. */
@media (max-width: 768px) {
    .doc-split {
        flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .doc-split::-webkit-scrollbar { width: 0; height: 0; display: none; }
    .doc-split-bar { display: none; }
    .doc-pane { flex: none !important; overflow: visible; }
    .doc-pane-top { max-height: none; }
    .doc-pane-top .bo-page-body { overflow: visible; }          /* nu mai e scroller propriu → un singur scroll */
    /* (min-width:0 pe .bo-table e setat global la carduri, mai jos — fixeaza scroll-ul orizontal peste tot.) */
    .doc-pane-bottom { margin-top: 12px; }
    /* Tabelul de linii (9 coloane financiare) ramane scrollabil ORIZONTAL DOAR in panoul lui, nu tot blocul. */
    .doc-lines-body { overflow-x: auto; overflow-y: visible; }
    .doc-lines-table { min-width: 620px; }
}

/* ── PAGINARE (unificat, sub orice tabel BoTablePageBase) ───────────── */
.bo-paginare {
    flex: 0 0 auto;                            /* footer fix al paginii, jos de tot (nu intră în scroll) */
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: nowrap; gap: 10px;              /* stânga + dreapta MEREU pe un rând (nu se rup) */
    padding: 12px 2px 4px; margin-top: 6px;
    border-top: 1px solid #e6ebf3;             /* separator de zona scrollabilă de deasupra */
}
/* Grupurile (paginație stânga / nr-pagină dreapta) nu se micșorează și nu se rup pe rânduri. */
.bo-pag-nav, .bo-pag-size { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex: 0 0 auto; }
/* Mijlocul preia spațiul rămas și se trunchiază (max 2 rânduri) când nu încape. */
.bo-pag-mid { flex: 1 1 auto; min-width: 0; text-align: center; padding: 0 8px; }
.bo-pag-info {
    font-size: 0.78rem; color: var(--fc-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bo-pag-info .fac-badge { vertical-align: middle; }
/* Pe ecrane înguste micșorăm butoanele ca să încapă inline. */
@media (max-width: 600px) {
    .bo-pag-btn { min-width: 30px; height: 30px; padding: 0 6px; font-size: 0.82rem; }
    .bo-paginare { gap: 6px; }
    .bo-pag-mid { padding: 0 4px; }
}
.bo-pag-btn {
    min-width: 34px; height: 34px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--fc-ink, #1a2744);
    border: 1px solid #dfe5ee; border-radius: 8px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer; user-select: none;
    transition: background .12s, border-color .12s, color .12s;
}
.bo-pag-btn:hover:not(:disabled):not(.activ) { background: #f1f4fa; border-color: #c5cee0; }
.bo-pag-btn.activ {
    background: var(--fc-indigo, #39316e); border-color: var(--fc-indigo, #39316e); color: #fff; cursor: default;
}
.bo-pag-btn:disabled { opacity: .4; cursor: default; }

/* ── TOGGLE SWITCH (Activ) ─────────────────────── */
.bo-switch { position: relative; display: inline-block; width: 42px; height: 23px; cursor: pointer; vertical-align: middle; }
.bo-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.bo-switch .slider {
    position: absolute; inset: 0; background: #cfd3e0; border-radius: 23px; transition: background .15s;
}
.bo-switch .slider::before {
    content: ''; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.bo-switch input:checked + .slider { background: var(--fc-indigo); }
.bo-switch input:checked + .slider::before { transform: translateX(19px); }
/* Switch bazat pe clasă (model) — folosit de BoRowActions (fără checkbox necontrolat). */
.bo-switch.on .slider { background: var(--fc-indigo); }
.bo-switch.on .slider::before { transform: translateX(19px); }

/* Buton-icon discret pentru acțiuni de rând (editare etc.) */
.bo-icon-act {
    background: transparent; border: 0; color: var(--fc-muted); cursor: pointer;
    font-size: 1.05rem; padding: 5px 8px; border-radius: 7px; line-height: 1; transition: background .12s, color .12s;
}
.bo-icon-act:hover { background: #eef0f6; color: var(--fc-ink); }
.bo-icon-act.danger { color: #c62828; }
.bo-icon-act.danger:hover { background: #fdecea; color: #a52020; }
.bo-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.bo-table .col-act { text-align: right; white-space: nowrap; }

/* Header sortabil + draggable (rearanjare coloane) */
.bo-table th.sortable {
    cursor: pointer; user-select: none;
    /* position:sticky vine din `.bo-table thead th` — oferă și containing block pt. resize-handle */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bo-table th .resize-handle {
    position: absolute; top: 0; right: 0; bottom: 0; width: 6px;
    cursor: col-resize; user-select: none; z-index: 2;
}
.bo-table th .resize-handle:hover { background: #e65100; opacity: 0.35; }
.bo-table td {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0;
}
.bo-table td.col-act, .bo-table th.col-act {
    overflow: visible; max-width: none; white-space: nowrap;
}
.bo-table th.sortable:hover { background: #eef2f8; }
.bo-table th.sortable.dragging   { opacity: 0.4; }
.bo-table th.sortable.drop-target { box-shadow: inset 4px 0 0 #e65100; }
.bo-table th .sort-arrow { margin-left: 4px; color: #e65100; font-size: 0.7rem; font-weight: 700; }
.bo-table tbody tr { cursor: pointer; }

/* ── MODAL EDITARE ────────────────────────────── */
.bo-modal-bg {
    position: fixed; inset: 0; height: 100dvh; background: rgba(26,39,68,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    overflow: hidden; overscroll-behavior: contain; touch-action: none;
}
.bo-modal {
    background: #fff; border-radius: 10px; padding: 0;
    min-width: 480px; max-width: 640px; max-height: 90dvh;
    display: flex; flex-direction: column; overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overscroll-behavior: contain;
}
html:has(.bo-modal-bg),
body:has(.bo-modal-bg) { overflow: hidden !important; height: 100% !important; }

/* Modal suprapus (ex. alocări custom peste editorul de gestiune) */
.bo-modal-bg-top { z-index: 1400; background: rgba(26,39,68,0.35); }

/* Bară de progres (ex. descărcare SPV) */
.bo-progress {
    height: 12px; background: #e1e7ef; border-radius: 7px; overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.bo-progress-fill {
    height: 100%; background: linear-gradient(90deg, #e65100, #ff9800);
    border-radius: 7px; transition: width .2s ease;
}
.bo-progress-fill.indet {
    width: 35%; animation: boIndet 1.1s ease-in-out infinite;
}
@keyframes boIndet {
    0%   { margin-left: -35%; }
    100% { margin-left: 100%; }
}

/* Indicator servicii de fundal (topbar) */
.fc-bg-wrap { position: relative; display: inline-flex; align-items: center; }
.fc-bg-on { color: #ff9800 !important; }
.fc-bg-spin { display: inline-block; font-size: 18px; line-height: 1; animation: fcSpin 1s linear infinite; }
@keyframes fcSpin { to { transform: rotate(360deg); } }
.fc-bg-mini {
    font-size: 0.72rem; font-weight: 700; color: #ff9800; margin-left: -2px;
    background: rgba(255,152,0,.15); padding: 1px 6px; border-radius: 9px;
}
.fc-bg-menu {
    position: absolute; right: 0; top: 46px; width: 320px; z-index: 90;
    background: #fff; border: 1px solid var(--fc-line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20,12,50,.28); overflow: hidden;
}
.fc-bg-row { padding: 10px 14px; border-bottom: 1px solid var(--fc-line); }
.fc-bg-row-top { display: flex; justify-content: space-between; align-items: center; }
.fc-bg-name { font-weight: 700; color: var(--fc-ink); font-size: 0.9rem; }
.fc-bg-sub { font-size: 0.78rem; color: var(--fc-muted); margin-top: 2px; }
.fc-bg-badge { font-size: 0.68rem; font-weight: 700; padding: 1px 8px; border-radius: 9px; background: #eef3fa; color: var(--fc-muted); }
.fc-bg-run {
    margin-top: 7px; width: 100%; padding: 6px 10px; border-radius: 7px; cursor: pointer;
    background: var(--fc-indigo, #39316e); color: #fff; border: 0; font-size: 0.8rem; font-weight: 600;
}
.fc-bg-run:hover:not(:disabled) { filter: brightness(1.1); }
.fc-bg-run:disabled { opacity: .45; cursor: default; }
.fc-bg-badge.run { background: rgba(255,152,0,.18); color: #e65100; }
.fc-bg-badge.ok  { background: #e8f5e9; color: #2e7d32; }
.fc-bg-badge.err { background: #ffebee; color: #c62828; }

/* Header ancorat sus (titlu + tab-uri), footer ancorat jos (acțiuni), scroll doar la mijloc. */
.bo-modal > h2 {
    flex: 0 0 auto; margin: 0; font-size: 1.2rem; color: var(--fc-ink);
    padding: 20px 24px 14px;
}
.bo-modal > .bo-tabs { flex: 0 0 auto; margin: 0; padding: 0 24px; }
.bo-modal-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 14px 24px;
    touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
/* Mesaje care rămân în zona header (ex. eroare deasupra tab-urilor) — primesc padding propriu */
.bo-modal > .bo-msg-eroare,
.bo-modal > .bo-msg-ok { flex: 0 0 auto; margin: 0 24px 10px; }

/* ── TAB-URI ÎN MODAL ────────────────────────── */
.bo-tabs { display: flex; gap: 4px; border-bottom: 2px solid #eef3fa; margin: 0 0 16px; }
.bo-tab {
    background: none; border: none; border-bottom: 3px solid transparent;
    padding: 8px 16px; margin-bottom: -2px; font-size: 0.9rem; font-weight: 600;
    color: var(--fc-muted); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.bo-tab:hover { color: var(--fc-ink); }
.bo-tab.active { color: var(--fc-accent); border-bottom-color: var(--fc-accent); }

/* ── INPUT NUMERIC CU − / + ─────────────────── */
.bo-num-input {
    display: flex; align-items: center; flex: 1;
    border: 1px solid #d4dce8; border-radius: 6px; overflow: hidden; background: #fff;
}
.bo-num-input input {
    flex: 1; border: none; text-align: center; padding: 8px 6px;
    font-size: 0.95rem; font-variant-numeric: tabular-nums; outline: none; min-width: 0;
}
.bo-num-btn {
    background: #f4f7fb; border: none; color: var(--fc-ink);
    font-size: 1.2rem; font-weight: 700; width: 38px; height: 38px;
    cursor: pointer; line-height: 1; transition: background 0.1s;
}
.bo-num-btn:hover { background: #e1e7ef; }
.bo-num-btn:active { background: #d4dce8; }

/* ── DROPDOWN MULTI-LINE LOOKUP (cod vamal, CPV) ──── */
.bo-multi-lookup { position: relative; display: flex; flex-direction: column; }
.bo-multi-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border: 1px solid #d4dce8; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18); max-height: 320px; overflow-y: auto;
    z-index: 20; margin-top: 2px;
}
.bo-multi-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 6px 12px;
    border-bottom: 1px solid #f0f3f7; cursor: pointer; font-size: 0.85rem;
    min-height: 48px; box-sizing: border-box;
}
.bo-multi-item:hover { background: #fff3e0; }
.bo-multi-code {
    flex: 0 0 auto; color: #e65100; font-weight: 600; font-family: monospace;
    white-space: nowrap; padding-top: 2px;
}
.bo-multi-desc {
    flex: 1; color: var(--fc-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.35; word-break: break-word;
}
.bo-form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bo-form-row label { flex: 0 0 140px; font-weight: 600; font-size: 0.85rem; color: #444; }
.bo-form-row input, .bo-form-row select, .bo-form-row textarea {
    flex: 1; padding: 7px 10px; border: 1px solid #c9d6e9; border-radius: 6px;
    font-size: 0.9rem; font-family: inherit;
}
.bo-form-row textarea { min-height: 60px; resize: vertical; }
.bo-form-row input[type=checkbox] { flex: 0 0 18px; width: 18px; height: 18px; }

/* Ascuns implicit; afișat doar în media query-ul de telefon (≤768px) */
.mobile-only { display: none; }

.bo-modal-actions {
    flex: 0 0 auto;
    display: flex; gap: 10px; justify-content: flex-end;
    margin: 0; padding: 14px 24px; border-top: 1px solid #f0f2f5;
    background: #fff; border-radius: 0 0 10px 10px;
}

/* ── Mapare cote TVA → cod casă (în editorul de gestiune) ── */
.bo-tva-map {
    margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f2f5;
}
.bo-tva-map-head { font-weight: 700; color: var(--fc-ink); font-size: 0.95rem; margin-bottom: 4px; }
.bo-tva-map-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bo-tva-map-cota {
    flex: 0 0 64px; font-weight: 700; color: var(--fc-ink);
    font-variant-numeric: tabular-nums; text-align: right;
}
.bo-tva-map-arrow { flex: 0 0 auto; color: var(--fc-muted); }
.bo-tva-map-input {
    flex: 0 0 80px; padding: 7px 10px; border: 1px solid #c9d6e9; border-radius: 6px;
    font-size: 0.95rem; font-family: monospace; text-align: center;
}

/* ── Mapări gestiune → casă (rânduri per cotă + excepții) ── */
.bo-map-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.bo-map-cota {
    flex: 0 0 56px; font-weight: 700; color: var(--fc-ink);
    font-variant-numeric: tabular-nums; text-align: right;
}
.bo-map-dep      { flex: 1 1 150px; min-width: 130px; }
.bo-map-tva      { flex: 0 0 78px; }
.bo-map-scope    { flex: 0 0 92px; }
.bo-map-scopeval { flex: 1 1 140px; min-width: 120px; }
.bo-map-row select, .bo-map-num {
    padding: 6px 9px; border: 1px solid #c9d6e9; border-radius: 6px;
    font-size: 0.9rem; background: #fff; color: var(--fc-ink);
}
.bo-map-num { flex: 0 0 62px; font-family: monospace; text-align: center; }
.bo-map-lbl { flex: 0 0 auto; font-size: 0.74rem; color: var(--fc-muted); }
.bo-map-exc-head {
    margin: 14px 0 8px; font-weight: 700; color: var(--fc-ink); font-size: 0.88rem;
}
.bo-map-exc-head .bo-page-hint { display: inline; margin-left: 6px; font-weight: 400; }
/* Card alocare custom (excepție) — 2 linii: scope sus, cotă+departament jos */
.bo-map-exc-card { background: #f7f9fc; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.bo-map-exc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bo-map-exc-line.sub { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #dde4ee; }
.bo-map-exc-for { font-size: 0.84rem; font-weight: 600; color: var(--fc-ink); }
.bo-map-exc-line .bo-map-del { margin-left: auto; }
.bo-map-del {
    flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
    font-size: 1rem; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.bo-map-del:hover { background: #fdecec; }
.bo-map-add { margin-top: 4px; }

.bo-msg-eroare {
    background: #ffebee; color: #c62828; padding: 10px 14px;
    border-radius: 6px; margin-bottom: 12px; font-size: 0.88rem;
}
.bo-msg-ok {
    background: #e8f5e9; color: #2e7d32; padding: 10px 14px;
    border-radius: 6px; margin-bottom: 12px; font-size: 0.88rem;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — tabletă (≤ 1024px) + telefon (≤ 768px)
   ════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .fc-dash-grid { grid-template-columns: 1fr; }
    .fc-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* Buton vizibil DOAR pe mobil (≤600px) — ex. lupa care deschide căutarea */
.show-sm { display: none; }

@media (max-width: 600px) {
    .fc-search, .hide-sm { display: none; }
    .show-sm { display: inline-flex; }
    /* Lupa deschide câmpul de căutare ca bară full-width sub topbar */
    .fc-search.fc-search-mobile-on {
        display: flex; position: fixed; top: var(--fc-top); left: 8px; right: 8px;
        margin: 0; max-width: none; z-index: 1205;
        background: var(--fc-side); box-shadow: 0 10px 28px rgba(0,0,0,.4);
    }
}

@media (max-width: 768px) {
    /* Shell devine o coloană; rail-ul off-canvas */
    .fc-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "top" "main";
    }
    .fc-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 264px; height: 100vh; transform: translateX(-100%);
        transition: transform 0.25s ease; z-index: 1200;
        box-shadow: 4px 0 16px rgba(0,0,0,0.3);
    }
    .fc-shell.mobile-open .fc-sidebar { transform: translateX(0); }
    .fc-rail-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1150; }

    /* Pe mobil rail-ul e off-canvas la lățime plină — afișăm MEREU textele,
       chiar dacă starea `collapsed` e activă (hamburgerul o comută și pe mobil). */
    .fc-shell.collapsed .fc-rail-label { display: block; }
    .fc-shell.collapsed .fc-rail-chev  { display: inline-flex; }
    .fc-shell.collapsed .fc-rail-item  { justify-content: flex-start; padding: 10px 12px; }

    /* Flyout full-screen peste rail */
    .fc-flyout {
        top: 0; left: 0; width: 264px; height: 100vh; z-index: 1300;
    }
    .fc-flyout-scrim { top: 0; left: 0; z-index: 1290; }
    .fc-flyout-back { display: inline-flex; }

    .fc-toolbar { padding: 10px 16px 4px; }
    .fc-toolbar-firm { font-size: 0.95rem; }
    .fc-main { padding: 10px 16px 24px; }

    .fc-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .fc-kpi { padding: 14px; }
    .fc-kpi-val { font-size: 1.35rem; }

    .bo-page h1 { font-size: 1.25rem; }
    .bo-page-hint { font-size: 0.85rem; margin-bottom: 16px; }

    .bo-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .bo-toolbar input { max-width: none; }

    /* ── Tabel → carduri pe telefon ───────────────────── */
    /* Ascunde bara de scroll (apare ca o dungă pe dreapta pe telefon/WebView); scroll-ul touch rămâne. */
    .fc-main, .bo-page-body, .bo-modal-body {
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .fc-main::-webkit-scrollbar,
    .bo-page-body::-webkit-scrollbar,
    .bo-modal-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

    /* La CARDURI tabelul nu mai e grid → anulam min-width-ul inline pus de bo-table.js (~nrCol*95px,
       fallback de scroll pe desktop) care altfel latea cardurile peste ecran si dadea scroll orizontal. */
    .bo-table { background: transparent; border: none; border-radius: 0; font-size: 0.85rem; min-width: 0 !important; }
    .bo-table thead { display: none; }
    .bo-table tbody, .bo-table tr, .bo-table td { display: block; width: 100%; }
    .bo-table tr {
        background: #fff; border: 1px solid #e1e7ef; border-radius: 8px;
        margin-bottom: 8px; padding: 2px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    .bo-table tr:hover td { background: #fff; }
    .bo-table td {
        position: relative; padding: 4px 14px 4px 45%; text-align: right;
        border-bottom: 1px solid #f4f7fb;
        max-width: none; overflow: visible; white-space: normal; word-break: break-word;
        /* min-height ca eticheta (poziționată absolut) să încapă chiar și când valoarea e goală */
        min-height: 1.7rem;
    }
    .bo-table td:last-child { border-bottom: none; }
    .bo-table td::before {
        content: attr(data-label); position: absolute; left: 14px; top: 4px;
        width: 40%; font-size: 0.72rem; font-weight: 700; color: var(--fc-muted);
        text-transform: uppercase; letter-spacing: 0.4px; text-align: left;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* Pe telefon ascundem coloanele mai puțin relevante din cardul de produs */
    .bo-table td[data-label="Preț fără TVA"],
    .bo-table td[data-label="Ultim preț achiziție"] { display: none; }

    /* Produse pe telefon: ordine FIXĂ Denumire / Cod / UM+Grupa / Preț cu TVA
       (indiferent de ordinea coloanelor — pe telefon nu se pot trage). */
    .bo-table td[data-label="Denumire"]    { order: 1; }
    .bo-table td[data-label="Cod"]         { order: 2; }
    .bo-table td[data-label="UM"]          { order: 3; }
    .bo-table td[data-label="Grupa"]       { order: 4; }
    .bo-table td[data-label="Preț cu TVA"] { order: 5; }

    /* Denumirea (coloana-nume) = TITLUL cardului pe telefon: sus, lățime plină, bold, fără etichetă.
       Se aplică la toată clasa (gestiuni, departamente, grupuri, produse, parteneri...). */
    .bo-table td.bo-cell-name {
        order: -1; flex: 0 0 100%;
        padding: 8px 14px 6px; text-align: left;
        font-size: 1.02rem; font-weight: 700; color: var(--fc-ink);
        border-bottom: 1px solid #eef2f7; min-height: 0;
    }
    .bo-table td.bo-cell-name::before { display: none; }
    /* UM + Grupa pe ACELAȘI rând, compacte (etichetă lângă valoare) */
    /* Fiecare umple jumătate (fără spațiu gol între ele, ca să nu se vadă culoarea la swipe).
       UM = text stânga, Grupa = text dreapta. */
    .bo-table td[data-label="UM"],
    .bo-table td[data-label="Grupa"] {
        flex: 1 1 0; min-height: 0; padding: 3px 14px; border-bottom: none;
    }
    .bo-table td[data-label="UM"]    { text-align: left; }
    .bo-table td[data-label="Grupa"] { text-align: right; }
    .bo-table td[data-label="UM"]::before,
    .bo-table td[data-label="Grupa"]::before {
        position: static; display: inline; width: auto; top: auto; left: auto;
        margin-right: 5px;
    }

    /* Pe telefon NU arătăm butoanele — rămân în DOM (ascunse) ca să fie click-uite de swipe.
       Swipe stânga = ștergere, swipe dreapta = inactivare, dublu-tap = editare. */
    .bo-table td.col-act { display: none; }

    /* Documente (facturi): swipe-ul e dezactivat → arătăm acțiunile (PDF) în card; ascundem rândurile goale. */
    .doc-table tr.doc-rand-gol { display: none; }
    .doc-table td.col-act {
        display: block;
        padding: 8px 14px; border-bottom: none;
    }
    /* Card: PDF stânga, NIR dreapta, ținte de deget. */
    .doc-table .doc-act { grid-auto-columns: 1fr; justify-content: stretch; gap: 10px; }
    .doc-table .doc-act-btn, .doc-table .doc-act-gol { height: 40px; }
    .doc-table .doc-act-btn { font-size: 0.9rem; }

    /* Swipe: cardul urmează degetul; în spate apar etichetele
       „Ștergere 🗑" (la swipe stânga, dreapta) / „⏸ Inactivare" (la swipe dreapta, stânga). */
    .bo-table tbody tr { will-change: transform; position: relative; overflow: hidden;
        display: flex; flex-wrap: wrap; align-items: baseline; }   /* card = flex-wrap (pt. order + inline) */
    .bo-table tr.swiping { transition: none !important; }
    .bo-table tbody td { background: #fff; position: relative; z-index: 1; flex: 0 0 100%; }   /* implicit: rând întreg; acoperă etichetele */
    .bo-table tbody tr::before,
    .bo-table tbody tr::after {
        position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 0;
        display: none; align-items: center; color: #fff; font-weight: 700;
        font-size: 0.95rem; padding: 0 20px; letter-spacing: .3px;
        /* Fixe în <tr> (care nu se mișcă); td-urile alunecă deasupra și le „descoperă". */
    }
    .bo-table tbody tr::after  { content: "Ștergere 🗑"; justify-content: flex-end;   background: #c62828; }
    .bo-table tbody tr::before { content: "⏸ Inactivare"; justify-content: flex-start; background: #2f2860; }
    .bo-table tbody tr.swipe-left::after   { display: flex; }
    .bo-table tbody tr.swipe-right::before { display: flex; }
    .bo-table td[colspan] { padding: 24px 12px; text-align: center; background: #fff; border-radius: 8px; }
    .bo-table td[colspan]::before { display: none; }
    .bo-table th .resize-handle { display: none; }

    /* Modal full-screen pe telefon */
    .bo-modal {
        min-width: 0; width: calc(100vw - 24px); max-height: calc(100dvh - 24px);
        padding: 0; border-radius: 8px;
    }
    .bo-modal > h2 { font-size: 1.05rem; padding: 16px 16px 10px; }
    .bo-modal > .bo-tabs { padding: 0 16px; }
    .bo-modal-body { padding: 10px 16px; }
    .bo-modal-actions { padding: 12px 16px; }
    .bo-form-row { flex-direction: column; align-items: stretch; gap: 4px; }
    .bo-form-row label { flex: 0 0 auto; font-size: 0.78rem; }
    .bo-modal-actions { flex-direction: column-reverse; }
    .bo-modal-actions .bo-btn { width: 100%; }
    .bo-table .bo-btn.sm { padding: 4px 6px; font-size: 0.72rem; }
}

/* Touch-friendly: pe ecrane fără hover, mărim suprafețele clickabile */
@media (hover: none) and (pointer: coarse) {
    .fc-rail-item { padding: 12px; }
    .fc-flyout-item { padding: 12px 18px; }
}

/* iOS PWA „Adaugă pe ecranul de start" (standalone): conținutul ar intra sub bara de stare
   (ceas/semnal) și ar lăsa spațiu alb jos. Tratăm safe-area: topbar-ul navy se extinde sub
   status bar (text alb pe navy), conținutul stă dedesubt; jos lăsăm loc de home indicator.
   --fc-top crește cu inset → topbar + barele fixe (top: var(--fc-top)) + grid-ul se aliniază. */
@media (display-mode: standalone) {
    /* status bar = `black` → iOS rezervă bara de stare. Doar insetul de jos (home indicator) pe ROOT.
       FĂRĂ background colorat aici: .fc-main e transparentă, deci un bg pe shell ar colora tot conținutul. */
    .fc-shell { padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }
}


/* ════════════════════ RBAC — editor drepturi roluri ════════════════════ */
.rbac-toggle { display:flex; align-items:center; gap:8px; font-weight:600; cursor:pointer; }
.rbac-toggle .rbac-hint { color:var(--fc-muted); font-weight:400; font-size:0.85rem; }
.rbac-grid { display:flex; flex-direction:column; gap:2px; margin-top:6px;
    max-height:46vh; overflow-y:auto; border:1px solid #e3e6ef; border-radius:8px; padding:10px 12px; background:#fafbff; }
.rbac-modul { font-weight:700; color:var(--fc-indigo); text-transform:uppercase; font-size:0.78rem;
    letter-spacing:.5px; margin:10px 0 2px; border-bottom:1px solid #e3e6ef; padding-bottom:4px; }
.rbac-modul:first-child { margin-top:0; }
.rbac-grup { font-weight:600; color:var(--fc-ink); font-size:0.82rem; margin:6px 0 2px; }
.rbac-drept { display:flex; align-items:center; gap:8px; padding:3px 0 3px 10px; cursor:pointer; font-size:0.9rem; }
.rbac-drept input { width:17px; height:17px; cursor:pointer; }
.rbac-exc-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:3px 0 3px 10px; font-size:0.9rem; }
.rbac-exc-row select { flex:0 0 auto; padding:3px 6px; border:1px solid #ccd3e0; border-radius:6px; }

/* ════════════════════ Jurnal de activitate ════════════════════ */
.jrn-filtre { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:8px; }
.jrn-filtre .bo-input { width:auto; }
.jrn-filtre label { display:flex; align-items:center; gap:4px; font-size:0.85rem; color:var(--fc-muted); }
.jrn-actiune { font-size:0.74rem; font-weight:700; padding:2px 8px; border-radius:10px; background:#eef0f7; color:var(--fc-ink); white-space:nowrap; }
.jrn-actiune.jrn-del   { background:#fde8e8; color:#b3261e; }
.jrn-actiune.jrn-add   { background:#e6f4ea; color:#1e7d34; }
.jrn-actiune.jrn-inact { background:#fff3e0; color:#9a5a00; }
.jrn-det { display:flex; flex-direction:column; gap:4px; margin-bottom:12px; font-size:0.92rem; }
.jrn-diff { width:100%; border-collapse:collapse; font-size:0.9rem; }
.jrn-diff th, .jrn-diff td { border:1px solid #e3e6ef; padding:6px 10px; text-align:left; }
.jrn-diff th { background:#f4f5f9; }
.jrn-diff .jrn-vechi { color:#b3261e; }
.jrn-diff .jrn-nou   { color:#1e7d34; }
.jrn-raw { background:#f4f5f9; padding:10px; border-radius:8px; font-size:0.82rem; overflow:auto; }

/* ── Badge bancă (BancaLogo) ─────────────────────────────────────────
   Monogramă pe fundal de brand. Culorile vin din BanciRomania; aici doar forma.
   NU e logo oficial — vezi comentariul din BanciRomania.cs.                     */
.banca-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 7px;
    font-weight: 800;
    letter-spacing: .3px;
    line-height: 1;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08);
    user-select: none;
}

/* Badge + text pe același rând (celule de tabel, linii de formular) */
.banca-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.banca-cell > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Logo real (fisier in /img/banci) — fundal alb ca logo-urile transparente sa nu se piarda */
.banca-logo-img {
    object-fit: contain;
    background: #fff;
    padding: 2px;
    box-sizing: border-box;
}

/* ── Câmp obligatoriu lipsă la o acțiune (ex. Conectare SPV → Email la contabil fără adresă) ──
   Rândul vibrează scurt + bulă „Completează aici” deasupra câmpului. Bula stă deasupra, nu peste conținut → merge și pe telefon. */
@keyframes bo-shake {
    0%, 100% { transform: translateX(0); }
    15%, 55% { transform: translateX(-7px); }
    35%, 75% { transform: translateX(7px); }
}
.bo-shake { animation: bo-shake .42s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { .bo-shake { animation: none; } }
.bo-camp-cu-bula { position: relative; flex: 1; min-width: 0; display: flex; }
.bo-camp-cu-bula > input { flex: 1; min-width: 0; }
.bo-input-atentie { border-color: #e8710a !important; box-shadow: 0 0 0 3px rgba(232, 113, 10, .18); }
.bo-bula-camp {
    position: absolute; left: 10px; bottom: calc(100% + 8px); z-index: 5;
    background: #e8710a; color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap;
    padding: 6px 10px; border-radius: 6px; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); pointer-events: none;
}
.bo-bula-camp::after {
    content: ""; position: absolute; left: 16px; top: 100%;
    border: 6px solid transparent; border-top-color: #e8710a;
}

/* ════════════════════════════════════════════════
   RECEPȚII (NIR) — editor + stoc
   ════════════════════════════════════════════════ */
.nir-page .bo-page-head > .bo-page-hint { max-width: 70%; }
.nir-avert { flex: 0 0 100%; margin-top: 6px !important; background: #fff8e1; color: #8a5a00; border-color: #ffe08a; }
.nir-body { display: flex; flex-direction: column; gap: 14px; }
.nir-antet {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px;
    background: #fff; border: 1px solid #e1e7ef; border-radius: 8px; padding: 14px;
}
.nir-camp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nir-camp label { font-weight: 600; font-size: 0.78rem; color: var(--fc-muted); }
/* Aceeași înălțime pentru input, select și DatePicker (select-ul și calendarul aveau altă înălțime nativă). */
.nir-camp input, .nir-camp select {
    width: 100%; height: 36px; box-sizing: border-box; padding: 0 9px;
    border: 1px solid #ccd5e2; border-radius: 6px; background: #fff;
    font-size: 0.92rem; font-weight: 400; color: var(--fc-ink); font-family: inherit;
}
.nir-camp .dp, .nir-camp .dp-field { display: flex; width: 100%; }
.nir-camp .dp-input { padding-right: 32px; text-align: left; }
.nir-camp-lat { grid-column: span 2; }
.nir-obs { max-width: 900px; }
.nir-linii-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nir-linii-head h2 { margin: 0; font-size: 1.05rem; color: var(--fc-ink); }
.nir-nr { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: #eef1f5; color: var(--fc-muted); font-size: 0.8rem; text-align: center; }
.nir-neasoc { color: #e65100; font-weight: 700; font-size: 0.85rem; }

.nir-table td { max-width: none; overflow: visible; white-space: normal; vertical-align: top; padding-top: 6px; padding-bottom: 6px; }
.nir-table th { white-space: normal; }
.nir-table th, .nir-table td { padding-left: 6px; padding-right: 6px; }
.nir-table tbody tr { cursor: default; }
.nir-table td.nir-cell-produs { min-width: 200px; }
.nir-table tr.nir-rand-neasoc td { background: #fffaf2; }
.nir-table tr.nir-rand-neasoc td:first-child { box-shadow: inset 3px 0 0 #fb8c00; }
.nir-table tr.nir-rand-adauga td { background: #fafbfd; }
.nir-num { width: 78px; box-sizing: border-box; padding: 5px 7px; border: 1px solid #ccd5e2; border-radius: 5px; text-align: right; font-size: 0.9rem; background: #fff; }
.nir-num-mic { width: 58px; }
.nir-num:disabled { background: #f3f5f8; color: #6b7188; }
.nir-pret-nou { border-color: #e8710a; background: #fff4e8; font-weight: 700; }
.nir-prod { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
/* EVIDENTA DUPA CODURI: codul principal pe rândul denumirii, împins la DREAPTA (margin-left:auto), nu lipit de denumire. */
.nir-edit-prod { flex: 0 0 auto; border: none; background: transparent; color: var(--fc-accent); font-size: 1rem; line-height: 1;
                 padding: 2px 4px; margin: -2px 0; border-radius: 5px; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .nir-edit-prod:hover { background: #f1effe; } }
@media (max-width: 768px) { .nir-edit-prod { padding: 8px 10px; margin: -8px -4px; } }   /* țintă mai mare pe touch */
.nir-prod.nir-prod-cu-cod { flex-wrap: nowrap; }
.nir-prod.nir-prod-cu-cod > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nir-cod-prod { margin-left: auto; padding-left: 12px; font-family: monospace; font-size: 0.86rem; letter-spacing: 0.3px; color: var(--fc-muted); white-space: nowrap; }
@media (max-width: 768px) { .nir-prod.nir-prod-cu-cod { flex-wrap: wrap; } }
/* Corecturi obligatorii înainte de validarea NIR: chenar roșu (fără cod / preț de stoc 0 / adaos în afara limitei). */
.nir-cod-prod.nir-cod-lipsa { color: #c62828; font-weight: 700; border: 1.5px solid #e53935; background: #fdecea; border-radius: 6px;
                              padding: 2px 8px; cursor: pointer; user-select: none; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .nir-cod-prod.nir-cod-lipsa:hover { background: #fbd9d5; } }
@media (max-width: 768px) { .nir-cod-prod.nir-cod-lipsa { padding: 8px 10px; } }
.nir-num.nir-camp-rosu { border: 1.5px solid #e53935 !important; background: #fdecea !important; color: #c62828; }
.nir-potr { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; color: #2e7d32; background: #e8f5e9; border-radius: 8px; padding: 1px 6px; }
.nir-sgr { color: #0b6b5e; background: #e0f2f1; margin-right: 4px; }
.nir-furn { font-size: 0.74rem; color: var(--fc-muted); font-weight: 400; margin-top: 2px; }
.nir-neasoc-txt { color: #e65100; font-weight: 700; font-size: 0.8rem; margin-bottom: 4px; }
.nir-asociere { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.nir-asociere .bo-multi-lookup { flex: 1 1 220px; }
.nir-asociere input, .nir-rand-adauga input { width: 100%; box-sizing: border-box; padding: 6px 9px; border: 1px solid #ccd5e2; border-radius: 6px; font-size: 0.9rem; }
.nir-link { background: none; border: none; color: #2b4ea2; cursor: pointer; font-size: 0.76rem; padding: 0; text-decoration: underline; }
.bo-multi-item-activ { background: #fff3e0; }

.nir-footer {
    /* Cadru ca antetul, ridicat de pe marginea ecranului (fc-main n-are padding jos pe paginile .bo-page). */
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid #e1e7ef; border-radius: 8px; padding: 10px 14px;
    margin: 8px 0 18px;
}
.nir-totaluri { display: flex; gap: 18px; flex-wrap: wrap; }
.nir-totaluri div { display: flex; flex-direction: column; }
.nir-totaluri span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .4px; color: var(--fc-muted); font-weight: 700; }
.nir-totaluri strong { font-size: 1.05rem; color: var(--fc-ink); }
.nir-totaluri .nir-dif strong { color: #c62828; }
.nir-totaluri .nir-ok strong  { color: #2e7d32; }
.nir-actiuni { display: flex; gap: 8px; flex-wrap: wrap; }
/* Starea salvării automate a ciornei: discretă, lângă butoane; roșu doar când pică / nu se poate salva. */
.nir-auto { align-self: center; font-size: 0.78rem; color: var(--fc-muted); white-space: nowrap; margin-right: 4px; }
.nir-auto-err { color: #c62828; font-weight: 600; white-space: normal; max-width: 420px; }
.nir-auto-ok { color: #2e7d32; font-weight: 600; }
.nir-auto-info { color: var(--fc-ink); white-space: normal; max-width: 360px; }
/* NIR validat = doar citire. Fieldset-ul nu schimbă layout-ul (display: contents), doar dezactivează câmpurile; clicurile pe
   antet / tabel (calendare, celule cu dublu-click) sunt oprite — derularea merge (evenimentele trec la containerul părinte). */
.nir-fs { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
.nir-doc-blocat .nir-antet, .nir-doc-blocat .nir-table, .nir-doc-blocat .nir-obs { pointer-events: none; }
.nir-doc-blocat .nir-table input:disabled, .nir-doc-blocat .nir-antet input:disabled, .nir-doc-blocat .nir-antet select:disabled { opacity: 1; }

.stoc-gest { padding: 7px 9px; border: 1px solid #ccd5e2; border-radius: 6px; font-size: 0.9rem; min-width: 180px; }
.stoc-metoda { font-size: 0.62rem; font-weight: 700; color: var(--fc-muted); margin-left: 4px; }
.bo-table tr.stoc-negativ td { color: #c62828; }

@media (max-width: 768px) {
    .nir-page .bo-page-head > .bo-page-hint { max-width: none; margin-left: 0; text-align: left; }
    .nir-antet { grid-template-columns: 1fr 1fr; padding: 10px; }
    .nir-camp-lat { grid-column: 1 / -1; }
    /* Linia NIR ca card: produsul = titlu, câmpurile numerice cu etichetă la stânga; ștergerea rămâne vizibilă. */
    .nir-table td { padding: 5px 14px 5px 45%; }
    .nir-table td.nir-cell-produs { min-width: 0; padding: 8px 14px 6px; }
    .nir-table td.col-act { display: flex; justify-content: flex-end; padding: 4px 14px; }
    .nir-table tr.nir-rand-adauga td[data-label="#"] { display: none; }
    .nir-table tr.nir-rand-adauga td { padding: 8px 10px; }
    .nir-table tr.nir-rand-adauga td::before { display: none; }
    .nir-num { width: 120px; font-size: 1rem; padding: 8px; }
    .nir-num-mic { width: 120px; }
    .nir-footer { padding: 10px; margin-bottom: 14px; }
    .nir-totaluri { gap: 12px; }
    .nir-actiuni { width: 100%; }
    .nir-actiuni .bo-btn { flex: 1 1 auto; min-height: 44px; }
    .nir-actiuni .nir-auto { flex-basis: 100%; text-align: center; white-space: normal; margin: 0; }
}
@media (max-width: 768px) {
    /* Câmpurile liniei NIR pe 2 coloane, eticheta deasupra valorii (cardul rămâne scurt). */
    .nir-table tbody td[data-label="#"] { display: none; }
    .nir-table tbody td[data-label]:not(.nir-cell-produs) {
        flex: 0 0 50%; box-sizing: border-box; padding: 4px 10px; text-align: left; border-bottom: none;
    }
    .nir-table tbody td[data-label]:not(.nir-cell-produs)::before {
        position: static; display: block; width: auto; margin-bottom: 2px;
    }
    .nir-table tbody td[data-label]:not(.nir-cell-produs) .nir-num { width: 100%; }
    .nir-table tbody tr.nir-rand-adauga td[data-label] { flex: 0 0 100%; }
    .nir-table tbody td.col-act { flex: 0 0 100%; }
}

/* NIR încorporat în Facturi de intrare: sus DOAR factura selectată, jos editorul NIR pe toată înălțimea rămasă. */
.doc-split-nir .doc-pane-nir { flex-grow: 1 !important; background: var(--fc-bg); border-color: transparent; }   /* tot spațiul rămas (raportul splitter-ului ar lăsa gol) */
.nir-incorporat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.nir-incorporat > .bo-page-head { flex: 0 0 auto; padding-bottom: 8px; }
.nir-incorporat > .bo-page-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.nir-incorporat .nir-footer { margin: 4px 0 2px; }
.nir-titlu-inc { margin: 0; font-size: 1.05rem; color: var(--fc-ink); }

/* Tranziția listă ⇄ NIR (boNirAnim în bo-table.js animă înălțimea panoului de sus): ce nu mai e necesar în starea NIR se
   strânge lin (bara de căutare, paginarea, splitter-ul), iar conținutul de jos intră cu fade + alunecare. */
.doc-split-page .bo-page-head > .bo-toolbar { max-height: 80px; transition: max-height .3s ease, margin .3s ease, opacity .2s ease; }
.doc-split-page .bo-page-head > .bo-page-hint { transition: opacity .2s ease; }
.doc-split-page .doc-head-nir > .bo-toolbar { max-height: 0; margin-top: 0 !important; opacity: 0; overflow: hidden; pointer-events: none; }
.doc-split-page .doc-head-nir > .bo-page-hint { opacity: 0; pointer-events: none; }
.doc-pane-top .bo-paginare { max-height: 80px; transition: max-height .3s ease, padding .3s ease, margin .3s ease, opacity .2s ease; }
.doc-pane-nir-sus .bo-paginare { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; opacity: 0; overflow: hidden; }
.doc-pane-nir-sus .bo-page-body { overflow: hidden; }
.doc-split-bar { transition: flex-basis .3s ease, opacity .2s ease; }
.doc-split-nir .doc-split-bar { flex-basis: 10px; opacity: 0; pointer-events: none; border-color: transparent; background: transparent; }
.doc-pane-bottom { transition: background .3s ease, border-color .3s ease; }
.doc-lines-anim { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; animation: docIntra .3s ease both; }
.nir-incorporat { animation: docIntra .35s ease .08s both; }
@keyframes docIntra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .doc-lines-anim, .nir-incorporat { animation: none; }
}
/* Antet compact (NIR încorporat sub factura SPV): doar Data recepției + Gestiune, restul se vede în rândul facturii. */
.nir-antet-compact { grid-template-columns: repeat(2, minmax(170px, 240px)); padding: 10px 14px; }

/* Bara documentului selectat (panoul de linii): ancorată jos, ca bara NIR — totaluri + PDF / NIR / tipărire / ștergere. */
.doc-lines-footer {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; border-top: 1px solid #e1e7ef; background: #fff; border-radius: 0 0 8px 8px;
}
.doc-split-page .doc-split { margin-bottom: 18px; }   /* panoul de jos nu stă lipit de marginea ecranului */
/* Totalul documentului = chenar mov al temei, text alb (cifra cu impact; restul totalurilor rămân discrete). */
.nir-totaluri .doc-total {
    background: var(--fc-accent); color: #fff; border-radius: 8px; padding: 6px 14px;
    box-shadow: 0 2px 8px rgba(124,109,242,.35);
}
.nir-totaluri .doc-total span { color: rgba(255,255,255,.85); }
.nir-totaluri .doc-total strong { color: #fff; font-size: 1.15rem; }
/* Căutare produs fără rezultat: mesaj + „＋ Adaugă produs” (deschide formularul comun de produs). */
.bo-multi-item.cp-gol { display: flex; align-items: center; justify-content: flex-start; gap: 10px; cursor: default; color: var(--fc-muted); }
.bo-multi-item.cp-gol:hover { background: transparent; }
/* NIR: câmpuri BLOCATE pe linie (coeficient, gestiune) — arată ca un câmp dezactivat; dublu-click le deblochează. */
.nir-blocat {
    display: inline-block; box-sizing: border-box; min-width: 58px; padding: 5px 7px; border: 1px dashed #d3dae6; border-radius: 5px;
    background: #f3f5f8; color: var(--fc-muted); font-size: 0.9rem; text-align: right; cursor: default; user-select: none;
}
.nir-blocat.nir-gest { text-align: left; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.nir-blocat.nir-gest-proprie { border-style: solid; border-color: var(--fc-accent); color: var(--fc-ink); background: #f1effe; font-weight: 600; }
.nir-blocat.nir-disc-zero { color: var(--fc-faint); }   /* discount 0 = estompat (nu încarcă tabelul); cu valoare = text normal */
.nir-num.nir-gest { width: 150px; text-align: left; }
.nir-cell-gest { white-space: nowrap; }
@media (max-width: 768px) { .nir-blocat, .nir-num.nir-gest { width: 120px; max-width: 120px; } }
/* NIR → ⚙ Opțiuni: meniu deasupra butonului (containerul e relative — meniul e absolute). */
.nir-optiuni { position: relative; }
.nir-optiuni-fundal { position: fixed; inset: 0; z-index: 40; }
.nir-optiuni-meniu {
    position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 41; width: 330px; max-width: 86vw;
    background: #fff; border: 1px solid #e1e7ef; border-radius: 10px; box-shadow: 0 10px 30px rgba(20,12,50,.18); padding: 6px;
}
.nir-optiuni-cap { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 6px; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--fc-muted); }
.nir-optiuni-cap .nir-link { text-decoration: none; font-size: .9rem; }
.nir-optiuni-item {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent;
    padding: 9px 10px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--fc-ink);
}
.nir-optiuni-item span { font-size: .8rem; color: var(--fc-muted); }
.nir-optiuni-item:disabled { opacity: .45; cursor: default; }
@media (hover: hover) and (pointer: fine) { .nir-optiuni-item:not(:disabled):hover { background: #f1effe; } }
@media (max-width: 768px) { .nir-optiuni { flex: 1 1 auto; } .nir-optiuni > .bo-btn { width: 100%; min-height: 44px; } }
/* Varianta din bara de sus a unei pagini (Produse → ⚙ Opțiuni): meniul se deschide SUB buton, aliniat la dreapta. */
.nir-optiuni-meniu.nir-optiuni-jos { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; }
@media (max-width: 768px) { .nir-optiuni-meniu.nir-optiuni-jos { left: 0; right: auto; } }
/* Produse → Echivalare: dublura (stânga) ➜ produsul care rămâne (dreapta). */
.ech-explicatie { margin: 0 0 12px; color: var(--fc-muted); font-size: .9rem; }
.ech-grila { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.ech-col { min-width: 0; }
.ech-titlu { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; color: var(--fc-muted); }
.ech-sursa .ech-titlu { color: #b42318; }
.ech-tinta .ech-titlu { color: #157f3b; }
.ech-mijloc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 26px; }
.ech-sageata { font-size: 1.4rem; color: var(--fc-muted); }
.ech-card { border: 1px solid #e1e7ef; border-radius: 8px; padding: 10px 12px; background: #fafbfd; }
.ech-sursa .ech-card { border-color: #f3c7c3; background: #fff7f6; }
.ech-tinta .ech-card { border-color: #bfe3cb; background: #f4fbf6; }
.ech-card-cap { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ech-card-cap .nir-link { text-decoration: none; font-size: 1rem; flex: none; }
.ech-card-info { margin-top: 4px; font-size: .85rem; color: var(--fc-ink); }
.ech-card-folosire { margin-top: 6px; font-size: .82rem; color: var(--fc-muted); }
.ech-inactiv { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #eceff4; font-size: .75rem; }
.ech-motiv { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ech-avert { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: #fff8e6; border: 1px solid #f2dca4; font-size: .86rem; color: var(--fc-ink); }
@media (max-width: 700px) {
    .ech-grila { grid-template-columns: 1fr; }
    .ech-mijloc { flex-direction: row; justify-content: center; padding-top: 0; }
    .ech-sageata { transform: rotate(90deg); }
    .ech-mijloc .bo-btn { min-height: 44px; min-width: 44px; }
}
/* Produse: denumirea unui SERVICIU (fără stoc) în alt stil decât produsele stocabile. */
.prod-serviciu { font-style: italic; font-weight: 600; color: #5a4bd6; }

/* ✕ de golire în câmpurile de căutare (CampCautare + căutările cu listă proprie). Containerul e relative — butonul e absolute. */
.bo-golire-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.bo-golire-wrap > input { width: 100%; padding-right: 30px !important; }
.bo-golire {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dfe3ec; color: #545a72; font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .bo-golire:hover { background: var(--fc-accent); color: #fff; } }
@media (hover: none) and (pointer: coarse) { .bo-golire { width: 26px; height: 26px; font-size: 13px; } }
/* Bara listelor: wrapper-ul preia rolul input-ului (lățime). */
.bo-toolbar .bo-golire-wrap { flex: 1; max-width: 320px; }
.bo-toolbar .bo-golire-wrap > input { max-width: none; }
@media (max-width: 768px) { .bo-toolbar .bo-golire-wrap { max-width: none; } }
/* Căutarea globală (topbar indigo): ✕ pe fundal închis. */
.fc-search .bo-golire { position: static; transform: none; background: rgba(255,255,255,.18); color: #fff; flex: 0 0 auto; }
.bo-multi-lookup > .bo-golire-wrap { display: flex; width: 100%; }
.bo-cauta-lat { flex: 1; width: 100%; }

/* ════════════════════════════════════════════════
   ETICHETE — constructorul de șabloane (ed-*), tipărirea (etp-*), lista scanată (etl-*)
   Conținutul etichetei folosește mm/pt reali (EticheteRandare.Css); aici doar „rama” de lucru.
   ════════════════════════════════════════════════ */
.et-miniatura { position: relative; overflow: hidden; background: #fff; border: 1px solid #d8deea; border-radius: 3px; box-shadow: 0 1px 3px rgba(20,12,50,.08); }
.et-implicit { margin-left: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #fff;
    background: var(--fc-accent); border-radius: 10px; padding: 1px 8px; vertical-align: middle; }
#tbl-et-sabloane td[data-label="Previzualizare"] { width: 1%; }

/* Modele de pornire (șablon nou) */
.ed-modele { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ed-model { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px; cursor: pointer;
    background: #fff; border: 1px solid #e1e5ef; border-radius: 10px; font: inherit; color: var(--fc-ink); transition: border-color .15s, box-shadow .15s; }
.ed-model small { color: var(--fc-muted); }
.ed-model-prev { width: 100%; height: 140px; display: flex; align-items: center; justify-content: center; background: #eef1f6; border-radius: 7px; margin-bottom: 6px; }
.ed-model-et { position: relative; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(20,12,50,.15); border-radius: 2px; }
@media (hover: hover) and (pointer: fine) { .ed-model:hover { border-color: var(--fc-accent); box-shadow: 0 4px 16px rgba(124,109,242,.18); } }

/* Constructorul: bară sus + 3 coloane (paletă | scenă | proprietăți) */
.ed-root { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ed-bara { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid #e6e9f2;
    border-radius: 10px; padding: 8px 10px; }
.ed-nume { flex: 1 1 200px; min-width: 160px; font-size: 1.05rem; font-weight: 700; padding: 7px 10px; border: 1px solid transparent;
    border-radius: 6px; background: #f6f7fb; color: var(--fc-ink); }
.ed-nume:focus { border-color: var(--fc-accent); background: #fff; outline: none; }
.ed-grup { display: inline-flex; align-items: center; gap: 2px; }
.ed-zoom-val { min-width: 58px; }
.ed-grila { gap: 6px; font-size: .82rem; color: var(--fc-muted); }
.ed-grila select { padding: 4px 6px; border: 1px solid #d4dbe8; border-radius: 6px; font: inherit; }
.ed-proba { position: relative; display: flex; align-items: center; gap: 6px; flex: 0 1 300px; min-width: 200px; }
.ed-proba .bo-multi-lookup { flex: 1; }
.ed-proba .bo-multi-lookup input { width: 100%; padding: 6px 9px; border: 1px solid #d4dbe8; border-radius: 6px; font: inherit; }
.ed-proba-nume { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; background: #f1effe;
    border: 1px solid var(--fc-accent); border-radius: 6px; font-size: .85rem; font-weight: 600; overflow: hidden; white-space: nowrap; }
.ed-proba-nume button { margin-left: auto; border: 0; background: transparent; cursor: pointer; color: var(--fc-muted); font-size: .9rem; }
.ed-msg { margin: 0; }
.ed-corp { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr) 320px; gap: 8px; }
.ed-paleta, .ed-prop { min-height: 0; overflow-y: auto; background: #fff; border: 1px solid #e6e9f2; border-radius: 10px; padding: 8px 10px;
    overscroll-behavior: contain; }
.ed-titlu-sec { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--fc-muted); margin: 10px 2px 6px; }
.ed-titlu-sec:first-child { margin-top: 2px; }
.ed-titlu-sec small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ed-titlu-sub { font-size: .78rem; font-weight: 700; color: var(--fc-ink); margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--fc-line); }
.ed-pal, .ed-strat { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; margin-bottom: 3px;
    border: 1px solid #eceef5; border-radius: 7px; background: #fafbfe; font: inherit; font-size: .85rem; color: var(--fc-ink); cursor: grab; }
.ed-strat { cursor: pointer; background: transparent; border-color: transparent; }
.ed-strat.activ { background: #f1effe; border-color: var(--fc-accent); font-weight: 600; }
.ed-pal-ic { flex: 0 0 30px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px;
    background: #ebe8fd; color: #4a3fb8; font-size: .7rem; font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
    .ed-pal:hover { border-color: var(--fc-accent); background: #fff; }
    .ed-strat:not(.activ):hover { background: #f6f7fb; }
}

.ed-scena { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 10px; border: 1px solid #e6e9f2;
    background: #e3e7ef; overflow: hidden; }
.ed-scena-int { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px 24px 24px 14px; overscroll-behavior: contain; }
.ed-rand { display: flex; align-items: flex-start; }
.ed-rigla-sus { position: relative; height: 18px; margin-bottom: 4px; font-size: 9px; color: #6b7188;
    background-image: linear-gradient(to right, #9aa3b5 1px, transparent 1px); background-repeat: repeat-x; background-position: 0 bottom;
    border-bottom: 1px solid #9aa3b5; }
.ed-rigla-sus span { position: absolute; top: 0; transform: translateX(-50%); }
.ed-rigla-st { position: relative; width: 18px; flex: 0 0 18px; margin-right: 4px; font-size: 9px; color: #6b7188;
    border-right: 1px solid #9aa3b5; background-image: linear-gradient(to bottom, #9aa3b5 1px, transparent 1px);
    background-repeat: repeat-y; background-position: right 0; }
.ed-rigla-st span { position: absolute; right: 3px; transform: translateY(-50%); }
.ed-stage-wrap { position: relative; flex: 0 0 auto; }
.ed-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-color: #fff; touch-action: none;
    box-shadow: 0 2px 12px rgba(20,12,50,.22); }
.ed-stage.cu-grila { background-image: linear-gradient(to right, rgba(124,109,242,.10) 0.1mm, transparent 0.1mm),
                                       linear-gradient(to bottom, rgba(124,109,242,.10) 0.1mm, transparent 0.1mm); }
.ed-continut { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ed-box { position: absolute; box-sizing: border-box; cursor: move; outline: calc(1px / var(--z)) dashed rgba(124,109,242,.35); }
.ed-box.activ { outline: calc(1.5px / var(--z)) solid var(--fc-accent); background: rgba(124,109,242,.06); z-index: 5; }
@media (hover: hover) and (pointer: fine) { .ed-box:not(.activ):hover { outline-color: var(--fc-accent); } }
.ed-h { position: absolute; width: calc(9px / var(--z)); height: calc(9px / var(--z)); background: #fff;
    border: calc(1.5px / var(--z)) solid var(--fc-accent); border-radius: 2px; box-sizing: border-box; transform: translate(-50%, -50%); }
.ed-h-nw { left: 0; top: 0; cursor: nwse-resize; }   .ed-h-n { left: 50%; top: 0; cursor: ns-resize; }
.ed-h-ne { left: 100%; top: 0; cursor: nesw-resize; } .ed-h-e { left: 100%; top: 50%; cursor: ew-resize; }
.ed-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .ed-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.ed-h-sw { left: 0; top: 100%; cursor: nesw-resize; } .ed-h-w { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .ed-h { width: calc(18px / var(--z)); height: calc(18px / var(--z)); } }
.ed-ghid { position: absolute; z-index: 6; pointer-events: none; background: #e8366b; }
.ed-ghid.v { top: -50mm; bottom: -50mm; width: calc(1px / var(--z)); }
.ed-ghid.h { left: -50mm; right: -50mm; height: calc(1px / var(--z)); }
.ed-status { flex: 0 0 auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 6px 12px; font-size: .78rem;
    color: var(--fc-muted); background: #f6f7fb; border-top: 1px solid #e1e5ee; }
.ed-info-poz { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fc-ink); }
.ed-sfat { margin-left: auto; }
.ed-proba-frame { position: fixed; left: -10000px; top: 0; width: 10px; height: 10px; border: 0; }

/* Panoul de proprietăți: etichetă deasupra câmpului (coloană îngustă) */
.ed-prop .bo-form-row, .etp-stanga .bo-form-row { flex-direction: column; align-items: stretch; gap: 3px; margin-bottom: 8px; }
.ed-prop .bo-form-row label, .etp-stanga .bo-form-row label { flex: 0 0 auto; font-size: .76rem; color: var(--fc-muted); }
.ed-prop .bo-form-row input, .ed-prop .bo-form-row select, .ed-prop .bo-form-row textarea { padding: 6px 8px; font-size: .86rem; }
/* Bara de proprietăți: FĂRĂ derulare orizontală — orice câmp se strânge la lățimea coloanei (un <select> s-ar lăți după opțiunea
   cea mai lungă, un grid 1fr după conținut). */
.ed-prop { overflow-x: hidden; }
.ed-prop * { min-width: 0; }
.ed-prop input, .ed-prop select, .ed-prop textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.ed-prop input[type=checkbox] { width: 17px; flex: 0 0 17px; }
.ed-prop .ed-seg { display: flex; width: 100%; }
.ed-prop .ed-seg button { flex: 1 1 0; min-width: 0; padding: 6px 4px; }
.ed-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; align-items: end; }
.ed-4 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; }
.ed-bifa { display: flex; align-items: center; gap: 7px; font-size: .84rem; margin: 4px 0 8px; cursor: pointer; }
.ed-bifa input { width: 17px; height: 17px; }
.ed-butoane { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ed-sterge { margin-left: auto; color: #c62828 !important; }
.ed-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid #d4dbe8; border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.ed-seg button { border: 0; border-right: 1px solid #e3e7ef; background: #fff; padding: 6px 10px; min-width: 34px; font: inherit;
    font-size: .85rem; cursor: pointer; color: var(--fc-ink); }
.ed-seg button:last-child { border-right: 0; }
.ed-seg button.activ { background: var(--fc-accent); color: #fff; }
.ed-seg-stil { display: flex; }
.ed-sep { width: 1px; background: #d4dbe8; }
.ed-avert { font-size: .8rem; color: #8a4b00; background: #fff4e0; border: 1px solid #f3d29a; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.ed-nota { font-size: .8rem; color: var(--fc-muted); margin: 0 0 8px; }
.ed-pt-efectiv { font-size: .78rem; color: #8a4b00; margin: -4px 0 8px; }
.ed-nota-inline { display: block; font-weight: 400; font-size: .74rem; color: var(--fc-muted); }
.ed-proba-camp input { background: #fffdf3; border-color: #ead9a6 !important; }   /* valorile de probă = alt fundal decât setările șablonului */
.ed-proba-camp label small { font-weight: 400; }
.ed-pt-efectiv:empty { display: none; }
.ed-coala-prev { position: relative; width: 100%; max-width: 220px; margin: 4px auto 10px; background: #fff; border: 1px solid #c9d1df;
    box-shadow: 0 1px 4px rgba(20,12,50,.12); }
.ed-coala-prev i { position: absolute; box-sizing: border-box; border: 1px solid rgba(124,109,242,.55); background: rgba(124,109,242,.10); border-radius: 1px; }

@media (max-width: 1100px) {
    .ed-corp { grid-template-columns: 170px minmax(0, 1fr) 290px; }
    .ed-sfat { display: none; }
}
@media (max-width: 860px) {
    /* Telefon / tabletă portret: scena sus, paleta + proprietățile dedesubt (constructorul e gândit pentru ecran mare). */
    .ed-root { height: auto; }
    .ed-corp { display: flex; flex-direction: column; }
    .ed-scena { order: 1; min-height: 52vh; }
    .ed-prop { order: 2; }
    .ed-paleta { order: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
    .ed-paleta .ed-titlu-sec { grid-column: 1 / -1; }
    .ed-pal, .ed-strat { min-height: 44px; margin: 0; }
    .ed-proba { flex: 1 1 100%; }
}

/* Fereastra de tipărire */
.bo-modal.etp-modal { max-width: min(1240px, 96vw); width: 96vw; height: 92dvh; max-height: 92dvh; }
.etp-sursa { font-weight: 400; color: var(--fc-muted); font-size: .95rem; }
.etp-corp { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; overflow: hidden !important; }
.etp-stanga { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* Doar lista de produse se micșorează când nu mai e loc — restul (butoanele de raport, șablonul, coala, bifele) își păstrează înălțimea. */
.etp-stanga > * { flex-shrink: 0; }
.etp-stanga > .etp-lista { flex-shrink: 1; }
.etp-bife { display: flex; flex-direction: column; gap: 4px; margin-right: auto; }
.etp-bifa-sec { font-weight: 600; }
.etp-bifa-nr { font-weight: 400; color: var(--fc-muted); font-size: .8rem; }
.etp-sablon { display: flex; gap: 6px; }
.etp-sablon select { flex: 1; padding: 7px 10px; border: 1px solid #c9d6e9; border-radius: 6px; font: inherit; }
.etp-dim { font-size: .78rem; color: var(--fc-muted); }
.etp-coala { display: grid; gap: 2px; width: 100%; max-width: 200px; max-height: 200px; padding: 4px; background: #fff;
    border: 1px solid #c9d1df; border-radius: 3px; margin: 2px 0 4px; }
.etp-coala button { border: 1px solid #d5dbe7; background: #fff; border-radius: 2px; padding: 0; min-height: 4px; cursor: pointer; }
.etp-coala button.folosit { background: repeating-linear-gradient(45deg, #dfe3ea 0 3px, #f3f5f8 3px 6px); border-color: #c9d1df; }
.etp-coala button.start { background: var(--fc-accent); border-color: var(--fc-accent); }
.etp-lista-cap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.etp-bifa-tot { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; margin-right: auto; cursor: pointer; }
.etp-lista { flex: 1 1 auto; min-height: 120px; overflow-y: auto; border: 1px solid #e3e7ef; border-radius: 8px; overscroll-behavior: contain; margin-top: 6px; }
.etp-poz { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #f0f2f7; }
.etp-poz:last-child { border-bottom: 0; }
.etp-poz.exclus { opacity: .5; }
.etp-poz > input[type=checkbox] { width: 17px; height: 17px; flex: 0 0 17px; }
.etp-poz-den { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.etp-poz-den span { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etp-poz-den small { font-size: .74rem; color: var(--fc-muted); }
.etp-pret-nou { color: #b35c00; }
.etp-nr { display: inline-flex; align-items: center; border: 1px solid #d4dbe8; border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.etp-nr button { width: 28px; height: 30px; border: 0; background: #f3f5fa; cursor: pointer; font-size: 1rem; color: var(--fc-ink); }
.etp-nr button:disabled { color: #b9bfcd; cursor: default; }
.etp-nr input { width: 46px; height: 30px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.etp-nr input::-webkit-inner-spin-button, .etp-nr input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.etp-total { padding: 8px 2px 0; font-size: .88rem; color: var(--fc-muted); }
.etp-total b { color: var(--fc-ink); font-size: 1.05rem; }
.etp-dreapta { min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.etp-prev { flex: 1 1 auto; width: 100%; min-height: 0; border: 1px solid #d5dbe4; border-radius: 8px; background: #d5dbe4; }
.etp-prev-gol { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--fc-faint); background: #f3f5f9; border-radius: 8px; }
.etp-sfat { margin: 0; font-size: .78rem; color: var(--fc-muted); }
.etp-imprimanta { font-size: .9rem; padding: 7px 10px; background: #f1effe; border: 1px solid #d9d3fb; border-radius: 7px; color: var(--fc-ink); }
.etp-imprimanta span { color: var(--fc-muted); font-size: .8rem; }
.etp-gol { padding: 30px; text-align: center; grid-column: 1 / -1; }
@media (max-width: 860px) {
    .bo-modal.etp-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; min-width: 0; }
    .etp-corp { display: flex; flex-direction: column; overflow-y: auto !important; }
    .etp-stanga { overflow: visible; }
    .etp-lista { max-height: 40vh; }
    .etp-dreapta { min-height: 55vh; }
    .etp-nr button { width: 40px; height: 40px; }
    .etp-nr input { height: 40px; }
}

.etp-rapoarte { display: flex; width: 100%; margin-bottom: 10px; }
.etp-rapoarte button { flex: 1 1 0; padding: 9px 6px; font-weight: 600; }
.etp-sablon-unic { flex: 1; padding: 7px 10px; border: 1px solid #e3e7ef; border-radius: 6px; background: #f6f7fb; font-weight: 600; }
.et-standard { margin-left: 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #4a3fb8;
    background: #ebe8fd; border-radius: 10px; padding: 1px 7px; vertical-align: middle; }
/* Documente în constructor: tab-urile benzilor, previzualizarea, editorul de coloane */
.ed-benzi { flex: 0 0 auto; display: flex; gap: 4px; padding: 8px 10px 0; background: #e3e7ef; }
.ed-benzi button { border: 1px solid #cfd6e3; border-bottom: 0; background: #f1f3f8; padding: 7px 14px; border-radius: 8px 8px 0 0;
    font: inherit; font-size: .86rem; cursor: pointer; color: var(--fc-muted); }
.ed-benzi button.activ { background: #fff; color: var(--fc-ink); font-weight: 700; }
.ed-doc-prev { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #d5dbe4; }
.ed-col { border: 1px solid #e3e7ef; border-radius: 8px; padding: 7px 8px 2px; margin-bottom: 7px; background: #fbfcfe; }
.ed-col-cap { display: flex; gap: 3px; align-items: center; margin-bottom: 6px; }
.ed-col-cap .ed-col-titlu { flex: 1 1 auto; font-weight: 700; padding: 5px 7px; border: 1px solid #d4dbe8; border-radius: 6px; font: inherit; font-size: .86rem; }
.ed-col-cap button { flex: 0 0 26px; height: 28px; border: 1px solid #d4dbe8; background: #fff; border-radius: 6px; cursor: pointer; font-size: .7rem; color: var(--fc-muted); }
.ed-col-cap button:disabled { opacity: .35; cursor: default; }
.ed-col-cap .ed-col-sterge { color: #c62828; }
.ed-campuri-text { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.ed-campuri-text button { border: 1px solid #d9d3fb; background: #f5f3ff; color: #4a3fb8; border-radius: 10px; padding: 1px 7px; font-size: .72rem;
    font-family: Consolas, monospace; cursor: pointer; }
.ed-model-tabel { margin-top: 2mm; height: 60mm; background: repeating-linear-gradient(to bottom, #9aa3b5 0 .3mm, transparent .3mm 6mm);
    border: .3mm solid #9aa3b5; }
/* Imprimantele acestei stații (TRXConnector) */
.is-statie { max-width: 820px; margin-bottom: 14px; }
.is-statie .bo-tva-map-head { display: flex; align-items: center; gap: 6px; }
.is-statie-nume { font-weight: 400; color: var(--fc-muted); font-size: .85rem; }
.is-tabel { width: 100%; border-collapse: collapse; }
.is-tabel td { padding: 4px 6px; vertical-align: middle; }
.is-tabel td.is-raport { font-weight: 700; width: 44%; }
.is-tabel tr.is-pers td:first-child { padding-left: 22px; color: var(--fc-muted); font-size: .88rem; }
.is-tabel select { width: 100%; padding: 6px 8px; border: 1px solid #c9d6e9; border-radius: 6px; font: inherit; font-size: .86rem; }
.etp-rezultat { font-size: .9rem; font-weight: 600; padding: 6px 2px; }
@media (max-width: 768px) { .is-tabel td { display: block; width: auto !important; } .is-tabel td.is-raport { padding-top: 10px; } }

/* TRXConnector — stațiile (Șabloane rapoarte) */
.is-statii { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.is-st { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid #c9d6e9;
         border-radius: 18px; background: #fff; color: var(--fc-ink); font: inherit; font-size: .88rem; cursor: pointer; }
.is-st.activ { border-color: #7c6cf2; background: #f1effe; font-weight: 700; }
.is-st.off { color: var(--fc-muted); }
.is-punct { width: 9px; height: 9px; border-radius: 50%; background: #b8c2d2; flex: 0 0 auto; }
.is-st.on .is-punct { background: #2e9d57; }
.is-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; font-size: .84rem; color: var(--fc-muted); }
.is-info .is-scoate { margin-left: auto; }
.is-dispozitiv { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e3e8f0; }
.is-dispozitiv label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.is-dispozitiv select { flex: 1 1 220px; max-width: 360px; padding: 6px 8px; border: 1px solid #c9d6e9; border-radius: 6px; font: inherit; font-size: .88rem; }
.is-dispozitiv small { display: block; margin-top: 4px; color: var(--fc-muted); font-size: .78rem; }

/* Echipamentele stațiilor (casă + cântar prin TRXConnector) */
.es-grila { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; max-width: 980px; }
.es-sectiune { margin-bottom: 0; }
.es-lat { max-width: 980px; margin-top: 14px; }
.es-test { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: .88rem; color: var(--fc-ink); }
.es-bifa { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 6px 0; }
.es-disp td.es-act { width: 1%; white-space: nowrap; text-align: right; }
.es-actiuni { margin-top: 14px; max-width: 980px; display: flex; justify-content: flex-end; }
@media (max-width: 700px) { .es-actiuni .bo-btn { width: 100%; min-height: 44px; } .es-disp td.es-act { text-align: left; } }

/* Unde pleacă tipărirea (fereastra de etichete, NIR, constructor) */
.dt { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: .9rem; padding: 7px 10px; background: #f1effe;
      border: 1px solid #d9d3fb; border-radius: 7px; color: var(--fc-ink); }
.dt-direct { background: #eaf7ee; border-color: #b9e2c5; }
.dt-avert { background: #fff6e5; border-color: #f3d39b; }
.dt-linie { flex: 1 1 auto; min-width: 0; }
.dt-sub { color: var(--fc-muted); font-size: .8rem; }
.dt-alege { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--fc-muted); }
.dt-alege select { padding: 5px 8px; border: 1px solid #c9d6e9; border-radius: 6px; font: inherit; font-size: .85rem; color: var(--fc-ink);
                   background: #fff; max-width: 260px; }
.dt-link { font-size: .8rem; }
.dt-compact { padding: 4px 8px; font-size: .85rem; }
@media (max-width: 700px) {
    .dt-alege { flex: 1 1 100%; }
    .dt-alege select, .is-dispozitiv select { flex: 1 1 auto; max-width: none; min-height: 40px; }
    .is-info .is-scoate { margin-left: 0; }
}
.et-miniatura-doc { width: 46px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.ed-grup-raport { margin: 18px 0 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--fc-muted); }
.ed-grup-raport:first-child { margin-top: 0; }
.ed-model-pers { font-size: .76rem; color: #4a3fb8; font-weight: 600; }

/* Lista scanată */
.etl-cap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.etl-nume { flex: 1 1 220px; min-width: 160px; font-size: 1.2rem; font-weight: 700; padding: 6px 10px; border: 1px solid transparent;
    border-radius: 6px; background: transparent; color: var(--fc-ink); }
.etl-nume:focus, .etl-nume:hover { border-color: #d4dbe8; background: #fff; outline: none; }
.etl-sablon { padding: 7px 10px; border: 1px solid #c9d6e9; border-radius: 6px; font: inherit; max-width: 260px; }
.etl-scan { width: 100%; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.etl-scan .bo-multi-lookup input { width: 100%; font-size: 1.1rem; padding: 12px 14px; border: 2px solid var(--fc-accent); border-radius: 10px; }
.etl-ultim { font-size: .86rem; color: var(--fc-ink); padding: 0 4px; min-height: 1.3em; }
.etl-ultim.gol { color: var(--fc-muted); }
.etl-proaspat td { background: #f1effe !important; transition: background 1.5s ease; }
@media (max-width: 768px) {
    .etl-sablon { max-width: none; flex: 1 1 100%; }
    .etl-nr button { width: 44px; height: 44px; }
    .etl-nr input { height: 44px; }
}

/* ── NIR manual ↔ factura din SPV (2026-11-10): sugestia de legare + comparația cu factura ── */
.nir-legare { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; padding: 8px 12px; border-radius: 8px;
    background: #fff8e1; border: 1px solid #ffe082; color: var(--fc-ink); font-size: 0.88rem; }
.nir-cmp { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; font-size: 0.88rem; color: var(--fc-ink); }
.nir-cmp-ok { background: #e8f5e9; border: 1px solid #a5d6a7; }
.nir-cmp-dif { background: #fff3f3; border: 1px solid #ef9a9a; }
.nir-cmp-cap { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #c62828; cursor: pointer; text-align: left; }
.nir-cmp-tabel { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.85rem; }
.nir-cmp-tabel th, .nir-cmp-tabel td { padding: 4px 8px; border-bottom: 1px solid rgba(0,0,0,.08); text-align: left; }
.nir-cmp-tabel .col-num { text-align: right; white-space: nowrap; }
.nir-cmp-rosu { color: #c62828; font-weight: 700; }
@media (max-width: 700px) {
    .nir-cmp-tabel thead { display: none; }
    .nir-cmp-tabel tr { display: block; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.1); }
    .nir-cmp-tabel td { display: inline-block; border: 0; padding: 2px 6px; }
}
/* Facturi de intrare: factura care ar putea fi a unui NIR manual / NIR manual fără factura din SPV după 5 zile */
.fac-legare { margin-left: 6px; padding: 1px 7px; border-radius: 10px; border: 1px solid #ffb300; background: #fff8e1; color: #8a5a00;
    font-size: 0.72rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fac-fara-spv { margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: #fdecea; color: #c62828; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
/* Produs nou completat din Catalogul TRX Nova + propunerea ambalajului SGR */
.prod-catalog { margin: -2px 0 8px 130px; padding: 6px 10px; border-radius: 8px; background: #eef2ff; border: 1px solid #c7d2fe;
    color: var(--fc-ink); font-size: 0.82rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-sgr { margin: 0 0 10px 130px; padding: 6px 10px; border-radius: 8px; background: #e0f2f1; border: 1px solid #80cbc4;
    color: var(--fc-ink); font-size: 0.82rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.prod-sgr b { color: #8a5a00; font-weight: 600; }
@media (max-width: 700px) { .prod-catalog, .prod-sgr { margin-left: 0; } }
/* Catalog TRX Nova (/catalog-produse) */
.cat-carduri { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cat-card { background: #fff; border: 1px solid var(--fc-line, #e3e8f0); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cat-card h3 { margin: 0; } .cat-card p { margin: 0; color: var(--fc-muted); font-size: 0.88rem; }
.cat-titlu { margin: 18px 0 8px; font-size: 1.05rem; }
.cat-actiuni { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
@media (max-width: 700px) { .cat-actiuni .bo-btn { width: 100%; min-height: 44px; } }


/* ════════════════════════════════════════════════════════════════════════════════════════════════════════
   TEMA 2026-11 (cerere user: „tonul” din macheta paginii Acasă — carduri mari rotunjite, iconițe în cerc, text și butoane
   mai mari, accent indigo → albastru). Strat de SUPRASCRIERE peste stilurile de mai sus (aceeași specificitate, mai jos =
   câștigă): se ajustează / se retrage dintr-un singur loc. Componentele comune (butoane, câmpuri, tabele, ferestre, bara de
   unelte, antetul paginii, meniul) → toate paginile odată.
   ════════════════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
    --fc-rail: 270px;
    --fc-top: 78px;
    --fc-raza: 14px;            /* rază card / panou */
    --fc-raza-sm: 10px;         /* rază buton / câmp */
    --fc-umbra: 0 10px 30px rgba(40, 30, 110, .07);
    --fc-umbra-sm: 0 2px 8px rgba(40, 30, 110, .06);
    --fc-indigo-in: #3b37a8;    /* indigo intens (butoane principale, selecție) */
    --fc-grad: linear-gradient(135deg, #4338ca 0%, #5b6cf0 100%);
    --fc-grad-col: linear-gradient(180deg, #4338ca 0%, #5b8def 100%);
    --fc-lav: #f1f0fd;          /* lavandă deschis (fundal pastile, selecție) */
    --fc-line: #e6e6f2;
}
html, body { font-size: 15px; }

/* ── Bara de sus + meniul lateral ── */
.fc-topbar { gap: 16px; padding: 0 20px; }
.fc-search input { font-size: .95rem; }
.fc-icon-btn { width: 40px; height: 40px; border-radius: 10px; }
.fc-rail { padding: 10px; gap: 4px; }
.fc-rail-item { padding: 12px 14px; font-size: .92rem; border-radius: 12px; gap: 14px; }
.fc-rail-item.active { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.fc-flyout { width: 270px; }
.fc-flyout-head { font-size: 1rem; padding: 16px 20px; }
.fc-flyout-item { padding: 12px 20px; font-size: .93rem; }
.fc-flyout-sep { font-size: .68rem; padding: 15px 20px 6px; }

/* ── Pagina ── */
.fc-main { padding: 16px 28px 28px; }
.bo-page h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.01em; }
.bo-page-hint { font-size: 1rem; }

/* ── Butoane ── */
.bo-btn { min-height: 42px; padding: 10px 20px; border-radius: var(--fc-raza-sm); font-size: .95rem; font-weight: 700;
    background: var(--fc-indigo-in); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .12s, box-shadow .12s, transform .06s; }
.bo-btn:hover { background: #312da0; }
.bo-btn:active:not(:disabled) { transform: translateY(1px); }
.bo-btn.orange { background: var(--fc-grad); box-shadow: 0 4px 12px rgba(67, 56, 202, .25); }
.bo-btn.orange:hover { background: linear-gradient(135deg, #3b32b8 0%, #4f5fe6 100%); }
.bo-btn.ghost { background: #fff; color: var(--fc-ink); border: 1px solid #d9dbea; }
.bo-btn.ghost:hover { background: var(--fc-lav); border-color: #c9c6ef; }
.bo-btn.danger { background: #d14343; }
.bo-btn.danger:hover { background: #b83434; }
.bo-btn.sm { min-height: 34px; padding: 6px 14px; font-size: .86rem; border-radius: 9px; }
.bo-btn:disabled, .bo-btn:disabled:hover, .bo-btn.orange:disabled:hover, .bo-btn.ghost:disabled:hover, .bo-btn.danger:disabled:hover {
    background: #e3e5ee; color: var(--fc-muted); border-color: #d6d9e4; box-shadow: none; }

/* ── Câmpuri (căutare, formulare, filtre) ── */
.bo-toolbar { gap: 12px; flex-wrap: wrap; }
.bo-toolbar input, .bo-form-row input, .bo-form-row select, .bo-form-row textarea,
.bo-golire-wrap > input, .bo-modal-body input:not([type=checkbox]):not([type=radio]), .bo-modal-body select {
    min-height: 44px; border: 1px solid #d9dbea; border-radius: var(--fc-raza-sm); font-size: .95rem; background: #fff; color: var(--fc-ink); }
.bo-toolbar input { padding: 10px 14px; max-width: 380px; }
.bo-toolbar input:focus, .bo-form-row input:focus, .bo-form-row select:focus, .bo-form-row textarea:focus,
.bo-golire-wrap > input:focus, .bo-modal-body input:focus, .bo-modal-body select:focus {
    outline: none; border-color: #7c74e8; box-shadow: 0 0 0 3px rgba(91, 108, 240, .15); }
.bo-toolbar-check { font-size: .95rem; }
.bo-toolbar input[type=checkbox], .bo-form-row input[type=checkbox] { flex: none; width: 20px; height: 20px; min-height: 0; max-width: none; padding: 0; margin: 0; accent-color: var(--fc-indigo-in); }
.bo-icon-act { min-width: 36px; min-height: 36px; font-size: 1.1rem; border-radius: 9px; }

/* ── Tabele ── */
.bo-table { border-color: var(--fc-line); }
@media (min-width: 769px) { .bo-table th, .bo-table td { padding: 9px 16px; font-size: .95rem; } }   /* doar desktop: pe telefon tabelul e în carduri (td cu data-label) */
.bo-table th { background: #f6f5fd; font-size: .76rem; color: #4f4a7a; }
.bo-table thead th { border-top-color: var(--fc-line); box-shadow: inset 0 -1px 0 var(--fc-line); }
.bo-table td.bo-cell-name { font-size: 1rem; }
.bo-table tr:hover td { background: #f8f7ff; }
.bo-switch { width: 46px; height: 26px; }
.bo-switch.on .slider, .bo-switch input:checked + .slider { background: var(--fc-indigo-in); }

/* ── Ferestre (BoModal) + tab-uri ── */
.bo-modal { border-radius: 18px; box-shadow: 0 24px 70px rgba(25, 18, 70, .28); }
.bo-modal > h2 { font-size: 1.35rem; font-weight: 800; }
.bo-modal-actions { gap: 10px; }
.bo-modal-actions .bo-btn { min-height: 46px; padding: 10px 24px; }
.bo-tab { font-size: .95rem; padding: 10px 16px; }

/* ── Carduri / panouri ── */
.fc-panel { border-radius: var(--fc-raza); border-color: var(--fc-line); box-shadow: var(--fc-umbra-sm); padding: 20px 22px; }
.fc-panel-head { font-size: 1.05rem; }
.fc-kpi { border-radius: var(--fc-raza); box-shadow: var(--fc-umbra-sm); padding: 18px 20px; }
.fc-kpi-ic { width: 52px; height: 52px; border-radius: 50%; }
.fc-kpi-val { font-size: 1.9rem; }
.fc-kpi-label { font-size: .92rem; }
.fc-quick-rand { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.bo-msg-eroare, .bo-msg-ok { border-radius: var(--fc-raza-sm); font-size: .95rem; }
.fc-dash { display: flex; flex-direction: column; gap: 18px; }
.fc-dash > .fc-kpi-row { margin-bottom: 0; }

/* ════════ Acasă → Activitate vânzări ════════ */
.va-panel { background: #fff; border: 1px solid var(--fc-line); border-radius: 22px; padding: 22px 26px 24px; box-shadow: var(--fc-umbra);
    display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.va-reincarca .va-tiles, .va-reincarca .va-chart, .va-reincarca .va-readout { opacity: .5; transition: opacity .15s; }
.va-cap { display: flex; align-items: center; gap: 14px; }
.va-titlu-ic { width: 52px; height: 52px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px; background: var(--fc-lav); color: var(--fc-indigo-in); }
.va-titlu { flex: 1; margin: 0; font-size: 1.85rem; font-weight: 800; color: var(--fc-ink); letter-spacing: -.01em; }
.va-perioada { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: #f2f2f8; }
.va-perioada button { min-height: 46px; padding: 0 24px; border: 0; border-radius: 999px; background: transparent;
    color: var(--fc-ink); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.va-perioada button.activ { background: #2f2a7a; color: #fff; box-shadow: 0 4px 12px rgba(47, 42, 122, .3); }
/* Cardurile cu cifre: iconiță în cerc + val discret dreapta-jos (decor, aria-hidden). */
.va-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.va-tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; min-width: 0; padding: 20px 22px;
    border: 1px solid var(--fc-line); border-radius: 18px; background: #fff; box-shadow: var(--fc-umbra-sm); }
.va-tile-ic { width: 72px; height: 72px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; z-index: 1; }
.va-tile-txt { display: flex; flex-direction: column; min-width: 0; z-index: 1; }
.va-tile-txt span { font-size: 1.05rem; color: var(--fc-ink); font-weight: 500; }
.va-tile-txt b { font-size: 2rem; font-weight: 800; color: var(--fc-ink); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.va-tile-txt small { font-size: 1.05rem; color: var(--fc-muted); }
.va-val { position: absolute; right: 0; bottom: 0; width: 62%; height: 58%; }
.va-t-mov .va-tile-ic     { background: #efedfe; color: #4338ca; }   .va-t-mov .va-val path     { fill: #ece9fd; }
.va-t-albastru .va-tile-ic { background: #e8f0fe; color: #2563eb; }  .va-t-albastru .va-val path { fill: #e6eefc; }
.va-t-verde .va-tile-ic   { background: #e5f6ef; color: #15936a; }   .va-t-verde .va-val path   { fill: #e5f5ee; }
.va-gol { padding: 24px 0; }
/* Graficul: titlul axei rotit, grilă punctată, coloane cu gradient indigo → albastru, valoarea în pastilă deasupra. */
.va-chart { position: relative; padding-left: 34px; }
.va-axa-titlu { position: absolute; left: -2px; top: 0; bottom: 36px; display: flex; align-items: center; justify-content: center;
    writing-mode: vertical-rl; transform: rotate(180deg); font-size: 1rem; color: var(--fc-muted); font-weight: 500; }
.va-plot { position: relative; height: 300px; margin: 16px 0 0 64px; }
.va-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #dcdcea; }
.va-grid-0 { border-top: 2px solid #d6d6e4; }
.va-grid span { position: absolute; right: calc(100% + 14px); top: -11px; font-size: 1.05rem; color: var(--fc-ink);
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.va-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; border-left: 2px solid #d6d6e4; }
.va-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center;
    padding: 0; border: 0; border-radius: 14px 14px 0 0; background: transparent; cursor: pointer; touch-action: manipulation; }
.va-col.sel { background: var(--fc-lav); }
.va-stack { position: relative; width: 82%; max-width: 170px; display: flex; flex-direction: column; gap: 2px; }   /* lățimea în % din ZI (padding-ul în % s-ar calcula din tot graficul) */
.va-seg { flex-basis: 0; min-height: 2px; }
.va-seg:first-of-type { border-radius: 10px 10px 0 0; }
.va-pos { background: var(--fc-grad-col); }
.va-horeca { background: linear-gradient(180deg, #e2551f 0%, #f08a4b 100%); }
.va-pil { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); padding: 5px 14px; border-radius: 10px;
    background: #2f2a7a; color: #fff; font-size: 1rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 10px rgba(47, 42, 122, .25); }
.va-pil-0 { background: #ececf2; color: var(--fc-ink); box-shadow: none; font-weight: 600; }
.va-dens .va-col { border-radius: 8px 8px 0 0; }
.va-dens .va-stack { width: 70%; }
.va-dens .va-seg:first-of-type { border-radius: 5px 5px 0 0; }
.va-dens .va-pil { font-size: .85rem; padding: 3px 9px; }
@media (hover: hover) and (pointer: fine) {
    .va-col:hover:not(.sel) { background: #f7f6fe; }
    .va-col:hover .va-seg { filter: brightness(1.08); }
    .va-perioada button:not(.activ):hover { background: #e8e7f6; }
}
.va-xlabels { display: flex; margin: 12px 0 0 64px; }
.va-xlabels span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 1.05rem; color: var(--fc-ink); white-space: nowrap; }
.va-xlabels span.sel { font-weight: 800; }
.va-xlabels em { font-style: normal; }
.va-dens + .va-xlabels span, .va-chart .va-xlabels span { overflow: visible; }
/* Linia de citire (ziua aleasă) + „Vezi vânzările”. */
.va-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 22px; border-radius: 16px; background: #f7f6fd;
    font-size: 1.1rem; color: var(--fc-muted); }
.va-readout-zi { display: inline-flex; align-items: center; gap: 14px; font-size: 1.2rem; font-weight: 700; color: var(--fc-ink); }
.va-readout-zi svg { color: var(--fc-indigo-in); }
.va-readout-sep { width: 1px; align-self: stretch; background: #dcdcea; }
.va-readout-total { padding: 6px 22px; border-radius: 14px; background: #edebfb; font-size: 1.8rem; font-weight: 800; color: #1e1a5c;
    font-variant-numeric: tabular-nums; }
.va-readout-nr { font-size: 1.15rem; color: var(--fc-muted); }
.va-key { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--fc-ink); }
.va-sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.va-link { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700;
    color: var(--fc-indigo-in); text-decoration: none; }
.va-link:hover { color: #2a25a0; }

@media (max-width: 1100px) {
    .va-tiles { gap: 12px; }
    .va-tile { padding: 14px; gap: 12px; }
    .va-tile-ic { width: 54px; height: 54px; }
    .va-tile-txt b { font-size: 1.5rem; }
}
@media (max-width: 768px) {
    .va-panel { padding: 16px; border-radius: 18px; gap: 14px; }
    .va-cap { flex-wrap: wrap; }
    .va-titlu-ic { width: 42px; height: 42px; }
    .va-titlu { font-size: 1.35rem; }
    .va-perioada { width: 100%; }
    .va-perioada button { flex: 1; min-height: 44px; font-size: 1rem; }
    .va-tiles { grid-template-columns: 1fr; }
    .va-tile-txt b { font-size: 1.4rem; }
    .va-chart { padding-left: 0; }
    .va-axa-titlu { display: none; }
    .va-plot { height: 220px; margin-left: 52px; }
    .va-grid span { font-size: .85rem; right: calc(100% + 8px); top: -9px; }
    .va-xlabels { margin-left: 52px; }
    .va-xlabels span { font-size: .78rem; line-height: 1.25; }
    .va-xlabels em { display: block; }
    .va-stack { width: 78%; }
    .va-pil { font-size: .72rem; padding: 3px 6px; }
    .va-readout { padding: 12px 14px; gap: 8px 14px; }
    .va-readout-zi { font-size: 1rem; }
    .va-readout-total { font-size: 1.4rem; padding: 4px 14px; }
    .va-readout-sep { display: none; }
    .va-link { margin-left: 0; font-size: 1.05rem; }
}
/* Telefon: coloanele sunt înguste → pastila doar pe ziua aleasă (valorile celorlalte zile = linia de citire la atingere). */
@media (max-width: 768px) { .va-col:not(.sel) .va-pil { display: none; } }
/* Acasă → Acces rapid: aceleași carduri ca „Azi / Ultimele zile / Bon mediu”, ca linkuri (titlu + descriere + săgeată). */
.va-tile-link { text-decoration: none; color: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.va-tile-link .va-tile-txt { flex: 1; }
.va-tile-link .va-tile-txt b { font-size: 1.45rem; }
.va-tile-link .va-tile-txt small { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.va-tile-sag { flex: none; z-index: 1; display: inline-flex; color: var(--fc-indigo-in); }
@media (hover: hover) and (pointer: fine) {
    .va-tile-link:hover { transform: translateY(-2px); border-color: #cfcbf3; box-shadow: var(--fc-umbra); }
}
@media (max-width: 768px) { .va-tile-link .va-tile-txt b { font-size: 1.2rem; } }

/* ════════ Meniul lateral (tema 2026-11, macheta userului): logo + ‹ sus, secțiuni cu titlu, elemente mari, val jos ════════ */
.fc-sidebar { display: flex; flex-direction: column; overflow: hidden;   /* position: relative DOAR pe desktop (pe telefon e fixed, off-canvas) */
    background: linear-gradient(180deg, #29225e 0%, #34297a 60%, #3b2d88 100%); }
.fc-side-brand { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06); }
.fc-side-logo { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; min-width: 0; }
.fc-side-logo img { height: 44px; width: auto; max-width: 128px; object-fit: contain; }
.fc-side-ver { margin-top: 2px; font-size: .72rem; color: #b9b2e6; font-weight: 600; }
.fc-side-toggle { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0;
    border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; transition: background .12s; }
.fc-side-toggle:hover { background: rgba(255,255,255,.22); }
.fc-sidebar .fc-rail { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 120px; gap: 3px;
    scrollbar-width: none; position: relative; z-index: 1; }
.fc-sidebar .fc-rail::-webkit-scrollbar { display: none; }
.fc-rail-sect { display: flex; align-items: center; gap: 10px; padding: 18px 8px 6px; font-size: .78rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; color: #cdc8f0; white-space: nowrap; }
.fc-rail-sect::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.16); }
.fc-rail-item { padding: 13px 14px; font-size: 1.02rem; font-weight: 600; color: #fff; border-radius: 12px; }
.fc-rail-ic { flex-basis: 26px; color: #fff; }
.fc-rail-chev { opacity: .85; }
.fc-rail-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.fc-rail-item.open { background: rgba(255,255,255,.13); }
.fc-rail-item.active { background: linear-gradient(135deg, #6b5dd3 0%, #8a7cf0 100%); box-shadow: 0 8px 18px rgba(16, 8, 60, .35); }
.fc-rail-item.active::before { display: none; }
.fc-side-val { position: absolute; left: 0; bottom: 0; width: 100%; height: 120px; pointer-events: none; z-index: 0; }
.fc-side-val path:first-child { fill: rgba(140, 120, 245, .16); }
.fc-side-val path:last-child  { fill: rgba(170, 150, 255, .14); }
/* Restrâns (doar iconițe): fără logo / titluri de secțiune (rămâne linia), butonul centrat. */
.fc-shell.collapsed .fc-side-logo { display: none; }
.fc-shell.collapsed .fc-side-brand { justify-content: center; padding: 12px 0 8px; }
.fc-shell.collapsed .fc-rail-sect { padding: 14px 6px 4px; }
.fc-shell.collapsed .fc-rail-sect span { display: none; }
.fc-shell.collapsed .fc-sidebar .fc-rail { padding-left: 8px; padding-right: 8px; }
@media (min-width: 769px) {
    /* Meniul ocupă toată înălțimea; bara de sus începe la dreapta lui (logo-ul și ‹ stau în meniu). */
    .fc-shell { grid-template-areas: "side top" "side main"; }
    .fc-sidebar { position: relative; }
    .fc-topbar .fc-burger, .fc-topbar .fc-brand { display: none; }
    .fc-flyout, .fc-flyout-scrim { top: 0; }
    .fc-flyout { height: 100vh; height: 100dvh; }
}
@media (max-width: 768px) {
    .fc-side-toggle { width: 36px; height: 36px; }   /* pe telefon ‹ închide meniul (același ToggleSidebar) */
    .fc-shell.collapsed .fc-side-logo { display: flex; }
    .fc-shell.collapsed .fc-side-brand { justify-content: space-between; padding: 12px 12px 8px 16px; }
    .fc-shell.collapsed .fc-rail-sect span { display: inline; }
}
.fc-shell.collapsed { --fc-rail: 76px; }
/* Meniul lateral, ajustări (cerere user): ‹ mai jos, sub logo (nu lipit de el); 270px; opțiunile fixate sub categorie. */
.fc-side-brand { align-items: flex-end; padding: 16px 14px 14px 18px; }
.fc-side-logo img { height: 48px; max-width: 150px; }
.fc-side-toggle { margin-bottom: -2px; }
.fc-rail-sub { display: flex; align-items: center; gap: 12px; margin: 0 4px 4px 34px; padding: 9px 12px 9px 14px;
    border-left: 2px solid rgba(255,255,255,.16); border-radius: 0 10px 10px 0; color: #ddd8f7; font-size: .96rem; font-weight: 600;
    text-decoration: none; transition: background .12s, color .12s; }
.fc-rail-sub-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: rgba(255,255,255,.45); }
.fc-rail-sub-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-rail-sub:hover { background: rgba(255,255,255,.08); color: #fff; }
.fc-rail-sub.active { background: rgba(255,255,255,.15); color: #fff; border-left-color: #a99cff; }
.fc-rail-sub.active .fc-rail-sub-dot { background: #b8adff; box-shadow: 0 0 0 3px rgba(184,173,255,.25); }
.fc-shell.collapsed .fc-rail-sub { display: none; }
.fc-shell.collapsed .fc-side-brand { align-items: center; }
@media (max-width: 768px) { .fc-shell.collapsed .fc-rail-sub { display: flex; } }
/* Pe telefon butonul din meniu ÎNCHIDE meniul → mereu „‹” (starea „restrâns” se comută odată cu deschiderea). */
@media (max-width: 768px) { .fc-shell.collapsed .fc-side-toggle svg { transform: rotate(180deg); } }
/* Logo-ul în BARA DE SUS (cerere user): bara de sus din nou pe toată lățimea, în culoarea meniului lateral → restrângerea
   meniului nu ascunde logo-ul. ‹ rămâne sus în meniu, singur pe rând, la dreapta. */
.fc-topbar { background: #29225e; border-bottom: 1px solid rgba(255,255,255,.06); }
.fc-brand img { height: 42px; }
.fc-side-brand { justify-content: flex-end; align-items: center; padding: 12px 14px 4px; border-bottom: 0; }
.fc-shell.collapsed .fc-side-brand { justify-content: center; padding: 12px 0 4px; }
@media (min-width: 769px) {
    .fc-shell { grid-template-areas: "top top" "side main"; }
    .fc-topbar .fc-brand { display: flex; }
    .fc-flyout, .fc-flyout-scrim { top: var(--fc-top); }
    .fc-flyout { height: calc(100vh - var(--fc-top)); height: calc(100dvh - var(--fc-top)); }
}
@media (max-width: 768px) { .fc-shell.collapsed .fc-side-brand { justify-content: flex-end; padding: 12px 14px 4px; } }
/* Căutarea din bara de sus începe la marginea conținutului (zona logo-ului = lățimea meniului). */
@media (min-width: 769px) { .fc-topbar .fc-brand { min-width: calc(var(--fc-rail) - 36px); } }
/* Bara de sus mai înaltă (78px) + logo mai mare (cerere user); căutarea și butoanele rămân centrate pe verticală. */
.fc-brand img { height: 58px; }
.fc-brand-ver { align-self: flex-end; margin-bottom: 14px; }
.fc-search { height: 44px; max-width: 460px; padding: 0 14px; border-radius: 12px; }
.fc-search input { font-size: 1rem; }
.fc-avatar { width: 44px; height: 44px; }
@media (max-width: 768px) {
    :root { --fc-top: 64px; }
    .fc-shell { grid-template-columns: minmax(0, 1fr); }   /* conținutul barei nu mai poate lăți pagina peste ecran */
    .fc-topbar { min-width: 0; gap: 8px; padding: 0 10px; }
    .fc-brand { min-width: 0; flex: 0 1 auto; }
    .fc-brand img { height: 40px; max-width: 130px; }
    .fc-top-actions { gap: 2px; }
    .fc-avatar { width: 40px; height: 40px; }
}
