*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }

:root {
    --navy:       #1a2744;
    --navy-md:    #1e3a6e;
    --blue:       #3d6eb5;
    --blue-lt:    #c8d4e8;
    --blue-lth:   #b0c2de;
    --orange:     #f5821f;
    --orange-hv:  #d4700f;
    --bg:         #f0f2f5;
    --white:      #ffffff;
    --border:     #dde2ec;
    --text:       #1a2744;
    --text-sm:    #5a6a84;
    --green:      #2e9e52;
    --purple:     #8e44ad;

    --gap:    6px;
    --rad:    10px;
    --rad-sm: 6px;
    --fs-xs:  clamp(0.6rem,  1vw,   0.72rem);
    --fs-sm:  clamp(0.68rem, 1.2vw, 0.82rem);
    --fs-md:  clamp(0.76rem, 1.4vw, 0.92rem);
    --fs-lg:  clamp(0.9rem,  1.8vw, 1.1rem);
    --num-h:  clamp(46px, 6.5vh, 66px);
    --act-h:  clamp(42px, 5.5vh, 54px);
    --nav-h:  clamp(44px, 6vh,   56px);
    --hdr-h:  clamp(64px, 9vh,   88px);
}

html, body { height:100%; height:100dvh; width:100%; font-family:'Segoe UI','Segoe UI Symbol','Segoe UI Emoji',Arial,sans-serif; background:var(--bg); overflow:hidden; overscroll-behavior:none; -webkit-text-size-adjust:100%; }
.pos-root   { height:100vh; height:100dvh; width:100vw; display:flex; flex-direction:column; }
.pos-screen { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }

/* ════════════════════ HEADER ════════════════════ */
.pos-header {
    background: var(--navy);
    min-height: var(--hdr-h);
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.2vw, 16px);
    padding: 6px clamp(10px, 1.5vw, 20px);
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.pos-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pos-logo img {
    height: calc(var(--hdr-h) - 14px);
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}
.pos-ver { font-size: 0.7rem; font-weight: 400; font-style: normal;
           color: #6a8aa8; letter-spacing: .5px; }

.hdr-sep { width:1px; height:36px; background:rgba(255,255,255,0.15); flex-shrink:0; }

.hdr-field { display:flex; flex-direction:column; gap:3px; min-width:0; }
.hdr-label { color:#a0b4cc; font-size:var(--fs-xs); font-weight:600; letter-spacing:.5px; white-space:nowrap; }

.hdr-input {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: var(--white);
    font-size: var(--fs-md);
    font-weight: 600;
    padding: 4px 8px;
    height: 34px;
    min-width: 0;
}
.hdr-input::placeholder { color: rgba(255,255,255,0.4); }
.hdr-input:focus { outline: 1px solid rgba(255,255,255,0.5); }

.hdr-input-wrap { display:flex; align-items:center; gap:4px; }
.btn-barcode {
    width:34px; height:34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.btn-barcode:hover { background: rgba(255,255,255,0.2); }

.hdr-field-cant { min-width: clamp(110px, 14vw, 170px); }
.cant-ctrl { display:flex; align-items:center; gap:4px; }
.btn-cant {
    width:32px; height:34px;
    background: var(--blue);
    border: none; border-radius: var(--rad-sm);
    color: var(--white); font-size:1.2rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.btn-cant:hover { background: var(--navy-md); }
.cant-val {
    flex:1; text-align:center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: var(--white); font-size:var(--fs-md); font-weight:700;
    height:34px; padding:0 4px; min-width:0;
}

.hdr-pret {
    min-width: clamp(80px, 10vw, 130px);
    text-align: right;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: var(--white); font-size: var(--fs-lg); font-weight:700;
    height:34px; padding:0 8px;
    display:flex; align-items:center; justify-content:flex-end;
}

.hdr-info {
    margin-left:auto;
    display:flex; flex-direction:column; align-items:flex-end;
    gap:2px; flex-shrink:0;
}
.hdr-info > div { color:#a0b4cc; font-size:var(--fs-xs); white-space:nowrap; }
.hdr-info strong { color:var(--white); }
.dot-green { color:#4caf50; font-size:0.7rem; }

.btn-settings {
    width:36px; height:36px; flex-shrink:0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color:var(--white); font-size:1.1rem;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.btn-settings:hover { background: rgba(255,255,255,0.2); }

/* ════════════════════ BODY ════════════════════ */
.pos-body {
    display:flex; flex:1; overflow:hidden;
    gap:var(--gap); padding:var(--gap);
    min-height:0;
}

/* ════════════════════ BON PANEL ════════════════════ */
.bon-panel {
    flex:1; display:flex; flex-direction:column;
    background:var(--white);
    border-radius: var(--rad);
    overflow:hidden;
    border:1px solid var(--border);
    min-width:0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bon-tabs-bar {
    background: var(--navy);
    display:flex; align-items:center; gap:4px;
    padding: 5px 8px;
    flex-shrink:0;
    overflow-x:auto; overflow-y:hidden;
}
.bon-tabs-bar::-webkit-scrollbar { height:2px; }
.bon-tabs-bar::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.3); }

.bon-tab {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: rgba(255,255,255,0.6);
    font-size: var(--fs-xs); font-weight:700;
    padding: 4px 12px; cursor:pointer; white-space:nowrap;
    flex-shrink:0; transition: background .1s, color .1s;
}
.bon-tab.active { background: var(--white); color: var(--navy); }
.bon-tab:hover:not(.active) { background: rgba(255,255,255,0.2); color:var(--white); }

.bon-tab-wrap {
    display:flex; align-items:center; gap:2px; flex-shrink:0;
}
.bon-tab-close {
    width:18px; height:18px;
    background:rgba(255,60,60,0.35);
    border:none; border-radius:50%;
    color:var(--white); font-size:0.75rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    line-height:1; flex-shrink:0;
}
.bon-tab-close:hover { background:rgba(255,60,60,0.7); }

.bon-tab-add {
    width:28px; height:28px; flex-shrink:0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color:var(--white); font-size:1.1rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.bon-tab-add:hover { background: rgba(255,255,255,0.2); }

.bon-panel-header {
    background: var(--navy-md);
    color: var(--white);
    display:flex; justify-content:space-between; align-items:center;
    padding: 6px 8px 6px 14px;
    flex-shrink:0;
    font-weight:700;
    font-size:var(--fs-md);
}
.bon-hdr-info {
    flex:1; min-width:0;
    display:flex; flex-direction:column; gap:1px;
    pointer-events:none; user-select:none;
}
.bon-hdr-label { font-size:var(--fs-xs); color:rgba(255,255,255,0.55); font-weight:600; }
.bon-hdr-qty   { font-size:var(--fs-sm); font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bon-hdr-cod   { font-size:var(--fs-xs); color:rgba(255,255,255,0.65); }
.scan-busy     { color:#7ecfff; animation:pulse-scan 0.7s ease-in-out infinite; }
.scan-negasit  { color:#ff6b6b; }
@keyframes pulse-scan { 0%,100%{opacity:1} 50%{opacity:0.4} }

.btn-bon-nav {
    width: var(--act-h); height: var(--act-h);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rad-sm);
    color: var(--white); font-size:1.1rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.btn-bon-nav:hover { background: rgba(255,255,255,0.25); }
.bon-nav-down { background: var(--blue-lt); border-color:var(--border); color:var(--navy); }
.bon-nav-down:hover { background: var(--blue-lth); }

/* Coloane ascunse pe telefon, vizibile pe ecran mare */
.bc-nr   { display:none; }
.bc-extra { display:none; }
.bc-det  { display:block; }

@media (min-width: 700px) {
    .bc-nr    { display:block; }
    .bc-extra { display:block; }
    .bc-det   { display:none !important; }
    /* Header și rânduri folosesc EXACT același grid → aliniere perfectă pe coloane */
    .bon-cols,
    .bon-row  { grid-template-columns: 50px 1fr clamp(120px,11vw,160px) clamp(50px,7vw,90px) clamp(50px,8vw,110px) clamp(44px,6vw,80px) !important; column-gap: clamp(8px,1vw,16px); }
    .bon-row .nr { display:block !important; }
    .bon-row.selected .col-r { color:var(--white); }
    .bon-row.anulat .col-r { text-decoration:line-through; color:#e57373; }
}
.bon-row .nr    { font-size:var(--fs-xs); color:var(--text-sm); font-weight:600; padding-top:2px; text-align:left !important; }
.bon-cols .bc-nr { text-align:left !important; }
.bon-row .col-r { font-size:var(--fs-sm); font-weight:600; text-align:right; color:var(--text); }
.bc-gest { display:none; font-size:var(--fs-xs); color:var(--text-sm); font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
@media (min-width:700px) { .bc-gest { display:block; } }

.bon-cols {
    display:grid;
    grid-template-columns: 1fr auto;
    padding: 5px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink:0;
}
.bon-cols span { font-size:var(--fs-xs); font-weight:700; color:var(--text-sm); text-transform:uppercase; }

.bon-list { flex:1; overflow-y:auto; overscroll-behavior:contain; }
@media (hover:hover) and (pointer:fine) {
    .bon-list { cursor:grab; }
    .bon-list::-webkit-scrollbar { width:6px; }
    .bon-list::-webkit-scrollbar-track { background:rgba(255,255,255,0.04); }
    .bon-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.2); border-radius:3px; }
    .bon-list::-webkit-scrollbar-thumb:hover { background:rgba(255,255,255,0.4); }
}

.bon-empty {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    height:100%; color:var(--text-sm); gap:8px;
    padding:20px;
}
.bon-empty svg { opacity:.25; }
.bon-empty .em-title { font-size:var(--fs-lg); font-weight:600; margin-top:8px; }
.bon-empty .em-sub   { font-size:var(--fs-sm); }

.bon-row {
    display:grid;
    grid-template-columns: 1fr auto;
    padding: 6px 12px;
    border-bottom: 1px solid #f0f2f5;
    align-items:start;
    cursor:pointer;
    transition: background .1s;
    gap: 0 4px;
}
.bon-row:hover    { background:#f5f7fa; }
.bon-row.selected { background:var(--navy-md); }
.bon-row.anulat   { background:#fff5f5; }
.bon-row.anulat .produs, .bon-row.anulat .bon-row-det, .bon-row.anulat .bon-amb-line, .bon-row.anulat .valoare {
    text-decoration: line-through; color:#e57373;
}
.bon-row.anulat.selected { background:#c62828; }
.bon-row.anulat.selected .produs,
.bon-row.anulat.selected .bon-row-det,
.bon-row.anulat.selected .bon-amb-line,
.bon-row.anulat.selected .valoare { color:rgba(255,255,255,0.7); }
.bon-row.selected .nr,
.bon-row.selected .produs,
.bon-row.selected .bon-row-det,
.bon-row.selected .bon-amb-line,
.bon-row.selected .valoare { color:var(--white); }
.bon-row.selected .bon-row-det,
.bon-row.selected .bon-amb-line { color:rgba(255,255,255,0.85); }

.bon-row-main     { display:flex; flex-direction:column; gap:2px; min-width:0; }
.bon-row .produs  { font-size:var(--fs-sm); font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bon-row-det      { font-size:var(--fs-xs); color:var(--text-sm); font-weight:500; }
.bon-amb-line     { font-size:var(--fs-xs); color:#4caf50; font-weight:600; }
.bon-disc-line    { font-size:var(--fs-xs); color:#ff9070; font-weight:600; }

/* Ambalaj / Discount — folosesc TOATA lățimea rândului (sub coloana PRODUS în wide, full row în compact) */
.bon-row-fullspan { grid-column: 1 / -1; padding-left:0; white-space:normal; line-height:1.3; }
@media (min-width: 700px) {
    /* În wide mode pornesc de la coloana PRODUS (col 2) ca să fie vizual aliniate cu denumirea, dar se întind până la VALOARE */
    .bon-row-fullspan { grid-column: 2 / -1; }
}
.bon-row .valoare { font-size:var(--fs-sm); font-weight:700; text-align:right; color:var(--navy-md); white-space:nowrap; padding-top:2px; }

.bon-panel-footer {
    display:flex; justify-content:space-between; align-items:center;
    padding: 5px 8px 5px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink:0;
    font-size:var(--fs-sm);
    color:var(--text-sm);
    font-weight:600;
}
.bon-panel-footer .ft-total { font-size:var(--fs-lg); font-weight:900; color:var(--navy); }
.bon-ftr-right { display:flex; align-items:center; gap:6px; }

.bon-sub {
    grid-column: 1 / -1;
    display:flex; flex-wrap:wrap; gap:5px;
    padding: 2px 0 4px 36px;
}
.sub-tag {
    font-size: var(--fs-xs); font-weight:600;
    padding: 2px 7px; border-radius:3px;
}
.sub-tag.returo   { background:#e8f5e9; color:#2e7d32; }
.sub-tag.discount { background:#fff3e0; color:#e65100; }

/* ════════════════════ RIGHT PANEL ════════════════════ */
.right-panel {
    width: clamp(240px, 28vw, 400px);
    display:flex; flex-direction:column; gap:var(--gap);
    flex-shrink:0; min-width:0; overflow:hidden;
}

.rp-cant {
    display:flex; align-items:center; gap:6px; flex-shrink:0; min-width:0;
}
.rp-label {
    font-size:var(--fs-xs); font-weight:700;
    color:var(--text-sm); text-transform:uppercase;
    letter-spacing:.5px; white-space:nowrap; flex-shrink:0;
}
.rp-cant .cant-ctrl { flex:0 0 auto; }
.rp-cant-val {
    width:64px !important;
    background:var(--bg) !important;
    border-color:var(--border) !important;
    text-align:center !important;
    color:var(--navy) !important;
    font-weight:700 !important;
}

.rp-input-wrap {
    display:flex; align-items:center; gap:4px; flex-shrink:0;
}
.rp-main-input {
    flex:1; min-width:0;
    background:var(--white);
    border:1px solid var(--border);
    border-radius:var(--rad-sm);
    color:var(--navy);
    font-size:var(--fs-md); font-weight:600;
    padding:5px 10px; height:36px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.rp-main-input:focus { outline:1px solid var(--blue); }
.rp-barcode-btn {
    width:36px; height:36px; flex-shrink:0;
    background:var(--blue-lt); border:1px solid var(--border);
    border-radius:var(--rad-sm); color:var(--navy);
    font-size:1.5rem; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
}
.rp-barcode-btn:hover { background:var(--blue-lth); }

.numpad-area {
    background: var(--bg);
    border:1px solid var(--border);
    border-radius:var(--rad);
    padding: 8px;
    display:grid;
    grid-template-columns: repeat(4,1fr);
    gap: 6px;
    flex-shrink:0;
}

.btn-num {
    height: var(--num-h);
    font-size: clamp(1rem,1.8vw,1.4rem);
    font-weight:700;
    border-radius: var(--rad-sm);
    cursor:pointer;
    border: none;
    background: var(--blue);
    color: var(--white);
    display:flex; align-items:center; justify-content:center;
    transition: background .1s, transform .08s;
    user-select:none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}
.btn-num:hover  { background: var(--navy-md); }
.btn-num:active { transform:scale(0.96); }
.btn-num.lt     { background:var(--blue-lt); color:var(--navy); box-shadow:none; font-size:clamp(1.1rem,1.9vw,1.5rem); }
.btn-num.lt:hover { background:var(--blue-lth); }
.btn-num.btn-cif-activ { background:#c0392b !important; color:#fff !important; font-size:0.7rem !important; font-weight:700; letter-spacing:.3px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; line-height:1.2; }
.btn-num.btn-cif-activ:hover { background:#e74c3c !important; }
.btn-cif-cod { display:block; font-size:0.68rem; font-weight:700; }
.btn-cif-den { display:block; font-size:0.52rem; font-weight:400; opacity:.88; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.btn-factura { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
.btn-factura-label { font-size:0.55rem; font-weight:700; letter-spacing:.5px; }
.btn-num.btn-factura-activ { background:#1e88e5 !important; color:#fff !important; }
.btn-num.btn-factura-activ:hover { background:#1976d2 !important; }
.btn-num.span2  { grid-column:span 2; }

.plata-btns {
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    flex-shrink:0;
}

.btn-plata {
    background: var(--blue-lt);
    color: var(--navy);
    border:none; border-radius:var(--rad-sm);
    cursor:pointer; min-height: clamp(56px,8vh,76px);
    display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:3px;
    transition: background .12s;
    padding: 6px 4px;
}
.btn-plata:hover  { background: var(--blue-lth); }
.btn-plata.active { background: var(--navy-md); color: var(--white); }
.btn-plata-orange {
    background: var(--orange); color: var(--white);
    box-shadow: 0 2px 6px rgba(245,130,31,0.35);
}
.btn-plata-orange:hover { background: var(--orange-hv); }

.plata-icon  { font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height:1; }
.plata-label { font-size: clamp(0.46rem, 2.2vw, 0.68rem); font-weight:700; text-align:center; line-height:1.2; white-space: normal; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }

.ultim-bon-panel {
    background:var(--navy); color:var(--white);
    border-radius:var(--rad); padding:clamp(4px,0.8vh,10px) 10px;
    flex:1; min-height:0; overflow-y:auto;
    animation: ub-fadein .25s ease;
}
@keyframes ub-fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.ub-title  { font-size:var(--fs-xs); font-weight:700; color:rgba(255,255,255,0.55); letter-spacing:.5px; text-transform:uppercase; margin-bottom:clamp(2px,0.4vh,6px); }
.ub-total  { font-size:clamp(0.95rem,1.6vw,1.4rem); font-weight:800; color:var(--white); margin-bottom:clamp(2px,0.4vh,6px); }
.ub-plati  { display:flex; flex-direction:column; gap:clamp(1px,0.3vh,3px); margin-bottom:clamp(1px,0.3vh,4px); }
.ub-row    { display:flex; justify-content:space-between; font-size:var(--fs-xs); line-height:1.3; }
.ub-den    { color:rgba(255,255,255,0.7); }
.ub-suma   { font-weight:700; }
.ub-rest   { font-size:var(--fs-xs); color:var(--orange); font-weight:700; border-top:1px solid rgba(255,255,255,0.15); padding-top:clamp(2px,0.3vh,4px); margin-top:clamp(2px,0.3vh,4px); }

.de-plata-section {
    background:var(--white);
    border:1px solid var(--border);
    border-radius:var(--rad);
    overflow:hidden;
    flex:1;
    display:flex; flex-direction:column;
    min-height:0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dp-plati-list { display:flex; flex-direction:column; flex:1; overflow-y:auto; min-height:0; }
.dp-row {
    display:flex; align-items:center; gap:7px;
    padding: clamp(4px, 0.7vh, 7px) 10px;
    border-bottom:1px solid var(--border);
}
.dp-row-icon { font-size:1.1rem; flex-shrink:0; }
.dp-row-den  { flex:1; font-size:var(--fs-sm); font-weight:600; color:var(--text-sm); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dp-row-val  { font-size:var(--fs-sm); font-weight:700; color:var(--navy); flex-shrink:0; }
.dp-remove   { background:none; border:none; color:#ccc; font-size:.85rem; cursor:pointer; padding:2px 5px; border-radius:4px; flex-shrink:0; line-height:1; }
.dp-remove:hover { background:#fff0f0; color:#e57373; }
.dp-sumar {
    padding: clamp(4px, 0.7vh, 7px) 10px;
    font-size:var(--fs-sm); font-weight:700;
    display:flex; justify-content:flex-end;
    border-top:1px solid var(--border);
    background:var(--bg); flex-shrink:0;
}
.dp-ramane { color:var(--orange); }
.dp-exact  { color:var(--green); }
.dp-rest   { color:var(--blue); }

.de-plata-header {
    background: var(--navy-md);
    color:var(--white);
    display:flex; justify-content:space-between; align-items:center;
    padding: clamp(6px, 1.2vh, 10px) 12px;
    font-weight:700; font-size:var(--fs-sm);
    flex-shrink:0;
}
.de-plata-header .dp-val {
    font-size: clamp(1.2rem, 3.5vh, 2.4rem);
    font-weight:900; color:var(--white);
    font-family:'Arial Narrow','Segoe UI',sans-serif;
    font-stretch:condensed; letter-spacing:-0.5px; line-height:1;
}

.btn-tot, .btn-dif {
    height:30px; padding:0 9px;
    border:none; border-radius:var(--rad-sm);
    font-size:var(--fs-xs); font-weight:600;
    cursor:pointer; white-space:nowrap;
}
.btn-tot { background:var(--blue); color:var(--white); }
.btn-tot:hover { background:var(--navy-md); }
.btn-dif { background:var(--blue-lt); color:var(--navy); }
.btn-dif:hover { background:var(--blue-lth); }

.btn-confirma-plata {
    margin:6px 8px; height:clamp(36px,5vh,46px);
    background:var(--green); border:none; border-radius:var(--rad-sm);
    color:var(--white); font-size:var(--fs-sm); font-weight:700;
    cursor:pointer; flex-shrink:0; width:calc(100% - 16px);
    transition: background .12s;
}
.btn-confirma-plata:hover    { background:#247a40; }
.btn-confirma-plata:disabled { background:#aaa; cursor:not-allowed; }

/* ════════════════════ NUMPAD PLATA ════════════════════ */
.npad-overlay {
    position:fixed; inset:0; z-index:1002;
    background:rgba(0,0,0,0.65);
    display:flex; align-items:center; justify-content:center;
    padding:16px;
}
.npad-panel {
    background:var(--navy);
    border-radius:16px;
    width:min(320px, 90vw);
    padding:16px;
    box-shadow:0 16px 48px rgba(0,0,0,0.4);
    display:flex; flex-direction:column; gap:10px;
}
.npad-title {
    color:rgba(255,255,255,0.65);
    font-size:var(--fs-sm); font-weight:600;
    text-align:center; text-transform:uppercase; letter-spacing:.5px;
}
.npad-display {
    background:rgba(255,255,255,0.1);
    border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm);
    color:var(--white);
    font-size:clamp(1.4rem,5vw,2rem); font-weight:700;
    text-align:right; padding:8px 14px;
    min-height:52px; display:flex; align-items:center; justify-content:flex-end;
}
.npad-grid {
    display:grid; grid-template-columns:repeat(3,1fr); gap:7px;
}
.npad-btn {
    height:clamp(50px,9vh,64px);
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.18);
    border-radius:var(--rad-sm);
    color:var(--white); font-size:1.3rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    transition:background .1s, transform .08s;
    user-select:none;
}
.npad-btn:hover  { background:rgba(255,255,255,0.22); }
.npad-btn:active { transform:scale(0.93); }
.npad-bs { background:rgba(210,60,40,0.35); }
.npad-bs:hover { background:rgba(210,60,40,0.55); }
.npad-actions { display:flex; gap:8px; }
.npad-cancel {
    flex:1; height:46px;
    background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm); color:rgba(255,255,255,0.7);
    font-size:var(--fs-sm); font-weight:700; cursor:pointer;
}
.npad-cancel:hover { background:rgba(255,255,255,0.2); }
.npad-ok {
    flex:2; height:46px;
    background:var(--green); border:none; border-radius:var(--rad-sm);
    color:var(--white); font-size:var(--fs-sm); font-weight:700; cursor:pointer;
}
.npad-ok:hover { background:#247a40; }

/* ════════════════════ ALTE FORME MODAL ════════════════════ */
.altele-overlay {
    position:fixed; inset:0; z-index:500;
    background:rgba(0,0,0,0.6);
    display:flex; align-items:center; justify-content:center;
    padding:16px;
}
.altele-panel {
    background:var(--white);
    border-radius:14px;
    box-shadow:0 8px 48px rgba(0,0,0,0.4);
    width:100%; max-width:500px;
    max-height:88dvh;
    display:flex; flex-direction:column;
    overflow:hidden;
}
.altele-hdr {
    display:flex; align-items:center; gap:10px;
    padding:13px 16px;
    background:var(--navy);
    color:var(--white);
    flex-shrink:0;
}
.altele-title { font-size:var(--fs-sm); font-weight:700; flex:1; opacity:.85; }
.altele-total {
    font-size:clamp(1.4rem,4vw,2rem); font-weight:900;
    font-family:'Arial Narrow','Segoe UI',sans-serif;
    letter-spacing:-0.5px; line-height:1;
}
.altele-close {
    background:none; border:none; color:rgba(255,255,255,0.6);
    font-size:1.1rem; cursor:pointer; padding:5px 9px;
    border-radius:6px; line-height:1; transition:background .1s;
    margin-left:4px;
}
.altele-close:hover { background:rgba(255,255,255,0.15); color:var(--white); }
.altele-resta {
    display:flex; align-items:center; justify-content:space-between;
    padding:10px 16px;
    background:var(--navy-md);
    flex-shrink:0;
    transition:background .2s;
}
.altele-resta.ar-pos { background:#1b5e20; }
.altele-resta.ar-neg { background:#7f1d1d; }
.altele-resta.ar-ok  { background:#1b5e20; }
.ar-label { font-size:var(--fs-xs); font-weight:700; color:rgba(255,255,255,0.75); text-transform:uppercase; letter-spacing:.4px; }
.ar-val   { font-size:clamp(1.1rem,3.5vw,1.5rem); font-weight:900; color:#fff; font-family:'Arial Narrow','Segoe UI',sans-serif; }
.altele-rows {
    display:flex; flex-direction:column;
    flex:1; overflow-y:auto; min-height:0;
}
.altele-rows::-webkit-scrollbar { width:3px; }
.altele-rows::-webkit-scrollbar-thumb { background:var(--blue-lt); }
.altele-row {
    display:flex; align-items:center; gap:12px;
    padding:10px 14px;
    border-bottom:1px solid var(--border);
    cursor:pointer; transition:background .12s;
    min-height:58px;
}
.altele-row:last-child { border-bottom:none; }
.altele-row:hover      { background:#f5f8ff; }
.altele-row-active     { background:#eef5ff; }
.altele-row-active:hover { background:#e5efff; }
.altele-icon-bub {
    width:42px; height:42px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:1.35rem; flex-shrink:0;
}
.ic-cash   { background:#e8f5e9; }
.ic-card   { background:#e3f2fd; }
.ic-tichet { background:#fff3e0; }
.ic-bank   { background:#e0f7fa; }
.ic-doc    { background:#fce4ec; }
.ic-online { background:#f3e5f5; }
.ic-credit { background:#fff8e1; }
.ic-other  { background:#f5f5f5; }
.altele-den {
    flex:1; font-size:var(--fs-sm); font-weight:600;
    color:var(--text); min-width:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.altele-amount {
    font-size:var(--fs-sm); font-weight:700; color:#ccc;
    min-width:76px; text-align:right; flex-shrink:0;
}
.altele-amount.filled { color:var(--navy); font-size:var(--fs-md); }
.altele-row-active .altele-amount.filled { color:var(--blue); }
.altele-btns { display:flex; gap:5px; flex-shrink:0; }
.altele-confirma-btn {
    margin:10px 12px 12px;
    height:clamp(42px,6vh,52px);
    background:var(--green); border:none; border-radius:var(--rad-sm);
    color:var(--white); font-size:var(--fs-sm); font-weight:700;
    cursor:pointer; flex-shrink:0;
    transition:background .12s; letter-spacing:.3px;
}
.altele-confirma-btn:hover    { background:#247a40; }
.altele-confirma-btn:disabled { background:#c8c8c8; color:#888; cursor:not-allowed; }

/* ════════════════════ ACTION BAR ════════════════════ */
.pos-action-bar {
    background:var(--bg);
    border-top:1px solid var(--border);
    padding: 5px var(--gap);
    padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px));
    display:flex; gap: var(--gap);
    align-items:stretch;
    overflow-x:auto; -webkit-overflow-scrolling:touch;
    flex-wrap:nowrap; flex-shrink:0;
    min-height:var(--act-h);
}

.btn-act {
    flex:1;
    background:var(--white);
    border:1px solid var(--border);
    border-radius:var(--rad-sm);
    color:var(--navy);
    font-size:var(--fs-xs); font-weight:700;
    cursor:pointer; white-space:normal;
    display:flex; align-items:center; justify-content:center;
    text-align:center; line-height:1.2; gap:3px;
    transition: background .1s;
    min-width:56px; padding:3px 5px;
}
.pos-conn-status {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding:3px 7px; border-radius:var(--rad-sm); border:1px solid;
    font-size:0.58rem; font-weight:700; line-height:1.3;
    white-space:nowrap; flex-shrink:0;
}
.pos-conn-online  { background:#e8f5e9; border-color:#2e7d32; color:#2e7d32; }
.pos-conn-offline { background:#fff3e0; border-color:var(--orange); color:var(--orange); }
.btn-act:hover { background:#e8ebf0; }
.btn-act.orange {
    background:var(--orange); border-color:var(--orange-hv); color:var(--white);
    box-shadow:0 2px 6px rgba(245,130,31,0.3);
}
.btn-act.orange:hover { background:var(--orange-hv); }

/* ════════════════════ LOGIN ════════════════════ */
.login-bg {
    flex:1; display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    background:var(--bg); padding:16px;
}
.login-card {
    background:var(--navy);
    border-radius:16px;
    padding:clamp(16px,2.5vw,32px) clamp(18px,3vw,36px);
    width:100%; max-width:640px;
    box-shadow:0 12px 40px rgba(0,0,0,0.2);
}
.login-kb-layout { max-width:900px; display:flex; gap:20px; align-items:flex-start; }
.login-left { flex:0 0 270px; }
.login-card { position:relative; }
.login-logo-wrap { position:absolute; top:-65px; left:18px; z-index:10; }
.login-logo { max-height:60px; width:auto; object-fit:contain; }
.login-kb { flex:1; display:flex; flex-direction:column; gap:5px; padding-top:2px; }
.vkb-row  { display:flex; gap:5px; justify-content:center; }
.vkb-key  {
    flex:1; height:44px; min-width:0;
    background:rgba(255,255,255,0.12);
    border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm);
    color:var(--white); font-size:0.88rem; font-weight:700;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    transition:background .1s, transform .08s;
    user-select:none;
}
.vkb-key:hover  { background:rgba(255,255,255,0.22); }
.vkb-key:active { transform:scale(0.93); }
.vkb-wide  { flex:4; }
.vkb-row-space { justify-content:center; }
.vkb-space { flex: 0 0 75%; }
.vkb-bs    { flex:2; background:rgba(210,60,40,0.35); }
.vkb-bs:hover { background:rgba(210,60,40,0.55); }
.vkb-enter { flex:2; background:var(--blue); }
.vkb-enter:hover { background:var(--navy-md); }
.login-row { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.login-label {
    color:rgba(255,255,255,0.7);
    font-weight:700; font-size:var(--fs-md);
    width:68px; text-align:right; flex-shrink:0;
}
.login-input {
    flex:1; min-width:0;
    background:rgba(255,255,255,0.1);
    border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm);
    color:var(--white);
    font-size:var(--fs-lg); font-weight:600;
    padding:5px 12px; height:38px; text-align:center;
}
.login-input:focus { outline:1px solid rgba(255,255,255,0.5); }
.login-input[type="password"] { text-align:left; letter-spacing:3px; }
.login-btn-arrow {
    width:38px; height:38px; flex-shrink:0; padding:0; font-size:1.1rem;
    background:rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm); color:var(--white); cursor:pointer;
    display:flex; align-items:center; justify-content:center;
}
.login-btn-arrow:hover { background:rgba(255,255,255,0.22); }
.login-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.login-actions .btn-act {
    flex:1 1 calc(50% - 8px); min-width:120px;
    height:clamp(42px,5.5vh,52px);
    background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2);
    color:var(--white);
}
.login-actions .btn-act:hover { background:rgba(255,255,255,0.18); }
.login-actions .btn-act.orange { background:var(--orange); border-color:var(--orange-hv); }
.login-error { color:#ffb74d; font-size:var(--fs-sm); text-align:center; margin-top:10px; min-height:18px; }
.login-footer { text-align:center; margin-top:12px; color:var(--text-sm); font-size:0.68rem; }
.login-connectivity { margin-top:10px; font-size:0.72rem; font-weight:600; letter-spacing:.4px; }
.login-conn-online  { color:#69f0ae; }
.login-conn-offline { color:#ffb74d; }
.login-conn-meta    { margin-top:4px; font-size:0.65rem; color:rgba(255,255,255,0.45); }
.login-conn-pending { color:#ffb74d; font-weight:600; }
.login-update-banner { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; padding:8px 12px; background:rgba(255,193,7,0.15); border:1px solid rgba(255,193,7,0.4); border-radius:6px; font-size:0.75rem; color:#ffe082; }
.login-update-banner .btn-act { padding:4px 12px; font-size:0.72rem; }

.conn-overlay { position:fixed; inset:0; background:rgba(10,14,26,0.92); display:flex; align-items:center; justify-content:center; z-index:8000; }
.conn-box { display:flex; flex-direction:column; align-items:center; gap:18px; }
.conn-spinner { width:44px; height:44px; border:4px solid #2a3a4a; border-top-color:#2a7fd4; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.conn-msg { color:#b0c4de; font-size:0.88rem; letter-spacing:.3px; text-align:center; max-width:320px; }
.login-footer-failover { color:#ff6b6b !important; }
.footer-failover-badge { color:#ff4444; font-weight:700; letter-spacing:.4px; animation:pulse-red 1.5s ease-in-out infinite; }
@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:.5} }

.startup-error-overlay { position:fixed; inset:0; background:rgba(10,14,26,0.97); display:flex; align-items:center; justify-content:center; z-index:9999; }
.startup-error-box { background:#1a1f2e; border:1px solid #c0392b; border-radius:12px; padding:40px 48px; max-width:520px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:16px; }
.startup-error-icon { font-size:3rem; color:#e74c3c; }
.startup-error-title { font-size:1.2rem; font-weight:700; color:#e74c3c; letter-spacing:.5px; }
.startup-error-msg { font-size:0.82rem; color:#ccc; white-space:pre-wrap; text-align:left; background:#111; padding:12px 16px; border-radius:6px; border:1px solid #333; width:100%; }

.startup-setup-box { background:#1a1f2e; border:1px solid #2a7fd4; border-radius:12px; padding:32px 40px; width:520px; max-width:95vw; display:flex; flex-direction:column; align-items:center; gap:14px; }
.startup-setup-subtitle { font-size:0.8rem; color:#aaa; text-align:center; }
.startup-setup-subtitle code { color:#7ecfff; background:#111; padding:1px 5px; border-radius:3px; }
.setup-form { width:100%; display:flex; flex-direction:column; gap:8px; }
.setup-row { display:grid; grid-template-columns:140px 1fr; align-items:center; gap:10px; }
.setup-row label { font-size:0.78rem; color:#aaa; text-align:right; }
.setup-row input { background:#111; border:1px solid #333; border-radius:5px; padding:6px 10px; color:#fff; font-size:0.82rem; outline:none; }
.setup-row input:focus { border-color:#2a7fd4; }
.setup-select { background:#111; border:1px solid #333; border-radius:5px; padding:6px 10px; color:#fff; font-size:0.82rem; outline:none; cursor:pointer; }
.setup-select:focus { border-color:#2a7fd4; }
.setup-section-hint { font-size:0.72rem; color:#9aaccc; padding:2px 0 4px 150px; line-height:1.4; }
.setup-section-hint code { color:#7ecfff; background:#111; padding:1px 5px; border-radius:3px; }
.setup-eroare { color:#ff6b6b; font-size:0.78rem; text-align:center; }
.setup-actions { display:flex; gap:12px; margin-top:4px; }
.setup-section-title { font-size:0.72rem; color:#7ecfff; text-transform:uppercase; letter-spacing:.6px; width:100%; border-top:1px solid #2a3a4a; padding-top:8px; margin-top:4px; }
.setup-cif-wrap { display:flex; gap:6px; }
.setup-cif-wrap input { flex:1; }
.setup-cif-btn { padding:4px 10px; font-size:0.78rem; min-width:36px; }
.setup-cif-found { font-size:0.78rem; color:#4caf50; text-align:center; }
.setup-cif-notfound { font-size:0.78rem; color:#ffb74d; text-align:center; }
.setup-cif-list { width:100%; display:flex; flex-direction:column; gap:4px; max-height:150px; overflow-y:auto; }
.setup-cif-item { background:#111; border:1px solid #2a3a4a; border-radius:5px; padding:6px 10px; cursor:pointer; display:flex; justify-content:space-between; align-items:center; text-align:left; color:#fff; }
.setup-cif-item:hover { border-color:#2a7fd4; background:#1a2a3a; }
.cif-item-den { font-size:0.82rem; font-weight:600; }
.cif-item-cif { font-size:0.72rem; color:#aaa; }

/* ════════════════════ SEARCH PANEL ════════════════════ */
.search-overlay {
    position:fixed; inset:0; z-index:1000;
    background:rgba(0,0,0,0.55);
    display:flex; align-items:flex-end; justify-content:center;
    padding:0;
}
.search-panel {
    background:var(--navy);
    border-radius:16px 16px 0 0;
    width:100%; max-width:860px;
    height:85dvh;
    display:flex; flex-direction:column;
    overflow:hidden;
    box-shadow:0 -8px 32px rgba(0,0,0,0.4);
}
.search-panel-hdr {
    display:flex; justify-content:space-between; align-items:center;
    padding:12px 16px;
    border-bottom:1px solid rgba(255,255,255,0.1);
    color:var(--white); font-size:var(--fs-md); font-weight:700;
    flex-shrink:0;
}
.search-close {
    width:32px; height:32px;
    background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2);
    border-radius:50%; color:var(--white); font-size:1rem;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.search-close:hover { background:rgba(255,255,255,0.2); }
.search-input-row { padding:10px 12px 6px; flex-shrink:0; display:flex; gap:4px; align-items:center; }
.search-bs-inline {
    flex-shrink:0; height:28px; width:88px;
    background:rgba(210,60,40,0.35); border:1px solid rgba(255,255,255,0.2);
    border-radius:var(--rad-sm); color:var(--white);
    font-size:0.88rem; font-weight:700; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    transition:background .1s, transform .08s; user-select:none;
}
.search-bs-inline:hover  { background:rgba(210,60,40,0.55); }
.search-bs-inline:active { transform:scale(0.93); }
.search-input {
    flex:1; min-width:0; height:40px;
    background:rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.25);
    border-radius:var(--rad-sm); color:var(--white);
    font-size:var(--fs-lg); font-weight:600; padding:0 12px;
}
.search-input:focus { outline:1px solid rgba(255,255,255,0.5); }
.search-input::placeholder { color:rgba(255,255,255,0.4); }
.search-kb { padding:6px 12px 8px; display:flex; flex-direction:column; gap:5px; flex-shrink:0; }
/* Pe telefon (compact mode) ascundem tastatura virtuală și butonul ⌫ inline — utilizatorul folosește tastatura sistemului */
@media (max-width: 699px) {
    .search-kb,
    .search-bs-inline { display:none !important; }
}
.search-results { flex:1; overflow-y:auto; overscroll-behavior:contain; border-top:1px solid rgba(255,255,255,0.1); border-bottom:1px solid rgba(255,255,255,0.1); }
.search-results::-webkit-scrollbar { width:4px; }
.search-results::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.3); border-radius:2px; }
@media (hover:hover) and (pointer:fine) {
    .search-results { cursor:grab; }
    .search-results::-webkit-scrollbar { width:8px; }
    .search-results::-webkit-scrollbar-track { background:rgba(255,255,255,0.06); border-radius:4px; }
    .search-results::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.35); border-radius:4px; }
    .search-results::-webkit-scrollbar-thumb:hover { background:rgba(255,255,255,0.6); }
}
.search-empty { padding:20px; text-align:center; color:rgba(255,255,255,0.5); font-size:var(--fs-sm); }
.search-result-row {
    display:flex; align-items:center; justify-content:space-between;
    padding:10px 16px;
    border-bottom:1px solid rgba(255,255,255,0.08);
    cursor:pointer; transition:background .1s;
}
.search-result-row:hover { background:rgba(255,255,255,0.08); }
.sr-info { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; overflow:hidden; }
.sr-name { font-size:var(--fs-sm); font-weight:700; color:var(--white); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sr-det  { font-size:var(--fs-xs); color:rgba(255,255,255,0.55); }
.sr-um   { font-size:0.68rem; font-weight:700; color:#1a2744; background:#7ab4ff; border-radius:4px; padding:1px 6px; white-space:nowrap; flex-shrink:0; align-self:center; }
.sr-pret { font-size:var(--fs-md); font-weight:700; color:#7ab4ff; white-space:nowrap; flex-shrink:0; padding-left:8px; }

/* ════════════════════ REST NUMERAR MODAL ════════════════════ */
.rest-overlay {
    position:fixed; inset:0; z-index:600;
    background:rgba(0,0,0,0.7);
    display:flex; align-items:center; justify-content:center;
    padding:16px;
}
.rest-panel {
    background:var(--navy);
    border-radius:16px;
    box-shadow:0 12px 56px rgba(0,0,0,0.5);
    width:100%; max-width:360px;
    display:flex; flex-direction:column;
    overflow:hidden;
}
.rest-hdr {
    padding:16px 20px 12px;
    font-size:var(--fs-sm); font-weight:700;
    color:rgba(255,255,255,0.7);
    text-align:center; text-transform:uppercase; letter-spacing:.5px;
}
.rest-body { padding:0 20px 16px; display:flex; flex-direction:column; gap:8px; }
.rest-row  { display:flex; justify-content:space-between; align-items:baseline; }
.rest-label  { font-size:var(--fs-sm); color:rgba(255,255,255,0.55); font-weight:500; }
.rest-val-sm { font-size:var(--fs-md); font-weight:700; color:rgba(255,255,255,0.8); }
.rest-sep    { height:1px; background:rgba(255,255,255,0.12); margin:4px 0; }
.rest-main-row { margin-top:4px; }
.rest-main-label { font-size:1.1rem; font-weight:700; color:rgba(255,255,255,0.7); text-transform:uppercase; letter-spacing:.5px; }
.rest-main-val {
    font-size:clamp(2rem,8vw,3rem); font-weight:900; color:#69f0ae;
    font-family:'Arial Narrow','Segoe UI',sans-serif;
    letter-spacing:-1px; line-height:1;
}
.rest-ok {
    margin:0; padding:16px;
    background:var(--green); border:none;
    color:var(--white); font-size:var(--fs-md); font-weight:700;
    cursor:pointer; letter-spacing:.3px;
    transition:background .12s;
}
.rest-ok:hover { background:#247a40; }

/* ════════════════════ MISC ════════════════════ */
.bon-list::-webkit-scrollbar { width:4px; }
.bon-list::-webkit-scrollbar-thumb { background:var(--blue-lt); border-radius:2px; }

/* ════════════════════ PC — butoane mari ════════════════════ */
@media (min-width: 700px) and (hover: hover) and (pointer: fine) {
    :root { --num-h: clamp(68px, 9.5vh, 96px); }
    .right-panel { width: clamp(340px, 38vw, 500px); }
    .rp-cant { justify-content: flex-end; }
    .btn-cant { width: 42px; height: 42px; font-size: 1.4rem; }
    .rp-cant-val { width: 84px !important; height: 42px !important; }
    .rp-main-input { height: 44px; }
    .rp-barcode-btn { width: 44px; height: 44px; font-size: 1.6rem; }
    .numpad-area { gap: 8px; padding: 10px; }
    .btn-num { font-size: clamp(1.2rem, 2vw, 1.7rem); }
    .btn-plata { min-height: clamp(82px, 12vh, 112px); }
    .plata-icon  { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }
    .plata-label { font-size: var(--fs-sm); }
}

/* ════════════════════ PC — ecran scurt (≤820px înălțime) ════════════════════ */
@media (min-width: 700px) and (max-height: 800px) and (hover: hover) and (pointer: fine) {
    :root {
        --hdr-h: clamp(48px, 7vh,   64px);
        --num-h: clamp(44px, 6.5vh, 68px);
        --act-h: clamp(36px, 5vh,   48px);
    }
    .right-panel { gap: 4px; }
    .numpad-area { padding: 6px; gap: 5px; }
    .btn-plata   { min-height: clamp(50px, 8vh, 76px); }
    .plata-icon  { font-size: clamp(1.2rem, 2.2vw, 1.8rem); }
}

/* ════════════════════ MOBILE ════════════════════ */
@media (hover: none) and (pointer: coarse) {
    .login-kb { display: none; }
    .login-kb-layout { max-width: 440px; flex-direction: column; }
    .login-left { flex: unset; width: 100%; }
    .pos-header  { flex-wrap: wrap; min-height: auto; }
    .hdr-info    { display: none; }
    .right-panel { width: clamp(220px, 35vw, 340px); }
    .plata-btns { gap: 3px; }
    .btn-plata { padding: 4px 2px; }
    .plata-icon { font-size: 1.0rem; }
    .plata-label { font-size: clamp(0.42rem, 2.0vw, 0.60rem); }
}

/* ════════════════════ CONFIG POS PANEL ════════════════════ */
.cfg-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.55);
    display:flex; align-items:center; justify-content:center;
    z-index:1000;
}
.cfg-panel {
    background:var(--white); border-radius:var(--rad);
    padding:24px; width:min(520px,94vw);
    box-shadow:0 8px 32px rgba(0,0,0,0.25);
    display:flex; flex-direction:column; gap:14px;
}
.cfg-title {
    font-size:var(--fs-lg); font-weight:800; color:var(--navy);
    display:flex; align-items:center; justify-content:space-between;
}
.cfg-back {
    font-size:var(--fs-sm); font-weight:600; color:var(--blue);
    background:none; border:none; cursor:pointer; padding:4px 8px;
}
.cfg-mod-btns {
    display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
}
/* 5 butoane: 3 pe primul rand, 2 pe al doilea centrate */
.cfg-mod-btns > :nth-child(4) { grid-column: 1; }
.cfg-mod-btns > :nth-child(5) { grid-column: 2; }
.cfg-mod-btn {
    display:flex; flex-direction:column; align-items:center; gap:4px;
    padding:12px 8px; border:2px solid var(--border);
    border-radius:var(--rad); background:var(--bg);
    cursor:pointer; transition:border-color .15s, background .15s;
    font-size:var(--fs-sm); font-weight:700; color:var(--navy);
}
.cfg-mod-btn:hover { border-color:var(--blue); background:var(--blue-lt); }
.cfg-mod-btn-offline { border-color:#c0392b; background:#fdf0ef; color:#c0392b; }
.cfg-mod-btn-offline:hover { border-color:#a93226; background:#fadbd8; }
.cfg-mod-btn-offline .cfg-mod-sub { color:#c0392b; }
.cfg-mod-icon { font-size:1.5rem; line-height:1; }
.cfg-mod-sub  { font-size:0.58rem; color:var(--text-sm); font-weight:400; text-align:center; word-break:break-all; }
.cfg-textarea {
    width:100%; height:260px; resize:vertical;
    font-family:'Consolas','Courier New',monospace; font-size:0.78rem;
    border:1px solid var(--border); border-radius:var(--rad-sm);
    padding:10px; color:var(--text); background:var(--bg);
    line-height:1.5;
}
.cfg-textarea:focus { outline:2px solid var(--blue); }
.cfg-mesaj  { font-size:var(--fs-sm); font-weight:600; padding:6px 10px; border-radius:var(--rad-sm); }
.cfg-ok  { background:#e8f5e9; color:#2e7d32; }
.cfg-err { background:#ffebee; color:#c62828; }
.cfg-actions { display:flex; gap:10px; }
.cfg-btn-save {
    flex:1; padding:10px; background:var(--green); color:var(--white);
    border:none; border-radius:var(--rad-sm); font-size:var(--fs-sm);
    font-weight:700; cursor:pointer;
}
.cfg-btn-save:disabled { background:#aaa; cursor:not-allowed; }
.cfg-btn-save:hover:not(:disabled) { background:#247a40; }
.cfg-btn-cancel {
    padding:10px 16px; background:var(--bg); color:var(--text-sm);
    border:1px solid var(--border); border-radius:var(--rad-sm);
    font-size:var(--fs-sm); font-weight:600; cursor:pointer;
}
.cfg-btn-cancel:hover { background:var(--border); }
.cfg-btn-server { background:var(--navy-md) !important; }
.cfg-btn-server:hover:not(:disabled) { background:var(--navy) !important; }
.cfg-btn-ambele { background:var(--purple, #8e44ad) !important; }
.cfg-btn-ambele:hover:not(:disabled) { background:#7d3c98 !important; }
.cfg-page { display:flex; flex-direction:column; height:100dvh; background:var(--bg); }
.cfg-page-header { background:var(--navy); color:var(--white); display:flex; align-items:center; gap:14px; padding:10px 20px; flex-shrink:0; }
.cfg-back-btn { background:rgba(255,255,255,0.15); border:1px solid rgba(255,255,255,0.25); color:var(--white); border-radius:var(--rad-sm); padding:6px 14px; font-size:var(--fs-sm); font-weight:600; cursor:pointer; }
.cfg-back-btn:hover { background:rgba(255,255,255,0.25); }
.cfg-page-title { font-size:var(--fs-lg); font-weight:800; letter-spacing:.3px; }
.cfg-mod-btns-page { padding:20px; display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.cfg-section-title { font-size:var(--fs-md); font-weight:800; color:var(--navy); display:flex; align-items:center; justify-content:space-between; padding:14px 20px 6px; }
.cfg-textarea-page { margin:0 20px; height:calc(100dvh - 200px); resize:none; }
.cfg-viz-table-wrap { margin:0 20px; flex:1; overflow-y:auto; }
.cfg-actions { padding:12px 20px; display:flex; gap:10px; }
.cfg-viz-search-bar { padding:10px 20px 4px; }
.cfg-viz-search { width:100%; max-width:420px; padding:8px 14px; border:1px solid var(--border); border-radius:var(--rad-sm); font-size:var(--fs-sm); background:var(--white); color:var(--navy); }
.cfg-viz-search:focus { outline:2px solid var(--blue); }
.cfg-viz-sectiune { padding:8px 12px 4px; font-size:var(--fs-xs); font-weight:800; color:var(--text-sm); text-transform:uppercase; letter-spacing:.6px; background:var(--bg); border-bottom:1px solid var(--border); }
.cfg-viz-empty  { padding:24px; text-align:center; color:var(--text-sm); font-size:var(--fs-sm); }
.cfg-viz-subcfg { background:#f8f9ff; }
.cfg-viz-subcfg .cfg-viz-key { padding-left:24px; color:var(--blue); }
.cfg-viz-subcfg .cfg-viz-key::before { content:"↳ "; opacity:.5; }
.cfg-viz-pair-wrap { display:flex; gap:6px; }
.cfg-viz-pair-wrap .cfg-viz-input { flex:1; min-width:0; }
.cfg-viz-pair-sep  { color:var(--text-sm); margin:0 4px; }
.cfg-viz-pair-key  { color:var(--blue); font-weight:500; font-size:var(--fs-xs); }
.cfg-panel.cfg-wide { width:min(960px,96vw); }

/* ── ADMIN AMEF ──────────────────────────────────── */
.cfg-amef-status {
    margin:8px 0 14px; padding:8px 16px; border-radius:var(--rad-sm);
    font-size:var(--fs-sm); font-weight:700; text-align:center;
}
.cfg-amef-ok  { background:#e8f5e9; color:#2e7d32; }
.cfg-amef-off { background:#f5f5f5; color:#888; }
.cfg-amef-grid {
    display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px;
}
.cfg-amef-btn {
    padding:14px 10px; border:2px solid var(--blue); border-radius:var(--rad-sm);
    background:var(--blue-lt); color:var(--navy);
    font-size:var(--fs-sm); font-weight:700; cursor:pointer; transition:background .15s;
}
.cfg-amef-btn:hover:not(:disabled) { background:#c9e1ff; }
.cfg-amef-btn:disabled { opacity:.4; cursor:not-allowed; }
.cfg-amef-btn-sec  { border-color:var(--border); background:var(--bg); }
.cfg-amef-btn-sec:hover:not(:disabled) { background:var(--border); }
.cfg-amef-btn-danger { border-color:#e53935; color:#c62828; background:#ffebee; }
.cfg-amef-btn-danger:hover:not(:disabled) { background:#ffcdd2; }
/* Parametri AMEF panel */
.cfg-amef-loading { text-align:center; padding:24px; color:var(--muted); font-size:var(--fs-sm); }
.cfg-amef-params  { display:flex; flex-direction:column; gap:0; max-height:460px; overflow-y:auto; margin-bottom:12px; border:1px solid var(--border); border-radius:var(--rad-sm); }
.cfg-amef-grup-titlu { background:var(--navy); color:var(--white); font-size:var(--fs-xs); font-weight:700; padding:5px 10px; text-transform:uppercase; letter-spacing:.05em; position:sticky; top:0; z-index:1; }
.cfg-amef-param-row   { display:flex; justify-content:space-between; align-items:center; padding:5px 10px; border-bottom:1px solid var(--border); font-size:var(--fs-sm); }
.cfg-amef-param-label { color:var(--muted); }
.cfg-amef-param-val   { font-weight:600; color:var(--navy); text-align:right; }
/* Form rows in amef-cfg */
.cfg-amef-form-row  { display:flex; justify-content:space-between; align-items:center; padding:5px 10px; border-bottom:1px solid var(--border); font-size:var(--fs-sm); gap:8px; }
.cfg-amef-form-row label { color:var(--muted); flex:1; }
.cfg-amef-form-row input[type=checkbox] { width:18px; height:18px; cursor:pointer; flex-shrink:0; }
.cfg-amef-form-btns { justify-content:flex-end; padding:6px 10px; background:var(--bg); }
.cfg-amef-input    { border:1px solid var(--border); border-radius:var(--rad-sm); padding:3px 6px; font-size:var(--fs-sm); background:var(--white); flex-shrink:0; width:160px; }
.cfg-amef-input-sm { width:70px; }
.cfg-amef-select   { border:1px solid var(--border); border-radius:var(--rad-sm); padding:3px 6px; font-size:var(--fs-sm); background:var(--white); flex-shrink:0; }
.cfg-amef-btn-sm   { padding:4px 10px; border-radius:var(--rad-sm); border:1px solid var(--border); background:var(--bg); font-size:var(--fs-xs); cursor:pointer; }
.cfg-amef-btn-sm:hover:not(:disabled) { background:var(--border); }
.cfg-amef-btn-sm:disabled { opacity:.4; cursor:not-allowed; }
.cfg-amef-btn-save { border-color:var(--accent); color:var(--accent); font-weight:600; }
.cfg-amef-btn-save:hover:not(:disabled) { background:var(--accent); color:var(--white); }
/* TVA table */
.cfg-amef-tva-header { display:grid; grid-template-columns:60px 1fr 90px; gap:6px; padding:4px 10px; background:var(--bg); font-size:var(--fs-xs); font-weight:700; color:var(--muted); border-bottom:1px solid var(--border); }
.cfg-amef-tva-row    { display:grid; grid-template-columns:60px 1fr 90px; gap:6px; padding:4px 10px; border-bottom:1px solid var(--border); align-items:center; font-size:var(--fs-sm); }
.cfg-amef-tva-litera { font-weight:700; color:var(--navy); }
/* Modal rapoarte fiscale din POS */
.pos-overlay { position:fixed; inset:0; z-index:1100; background:rgba(0,0,0,0.65); display:flex; align-items:center; justify-content:center; }
.pos-modal-small { background:var(--white); border-radius:var(--rad); padding:24px; min-width:320px; max-width:420px; width:90%; box-shadow:0 8px 32px rgba(0,0,0,0.35); }
.pos-modal-title { font-size:var(--fs-lg); font-weight:700; color:var(--navy); margin-bottom:16px; text-align:center; }
.cif-modal      { display:flex; flex-direction:column; gap:12px; }
.cif-input-row  { display:flex; gap:8px; }
.cif-input      { flex:1; background:#f4f6fb; border:1px solid #ccd3e0; border-radius:6px; padding:10px 12px; font-size:1rem; color:#1a2744; outline:none; }
.cif-input:focus { border-color:#2a7fd4; }
.cif-search-btn { padding:8px 14px; font-size:0.8rem; white-space:nowrap; }
.cif-denumire   { color:#1a7a3a; font-size:0.85rem; font-weight:600; padding:6px 10px; background:#e8f5e9; border-radius:6px; }
.cif-eroare     { color:#c0392b; font-size:0.82rem; padding:6px 10px; background:#fdecea; border-radius:6px; }
.cif-actions    { display:flex; gap:10px; justify-content:flex-end; margin-top:4px; }
.cif-actions .btn-act { padding:14px 22px; font-size:0.95rem; }
/* ── Discount modal ── */
.disc-modal         { display:flex; flex-direction:column; gap:12px; }
.disc-produs-name   { font-size:0.75rem; font-weight:400; opacity:.75; margin-left:6px; }
.disc-toggle        { display:flex; gap:8px; }
.disc-toggle-sm .disc-tog { padding:7px; font-size:0.9rem; }
.disc-tog           { flex:1; padding:10px; font-size:1rem; font-weight:700; background:#1e2d3d; color:#e0eaf8; border:1px solid #2a3a4a; border-radius:7px; cursor:pointer; transition:background .13s; }
.disc-tog.active    { background:#2a7fd4; border-color:#2a7fd4; color:#fff; }
.disc-display       { background:#0d1a2a; border:1px solid #2a3a4a; border-radius:8px; padding:14px 18px; display:flex; align-items:baseline; justify-content:flex-end; gap:8px; transition:border-color .15s, background .15s; }
.disc-display-over  { border-color:#e74c3c !important; background:#5a0f0f !important; }
.disc-display-over .disc-val { color:#ff9090 !important; }
.disc-val           { font-size:2rem; font-weight:700; color:#fff; }
.disc-unit          { font-size:1rem; color:#6a8aa8; }
.disc-numpad        { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.disc-npad-btn      { padding:14px 0; font-size:1.15rem; font-weight:700; background:#1e2d3d; color:#e0eaf8; border:1px solid #2a3a4a; border-radius:7px; cursor:pointer; transition:background .13s; }
.disc-npad-btn:hover { background:#2a7fd4; border-color:#2a7fd4; color:#fff; }
.disc-npad-bs       { background:#3a1a1a; border-color:#6a2a2a; color:#ff9999; }
.disc-npad-bs:hover { background:#7a2a2a; border-color:#7a2a2a; color:#fff; }
.disc-preview       { background:#0a1520; border:1px solid #2a3a4a; border-radius:8px; padding:10px 14px; display:flex; flex-direction:column; gap:4px; }
.disc-prev-row      { display:flex; justify-content:space-between; font-size:0.88rem; color:#8aaccc; }
.disc-prev-red span:last-child { color:#ff7070; font-weight:600; }
.disc-prev-sep      { border-top:1px solid #2a3a4a; margin:4px 0; }
.disc-prev-final    { font-size:1rem; font-weight:700; }
.disc-prev-final span:first-child { color:#e0eaf8; }
.disc-prev-final span:last-child  { color:#7fff7f; }
.disc-actions       { display:flex; gap:10px; justify-content:flex-end; }
.disc-actions .btn-act { padding:14px 22px; font-size:0.95rem; }

/* Modal fallback cântar */
.cantar-fb-eroare   { background:#3a1a1a; border:1px solid #6a2a2a; color:#ffb0b0; font-size:0.85rem; padding:8px 12px; border-radius:7px; }
.cantar-fb-hint     { font-size:0.85rem; color:#8aaccc; }

/* Cod produs sub denumire (vizibil doar pe ecrane mari prin .bc-extra) */
.bon-row-cod { font-size:0.72rem; font-weight:500; color:#7a8aa0; font-family:'Consolas', 'Monaco', monospace; letter-spacing:0.3px; margin-top:1px; }
.bon-row-cod-lbl { color:#9aaac0; font-weight:400; margin-right:4px; font-family:inherit; letter-spacing:normal; font-style:italic; }
.bon-row.selected .bon-row-cod { color:#c9d6e9; }
.bon-row.anulat  .bon-row-cod { text-decoration:line-through; color:#c47878; }

/* Preț pe linie — centrat ca să se alinieze cu header-ul PRET/BUC */
.bc-pret-cell { font-size:var(--fs-sm); font-weight:600; text-align:center; color:var(--text); }
.bon-row.selected .bc-pret-cell { color:var(--white); }
.bon-row.anulat  .bc-pret-cell { text-decoration:line-through; color:#e57373; }

/* Controale cantitate pe linie — afișate doar pe ecrane >=700px (modul compact mobile le ascunde prin .bc-extra) */
@media (min-width: 700px) {
    .bc-qty-cell    { display:flex; align-items:center; gap:3px; justify-content:flex-end; }
    .bc-qty-btn     { width:26px; height:30px; padding:0; font-size:1.1rem; font-weight:700; line-height:1; background:#1e2d3d; color:#e0eaf8; border:1px solid #2a3a4a; border-radius:5px; cursor:pointer; transition:background .12s; flex-shrink:0; }
    .bc-qty-btn:hover:not(:disabled) { background:#2a7fd4; border-color:#2a7fd4; }
    .bc-qty-btn:disabled { opacity:.35; cursor:not-allowed; }
    .bc-qty-frame   { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:3px 6px; min-width:54px; height:30px; background:#fff; color:#1a2744; border:1.5px solid #2a7fd4; border-radius:5px; cursor:pointer; transition:background .12s, border-color .12s; flex:1; }
    .bc-qty-frame:hover:not(:disabled) { background:#dbe9fa; }
    .bc-qty-frame:disabled { opacity:.4; cursor:not-allowed; }
    .bc-qty-val     { font-size:0.95rem; font-weight:700; line-height:1; }
    .bc-qty-um      { font-size:0.65rem; font-weight:500; opacity:.7; line-height:1; margin-top:1px; }
    .bon-row.selected .bc-qty-frame { background:#dbe9fa; }
    .bon-row.anulat .bc-qty-frame   { text-decoration:line-through; color:#e57373; border-color:#e57373; }
}

/* ── Modal Grupe — tonul navy din search panel ── */
.pos-modal-large   { background:var(--navy); border-radius:16px; padding:18px; width:min(720px, 92vw); max-height:85vh; display:flex; flex-direction:column; gap:14px; box-shadow:0 8px 32px rgba(0,0,0,0.45); }
.grupe-modal       { color:var(--white); }
.grupe-modal .pos-modal-title { color:var(--white); margin:0; }
.grupe-header      { display:flex; align-items:center; gap:10px; padding-bottom:10px; border-bottom:1px solid rgba(255,255,255,0.1); }
.grupe-header .pos-modal-title { flex:1; text-align:left; font-size:var(--fs-md); }
.grupe-back-btn    { background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2); color:var(--white); border-radius:6px; padding:6px 12px; font-size:0.9rem; font-weight:600; cursor:pointer; }
.grupe-back-btn:hover { background:rgba(255,255,255,0.2); }
.grupe-search-btn  { background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2); color:var(--white); border-radius:6px; padding:6px 12px; font-size:1.05rem; cursor:pointer; }
.grupe-search-btn:hover { background:rgba(255,255,255,0.22); }
.grupe-close-btn   { width:32px; height:32px; padding:0; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.2); color:var(--white); border-radius:50%; font-size:1rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.grupe-close-btn:hover { background:rgba(255,255,255,0.22); }
.grupe-info        { padding:24px; text-align:center; color:rgba(255,255,255,0.6); font-size:0.95rem; }
.grupe-info code   { background:rgba(255,255,255,0.1); padding:2px 6px; border-radius:4px; color:#7ab4ff; }
.grupe-grid        { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:10px; overflow-y:auto; padding:4px; }
.grupe-grid::-webkit-scrollbar { width:8px; }
.grupe-grid::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.35); border-radius:4px; }
.grupe-card        { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:22px 12px 14px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.15); border-radius:10px; cursor:pointer; transition:background .12s, border-color .12s; min-height:80px; color:var(--white); }
.grupe-card:hover  { background:rgba(255,255,255,0.14); border-color:rgba(255,255,255,0.35); }
.grupe-card-badge  { position:absolute; top:6px; left:8px; font-size:0.72rem; font-weight:800; color:#1a2744; background:#7ab4ff; border-radius:4px; padding:2px 6px; letter-spacing:0.5px; }
.grupe-card-den    { font-size:1rem; font-weight:700; color:var(--white); text-align:center; line-height:1.2; }
.grupe-produse-list { display:flex; flex-direction:column; gap:4px; overflow-y:auto; max-height:60vh; padding-right:4px; }
.grupe-produse-list::-webkit-scrollbar { width:8px; }
.grupe-produse-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.35); border-radius:4px; }
.grupe-prod-row    { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:10px 14px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); border-radius:7px; cursor:pointer; text-align:left; transition:background .12s, border-color .12s; }
.grupe-prod-row:hover { background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.2); }
.grupe-prod-den    { font-size:1rem; font-weight:700; color:var(--white); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.grupe-prod-pret   { font-size:1rem; font-weight:700; color:#7ab4ff; white-space:nowrap; }
.grupe-prod-pret small { font-size:0.7rem; opacity:0.7; font-weight:500; }

.cif-numpad     { display:flex; flex-direction:column; gap:6px; }
.cif-npad-row   { display:flex; gap:6px; }
.cif-npad-btn   { flex:1; padding:14px 0; font-size:1.15rem; font-weight:700; background:#1e2d3d; color:#e0eaf8; border:1px solid #2a3a4a; border-radius:7px; cursor:pointer; transition:background .13s; }
.cif-npad-btn:hover  { background:#2a7fd4; border-color:#2a7fd4; color:#fff; }
.cif-npad-ro    { background:#1a3a1a; border-color:#2a6a2a; color:#7fff7f; font-size:0.95rem; }
.cif-npad-ro:hover   { background:#2a7a2a; border-color:#2a7a2a; color:#fff; }
.cif-npad-bs    { background:#3a1a1a; border-color:#6a2a2a; color:#ff9999; }
.cif-npad-bs:hover   { background:#7a2a2a; border-color:#7a2a2a; color:#fff; }
/* Utilizatori & Grupuri */
.cfg-util-toolbar { display:flex; align-items:center; gap:10px; padding:8px 20px; border-bottom:1px solid var(--border); }
.cfg-util-form { margin:0 20px 8px; border:2px solid var(--accent); border-radius:var(--rad-sm); overflow:hidden; }
.cfg-util-form-title { background:var(--accent); color:var(--white); font-size:var(--fs-xs); font-weight:700; padding:4px 10px; }
.cfg-util-table-wrap { margin:0 20px; max-height:320px; overflow-y:auto; border:1px solid var(--border); border-radius:var(--rad-sm); }
.cfg-viz-table td { padding:5px 10px; border-bottom:1px solid var(--border); font-size:var(--fs-sm); }
.cfg-viz-table tbody tr:last-child td { border-bottom:none; }
.cfg-viz-table tbody tr:hover td { background:var(--bg); }
.cfg-util-inactiv td { opacity:.5; font-style:italic; }
.cfg-util-actions { white-space:nowrap; text-align:right; }
.cfg-util-btn-del { border-color:#e53935; color:#c62828; }
.cfg-util-btn-del:hover:not(:disabled) { background:#ffebee; }
.cfg-err-inline { color:#c62828; font-size:var(--fs-sm); }
.cfg-ok-inline  { color:#2e7d32; font-size:var(--fs-sm); }
/* ── Conectivitate ────────────────────────────────── */
.cfg-conectivitate { display:flex; flex-direction:column; gap:12px; padding:8px 0; }
.cfg-conn-status { font-size:1.1rem; font-weight:700; padding:10px 16px; border-radius:var(--rad-sm); letter-spacing:.5px; }
.cfg-conn-online  { background:#e8f5e9; color:#2e7d32; }
.cfg-conn-offline { background:#fff3e0; color:#e65100; }
.cfg-conn-info    { font-size:var(--fs-sm); color:var(--text-sm); }
.cfg-conn-btns    { display:flex; gap:8px; flex-wrap:wrap; }
.cfg-conn-warning { background:#fff3e0; color:#e65100; border:1px solid #ffcc80; border-radius:var(--rad-sm); padding:8px 12px; font-size:var(--fs-sm); }
.cfg-conn-errors   { background:#fff8f8; border:1px solid #ffcdd2; border-radius:var(--rad-sm); padding:8px 12px; }
.cfg-conn-error-row { font-size:var(--fs-sm); color:#c62828; font-family:'Consolas',monospace; padding:2px 0; }
.cfg-viz-table-wrap { overflow-y:auto; max-height:340px; border:1px solid var(--border); border-radius:var(--rad-sm); }
.cfg-viz-table { width:100%; border-collapse:collapse; font-size:var(--fs-sm); }
.cfg-viz-table thead tr { background:var(--navy); color:var(--white); position:sticky; top:0; }
.cfg-viz-table th { padding:8px 12px; text-align:left; font-weight:700; font-size:var(--fs-xs); letter-spacing:.4px; }
.cfg-viz-table tbody tr { border-bottom:1px solid var(--border); }
.cfg-viz-table tbody tr:hover { background:var(--bg); }
.cfg-viz-override { background:#fff8e1 !important; }
.cfg-viz-key  { padding:7px 12px; font-weight:600; color:var(--navy); white-space:nowrap; }
.cfg-viz-srv  { padding:7px 12px; color:var(--text-sm); font-family:'Consolas',monospace; }
.cfg-viz-loc  { padding:4px 8px; }
.cfg-viz-input { width:100%; border:1px solid var(--border); border-radius:4px; padding:4px 8px; font-family:'Consolas',monospace; font-size:var(--fs-sm); background:var(--white); color:var(--navy); }
.cfg-viz-input:focus { outline:2px solid var(--blue); border-color:transparent; }
.cfg-viz-editlabel { font-size:0.65rem; font-weight:400; opacity:.7; }
.cfg-viz-info { padding:7px 12px; font-size:0.68rem; color:var(--text-sm); font-style:italic; max-width:220px; }
.cfg-viz-input select, select.cfg-viz-input { width:100%; border:1px solid var(--border); border-radius:4px; padding:4px 8px; font-size:var(--fs-sm); background:var(--white); color:var(--navy); }
.cfg-viz-folder-row { display:flex; gap:4px; align-items:stretch; }
.cfg-viz-folder-row .cfg-viz-input { flex:1; }
.cfg-viz-folder-btn { padding:4px 10px; border:1px solid var(--border); border-radius:4px; background:var(--white); cursor:pointer; font-size:var(--fs-sm); }
.cfg-viz-folder-btn:hover { background:var(--bg); }

/* ── Stare AMEF afișată inline în Admin AMEF ── */
.cfg-amef-stare { background:var(--bg); border:1px solid var(--border); border-radius:6px;
                  padding:12px 14px; margin:14px 0; font-size:0.85rem; }
.cfg-amef-stare-titlu { font-weight:700; color:var(--navy); margin:8px 0 4px;
                         padding-bottom:4px; border-bottom:1px solid var(--border); }
.cfg-amef-stare-titlu:first-child { margin-top:0; }
.cfg-amef-stare-row   { display:flex; justify-content:space-between; align-items:baseline;
                         padding:3px 0; font-family:'Consolas',monospace; font-size:0.82rem; }
.cfg-amef-stare-row.stare-ok    strong { color:#2e7d32; }
.cfg-amef-stare-row.stare-warn  strong { color:#c0392b; }

/* ── Verificare AMEF modal ── */
.amef-issue { background:#fff3e0; border-left:4px solid var(--orange);
              padding:10px 14px; margin:8px 0; border-radius:4px; }
.amef-issue-titlu  { font-weight:600; font-size:0.95rem; color:#7c4a00; margin-bottom:4px; }
.amef-issue-detail { font-size:0.85rem; color:#5a3700; line-height:1.5; }
.amef-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; }

/* ════════════════════════════════════════════════════════════
   CUSTOMER DISPLAY  /display
   ════════════════════════════════════════════════════════════ */
.cd-root { width:100vw; height:100vh; background:#0d0d0d; color:#fff;
           font-family:'Segoe UI','Roboto',sans-serif; overflow:hidden; }

.cd-wrap { display:grid; height:100vh;
           grid-template-rows: 28% 1fr;
           padding-top:40px; box-sizing:border-box;  /* compensare margin -40 MAUI */ }

/* ── Rândul de jos: media + bon side by side ── */
.cd-bottom { display:grid; grid-template-columns: 40% 60%; min-height:0; }

/* ── Top: ultimul produs ── */
.cd-top { display:flex; flex-direction:column; justify-content:center; align-items:center;
          background:#111; border-bottom:2px solid #1e3a5f;
          padding:16px 32px; text-align:center; }
.cd-top-idle { background:#0d0d0d; }
.cd-prd-den   { font-size:clamp(1.6rem,4vw,3.2rem); font-weight:700;
                color:#fff; line-height:1.2; max-width:90vw; }
.cd-prd-det   { display:flex; gap:16px; align-items:baseline;
                margin-top:10px; flex-wrap:wrap; justify-content:center; }
.cd-prd-cant  { font-size:1.4rem; color:#aaa; }
.cd-prd-pret  { font-size:2rem; font-weight:600; color:#4fc3f7; }
.cd-prd-sep   { font-size:1.4rem; color:#666; }
.cd-prd-total { font-size:2.2rem; font-weight:700; color:#fff176; }
.cd-welcome-text { font-size:clamp(2rem,5vw,4rem); font-weight:700; color:#4fc3f7; }
.cd-welcome-sub  { font-size:1.2rem; color:#666; margin-top:8px; }
.cd-casa-inchisa-modal { position:fixed; inset:0; display:flex; align-items:center;
                          justify-content:center; background:#0d0d0d; z-index:25;
                          padding-top:40px; /* compensare margin -40 MAUI */ }
.cd-casa-inchisa-img   { width:70vw; max-height:90vh; object-fit:contain; }
.cd-corner-logo  { position:fixed; top:52px; right:16px; height:7vh; width:auto;
                   z-index:30; pointer-events:none;
                   filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }

/* ── Media / reclame ── */
.cd-media { background:#0a0a0a; display:flex; align-items:center;
            justify-content:center; overflow:hidden;
            border-right:1px solid #1e2e3e; }
.cd-media-placeholder { display:flex; align-items:center;
                         justify-content:center; gap:8px; opacity:.12; }
.cd-media-label { font-size:0.75rem; letter-spacing:4px; color:#fff; }
.cd-media-img   { width:100%; height:100%; object-fit:contain;
                  animation: cdFade 0.5s ease-in; }
@keyframes cdFade { from { opacity:0; } to { opacity:1; } }

/* ── Bon list + total ── */
.cd-bon-zona { display:flex; flex-direction:column;
               background:#0d0d0d; min-height:0; overflow:hidden; }
.cd-bon-lista { flex:1; overflow-y:auto; padding:4px 0; }
.cd-bon-lista::-webkit-scrollbar { width:4px; }
.cd-bon-lista::-webkit-scrollbar-thumb { background:#333; border-radius:2px; }

.cd-bon-header,
.cd-linie { display:grid;
            grid-template-columns: 1fr minmax(52px,auto) minmax(52px,auto) minmax(80px,auto);
            gap:0 10px; padding:5px 20px; align-items:center; }
.cd-bon-header { padding:4px 20px 4px; border-bottom:1px solid #1e3a5f;
                 margin-bottom:2px; }
.cd-linie { border-bottom:1px solid #161616; }
.cd-linie-anulat .cd-l-den,
.cd-linie-anulat .cd-l-qty,
.cd-linie-anulat .cd-l-pret,
.cd-linie-anulat .cd-l-total { text-decoration:line-through; color:#c0392b !important;
                                 opacity:.7; }

.cd-h-den,
.cd-h-qty,
.cd-h-pret,
.cd-h-val   { font-size:0.65rem; font-weight:700; letter-spacing:.8px;
              color:#2a5a8a; text-transform:uppercase; }
.cd-h-qty, .cd-h-pret, .cd-h-val { text-align:right; }

.cd-l-den   { font-size:1rem; color:#ddd;
              white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cd-l-qty   { font-size:0.85rem; color:#777; white-space:nowrap;
              text-align:right; font-variant-numeric:tabular-nums; }
.cd-l-pret  { font-size:0.85rem; color:#777; white-space:nowrap;
              text-align:right; font-variant-numeric:tabular-nums; }
.cd-l-total { font-size:1rem; font-weight:600; color:#fff;
              white-space:nowrap; text-align:right;
              font-variant-numeric:tabular-nums; }
.cd-linie-disc { padding:1px 20px 4px 40px; font-size:0.8rem; color:#ff9070; }

.cd-total-bar { display:flex; justify-content:space-between; align-items:center;
                padding:10px 20px; background:#142030;
                border-top:2px solid #1e4060; flex-shrink:0; }
.cd-total-label { font-size:2.5rem; font-weight:600; color:#aaa; letter-spacing:1px; }
.cd-total-val   { font-size:clamp(2.2rem,4vw,3.4rem);
                  font-weight:800; color:#69f0ae; }
.cd-bon-gol { display:flex; align-items:center; justify-content:center;
              flex:1; color:#2a2a2a; font-size:1rem; font-style:italic; }

/* ── Overlay ultima vânzare ── */
.cd-ultim-overlay { position:absolute; inset:0; background:#060e18;
                    display:flex; flex-direction:column; align-items:center;
                    justify-content:center; gap:32px; z-index:20;
                    padding:88px 48px 48px 48px;   /* +40px top pentru compensare margin -40 MAUI */ }
.cd-ultim-icon    { font-size:7rem; color:#69f0ae; line-height:1; }
.cd-ultim-title   { font-size:3.2rem; font-weight:700; color:#fff;
                    letter-spacing:.5px; }
.cd-ultim-rows    { width:100%; max-width:900px; display:flex;
                    flex-direction:column; gap:12px; }
.cd-ultim-row     { display:flex; justify-content:space-between;
                    align-items:baseline; font-size:2.2rem; }
.cd-ultim-total-row { font-size:2.8rem; font-weight:700; color:#fff;
                      border-bottom:1px solid #1e3a5f; padding-bottom:12px;
                      margin-bottom:4px; }
.cd-ultim-sub     { font-size:1.9rem; color:#888; padding-left:32px; }
.cd-ultim-disc-row { color:#ff9070 !important; }
.cd-ultim-sep     { border-top:1px solid #1e3a5f; margin:12px 0; }
.cd-ultim-plata   { font-size:2.3rem; color:#4fc3f7; font-weight:600; }
.cd-ultim-rest-row { font-size:2.2rem; color:#fff176; font-weight:600; }
.cd-ultim-thanks  { font-size:3.6rem; font-weight:700; color:#69f0ae;
                    margin-top:16px; letter-spacing:.5px; }
.cd-ultim-client  { text-align:center; padding:8px 16px;
                    border:1px solid #1e3a5f; border-radius:8px;
                    background:#0f1c2c; min-width:60vw; }
.cd-ultim-client-den { font-size:2rem; font-weight:600; color:#4fc3f7; }
.cd-ultim-client-cif { font-size:1.5rem; color:#aaa; margin-top:4px; }

#blazor-error-ui {
    background:var(--orange); color:#fff; padding:8px 20px;
    position:fixed; bottom:0; left:0; right:0; display:none;
    text-align:center; z-index:9999; font-size:var(--fs-sm);
}
#blazor-error-ui .reload { color:#ffe; margin:0 10px; }
#blazor-error-ui .dismiss { cursor:pointer; float:right; }
