/* Hirecha theme - colours from the Hirecha logo (blue) with a beverage-gold accent.
   Visual only. Warehouse photos: public/img/warehouse-*.jpg. Previous version: ~/hirecha-pos-backup-20261027-pretheme.tgz */
:root {
    --brand: #2f74bd;          /* Hirecha logo blue */
    --brand-dark: #154172;
    --brand-deep: #0b2442;
    --brand-soft: #e8f1fb;
    --accent: #f2a43a;         /* beverage gold */
    --accent-soft: #fff4e3;
    --ink: #1c2836;
    --muted: #64748b;
    --page: #eef3f9;
    --line: #e3eaf3;
    --radius: .85rem;
    --bs-primary: #2f74bd;
    --bs-primary-rgb: 47, 116, 189;
    --bs-link-color: #2466ad;
    --bs-link-color-rgb: 36, 102, 173;
    --bs-link-hover-color: #154172;
    --bs-link-hover-color-rgb: 21, 65, 114;
}
body { background: var(--page); font-size: .925rem; color: var(--ink); }

/* beverage warehouse photo, seen from afar behind every page */
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background: url("../img/warehouse-aisle.jpg") center center / cover no-repeat;
    filter: saturate(.85);
}
body::after {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background:
        radial-gradient(1100px 520px at 100% -10%, rgba(47, 116, 189, .16), transparent 60%),
        radial-gradient(800px 420px at 0% 110%, rgba(242, 164, 58, .10), transparent 60%),
        linear-gradient(180deg, rgba(238, 243, 249, .84), rgba(232, 240, 249, .88));
}
/* no z-index here: it would trap Bootstrap modals under their backdrop */
.main-col { position: relative; }

/* ---------- sidebar */
.sidebar {
    width: 250px; min-height: 100vh; color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; z-index: 2;
    background:
        linear-gradient(180deg, rgba(18, 58, 99, .9) 0%, rgba(11, 36, 66, .93) 48%, rgba(6, 23, 44, .97) 100%),
        url("../img/warehouse-forklift.jpg") 32% center / cover no-repeat,
        #0b2442;
    box-shadow: 6px 0 28px rgba(11, 36, 66, .22);
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 6px; }
.sidebar .brand {
    display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent);
}
.sidebar .brand img { background: #fff; border-radius: .6rem; padding: 3px; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.sidebar .brand i { font-size: 1.8rem; color: var(--accent); }
.sidebar .nav-link {
    color: rgba(226, 236, 248, .8); padding: .45rem 1rem; border-radius: .55rem; margin: 1px .5rem;
    display: flex; gap: .6rem; align-items: center; position: relative; transition: background .15s, color .15s;
}
.sidebar .nav-link i { color: rgba(160, 196, 236, .85); transition: color .15s; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link:hover i { color: var(--accent); }
.sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--brand), #3b86d2); color: #fff;
    box-shadow: 0 6px 16px rgba(47, 116, 189, .35);
}
.sidebar .nav-link.active i { color: #fff; }
.sidebar .nav-link.active::before {
    content: ""; position: absolute; left: -.5rem; top: 22%; bottom: 22%; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--accent);
}
.sidebar .nav-header {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600;
    color: rgba(242, 164, 58, .8); padding: 1rem 1.5rem .3rem;
}

/* ---------- page frame */
.main-col { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main-col main { flex: 1; }
.topbar {
    background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; display: flex; align-items: center; gap: .75rem;
    position: sticky; top: 0; z-index: 10;
}
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--brand) 55%, var(--accent));
    opacity: .85;
}
.topbar h1, .topbar .h4, .topbar .h5 { color: var(--brand-deep); font-weight: 700; }
.app-footer {
    text-align: center; font-size: .8rem; color: var(--muted); padding: .75rem 1rem;
    border-top: 1px solid var(--line); background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.app-footer strong, .app-footer b { color: var(--brand-dark); }

/* ---------- cards */
.card {
    --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    border: 1px solid rgba(15, 47, 82, .05);
    box-shadow: 0 1px 2px rgba(16, 42, 73, .05), 0 8px 22px rgba(16, 42, 73, .06);
}
.card-header { background: rgba(248, 251, 255, .9); font-weight: 600; color: var(--brand-deep); border-bottom: 1px solid var(--line); }
.card-footer { background: rgba(248, 251, 255, .9); border-top: 1px solid var(--line); }
.stat-card { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 42, 73, .06), 0 14px 28px rgba(16, 42, 73, .1); }
.stat-card::after {
    content: ""; position: absolute; right: -36px; bottom: -36px; width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 116, 189, .09), transparent 70%); pointer-events: none;
}
.stat-card .icon { width: 46px; height: 46px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.35rem; }

/* ---------- buttons, links, forms */
.btn-brand { background: linear-gradient(180deg, #3a82cc, var(--brand)); color: #fff; border-color: var(--brand); box-shadow: 0 2px 6px rgba(47, 116, 189, .25); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.btn { border-radius: .55rem; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: #8bb5e2; box-shadow: 0 0 0 .2rem rgba(47, 116, 189, .16); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.nav-pills .nav-link { color: var(--brand-dark); }
.nav-pills .nav-link.active { color: #fff; }
.pagination { --bs-pagination-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-hover-color: var(--brand-dark); }
.dropdown-item.active, .dropdown-item:active { background-color: var(--brand); }
.modal-content { border: 0; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(11, 36, 66, .25); }

/* ---------- tables */
.table thead th {
    font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: #4f647c;
    background: #f2f7fd; white-space: nowrap; border-bottom: 1px solid #dbe5f1;
}
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(47, 116, 189, .05); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-section td { background: var(--brand-soft) !important; font-weight: 700; }
.row-bold td, .row-total td { font-weight: 700; }
.row-total td { border-top: 2px solid var(--brand-deep); background: #f6f9fd; }
.badge-status-completed, .badge-status-posted, .badge-status-delivered, .badge-status-sent { background: #198754; }
.badge-status-voided, .badge-status-cancelled, .badge-status-failed { background: #dc3545; }
.badge-status-pending, .badge-status-dispatched { background: #fd7e14; }
.badge-status-manual { background: var(--brand); }
.badge-status-disabled { background: #6c757d; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s; }
    .sidebar.show { left: 0; }
}

/* ---------- POS */
.pos-wrap { height: calc(100vh - 120px); }
.pos-products { overflow-y: auto; }
.pos-cart { display: flex; flex-direction: column; height: 100%; }
.pos-cart .lines { flex: 1; overflow-y: auto; }
.product-tile { cursor: pointer; transition: transform .08s, box-shadow .12s; border: 1px solid #e6edf6 !important; border-radius: .7rem; }
.product-tile:hover { transform: translateY(-2px); border-color: var(--brand) !important; box-shadow: 0 8px 18px rgba(47, 116, 189, .15); }
.pos-total { font-size: 2rem; font-weight: 800; color: var(--brand); }

/* ---------- login page */
body:has(.login-card)::before { background: url("../img/warehouse-forklift.jpg") center center / cover no-repeat; filter: none; }
body:has(.login-card)::after {
    background:
        radial-gradient(640px 420px at 50% 45%, rgba(6, 23, 44, .25), transparent 75%),
        linear-gradient(135deg, rgba(6, 23, 44, .78), rgba(18, 58, 99, .55) 55%, rgba(47, 116, 189, .35));
}
.login-card .text-white-50, .login-card .text-white { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.login-card { position: relative; z-index: 1; }
.login-card .card { border-radius: 1.1rem; box-shadow: 0 30px 70px rgba(3, 14, 30, .45); background: #fff; }
.login-card .card::before {
    content: ""; display: block; height: 5px; border-radius: 1.1rem 1.1rem 0 0;
    background: linear-gradient(90deg, var(--brand), #4b95dd 60%, var(--accent));
}

@media print {
    body { background: #fff; }
    body::before, body::after { display: none; }
    .main-col main { padding: 0 !important; }
}
