:root {
    --bg: #070d1b;
    --bg-elevated: #0e1628;
    --panel: #121c31;
    --panel-2: #0b1427;
    --ink: #f1f4ff;
    --muted: #9ca8c3;
    --accent: #ff6d5c;
    --accent-2: #ff8f7b;
    --border: #1e2d4a;
    --focus: #3e69bd;
    --ok-bg: #14301f;
    --ok-ink: #76e6a1;
    --err-bg: #3b1a22;
    --err-ink: #ff9faf;
    --sidebar-width: 252px;
    --sidebar-collapsed-width: 84px;
    --topbar-h: 56px;
    --content-max: 1540px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
    height: 100vh;
}

/* ── scrollbar ─────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #415a8e #0a1327; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2f4774; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #3d5b92; }

a { color: #b5ccff; text-decoration: none; }

/* ── login ─────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    overflow: auto;
    background:
        radial-gradient(1200px 700px at 85% -10%, rgba(255,109,92,.12), transparent 60%),
        radial-gradient(1000px 600px at 10% -20%, rgba(64,100,190,.22), transparent 60%),
        linear-gradient(180deg, #050b18 0%, var(--bg) 100%);
}

.login-card, .card {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.login-card { width: min(460px, 100%); }

/* ── topbar ────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    padding: 0 20px;
    background: #0b1325;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 20;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.topbar-user-wrap {
    position: relative;
}

.topbar-logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-user {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    background: transparent;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.topbar-user:hover .user-avatar,
.topbar-user[aria-expanded="true"] .user-avatar {
    background: #223355;
    border-color: #33548f;
}

.topbar-user strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.topbar-user-lines {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 5px;
    line-height: 1.05;
}

.topbar-user-meta {
    display: block;
    color: #b1bdd7;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.05;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1a2744;
    border: 2px solid var(--border);
    display: grid;
    place-items: center;
}

.user-avatar svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 1.8; }

.topbar-user-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
        radial-gradient(160px 80px at 100% 0, rgba(255,109,92,.12), transparent 70%),
        linear-gradient(180deg, #111b31, #0a1223);
    box-shadow: 0 18px 40px rgba(0,0,0,.42);
    z-index: 40;
}

.topbar-user-popup[hidden] {
    display: none;
}

.topbar-user-popup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(122, 146, 197, .14);
}

.topbar-user-popup-head strong {
    display: block;
    color: #eef3ff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
}

.topbar-user-popup-head span {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
}

.topbar-user-popup-head bdi {
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(122, 146, 197, .18);
    border-radius: 999px;
    padding: 4px 8px;
    white-space: nowrap;
    line-height: 1;
}

.topbar-user-popup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.topbar-pay-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
    min-height: 58px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(122, 146, 197, .18);
}

.topbar-pay-item.is-live {
    background: rgba(255, 109, 92, .08);
}

.topbar-pay-item.is-zeroed {
    background: rgba(32, 93, 58, .22);
    border-color: rgba(118, 230, 161, .24);
}

.topbar-pay-item.is-deficit {
    background: rgba(220, 53, 69, .12);
    border-color: rgba(220, 53, 69, .3);
}

.topbar-pay-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(255,255,255,.05);
    color: #ffd7d1;
}

.topbar-pay-item.is-zeroed .topbar-pay-icon {
    color: #76e6a1;
    background: rgba(118, 230, 161, .12);
}

.topbar-pay-item.is-deficit .topbar-pay-icon {
    color: #ff6b6b;
    background: rgba(220, 53, 69, .15);
}

.topbar-pay-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-pay-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    flex: 1;
}

.topbar-pay-copy strong {
    color: #edf2ff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
}

.topbar-pay-copy span {
    color: #ffcabf;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
}

.topbar-pay-item.is-zeroed .topbar-pay-copy span {
    color: #8bf0b6;
}

.topbar-pay-item.is-deficit .topbar-pay-copy span {
    color: #ff8a8a;
}

.topbar-user-popup-head.is-zeroed bdi {
    color: #8bf0b6;
    border-color: rgba(118, 230, 161, .3);
    background: rgba(32, 93, 58, .25);
}

.topbar-user-popup-head.is-deficit bdi {
    color: #ff8a8a;
    border-color: rgba(220, 53, 69, .3);
    background: rgba(220, 53, 69, .15);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: 0 14px;
}
.topbar-pending-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 860px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.topbar-pending-label {
    flex: 0 0 auto;
    color: #d8e5ff;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
    border-radius: 999px;
    background: #15233f;
    border: 1px solid #28406c;
    white-space: nowrap;
}
.topbar-pending-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 10px;
    border-radius: 999px;
    background: #101d37;
    border: 1px solid #243758;
}
.topbar-pending-lines {
    display: grid;
    gap: 2px;
    line-height: 1;
}
.topbar-pending-lines strong {
    color: #f1f5ff;
    font-size: 12px;
}
.topbar-pending-lines span {
    color: #9bb0d8;
    font-size: 11px;
}
.topbar-pending-form {
    margin: 0;
}
.topbar-pending-confirm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #255940;
    background: #143426;
    color: #88efb4;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
}
.topbar-pending-confirm:hover {
    background: #18452f;
    color: #c4ffd9;
}
.topbar-pending-confirm svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #111d35;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
    transition: .2s;
    padding: 0;
    font: inherit;
    line-height: 1;
}

.topbar-icon:hover { background: #19294a; color: var(--ink); }
.topbar-icon.is-active { background: #203762; color: var(--ink); border-color: #33548f; }
.topbar-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-toggle-btn {
    display: inline-grid;
}

.sidebar-toggle-btn--desktop {
    display: inline-grid;
}

.sidebar-toggle-btn--mobile {
    display: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(2, 8, 18, .58);
    backdrop-filter: blur(2px);
    z-index: 55;
    cursor: pointer;
}

.cart-badge {
    position: relative;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 7px 14px 7px 10px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-badge .count {
    background: #fff;
    color: var(--accent);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.cart-badge svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }

/* ── shell layout ──────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    grid-template-rows: var(--topbar-h) 1fr;
    height: 100vh;
    direction: ltr;
}

.app-shell > .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
}

.side-panel {
    grid-column: 2;
    grid-row: 2;
    background: #080f1f;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    direction: rtl;
    text-align: right;
    padding: 6px 6px;
}

.app-main {
    grid-column: 1;
    grid-row: 2;
    direction: rtl;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Desktop collapsed sidebar: icons-only navigation */
body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .side-panel {
    padding: 6px 4px;
}

body.sidebar-collapsed .sidebar-group {
    border-radius: 10px;
}

body.sidebar-collapsed .sidebar-group::before {
    width: 2px;
}

body.sidebar-collapsed .sidebar-group-header--toggle {
    display: none;
}

body.sidebar-collapsed .sidebar-group-body {
    max-height: 1200px;
    overflow: visible;
}

body.sidebar-collapsed .sidebar-group ul {
    padding: 6px 4px;
}

body.sidebar-collapsed .sidebar-group a {
    justify-content: center;
    padding: 9px 0;
    border-radius: 10px;
}

body.sidebar-collapsed .sidebar-group a .nav-icon {
    width: 20px;
    height: 20px;
}

body.sidebar-collapsed .sidebar-group a .nav-icon svg {
    width: 17px;
    height: 17px;
}

body.sidebar-collapsed .sidebar-group a .nav-icon + span {
    display: none;
}

body.sidebar-collapsed .sidebar-group--single .hdr-right {
    display: grid;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
}

body.sidebar-collapsed .sidebar-group--single .hdr-right > span:not(.nav-icon) {
    display: none;
}

body.sidebar-collapsed .sidebar-group--single .sidebar-group-header > .hdr-right {
    display: grid !important;
}

body.sidebar-collapsed .sidebar-group--single .sidebar-group-header {
    display: grid;
    place-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 0;
    min-height: 46px;
    border-bottom: 0;
    width: 100%;
    color: #eef5ff;
}

body.sidebar-collapsed .sidebar-group--single .nav-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    color: #92b6ec;
    background: rgba(16, 25, 43, .96);
    border: 1px solid rgba(122, 146, 197, .22);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
    opacity: 1;
    visibility: visible;
}

body.sidebar-collapsed .sidebar-group--single .nav-icon svg {
    width: 15px;
    height: 15px;
    display: block;
    opacity: 1;
    visibility: visible;
}

/* ── sidebar ───────────────────────────────── */
.sidebar-search {
    position: relative;
    margin-bottom: 10px;
}

.sidebar-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0c1629;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.sidebar-search input::placeholder { color: #6a7a9e; }

.sidebar-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    stroke: var(--muted);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    padding: 4px 2px 10px;
}

.sidebar-group {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(84, 108, 154, .22);
    background: linear-gradient(180deg, rgba(11, 21, 38, .68), rgba(7, 14, 28, .74));
    overflow: hidden;
}

.sidebar-group::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: rgba(115, 148, 214, .48);
}

.sidebar-group--secondary::before {
    background: linear-gradient(180deg, rgba(255, 124, 98, .82), rgba(255, 146, 118, .78));
}

.sidebar-group--customers::before,
.sidebar-group--primary::before {
    background: rgba(118, 154, 224, .72);
}

.sidebar-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 7px;
    color: #e3edff;
    font-size: 13px;
    font-weight: 800;
    user-select: none;
    letter-spacing: .35px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(86, 108, 150, .2);
    cursor: pointer;
}

.sidebar-group-header--static { cursor: default; }

.sidebar-group-header .hdr-right {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sidebar-group-header .nav-icon { color: #8caee8; }
.sidebar-group-header .nav-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-group-header .chevron {
    width: 14px;
    height: 14px;
    stroke: #8da4cf;
    fill: none;
    stroke-width: 2;
    transition: transform .2s ease;
}
.sidebar-group.open .sidebar-group-header .chevron {
    transform: rotate(180deg);
}

.sidebar-group--secondary .sidebar-group-header {
    color: #e3edff;
}

.sidebar-group--secondary .sidebar-group-header .nav-icon {
    color: #8caee8;
}

.sidebar-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .24s ease;
}

.sidebar-group.open .sidebar-group-body {
    max-height: 620px;
}

.sidebar-group ul {
    list-style: none;
    padding: 6px;
    display: grid;
    gap: 4px;
}

.sidebar-group a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c8d7f2;
    font-size: 14.5px;
    padding: 7px 9px;
    border-radius: 9px;
    border: 1px solid rgba(88, 116, 163, .16);
    background: rgba(13, 23, 41, .48);
    transition: .16s ease;
}

.sidebar-group a:hover {
    background: rgba(27, 40, 65, .72);
    border-color: rgba(112, 148, 210, .28);
    color: #eef5ff;
    transform: translateX(-1px);
}

.sidebar-group a.active {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(255, 109, 92, .28);
}

.sidebar-group a .nav-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-group a .nav-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-group a:hover .nav-icon { color: #c9ddff; }
.sidebar-group a.active .nav-icon { color: #fff; }

.sidebar-group--secondary a {
    color: #c8d7f2;
    border-color: rgba(255, 151, 135, .16);
    background: rgba(37, 23, 21, .34);
}

.sidebar-group--secondary a:hover {
    background: rgba(52, 28, 25, .54);
    border-color: rgba(255, 156, 140, .3);
    color: #fff1ee;
}

.sidebar-group--customers .sidebar-group-header,
.sidebar-group--customers a {
    color: #e3edff;
}

.sidebar-group .badge-count {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 700;
    margin-inline-start: auto;
}

@media (max-width: 1180px) {
    .topbar-user-popup {
        width: min(290px, calc(100vw - 24px));
        right: -6px;
    }

    .topbar-user-popup-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── sales page layout ─────────────────────── */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--topbar-h));
}

/* ── products panel ────────────────────────── */
.products-panel {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.products-panel h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
}

.products-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.product-search {
    position: relative;
}

.product-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0c1629;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
}

.product-search input::placeholder { color: #6a7a9e; }

.product-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    stroke: var(--muted);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}

.product-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-filter-btn {
    border: 1px solid var(--border);
    background: #0e1830;
    color: #c7d4f3;
    border-radius: 999px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
}

.product-filter-btn:hover {
    border-color: #4f6ea7;
    color: #eef4ff;
}

.product-filter-btn.active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
}

/* Generic filter buttons */
.filter-btn {
    border: 1px solid var(--border);
    background: #0e1830;
    color: #c7d4f3;
    border-radius: 999px;
    padding: 6px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
}
.filter-btn:hover { border-color: #4f6ea7; color: #eef4ff; }
.filter-btn.active { border-color: transparent; color: #fff; background: linear-gradient(100deg, var(--accent), var(--accent-2)); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.product-card {
    text-align: center;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #0e1830, #0a1327);
    color: #eff4ff;
    border-radius: 12px;
    padding: 14px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: .15s;
    position: relative;
}

.product-card:hover { border-color: #4f6ea7; transform: translateY(-2px); }
.product-card.in-cart { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,109,92,.2); }

.product-card .card-icon {
    width: 50px;
    height: 50px;
    background: #141f38;
    border-radius: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.product-card .card-icon svg {
    width: 26px; height: 26px;
    stroke: #5a7ab5;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-card .card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.product-card .card-name {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
}

.product-card .card-price {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.product-card .card-stock-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #141f38;
    display: grid;
    place-items: center;
}

.product-card .card-stock-badge svg {
    width: 12px; height: 12px;
    stroke: #5aa87a;
    fill: none;
    stroke-width: 2.5;
}

/* ── cart panel ────────────────────────────── */
.cart-panel {
    background: #0a1122;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.cart-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-header h2 svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.clear-cart-btn {
    font-size: 12px;
    color: var(--muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
}

.clear-cart-btn:hover { color: var(--err-ink); border-color: #6f3644; }

/* order type tabs */
.order-tabs {
    display: flex;
    padding: 0 16px;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: .15s;
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.cart-clear-btn {
    display: grid;
    place-items: center;
    width: 34px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: #7b8fb5;
    cursor: pointer;
    padding: 0;
    transition: color .15s ease, transform .15s ease;
}

.cart-clear-btn:hover {
    color: var(--accent);
    transform: scale(1.15);
}

/* cart items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.cart-empty {
    text-align: center;
    color: var(--muted);
    padding: 30px 10px;
    font-size: 14px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 6px;
    background: #0c1629;
    position: relative;
}

.cart-item-icon {
    width: 40px;
    height: 40px;
    background: #141f38;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.cart-item-icon > svg { width: 22px; height: 22px; stroke: #5a7ab5; fill: none; stroke-width: 1.5; transition: opacity .15s; }

.cart-item-icon .remove-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: none;
    background: rgba(255, 60, 40, .85);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    opacity: 0;
    transition: opacity .15s ease;
}

.cart-item-icon:hover > svg { opacity: .15; }
.cart-item-icon:hover .remove-item { opacity: 1; }

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info .item-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cart-item-info .item-price-line {
    font-size: 12px;
    color: var(--muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-controls button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #111d35;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    font-family: inherit;
    line-height: 1;
}

.cart-item-controls button:hover { background: #19294a; }

.cart-item-controls .qty-display {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.cart-item .weight-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item .weight-input {
    width: 65px;
    padding: 4px 6px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: rgba(255,109,92,.08);
    color: var(--accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.cart-item .weight-label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
}

/* delivery fields within cart */
.cart-fields {
    padding: 0 12px 10px;
    display: grid;
    gap: 8px;
}

.cart-fields label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #b0bdd8;
}

.cart-fields input,
.cart-fields select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0c1629;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
}

.customer-toggle-btn {
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    color: #d7e3ff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background-color .15s;
}

.customer-toggle-btn:hover { background: rgba(255,255,255,.03); }

.customer-toggle-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.customer-toggle-title {
    font-size: 12px;
    font-weight: 800;
    color: #ecf3ff;
}

.customer-toggle-subtitle {
    color: #8ea6d4;
    font-size: 10px;
    font-weight: 500;
}

.customer-toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.customer-state-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    color: #bdcfff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.customer-toggle-btn .toggle-arrow {
    transition: transform .2s;
    font-size: 10px;
    color: #90a9d6;
}

.customer-toggle-btn.open .toggle-arrow {
    transform: rotate(180deg);
}

.cart-fields #customerResults {
    position: relative;
    margin: 6px 6px 0;
}

.customer-search-shell {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.customer-search-row {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 36px;
    padding: 0;
    border: none;
    border-bottom: 1px solid rgba(140, 165, 210, .18);
    border-radius: 0;
    background: transparent;
    transition: border-color .2s ease;
}

.customer-search-row:focus-within {
    border-color: rgba(255, 109, 92, .55);
    box-shadow: none;
}

.customer-search-icon {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #8ea5d2;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: none;
    opacity: .7;
}

.customer-search-row input {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #dce6ff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 0;
    height: 34px;
    outline: none;
}

.customer-search-row input::placeholder {
    color: #6b82ad;
    font-weight: 400;
}

.customer-row-caption {
    margin-top: 5px;
    font-size: 10px;
    color: #7f96c3;
    text-align: right;
}

.add-customer-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: color .15s ease, transform .15s ease;
    padding: 0;
    line-height: 1;
    box-shadow: none;
    opacity: .7;
}

.add-customer-btn:hover {
    color: var(--accent-2);
    opacity: 1;
    transform: scale(1.15);
    background: transparent;
    border: none;
    box-shadow: none;
}

.selected-customer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255,109,92,.38);
    border-radius: 14px;
    background:
        linear-gradient(90deg, rgba(255,109,92,.17), rgba(255,109,92,.05)),
        linear-gradient(180deg, rgba(20, 27, 45, .96), rgba(12, 18, 31, .98));
    box-shadow: 0 12px 26px rgba(0,0,0,.14);
}

.sel-cust-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sel-cust-info strong {
    font-size: 13px;
    color: #fff1ee;
    font-weight: 800;
}

.sel-cust-info span {
    font-size: 11px;
    color: #ffd0ca;
}

.sel-cust-addr {
    font-size: 10px !important;
    color: #ffe0db !important;
    font-style: normal;
    opacity: .9;
}

.sel-cust-remove {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255,109,92,.42);
    background: rgba(255,109,92,.12);
    color: #ffb6ad;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.sel-cust-remove:hover {
    background: rgba(255,109,92,.26);
    color: #fff;
    border-color: rgba(255,109,92,.62);
    transform: translateY(-1px);
}

.cart-fields .search-results {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    display: grid;
    gap: 3px;
    margin: 0 0 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
    background: linear-gradient(180deg, rgba(12, 20, 38, .98), rgba(8, 14, 28, .98));
    border: 1px solid rgba(120, 148, 200, .22);
    border-radius: 12px;
    box-shadow: 0 -12px 36px rgba(0,0,0,.28);
    z-index: 50;
    animation: custDropUp .18s ease-out;
}

.cart-fields .search-results:empty {
    display: none;
}

@keyframes custDropUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

#selectedCustomerWrap {
    margin: 0 10px;
}

.cart-fields .customer-result {
    text-align: right;
    border: none;
    border-bottom: 1px solid rgba(120, 148, 200, .1);
    background: transparent;
    color: #dce6ff;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    cursor: pointer;
    font-size: 11px;
    transition: background .12s ease;
    box-shadow: none;
}

.cart-fields .customer-result:last-child {
    border-bottom: none;
}

.cart-fields .customer-result strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    color: #f0f5ff;
    font-weight: 700;
}

.cart-fields .customer-result:hover {
    background: rgba(255, 109, 92, .1);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.cart-fields .customer-result span {
    display: block;
    color: #97aed4;
    font-size: 10px;
    line-height: 1.4;
}

.cart-fields .customer-result .cust-address {
    margin-top: 1px;
    font-size: 9px;
    color: #7e96c0;
    font-style: normal;
}

/* cart footer */
.cart-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: #080f1f;
}

.cart-summary {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    padding: 2px 0;
}

.cart-summary-row.discount-row span:last-child { color: var(--ok-ink); }

.cart-summary-row.total-row {
    font-size: 15px;
    color: var(--ink);
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
}

.cart-summary-row.total-row strong { font-size: 18px; }

.cart-summary-row.remaining-row {
    padding-top: 4px;
    font-weight: 700;
    font-size: 14px;
}

.cart-item-info .item-line-total {
    display: none;
}

.submit-order {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: .15s;
}

.submit-order:hover { filter: brightness(1.1); }
.submit-order svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* recently sold */
.recent-section {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.recent-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recent-section h3 svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.recent-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.recent-card {
    flex-shrink: 0;
    width: 120px;
    text-align: center;
    border: 1px solid var(--border);
    background: #0c1629;
    border-radius: 10px;
    padding: 10px 6px 8px;
    cursor: pointer;
    position: relative;
}

.recent-card:hover { border-color: #4f6ea7; }

.recent-card .card-icon {
    width: 40px;
    height: 40px;
    background: #141f38;
    border-radius: 8px;
    display: grid;
    place-items: center;
    margin: 0 auto 6px;
}

.recent-card .card-icon svg { width: 22px; height: 22px; stroke: #5a7ab5; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.recent-card .card-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.recent-card .card-price { font-size: 12px; color: var(--muted); }

.recent-card .card-stock-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px; height: 18px;
    border-radius: 5px;
    background: #141f38;
    display: grid;
    place-items: center;
}

.recent-card .card-stock-badge svg { width: 10px; height: 10px; stroke: #5aa87a; fill: none; stroke-width: 2.5; }

/* ── module-page / general layout ──────────── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border: 1px solid rgba(255,109,92,.35);
    border-radius: 999px;
    color: #ffb8ae;
    font-size: 13px;
    margin-bottom: 8px;
    background: rgba(255,109,92,.08);
}

.layout {
    display: grid;
    gap: 16px;
    grid-template-columns: 2fr 1fr;
    padding: 16px;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    overflow: auto;
    flex: 1;
    align-content: start;
}

.one-col { grid-template-columns: 1fr; }

.top-actions { display: flex; gap: 8px; }

.topbar h1 { margin: 0; font-size: 16px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 10px;
}

.kpi-item {
    border: 1px solid var(--border);
    background: #0b162d;
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 4px;
}

.kpi-item span { color: #95a6cb; }
.kpi-item strong { font-size: 22px; }
.kpi-item.warning { border-color: #814f58; background: #2a1319; }

.filters-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 10px;
}

.pagination-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 14px;
}

.pagination-link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #32466f;
    background: #101a2f;
    color: #e8efff;
    text-decoration: none;
    font-weight: 700;
    transition: .2s ease;
}

.pagination-link:hover {
    filter: brightness(1.12);
}

.pagination-link.is-active {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

.warn-row td { background: rgba(129,79,88,.2); }

.module-page .app-main { overflow-y: auto; }
.module-page .topbar { padding: 14px 18px; height: auto; }
.module-page .layout { padding: 12px 16px 16px; }
.module-page .card { padding: 14px; border-radius: 14px; overflow-x: auto; }
.module-page .form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.module-page .inline-form { flex-wrap: wrap; }
.module-page .filters-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.module-page th, .module-page td { min-width: 120px; }
.module-page table { width: 100%; min-width: 760px; }
.module-page .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
.module-page .kpi-item strong { font-size: 20px; }

.cp-layout { overflow: visible; }

/* ═══════ Control Panel v2 ═══════ */
.cp2 { display: grid; gap: 18px; padding: 10px 0 28px; }

/* ── Date filter bar ── */
.cp2-filter {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 12px;
    background: rgba(10,21,42,.55); border: 1px solid #283b61;
}
.cp2-shortcuts { display: flex; gap: 6px; }
.cp2-shortcut {
    padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 700;
    background: #15274a; border: 1px solid #38588f; color: #d7e5ff; cursor: pointer;
    transition: .15s;
}
.cp2-shortcut:hover { background: #1e3566; }
.cp2-date-form {
    display: flex; align-items: center; gap: 8px; margin-right: auto;
}
.cp2-date-form input[type="date"] {
    width: 140px; padding: 7px 10px; font-size: 13px;
    border-radius: 8px; border: 1px solid #38588f; background: #0d1b33; color: #d7e5ff;
}
.cp2-arrow { color: #5a7db5; font-size: 14px; }
.cp2-go-btn {
    padding: 7px 18px; border-radius: 8px; font-size: 13px; font-weight: 700;
    background: linear-gradient(135deg,#4f83ff,#6da2ff); color: #fff; border: none; cursor: pointer;
}
.cp2-go-btn:hover { opacity: .85; }

/* ── Top KPI cards ── */
.cp2-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.cp2-card {
    background: #111d36; border: 1px solid #253958;
    border-radius: 14px; padding: 16px 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.cp2-card__label { color: #8fa4c9; font-size: 12px; font-weight: 600; }
.cp2-card__val { color: #f2f6ff; font-size: 22px; font-weight: 800; line-height: 1.15; }
.cp2-card__val--sm { font-size: 16px; }
.cp2-card__sub { color: #8899b8; font-size: 11px; margin-top: 2px; }

.cp2-card--blue  { border-color: #3464b3; background: linear-gradient(135deg,#0f1f3e,#162c54); }
.cp2-card--red   { border-color: #7a3a40; background: linear-gradient(135deg,#250e12,#3a1520); }
.cp2-card--green { border-color: #2d7a4a; background: linear-gradient(135deg,#0b1f14,#153326); }
.cp2-card--orange{ border-color: #9a6a2c; background: linear-gradient(135deg,#1f170a,#352510); }

/* ── Section containers ── */
.cp2-section {
    background: #0f1a30; border: 1px solid #253858;
    border-radius: 14px; padding: 16px;
}
.cp2-section__title {
    margin: 0 0 12px; font-size: 16px; font-weight: 800; color: #e8eeff;
}
.cp2-section__title small { color: #7e93b6; font-size: 12px; font-weight: 600; }
.cp2-empty { color: #6a7e9e; font-size: 13px; margin: 0; }

/* ── Mini KPI grid (finance) ── */
.cp2-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.cp2-mini {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 0; border-bottom: 1px solid #223457;
}
.cp2-mini span { color: #8fa4c9; font-size: 12px; }
.cp2-mini strong { color: #f2f6ff; font-size: 17px; }
.cp2-mini--warn strong { color: #ff9f8d; }

/* ── Duo boxes (creditors/debtors) ── */
.cp2-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp2-duo__box {
    text-align: center; border-radius: 10px;
    padding: 14px 10px; display: flex; flex-direction: column; gap: 4px;
}
.cp2-duo__box span  { font-size: 12px; font-weight: 700; }
.cp2-duo__box strong { font-size: 24px; font-weight: 800; }
.cp2-duo__box small  { font-size: 12px; opacity: .7; }
.cp2-duo__box--green { background: #0e2218; border: 1px solid #1f5a37; color: #7ff5a8; }
.cp2-duo__box--red   { background: #250f13; border: 1px solid #6b2e36; color: #ff9f97; }

/* ── Two-column row ── */
.cp2-row2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

/* ── Bar charts ── */
.cp2-bar-list { display: grid; gap: 10px; }
.cp2-bar { display: grid; gap: 5px; }
.cp2-bar__head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: #c4d0e9;
}
.cp2-bar__head span:last-child { color: #8899b8; font-size: 12px; }
.cp2-bar__track {
    width: 100%; height: 8px; border-radius: 999px;
    background: #0a1428; border: 1px solid #273655; overflow: hidden;
}
.cp2-bar__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#4f83ff,#6da2ff); }
.cp2-bar__fill--cyan   { background: linear-gradient(90deg,#00b3ff,#47d8ff); }
.cp2-bar__fill--red    { background: linear-gradient(90deg,#ff8f7b,#ff6d5c); }
.cp2-bar__fill--orange { background: linear-gradient(90deg,#ffa64d,#ff8c26); }

/* ── Stat rows (income) ── */
.cp2-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #223457;
}
.cp2-stat-row span { color: #9db0d6; font-size: 13px; }
.cp2-stat-row strong { color: #f4f7ff; font-size: 14px; }

/* ── Courier list ── */
.cp2-courier-list { display: grid; gap: 12px; }
.cp2-courier {
    display: grid; gap: 6px;
    padding-bottom: 12px; border-bottom: 1px solid #233555;
}
.cp2-courier__top {
    display: flex; align-items: center; gap: 10px;
}
.cp2-courier__top strong { color: #f2f6ff; font-size: 15px; }
.cp2-courier__phone { color: #8899b8; font-size: 12px; }
.cp2-courier__total { margin-right: auto; color: #ffa87a; font-size: 16px; font-weight: 800; }
.cp2-courier__meta {
    display: flex; flex-wrap: wrap; gap: 14px; color: #b0bdd6; font-size: 12px;
}

@media (max-width: 600px) {
    .cp2-filter { flex-direction: column; align-items: stretch; }
    .cp2-date-form { margin-right: 0; flex-wrap: wrap; }
    .cp2-duo { grid-template-columns: 1fr; }
    .cp2-row2 { grid-template-columns: 1fr; }
    .cp2-cards { grid-template-columns: repeat(2, 1fr); }
}

.single { width: min(900px, 95%); margin: 20px auto; }

.card h2, .card h3 { margin-top: 0; }

.form-grid { display: grid; gap: 12px; }

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #d6def2;
}

input, select, button {
    font-family: inherit;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #0a1326;
    color: var(--ink);
}

input::placeholder { color: #7a87a8; }

input:focus, select:focus, button:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(62,105,189,.25);
}

.btn {
    display: inline-block;
    border: 1px solid #32466f;
    background: #101a2f;
    color: #e8efff;
    text-decoration: none;
    cursor: pointer;
    transition: .2s ease;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
}

.btn:hover { filter: brightness(1.15); }

.btn.primary {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
}

.btn.danger {
    background: #2e1420;
    border-color: #613348;
    color: #ffb6c4;
}

.btn-icon-only {
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alert { padding: 10px; border-radius: 10px; font-weight: 700; margin-bottom: 8px; font-size: 13px; }
.alert.success { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #2f5a40; }
.alert.error { background: var(--err-bg); color: var(--err-ink); border: 1px solid #6f3644; }

.hidden { display: none !important; }

.inline-form { display: flex; gap: 8px; margin-bottom: 10px; }

table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--border); padding: 8px; text-align: right; }
th { background: #0b162d; color: #dce6ff; }
tr:hover td { background: #0f1a31; }

fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
small { color: var(--muted); }

.muted-note { color: #91a1c7; font-size: 14px; }

.items-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px; }

.item-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
}

.item-name {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0b162d;
}

/* ── responsive ────────────────────────────── */
@media (max-width: 1100px) {
    .pos-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 248px;
    }

    .topbar-pending-strip {
        max-width: 440px;
    }
}

@media (max-width: 992px) {
    body { overflow: auto; height: auto; }

    .cart-badge {
        display: none;
    }

    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100vh;
    }

    .app-shell > .topbar { grid-column: 1; }

    .side-panel {
        grid-column: 1;
        grid-row: 1 / -1;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(84vw, 320px);
        max-width: 320px;
        height: 100dvh;
        border-left: none;
        border-right: 1px solid var(--border);
        border-top: none;
        z-index: 60;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: -18px 0 35px rgba(0, 0, 0, .38);
        padding-top: 68px;
    }

    body.sidebar-open .side-panel {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        grid-column: 1;
        grid-row: 2;
        overflow: visible;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        overflow: visible;
        height: auto;
    }

    .products-panel { overflow: visible; height: auto; }

    .cart-panel {
        border-right: none;
        border-top: 1px solid var(--border);
        position: static;
        height: auto;
    }

    .layout {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "left right"
            "center center";
        align-items: center;
        column-gap: 10px;
        row-gap: 10px;
        height: auto;
        padding: 12px 16px;
    }

    .sidebar-toggle-btn {
        display: inline-grid;
    }

    .sidebar-toggle-btn--desktop {
        display: none;
    }

    .sidebar-toggle-btn--mobile {
        display: inline-grid;
    }

    .sidebar-toggle-btn[aria-expanded="true"] {
        background: #203762;
        color: var(--ink);
        border-color: #33548f;
    }

    .topbar-left {
        grid-area: left;
        width: auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .topbar-right {
        grid-area: right;
        width: auto;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }

    .topbar-center {
        grid-area: center;
        width: 100%;
        min-width: 0;
        padding: 0;
    }

    .topbar-user {
        width: auto;
        max-width: min(62vw, 360px);
        margin-inline-start: auto;
    }

    .topbar-user-lines {
        min-width: 0;
    }

    .topbar-user-meta {
        white-space: normal;
    }

    .topbar-pending-strip {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .topbar-pending-item {
        flex: 0 0 auto;
    }

    .side-panel {
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-fields .customer-grid { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: 1fr; }

    .module-page .layout { padding: 12px; }
    .module-page .card { padding: 12px; }
    .module-page .form-grid { grid-template-columns: 1fr; }
    .module-page table { min-width: 620px; }
        .cp-hero-head {
            flex-direction: column;
            align-items: stretch;
        }
        .cp-range-pill {
            width: fit-content;
        }
}

/* ═══════════════════════════════════════════════
   Inventory Page — Redesign
   ═══════════════════════════════════════════════ */

/* ── Toolbar ── */
.inv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.inv-toolbar__start,
.inv-toolbar__end {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inv-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    height: 40px;
    min-width: 200px;
    transition: border-color .2s;
}
.inv-search-box:focus-within { border-color: var(--accent); }
.inv-search-box svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.inv-search-box input {
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    width: 100%;
    outline: none;
    font-family: inherit;
}
.inv-search-box input::placeholder { color: var(--muted); opacity: .7; }
.inv-category-filter {
    display: flex;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 40px;
    padding: 0 10px;
    min-width: 170px;
}
.inv-category-filter select {
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    width: 100%;
}
.inv-count-badge {
    background: rgba(255, 109, 92, .12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Toolbar buttons ── */
.inv-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s;
}
.inv-tool-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.inv-tool-btn:hover {
    background: var(--bg-elevated, #0e1628);
    border-color: #4a5a80;
    transform: translateY(-1px);
}
.inv-tool-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.inv-tool-btn--primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
}
.inv-tool-btn--danger {
    background: rgba(180, 50, 60, .3);
    border-color: #a44b5a;
    color: #ffb3b3;
}
.inv-tool-btn--danger:hover {
    background: rgba(180, 50, 60, .5);
    border-color: #d97f90;
}

/* ── Table wrap ── */
.inv-table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.inv-table {
    width: 100%;
    border-collapse: collapse;
}
.inv-table thead {
    background: rgba(0, 0, 0, .18);
}
.inv-table th {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.inv-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--ink);
    border-bottom: 1px solid rgba(30, 45, 74, .4);
    vertical-align: middle;
}
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-table tbody tr:hover { background: rgba(255, 109, 92, .04); }
.inv-empty {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--muted);
    font-size: 15px;
}

/* ── Checkbox column ── */
.inv-chk { width: 42px; text-align: center; }
.inv-table input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: rgba(30, 37, 56, .8);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: background .15s, border-color .15s;
}
.inv-table input[type="checkbox"]:hover { border-color: var(--accent); }
.inv-table input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.inv-table input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 1px;
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

/* ── Product cell (avatar + info) ── */
.inv-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.inv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: #1a2235;
    flex-shrink: 0;
}
.inv-avatar--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 45, 74, .5);
}
.inv-avatar--empty svg { width: 22px; height: 22px; color: var(--muted); opacity: .5; }
.inv-product-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inv-product-info strong { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-sku { font-size: 11px; color: var(--muted); opacity: .7; font-family: Consolas, monospace; }

/* ── Tags & Badges ── */
.inv-tag {
    background: rgba(62, 105, 189, .12);
    color: #8bb4ff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.inv-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.inv-badge--kg {
    background: rgba(76, 175, 80, .12);
    color: #8bd990;
}
.inv-badge--pc {
    background: rgba(255, 183, 77, .12);
    color: #ffc966;
}

/* ── Price cell ── */
.inv-price { white-space: nowrap; font-weight: 600; font-size: 14px; }
.inv-price small { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ── Action icon buttons ── */
.inv-th-actions { width: 90px; }
.inv-actions { white-space: nowrap; display: flex; gap: 6px; justify-content: center; }
.inv-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.inv-icon-btn svg { width: 24px; height: 24px; stroke-width: 2.4; }
.inv-icon-btn:hover {
    background: rgba(62, 105, 189, .15);
    color: #8bb4ff;
    border-color: #4f78c2;
}
.inv-icon-btn--danger:hover {
    background: rgba(200, 50, 60, .15);
    color: #ff9999;
    border-color: #a44b5a;
}

/* ── Modal overlay ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: radial-gradient(circle at 20% 15%, rgba(41, 65, 110, .3), rgba(8, 10, 18, .8));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-box {
    background: linear-gradient(180deg, #1d2539, #151d2f);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box--sm { max-width: 440px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #f2f6ff;
}
.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(200, 50, 60, .2); color: #ffaaaa; }

/* ── Modal form ── */
.modal-form { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal-form input[type="text"],
.modal-form input[type="password"],
.modal-form input[type="number"],
.modal-form input[type="file"],
.modal-form select {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(12, 18, 32, .6);
    color: var(--ink);
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}
.modal-form input:focus,
.modal-form select:focus { border-color: var(--accent); }
.modal-form input[type="file"] { padding: 7px 12px; height: auto; }

.modal-fields { display: flex; flex-direction: column; gap: 14px; }
.modal-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Order action modals (edit/cancel) ── */
.order-action-modal {
    width: 96%;
    max-width: 560px;
    border-radius: 18px;
    overflow: hidden;
}

.order-action-modal--cancel {
    max-width: 500px;
}

.order-action-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 22px 0;
}

.order-action-head-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.order-action-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #f2f6ff;
}

.order-action-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.order-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 109, 92, .35);
    background: rgba(255, 109, 92, .12);
    color: #ffb3a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-action-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.order-action-icon--danger {
    border-color: rgba(220, 53, 69, .35);
    background: rgba(220, 53, 69, .12);
    color: #ff9ea8;
}

.order-action-form {
    padding-top: 14px;
}

.order-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.order-action-form label > span {
    margin-bottom: 4px;
    display: inline-block;
}

.order-cancel-note {
    padding: 10px 12px;
    border: 1px solid rgba(220, 53, 69, .35);
    border-radius: 10px;
    background: rgba(220, 53, 69, .1);
    color: #ffc0c7;
    font-size: 13px;
}

.order-action-footer {
    justify-content: flex-end;
}

@media (max-width: 620px) {
    .order-action-head {
        padding: 16px 16px 0;
    }

    .order-action-head h3 {
        font-size: 18px;
    }

    .order-action-grid {
        grid-template-columns: 1fr;
    }

    .order-action-footer {
        flex-wrap: wrap;
    }

    .order-action-footer .btn {
        width: 100%;
    }
}

/* ── Image zone in modal ── */
.modal-img-zone {
    border: 1px dashed rgba(66, 81, 118, .6);
    border-radius: 14px;
    padding: 16px;
    background: rgba(18, 24, 39, .35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.modal-img-preview {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.modal-img-placeholder {
    height: 90px;
    width: 100%;
    border: 1px dashed rgba(63, 78, 115, .5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    opacity: .7;
}
.modal-img-placeholder svg { width: 28px; height: 28px; }
.modal-img-upload {
    display: inline-flex;
    cursor: pointer;
}
.modal-img-upload span {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 5px 14px;
    transition: background .15s;
}
.modal-img-upload:hover span { background: rgba(255, 109, 92, .1); }
.modal-img-upload input { display: none; }

/* ── Modal footer ── */
.modal-footer {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

/* ── Strong Alert Popup ── */
.strong-alert-box {
    border: 1px solid rgba(255, 109, 92, .35);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .62);
}

.strong-alert-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 24px 8px;
}

.strong-alert-head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #f7fbff;
}

.strong-alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 109, 92, .35);
    background: rgba(255, 109, 92, .12);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.strong-alert-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.strong-alert-msg {
    margin: 0;
    padding: 0 24px 18px;
    font-size: 14px;
    line-height: 1.8;
    color: #d8e4ff;
    white-space: pre-line;
}

/* ── CSV hint ── */
.csv-hint {
    border: 1px solid var(--border);
    background: rgba(19, 27, 44, .6);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #c5d2ef;
    line-height: 1.7;
}
.csv-hint code {
    font-family: Consolas, Monaco, monospace;
    color: #e9f0ff;
    background: rgba(255, 255, 255, .07);
    padding: 2px 6px;
    border-radius: 6px;
}

/* ── Accent tool button ── */
.inv-tool-btn--accent {
    background: rgba(62, 105, 189, .2);
    border-color: #4f78c2;
    color: #8bb4ff;
}
.inv-tool-btn--accent:hover {
    background: rgba(62, 105, 189, .35);
    border-color: #7fa4e4;
}

/* ── Larger modal ── */
.modal-box--lg { max-width: 720px; }

/* ── Modal entrance animation ── */
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-overlay[style*="flex"] { animation: modalFadeIn .2s ease; }
.modal-overlay[style*="flex"] .modal-box { animation: modalSlideUp .3s cubic-bezier(.22,1,.36,1); }

/* ── Form label row (asterisk inline) ── */
.form-label-row { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form-label-row .req { color: var(--accent); font-size: 16px; font-weight: 700; line-height: 1; }

/* ── Modal sections ── */
.modal-section { background: rgba(11, 20, 39, .4); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.modal-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: #c8d8f8;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.modal-section-title svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Permission toggle items ── */
.perm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.perm-item {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 10px;
    background: rgba(12, 18, 32, .5); border: 1px solid transparent;
    cursor: pointer; transition: all .15s;
    font-size: 13px; color: var(--muted); user-select: none;
}
.perm-item:hover { border-color: var(--border); background: rgba(20, 32, 55, .6); }
.perm-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.perm-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.perm-item span::before {
    content: "";
    width: 17px;
    height: 17px;
    border-radius: 6px;
    border: 1px solid #3c4c70;
    background: rgba(12, 18, 32, .85);
    box-shadow: inset 0 0 0 2px rgba(12, 18, 32, .95);
    transition: all .16s ease;
    flex-shrink: 0;
}
.perm-item:has(input:checked) { border-color: rgba(62,105,189,.4); background: rgba(62,105,189,.08); }
.perm-item:has(input:checked) span { color: var(--ink); }
.perm-item:has(input:checked) span::before {
    border-color: #5f86ce;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .2);
}

/* ── 4 fields in one row (branch/role/status/create-users) ── */
.user-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1200px) {
    .perm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .perm-grid { grid-template-columns: 1fr; }
    .user-meta-grid { grid-template-columns: 1fr; }
}

/* ── Modal form inputs full width ── */
.modal-section input[type="text"],
.modal-section input[type="password"],
.modal-section input[type="number"],
.modal-section select {
    width: 100%; box-sizing: border-box;
    height: 42px; border: 1px solid var(--border); border-radius: 10px;
    background: rgba(12, 18, 32, .6); color: var(--ink);
    padding: 0 12px; font-size: 14px; font-family: inherit;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.modal-section input:focus,
.modal-section select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,105,189,.15); }

/* ── Warning / Confirm modal ── */
.warn-modal-box {
    background: linear-gradient(180deg, #2a1a1f, #1d1520);
    border: 1px solid #5a2a38; text-align: center; max-width: 420px;
}
.warn-icon {
    width: 68px; height: 68px; margin: 0 auto 14px;
    background: rgba(220, 60, 70, .12); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: warnPulse 2s ease infinite;
}
.warn-icon svg { width: 34px; height: 34px; stroke: #ff6b7a; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes warnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 60, 70, .25); }
    50% { box-shadow: 0 0 0 14px rgba(220, 60, 70, 0); }
}
.warn-title { font-size: 18px; font-weight: 800; color: #ffb6c4; margin: 0 0 8px; }
.warn-text { font-size: 14px; color: #c9a0aa; margin: 0 0 22px; line-height: 1.7; }
.warn-btns { display: flex; gap: 10px; justify-content: center; }
.btn.warn-confirm {
    background: linear-gradient(100deg, #c53a4a, #9a2535);
    color: #fff; border: none; padding: 10px 28px; font-weight: 700;
    border-radius: 10px; cursor: pointer; transition: filter .15s;
}
.btn.warn-confirm:hover { filter: brightness(1.15); }
.btn.warn-cancel {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    padding: 10px 24px; border-radius: 10px; color: #c9a0aa; cursor: pointer;
}

/* ── Order Details Modal ── */
.od-modal {
    max-width: 720px;
    width: 96%;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}
.od-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.od-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.od-order-no {
    font-size: 20px;
    font-weight: 800;
    color: #f2f6ff;
    letter-spacing: -0.3px;
}
.od-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.od-badge--ok { background: rgba(52, 199, 89, .15); color: #6ee7a0; border: 1px solid rgba(52, 199, 89, .25); }
.od-badge--pending { background: rgba(255, 193, 7, .12); color: #ffd54f; border: 1px solid rgba(255, 193, 7, .2); }
.od-badge--cancel { background: rgba(220, 53, 69, .12); color: #ff8a8a; border: 1px solid rgba(220, 53, 69, .2); }
.od-body {
    padding: 20px 24px 24px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,109,92,.4) transparent;
}
.od-body > * { margin-bottom: 18px; }
.od-body > *:last-child { margin-bottom: 0; }
.od-body::-webkit-scrollbar { width: 6px; }
.od-body::-webkit-scrollbar-track { background: transparent; }
.od-body::-webkit-scrollbar-thumb { background: rgba(255,109,92,.35); border-radius: 3px; }
.od-body::-webkit-scrollbar-thumb:hover { background: rgba(255,109,92,.6); }

/* Info cards row */
.od-info-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.od-info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: rgba(18, 26, 44, .6);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
    transition: border-color .2s;
}
.od-info-card:hover { border-color: rgba(255, 109, 92, .3); }
.od-info-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 109, 92, .28);
    background: rgba(255, 109, 92, .1);
    color: #ffb3a8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.od-info-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
}
.od-info-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.od-info-val { font-size: 13px; font-weight: 700; color: var(--ink); }

/* Section inside modal */
.od-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.od-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: rgba(18, 26, 44, .5);
    border-bottom: 1px solid var(--border);
}
.od-section-title svg { flex-shrink: 0; opacity: .6; }

/* Customer grid */
.od-customer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.od-customer-grid > div {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.od-customer-grid > div:nth-child(odd) { border-left: 1px solid rgba(255,255,255,.04); }
.od-customer-grid > div span { font-size: 11px; color: var(--muted); font-weight: 600; }
.od-customer-grid > div strong { font-size: 14px; color: var(--ink); font-weight: 700; }
.od-customer-address { grid-column: 1 / -1; }
.od-customer-grid > div:last-child { border-bottom: none; }
.od-customer-grid > div:nth-last-child(2):nth-child(odd) { border-bottom: none; }

/* Items table */
.od-items-wrap { overflow-x: auto; }
.od-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.od-items-table thead th {
    padding: 10px 14px;
    text-align: right;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
    background: rgba(18, 26, 44, .3);
    border-bottom: 1px solid var(--border);
}
.od-items-table tbody td {
    padding: 10px 14px;
    color: var(--ink);
    border-bottom: 1px solid rgba(255,255,255,.04);
    white-space: nowrap;
}
.od-items-table tbody tr:last-child td { border-bottom: none; }
.od-items-table tbody tr:hover { background: rgba(255, 109, 92, .04); }
.od-item-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 109, 92, .12);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    margin-inline-end: 8px;
    flex-shrink: 0;
}
.od-line-total { font-weight: 700; color: var(--accent); }
.od-empty { text-align: center; color: var(--muted); padding: 24px 14px !important; }

/* Totals */
.od-totals {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.od-totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.od-totals-row:last-child { border-bottom: none; }
.od-totals-row span { font-size: 13px; color: var(--muted); font-weight: 600; }
.od-totals-row strong { font-size: 15px; font-weight: 800; color: var(--ink); }
.od-totals-row:first-child { background: rgba(255, 109, 92, .06); }
.od-totals-row:first-child strong { color: var(--accent); font-size: 17px; }
.od-totals-discount strong { color: #ff8f8f; }
.od-totals-remaining strong { color: #ffd54f; }

/* Notes */
.od-notes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(18, 26, 44, .4);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}
.od-notes svg { flex-shrink: 0; margin-top: 2px; opacity: .5; }

/* Close button */
.od-close-btn {
    align-self: center;
    min-width: 120px;
    justify-content: center;
}

@media (max-width: 600px) {
    .od-modal { width: 100%; max-width: 100%; height: 90vh; border-radius: 14px; }
    .od-info-row { grid-template-columns: 1fr 1fr; }
    .od-customer-grid { grid-template-columns: 1fr; }
    .od-customer-grid > div:nth-child(odd) { border-left: none; }
    .od-header { padding: 16px 16px 12px; }
    .od-body { padding: 16px; }
}

/* ── Customer Details Modal ── */
.cd-modal {
    max-width: 900px;
    width: 96%;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}
.cd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cd-customer-name {
    font-size: 20px;
    font-weight: 800;
    color: #f2f6ff;
    letter-spacing: -0.3px;
}
.cd-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.cd-badge--ok { background: rgba(52, 199, 89, .15); color: #6ee7a0; border: 1px solid rgba(52, 199, 89, .25); }
.cd-badge--warn { background: rgba(255, 193, 7, .12); color: #ffd54f; border: 1px solid rgba(255, 193, 7, .2); }
.cd-badge--danger { background: rgba(220, 53, 69, .12); color: #ff8a8a; border: 1px solid rgba(220, 53, 69, .2); }
.cd-body {
    padding: 20px 24px 24px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,109,92,.4) transparent;
}
.cd-body > * { margin-bottom: 18px; }
.cd-body > *:last-child { margin-bottom: 0; }
.cd-body::-webkit-scrollbar { width: 6px; }
.cd-body::-webkit-scrollbar-track { background: transparent; }
.cd-body::-webkit-scrollbar-thumb { background: rgba(255,109,92,.35); border-radius: 3px; }
.cd-body::-webkit-scrollbar-thumb:hover { background: rgba(255,109,92,.6); }
.cd-info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.cd-info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: rgba(18, 26, 44, .6);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
    transition: border-color .2s;
}
.cd-info-card:hover { border-color: rgba(255, 109, 92, .3); }
.cd-info-icon {
    width: 20px;
    height: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}
.cd-info-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cd-ico {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: -2px;
    margin-left: 4px;
}
.cd-info-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.cd-info-val { font-size: 13px; font-weight: 700; color: var(--ink); word-break: break-word; }

/* Balance row */
.cd-balance-row {
    display: flex;
}
.cd-balance-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(18, 26, 44, .5);
}
.cd-balance-card span { font-size: 13px; color: var(--muted); font-weight: 600; }
.cd-balance-card strong { font-size: 18px; font-weight: 800; }
.cd-bal-pos { color: #6ee7a0; }
.cd-bal-neg { color: #ff8a8a; }
.cd-bal-ok { color: #9ca3af; }

.cd-modal-section {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255,255,255,.015);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cd-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cd-balance-mini {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
    background: rgba(18, 26, 44, .45);
}

/* Notes */
.cd-notes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(18, 26, 44, .4);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}
.cd-notes svg { flex-shrink: 0; margin-top: 2px; opacity: .5; }

/* Orders section */
.cd-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.cd-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    background: rgba(18, 26, 44, .5);
    border-bottom: 1px solid var(--border);
}
.cd-section-title svg { flex-shrink: 0; opacity: .6; }
.cd-orders-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,109,92,.4) transparent;
}
.cd-orders-wrap::-webkit-scrollbar { height: 4px; }
.cd-orders-wrap::-webkit-scrollbar-track { background: transparent; }
.cd-orders-wrap::-webkit-scrollbar-thumb { background: rgba(255,109,92,.35); border-radius: 3px; }
.cd-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cd-orders-table thead th {
    padding: 10px 14px;
    text-align: right;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--muted);
    background: rgba(18, 26, 44, .3);
    border-bottom: 1px solid var(--border);
}
.cd-orders-table tbody td {
    padding: 10px 14px;
    color: var(--ink);
    border-bottom: 1px solid rgba(255,255,255,.04);
    white-space: nowrap;
}
.cd-orders-table tbody tr:last-child td { border-bottom: none; }
.cd-orders-table tbody tr:hover { background: rgba(255, 109, 92, .04); }
.cd-order-num {
    font-weight: 700;
    color: var(--accent);
}
.cd-st-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}
.cd-st-ok { background: rgba(52, 199, 89, .12); color: #6ee7a0; }
.cd-st-pending { background: rgba(255, 193, 7, .1); color: #ffd54f; }
.cd-st-cancel { background: rgba(220, 53, 69, .1); color: #ff8a8a; }
.cd-empty { text-align: center; color: var(--muted); padding: 24px 14px !important; }

@media (max-width: 600px) {
    .cd-modal { width: 100%; max-width: 100%; height: 90vh; border-radius: 14px; }
    .cd-info-row { grid-template-columns: 1fr 1fr; }
    .cd-header { padding: 16px 16px 12px; }
    .cd-body { padding: 16px 12px; }
}

/* ── Bulk add rows ── */
.bulk-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 2px;
}
.bulk-row,
.bulk-row--header {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1.3fr 36px;
    gap: 8px;
    align-items: center;
}
.bulk-row--header {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #1d2539, #151d2f);
    z-index: 1;
}
.bulk-row input[type="text"],
.bulk-row input[type="number"],
.bulk-row select {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(12, 18, 32, .6);
    color: var(--ink);
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
}
.bulk-row input:focus,
.bulk-row select:focus { border-color: var(--accent); }
.bulk-price-wrap {
    display: flex;
    gap: 4px;
}
.bulk-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.bulk-remove-btn:hover {
    background: rgba(200, 50, 60, .2);
    color: #ffaaaa;
    border-color: #a44b5a;
}
.bulk-add-row-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 40px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
}
.bulk-add-row-btn svg { width: 16px; height: 16px; }
.bulk-add-row-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 109, 92, .05);
}

/* ── Delivery Follow-up ── */
.delivery-followup-card {
    display: grid;
    gap: 12px;
}

.delivery-followup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.delivery-followup-head-main {
    min-width: 220px;
}

.delivery-followup-head h2 {
    margin: 0;
    font-size: 22px;
}

.delivery-followup-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.delivery-followup-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.delivery-followup-filters input {
    flex: 1;
    min-width: 240px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(12, 18, 32, .65);
    color: var(--ink);
    padding: 0 12px;
    font-family: inherit;
}

.delivery-followup-filters input:focus {
    outline: none;
    border-color: var(--accent);
}

.delivery-status-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-inline-start: auto;
}

.delivery-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0f1a31;
    color: #d4e0fb;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

.delivery-status-tab bdi {
    min-width: 20px;
    text-align: center;
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
    padding: 0 7px;
}

.delivery-status-tab.is-active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
}

.delivery-followup-table .inv-empty {
    text-align: center;
}

.delivery-followup-pagination {
    margin-top: 6px;
}

.delivery-status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.delivery-customer-link {
    border: none;
    background: transparent;
    color: #9fc3ff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 0;
}

.delivery-customer-link:hover {
    color: #c8deff;
    text-decoration: underline;
}

.delivery-confirm-form {
    display: inline-flex;
}

.delivery-confirm-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #2f5a40;
    border-radius: 9px;
    background: rgba(65, 160, 96, .12);
    color: #9ce0b4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.delivery-confirm-btn:hover {
    background: rgba(65, 160, 96, .2);
    border-color: #4b8e60;
}

.delivery-confirm-btn svg {
    width: 15px;
    height: 15px;
}

.delivery-order-body {
    padding: 14px 20px 22px;
    display: grid;
    gap: 12px;
}

.delivery-order-body h4 {
    margin: 2px 0 0;
    font-size: 16px;
}

.delivery-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.delivery-order-info {
    border: 1px solid rgba(56, 78, 122, .45);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(12, 19, 35, .55);
    display: grid;
    gap: 4px;
}

.delivery-order-info span {
    color: var(--muted);
    font-size: 12px;
}

.delivery-order-info strong {
    font-size: 13px;
    color: #eef4ff;
    word-break: break-word;
}

.delivery-items-table {
    min-width: 100%;
}

@media (max-width: 760px) {
    .delivery-followup-head {
        align-items: stretch;
    }

    .delivery-status-tabs {
        margin-inline-start: 0;
    }

    .delivery-followup-filters {
        flex-wrap: nowrap;
        align-items: center;
    }

    .delivery-followup-filters input[type="text"] {
        min-width: 0;
        flex: 1 1 auto;
    }

    .delivery-followup-filters .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .delivery-followup-card.card {
        overflow-x: hidden;
    }

    .delivery-followup-card .inv-table-wrap {
        overflow: hidden;
        border: none;
        background: transparent;
    }

    .module-page .delivery-followup-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .module-page table.delivery-followup-table {
        min-width: 0 !important;
    }

    .module-page .delivery-followup-table th,
    .module-page .delivery-followup-table td {
        min-width: 0 !important;
        max-width: 100%;
    }

    .delivery-followup-table thead {
        display: none;
    }

    .delivery-followup-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: rgba(12, 20, 36, .75);
        overflow: hidden;
    }

    .delivery-followup-table tbody td {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 9px 12px;
        border-bottom: 1px solid rgba(30, 45, 74, .35);
        text-align: right;
        min-width: 0 !important;
        white-space: normal;
        box-sizing: border-box;
    }

    .delivery-followup-table tbody td:last-child {
        border-bottom: none;
    }

    .delivery-followup-table tbody td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }

    .delivery-cell-value,
    .delivery-customer-link {
        justify-self: stretch;
        display: block;
        text-align: right;
        max-width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .delivery-status-inner {
        justify-self: stretch;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
        min-width: 0;
    }

    .delivery-followup-table .inv-empty {
        display: block;
        text-align: center;
    }

    .delivery-followup-table .inv-empty::before {
        content: none;
    }

    .delivery-customer-link {
        font-size: 13px;
        text-align: right;
    }

    .delivery-followup-pagination {
        margin-top: 2px;
        gap: 6px;
    }

    .delivery-followup-pagination .pagination-link {
        min-width: 34px;
        height: 34px;
    }
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .topbar {
        height: auto;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .cd-modal-row { grid-template-columns: 1fr; }

    .topbar-pending-strip {
        max-width: none;
    }
    .inv-toolbar { flex-direction: column; align-items: stretch; }
    .inv-toolbar__end { justify-content: flex-start; flex-wrap: wrap; }
    .inv-search-box { min-width: 0; flex: 1; }
    .inv-category-filter { min-width: 0; flex: 1; }
    .modal-fields-row { grid-template-columns: 1fr; }
    .modal-box--lg { max-width: 95vw; }
    .bulk-row, .bulk-row--header { grid-template-columns: 1.5fr 1fr .8fr 1fr 30px; gap: 4px; }
    .bulk-row input, .bulk-row select { font-size: 12px; height: 34px; padding: 0 6px; }
}
