:root {
    --page-bg: #f0f2f5;
    --card-bg: #ffffff;
    --input-bg: #e8ecf1;
    --sidebar-bg: #ffffff;
    --header-bg: #e8ecf1;
    --text-primary: #1a1a2e;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --success: #27ae60;
    --warning: #e67e22;
    --info: #2980b9;
    --border: #d1d8e0;
    --grid-alt: #f8f9fa;
    --grid-line: #e0e4e8;
    --sidebar-w: 212px;
    --topbar-h: 48px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    min-height: 100%;
    min-height: 100dvh;
    background: var(--page-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

body.bo-app {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    padding-left: var(--safe-l);
    padding-right: var(--safe-r);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    z-index: 1040;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-t);
    padding-bottom: var(--safe-b);
}
.sidebar-brand {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 8px 8px 6px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo {
    display: block;
    flex: 1;
    min-width: 0;
    line-height: 0;
}
.sidebar-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 86px;
    object-fit: contain;
    object-position: center;
}
.sidebar-brand .sidebar-close { color: var(--text-primary); }
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px 10px; min-height: 0; }
.sidebar-group { margin: 0 0 4px; }
.sidebar-section {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; border: 0; background: transparent; text-align: left;
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    padding: 8px 8px; cursor: pointer; border-radius: 6px;
}
.sidebar-section:hover { background: var(--input-bg); }
.sidebar-section .chevron { font-size: 14px; color: var(--text-muted); transition: transform .15s; }
.sidebar-group.is-open .chevron { transform: rotate(90deg); }
.sidebar-group > .nav { display: none; flex-direction: column; }
.sidebar-group.is-open > .nav { display: flex; }
.sidebar .nav-link {
    color: var(--text-secondary); padding: 7px 10px 7px 18px; border-radius: 6px;
    font-size: 13px; text-decoration: none;
}
.sidebar .nav-link:hover { color: var(--text-primary); background: var(--input-bg); }
.sidebar .nav-link.active {
    color: #fff; background: var(--accent); font-weight: 600;
}
.sidebar-user {
    border-top: 1px solid var(--border);
    padding: 8px;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-avatar {
    width: 32px; height: 32px; border-radius: 16px; background: var(--input-bg);
    color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; color: var(--text-primary); line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: var(--text-secondary); }
.btn-icon {
    width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer;
    border-radius: 6px; color: var(--text-secondary);
}
.btn-icon:hover { background: var(--input-bg); color: var(--text-primary); }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100dvh; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h); min-height: var(--topbar-h);
    padding: 0 15px 0 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border-bottom: 1px solid var(--border); background: var(--page-bg);
    position: sticky; top: 0; z-index: 1020;
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.topbar h1 {
    font-size: 18px; font-weight: 700; margin: 0; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-menu-toggle, .sidebar-close { display: none; }
.content-area { padding: 16px 20px 24px; flex: 1; min-width: 0; }
body.is-filtering .table-host,
body.is-filtering .cat-split,
body.is-filtering .mm-grid-wrap { opacity: 0.55; transition: opacity 0.12s; }

.card-bo {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: none;
}
.kpi-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; min-width: 140px; flex: 1 1 140px; max-width: 220px;
}
.kpi-label { font-size: 11px; color: var(--text-secondary); text-transform: none; }
.kpi-value { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.kpi-delta { font-size: 10px; color: var(--text-muted); }

.filters-bar {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 8px;
}
.filters-bar .form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.filters-bar .form-control, .filters-bar .form-select {
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px; min-height: 30px;
}
.btn-accent {
    background: var(--accent); color: #fff; border: 0; border-radius: 6px;
    height: 30px; padding: 0 14px; font-size: 12px; font-weight: 600;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-bo {
    height: 30px; padding: 0 10px; font-size: 12px; font-weight: 600;
    border-radius: 6px; border: 1px solid var(--border); background: var(--input-bg);
    color: var(--text-primary);
}
.btn-bo-sm { height: 28px; padding: 0 8px; font-size: 11px; }

.tabs-scroll {
    display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; border-bottom: 2px solid var(--border);
    margin-bottom: 8px; flex-wrap: nowrap;
}
.tabs-scroll .tab-link {
    flex: 0 0 auto; padding: 8px 14px; font-size: 13px; color: var(--text-secondary);
    text-decoration: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
    white-space: nowrap;
}
.tabs-scroll .tab-link:hover { background: var(--input-bg); color: var(--text-primary); }
.tabs-scroll .tab-link.active {
    color: var(--text-primary); font-weight: 600; background: var(--card-bg);
    border-bottom-color: var(--accent);
}

.pulse-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.pulse-kpi {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 10px; min-width: 200px; max-width: 280px; flex: 1 1 200px;
}
.pulse-kpi-val { font-size: 20px; font-weight: 700; line-height: 1.2; }
.pulse-kpi-val.is-pink { color: #FF0080; }
.pulse-kpi-val.is-orange { color: #FF6D00; }
.pulse-kpi-val.is-muted { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.cr-subtabs {
    display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid var(--border);
    margin: 4px 0 10px; flex-wrap: nowrap;
}
.cr-subtabs .cr-tab {
    flex: 0 0 auto; padding: 6px 10px; font-size: 11px; color: var(--text-secondary);
    background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
    cursor: pointer; white-space: nowrap;
}
.cr-subtabs .cr-tab:hover { background: var(--input-bg); color: var(--text-primary); }
.cr-subtabs .cr-tab.is-on {
    color: var(--text-primary); font-weight: 600; background: var(--input-bg); border-bottom-color: var(--accent);
}
.cr-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.cr-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); margin: 0; }
.cr-filters .form-control, .cr-filters .form-select {
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px; min-height: 30px; height: 30px;
}
.btn-recalc { background: #00695C; min-width: 150px; height: 30px; }
.btn-recalc:hover { background: #00897B; color: #fff; }
.table-bo.produse-grid tbody tr.produs-row.cr-teal.is-selected td {
    border-top-color: #00ACC1; border-bottom-color: #00ACC1;
}
.table-bo.produse-grid tbody tr.produs-row.cr-teal.is-selected td:first-child { border-left-color: #00ACC1; }
.table-bo.produse-grid tbody tr.produs-row.cr-teal.is-selected td:last-child { border-right-color: #00ACC1; }
.table-bo.produse-grid tbody tr.produs-row.cr-amber.is-selected td {
    border-top-color: #FF8F00; border-bottom-color: #FF8F00;
}
.table-bo.produse-grid tbody tr.produs-row.cr-amber.is-selected td:first-child { border-left-color: #FF8F00; }
.table-bo.produse-grid tbody tr.produs-row.cr-amber.is-selected td:last-child { border-right-color: #FF8F00; }
#clientIstoricModal .modal-dialog { max-width: 1020px; }
#clientAdreseModal .modal-dialog { max-width: 760px; }

.mm-page { display: flex; flex-direction: column; gap: 6px; min-height: calc(100dvh - 88px); }
.mm-bar { padding: 8px 8px 6px; }
.mm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; }
.mm-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-right: 6px; }
.mm-count { font-size: 12px; color: var(--text-secondary); margin-right: 6px; }
.mm-inl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); margin: 0; }
.mm-inp {
    display: inline-flex; background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 4px; padding: 1px 3px;
}
.mm-inp .form-select, .mm-inp .form-control {
    background: transparent; border: 0; box-shadow: none; min-height: 24px; height: 24px;
    font-size: 12px; padding: 0 6px; width: auto; min-width: 84px;
}
.mm-inp-grow { flex: 1; min-width: 160px; width: 100%; }
.mm-inp-grow .form-control { width: 100%; min-width: 0; }
.mm-search { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.mm-btn {
    height: 28px; min-width: 76px; padding: 0 10px; border: 0; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.mm-btn-load { background: #1E88E5; width: 84px; }
.mm-btn-load:hover { background: #2196F3; color: #fff; }
.mm-btn-reset { background: #EF6C00; width: 74px; }
.mm-btn-reset:hover { background: #F57C00; color: #fff; }
.mm-btn-go { background: var(--success); width: 100px; height: 30px; color: #0f0f23; }
.mm-btn-go:hover { background: #2ecc71; color: #0f0f23; }
.mm-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.mm-grid-wrap { padding: 1px; flex: 1; min-height: 180px; }
.mm-page .table-host { max-height: calc(100dvh - 268px); border: 0; border-radius: 8px; }
.mm-grid { min-width: 1100px; }
.mm-grid thead th { font-size: 11px; padding: 3px 6px; height: 28px; border-right: 1px solid var(--border); }
.mm-grid td { font-size: 11px; padding: 0 4px; height: 24px; }
.mm-grid .mm-f { position: sticky; z-index: 3; }
.mm-grid .mm-c0 { left: 0; width: 30px; min-width: 30px; max-width: 30px; text-align: center; }
.mm-grid .mm-c1 { left: 30px; width: 50px; min-width: 50px; }
.mm-grid .mm-c2 { left: 80px; min-width: 220px; box-shadow: 6px 0 8px -6px rgba(0,0,0,.12); }
.mm-grid thead th.mm-f { z-index: 5; background: var(--header-bg); }
.mm-grid tbody tr:nth-child(odd) td.mm-f { background: var(--card-bg); }
.mm-grid tbody tr:nth-child(even) td.mm-f { background: var(--grid-alt); }
.mm-grid tbody tr:hover td.mm-f { background: var(--input-bg); }
.mm-grid tbody tr.produs-row.is-selected td.mm-f,
.mm-grid tbody tr.produs-row.is-selected:hover td.mm-f { background: var(--card-bg); }
.mm-grid tbody tr.produs-row.is-selected:nth-child(even) td.mm-f,
.mm-grid tbody tr.produs-row.is-selected:nth-child(even):hover td.mm-f { background: var(--grid-alt); }
.mm-grid .bo-chk { width: 16px; height: 16px; }
.mm-actions { padding: 8px 8px 5px; }
.mm-sel { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.mm-act-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mm-bulk .mm-inp .form-select { min-width: 160px; height: 26px; }
.mm-bulk:last-of-type .mm-inp .form-select { min-width: 190px; }

.table-host {
    overflow: auto;
    max-height: calc(100dvh - 220px);
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.content-area:has(.produse-grid) .table-host { max-height: calc(100dvh - 360px); }
.content-area:has(.doc-grid) .table-host.doc-grid-host { max-height: calc(100dvh - 340px); }
.content-area:has(.cat-split) .table-host { max-height: none; }
.table-bo { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.table-bo thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--header-bg); color: #555; font-size: 11px; font-weight: 600;
    text-transform: none; letter-spacing: 0; padding: 6px 8px; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table-bo thead th.is-sortable {
    cursor: pointer;
    user-select: none;
}
.table-bo thead th.is-sortable:hover {
    color: var(--text-primary);
    background: #dce3eb;
}
.table-bo thead th.is-sorted { color: var(--text-primary); }
.table-bo thead th.is-sorted::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
    border: 4px solid transparent;
}
.table-bo thead th.sort-asc::after {
    border-bottom: 5px solid var(--accent);
    border-top-width: 0;
    margin-bottom: 2px;
}
.table-bo thead th.sort-desc::after {
    border-top: 5px solid var(--accent);
    border-bottom-width: 0;
    margin-top: 2px;
}
.table-bo td { font-size: 12px; padding: 5px 8px; vertical-align: middle; border-bottom: 1px solid var(--grid-line); white-space: nowrap; }
.table-bo input.cm-nec {
    width: 88px; height: 24px; margin: 0; padding: 0 6px;
    text-align: right; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border); border-radius: 4px;
    background: #fff; color: var(--text-primary);
}
.table-bo input.cm-nec:focus {
    outline: 2px solid var(--accent); border-color: var(--accent);
}
.table-bo tbody tr:nth-child(even) { background: var(--grid-alt); }
.table-bo tbody tr:hover { background: var(--input-bg); }
.table-bo .col-actions {
    position: sticky; right: 0; z-index: 3;
    background: inherit; box-shadow: -6px 0 8px -6px rgba(0,0,0,.12);
    text-align: right; white-space: nowrap;
}
.table-bo thead th.col-actions { z-index: 4; background: var(--header-bg); }

.table-bo.produse-grid tbody tr.produs-row { cursor: pointer; }
.table-bo.produse-grid tbody tr.produs-row.is-inactive { opacity: .55; }
.table-bo.produse-grid tbody tr.produs-row.is-deleted { opacity: .4; }
.table-bo.produse-grid tbody tr.produs-row.is-selected { opacity: 1; }
.table-bo.produse-grid tbody tr.produs-row.is-selected td {
    border-top: 2px solid #FF0080;
    border-bottom: 2px solid #FF0080;
    background: transparent;
}
.table-bo.produse-grid tbody tr.produs-row.is-selected td:first-child {
    border-left: 2px solid #FF0080;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.table-bo.produse-grid tbody tr.produs-row.is-selected td:last-child {
    border-right: 2px solid #FF0080;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.table-bo.produse-grid tbody tr.produs-row.is-selected:hover { background: transparent; }
.table-bo.produse-grid tbody tr.produs-row.is-selected:nth-child(even) { background: var(--grid-alt); }

.table-bo .col-gear {
    position: sticky; left: 0; z-index: 3;
    width: 50px; min-width: 50px; max-width: 50px;
    text-align: center; padding: 4px 6px;
    background: inherit;
    box-shadow: 6px 0 8px -6px rgba(0,0,0,.12);
}
.table-bo thead th.col-gear { z-index: 4; background: var(--header-bg); }
.table-bo tbody tr:nth-child(odd) td.col-gear { background: var(--card-bg); }
.table-bo tbody tr:nth-child(even) td.col-gear { background: var(--grid-alt); }
.table-bo tbody tr:hover td.col-gear { background: var(--input-bg); }
.table-bo tbody tr.produs-row.is-selected td.col-gear,
.table-bo tbody tr.produs-row.is-selected:hover td.col-gear { background: var(--card-bg); }
.table-bo tbody tr.produs-row.is-selected:nth-child(even) td.col-gear,
.table-bo tbody tr.produs-row.is-selected:nth-child(even):hover td.col-gear { background: var(--grid-alt); }

.produs-gear {
    width: 32px; height: 24px; padding: 0;
    border: 1px solid #7A8FA8; border-radius: 8px;
    background: transparent; color: #FF0080;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1; opacity: .92; cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
}
.produs-gear:hover, .produs-gear.is-open {
    opacity: 1; background: rgba(61, 165, 255, .06); border-color: #4F86C6; transform: scale(1.1);
}
.produs-gear:active { transform: scale(.95); background: rgba(61, 165, 255, .09); border-color: #3B6B9C; }

.produs-gear-menu {
    position: fixed; z-index: 1080; min-width: 240px;
    background: var(--card-bg); border: 1px solid rgba(233, 69, 96, .24);
    border-radius: 10px; padding: 8px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.produs-gear-menu button,
.produs-gear-menu a[role="menuitem"] {
    display: flex; align-items: center; width: 100%;
    border: 0; background: transparent; color: var(--text-primary);
    font-size: 13px; text-align: left; padding: 6px 8px 6px 8px;
    border-radius: 6px; cursor: pointer; gap: 10px; text-decoration: none;
}
.produs-gear-menu button:hover,
.produs-gear-menu a[role="menuitem"]:hover { background: color-mix(in srgb, var(--c, #90A4AE) 10%, transparent); color: var(--text-primary); }
.produs-gear-menu .pgm-ico {
    width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--c) 18%, transparent);
    color: var(--c); font-size: 13px;
}
.produs-gear-menu .pgm-sep {
    height: 1px; margin: 4px 12px; background: rgba(233, 69, 96, .16);
}
.produs-gear-menu button.is-hidden { display: none; }

.loc-pill {
    background: var(--input-bg); border: 0; border-radius: 10px; padding: 3px 8px;
    color: var(--accent); font-weight: 600; font-size: 14px; max-width: 220px;
}
.chart-box { position: relative; height: 240px; min-height: 180px; }
.sidebar-backdrop { display: none; }

.login-page {
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 50%, #1e73be 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
}
.login-card { width: 100%; max-width: 420px; border: none; border-radius: 12px; }

.page-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; margin-bottom: 10px;
}
.page-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-head-title .ph-ico { font-size: 22px; line-height: 1; }
.page-head-title h2 {
    margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.1;
}
.page-head-title .ph-count { color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.page-head-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.md-acc { display: flex; flex-direction: column; gap: 8px; }
.md-sala { overflow: hidden; padding: 0; }
.md-sala-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; border: 0; background: transparent; text-align: left;
    padding: 12px 14px; cursor: pointer; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.md-sala-head:hover { background: var(--input-bg); }
.md-sala.is-open .md-sala-head { border-radius: 10px 10px 0 0; }
.md-sala-title {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
    min-width: 0; flex: 1;
}
.md-sala-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-sala-stats { font-size: 12px; font-weight: 400; color: var(--text-secondary); white-space: nowrap; }
.md-sala-stats .is-busy { color: var(--accent); font-weight: 600; }
.md-sala-head .chevron { font-size: 14px; color: var(--text-muted); transition: transform .15s; flex-shrink: 0; }
.md-sala.is-open .chevron { transform: rotate(90deg); }
.md-sala-panel {
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease;
}
.md-sala.is-open .md-sala-panel { grid-template-rows: 1fr; }
.md-sala-panel-inner { overflow: hidden; min-height: 0; border-top: 1px solid transparent; }
.md-sala.is-open .md-sala-panel-inner { border-top-color: var(--border); }
.md-mese {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 8px;
    padding: 10px;
}
.md-masa-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; min-height: 92px; padding: 10px 8px; width: 100%; position: relative;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--md-bg, var(--card-bg)); color: var(--md-fg, var(--text-primary));
    font-size: 13px; font-family: inherit; text-align: center; cursor: default;
}
.md-masa-card.has-color { border-color: transparent; }
.md-masa-card.is-ocupata {
    background: #e94560; color: #fff; border-color: transparent; cursor: pointer;
}
.md-masa-card.is-ocupata:hover { filter: brightness(1.06); }
.md-masa-card.is-flag { box-shadow: inset 0 0 0 2px #FFD600; }
.md-masa-flag {
    position: absolute; top: 6px; right: 6px;
    background: #FFD600; color: #1a1a2e;
    font-size: 9px; font-weight: 800; letter-spacing: .04em;
    padding: 2px 6px; border-radius: 4px; line-height: 1.3;
}
.md-masa-title {
    font-size: 13px; font-weight: 700; line-height: 1.25; text-align: center;
    width: 100%; word-break: break-word;
}
.md-masa-ocup { width: 100%; font-size: 11px; font-weight: 400; opacity: .95; }
.md-masa-libera { width: 100%; font-size: 12px; font-weight: 700; color: var(--success); }
.md-masa-user { font-weight: 600; margin-bottom: 2px; }
.md-masa-kpis { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 10px; }
.md-empty { padding: 12px 14px; font-size: 13px; color: var(--text-secondary); }
.md-antet {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px;
    background: linear-gradient(180deg, #fafbfc 0%, #f3f5f8 100%);
    border-bottom: 1px solid var(--border);
}
.md-chip {
    display: inline-flex; flex-direction: column; justify-content: center;
    gap: 1px; min-width: 120px;
    background: #fff; border-radius: 10px; padding: 7px 12px 8px 12px;
    font-size: 13px; color: var(--text-primary); line-height: 1.25;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(26, 26, 46, .06);
}
.md-chip-k {
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; opacity: .78;
}
.md-chip b { font-weight: 800; font-size: 13px; color: inherit; }
.md-chip.is-bon {
    background: linear-gradient(180deg, #fff1f4 0%, #ffe4ea 100%);
    border-color: #f5b4c0; color: #9b1b38;
}
.md-chip.is-user {
    background: linear-gradient(180deg, #eef5ff 0%, #dceaff 100%);
    border-color: #b7d3f5; color: #1a4f8b;
}
.md-chip.is-time {
    background: linear-gradient(180deg, #fff8eb 0%, #ffefd1 100%);
    border-color: #f0d09a; color: #8a5a12;
}
.md-chip.is-pers {
    background: linear-gradient(180deg, #eefaf2 0%, #d9f3e3 100%);
    border-color: #a8dfbf; color: #1b6b3a;
}
.md-bon-block { margin-bottom: 12px; border-bottom: 2px solid var(--border); }
.md-bon-block:last-child { border-bottom: 0; margin-bottom: 0; }
.md-prod-host { max-height: none; border-radius: 0; border-left: 0; border-right: 0; }
.md-prod-com { color: #D32F2F; font-size: 11px; font-weight: 500; margin-top: 2px; }
.md-total {
    text-align: right; padding: 10px 14px; font-size: 14px; color: var(--text-primary);
    background: var(--card-bg); border-bottom: 1px solid var(--border);
}
.md-log-title {
    font-size: 13px; font-weight: 600; color: var(--accent); padding: 10px 14px 6px;
}
.md-flag-banner {
    background: #FFF8E1; color: #5D4037; border-bottom: 2px solid #FFD600;
    padding: 8px 14px; font-size: 12px; font-weight: 600;
}
.md-log-host { max-height: 280px; overflow-x: hidden; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.md-log-host .table-bo { min-width: 0; width: 100%; table-layout: fixed; }
.md-log-host .table-bo th, .md-log-host .table-bo td { white-space: normal; vertical-align: top; }
.md-log-host .table-bo th:nth-child(1), .md-log-host .table-bo td:nth-child(1) { width: 18%; white-space: nowrap; }
.md-log-host .table-bo th:nth-child(2), .md-log-host .table-bo td:nth-child(2) { width: 18%; }
.md-log-host .table-bo th:nth-child(3), .md-log-host .table-bo td:nth-child(3) { width: 22%; }
.md-log-obs {
    overflow: visible; text-overflow: unset; max-width: none;
    white-space: normal; word-break: break-word; overflow-wrap: anywhere;
    font-size: 11px; color: var(--text-secondary);
}
.md-nota-lines {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px; line-height: 1.5; color: var(--text-primary);
}
.md-nota-row { word-break: break-word; }
.md-nota-disc { color: #C62828; padding-left: 10px; }
.md-nota-global { font-weight: 700; padding-left: 0; margin-top: 4px; }
.md-nota-total {
    font-weight: 700; margin-top: 4px; padding-top: 4px;
    border-top: 1px dashed var(--border);
}
.md-nota-bon { font-weight: 700; color: var(--accent); margin: 6px 0 2px; }
.md-log-host tbody tr.is-flag td { background: #FFEBEE; }
.md-log-host tbody tr.is-flag td:first-child { box-shadow: inset 3px 0 0 #e94560; }
#mdMasaModal .modal-header { height: auto; min-height: 50px; padding: 8px 20px; }
.md-modal-head { min-width: 0; flex: 1; }
.md-modal-nr { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 2px; }
#mdMasaModal .md-btn-close,
.md-btn-close {
    appearance: none; -webkit-appearance: none;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 148px; height: 42px; padding: 0 28px; margin: 0;
    border: 0; border-radius: 12px;
    background: linear-gradient(180deg, #ff6b81 0%, #e94560 52%, #c92a48 100%);
    color: #fff !important;
    font-family: inherit; font-size: 13px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; line-height: 1;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255,255,255,.35) inset,
        0 10px 22px rgba(233, 69, 96, .38);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
#mdMasaModal .md-btn-close:hover,
.md-btn-close:hover {
    color: #fff !important; filter: brightness(1.08);
    box-shadow:
        0 1px 0 rgba(255,255,255,.45) inset,
        0 12px 26px rgba(233, 69, 96, .5);
    transform: translateY(-1px);
}
#mdMasaModal .md-btn-close:active,
.md-btn-close:active {
    transform: translateY(1px); filter: brightness(.96);
    box-shadow:
        0 1px 0 rgba(255,255,255,.2) inset,
        0 4px 10px rgba(201, 42, 72, .28);
}
#mdMasaModal .md-btn-close:focus-visible,
.md-btn-close:focus-visible {
    outline: 3px solid rgba(233, 69, 96, .35);
    outline-offset: 2px;
}

.bn-filters { margin-bottom: 10px; }
.bn-filters .bn-tura { min-width: min(280px, 70vw); max-width: 360px; }
.bn-table-host { max-height: calc(100dvh - 280px); }
.bn-table { min-width: 1080px; }
.bn-table td.bn-id-cell { white-space: nowrap; width: 1%; }
.bn-table td:nth-child(3) { white-space: normal; }
.bn-table tbody tr.is-flag td { background: #FFFDE7; }
.bn-table tbody tr.is-flag td:first-child { box-shadow: inset 3px 0 0 #FFD600; }
.bn-id-cell { position: relative; padding-top: 6px; padding-bottom: 6px; }
.bn-id-link {
    appearance: none; -webkit-appearance: none;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; width: auto; max-width: max-content; flex: 0 0 auto;
    min-height: 28px; margin: 0; padding: 0 10px;
    border: 0; border-radius: 8px;
    background: linear-gradient(180deg, #ff6b81 0%, #e94560 52%, #c92a48 100%);
    color: #fff !important;
    font-family: inherit; font-size: 12px; font-weight: 800;
    letter-spacing: .02em; line-height: 1.2;
    white-space: nowrap; text-align: center; text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255,255,255,.35) inset,
        0 3px 8px rgba(233, 69, 96, .28);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.bn-id-link .bn-id-ico { font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 0 rgba(0,0,0,.15)); }
.bn-id-link:hover,
.bn-id-link:focus-visible {
    color: #fff !important; text-decoration: none; filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255,255,255,.45) inset,
        0 5px 12px rgba(233, 69, 96, .38);
}
.bn-id-link:focus-visible {
    outline: 3px solid rgba(233, 69, 96, .35);
    outline-offset: 2px;
}
.bn-id-link:active {
    transform: translateY(1px); filter: brightness(.96);
    box-shadow:
        0 1px 0 rgba(255,255,255,.22) inset,
        0 2px 6px rgba(201, 42, 72, .28);
}
.bn-id-link.is-flag {
    box-shadow:
        0 1px 0 rgba(255,255,255,.35) inset,
        0 0 0 2px #FFD600,
        0 3px 8px rgba(233, 69, 96, .28);
}
.bn-row-flag { position: static; flex-shrink: 0; }
.bn-user { font-weight: 600; line-height: 1.25; }
.bn-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
.bn-tip { font-size: 12px; font-weight: 700; margin-right: 4px; display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; padding: 3px 8px; }
.bn-tip b { font-weight: 800; }
.bn-tip.is-fisc { color: #0B5CAB; background: #E3F2FD; }
.bn-tip.is-prot { color: #6A1B9A; background: #F3E5F5; }
.bn-cards { display: none; flex-direction: column; gap: 8px; }
.bn-card { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.bn-card.is-flag { box-shadow: inset 0 0 0 2px #FFD600; }
.bn-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bn-card-meta, .bn-card-dates, .bn-pays {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    font-size: 12px; color: var(--text-secondary);
}
.bn-pays span { background: var(--input-bg); border-radius: 6px; padding: 2px 8px; color: var(--text-primary); font-weight: 600; font-size: 11px; }
@media (max-width: 767.98px) {
    .bn-table-host { display: none; }
    .bn-cards { display: flex; }
    .bn-filters .rv-inl { width: 100%; }
    .bn-filters .form-control, .bn-filters .form-select, .bn-filters input[type="date"] { width: 100%; min-width: 0; }
    .bn-filters .bn-tura { max-width: none; }
    .bn-filters .btn-accent { width: 100%; height: 40px; }
}
.btn-export {
    width: 80px; height: 30px; border: 0; border-radius: 6px; background: var(--input-bg);
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-export.is-xls { color: var(--success); }
.btn-export.is-pdf { color: var(--warning); }
.btn-ok {
    background: var(--success); color: #fff; border: 0; border-radius: 8px;
    height: 32px; padding: 0 16px; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer;
}
.btn-ok:hover { background: #2ecc71; color: #fff; }
.btn-ok-lg { height: 40px; width: 120px; font-size: 16px; }
.btn-danger-fill {
    background: var(--accent); color: #fff; border: 0; border-radius: 8px;
    height: 40px; width: 120px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-danger-fill:hover { background: var(--accent-hover); color: #fff; }
.btn-reset {
    width: 34px; height: 30px; border: 0; border-radius: 6px; background: #5C6BC0; color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.btn-reset:hover { background: #7986cb; color: #fff; }
.btn-reload {
    width: 36px; height: 28px; border: 0; border-radius: 6px; background: #1E88E5; color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.btn-reload:hover { color: #fff; filter: brightness(1.08); }
.btn-img-blue {
    background: #2563EB; color: #fff; border: 0; border-radius: 6px; height: 28px; padding: 0 12px;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-img-red {
    background: #C62828; color: #fff; border: 0; border-radius: 6px; height: 28px; padding: 0 12px;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.ico-btn {
    width: 31px; height: 24px; border: 0; border-radius: 5px; background: var(--input-bg);
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    font-size: 13px; margin: 0 1px; color: var(--text-primary); cursor: pointer; padding: 0;
}
.ico-btn:hover { background: var(--accent); color: #fff; }
.ico-btn.is-del:hover { background: #c0392b; color: #fff; }

.filters-bar .form-label { font-size: 10px; font-weight: 600; letter-spacing: 0; }
.filters-bar .form-control, .filters-bar .form-select { height: 32px; font-size: 12px; }
.filters-bar .form-check-label { font-size: 12px; color: var(--text-primary); }
.search-accent {
    background: var(--card-bg); border: 1.5px solid var(--accent); border-radius: 8px;
    padding: 8px 12px; margin-bottom: 8px;
}
.search-accent .sa-box {
    display: flex; align-items: center; gap: 8px; background: var(--input-bg);
    border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; min-height: 36px;
}
.search-accent .sa-box input {
    border: 0; background: transparent; outline: none; flex: 1; font-size: 14px; color: var(--text-primary); min-width: 0;
}
.search-accent .sa-box input::placeholder { color: var(--text-secondary); opacity: .6; font-size: 13px; }

.pager-bo {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 10px; margin-top: 8px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.pager-bo .pg-btn {
    height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: #3F51B5; color: #fff;
    font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center;
}
.pager-bo .pg-btn:hover { background: #4D63D1; color: #fff; }
.pager-bo .pg-btn.is-off { opacity: .55; pointer-events: none; }
.pager-bo .pg-meta { margin-left: auto; font-size: 12px; color: var(--text-secondary); }
.pager-bo label { font-size: 10px; color: var(--text-secondary); margin: 0 8px 0 0; }
.pager-bo select { height: 28px; font-size: 11px; background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; }

.table-bo.produse-grid td.col-name { font-weight: 600; }
.table-bo.produse-grid td.col-preta { color: #EF5350; font-weight: 700; text-align: right; }
.table-bo.produse-grid td.col-pretv { color: #1E7D32; font-weight: 700; text-align: right; }
.table-bo.produse-grid td.col-stoc { font-weight: 700; text-align: right; color: var(--text-secondary); }
.table-bo.produse-grid td.col-stoc.is-pos { color: #1E7D32; }
.table-bo.produse-grid td.col-stoc.is-neg { color: #EF5350; }
.table-bo td.col-stoc.is-pos { color: #1E7D32; font-weight: 700; }
.table-bo td.col-stoc.is-neg { color: #EF5350; font-weight: 700; }
.table-bo.produse-grid td.col-tip.is-ok { color: #1E7D32; font-weight: 600; }
.table-bo.produse-grid td.col-tip.is-miss { color: #D32F2F; font-weight: 600; }
.table-bo.produse-grid td.col-arestoc { text-align: center; font-weight: 600; color: #D32F2F; }
.table-bo.produse-grid td.col-arestoc.is-yes { color: #1E7D32; }
.table-bo.produse-grid thead th { font-size: 12px; border-right: 1px solid var(--border); }

.bo-modal .modal-content {
    border: 0; border-radius: 10px; background: var(--page-bg); overflow: hidden;
}
.bo-modal .modal-header {
    height: 50px; min-height: 50px; background: var(--card-bg); border: 0; padding: 0 20px;
    display: flex; align-items: center;
}
.bo-modal .modal-footer {
    height: 60px; min-height: 60px; background: var(--card-bg); border: 0; padding: 0 20px;
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.bo-modal .modal-title { font-size: 16px; font-weight: 600; }
.bo-modal .modal-dialog { max-width: 805px; }
.bo-modal.bo-dlg-sm .modal-dialog { max-width: 520px; }
#produsIstoricModal .modal-dialog { max-width: 900px; }
.bo-modal .modal-body { max-height: calc(100dvh - 180px); padding: 15px 20px; }
.bo-modal .form-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 5px; }
.bo-modal .form-label.req { color: var(--warning); font-weight: 600; }
.bo-modal .form-control, .bo-modal .form-select {
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
    box-shadow: none;
}
.bo-modal .form-control.is-req, .bo-modal .form-select.is-req {
    border-color: transparent; border-bottom: 2px solid var(--warning);
}
.bo-modal .section-label { color: var(--accent); font-size: 13px; font-weight: 600; margin: 4px 0 10px; }
.bo-modal .btn-x {
    width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent;
    color: var(--text-secondary); font-size: 16px; line-height: 1; cursor: pointer;
}
.bo-modal .btn-x:hover { background: var(--accent); color: #fff; }
.produs-img-box {
    width: 80px; height: 80px; border-radius: 6px; background: var(--input-bg);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
}
.produs-img-box.sm { width: 70px; height: 70px; }
.produs-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bo-modal .icon-sq {
    width: 35px; height: 35px; border: 0; border-radius: 6px; background: var(--input-bg);
    cursor: pointer; font-size: 16px;
}
.bo-modal .icon-sq:hover { background: var(--accent); }
.bo-chk {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0;
    border: 1.5px solid var(--border); border-radius: 3px; background: var(--input-bg);
    cursor: pointer; vertical-align: middle; position: relative; flex-shrink: 0;
}
.bo-chk:hover, .bo-chk:checked { border-color: var(--accent); }
.bo-chk:checked::after {
    content: ""; position: absolute; left: 3px; top: 1px; width: 8px; height: 11px;
    border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.bo-modal .form-check { display: flex; align-items: center; gap: 8px; }
.bo-modal .form-check-label { font-size: 13px; color: var(--text-primary); }

.cat-split { display: flex; flex-direction: column; gap: 0; min-height: calc(100dvh - 130px); }
.cat-pane { flex: 1; min-height: 240px; display: flex; flex-direction: column; }
.cat-pane .table-host { flex: 1; max-height: none; min-height: 160px; }
.cat-sep { height: 1px; background: var(--input-bg); margin: 10px 0; }
.cat-sub-label { color: var(--accent); font-size: 13px; margin-left: 20px; }
.table-bo.cat-grid tbody tr { cursor: pointer; }
.table-bo.cat-grid tbody tr.is-selected td {
    border-top: 2px solid #FF0080; border-bottom: 2px solid #FF0080; background: transparent;
}
.table-bo.cat-grid tbody tr.is-selected td:first-child {
    border-left: 2px solid #FF0080; border-top-left-radius: 8px; border-bottom-left-radius: 8px;
}
.table-bo.cat-grid tbody tr.is-selected td:last-child {
    border-right: 2px solid #FF0080; border-top-right-radius: 8px; border-bottom-right-radius: 8px;
}
.table-bo.cat-grid thead th { font-size: 11px; padding: 5px 8px; }

.amb-card { padding: 16px 18px; }
.amb-modes { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; min-height: 32px; }
.amb-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); cursor: pointer; margin: 0; }
.amb-search-wrap { position: relative; }
.amb-search-row { display: flex; gap: 10px; align-items: center; }
.amb-search-row .form-control { flex: 1; height: 35px; }
.amb-search-pop {
    position: absolute; left: 0; right: 90px; top: 100%; z-index: 20;
    background: var(--page-bg); border: 1px solid var(--accent); border-radius: 8px;
    max-height: 260px; overflow: auto; margin-top: 4px; padding: 2px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.amb-search-item {
    display: grid; grid-template-columns: 1fr 100px 120px; gap: 8px;
    padding: 6px 8px; cursor: pointer; border-radius: 6px; font-size: 13px;
}
.amb-search-item:hover, .amb-search-item.is-on { background: var(--card-bg); }
.amb-search-item .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amb-search-item .c { color: var(--text-secondary); text-align: right; }
.amb-search-item .a { color: var(--success); text-align: right; }
.amb-found { margin-top: 6px; font-size: 13px; font-weight: 600; min-height: 18px; }
.amb-found.is-ok { color: var(--success); }
.amb-found.is-warn { color: #ffa500; }
.amb-found.is-err { color: var(--accent); }
.amb-prod-box {
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.amb-curent { color: var(--success); }
.amb-grid td.amb-curent { color: var(--success); font-size: 12px; }
.amb-grid .form-select-sm { height: 22px; font-size: 11px; padding: 0 6px; min-height: 22px; }
.amb-grid-foot {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 8px 10px 10px;
}
.btn-load-blue {
    height: 30px; min-width: 136px; border: 0; border-radius: 8px; background: #1976D2; color: #fff;
    font-size: 11px; font-weight: 600; cursor: pointer;
}
.btn-load-blue:hover { background: #1565C0; color: #fff; }
.btn-add-green { background: #2E7D32; min-width: 158px; height: 30px; }
.btn-add-green:hover { background: #388E3C; color: #fff; }
.btn-reset-orange {
    height: 30px; min-width: 104px; border: 0; border-radius: 8px; background: #EF6C00; color: #fff;
    font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; padding: 0 12px;
}
.btn-reset-orange:hover { background: #F57C00; color: #fff; }
.btn-anaf {
    width: 35px; height: 35px; border: 0; border-radius: 8px; background: #2E7D32; color: #fff;
    font-family: Consolas, "Courier New", monospace; font-size: 16px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.btn-anaf:hover { background: #43A047; }
.btn-anaf:disabled { opacity: .55; cursor: wait; }
.ico-btn.is-edit { background: #1976D2; color: #fff; }
.ico-btn.is-edit:hover { background: #1565C0; color: #fff; }
.ico-btn.is-del-fill { background: #D32F2F; color: #fff; }
.ico-btn.is-del-fill:hover { background: #C62828; color: #fff; }
.ico-btn.is-anaf {
    background: #2E7D32; color: #fff; font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 12px;
}
.ico-btn.is-anaf:hover { background: #43A047; color: #fff; }
.table-bo td.is-yes { color: #1E7D32; font-weight: 600; }
.table-bo td.is-no { color: #D32F2F; font-weight: 600; }
.bo-modal.bo-dlg-wide .modal-dialog { max-width: 960px; }
.bo-modal.bo-dlg-wide .modal-body { max-height: calc(100dvh - 140px); }

@media (hover: none) {
    .sidebar .nav-link, .btn-accent, .btn-bo { min-height: 44px; display: inline-flex; align-items: center; }
    .md-sala-head, .md-masa-card { min-height: 44px; }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,.12);
        width: min(280px, 86vw);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1035;
        background: rgba(15, 23, 42, .45);
    }
    body.sidebar-open { overflow: hidden; }
    .main-wrap { margin-left: 0; }
    .btn-menu-toggle, .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .btn-menu-toggle {
        width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
    }
    .content-area { padding: 12px; }
    .kpi-card { max-width: none; flex: 1 1 calc(50% - 8px); }
    .table-host { max-height: calc(100dvh - 260px); }
    .loc-pill { max-width: 140px; font-size: 13px; }
    .chart-box { height: 200px; }
}

@media (max-width: 575.98px) {
    .content-area { padding: 10px; }
    .kpi-value { font-size: 16px; }
    .topbar h1 { font-size: 16px; }
    .filters-bar .btn-accent, .filters-bar .btn-bo { width: 100%; }
    .table-host { max-height: calc(100dvh - 280px); }
}

@media (min-width: 1400px) {
    .content-area { padding: 20px 28px 32px; }
    .kpi-card { padding: 14px 16px; }
}

/* Documente (facturi / avize / NIR / retur) — 1:1 BackOffice */
.doc-filters {
    padding: 10px 12px 8px; border-radius: 10px; margin-bottom: 10px;
}
.doc-filter-wrap { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.doc-fl { display: flex; flex-direction: column; gap: 4px; min-width: 110px; }
.doc-fl span { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.doc-fl .form-control, .doc-fl .form-select {
    height: 28px; padding: 2px 8px; font-size: 12px; border-radius: 7px; background: var(--input-bg);
    border: 0; color: var(--text-primary);
}
.doc-filter-mid { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.doc-check { font-size: 12px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.doc-filter-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.doc-btn {
    height: 30px; min-width: 34px; padding: 0 12px; border: 0; border-radius: 6px; color: #fff;
    font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.doc-btn-blue { background: #2563EB; }
.doc-btn-blue:hover { background: #1d4ed8; color: #fff; }
.doc-btn-green { background: #1B8E3E; }
.doc-btn-green:hover { background: #15803d; color: #fff; }
.doc-btn-red { background: #C62828; }
.doc-btn-red:hover { background: #b71c1c; color: #fff; }
.doc-btn-amber { background: #F59E0B; }
.doc-btn-amber:hover { background: #d97706; color: #fff; }
.doc-btn-gray { background: #455A64; }
.doc-btn-purple { background: #8E24AA; }
.doc-adv { background: var(--input-bg); border-radius: 8px; padding: 10px 8px; margin-top: 6px; }
.doc-crt {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; padding: 3px 8px; border-radius: 10px; font-weight: 700; font-size: 12px;
    border: 1px solid var(--border); background: var(--input-bg); color: var(--text-secondary);
}
.doc-crt.is-ok { background: #2E7D32; border-color: #2E7D32; color: #fff; }
.doc-crt.is-bad { background: #D32F2F; border-color: #D32F2F; color: #fff; }
.doc-crt.is-warn { background: #EF6C00; border-color: #EF6C00; color: #fff; }
.doc-crt.is-info { background: #1565C0; border-color: #1565C0; color: #fff; }
.doc-badge { font-weight: 600; font-size: 12px; }
.doc-badge.is-ok { color: #2E7D32; }
.doc-badge.is-bad { color: #D32F2F; }
.doc-badge.is-warn { color: #EF6C00; }
.doc-badge.is-info { color: #1565C0; }
.doc-grid-host { max-height: calc(100dvh - 340px); }
.doc-sheet {
    background: var(--card-bg); border-radius: 12px; padding: 18px 20px 24px;
    box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.doc-sheet-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.doc-kicker { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-secondary); }
.doc-sn { font-size: 20px; font-weight: 700; }
.doc-meta { color: var(--text-secondary); font-size: 13px; }
.doc-sheet-blue {
    background: #1565C0; color: #fff; min-width: 190px; padding: 10px 14px; border-radius: 4px; text-align: center;
}
.doc-sheet-blue strong { display: block; font-size: 15px; margin: 2px 0; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.doc-party { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.doc-party strong { color: #1565C0; display: block; margin: 2px 0 6px; }
.doc-total { color: #2E7D32; }
.doc-lines { max-height: none; margin-bottom: 12px; }
.doc-totals {
    margin-left: auto; width: min(320px, 100%); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.doc-totals div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.doc-totals .is-grand { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; font-weight: 700; color: #1565C0; }
.doc-obs { margin-top: 12px; font-size: 12px; color: var(--text-secondary); }
@media (max-width: 900px) {
    .doc-parties { grid-template-columns: 1fr; }
}

/* Raport vânzări — 1:1 BackOffice RaportVanzariPage */
.rv-page { display: flex; flex-direction: column; gap: 0; min-height: calc(100dvh - 88px); }
.rv-filters { padding: 10px 12px 8px; border-radius: 10px; margin-bottom: 6px; }
.rv-wrap { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.rv-wrap .rv-inl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); margin: 0; font-weight: 600; }
.rv-wrap .form-control, .rv-wrap .form-select {
    height: 30px; min-height: 30px; padding: 2px 8px; font-size: 12px; border-radius: 5px;
    background: var(--input-bg); border: 0; color: var(--text-primary); width: auto;
}
.rv-wrap input[type="date"] { width: 118px; }
.rv-wrap input[type="text"], .rv-wrap input[type="number"] { width: 160px; }
.rv-adv-btn {
    height: 30px; min-width: 132px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--input-bg); color: var(--text-primary); font-size: 12px; font-weight: 600; cursor: pointer;
}
.rv-adv-btn:hover { opacity: .94; }
.rv-gen { height: 30px; min-width: 110px; padding: 0 14px; font-size: 12px; }
.rv-exports { display: inline-flex; gap: 4px; margin-left: auto; }
.rv-kpis { background: var(--card-bg); border-radius: 10px; padding: 12px 8px; margin-bottom: 6px; }
.rv-kpi-row { display: grid; gap: 6px; }
.rv-kpi-row.is-1 { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 5px; }
.rv-kpi-row.is-2 { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 2fr); }
.rv-kpi {
    background: var(--input-bg); border-radius: 8px; padding: 10px 10px 8px;
    min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.rv-kpi .k { font-size: 8px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.rv-kpi .v { font-size: 17px; font-weight: 700; line-height: 1.15; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-kpi .s { font-size: 8px; color: var(--text-secondary); }
.rv-kpi.is-sm .v { font-size: 12px; }
.rv-kpi.is-sm .k { font-size: 7px; }
.rv-kpi.is-accent .v { color: var(--accent); }
.rv-kpi.is-orange .v { color: #FF9800; }
.rv-kpi.is-purple .v { color: #9C27B0; }
.rv-kpi.is-blue .v { color: #2196F3; }
.rv-kpi.is-red .v { color: #F44336; }
.rv-kpi.is-green .v { color: #4CAF50; }
.rv-kpi.is-storno { background: #2C1010; }
.rv-kpi.is-storno .k { color: #EF9A9A; }
.rv-kpi.is-storno .v { color: #F44336; }
.rv-kpi.is-retur { background: #3E2723; }
.rv-kpi.is-retur .k { color: #FFAB91; }
.rv-kpi.is-retur .v { color: #FF7043; }
.rv-kpi.is-wait { background: #4A3728; }
.rv-kpi.is-wait .k { color: #FFCC80; }
.rv-kpi.is-wait .v { color: #FFB74D; }
.rv-pays { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.rv-pay { border-radius: 8px; padding: 8px 8px 6px; opacity: .9; min-width: 0; }
.rv-pay .k { font-size: 7px; font-weight: 600; }
.rv-pay .v { font-size: 12px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-pay.is-cash { background: #1B5E20; }
.rv-pay.is-cash .k { color: #A5D6A7; }
.rv-pay.is-card { background: #0D47A1; }
.rv-pay.is-card .k { color: #90CAF9; }
.rv-pay.is-tic { background: #E65100; }
.rv-pay.is-tic .k { color: #FFCC80; }
.rv-pay.is-mod { background: #4A148C; }
.rv-pay.is-mod .k { color: #CE93D8; }
.rv-pay.is-op { background: #00695C; }
.rv-pay.is-op .k { color: #80CBC4; }
.rv-pay.is-prot { background: #37474F; }
.rv-pay.is-prot .k { color: #B0BEC5; }
.rv-subtabs { display: flex; gap: 2px; overflow-x: auto; margin: 4px 0 0; flex-wrap: nowrap; }
.rv-sub {
    flex: 0 0 auto; padding: 6px 12px; font-size: 11px; color: var(--text-secondary);
    background: var(--input-bg); border: 0; border-radius: 8px 8px 0 0; text-decoration: none; white-space: nowrap;
}
.rv-sub:hover { background: var(--card-bg); color: var(--text-primary); }
.rv-sub.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.rv-placeholder {
    background: var(--card-bg); border-radius: 10px; padding: 48px 24px; text-align: center; color: var(--text-muted);
}
.rv-placeholder .ph-ico { font-size: 40px; line-height: 1; display: block; margin-bottom: 8px; }
.rv-placeholder p { margin: 0; font-size: 13px; }
.rv-grid-host { max-height: calc(100dvh - 420px); border-radius: 0 10px 10px 10px; }
.content-area:has(.rv-page) .table-host.rv-grid-host { max-height: calc(100dvh - 420px); }
.rv-red { color: #F44336 !important; }
.rv-op { color: #00695C !important; }
.rv-prot { color: #9C27B0 !important; }
.rv-profit { color: #4CAF50 !important; }
.rv-foot {
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
    background: var(--card-bg); border-radius: 10px; padding: 10px 14px; margin-top: 6px; font-size: 12px;
}
.rv-foot .sep { width: 1px; height: 18px; background: var(--border); }
.rv-foot .lab { color: var(--text-secondary); margin-right: 4px; }
.rv-foot .val { font-weight: 600; color: var(--text-primary); }
.rv-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; font-size: 11px; color: var(--text-secondary); }
.rv-top3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.rv-top-card { background: var(--input-bg); border-radius: 8px; padding: 10px; }
.rv-top-card h6 { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.rv-top-card ol { margin: 0; padding: 0; list-style: none; }
.rv-top-card li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; font-size: 12px; padding: 2px 0; }
.rv-top-card .rk { color: var(--text-muted); font-weight: 700; }
.rv-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chip {
    background: var(--input-bg); border-radius: 6px; padding: 5px 10px; font-size: 11px;
    display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary);
}
.rv-chip b { color: var(--text-primary); font-weight: 700; }
.rv-chip.is-red b { color: #F44336; }
.rv-chip.is-total { background: #B71C1C; color: #FFCDD2; opacity: .92; }
.rv-chip.is-total b { color: #fff; font-size: 12px; }
.rv-chip.is-pay { color: #fff; opacity: .9; }
.rv-chip.is-pay b { color: #fff; }
.rv-chip.is-grand { background: var(--accent); opacity: 1; }
.rv-sec { font-size: 10px; font-weight: 600; color: var(--text-muted); margin: 0 0 6px; }
.rv-bon-head, .rv-bon-block { background: var(--card-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.rv-bon-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.rv-bon-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv-bon-id { font-size: 18px; font-weight: 700; }
#bonDetaliiModal .modal-dialog { max-width: 950px; }
#bonDetaliiModal .modal-body { padding: 12px 16px; max-height: calc(100dvh - 80px); }
#bonDetaliiModal .rv-grid-host { max-height: 280px; }
.rv-ctx { position: fixed; z-index: 1080; min-width: 180px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.rv-ctx button {
    display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 7px 10px;
    font-size: 12px; color: var(--text-primary); border-radius: 6px; cursor: pointer;
}
.rv-ctx button:hover { background: var(--input-bg); }
@media (max-width: 1200px) {
    .rv-kpi-row.is-1, .rv-kpi-row.is-2, .rv-pays, .rv-top3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rv-kpi .v { font-size: 14px; }
}

/* Valoare stoc — 1:1 BackOffice ValoareStocPage */
.vs-page { display: flex; flex-direction: column; min-height: calc(100dvh - 88px); }
.content-area:has(.vs-page) .vs-grid-host { max-height: calc(100dvh - 340px); }
.vs-refresh {
    width: 34px; height: 28px; border: 0; border-radius: 6px; background: #2563EB; color: #fff;
    font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.vs-refresh:hover { background: #1d4ed8; color: #fff; }
.vs-grid { min-width: 1280px; }
.vs-grid .vs-f { position: sticky; z-index: 3; }
.vs-grid .vs-c0 { left: 0; width: 58px; min-width: 58px; }
.vs-grid .vs-c1 { left: 58px; min-width: 160px; box-shadow: 6px 0 8px -6px rgba(0,0,0,.12); }
.vs-grid thead th.vs-f { z-index: 5; background: var(--header-bg); }
.vs-grid tbody tr:nth-child(odd) td.vs-f { background: var(--card-bg); }
.vs-grid tbody tr:nth-child(even) td.vs-f { background: var(--grid-alt); }
.vs-grid tbody tr:hover td.vs-f { background: var(--input-bg); }
.vs-grid tbody tr.produs-row.is-selected td.vs-f,
.vs-grid tbody tr.produs-row.is-selected:hover td.vs-f { background: var(--card-bg); }
.vs-grid tbody tr.produs-row.is-selected:nth-child(even) td.vs-f,
.vs-grid tbody tr.produs-row.is-selected:nth-child(even):hover td.vs-f { background: var(--grid-alt); }
.vs-vala { color: #27ae60; font-weight: 700; }
.vs-valv { color: #e67e22; font-weight: 700; }
.vs-footer {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px;
    padding: 12px 20px; margin-top: 12px; border-radius: 10px; font-size: 13px; color: var(--text-secondary);
}
.vs-footer b { color: var(--text-primary); font-size: 14px; }

/* Raport Lunar I/O — 1:1 BackOffice RaportLunarIOPage */
.lio-page { display: flex; flex-direction: column; min-height: calc(100dvh - 88px); }
.content-area:has(.lio-page) .lio-grid-host { max-height: calc(100dvh - 320px); }
.lio-x {
    width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px;
    background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
    cursor: pointer; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.lio-x:hover { opacity: .9; }
.lio-grid { min-width: 1680px; font-size: 11px; }
.lio-grid thead th { font-size: 11px; font-weight: 600; text-align: center; white-space: normal; line-height: 1.15; padding: 4px 6px; }
.lio-grid tbody td { font-size: 11px; padding: 2px 6px; white-space: nowrap; }
.lio-grid .col-name { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lio-grid .lio-f { position: sticky; z-index: 3; }
.lio-grid .lio-c0 { left: 0; width: 55px; min-width: 55px; }
.lio-grid .lio-c1 { left: 55px; min-width: 110px; box-shadow: 6px 0 8px -6px rgba(0,0,0,.12); }
.lio-grid thead th.lio-f { z-index: 5; background: var(--header-bg); }
.lio-grid tbody tr:nth-child(odd) td.lio-f { background: var(--card-bg); }
.lio-grid tbody tr:nth-child(even) td.lio-f { background: var(--grid-alt); }
.lio-grid tbody tr:hover td.lio-f { background: var(--input-bg); }
.lio-grid tbody tr.produs-row.is-selected td.lio-f,
.lio-grid tbody tr.produs-row.is-selected:hover td.lio-f { background: var(--card-bg); }
.lio-grid tbody tr.produs-row.is-selected:nth-child(even) td.lio-f,
.lio-grid tbody tr.produs-row.is-selected:nth-child(even):hover td.lio-f { background: var(--grid-alt); }
.lio-in { color: #4CAF50 !important; font-weight: 600; }
.lio-out { color: #E65100 !important; font-weight: 600; }
.lio-final { color: var(--accent); font-weight: 700; }
.lio-footer { padding: 10px 16px; margin-top: 8px; border-radius: 8px; }
.lio-ft-row { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--text-primary); }
.lio-ft-row.is-v { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.lio-ft-row b { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.page-head-actions .btn-export { width: 90px; height: 34px; }

@media print {
    .sidebar, .topbar, .no-print, .sidebar-backdrop { display: none !important; }
    .main-wrap { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    .table-host { max-height: none; overflow: visible; }
    .col-gear, .produs-gear-menu, .produs-gear, .mm-c0, #mmSelectAll { display: none !important; }
}
