:root {
    --bg: #07111F;
    --surface: #0D1B2E;
    --surface-2: #10233A;
    --border: #1E3552;
    --text: #EAF2FF;
    --muted: #8FA7C6;
    --blue: #4DA3FF;
    --purple: #4DA3FF;
    --green: #22C55E;
    --amber: #F59E0B;
    --pink: #4DA3FF;
    --danger: #EF4444;
    --radius: 22px;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
    --sidebar-width: 282px;
}

* { box-sizing: border-box; }

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 163, 255, 0.56) rgba(7, 17, 31, 0.92);
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(7, 17, 31, 0.92); border-radius: 999px; }
*::-webkit-scrollbar-thumb {
    border: 2px solid rgba(7, 17, 31, 0.92);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.64);
}
*::-webkit-scrollbar-thumb:hover { background: rgba(77, 163, 255, 0.82); }
*::-webkit-scrollbar-corner { background: rgba(7, 17, 31, 0.92); }

body {
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(77, 163, 255, 0.08), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: Cairo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; width: 100%; }

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    padding: 18px 16px;
    background: linear-gradient(180deg, rgba(8, 19, 34, 0.99), rgba(5, 13, 25, 0.98));
    border-inline-end: 1px solid rgba(77, 163, 255, 0.12);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    transition: transform 180ms ease;
    z-index: 10;
}
.sidebar-backdrop { display: none; }
.mobile-sidebar-close { display: none; }

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    margin-bottom: 18px;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(12, 28, 48, 0.68);
}
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #2f80ed, #1d4ed8);
    color: white;
    font-weight: 800;
    box-shadow: none;
}
.brand strong { display: block; font-size: 0.98rem; line-height: 1.3; letter-spacing: -0.01em; }
.brand small { color: #8ea4c1; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; }

.sidebar-nav { display: grid; gap: 10px; padding-bottom: 14px; }
.sidebar-section { display: grid; gap: 3px; }
.sidebar-section-title {
    margin: 2px 8px 3px;
    color: #637994;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.nav-link, .sidebar-nav-item, .sidebar-nav-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 37px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #9aacc4;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.nav-link:hover, .nav-link:focus-visible {
    color: var(--text);
    background: rgba(148, 163, 184, 0.07);
    border-color: rgba(148, 163, 184, 0.11);
    outline: none;
}
.nav-link.active, .nav-link.is-active {
    color: var(--text);
    background: rgba(77, 163, 255, 0.09);
    border-color: rgba(77, 163, 255, 0.17);
    box-shadow: inset -2px 0 0 rgba(77, 163, 255, 0.72);
}
.sidebar-nav-icon {
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.06);
    color: #71869f;
    font-size: 0.7rem;
    font-weight: 900;
}
.nav-link.active .sidebar-nav-icon, .nav-link.is-active .sidebar-nav-icon {
    background: rgba(77, 163, 255, 0.12);
    color: #a9cdf8;
}
.sidebar-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group, .sidebar-nav-group { display: grid; gap: 3px; }
.nav-group[open], .nav-group.is-open { border-radius: 13px; }
.nav-group summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after {
    content: "▾";
    display: grid;
    place-items: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-inline-start: auto;
    border-radius: 6px;
    color: #71869f;
    font-size: 0.58rem;
    line-height: 1;
    transition: transform 150ms ease, color 150ms ease, background 150ms ease;
}
.nav-group summary:hover::after { background: rgba(148, 163, 184, 0.08); color: #9fb1c9; }
.nav-group[open] summary::after { transform: rotate(180deg); color: var(--blue); }
.nav-submenu, .sidebar-subnav {
    display: grid;
    gap: 1px;
    margin: 0 0 2px;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, 0.07);
    border-radius: 12px;
    background: rgba(3, 10, 22, 0.22);
}
.nav-sub-link, .sidebar-subnav-item {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 14px 7px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #93a5bd;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.nav-sub-link:hover, .nav-sub-link:focus-visible {
    border-color: transparent;
    background: rgba(148, 163, 184, 0.055);
    color: var(--text);
    outline: none;
}
.nav-sub-link.active, .nav-sub-link.is-active {
    border-color: transparent;
    background: rgba(77, 163, 255, 0.065);
    color: var(--text);
}
.nav-sub-link.active::before, .nav-sub-link.is-active::before {
    content: "";
    position: absolute;
    inset-block: 9px;
    inset-inline-start: 6px;
    width: 2px;
    border-radius: 999px;
    background: var(--blue);
}

.main-shell {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    margin-inline-start: var(--sidebar-width);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 90px;
    padding: 20px 34px;
    background: rgba(8, 13, 26, 0.72);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}
.topbar-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.35rem, 2vw, 2rem); }
.eyebrow { color: var(--blue); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}
.account-menu { position: relative; flex: 0 1 auto; min-width: 0; }
.account-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 260px;
    min-height: 44px;
    padding: 5px 9px 5px 12px;
    border: 1px solid rgba(77, 163, 255, 0.16);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(16, 35, 58, 0.82), rgba(8, 13, 26, 0.58));
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.account-pill:hover, .account-pill:focus-visible, .account-pill[aria-expanded="true"] { border-color: rgba(77, 163, 255, 0.34); background: linear-gradient(135deg, rgba(23, 49, 82, 0.92), rgba(10, 20, 37, 0.72)); outline: none; }
.account-pill:active { transform: translateY(1px); }
.user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(145deg, #2f80ed, #1d4ed8);
    color: white;
    font-size: 0.78rem;
    font-weight: 900;
    box-shadow: none;
}
.user-avatar.small { flex-basis: 36px; width: 36px; height: 36px; border-radius: 13px; }
.account-pill-text { display: grid; gap: 1px; min-width: 0; text-align: right; }
.user-name { overflow: hidden; color: var(--text); font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.account-pill-text small, .account-dropdown-head small { color: var(--muted); font-size: 0.72rem; line-height: 1.25; white-space: nowrap; }
.account-caret { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 7px; color: #8ea4c1; font-size: 0.62rem; transition: transform 160ms ease, background 160ms ease, color 160ms ease; }
.account-pill[aria-expanded="true"] .account-caret { transform: rotate(180deg); background: rgba(77, 163, 255, 0.12); color: #bfdbfe; }
.account-dropdown {
    position: absolute;
    inset-block-start: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: 45;
    width: min(280px, calc(100vw - 24px));
    padding: 9px;
    border: 1px solid rgba(77, 163, 255, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 35, 58, 0.98), rgba(8, 13, 26, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}
.account-dropdown.is-hidden { display: none; }
.account-dropdown-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px; }
.account-dropdown-head strong { display: block; color: var(--text); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-divider { height: 1px; margin: 5px 4px; background: rgba(148, 163, 184, 0.14); }
.account-dropdown-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #fecaca;
    cursor: pointer;
    font-weight: 900;
    text-align: right;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.account-dropdown-item:hover, .account-dropdown-item:focus-visible { border-color: rgba(248, 113, 113, 0.18); background: rgba(127, 29, 29, 0.13); color: #fee2e2; outline: none; }
.install-menu-item { color: #bfdbfe; }
.install-menu-item:hover, .install-menu-item:focus-visible { border-color: rgba(77, 163, 255, 0.2); background: rgba(77, 163, 255, 0.1); color: var(--text); }
.install-menu-item[hidden] { display: none; }
.logout-form { margin: 0; }
.logout-confirm-modal, .install-help-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
}
.logout-confirm-modal.is-hidden { display: none; }
.install-help-modal.is-hidden { display: none; }
.logout-confirm-backdrop, .install-help-backdrop { position: absolute; inset: 0; background: rgba(2, 8, 23, 0.68); backdrop-filter: blur(10px); }
.logout-confirm-card, .install-help-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    width: min(100%, 420px);
    padding: 22px;
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(16, 35, 58, 0.98), rgba(13, 27, 46, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}
.install-help-card { border-color: rgba(77, 163, 255, 0.22); }
.logout-confirm-card h2, .install-help-card h2 { margin: 4px 0 6px; color: var(--text); font-size: 1.25rem; }
.logout-confirm-card p, .install-help-card p { margin: 0; color: var(--muted); line-height: 1.8; }
.install-help-card ol { margin: 10px 0; padding-inline-start: 22px; color: var(--text); line-height: 1.9; }
.install-help-card li { padding-inline-start: 4px; }
.install-help-card strong { color: #bfdbfe; }
.logout-confirm-actions, .install-help-actions { display: flex; justify-content: flex-end; gap: 10px; }
.logout-confirm-actions .btn, .logout-confirm-submit { min-height: 42px; }
.install-help-actions .btn { min-height: 42px; min-width: 96px; }
.user-chip, .badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border);
    color: var(--muted);
}
.sidebar-toggle { display: none; }

.content { padding: 34px 34px 52px; }
.dashboard-page { display: grid; gap: 18px; }
.dashboard-page > *, .enhanced-invoice-detail > * { min-width: 0; max-width: 100%; }
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(77, 163, 255, 0.14);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(16, 35, 58, 0.62), rgba(8, 13, 26, 0.34));
}
.dashboard-hero h2 { margin: 3px 0 0; font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.25; }
.dashboard-hero p { margin: 6px 0 0; color: var(--muted); font-size: 0.94rem; line-height: 1.7; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.metric-card, .panel, .login-panel {
    background: linear-gradient(180deg, rgba(16, 35, 58, 0.96), rgba(13, 27, 46, 0.96));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 124px;
    padding: 16px;
    text-align: right;
    display: grid;
    align-content: space-between;
    gap: 16px;
}
.metric-card::before {
    content: "";
    position: absolute;
    inset-inline: 16px;
    inset-block-start: 0;
    height: 3px;
    border-radius: 999px;
    opacity: 0.82;
    background: rgba(77, 163, 255, 0.72);
}
.metric-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-card-head i { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(77, 163, 255, 0.18); border-radius: 12px; background: rgba(77, 163, 255, 0.08); }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 900; line-height: 1.45; }
.metric-card strong { display: block; color: var(--text); font-size: clamp(1.45rem, 2vw, 1.85rem); line-height: 1.12; letter-spacing: -0.02em; word-break: break-word; }
.metric-card > small { margin-top: -10px; color: rgba(191, 219, 254, 0.84); direction: ltr; text-align: right; }
.metric-card-strong {
    background: linear-gradient(145deg, rgba(16, 35, 58, 0.98), rgba(13, 27, 46, 0.98));
    border-color: rgba(77, 163, 255, 0.36);
}
.metric-card-strong::before { height: 3px; background: var(--blue); }
.metric-card-strong .metric-card-head i { border-color: rgba(77, 163, 255, 0.34); background: rgba(77, 163, 255, 0.13); }
.metric-card-strong strong { font-size: clamp(1.6rem, 2.1vw, 2rem); }
.accent-blue, .accent-purple, .accent-pink, .accent-slate { color: var(--blue); }
.accent-green { color: var(--green); }
.accent-amber { color: var(--amber); }

.dashboard-section-card { border-radius: 22px; }
.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.dashboard-section-header h2 { margin: 2px 0 0; font-size: 1.15rem; line-height: 1.3; }
.dashboard-section-header .badge { flex: 0 0 auto; }
.warning-badge { min-height: 24px; padding: 3px 8px; border-color: rgba(245, 158, 11, 0.2); color: #fbbf24; background: rgba(245, 158, 11, 0.07); font-size: 0.72rem; }
.warning-badge.info { border-color: rgba(148, 163, 184, 0.18); color: var(--muted); background: rgba(148, 163, 184, 0.07); }
.dashboard-warning-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.dashboard-actions-panel { padding: 18px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(16, 35, 58, 0.58), rgba(13, 27, 46, 0.42)); box-shadow: var(--shadow); }
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(8, 13, 26, 0.22);
    color: var(--text);
    font-weight: 900;
    text-align: center;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.quick-action:hover, .quick-action:focus-visible { border-color: rgba(77, 163, 255, 0.46); background: rgba(77, 163, 255, 0.08); outline: none; transform: translateY(-1px); }
.quick-action-primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #06111F;
}
.quick-action-primary:hover, .quick-action-primary:focus-visible { background: #78BAFF; border-color: #78BAFF; }
.dashboard-section { margin-bottom: 0; padding: 18px; }
.dashboard-table-wrap { border: 1px solid rgba(148, 163, 184, 0.1); border-radius: 18px; background: rgba(8, 13, 26, 0.18); }
.compact-table { min-width: 860px; }
.dashboard-table th, .dashboard-table td { padding: 12px 14px; vertical-align: middle; }
.dashboard-table th { font-size: 0.78rem; }
.dashboard-table td { color: rgba(234, 242, 255, 0.92); }
.dashboard-product-cell { white-space: normal !important; min-width: 230px; }
.dashboard-product-cell strong, .dashboard-product-cell span { display: block; }
.dashboard-product-cell strong { margin-bottom: 3px; color: var(--text); }
.dashboard-product-cell span { color: var(--muted); line-height: 1.45; }
.dashboard-customer-cell strong { color: var(--text); }
.dashboard-money { color: #bbf7d0; white-space: nowrap; }
.status-badge.status-info, .status-badge.info { color: #bae6fd; background: rgba(56, 189, 248, 0.12); }
.status-badge.status-success, .status-badge.success { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.status-badge.status-warning, .status-badge.warning { color: var(--amber); background: rgba(251, 191, 36, 0.11); }
.status-badge.status-muted, .status-badge.muted { color: var(--muted); background: rgba(148, 163, 184, 0.09); }
.table-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 11px; border: 1px solid rgba(77, 163, 255, 0.2); border-radius: 999px; color: #bfdbfe; background: rgba(77, 163, 255, 0.07); font-weight: 900; }
.table-link:hover, .table-link:focus-visible { border-color: rgba(77, 163, 255, 0.45); background: rgba(77, 163, 255, 0.13); outline: none; }
.movement-reference {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: rtl;
    white-space: nowrap;
}
.low-stock-grid, .low-stock-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.dashboard-warning-subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.dashboard-warning-subhead.danger { margin-top: 12px; }
.dashboard-warning-title { margin: 0; color: #fbbf24; font-size: 0.9rem; line-height: 1.4; }
.dashboard-warning-title.danger { color: #fda4af; }
.dashboard-warning-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    color: #fde68a;
    background: rgba(8, 13, 26, 0.24);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.dashboard-warning-link:hover, .dashboard-warning-link:focus-visible { border-color: rgba(245, 158, 11, 0.34); background: rgba(245, 158, 11, 0.08); outline: none; }
.dashboard-warning-link.danger { border-color: rgba(148, 163, 184, 0.18); color: #fecdd3; background: rgba(8, 13, 26, 0.24); }
.dashboard-warning-link.danger:hover, .dashboard-warning-link.danger:focus-visible { border-color: rgba(248, 113, 113, 0.34); background: rgba(127, 29, 29, 0.16); }
.low-stock-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    min-height: 0;
    padding: 10px 11px;
    border: 1px solid rgba(245, 158, 11, 0.14);
    border-inline-start: 3px solid rgba(245, 158, 11, 0.5);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.045), rgba(16, 35, 58, 0.34));
}
.out-stock-card { border-color: rgba(248, 113, 113, 0.22); border-inline-start-color: rgba(248, 113, 113, 0.58); background: linear-gradient(135deg, rgba(127, 29, 29, 0.14), rgba(16, 35, 58, 0.38)); }
.low-stock-product-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: center; min-width: 0; }
.low-stock-card strong {
    min-width: 0;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
}
.low-stock-code {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 6px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.07);
    color: var(--text);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.low-stock-code.danger { border-color: rgba(248, 113, 113, 0.24); background: rgba(127, 29, 29, 0.16); }
.low-stock-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.low-stock-location { min-width: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.low-stock-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
    color: #fbbf24;
    font-size: 0.76rem;
    font-weight: 800;
    flex: 0 0 auto;
}
.low-stock-meta span { padding: 3px 7px; border-radius: 999px; background: rgba(245, 158, 11, 0.065); border: 1px solid rgba(245, 158, 11, 0.12); }
.low-stock-meta.danger { color: #fda4af; }
.low-stock-meta.danger span { background: rgba(127, 29, 29, 0.16); border-color: rgba(248, 113, 113, 0.16); }
.stock-alerts-page { overflow: hidden; }
.stock-alert-count {
    display: grid;
    gap: 3px;
    min-width: 112px;
    padding: 9px 12px;
    border: 1px solid rgba(245, 158, 11, 0.16);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.07);
    text-align: center;
}
.stock-alert-count small { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.stock-alert-count strong { color: #fbbf24; font-size: 1.25rem; line-height: 1; }
.stock-alert-filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(6, minmax(130px, 1fr)) auto auto;
    gap: 9px;
    align-items: center;
    margin: 0 0 14px;
}
.stock-alert-table-wrap { border: 1px solid rgba(148, 163, 184, 0.12); border-radius: 18px; background: rgba(8, 13, 26, 0.2); }
.stock-alert-table { min-width: 980px; }
.stock-alert-table th { font-size: 0.76rem; }
.stock-alert-table th, .stock-alert-table td { padding: 11px 12px; vertical-align: middle; }
.stock-alert-row-out { background: rgba(127, 29, 29, 0.08); }
.stock-alert-row-low { background: rgba(245, 158, 11, 0.035); }
.stock-alert-product-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; min-width: 240px; }
.stock-alert-product-cell strong { min-width: 0; color: var(--text); font-size: 0.88rem; line-height: 1.35; overflow-wrap: break-word; }
.stock-alert-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 23px;
    padding: 2px 7px;
    border: 1px solid rgba(77, 163, 255, 0.22);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.08);
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}
.stock-alert-quantity { color: #fde68a; font-weight: 900; white-space: nowrap; }
.best-seller-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.best-seller-card {
    display: grid;
    gap: 10px;
    min-height: 128px;
    padding: 14px;
    border: 1px solid rgba(77, 163, 255, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(77, 163, 255, 0.08), rgba(16, 35, 58, 0.42));
}
.best-seller-card small { color: var(--blue); font-weight: 900; }
.best-seller-product { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; min-width: 0; }
.best-seller-product > span {
    padding: 3px 8px;
    border: 1px solid rgba(77, 163, 255, 0.22);
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(77, 163, 255, 0.08);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}
.best-seller-card strong { min-width: 0; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; word-break: normal; }
.best-seller-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 0.86rem; font-weight: 800; }
.best-seller-meta span { padding: 5px 9px; border-radius: 999px; background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.12); }
.best-seller-empty { color: var(--muted) !important; font-size: 0.95rem; }
.dashboard-empty-state,
.success-state {
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(143, 167, 198, 0.055);
    text-align: center;
    font-weight: 900;
}
.success-state { border-color: rgba(34, 197, 94, 0.22); color: var(--green); background: rgba(34, 197, 94, 0.07); }

.panel { padding: 26px; }
.panel-header { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.panel-header h2 { margin: 2px 0 0; }
.empty-state {
    padding: 36px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    color: var(--text);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn-primary { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #ffffff; font-weight: 700; }
.btn-ghost { background: rgba(148, 163, 184, 0.1); border: 1px solid var(--border); }
.btn-info-soft { background: rgba(77, 163, 255, 0.12); border: 1px solid rgba(77, 163, 255, 0.32); color: #bfdbfe; font-weight: 800; }
.btn-info-soft:hover, .btn-info-soft:focus-visible { background: rgba(77, 163, 255, 0.18); border-color: rgba(77, 163, 255, 0.48); outline: none; }
.btn-danger { background: rgba(190, 18, 60, 0.9); border: 1px solid rgba(251, 113, 133, 0.54); color: #fff1f2; font-weight: 900; }
.btn-danger:hover, .btn-danger:focus-visible { background: rgba(225, 29, 72, 0.95); border-color: rgba(253, 164, 175, 0.7); outline: none; }
.btn-danger-soft { background: rgba(251, 113, 133, 0.13); border: 1px solid rgba(251, 113, 133, 0.35); color: #fecdd3; font-weight: 800; }
.btn-sm { min-height: 34px; padding: 7px 12px; border-radius: 11px; font-size: 0.86rem; }
.btn-danger-soft:hover, .btn-danger-soft:focus-visible { background: rgba(251, 113, 133, 0.2); border-color: rgba(251, 113, 133, 0.5); outline: none; }
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.button-group { display: flex; flex-wrap: wrap; gap: 10px; }
.table-link { color: var(--blue); font-weight: 700; }

.skip-link {
    position: fixed;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fbbf24;
    color: #111827;
    font-weight: 900;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #fbbf24 !important;
    outline-offset: 2px;
}
.danger-link { color: #fecdd3; }
.table-actions { display: inline-flex; flex-wrap: nowrap; justify-content: flex-start; gap: 7px; }
.stock-row-actions { flex-wrap: wrap; min-width: 178px; }
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.action-btn-edit { color: #bae6fd; background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.2); }
.action-btn-edit:hover, .action-btn-edit:focus-visible { background: rgba(56, 189, 248, 0.15); border-color: rgba(56, 189, 248, 0.42); outline: none; }
.action-btn-delete { color: #fecdd3; background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.2); }
.action-btn-delete:hover, .action-btn-delete:focus-visible { background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.42); outline: none; }

.messages {
    display: grid;
    gap: 12px;
    width: min(100%, 920px);
    margin: 0 0 22px auto;
}
.message-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 10px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(15, 23, 42, 0.72));
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
    color: var(--text);
    transition: opacity 180ms ease, transform 180ms ease;
}
.flash-message.is-hidden {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}
.message-marker {
    width: 12px;
    height: 34px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.24);
}
.message-body { line-height: 1.7; font-weight: 800; overflow-wrap: anywhere; }
.message-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(8, 13, 26, 0.4);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.message-close:hover, .message-close:focus-visible {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(56, 189, 248, 0.12);
    color: var(--text);
    outline: none;
}
.message-success { border-color: rgba(52, 211, 153, 0.3); background: linear-gradient(135deg, rgba(52, 211, 153, 0.11), rgba(15, 23, 42, 0.72)); }
.message-success .message-marker { background: var(--green); box-shadow: 0 0 20px rgba(52, 211, 153, 0.26); }
.message-error { border-color: rgba(251, 113, 133, 0.34); background: linear-gradient(135deg, rgba(251, 113, 133, 0.12), rgba(15, 23, 42, 0.72)); }
.message-error .message-marker { background: var(--danger); box-shadow: 0 0 20px rgba(251, 113, 133, 0.26); }
.message-warning { border-color: rgba(251, 191, 36, 0.34); background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.72)); }
.message-warning .message-marker { background: var(--amber); box-shadow: 0 0 20px rgba(251, 191, 36, 0.26); }
.message-info, .message-debug { border-color: rgba(56, 189, 248, 0.26); }

.login-body { display: grid; place-items: center; padding: 24px; }
.login-wrap { width: min(100%, 480px); }
.login-panel { padding: 32px; }
.login-panel h1 { margin: 18px 0 6px; }
.login-panel p { margin: 0 0 22px; color: var(--muted); }
.login-brand { margin-bottom: 8px; }
.form-card { display: grid; gap: 10px; }
.form-card label { color: var(--muted); font-weight: 700; }
.form-card input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(8, 13, 26, 0.68);
    color: var(--text);
    outline: none;
}
.form-card input:focus { border-color: rgba(56, 189, 248, 0.55); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08); }
.form-card .btn { margin-top: 8px; width: 100%; }

.list-panel, .form-panel { overflow: hidden; max-width: 100%; }
.bulk-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(251, 113, 133, 0.2);
    border-radius: 16px;
    background: rgba(251, 113, 133, 0.06);
    color: var(--muted);
}
.bulk-actions-bar[hidden] { display: none; }
.bulk-selection-count { color: var(--text); font-weight: 900; }
.select-column { width: 42px; min-width: 42px; text-align: center; }
.code-column { width: 110px; max-width: 130px; }
.actions-column { width: 118px; }
.delete-confirm-panel { display: grid; gap: 18px; }
.delete-warning {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(251, 113, 133, 0.28);
    background: rgba(251, 113, 133, 0.08);
    color: #fecdd3;
    font-weight: 800;
}
.delete-summary-card, .delete-blockers {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.52);
}
.delete-summary-card span, .delete-summary-card small, .blocker-text { color: var(--muted); }
.delete-blockers { border-color: rgba(251, 113, 133, 0.25); }
.delete-blockers p, .blocker-text { margin: 6px 0 0; }
.delete-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.danger-badge { color: #fecdd3; border-color: rgba(251, 113, 133, 0.3); }
.barcode-management-card, .list-toolbar-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.06);
}
.barcode-management-card div { display: grid; gap: 3px; }
.barcode-management-card strong { color: var(--text); font-size: 1rem; }
.barcode-management-card small, .printer-note { color: var(--muted); }
.list-toolbar-form { justify-content: flex-start; flex-wrap: wrap; }
.success-toolbar { align-items: center; justify-content: center; min-height: 44px; margin-bottom: 14px; padding: 10px 13px; border-color: rgba(52, 211, 153, 0.24); color: var(--green); font-weight: 900; }
.barcode-labels-panel { display: grid; gap: 12px; }
.barcode-page-header { margin-bottom: 2px; }
.barcode-workflow-section {
    display: grid;
    gap: 13px;
    padding: 16px 17px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.36);
}
.barcode-step-heading { display: flex; align-items: flex-start; gap: 10px; }
.barcode-step-heading h3 { margin: 0; color: var(--text); font-size: 1.06rem; }
.barcode-step-heading p { margin: 4px 0 0; color: var(--muted); line-height: 1.65; font-size: 0.9rem; }
.barcode-section-heading { display: grid; gap: 4px; }
.barcode-section-heading h3 { margin: 0; color: var(--text); font-size: 1.06rem; }
.barcode-section-heading p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 0.9rem; }
.step-badge { display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid rgba(77, 163, 255, 0.28); border-radius: 12px; background: rgba(77, 163, 255, 0.1); color: #bfdbfe; font-weight: 900; }
.barcode-step-select { gap: 12px; }
.barcode-label-form { display: none; }
.print-settings-card { border-color: rgba(77, 163, 255, 0.22); background: linear-gradient(145deg, rgba(16, 35, 58, 0.56), rgba(8, 13, 26, 0.34)); }
.barcode-product-filter-form {
    display: grid;
    gap: 12px;
    margin: 0;
}
.barcode-search-row { display: grid; grid-template-columns: minmax(320px, 1fr) auto auto; gap: 9px; align-items: end; }
.barcode-search-field, .barcode-filter-field { display: grid; gap: 6px; min-width: 0; }
.barcode-search-field label, .barcode-filter-field label { color: var(--muted); font-size: 0.82rem; font-weight: 900; }
.barcode-search-field .form-control { min-height: 46px; border-color: rgba(77, 163, 255, 0.3); background: rgba(2, 6, 23, 0.28); font-size: 0.96rem; }
.barcode-search-row .btn { min-height: 46px; white-space: nowrap; }
.barcode-classification-filter { display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.barcode-compact-filter-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.barcode-compact-filter-header strong { color: #bfdbfe; font-size: 0.84rem; font-weight: 900; }
.barcode-filter-toggle {
    display: none;
    border: 1px solid rgba(77, 163, 255, 0.22);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.08);
    color: #bfdbfe;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}
.barcode-filter-toggle:hover, .barcode-filter-toggle:focus-visible { border-color: rgba(77, 163, 255, 0.44); background: rgba(77, 163, 255, 0.14); outline: none; }
.barcode-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 9px; align-items: end; }
.barcode-filter-grid select, .barcode-filter-grid input { min-width: 0; width: 100%; }
.label-count-control { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.label-control-field { display: grid; gap: 6px; min-width: 0; }
.label-count-control label { color: var(--muted); font-weight: 900; font-size: 0.84rem; }
.label-count-control input, .label-count-control select { width: 100%; min-width: 0; min-height: 44px; }
.label-preview-action-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding-block: 14px; border-color: rgba(77, 163, 255, 0.22); background: linear-gradient(135deg, rgba(16, 35, 58, 0.5), rgba(8, 13, 26, 0.32)); }
.label-preview-action-card .barcode-section-heading p { max-width: 520px; }
.label-preview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.selected-count { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid rgba(77, 163, 255, 0.18); border-radius: 999px; color: var(--text); background: rgba(77, 163, 255, 0.07); font-weight: 900; white-space: nowrap; }
#preview-labels-button:disabled { border-color: rgba(148, 163, 184, 0.12); background: rgba(148, 163, 184, 0.08); color: var(--muted); opacity: 0.68; box-shadow: none; }
.barcode-products-card { gap: 12px; }
.barcode-product-table-section { margin-top: 0; }
.barcode-product-table-section .select-column { width: 54px; text-align: center; }
.barcode-product-table-section input[type="checkbox"] { width: 20px; height: 20px; }
.no-spinner { appearance: textfield; }
.no-spinner::-webkit-outer-spin-button, .no-spinner::-webkit-inner-spin-button { margin: 0; appearance: none; }
.barcode-count-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
}
.mini-count-card {
    display: grid;
    align-content: center;
    min-height: 80px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
}
.mini-count-card span { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.mini-count-card strong { display: block; margin-top: 6px; font-size: 1.6rem; line-height: 1; }
.mini-count-card.warning { border-color: rgba(251, 191, 36, 0.22); color: var(--amber); }
.barcode-status-toolbar { justify-content: space-between; margin-bottom: 0; }
.barcode-status-toolbar span { color: var(--muted); font-size: 0.88rem; font-weight: 800; }
.barcode-empty-state { display: grid; gap: 12px; justify-items: center; min-height: 130px; margin-top: 0; border: 1px dashed rgba(148, 163, 184, 0.2); border-radius: 18px; background: rgba(8, 13, 26, 0.25); }
.barcode-page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}
.module-header h2 { margin: 2px 0 4px; }
.module-header p { margin: 0; color: var(--muted); max-width: 720px; }
.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: -4px 0 18px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
}
.module-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(148, 163, 184, 0.07);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}
.module-tab:hover, .module-tab.active {
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.36);
    background: rgba(56, 189, 248, 0.12);
}
.module-tab.active { box-shadow: inset 0 -2px 0 rgba(77, 163, 255, 0.62); }
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
}
.filter-bar .btn, .inventory-filter-bar .btn, .movement-filter-bar .btn { min-height: 46px; white-space: nowrap; }
.product-filter { grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(140px, 1fr)) auto auto; }
.sales-rep-filter-bar { grid-template-columns: minmax(260px, 1fr) auto auto; }
.customer-filter-bar { grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) auto auto; }
.sales-rep-filter-bar .btn, .customer-filter-bar .btn { width: auto; padding-inline: 18px; }
.customer-profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.customer-profile-card { display: grid; align-content: start; gap: 4px; min-height: 72px; padding: 11px 12px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 14px; background: rgba(15, 23, 42, 0.42); }
.customer-profile-card span { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.customer-profile-card strong, .customer-profile-card p { margin: 0; color: var(--text); font-size: 0.94rem; font-weight: 900; line-height: 1.55; overflow-wrap: anywhere; }
.customer-profile-card.full-width { grid-column: 1 / -1; }
.customer-form { gap: 18px; }
.customer-form .form-grid { gap: 14px 16px; }
.customer-form textarea { min-height: 74px; resize: vertical; }
.customer-form .checkbox-field { padding-top: 18px; }
.customer-form .form-actions { margin-top: 2px; padding-top: 16px; border-top: 1px solid var(--border); }
.customer-row-actions { gap: 8px; }
.customer-row-actions .action-btn { min-height: 34px; padding: 7px 13px; border-radius: 999px; font-size: 0.84rem; }
.customer-view-action { color: var(--text); background: rgba(148, 163, 184, 0.11); border-color: rgba(148, 163, 184, 0.24); }
.customer-edit-action { color: #bae6fd; background: rgba(56, 189, 248, 0.11); border-color: rgba(56, 189, 248, 0.28); }
.customer-view-action:hover, .customer-view-action:focus-visible { background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.38); outline: none; }
.customer-edit-action:hover, .customer-edit-action:focus-visible { background: rgba(56, 189, 248, 0.18); border-color: rgba(56, 189, 248, 0.45); outline: none; }
.customer-detail-page { display: grid; gap: 14px; }
.customer-detail-page .preview-empty-state { margin-top: 4px; }
.customer-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid rgba(77, 163, 255, 0.16); border-radius: 18px; background: linear-gradient(135deg, rgba(16, 35, 58, 0.58), rgba(8, 13, 26, 0.32)); }
.customer-hero-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.customer-avatar { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid rgba(77, 163, 255, 0.3); border-radius: 16px; background: rgba(77, 163, 255, 0.12); color: #bfdbfe; font-size: 1.15rem; font-weight: 900; }
.customer-hero-text { min-width: 0; }
.customer-hero-text h2 { margin: 2px 0 5px; color: var(--text); font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.25; overflow-wrap: anywhere; }
.customer-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 900; }
.customer-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.customer-hero-actions .btn { min-height: 40px; padding-inline: 16px; }
.customer-purchase-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.customer-summary-card { display: grid; align-content: center; gap: 7px; min-height: 86px; padding: 13px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 15px; background: rgba(15, 23, 42, 0.46); }
.customer-summary-card span { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.customer-summary-card strong { color: var(--text); font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.customer-summary-card.total { border-color: rgba(52, 211, 153, 0.24); background: rgba(52, 211, 153, 0.08); }
.customer-summary-card.total strong { color: #bbf7d0; font-size: 1.18rem; }
.customer-history-section { display: grid; gap: 12px; }
.customer-section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 2px; }
.customer-section-header h3 { margin: 0; color: var(--text); font-size: 1.05rem; }
.customer-section-header p { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.65; }
.customer-invoice-history-wrap { border: 1px solid rgba(148, 163, 184, 0.12); border-radius: 18px; background: rgba(15, 23, 42, 0.18); }
.customer-invoice-history-table { min-width: 860px; }
.customer-invoice-history-table td { vertical-align: middle; }
.customer-invoice-history-table td:first-child { display: grid; gap: 6px; justify-items: start; }
.customer-invoice-history-table .action-btn { min-height: 34px; justify-content: center; }
.users-management-page { overflow: visible; }
.users-page-header { align-items: center; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.users-title-row { display: flex; align-items: center; gap: 10px; }
.users-title-row h2 { margin-bottom: 0; }
.role-help-trigger {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(77, 163, 255, 0.34);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.1);
    color: #bfdbfe;
    cursor: pointer;
    font-weight: 900;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.role-help-trigger:hover, .role-help-trigger:focus-visible { border-color: rgba(77, 163, 255, 0.72); background: rgba(77, 163, 255, 0.18); color: var(--text); outline: none; transform: translateY(-1px); }
.users-add-button { min-height: 44px; padding-inline: 20px; border: 1px solid rgba(125, 211, 252, 0.22); box-shadow: 0 12px 30px rgba(77, 163, 255, 0.14); font-weight: 900; white-space: nowrap; }
.users-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(145px, 180px) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.34);
}
.users-filter-bar .form-control, .users-filter-bar .btn { min-height: 44px; }
.users-filter-bar .btn { padding-inline: 17px; white-space: nowrap; }
.users-table-wrap { border: 1px solid rgba(148, 163, 184, 0.12); border-radius: 18px; background: rgba(15, 23, 42, 0.18); }
.users-table { min-width: 960px; }
.users-table th { white-space: nowrap; }
.users-table td { vertical-align: middle; line-height: 1.55; }
.users-table td, .users-table td span, .users-table td strong { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users-table td:last-child, .users-table td:last-child span { max-width: none; overflow: visible; }
.role-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}
.role-badge { border: 1px solid rgba(125, 211, 252, 0.28); background: rgba(56, 189, 248, 0.08); color: #bfdbfe; }
.status-badge.success { border: 1px solid rgba(34, 197, 94, 0.32); background: rgba(34, 197, 94, 0.11); color: #bbf7d0; }
.status-badge.muted { border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(148, 163, 184, 0.09); color: var(--muted); }
.muted-placeholder { color: rgba(143, 167, 198, 0.72); font-weight: 700; }
.users-row-actions { justify-content: flex-start; gap: 8px; }
.users-row-actions .action-btn { min-height: 34px; padding: 7px 13px; border-radius: 999px; }
.role-help-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 23, 0.7);
    backdrop-filter: blur(12px);
}
.role-help-modal.is-hidden { display: none; }
.role-help-card {
    width: min(100%, 760px);
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid rgba(77, 163, 255, 0.24);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(16, 35, 58, 0.98), rgba(13, 27, 46, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}
.role-help-card .module-header { margin-bottom: 14px; }
.role-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.role-help-grid article { display: grid; gap: 7px; padding: 14px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 16px; background: rgba(15, 23, 42, 0.48); }
.role-help-grid strong { color: var(--text); }
.role-help-grid p { margin: 0; color: var(--muted); line-height: 1.75; font-size: 0.92rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.invoice-form-panel { padding: 20px; }
.invoice-form { gap: 14px; }
.invoice-form textarea { min-height: 56px; resize: vertical; }
.invoice-form #id_notes { min-height: 54px; max-height: 120px; }
.invoice-section-card { border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 18px; background: linear-gradient(180deg, rgba(15, 23, 42, 0.42), rgba(8, 13, 26, 0.3)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025); }
.invoice-pos-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 8px; border: 1px solid rgba(77, 163, 255, 0.12); border-radius: 18px; background: rgba(8, 13, 26, 0.42); }
.invoice-pos-steps button { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 42px; padding: 8px 10px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 900; line-height: 1.35; text-align: right; cursor: pointer; }
.invoice-pos-steps button:hover, .invoice-pos-steps button:focus-visible { background: rgba(77, 163, 255, 0.08); color: #dbeafe; outline: none; }
.invoice-pos-steps button.is-current { background: rgba(77, 163, 255, 0.13); color: #dbeafe; }
.invoice-pos-steps b { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 9px; background: rgba(148, 163, 184, 0.08); color: var(--text); font-size: 0.75rem; }
.invoice-pos-steps .is-current b { border-color: rgba(77, 163, 255, 0.42); background: rgba(77, 163, 255, 0.2); color: #eff6ff; }
.pos-step-card { display: grid; gap: 14px; padding: 17px; scroll-margin-top: 90px; }
.pos-step-card[hidden] { display: none !important; }
.pos-products-step { border-color: rgba(77, 163, 255, 0.28); background: linear-gradient(150deg, rgba(16, 35, 58, 0.72), rgba(8, 13, 26, 0.38)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 50px rgba(2, 6, 23, 0.14); }
.pos-step-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.pos-step-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pos-step-title strong { display: block; color: var(--text); font-size: 1.06rem; font-weight: 900; }
.pos-step-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.79rem; font-weight: 800; line-height: 1.5; }
.pos-step-number { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid rgba(77, 163, 255, 0.34); border-radius: 13px; background: rgba(77, 163, 255, 0.14); color: #dbeafe; font-size: 1rem; font-weight: 900; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.pos-source-strip { grid-template-columns: minmax(170px, 0.36fr) minmax(0, 1fr); align-items: end; padding: 13px 14px; background: rgba(7, 17, 31, 0.42); }
.pos-source-strip .invoice-subsection-title { align-self: center; }
.invoice-scanner-panel { display: grid; grid-template-columns: minmax(250px, 0.72fr) minmax(360px, 1.28fr); gap: 11px 16px; padding: 18px; border: 1px solid rgba(56, 189, 248, 0.32); border-radius: 20px; background: radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.2), transparent 45%), linear-gradient(145deg, rgba(10, 29, 52, 0.96), rgba(7, 17, 31, 0.8)); box-shadow: 0 15px 38px rgba(2, 6, 23, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.045); }
.invoice-scanner-copy { grid-row: 1 / span 2; display: flex; align-items: center; gap: 13px; min-width: 0; }
.invoice-scanner-icon { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 15px; background: rgba(56, 189, 248, 0.12); color: #bae6fd; font-size: 1.55rem; font-weight: 900; }
.invoice-scanner-copy h3 { margin: 0 0 5px; color: #f8fafc; font-size: 1.08rem; }
.invoice-scanner-copy p { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 800; line-height: 1.6; }
.invoice-scanner-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: stretch; }
.invoice-scanner-input { min-width: 0; min-height: 52px; padding-inline: 16px; border: 1px solid rgba(56, 189, 248, 0.42); border-radius: 15px; background: rgba(2, 6, 23, 0.7); color: #f8fafc; font-size: 1rem; font-weight: 900; direction: ltr; text-align: left; letter-spacing: 0.025em; }
.invoice-scanner-input::placeholder { color: rgba(186, 230, 253, 0.62); direction: rtl; text-align: right; letter-spacing: 0; }
.invoice-scanner-input:focus { border-color: #38bdf8; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13); outline: none; }
.invoice-scanner-input:disabled { opacity: 0.55; cursor: not-allowed; }
.invoice-scanner-focus { min-height: 52px; white-space: nowrap; }
.invoice-unified-product-input { direction: rtl; text-align: right; letter-spacing: 0; }
.invoice-unified-product-results {
    position: fixed;
    z-index: 85;
    display: grid;
    gap: 6px;
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    background: rgba(8, 13, 26, 0.99);
    box-shadow: 0 22px 62px rgba(0, 0, 0, 0.45);
    direction: rtl;
    scrollbar-width: thin;
}
.invoice-unified-product-results[hidden] { display: none; }
.invoice-unified-product-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--text); cursor: pointer; text-align: right; }
.invoice-unified-product-result:hover, .invoice-unified-product-result:focus-visible, .invoice-unified-product-result.is-active { border-color: rgba(56, 189, 248, 0.24); background: rgba(56, 189, 248, 0.12); outline: none; }
.invoice-unified-product-identity { display: grid; gap: 2px; min-width: 0; }
.invoice-unified-product-identity strong { color: #bfdbfe; font-size: 0.78rem; direction: ltr; text-align: right; }
.invoice-unified-product-identity b { overflow-wrap: anywhere; font-size: 0.9rem; line-height: 1.45; }
.invoice-unified-product-identity small { overflow-wrap: anywhere; color: var(--muted); font-size: 0.74rem; font-weight: 800; }
.invoice-unified-product-stock { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 5px 9px; border: 1px solid rgba(52, 211, 153, 0.24); border-radius: 999px; background: rgba(52, 211, 153, 0.09); color: #bbf7d0; font-size: 0.76rem; font-weight: 900; white-space: nowrap; }
.invoice-unified-product-empty { padding: 14px; color: var(--muted); font-size: 0.86rem; font-weight: 900; text-align: center; }
.invoice-scanner-status { display: flex; align-items: center; gap: 9px; min-height: 35px; padding: 7px 11px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 12px; background: rgba(15, 23, 42, 0.5); color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.invoice-scanner-status strong { color: #dbeafe; white-space: nowrap; }
.invoice-scanner-status[data-status="loading"] { border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.09); }
.invoice-scanner-status[data-status="success"] { border-color: rgba(52, 211, 153, 0.32); background: rgba(52, 211, 153, 0.1); color: #bbf7d0; }
.invoice-scanner-status[data-status="success"] strong { color: #6ee7b7; }
.invoice-scanner-status[data-status="error"] { border-color: rgba(251, 113, 133, 0.36); background: rgba(251, 113, 133, 0.1); color: #fecdd3; }
.invoice-scanner-status[data-status="error"] strong { color: #fda4af; }
.invoice-source-lock-note { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid rgba(148, 163, 184, 0.12); color: #fde68a; font-size: 0.75rem; font-weight: 900; }
.invoice-source-lock-note[hidden] { display: none; }
.invoice-cashier-summary { display: grid; grid-template-columns: repeat(2, minmax(100px, 0.68fr)) repeat(2, minmax(120px, 0.82fr)) minmax(150px, 1fr) minmax(220px, 1.25fr); grid-auto-rows: 1fr; gap: 9px; align-items: stretch; padding: 12px; border: 1px solid rgba(52, 211, 153, 0.22); border-radius: 18px; background: linear-gradient(135deg, rgba(6, 78, 59, 0.13), rgba(7, 17, 31, 0.58)); }
.invoice-cart-stat { display: grid; align-content: center; gap: 4px; min-height: 65px; padding: 9px 11px; border: 1px solid rgba(148, 163, 184, 0.12); border-radius: 13px; background: rgba(2, 6, 23, 0.24); }
.invoice-cart-stat small { color: var(--muted); font-size: 0.7rem; font-weight: 900; }
.invoice-cart-stat strong { color: var(--text); font-size: 1.02rem; font-weight: 900; }
.invoice-cart-stat em { color: var(--muted); font-size: 0.68rem; font-style: normal; }
.invoice-cart-stat.warning strong { color: #fde68a; }
.invoice-cart-stat.total { border-color: rgba(52, 211, 153, 0.28); background: rgba(52, 211, 153, 0.09); }
.invoice-cart-stat.total strong { color: #6ee7b7; font-size: 1.17rem; }
.invoice-next-action { min-height: 65px; }
.invoice-next-action { min-height: 65px; font-size: 0.94rem; font-weight: 900; }
.invoice-step-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.invoice-step-actions .btn { min-width: 210px; min-height: 46px; }
.invoice-customer-step .invoice-customer-box, .invoice-payment-step .invoice-payment-box { background: rgba(7, 17, 31, 0.4); }
.invoice-final-step { border-color: rgba(52, 211, 153, 0.18); }
.pos-final-totals { padding: 0; }
.invoice-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.invoice-section-heading strong, .compact-row-header strong { display: block; color: var(--text); font-size: 1rem; font-weight: 900; }
.invoice-section-heading small, .compact-row-header small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.78rem; font-weight: 700; line-height: 1.45; }
.invoice-header-card { display: grid; gap: 16px; padding: 16px; }
.invoice-customer-source-grid { display: grid; grid-template-columns: minmax(340px, 1.08fr) minmax(340px, 0.92fr); gap: 14px; align-items: stretch; }
.invoice-subsection { display: grid; align-content: start; gap: 12px; min-width: 0; padding: 15px; border: 1px solid rgba(77, 163, 255, 0.13); border-radius: 18px; background: linear-gradient(180deg, rgba(16, 35, 58, 0.5), rgba(7, 17, 31, 0.36)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.025); }
.invoice-subsection-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.82rem; font-weight: 900; }
.invoice-subsection-title span { display: block; color: var(--text); font-size: 0.96rem; line-height: 1.35; }
.invoice-subsection-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.76rem; font-weight: 800; line-height: 1.5; }
.invoice-source-grid { display: grid; grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1.2fr); gap: 12px; align-items: end; }
.invoice-source-grid .source-sales-rep { grid-column: 2; }
.invoice-combobox-field { position: relative; }
.invoice-combobox-field label { color: #bfdbfe; font-size: 0.82rem; font-weight: 900; }
.invoice-combobox-field .searchable-select-input { min-height: 48px; padding: 12px 14px; border-radius: 15px; border-color: rgba(77, 163, 255, 0.18); background: rgba(8, 13, 26, 0.72); color: var(--text); font-size: 0.96rem; font-weight: 800; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02); }
.invoice-combobox-field .searchable-select-input::placeholder { color: rgba(143, 167, 198, 0.78); font-weight: 800; }
.invoice-combobox-field .searchable-select-input:focus { border-color: rgba(77, 163, 255, 0.58); box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.1); }
.customer-search-input { min-height: 50px; }
.customer-quick-open { min-height: 36px; padding-inline: 14px; border-color: rgba(56, 189, 248, 0.24); background: rgba(56, 189, 248, 0.08); color: #bfdbfe; box-shadow: none; white-space: nowrap; }
.customer-quick-open:hover, .customer-quick-open:focus-visible { border-color: rgba(56, 189, 248, 0.48); background: rgba(56, 189, 248, 0.14); outline: none; }
.source-field[hidden] { display: none !important; }
.invoice-combobox-field select { display: none; }
.locked-source-box { min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(56, 189, 248, 0.2); border-radius: 13px; background: rgba(56, 189, 248, 0.07); color: var(--text); font-weight: 900; }
.locked-source-box::before { content: 'محدد'; display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; background: rgba(34, 197, 94, 0.11); color: #bbf7d0; font-size: 0.7rem; }
.invoice-lines-block { display: grid; gap: 12px; padding: 15px; }
.invoice-line-head { display: none; }
.invoice-line-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "product actions" "controls controls";
    gap: 12px 14px;
    align-items: start;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(7, 17, 31, 0.46));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.invoice-line-row.is-product-selected { border-color: rgba(77, 163, 255, 0.2); }
.invoice-line-row.is-empty-row, .invoice-line-row[data-product-state="empty"] { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "product actions"; min-height: 92px; align-items: center; border-style: dashed; border-color: rgba(77, 163, 255, 0.3); background: linear-gradient(135deg, rgba(77, 163, 255, 0.1), rgba(7, 17, 31, 0.38)); }
#invoice-lines { display: grid; gap: 12px; }
.invoice-line-row .form-field { gap: 5px; }
.invoice-line-product-area { grid-area: product; min-width: 0; }
.invoice-product-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px !important; align-items: stretch; min-width: 0; }
.invoice-product-cell label { display: none; }
.selected-product-label { min-height: 0; display: grid; align-content: center; gap: 8px; min-width: 0; padding: 1px 0; border: 0; background: transparent; color: var(--text); font-size: 0.92rem; font-weight: 900; white-space: normal; }
.selected-product-label.is-empty { min-height: 58px; color: rgba(143, 167, 198, 0.88); font-weight: 800; padding-block: 4px; }
.selected-product-label.is-empty strong { color: var(--text); font-size: 1rem; }
.selected-product-label.is-empty span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.invoice-product-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 11px; min-width: 0; }
.invoice-product-name { flex: 1 1 260px; min-width: 0; color: var(--text); font-size: 1rem; font-weight: 900; line-height: 1.45; overflow-wrap: anywhere; }
.invoice-product-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.product-summary-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; min-height: 25px; padding: 3px 9px; border: 1px solid rgba(143, 167, 198, 0.18); border-radius: 999px; background: rgba(143, 167, 198, 0.07); color: var(--muted); font-size: 0.74rem; font-weight: 900; line-height: 1.35; }
.invoice-stock-badge { border-color: rgba(52, 211, 153, 0.24); background: rgba(52, 211, 153, 0.09); color: #bbf7d0; }
.invoice-stock-badge strong { color: #6ee7b7; font-size: inherit; }
.invoice-stock-badge.is-warning { border-color: rgba(245, 158, 11, 0.38); background: rgba(245, 158, 11, 0.11); color: #fde68a; }
.invoice-stock-badge.is-warning strong { color: #fde68a; }
.invoice-price-badge { color: #bfdbfe; }
.invoice-open-product-picker { width: auto; min-height: 36px; padding-inline: 12px; border-color: rgba(77, 163, 255, 0.32); background: rgba(77, 163, 255, 0.075); color: #dbeafe; font-weight: 900; box-shadow: none; white-space: nowrap; }
.is-empty-row .invoice-line-product-area, .invoice-line-row[data-product-state="empty"] .invoice-line-product-area { grid-template-columns: minmax(0, 1fr); }
.is-empty-row .invoice-open-product-picker, .invoice-line-row[data-product-state="empty"] .invoice-open-product-picker { min-height: 48px; padding-inline: 22px; border-color: rgba(77, 163, 255, 0.46); background: rgba(77, 163, 255, 0.14); font-size: 0.94rem; }
.is-empty-row .invoice-line-values, .invoice-line-row[data-product-state="empty"] .invoice-line-values { display: none; }
.is-empty-row .invoice-delete-line, .invoice-line-row[data-product-state="empty"] .invoice-delete-line { display: none; }
.is-empty-row .invoice-line-actions, .invoice-line-row[data-product-state="empty"] .invoice-line-actions { min-width: 0; align-self: center; }
.invoice-open-product-picker:not(:disabled):hover, .invoice-open-product-picker:not(:disabled):focus-visible { border-color: var(--blue); background: rgba(77, 163, 255, 0.16); outline: none; }
.invoice-open-product-picker:disabled { box-shadow: none; }
.invoice-source-helper { color: #fde68a; font-size: 0.73rem; font-weight: 900; line-height: 1.35; }
.invoice-available-only { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(143, 167, 198, 0.07); color: var(--muted); font-size: 0.82rem; font-weight: 900; white-space: nowrap; }
.invoice-product-modal { position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; padding: 22px; background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(10px); }
.invoice-product-modal.is-hidden { display: none; }
.invoice-product-modal-card { width: min(100%, 1320px); max-height: min(92vh, 880px); overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 24px; background: rgba(7, 17, 31, 0.98); box-shadow: 0 26px 80px rgba(0, 0, 0, 0.48); }
.invoice-product-modal-filters { display: grid; gap: 13px; margin-bottom: 12px; padding: 15px; border: 1px solid rgba(77, 163, 255, 0.18); border-radius: 18px; background: rgba(16, 35, 58, 0.5); }
.invoice-product-search-row { display: grid; grid-template-columns: minmax(320px, 1fr) auto auto; gap: 10px; align-items: end; }
.invoice-picker-search-field, .invoice-picker-filter { display: grid; gap: 6px; min-width: 0; }
.invoice-picker-search-field label, .invoice-picker-filter span { color: #bfdbfe; font-size: 0.75rem; font-weight: 900; }
.invoice-picker-search-field .form-control { min-height: 48px; border-color: rgba(77, 163, 255, 0.34); background: rgba(2, 6, 23, 0.36); font-size: 1rem; }
.invoice-product-filter-row { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.invoice-product-modal-filters .form-control { min-width: 0; min-height: 42px; }
.invoice-product-modal-filters select.form-control { max-width: 100%; text-overflow: ellipsis; }
.invoice-product-modal-filters .btn { min-height: 42px; white-space: nowrap; }
.invoice-product-modal-message { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(143, 167, 198, 0.07); color: var(--muted); font-weight: 900; }
.invoice-product-modal-message[hidden] { display: none; }
.invoice-product-source-warning { display: grid; place-items: center; min-height: 210px; padding: 22px; border: 1px solid rgba(245, 158, 11, 0.28); border-radius: 18px; background: rgba(245, 158, 11, 0.08); color: #fde68a; font-weight: 900; text-align: center; }
.invoice-product-source-warning.is-hidden { display: none; }
.invoice-product-results-table { min-width: 1060px; }
.invoice-product-results-table th, .invoice-product-results-table td { padding: 12px 13px; }
.invoice-product-results-table tbody tr { transition: background 150ms ease, color 150ms ease; }
.invoice-product-results-table tbody tr:hover td { background: rgba(77, 163, 255, 0.06); }
.invoice-product-results-table tr.is-zero-stock td { background: rgba(245, 158, 11, 0.04); color: var(--muted); }
.invoice-product-results-table tr.is-zero-stock:hover td { background: rgba(245, 158, 11, 0.08); }
.product-result-select { min-height: 34px; padding-inline: 14px; font-weight: 900; white-space: nowrap; }
.invoice-line-values { grid-area: controls; display: grid; grid-template-columns: minmax(150px, 1.15fr) repeat(2, minmax(110px, 1fr)) minmax(130px, 0.9fr); gap: 9px; align-items: end; min-width: 0; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.invoice-line-field { display: grid; grid-template-rows: 16px 44px; align-content: end; gap: 5px !important; }
.invoice-line-field label { min-height: 16px; color: var(--muted); font-size: 0.72rem; font-weight: 900; line-height: 1.2; text-align: center; }
.invoice-line-field input { width: 100%; height: 44px; min-height: 44px; text-align: center; border-color: rgba(148, 163, 184, 0.13); background: rgba(2, 6, 23, 0.22); }
.invoice-quantity-control { display: grid; grid-template-columns: 38px minmax(58px, 1fr) 38px; gap: 5px; min-width: 0; }
.invoice-quantity-control input { min-width: 0; padding-inline: 4px; }
.invoice-quantity-button { display: grid; place-items: center; width: 38px; min-width: 38px; height: 44px; min-height: 44px; padding: 0; border: 1px solid rgba(77, 163, 255, 0.26); border-radius: 10px; background: rgba(77, 163, 255, 0.09); color: #dbeafe; font: inherit; font-size: 1.15rem; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.invoice-quantity-button:hover, .invoice-quantity-button:focus-visible { border-color: rgba(77, 163, 255, 0.55); background: rgba(77, 163, 255, 0.17); outline: none; }
.invoice-item-code { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 25px; padding: 3px 9px; border: 1px solid rgba(56, 189, 248, 0.28); border-radius: 999px; background: rgba(56, 189, 248, 0.1); color: #bae6fd; font-size: 0.74rem; font-weight: 900; line-height: 1.2; direction: ltr; unicode-bidi: isolate; letter-spacing: 0.025em; white-space: nowrap; }
.invoice-discount-field { gap: 5px !important; }
.invoice-line-total { min-height: 65px; display: grid; align-content: center; justify-items: center; gap: 3px; padding: 7px 10px; border: 1px solid rgba(52, 211, 153, 0.2); border-radius: 13px; background: rgba(52, 211, 153, 0.09); color: var(--green); font-weight: 900; }
.invoice-line-total span { color: rgba(187, 247, 208, 0.74); font-size: 0.7rem; line-height: 1.2; }
.invoice-line-total strong { color: var(--green); font-size: 1rem; line-height: 1.2; }
.invoice-line-total small { color: rgba(187, 247, 208, 0.64); font-size: 0.65rem; font-weight: 800; }
.invoice-stock-hint { width: fit-content; min-height: 58px; display: grid; align-content: center; justify-items: center; gap: 3px; white-space: nowrap; padding: 7px 11px; border: 1px solid rgba(34, 197, 94, 0.18); border-radius: 13px; background: rgba(34, 197, 94, 0.08); color: var(--muted); font-size: 0.72rem; font-weight: 900; }
.invoice-stock-hint strong { color: var(--green); }
.invoice-stock-hint.is-warning { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.1); color: #fde68a; }
.invoice-stock-hint.is-warning strong { color: #fde68a; }
.invoice-line-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; min-width: 0; }
.invoice-line-actions .btn { width: auto; min-height: 36px; padding-inline: 11px; }
.invoice-delete-line { color: #fecaca; border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.06); box-shadow: none; }
.invoice-delete-line:hover, .invoice-delete-line:focus-visible { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.11); outline: none; }
.invoice-add-line { min-height: 42px; padding-inline: 19px; border-color: rgba(77, 163, 255, 0.48); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18); }
.invoice-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.invoice-form-actions #open-sale-review { min-width: 260px; min-height: 50px; padding-inline: 28px; font-size: 1rem; font-weight: 900; box-shadow: 0 14px 32px rgba(37, 99, 235, 0.22); }
.invoice-total-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.enhanced-invoice-detail { display: grid; gap: 18px; }
.invoice-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px; border: 1px solid rgba(77, 163, 255, 0.16); background: linear-gradient(135deg, rgba(16, 35, 58, 0.82), rgba(7, 17, 31, 0.96)); }
.invoice-detail-title { display: grid; gap: 8px; min-width: 0; }
.invoice-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.invoice-title-row h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.35rem); letter-spacing: -0.02em; }
.invoice-detail-title p { margin: 0; color: var(--muted); font-weight: 800; }
.invoice-detail-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; flex-wrap: nowrap; }
.invoice-detail-actions > .btn, .invoice-detail-actions .invoice-share-button, .invoice-action-dropdown > summary { min-height: 42px; white-space: nowrap; }
.invoice-action-dropdown { position: relative; }
.invoice-action-dropdown > summary { gap: 8px; cursor: pointer; list-style: none; user-select: none; }
.invoice-action-dropdown > summary::-webkit-details-marker { display: none; }
.invoice-action-dropdown > summary::marker { content: ''; }
.invoice-action-dropdown[open] > summary { border-color: rgba(77, 163, 255, 0.48); background: rgba(77, 163, 255, 0.16); }
.invoice-print-dropdown[open] > summary { background: linear-gradient(135deg, var(--blue), var(--blue-strong)); }
.invoice-action-menu { position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + 9px); display: grid; min-width: 238px; padding: 7px; border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 15px; background: rgba(8, 17, 31, 0.98); box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42); }
.invoice-action-menu-item { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 850; line-height: 1.35; text-align: start; text-decoration: none; cursor: pointer; }
.invoice-action-menu-item:hover, .invoice-action-menu-item:focus-visible { outline: none; background: rgba(77, 163, 255, 0.13); color: #dbeafe; }
.invoice-action-menu-item.is-positive { color: #bbf7d0; }
.invoice-action-menu-form { margin: 0; }
.invoice-action-menu-danger { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(251, 113, 133, 0.18); }
.invoice-action-menu-item.is-danger { color: #fecdd3; }
.invoice-action-menu-item.is-danger:hover, .invoice-action-menu-item.is-danger:focus-visible { background: rgba(251, 113, 133, 0.12); color: #ffe4e6; }
.invoice-detail-actions .invoice-share-controls { position: relative; flex-wrap: nowrap; }
.invoice-detail-actions .invoice-share-feedback { position: absolute; z-index: 45; inset-inline-end: 0; top: calc(100% + 9px); width: min(300px, calc(100vw - 32px)); padding: 10px 12px; border: 1px solid rgba(245, 158, 11, 0.24); border-radius: 12px; background: rgba(8, 17, 31, 0.98); color: #fde68a; box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32); font-size: 0.78rem; font-weight: 800; line-height: 1.55; }
.invoice-inline-customer-action { display: inline-flex; width: fit-content; margin-top: 3px; color: #93c5fd; font-size: 0.78rem; font-weight: 850; text-decoration: none; }
.invoice-inline-customer-action:hover, .invoice-inline-customer-action:focus-visible { color: #dbeafe; text-decoration: underline; outline: none; }
.return-status-pill, .qty-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.return-status-pill { border: 1px solid rgba(52, 211, 153, 0.32); background: rgba(52, 211, 153, 0.12); color: #bbf7d0; }
.return-status-pill.subtle { border-color: rgba(77, 163, 255, 0.25); background: rgba(77, 163, 255, 0.1); color: #bfdbfe; }
.invoice-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.72fr); gap: 18px; align-items: stretch; }
.invoice-info-panel, .invoice-money-panel, .invoice-return-summary-panel, .invoice-lines-panel, .invoice-return-history-panel { padding: 22px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.section-heading h3 { margin: 0; color: var(--text); font-size: 1.05rem; }
.invoice-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-tile, .money-tile, .return-summary-card { min-width: 0; padding: 15px 16px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 16px; background: rgba(8, 13, 26, 0.44); }
.info-tile { display: grid; align-content: center; gap: 8px; min-height: 104px; }
.info-tile.full { grid-column: 1 / -1; }
.info-tile span, .money-tile span, .return-summary-card span, .return-history-card span { display: block; margin: 0; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.01em; }
.info-tile strong, .money-tile strong, .return-summary-card strong { display: block; color: var(--text); font-size: 1.04rem; font-weight: 900; line-height: 1.55; overflow-wrap: anywhere; }
.info-tile small, .info-tile p { margin: 0; color: var(--muted); font-weight: 800; }
.info-tile.warning { border-color: rgba(251, 113, 133, 0.24); background: rgba(251, 113, 133, 0.07); }
.invoice-money-stack { display: grid; gap: 12px; }
.money-tile strong { display: block; font-size: 1.25rem; }
.money-tile.warning strong { color: #fde68a; }
.money-tile.success { border-color: rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.09); }
.money-tile.success strong { color: var(--green); font-size: 1.45rem; }
.return-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.return-summary-card { background: rgba(77, 163, 255, 0.07); border-color: rgba(77, 163, 255, 0.16); }
.invoice-detail-lines-table { min-width: 1040px; }
.invoice-product-display { white-space: normal !important; min-width: 260px; }
.invoice-product-display strong { direction: ltr; unicode-bidi: isolate; }
.invoice-product-display span { display: block; margin-top: 4px; color: var(--text); font-weight: 900; direction: ltr; unicode-bidi: isolate; text-align: right; }
.qty-pill.neutral { border: 1px solid rgba(148, 163, 184, 0.2); background: rgba(148, 163, 184, 0.08); color: var(--text); }
.qty-pill.returned.is-clear { color: var(--muted); border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(148, 163, 184, 0.05); }
.qty-pill.returned.is-returned { color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.11); }
.qty-pill.remaining.is-clear { color: #bfdbfe; border: 1px solid rgba(77, 163, 255, 0.24); background: rgba(77, 163, 255, 0.08); }
.qty-pill.remaining.is-partial { color: #bbf7d0; border: 1px solid rgba(52, 211, 153, 0.28); background: rgba(52, 211, 153, 0.09); }
.qty-pill.remaining.is-complete { color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.26); background: rgba(248, 113, 113, 0.09); }
.return-history-list { display: grid; gap: 14px; }
.return-history-card { border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 18px; background: rgba(8, 13, 26, 0.52); overflow: hidden; }
.return-history-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 14px 16px; border-bottom: 1px solid rgba(148, 163, 184, 0.14); background: rgba(16, 35, 58, 0.44); }
.return-history-meta, .return-history-value { min-width: 0; }
.return-history-meta { padding-inline: 12px; border-inline-start: 1px solid rgba(148, 163, 184, 0.12); }
.return-history-meta:first-child { padding-inline-start: 0; border-inline-start: 0; }
.return-history-head strong { display: block; color: var(--text); font-size: 0.96rem; font-weight: 900; line-height: 1.45; overflow-wrap: anywhere; }
.return-history-value { padding-inline-start: 12px; border-inline-start: 1px solid rgba(245, 158, 11, 0.22); }
.return-history-value strong { color: #fcd34d; }
.return-history-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr); gap: 16px; padding: 16px; }
.return-products-block, .return-reason-block { display: grid; gap: 9px; min-width: 0; }
.return-product-list { display: grid; gap: 8px; }
.return-product-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 12px; background: rgba(15, 23, 42, 0.46); }
.return-product-row strong { min-width: 0; color: var(--text); font-size: 0.9rem; font-weight: 800; line-height: 1.45; direction: ltr; unicode-bidi: isolate; text-align: right; overflow-wrap: anywhere; }
.return-product-code, .return-quantity-badge { display: inline-flex !important; align-items: center; justify-content: center; min-height: 26px; margin: 0 !important; padding: 4px 8px; border-radius: 999px; font-size: 0.72rem !important; font-weight: 900 !important; white-space: nowrap; }
.return-product-code { border: 1px solid rgba(77, 163, 255, 0.22); background: rgba(77, 163, 255, 0.08); color: #bfdbfe !important; }
.return-quantity-badge { border: 1px solid rgba(245, 158, 11, 0.26); background: rgba(245, 158, 11, 0.1); color: #fde68a !important; }
.return-reason-block { align-content: start; padding: 12px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 12px; background: rgba(148, 163, 184, 0.045); }
.return-reason-block p { margin: 0; color: var(--text); font-weight: 800; line-height: 1.7; white-space: normal; }
.return-history-footer { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid rgba(148, 163, 184, 0.12); background: rgba(15, 23, 42, 0.22); color: var(--muted); }
.return-history-footer span { margin: 0; }
.return-history-footer strong { color: var(--text); font-size: 0.84rem; }
.invoice-cancellation-return-warning { margin-bottom: 18px; padding: 13px 15px; border: 1px solid rgba(245, 158, 11, 0.32); border-radius: 14px; background: rgba(245, 158, 11, 0.1); color: #fde68a; font-weight: 800; line-height: 1.7; }
.invoice-line-delete-input { display: none; }
.invoice-live-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.invoice-total-card { min-height: 94px; padding: 14px; border-radius: 16px; }
.invoice-total-card strong { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 1.35rem; }
.invoice-total-card em { color: var(--muted); font-size: 0.78rem; font-style: normal; font-weight: 800; }
.invoice-net-total { transform: none; border-color: rgba(52, 211, 153, 0.3); background: linear-gradient(135deg, rgba(52, 211, 153, 0.16), rgba(15, 23, 42, 0.28)); box-shadow: 0 14px 34px rgba(52, 211, 153, 0.08); }
.invoice-net-total strong { font-size: 1.75rem; }
.invoice-net-total em { color: var(--green); }
.invoice-review-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 22px; background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(10px); }
.invoice-review-modal.is-hidden { display: none; }
.invoice-review-card { width: min(100%, 980px); max-height: min(92vh, 820px); overflow-y: auto; padding: 22px; border: 1px solid rgba(56, 189, 248, 0.22); border-radius: 24px; background: rgba(8, 13, 26, 0.98); box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55); }
.customer-quick-card { width: min(100%, 720px); }
.customer-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.customer-quick-message { margin-bottom: 14px; padding: 11px 13px; border-radius: 14px; font-weight: 900; }
.customer-quick-message[hidden] { display: none; }
.customer-quick-message.is-success { border: 1px solid rgba(52, 211, 153, 0.28); background: rgba(52, 211, 153, 0.1); color: var(--green); }
.customer-quick-message.is-error { border: 1px solid rgba(248, 113, 113, 0.28); background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.invoice-review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.invoice-review-table { min-width: 760px; }
.invoice-review-totals { margin-top: 16px; }
.invoice-modal-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); justify-content: space-between; }
.table-wrap, .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; }
.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    color: var(--text);
}
.compact-table { min-width: 520px; }
.product-items-table { min-width: 860px; }
.import-table { min-width: 980px; }
.data-table th, .data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}
.item-name-column { white-space: normal !important; min-width: 170px; }
.data-table th { color: var(--muted); font-size: 0.86rem; font-weight: 800; }
.data-table tbody tr:hover { background: rgba(148, 163, 184, 0.05); }
.empty-row { color: var(--muted); text-align: center !important; }
.stacked-form { display: grid; gap: 22px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.form-field { display: grid; gap: 8px; }
.form-field.single-column { grid-column: 1 / -1; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-field label { color: var(--muted); font-weight: 800; }
.form-field small { color: var(--muted); }
.form-control, input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(8, 13, 26, 0.68);
    color: var(--text);
    outline: none;
}
.form-control:focus, input:focus, select:focus, textarea:focus { border-color: rgba(56, 189, 248, 0.55); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08); }
.form-control:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: 0.68; background: rgba(15, 23, 42, 0.58); color: var(--muted); }
select.form-control, select { color-scheme: dark; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: left 17px center, left 11px center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-inline-start: 34px; }
select.form-control option, select option { background: var(--surface); color: var(--text); }
.checkbox-field { display: flex; align-items: center; gap: 10px; padding-top: 30px; }
input[type="checkbox"], .checkbox-field input { width: 18px; height: 18px; accent-color: var(--blue); }
.field-error { color: #fecdd3; font-size: 0.88rem; line-height: 1.6; overflow-wrap: anywhere; }
.has-field-error .form-control, .has-field-error input, .has-field-error select, .has-field-error textarea { border-color: #fb7185; box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16); }
.form-errors, .form-error-alert {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(251, 113, 133, 0.45);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.34), rgba(88, 28, 45, 0.22));
    color: #fecdd3;
    font-weight: 800;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.form-errors ul, .form-error-alert ul { margin: 0; padding-inline-start: 18px; }
.form-errors li, .form-error-alert li { margin: 0; }
.invoice-error-summary { gap: 9px; padding: 15px 16px; border-color: rgba(248, 113, 113, 0.62); background: linear-gradient(135deg, rgba(127, 29, 29, 0.46), rgba(88, 28, 45, 0.28)); box-shadow: 0 14px 34px rgba(127, 29, 29, 0.16); }
.invoice-error-summary strong { color: #fecdd3; font-size: 1rem; font-weight: 900; }
.invoice-error-summary:focus { outline: 3px solid rgba(248, 113, 113, 0.26); outline-offset: 3px; }
.field-error-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(251, 113, 133, 0.48);
    border-radius: 14px;
    background: rgba(127, 29, 29, 0.34);
    color: #fecdd3;
    font-size: 0.9rem;
    line-height: 1.6;
}
.field-error-box[hidden] { display: none; }
.field-error-icon { flex: 0 0 auto; color: #fda4af; font-weight: 900; line-height: 1.6; }
.invoice-payment-method-field.has-field-error label { color: #fecdd3; }
.payment-method-error { font-size: 0.96rem; font-weight: 900; }
.form-actions { display: flex; gap: 12px; justify-content: flex-start; }
.single-column { grid-template-columns: 1fr; }
.import-upload-section { min-height: calc(100vh - 190px); }
.import-upload-section .module-header { margin-bottom: 14px; }
.import-upload-section .module-tabs { margin-bottom: 18px; padding-bottom: 14px; }
.import-upload-form {
    width: min(100%, 880px);
    margin: 0 auto;
    gap: 14px;
}
.compact-upload-panel {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.09), rgba(167, 139, 250, 0.06)),
        rgba(8, 13, 26, 0.52);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}
.compact-upload-header { display: flex; align-items: center; gap: 14px; }
.upload-panel-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(167, 139, 250, 0.95));
    color: white;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(56, 189, 248, 0.24);
}
.compact-upload-header h3 { margin: 0 0 4px; font-size: 1.16rem; }
.compact-upload-header p { margin: 0; color: var(--muted); }
.compact-stock-alert { margin: 0; padding: 11px 13px; border-color: rgba(56, 189, 248, 0.2); }
.compact-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    border: 1px dashed rgba(56, 189, 248, 0.32);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.42);
}
.file-input-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.file-picker-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 14px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    transition: 160ms ease;
}
.file-picker-button:hover, .file-input-hidden:focus ~ .compact-file-row .file-picker-button, .file-picker-button:focus {
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
    background: rgba(56, 189, 248, 0.16);
}
.upload-hint { color: var(--muted); font-size: 0.88rem; }
.file-name-wrap { display: grid; gap: 4px; min-width: 0; flex: 1; }
.upload-file-name {
    max-width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--blue);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.import-preview-page { padding-bottom: 126px; }
.import-notices { display: grid; gap: 12px; margin-bottom: 20px; }
.preview-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0 12px;
}
.summary-card {
    display: grid;
    gap: 8px;
    min-height: 102px;
    align-content: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(8, 13, 26, 0.44));
}
.summary-card strong { font-size: 2rem; line-height: 1; }
.summary-card small { color: var(--muted); font-weight: 900; font-size: 0.92rem; }
.summary-card.success { border-color: rgba(52, 211, 153, 0.24); color: var(--green); }
.summary-card.warning { border-color: rgba(251, 191, 36, 0.28); color: var(--amber); }
.summary-card.danger { border-color: rgba(251, 113, 133, 0.28); color: var(--danger); }
.summary-card.info { border-color: rgba(56, 189, 248, 0.24); color: #bae6fd; }
.invoice-list-page { display: grid; gap: 16px; }
.invoice-create-action { min-height: 42px; padding-inline: 18px; font-weight: 900; }
.invoice-filter-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 18px; background: rgba(8, 13, 26, 0.34); }
.invoice-filter-grid { display: grid; gap: 10px; align-items: end; }
.invoice-filter-grid-primary { grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(150px, 0.85fr)); }
.invoice-filter-grid-secondary { grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; }
.invoice-filter-grid .form-field { gap: 6px; min-width: 0; }
.invoice-filter-grid label { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.invoice-filter-grid .form-control { min-height: 42px; }
.invoice-filter-actions { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.invoice-filter-actions .btn { min-height: 42px; padding-inline: 16px; white-space: nowrap; }
.invoice-list-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.invoice-summary-card { min-height: 84px; padding: 13px 14px; border-radius: 16px; }
.invoice-summary-card strong { font-size: 1.35rem; line-height: 1.25; }
.invoice-summary-card small { font-size: 0.78rem; }
.invoice-list-table { min-width: 1080px; }
.invoice-list-table th, .invoice-list-table td { padding: 13px 12px; vertical-align: middle; }
.invoice-number-cell, .invoice-customer-cell { display: grid; gap: 6px; min-width: 0; }
.invoice-number-cell strong { color: #dbeafe; font-size: 0.98rem; letter-spacing: 0.01em; }
.invoice-customer-cell strong { color: var(--text); line-height: 1.35; }
.invoice-customer-cell small, .invoice-list-table small { color: var(--muted); font-weight: 800; }
.invoice-list-customer-link, .invoice-customer-detail-link { display: grid; gap: 5px; min-width: 0; color: inherit; text-decoration: none; }
.invoice-list-customer-link:hover strong, .invoice-list-customer-link:focus-visible strong, .invoice-customer-detail-link:hover strong, .invoice-customer-detail-link:focus-visible strong { color: #bfdbfe; text-decoration: underline; }
.invoice-list-customer-link:focus-visible, .invoice-customer-detail-link:focus-visible { outline: 2px solid rgba(77, 163, 255, 0.52); outline-offset: 4px; border-radius: 8px; }
.invoice-link-customer-action { border-color: rgba(52, 211, 153, 0.34); background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9)); box-shadow: 0 12px 28px rgba(5, 150, 105, 0.2); }
.invoice-customer-link-page { display: grid; gap: 16px; }
.invoice-customer-link-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; border-color: rgba(77, 163, 255, 0.2); background: linear-gradient(135deg, rgba(16, 35, 58, 0.75), rgba(7, 17, 31, 0.54)); }
.invoice-customer-link-hero h2 { margin: 4px 0 6px; color: var(--text); font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.invoice-customer-link-hero p { max-width: 760px; margin: 0; color: var(--muted); font-weight: 800; line-height: 1.7; }
.invoice-customer-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.invoice-customer-link-section { display: grid; gap: 16px; min-width: 0; padding: 18px; }
.invoice-customer-link-heading { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 13px; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.invoice-customer-link-heading h3 { margin: 0 0 4px; color: var(--text); font-size: 1.06rem; }
.invoice-customer-link-heading p { margin: 0; color: var(--muted); font-size: 0.84rem; font-weight: 800; line-height: 1.55; }
.invoice-customer-link-option { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid rgba(77, 163, 255, 0.32); border-radius: 12px; background: rgba(77, 163, 255, 0.12); color: #dbeafe; font-weight: 900; }
.invoice-customer-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.invoice-customer-search-form .form-control, .invoice-customer-search-form .btn { min-height: 46px; }
.invoice-customer-search-results { display: grid; gap: 9px; max-height: 430px; overflow-y: auto; padding-inline-end: 3px; }
.invoice-customer-result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: center; min-height: 64px; padding: 11px 12px; border: 1px solid rgba(148, 163, 184, 0.15); border-radius: 15px; background: rgba(8, 13, 26, 0.44); cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.invoice-customer-result:hover, .invoice-customer-result:focus-within { border-color: rgba(77, 163, 255, 0.42); background: rgba(77, 163, 255, 0.08); }
.invoice-customer-result input { width: 20px; height: 20px; accent-color: var(--blue); }
.invoice-customer-result span { display: grid; gap: 4px; min-width: 0; }
.invoice-customer-result strong { color: var(--text); overflow-wrap: anywhere; }
.invoice-customer-result small { color: var(--muted); font-weight: 800; direction: ltr; text-align: right; overflow-wrap: anywhere; }
.invoice-customer-search-prompt, .invoice-customer-empty { min-height: 120px; display: grid; place-items: center; padding: 18px; border: 1px dashed rgba(148, 163, 184, 0.2); border-radius: 16px; background: rgba(8, 13, 26, 0.28); color: var(--muted); font-weight: 800; text-align: center; }
.invoice-customer-duplicate-notice { display: grid; gap: 7px; padding: 13px; border: 1px solid rgba(245, 158, 11, 0.34); border-radius: 16px; background: rgba(245, 158, 11, 0.1); color: #fde68a; }
.invoice-customer-duplicate-notice span { color: #fef3c7; font-size: 0.84rem; font-weight: 800; }
.invoice-customer-duplicate-notice .btn { width: 100%; margin-top: 3px; border-color: rgba(245, 158, 11, 0.35); color: #fef3c7; }
.invoice-new-customer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.invoice-new-customer-grid .single-column { grid-column: 1 / -1; }
.invoice-new-customer-grid textarea { min-height: 74px; }
.invoice-customer-link-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 13px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.invoice-customer-link-actions .btn { min-height: 44px; }
.invoice-payment-method { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(148, 163, 184, 0.07); color: var(--text); font-size: 0.8rem; font-weight: 900; }
.invoice-payment-method.is-muted { border-color: rgba(148, 163, 184, 0.12); background: rgba(148, 163, 184, 0.045); color: var(--muted); font-weight: 800; }
.invoice-customer-title { align-items: flex-start; gap: 12px; }
.invoice-customer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.anonymous-sale-toggle { min-height: 36px; padding-inline: 14px; border-color: rgba(148, 163, 184, 0.18); background: rgba(148, 163, 184, 0.06); color: var(--text); box-shadow: none; white-space: nowrap; }
.anonymous-sale-toggle::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.58); margin-inline-end: 7px; }
.anonymous-sale-toggle.is-active { border-color: rgba(52, 211, 153, 0.42); background: rgba(52, 211, 153, 0.14); color: #bbf7d0; }
.anonymous-sale-toggle.is-active::before { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }
.anonymous-sale-message { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(52, 211, 153, 0.24); border-radius: 14px; background: rgba(52, 211, 153, 0.08); color: #bbf7d0; font-size: 0.84rem; font-weight: 900; }
.anonymous-sale-message[hidden] { display: none; }
.anonymous-sale-message strong { color: #dcfce7; white-space: nowrap; }
.anonymous-sale-message span { color: #bbf7d0; }
#id_is_anonymous_sale, .invoice-customer-box input[name="is_anonymous_sale"] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.invoice-customer-box.is-anonymous-sale .invoice-combobox-field { opacity: 0.72; }
.invoice-customer-box.is-anonymous-sale .customer-search-input { border-color: rgba(52, 211, 153, 0.2); background: rgba(6, 78, 59, 0.14); }
.invoice-return-badge { width: fit-content; border: 1px solid rgba(56, 189, 248, 0.28); background: rgba(56, 189, 248, 0.1); color: #bae6fd; font-size: 0.72rem; }
.invoice-row-action { min-height: 34px; min-width: 58px; justify-content: center; }
.invoice-share-controls { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invoice-share-controls .btn { min-height: 40px; white-space: nowrap; }
.invoice-share-feedback { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px; border: 1px solid rgba(251, 191, 36, 0.32); border-radius: 999px; background: rgba(251, 191, 36, 0.1); color: #fde68a; font-size: 0.8rem; font-weight: 900; }
.invoice-share-feedback[hidden] { display: none; }
.daily-close-page { max-width: 1180px; margin-inline: auto; }
.daily-close-hero { align-items: flex-start; gap: 18px; margin-bottom: 8px; }
.daily-close-hero p { max-width: 780px; line-height: 1.8; }
.daily-close-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(148, 163, 184, 0.11); }
.daily-close-section-heading strong { color: var(--text); font-size: 0.98rem; font-weight: 900; }
.daily-close-section-heading small { color: var(--muted); font-size: 0.78rem; font-weight: 800; line-height: 1.5; }
.daily-close-summary, .daily-close-list-summary { margin-top: 0; margin-bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.daily-close-list-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; }
.daily-close-card { min-height: 104px; padding: 14px; }
.daily-close-card strong { font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.daily-close-card span { color: var(--muted); font-size: 0.82rem; font-weight: 700; line-height: 1.5; }
.daily-close-form {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background: rgba(8, 13, 26, 0.32);
}
.daily-close-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.daily-close-field-card, .daily-close-readonly-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.42);
}
.daily-close-field-card label, .daily-close-readonly-card span { color: var(--muted); font-weight: 900; font-size: 0.86rem; }
.daily-close-readonly-card strong { color: var(--text); font-size: 1.2rem; line-height: 1.35; overflow-wrap: anywhere; }
.daily-close-readonly-card small { color: var(--muted); line-height: 1.6; }
.daily-close-cash-card { border-color: rgba(56, 189, 248, 0.22); background: rgba(56, 189, 248, 0.06); }
.daily-close-cash-card label { color: #bfdbfe; font-size: 0.96rem; }
.daily-close-cash-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.daily-close-cash-control span { min-height: 46px; display: inline-flex; align-items: center; padding-inline: 12px; border: 1px solid rgba(56, 189, 248, 0.2); border-radius: 13px; background: rgba(56, 189, 248, 0.08); color: #bfdbfe; font-weight: 900; }
.daily-close-cash-input { min-height: 52px; font-size: 1.18rem; font-weight: 900; text-align: center; }
.daily-close-difference-panel.success, .daily-close-card.success { background: linear-gradient(180deg, rgba(6, 78, 59, 0.26), rgba(8, 13, 26, 0.44)); }
.daily-close-difference-panel.warning, .daily-close-card.warning { border-color: rgba(251, 191, 36, 0.32); background: linear-gradient(180deg, rgba(120, 53, 15, 0.22), rgba(8, 13, 26, 0.44)); }
.daily-close-difference-panel.danger, .daily-close-card.danger { border-color: rgba(251, 113, 133, 0.34); background: linear-gradient(180deg, rgba(127, 29, 29, 0.24), rgba(8, 13, 26, 0.44)); }
.daily-close-notes { grid-column: 1 / -1; }
.daily-close-breakdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
}
.daily-close-breakdown div { display: grid; gap: 4px; min-width: 0; }
.daily-close-breakdown span { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.daily-close-breakdown strong { color: var(--text); font-size: 1rem; overflow-wrap: anywhere; }
.daily-close-actions { justify-content: space-between; align-items: center; padding-top: 2px; }
.daily-close-submit { min-height: 52px; min-width: 190px; font-size: 1.02rem; box-shadow: 0 16px 34px rgba(37, 99, 235, 0.24); }
.daily-close-list-page { display: grid; gap: 12px; }
.daily-close-filter-panel { overflow: hidden; }
.daily-close-filter-bar { display: grid; grid-template-columns: minmax(170px, 1.05fr) repeat(3, minmax(126px, 0.72fr)) minmax(170px, 1fr) auto; gap: 9px; align-items: end; }
.daily-close-filter-bar label { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.daily-close-filter-bar .form-control { min-height: 40px; }
.daily-close-search { grid-column: auto; }
.daily-close-filter-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.daily-close-filter-actions .btn { min-height: 40px; padding-inline: 14px; white-space: nowrap; }
.daily-close-list-summary { gap: 9px; }
.daily-close-list-summary .daily-close-card { min-height: 86px; padding: 12px 13px; border-radius: 15px; }
.daily-close-list-summary .daily-close-card strong { font-size: 1.12rem; }
.daily-close-table { min-width: 900px; }
.daily-close-table th, .daily-close-table td { padding: 12px 11px; vertical-align: middle; }
.daily-close-table small { color: var(--muted); font-weight: 800; line-height: 1.6; }
.daily-close-difference-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.daily-close-difference-badge.success { color: #bbf7d0; border: 1px solid rgba(34, 197, 94, 0.26); background: rgba(34, 197, 94, 0.1); }
.daily-close-difference-badge.warning { color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.1); }
.daily-close-difference-badge.danger { color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.28); background: rgba(248, 113, 113, 0.1); }
.daily-close-reopen-reason { display: inline-block; max-width: 240px; margin-top: 4px; white-space: normal; }
.daily-close-reopen-action { min-height: 38px; min-width: 88px; display: inline-flex; align-items: center; justify-content: center; color: #fde68a; border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.09); font-weight: 900; }
.daily-close-row-details { margin-top: 7px; }
.daily-close-row-details summary { cursor: pointer; width: fit-content; min-height: 26px; display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid rgba(56, 189, 248, 0.18); border-radius: 999px; background: rgba(56, 189, 248, 0.07); color: #bfdbfe; font-size: 0.72rem; font-weight: 900; list-style: none; }
.daily-close-row-details summary::-webkit-details-marker { display: none; }
.daily-close-row-details[open] { display: grid; gap: 6px; padding-top: 2px; }
.daily-close-row-details div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 230px; padding: 5px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.08); }
.daily-close-row-details div:last-child { border-bottom: 0; }
.daily-close-row-details span { color: var(--muted); font-size: 0.74rem; font-weight: 900; }
.daily-close-row-details strong { color: var(--text); font-size: 0.78rem; white-space: nowrap; }
.reopen-close-page { max-width: 760px; margin-inline: auto; display: grid; gap: 16px; }
.reopen-warning { display: grid; gap: 6px; border-color: rgba(245, 158, 11, 0.38); background: linear-gradient(135deg, rgba(120, 53, 15, 0.26), rgba(88, 28, 45, 0.18)); color: #fde68a; }
.reopen-warning strong { color: #fde68a; }
.reopen-close-form { padding: 16px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 18px; background: rgba(8, 13, 26, 0.34); }
.reopen-close-actions { justify-content: space-between; }
.rep-expense-page { max-width: 980px; margin-inline: auto; }
.rep-expense-form { gap: 14px; }
.rep-expense-section { display: grid; gap: 12px; padding: 15px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 18px; background: rgba(8, 13, 26, 0.32); }
.section-heading.compact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding-bottom: 9px; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.section-heading.compact h3 { margin: 0; color: var(--text); font-size: 0.98rem; }
.section-heading.compact span { color: var(--muted); font-size: 0.78rem; font-weight: 800; line-height: 1.5; }
.rep-expense-grid { display: grid; grid-template-columns: minmax(180px, 0.75fr) minmax(240px, 1fr); gap: 12px; align-items: stretch; }
.rep-expense-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rep-expense-grid.one-column { grid-template-columns: 1fr; }
.rep-expense-field { min-width: 0; padding: 12px; border: 1px solid rgba(148, 163, 184, 0.11); border-radius: 15px; background: rgba(15, 23, 42, 0.36); }
.rep-expense-field label { color: var(--muted); font-size: 0.82rem; font-weight: 900; }
.rep-expense-description { grid-column: 1 / -1; }
.rep-expense-description textarea { min-height: 92px; resize: vertical; }
.rep-expense-money-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rep-expense-money-input span { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 12px; border: 1px solid rgba(56, 189, 248, 0.18); border-radius: 13px; background: rgba(56, 189, 248, 0.07); color: #bfdbfe; font-weight: 900; }
.rep-expense-amount-field input { min-height: 46px; font-weight: 900; text-align: center; }
.rep-expense-actions { justify-content: flex-end; padding-top: 2px; }
.rep-expense-actions .btn { min-height: 44px; min-width: 120px; }
.secondary-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; padding-inline: 2px; }
.preview-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.primary-filters { margin-bottom: 20px; }
.primary-filters .module-tab {
    min-width: 96px;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.96rem;
    border-radius: 16px;
}
.primary-filters .module-tab.active {
    color: white;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(167, 139, 250, 0.18));
    border-color: rgba(56, 189, 248, 0.52);
    box-shadow: 0 10px 28px rgba(56, 189, 248, 0.12);
}
.tool-panel {
    margin-bottom: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.34);
    overflow: hidden;
}
.tool-panel:hover { border-color: rgba(56, 189, 248, 0.26); }
.tool-panel summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    color: var(--text);
    font-weight: 800;
    list-style: none;
}
.tool-panel summary span { font-size: 0.98rem; }
.tool-panel summary small { color: var(--muted); font-weight: 600; margin-inline-start: auto; }
.tool-panel summary::-webkit-details-marker { display: none; }
.tool-panel summary::before { content: "+"; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: rgba(56, 189, 248, 0.12); color: var(--blue); }
.tool-panel[open] summary::before { content: "-"; }
.tool-panel-body { padding: 0 16px 16px; }
.muted-note { margin: 0 0 12px; color: var(--muted); }
.compact-form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.bulk-correction-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}
.bulk-correction-panel p { margin: 0; color: var(--muted); }
.import-mapping-form { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.import-mapping-form h3 { margin: 0; }
.warning-text { color: #fde68a; font-size: 0.88rem; }
.relation-warning { margin-bottom: 18px; }
.table-input { min-width: 130px; }
.import-preview-list { display: grid; gap: 14px; margin-top: 18px; }
.import-row-card {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(8, 13, 26, 0.34);
}
.import-row-card.needs-review { border-color: rgba(251, 191, 36, 0.34); background: rgba(251, 191, 36, 0.045); }
.import-row-card.has-error { border-color: rgba(251, 113, 133, 0.36); background: rgba(251, 113, 133, 0.055); }
.import-row-card.is-ready { border-color: rgba(52, 211, 153, 0.16); }
.import-map-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.row-messages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.compact-row-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.row-title-block { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.row-title-block strong { overflow-wrap: anywhere; }
.row-code { color: var(--muted); font-size: 0.86rem; font-weight: 800; }
.row-finance-meta { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; color: var(--muted); font-size: 0.84rem; }
.muted-badge { padding: 4px 8px; border-radius: 999px; background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border); }
.status-badge { padding: 5px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 900; }
.status-badge.info { color: #bae6fd; background: rgba(56, 189, 248, 0.12); }
.status-badge.success { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.status-badge.warning { color: var(--amber); background: rgba(251, 191, 36, 0.11); }
.status-badge.danger { color: #fecdd3; background: rgba(251, 113, 133, 0.12); }
.status-badge.subtle-danger { color: #fda4af; background: rgba(251, 113, 133, 0.07); font-weight: 700; }
.status-badge.muted { color: var(--muted); background: rgba(148, 163, 184, 0.09); }
.compact-map-grid { grid-template-columns: 1.1fr 1fr 1fr 0.7fr; gap: 9px; }
.compact-map-grid .form-control { min-height: 40px; padding: 8px 10px; border-radius: 12px; }
.compact-map-grid label { font-size: 0.78rem; }
.compact-messages { margin-top: 10px; }
.message-pill {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    border: 1px solid var(--border);
}
.warning-pill { color: #fde68a; background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.24); }
.error-pill { color: #fecdd3; background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.28); }
.sticky-import-actions {
    position: sticky;
    bottom: 14px;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 18px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(10, 16, 32, 0.98), rgba(15, 23, 42, 0.94));
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
}
.sticky-import-actions strong, .sticky-import-actions small { display: block; }
.sticky-import-actions small { color: var(--muted); margin-top: 2px; }
.sticky-import-actions .btn-primary { min-width: 210px; min-height: 46px; font-weight: 900; }
.sticky-import-actions .btn-ghost { min-height: 46px; }
.preview-empty-state {
    display: grid;
    gap: 8px;
    place-items: center;
    min-height: 180px;
    border-style: solid;
    background: rgba(15, 23, 42, 0.3);
}
.preview-empty-state strong { font-size: 1.05rem; color: var(--text); }
.preview-empty-state span { color: var(--muted); }
.inventory-upload-section code { color: var(--blue); font-weight: 900; }
.inventory-upload-section { min-height: auto; }
.stock-upload-panel { gap: 14px; padding: 20px; }
.stock-import-guidance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.08);
}
.stock-import-guidance > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stock-import-guidance strong { color: var(--text); }
.stock-import-guidance span { color: var(--muted); }
.stock-import-guidance .stock-import-warning { color: #fde68a; font-weight: 900; }
.stock-do-dont-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.stock-note-card {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.36);
}
.stock-note-card strong { width: 100%; color: var(--text); }
.stock-note-card span:not(.required-chip) { color: var(--muted); font-size: 0.88rem; }
.stock-note-card.valid { border-color: rgba(52, 211, 153, 0.22); }
.stock-note-card.invalid { border-color: rgba(251, 113, 133, 0.22); }
.stock-file-row { align-items: center; }
.required-chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.required-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.09);
    color: #bae6fd;
    font-size: 0.82rem;
    font-weight: 900;
}
.inventory-upload-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}
.template-download-btn { border-color: rgba(56, 189, 248, 0.32); background: rgba(56, 189, 248, 0.11); font-weight: 900; }
.inventory-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.32);
    color: var(--muted);
}
.inventory-summary-cards { margin-top: 0; }
.stock-preview-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.summary-date { font-size: 1.35rem !important; }
.summary-location { font-size: 1.05rem !important; overflow-wrap: anywhere; }
.blocking-import-state {
    display: grid;
    gap: 9px;
    margin: 12px 0 18px;
    padding: 18px;
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.1), rgba(15, 23, 42, 0.42));
    color: #fecdd3;
}
.blocking-import-state strong { color: #fecdd3; font-size: 1.05rem; }
.blocking-import-state span { color: var(--muted); }
.blocking-import-state .btn { justify-self: start; margin-top: 4px; color: var(--text); }
.repeated-stock-state { border-color: rgba(251, 191, 36, 0.32); background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(15, 23, 42, 0.42)); }
.repeated-stock-state strong { color: #fde68a; }
.inventory-preview-table { min-width: 820px; }
.inventory-filter-bar {
    display: grid;
    grid-template-columns: minmax(230px, 1.8fr) repeat(4, minmax(135px, 1fr)) minmax(130px, auto) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
}
.inventory-filter-bar .btn { min-height: 46px; white-space: nowrap; }
.inventory-checkbox { padding: 0 6px; min-height: 46px; border: 1px solid var(--border); border-radius: 14px; background: rgba(8, 13, 26, 0.4); white-space: nowrap; }
.movement-summary-cards, .adjustment-summary-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.movement-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(135px, 0.8fr) minmax(135px, 0.8fr) auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.28);
}
.movement-filter-bar .btn { min-height: 46px; white-space: nowrap; }
.movement-table { min-width: 1080px; }
.adjustment-table { min-width: 940px; }
.difference-value.positive { color: var(--green); }
.difference-value.negative { color: var(--amber); }
.warehouse-empty-state { gap: 12px; }
.warehouse-empty-state .btn { margin-top: 4px; }
.stock-overview-cards { display: none; }
.stock-overview-table { min-width: 1120px; }
.stock-overview-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; }
.stock-overview-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(5, minmax(120px, 0.8fr)) auto auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.stock-overview-filter-bar .btn { min-height: 38px; white-space: nowrap; }

.custody-visibility-note,
.custody-read-only-message,
.custody-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 16px;
    background: rgba(56, 189, 248, 0.07);
}
.custody-visibility-note > div,
.custody-read-only-message { min-width: 0; }
.custody-visibility-note strong,
.custody-visibility-note span,
.custody-read-only-message strong,
.custody-read-only-message span { display: block; }
.custody-visibility-note span,
.custody-read-only-message span { color: var(--muted); }
.custody-visibility-note .status-badge { flex: 0 0 auto; }
.custody-switcher { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 10px; width: min(100%, 720px); }
.custody-switcher label { color: var(--muted); font-weight: 800; white-space: nowrap; }
.custody-switcher .form-control { min-width: 0; }
.custody-read-only-message { justify-content: flex-start; }
.custody-read-only-message strong { flex: 0 0 auto; color: var(--cyan); }
.stock-location-state { display: inline-flex; margin-inline-start: 7px; padding: 2px 7px; border: 1px solid rgba(56, 189, 248, 0.24); border-radius: 999px; color: var(--cyan); font-size: 0.72rem; font-weight: 900; white-space: nowrap; }
.stock-location-state.is-own { border-color: rgba(52, 211, 153, 0.28); color: var(--green); }
.stock-overview-grid { display: grid; gap: 14px; }
.stock-product-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 18px; background: rgba(16, 35, 58, 0.58); }
.stock-product-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.stock-card-actions { display: flex; justify-content: flex-end; margin-top: -8px; }
.stock-product-header h3 { margin: 4px 0 0; font-size: 1.08rem; }
.stock-product-code { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid rgba(77, 163, 255, 0.24); border-radius: 999px; color: var(--blue); background: rgba(77, 163, 255, 0.08); font-size: 0.82rem; font-weight: 900; }
.stock-total-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 11px; border: 1px solid rgba(34, 197, 94, 0.24); border-radius: 999px; color: var(--green); background: rgba(34, 197, 94, 0.08); font-weight: 900; white-space: nowrap; }
.stock-product-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.85rem; font-weight: 800; }
.stock-product-meta span { padding: 5px 8px; border-radius: 999px; background: rgba(143, 167, 198, 0.06); }
.stock-source-sections { display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.stock-source-section { display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 15px; background: rgba(7, 17, 31, 0.32); }
.stock-source-section.is-focused { border-color: rgba(77, 163, 255, 0.34); background: rgba(77, 163, 255, 0.07); }
.stock-source-section h4 { margin: 0; color: var(--text); font-size: 0.92rem; }
.stock-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.stock-quantity-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 6px 9px; border: 1px solid rgba(143, 167, 198, 0.18); border-radius: 999px; background: rgba(143, 167, 198, 0.07); color: var(--text); font-size: 0.82rem; font-weight: 900; }
.stock-quantity-chip a, .stock-adjust-link { color: #bfdbfe; font-size: 0.76rem; font-weight: 900; text-decoration: none; }
.stock-quantity-chip a:hover, .stock-adjust-link:hover { color: var(--text); text-decoration: underline; }
.stock-quantity-chip.is-muted, .stock-empty-note { color: var(--muted); }
.stock-empty-note { font-size: 0.84rem; font-weight: 800; }
.stock-overview-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 35, 58, 0.58); }
.stock-overview-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.stock-overview-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.85rem; font-weight: 800; }
.stock-location-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stock-location-grid > div { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: rgba(7, 17, 31, 0.32); }
.stock-location-grid b { color: var(--text); }
.stock-location-grid span { color: var(--muted); font-weight: 800; }
.movement-card-list { display: none; }
.movement-table-wrap { display: block; }
.movement-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 35, 58, 0.58); }
.movement-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.movement-card-head div { display: grid; gap: 4px; }
.movement-card-head span:not(.status-badge) { color: var(--muted); font-size: 0.86rem; }
.movement-card-grid { display: grid; grid-template-columns: minmax(90px, 0.38fr) minmax(0, 1fr); gap: 8px 12px; }
.movement-card-grid span { color: var(--muted); font-size: 0.82rem; font-weight: 900; }
.movement-card-grid b { color: var(--text); font-weight: 800; }
.stock-adjustment-page .module-header { margin-bottom: 14px; }
.adjustment-warning {
    margin-bottom: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 16px;
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-weight: 800;
}
.adjustment-form-card {
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.3);
}
.adjustment-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adjustment-product-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.adjustment-product-card > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(8, 13, 26, 0.36);
}
.adjustment-product-card small, .adjustment-difference-card span, .adjustment-difference-card small { color: var(--muted); }
.adjustment-product-card strong { overflow-wrap: anywhere; }
.current-quantity-card { border-color: rgba(56, 189, 248, 0.28) !important; }
.current-quantity-card strong { color: var(--blue); font-size: 1.6rem; line-height: 1; }
.adjustment-placeholder { grid-column: 1 / -1; align-items: center; min-height: 90px; color: var(--muted); }
.adjustment-difference-card {
    display: grid;
    gap: 5px;
    padding: 15px;
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(167, 139, 250, 0.08));
}
.adjustment-difference-card strong { font-size: 2rem; line-height: 1; }
.adjustment-difference-card.is-increase { border-color: rgba(52, 211, 153, 0.32); background: rgba(52, 211, 153, 0.08); }
.adjustment-difference-card.is-increase strong, .adjustment-difference-card.is-increase small { color: var(--green); }
.adjustment-difference-card.is-decrease { border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.08); }
.adjustment-difference-card.is-decrease strong, .adjustment-difference-card.is-decrease small { color: var(--amber); }
.adjustment-difference-card.is-zero { border-color: rgba(148, 163, 184, 0.24); background: rgba(148, 163, 184, 0.08); }
.adjustment-difference-card.is-zero strong, .adjustment-difference-card.is-zero small { color: var(--muted); }
.stock-adjustment-history .data-table { min-width: 980px; }
.transfer-stock-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(167, 139, 250, 0.05));
}
.transfer-stock-panel > div {
    display: grid;
    gap: 6px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(8, 13, 26, 0.34);
}
.transfer-stock-panel small { color: var(--muted); font-weight: 800; }
.transfer-stock-panel strong { color: var(--blue); font-size: 1.7rem; line-height: 1; }
.transfer-stock-warning {
    grid-column: 1 / -1;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(251, 191, 36, 0.26);
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-weight: 900;
}
.searchable-field { position: relative; }
.branch-transfer-page .searchable-field select { display: none; }
.visually-hidden-select {
    position: absolute;
    inline-size: 1px !important;
    block-size: 1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
}
.searchable-options {
    position: absolute;
    z-index: 8;
    inset-inline: 0;
    top: calc(100% + 6px);
    max-height: 260px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 15px;
    background: rgba(8, 13, 26, 0.98);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}
.searchable-options.is-closed {
    display: none;
    height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    pointer-events: none;
}
.searchable-options.is-open {
    display: grid;
    max-height: 260px;
    overflow-y: auto;
    pointer-events: auto;
}
.searchable-option {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: right;
}
.searchable-option:hover, .searchable-option:focus-visible { background: rgba(56, 189, 248, 0.12); outline: none; }
.customer-autocomplete-popup {
    position: fixed;
    z-index: 80;
    inset: auto;
    min-width: 0;
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 163, 255, 0.45) rgba(8, 13, 26, 0.55);
}
.customer-autocomplete-popup.is-open { display: grid; overflow-y: auto; }
.customer-autocomplete-popup .searchable-option { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.customer-autocomplete-popup .searchable-option.is-active { background: rgba(56, 189, 248, 0.16); color: #dbeafe; outline: 1px solid rgba(56, 189, 248, 0.28); }
.branch-transfer-form textarea { min-height: 92px; }
.data-table tr.has-error td { background: rgba(251, 113, 133, 0.05); }
.data-table tr.needs-review td { background: rgba(251, 191, 36, 0.04); }

.stock-transfer-page { display: grid; gap: 14px; min-width: 0; max-width: 100%; overflow-x: clip; }
.stock-transfer-page .module-tabs { margin-bottom: 0; }
.stock-transfer-header { margin-bottom: 0; padding-bottom: 2px; }
.stock-transfer-header p { max-width: 760px; }
.transfer-compat-text { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.stock-transfer-page .transfer-stock-panel {
    gap: 9px;
    padding: 9px;
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(8, 13, 26, 0.26);
    box-shadow: none;
}
.stock-transfer-page .transfer-stat-card {
    min-height: 78px;
    align-content: center;
    gap: 6px;
    padding: 11px 13px;
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.34);
}
.stock-transfer-page .transfer-stat-card small { color: #9fb4d2; font-size: 0.79rem; line-height: 1.25; }
.stock-transfer-page .transfer-stat-card strong { color: var(--text); font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 900; letter-spacing: -0.02em; }
.stock-transfer-page .transfer-stock-panel.is-empty .transfer-stat-card:not(:first-child) strong,
.stock-transfer-page .transfer-stock-panel.is-empty .transfer-stat-card strong { color: rgba(234, 242, 255, 0.48); }
.stock-transfer-page .transfer-stock-warning {
    padding: 10px 12px;
    border-color: rgba(251, 191, 36, 0.18);
    border-radius: 13px;
    background: rgba(251, 191, 36, 0.07);
    color: #fde68a;
    font-size: 0.9rem;
    font-weight: 800;
}
.stock-transfer-form {
    gap: 15px;
    padding: 18px;
    border-color: rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background: rgba(8, 13, 26, 0.28);
}
.stock-transfer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.stock-transfer-form .form-field { gap: 7px; min-width: 0; }
.stock-transfer-form .form-field label { color: #c3d5ee; font-size: 0.88rem; line-height: 1.2; }
.stock-transfer-form .form-field small { color: #7f95b4; font-size: 0.8rem; line-height: 1.35; }
.stock-transfer-form .form-control,
.stock-transfer-form input[type="number"],
.stock-transfer-form input[type="search"],
.stock-transfer-form select,
.stock-transfer-form textarea {
    min-height: 44px;
    padding-block: 10px;
    border-color: rgba(148, 163, 184, 0.18);
    border-radius: 13px;
    background-color: rgba(7, 17, 31, 0.64);
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.stock-transfer-form input[type="number"]::-webkit-outer-spin-button,
.stock-transfer-form input[type="number"]::-webkit-inner-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.stock-transfer-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; direction: rtl; text-align: right; }
.stock-transfer-form select[aria-invalid="true"] { border-color: rgba(251, 191, 36, 0.44); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.07); }
.stock-transfer-form .form-control:focus,
.stock-transfer-form input:focus,
.stock-transfer-form select:focus,
.stock-transfer-form textarea:focus {
    border-color: rgba(77, 163, 255, 0.48);
    background-color: rgba(7, 17, 31, 0.86);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.08);
}
.transfer-product-field,
.transfer-notes-field { grid-column: 1 / -1; }
.transfer-live-note {
    align-self: end;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(77, 163, 255, 0.14);
    border-radius: 13px;
    background: rgba(77, 163, 255, 0.06);
    color: #a8c3e4;
    font-size: 0.88rem;
    font-weight: 800;
}
.transfer-live-note[hidden] { display: none !important; }
.stock-transfer-form textarea { min-height: 88px; resize: vertical; }
.stock-transfer-form .searchable-options {
    border-color: rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(7, 17, 31, 0.98);
}
.stock-transfer-form .searchable-option {
    padding: 11px 12px;
    border-radius: 10px;
    color: #dbeafe;
    font-size: 0.9rem;
    line-height: 1.5;
}
.selected-transfer-product {
    display: grid;
    gap: 9px;
    margin-top: 2px;
    padding: 11px 12px;
    border: 1px solid rgba(77, 163, 255, 0.18);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(77, 163, 255, 0.08), rgba(15, 23, 42, 0.18));
    overflow: hidden;
}
.selected-transfer-product.is-empty {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.22);
    color: #7f95b4;
    font-weight: 800;
}
.selected-product-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.selected-product-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid rgba(77, 163, 255, 0.18);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.09);
    color: #bfdbfe;
    font-size: 0.8rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}
.selected-product-chip:last-child { border-color: rgba(34, 197, 94, 0.2); background: rgba(34, 197, 94, 0.1); color: #86efac; }
.selected-product-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
.selected-product-row { display: grid; gap: 2px; min-width: 0; }
.selected-product-row span { color: #8fa7c6; font-size: 0.76rem; font-weight: 900; }
.selected-product-row strong { color: var(--text); font-size: 0.9rem; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.transfer-form-alert,
.transfer-server-alert {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-weight: 900;
}
.stock-transfer-form .field-error {
    padding: 8px 10px;
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 11px;
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
    font-weight: 800;
}
.stock-transfer-actions {
    justify-content: flex-end;
    align-items: center;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.stock-transfer-actions .btn { min-width: 142px; }
.stock-transfer-actions .btn-primary {
    border-color: rgba(77, 163, 255, 0.52);
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    color: white;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}
.stock-transfer-actions .btn-ghost { border-color: rgba(148, 163, 184, 0.18); background: rgba(15, 23, 42, 0.24); }
.stock-transfer-actions .btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    filter: grayscale(0.25);
    box-shadow: none;
}
.multi-transfer-form { min-width: 0; max-width: 100%; overflow: visible; }
.multi-transfer-section {
    display: grid;
    gap: 13px;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.46), rgba(8, 13, 26, 0.3));
}
.multi-transfer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.multi-transfer-heading > div { display: grid; gap: 3px; min-width: 0; }
.multi-transfer-heading strong { color: var(--text); font-size: 0.98rem; }
.multi-transfer-heading small { color: var(--muted); font-size: 0.8rem; font-weight: 700; line-height: 1.55; }
.multi-transfer-route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.transfer-mobile-location { display: none; }
.transfer-unified-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.transfer-unified-product-input { width: 100%; }
.transfer-unified-product-input:disabled { cursor: not-allowed; opacity: 0.58; }
.transfer-unified-results {
    position: fixed;
    z-index: 90;
    display: grid;
    gap: 5px;
    min-width: 0;
    max-width: calc(100vw - 16px);
    padding: 7px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 260px;
    overscroll-behavior: contain;
    border: 1px solid rgba(77, 163, 255, 0.3);
    border-radius: 15px;
    background: rgba(5, 13, 24, 0.98);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
    direction: rtl;
    scrollbar-width: thin;
}
.transfer-unified-results[hidden] { display: none; }
.transfer-unified-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: right;
}
.transfer-unified-result:hover, .transfer-unified-result:focus-visible, .transfer-unified-result.is-active { border-color: rgba(77, 163, 255, 0.25); background: rgba(77, 163, 255, 0.13); outline: none; }
.transfer-unified-result > span { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; min-width: 0; }
.transfer-unified-result strong { flex: 0 0 auto; color: #93c5fd; font-size: 0.78rem; }
.transfer-unified-result b { min-width: 0; overflow-wrap: anywhere; font-size: 0.9rem; }
.transfer-unified-result small { flex-basis: 100%; color: var(--muted); font-size: 0.76rem; }
.transfer-unified-result em { color: #86efac; font-size: 0.8rem; font-style: normal; font-weight: 900; white-space: nowrap; }
.transfer-unified-empty { padding: 14px; color: var(--muted); font-weight: 800; text-align: center; }
.transfer-search-status { min-height: 22px; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.transfer-search-status[data-status="success"] { color: #86efac; }
.transfer-search-status[data-status="error"] { color: #fca5a5; }
.transfer-line-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(77, 163, 255, 0.2);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.09);
    color: #bfdbfe;
    font-size: 0.8rem;
    font-weight: 800;
}
.transfer-cart-head, .transfer-cart-line { display: grid; grid-template-columns: 105px minmax(180px, 1fr) 76px 112px 128px 96px 70px; gap: 9px; align-items: center; min-width: 0; }
.transfer-cart-head { padding: 0 12px; color: var(--muted); font-size: 0.76rem; font-weight: 900; }
.transfer-cart-head span { min-width: 0; overflow-wrap: anywhere; }
.transfer-cart-lines { display: grid; gap: 8px; }
.transfer-cart-line {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 14px;
    background: rgba(7, 17, 31, 0.58);
}
.transfer-cart-line.is-invalid { border-color: rgba(248, 113, 113, 0.42); background: rgba(127, 29, 29, 0.1); }
.transfer-cart-code, .transfer-cart-name, .transfer-cart-size, .transfer-cart-available, .transfer-cart-quantity, .transfer-cart-controls, .transfer-cart-action { min-width: 0; }
.transfer-cart-code strong { color: #93c5fd; font-size: 0.78rem; overflow-wrap: anywhere; }
.transfer-cart-name strong { display: block; color: var(--text); font-size: 0.86rem; overflow-wrap: anywhere; }
.transfer-cart-size span { color: #cbd5e1; font-size: 0.82rem; overflow-wrap: anywhere; }
.transfer-cart-available { display: flex; align-items: baseline; gap: 4px; }
.transfer-cart-available strong { color: #86efac; font-size: 1rem; }
.transfer-cart-available span { color: var(--muted); font-size: 0.72rem; }
.transfer-cart-quantity { display: grid; gap: 4px; }
.stock-transfer-form .transfer-cart-quantity input { min-height: 38px; padding: 6px; direction: ltr; text-align: center; }
.stock-transfer-form .transfer-cart-quantity input[aria-invalid="true"] { border-color: rgba(248, 113, 113, 0.48); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08); }
.transfer-line-error { color: #fca5a5 !important; font-size: 0.68rem !important; font-weight: 800; line-height: 1.4 !important; overflow-wrap: anywhere; }
.transfer-cart-controls { display: grid; grid-template-columns: repeat(2, 38px); justify-content: center; gap: 6px; direction: ltr; }
.transfer-cart-controls button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(77, 163, 255, 0.22);
    border-radius: 10px;
    background: rgba(77, 163, 255, 0.08);
    color: #dbeafe;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 900;
}
.transfer-cart-controls button:hover, .transfer-cart-controls button:focus-visible { border-color: rgba(77, 163, 255, 0.45); background: rgba(77, 163, 255, 0.16); outline: none; }
.transfer-cart-action { justify-self: stretch; }
.transfer-cart-action .btn { width: 100%; min-width: 0; padding-inline: 7px; }
.transfer-cart-empty { display: grid; gap: 4px; padding: 20px; border: 1px dashed rgba(148, 163, 184, 0.2); border-radius: 14px; color: var(--muted); text-align: center; }
.transfer-cart-empty[hidden] { display: none; }
.transfer-cart-empty strong { color: #cbd5e1; }
.transfer-cart-empty span { font-size: 0.82rem; }
.transfer-cart-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 11px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.transfer-cart-summary > div { display: grid; gap: 4px; min-width: 0; padding: 10px 11px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 12px; background: rgba(15, 23, 42, 0.34); }
.transfer-cart-summary span { color: var(--muted); font-size: 0.72rem; font-weight: 900; }
.transfer-cart-summary strong { color: var(--text); font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.transfer-cart-summary > div:nth-child(-n+2) strong { color: #86efac; font-size: 1rem; }
.transfer-server-alert ul { margin: 7px 0 0; padding-inline-start: 20px; }

@media screen and (max-width: 1100px) {
    .transfer-cart-head { display: none; }
    .transfer-cart-line { grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr); grid-template-areas: "code name" "size available" "quantity controls" "action action"; gap: 10px 14px; }
    .transfer-cart-line > div::before { display: block; margin-bottom: 4px; color: var(--muted); content: attr(data-label); font-size: 0.72rem; font-weight: 900; }
    .transfer-cart-code { grid-area: code; }
    .transfer-cart-name { grid-area: name; }
    .transfer-cart-size { grid-area: size; }
    .transfer-cart-available { grid-area: available; justify-self: end; }
    .transfer-cart-quantity { grid-area: quantity; }
    .transfer-cart-controls { grid-area: controls; justify-content: start; }
    .transfer-cart-action { grid-area: action; }
    .transfer-cart-action .btn { width: auto; min-width: 100px; }
    .transfer-cart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 620px) {
    .multi-transfer-section { padding: 12px; border-radius: 16px; }
    .multi-transfer-route-grid, .transfer-unified-input-row { grid-template-columns: 1fr; }
    .transfer-unified-input-row .btn { width: 100%; }
    .multi-transfer-heading { align-items: flex-start; }
    .transfer-cart-line { grid-template-columns: 1fr; grid-template-areas: "code" "name" "size" "available" "quantity" "controls" "action"; gap: 10px; }
    .transfer-cart-available { display: grid; justify-self: stretch; }
    .transfer-cart-available { grid-template-columns: auto 1fr; align-items: baseline; }
    .transfer-cart-controls { justify-content: stretch; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transfer-cart-controls button { width: 100%; }
    .transfer-cart-action { justify-self: stretch; }
    .transfer-cart-action .btn { width: 100%; min-height: 40px; }
    .transfer-cart-summary { grid-template-columns: 1fr; }
}

.stock-count-page, .stock-count-detail-page, .stock-count-history-page { display: grid; gap: 16px; }
.stock-count-create-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock-count-notes { grid-column: 1 / -1; }
.stock-count-summary-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stock-count-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.34);
}
.stock-count-meta-grid div { display: grid; gap: 4px; min-width: 0; }
.stock-count-meta-grid small, .stock-count-line-card small { color: var(--muted); font-size: 0.76rem; font-weight: 900; }
.stock-count-meta-grid strong, .stock-count-line-card strong { overflow-wrap: anywhere; }
.stock-count-lines-form { display: grid; gap: 14px; }
.stock-count-table { border-spacing: 0; }
.stock-count-table th { padding-block: 11px; font-size: 0.78rem; white-space: nowrap; }
.stock-count-table td { padding-block: 10px; vertical-align: middle; }
.stock-count-table .item-name-column { min-width: 260px; line-height: 1.6; }
.stock-count-table input[type="number"] { width: 104px; min-width: 96px; text-align: center; }
.stock-count-table textarea { min-width: 190px; min-height: 40px; resize: vertical; line-height: 1.5; }
.stock-count-table .difference-value { min-width: 48px; justify-content: center; }
.stock-count-mobile-cards { display: none; }
.stock-count-line-card {
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.4);
}
.stock-count-line-card div { display: grid; gap: 4px; min-width: 0; }
.stock-count-line-card .wide { grid-column: 1 / -1; }
.stock-count-actions { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 9px; padding-top: 2px; }
.stock-count-actions .btn-primary { min-width: 148px; font-weight: 900; }
.stock-count-actions .btn-ghost, .stock-count-actions .btn-info-soft { min-width: 122px; }
.stock-count-cancel-form {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding-top: 4px;
}
.stock-count-cancel-disclosure { width: min(100%, 560px); }
.stock-count-cancel-disclosure summary {
    width: fit-content;
    min-height: 38px;
    list-style: none;
    cursor: pointer;
}
.stock-count-cancel-disclosure summary::-webkit-details-marker { display: none; }
.stock-count-cancel-panel {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: 16px;
    background: rgba(127, 29, 29, 0.14);
}
.stock-count-cancel-panel p {
    margin: 0;
    color: #fecdd3;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.7;
}
.stock-count-stale-alert {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, 0.34);
    border-radius: 18px;
    background: rgba(120, 53, 15, 0.18);
    color: #fde68a;
}
.stock-count-stale-alert strong { color: #fef3c7; }
.stock-count-stale-alert span { color: #fcd34d; font-size: 0.9rem; font-weight: 800; }
.stock-count-stale-table td, .stock-count-stale-table th { white-space: nowrap; }
.stock-count-filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 10px; font-size: 0.82rem; }

.reports-dashboard-page, .reports-detail-page { display: grid; gap: 16px; }
.reports-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.report-card {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.56), rgba(8, 13, 26, 0.36));
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.report-card:hover, .report-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(77, 163, 255, 0.38);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.22), rgba(8, 13, 26, 0.42));
    outline: none;
}
.report-card small { color: var(--blue); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.report-card strong { color: var(--text); font-size: 1.05rem; line-height: 1.35; }
.report-card span { color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
.reports-filter-bar { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; }
.report-filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}
.report-filter-field .form-control { width: 100%; }
.settings-page { display: grid; gap: 16px; }
.settings-form-card { gap: 16px; }
.form-field.full-span { grid-column: 1 / -1; }
.report-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.34);
    color: var(--muted);
    font-weight: 800;
}
.reports-summary-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reports-table th { white-space: nowrap; }
.reports-table td { vertical-align: top; line-height: 1.6; }

.filter-panel {
    display: grid;
    margin-bottom: 16px;
    border: 1px solid rgba(77, 163, 255, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 35, 58, 0.58), rgba(8, 13, 26, 0.34));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.filter-panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.filter-panel-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(77, 163, 255, 0.24);
    border-radius: 12px;
    background: rgba(77, 163, 255, 0.1);
    color: #bfdbfe;
    font-weight: 900;
}
.filter-panel-title strong { display: block; color: var(--text); line-height: 1.25; }
.filter-panel-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.78rem; font-weight: 800; line-height: 1.45; }
.filter-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(77, 163, 255, 0.24);
    border-radius: 999px;
    background: rgba(77, 163, 255, 0.08);
    color: #bfdbfe;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 900;
    white-space: nowrap;
}
.filter-panel-toggle:hover, .filter-panel-toggle:focus-visible { border-color: rgba(77, 163, 255, 0.42); background: rgba(77, 163, 255, 0.14); color: var(--text); outline: none; }
.filter-panel.is-collapsed .filter-panel-body { display: none; }
.filter-panel.is-collapsed .when-expanded, .filter-panel:not(.is-collapsed) .when-collapsed { display: none; }
.filter-panel-body { padding: 12px; }
.filter-panel-body > form { margin: 0; border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }

body.sidebar-collapsed .sidebar { transform: translateX(100%); }
body.sidebar-collapsed .main-shell { width: 100%; margin-inline-start: 0; }

@media screen and (max-width: 1024px) {
    :root { --sidebar-width: min(86vw, 320px); }
    body.mobile-nav-open { overflow: hidden; }
    .sidebar {
        transform: translateX(100%);
        z-index: 50;
        width: var(--sidebar-width);
        padding: 16px;
        box-shadow: -22px 0 60px rgba(0, 0, 0, 0.42);
        transition: transform 220ms ease;
        overscroll-behavior: contain;
    }
    body.mobile-nav-open .sidebar { transform: translateX(0); }
    .mobile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        margin: 0 0 12px auto;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: rgba(16, 35, 58, 0.78);
        color: var(--text);
        cursor: pointer;
        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1;
    }
    .mobile-sidebar-close:hover, .mobile-sidebar-close:focus-visible {
        border-color: rgba(77, 163, 255, 0.42);
        background: rgba(77, 163, 255, 0.12);
        outline: none;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(2, 6, 23, 0.58);
        backdrop-filter: blur(4px);
    }
    body.mobile-nav-open .sidebar-backdrop { display: block; }
    .main-shell { width: 100%; margin-inline-start: 0; }
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        min-height: 42px;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: rgba(16, 35, 58, 0.72);
        color: var(--text);
        cursor: pointer;
        font-size: 1.1rem;
    }
    .brand { margin-bottom: 16px; }
    .sidebar-nav { gap: 6px; }
    .nav-link { min-height: 42px; display: flex; align-items: center; padding: 10px 12px; }
    .topbar { min-height: 72px; padding: 14px 18px; }
    .topbar h1 { font-size: 1.28rem; }
    .topbar .eyebrow { display: none; }
    .content { padding: 22px 18px 38px; }
}

@media screen and (max-width: 700px) {
    html { font-size: 15px; }
    .app-shell, .main-shell, .content, .panel, .invoice-product-modal-card, .invoice-review-card { max-width: 100%; }
    .topbar {
        align-items: center;
        gap: 10px;
        min-height: 64px;
        padding: 10px 12px;
    }
    .topbar-heading { gap: 10px; flex: 1 1 auto; }
    .topbar h1 { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-actions { gap: 7px; }
    .user-avatar { width: 34px; height: 34px; border-radius: 12px; }
    .account-pill { min-height: 40px; padding: 4px 8px; }
    .content { padding: 16px 10px 28px; }
    .panel, .login-panel { border-radius: 18px; padding: 16px; }
    .module-header { gap: 12px; margin-bottom: 14px; }
    .module-header h2, .panel-header h2 { font-size: 1.18rem; }
    .module-header p { margin-top: 4px; font-size: 0.9rem; }
    .module-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; padding: 8px; }
    .module-tab { width: 100%; min-width: 0; min-height: 42px; padding: 7px 9px; font-size: 0.8rem; line-height: 1.35; text-align: center; white-space: normal; }
    .dashboard-page { gap: 14px; }
    .dashboard-hero { padding: 16px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .metric-card, .metric-card-strong { min-height: 104px; padding: 15px; }
    .metric-card strong, .metric-card-strong strong { font-size: 1.55rem; }
    .dashboard-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .quick-action, .btn { min-height: 44px; }
    .form-grid, .form-grid.two-columns, .invoice-header-card, .customer-profile-grid, .invoice-review-grid, .invoice-live-totals, .invoice-list-summary, .preview-summary-cards, .stock-preview-summary, .movement-summary-cards, .adjustment-summary-cards, .transfer-stock-panel, .low-stock-grid, .low-stock-list, .best-seller-grid { grid-template-columns: 1fr !important; }
    .customer-detail-hero { display: grid; gap: 12px; padding: 12px; }
    .customer-hero-main { align-items: flex-start; }
    .customer-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .customer-hero-actions .btn { width: 100%; justify-content: center; }
    .customer-purchase-summary { grid-template-columns: 1fr !important; }
    .customer-summary-card { min-height: 76px; }
    .customer-section-header { align-items: flex-start; }
    .customer-invoice-history-table { min-width: 0; }
    .customer-invoice-history-table .action-btn { width: 100%; min-height: 40px; }
    .filter-bar, .product-filter, .inventory-filter-bar, .movement-filter-bar, .stock-alert-filter-bar, .sales-rep-filter-bar, .customer-filter-bar, .users-filter-bar { display: grid; grid-template-columns: 1fr !important; gap: 10px; }
    .filter-panel { border-radius: 16px; }
    .filter-panel-header { align-items: flex-start; padding: 11px; }
    .filter-panel-title small { display: none; }
    .filter-panel-body { padding: 10px; }
    .form-field, .checkbox-field { min-width: 0; }
    .form-control, input, select, textarea { max-width: 100%; }
    textarea { min-height: 84px; }
    .form-actions, .invoice-form-actions, .invoice-modal-actions { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: stretch; }
    .form-actions .btn, .invoice-form-actions .btn, .invoice-modal-actions .btn, .invoice-filter-actions .btn, .filter-bar .btn, .inventory-filter-bar .btn, .movement-filter-bar .btn, .users-filter-bar .btn { width: 100%; }
    .invoice-filter-grid { grid-template-columns: 1fr !important; gap: 9px; }
    .invoice-filter-actions { display: grid; grid-template-columns: 1fr; align-items: stretch; }
    .invoice-customer-title { align-items: flex-start; }
    .invoice-customer-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .invoice-customer-actions .btn { width: 100%; }
    .invoice-list-table { min-width: 0; }
    .invoice-row-action { width: 100%; min-height: 40px; }
    .table-responsive.mobile-card-table, .table-wrap.mobile-card-table { overflow: visible; }
    .mobile-card-table .data-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
    .mobile-card-table .data-table thead { display: none; }
    .mobile-card-table .data-table, .mobile-card-table .data-table tbody, .mobile-card-table .data-table tr, .mobile-card-table .data-table td { display: block; width: 100%; }
    .mobile-card-table .data-table tr {
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: rgba(16, 35, 58, 0.58);
    }
    .mobile-card-table .data-table td {
        display: grid;
        grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 8px 0;
        border: 0;
        word-break: break-word;
    }
    .mobile-card-table .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.82rem;
        font-weight: 900;
    }
    .mobile-card-table .data-table td[colspan] { display: block; }
    .mobile-card-table .data-table td[colspan]::before { content: none; }
    .dashboard-table-wrap { overflow: visible; border: 0; background: transparent; }
    .dashboard-table .dashboard-product-cell strong, .dashboard-table .dashboard-product-cell span { display: block; }
    .dashboard-section { padding: 14px; }
    .dashboard-section-header { align-items: flex-start; }
    .low-stock-card { min-height: 0; }
    .table-actions, .customer-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .action-btn, .table-link { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 12px; }
    .flash-messages { inset-inline: 10px; top: 76px; max-width: none; }
    .flash-message { align-items: flex-start; padding: 12px; }
    .invoice-header-card { padding: 12px; }
    .invoice-customer-source-grid, .invoice-source-grid { grid-template-columns: 1fr !important; }
    .invoice-source-grid .source-sales-rep { grid-column: auto; }
    .daily-close-page { padding: 14px; }
    .daily-close-hero { display: grid; grid-template-columns: 1fr; }
    .daily-close-form { padding: 12px; border-radius: 18px; }
    .daily-close-form-grid, .daily-close-breakdown, .daily-close-summary, .daily-close-list-summary, .daily-close-filter-bar { grid-template-columns: 1fr !important; }
    .daily-close-section-heading { display: grid; gap: 4px; }
    .daily-close-field-card, .daily-close-readonly-card { padding: 12px; border-radius: 16px; }
    .daily-close-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .daily-close-submit { width: 100%; min-width: 0; }
    .daily-close-search { grid-column: auto; }
    .daily-close-filter-actions { display: grid; grid-template-columns: 1fr; }
    .daily-close-filter-actions .btn, .reopen-close-actions .btn { width: 100%; }
    .daily-close-table { min-width: 0; }
    .daily-close-row-details div { min-width: 0; }
    .daily-close-reopen-action { width: 100%; }
    .reopen-close-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .rep-expense-page { padding: 12px; }
    .rep-expense-section { padding: 12px; border-radius: 16px; }
    .section-heading.compact { display: grid; gap: 4px; }
    .rep-expense-grid, .rep-expense-grid.two-columns { grid-template-columns: 1fr; }
    .rep-expense-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .rep-expense-actions .btn { width: 100%; }
    .field-error-box { padding: 10px; font-size: 0.86rem; border-radius: 12px; }
    .invoice-subsection { padding: 11px; }
    .invoice-subsection-title, .invoice-customer-title { display: grid; grid-template-columns: 1fr; align-items: flex-start; }
    .invoice-customer-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .customer-quick-open, .anonymous-sale-toggle { width: 100%; min-height: 42px; justify-content: center; }
    .anonymous-sale-message { grid-template-columns: 1fr; gap: 3px; }
    .invoice-lines-block { padding: 12px; }
    .invoice-line-head { display: none; }
    .invoice-line-row, .invoice-line-row.is-empty-row, .invoice-line-row[data-product-state="empty"] { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; border-radius: 18px; }
    .invoice-line-product-area, .is-empty-row .invoice-line-product-area, .invoice-line-row[data-product-state="empty"] .invoice-line-product-area { grid-template-columns: 1fr; gap: 7px; }
    .invoice-product-cell { grid-template-columns: 1fr; grid-column: 1; align-items: stretch; }
    .selected-product-label { min-height: 0; }
    .selected-product-label.is-empty { padding: 2px 0 0; }
    .invoice-open-product-picker { grid-column: 1; grid-row: auto; justify-self: stretch; width: 100%; min-height: 44px; }
    .invoice-line-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-total { min-height: 52px; }
    .invoice-line-actions { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: stretch; }
    .invoice-line-row[data-product-state="empty"] .invoice-line-actions, .is-empty-row .invoice-line-actions { grid-template-columns: 1fr; }
    .invoice-line-actions .btn, .invoice-delete-line { width: 100%; }
    .invoice-delete-line { min-height: 42px; }
    .invoice-live-totals { padding: 10px; }
    .invoice-total-card { min-height: 78px; }
    .invoice-product-modal { align-items: stretch; justify-items: stretch; padding: 8px; }
    .invoice-product-modal-card { width: 100%; max-height: calc(100dvh - 16px); padding: 14px; border-radius: 18px; }
    .invoice-product-search-row, .invoice-product-filter-row { grid-template-columns: 1fr !important; gap: 9px; }
    .invoice-product-modal-filters { padding: 12px; }
    .invoice-product-modal-filters .btn, .invoice-available-only { width: 100%; min-height: 44px; }
    .invoice-product-results-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
    .invoice-product-results-table thead { display: none; }
    .invoice-product-results-table, .invoice-product-results-table tbody, .invoice-product-results-table tr, .invoice-product-results-table td { display: block; width: 100%; }
    .invoice-product-results-table tr { padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 35, 58, 0.48); }
    .invoice-product-results-table td { display: grid; grid-template-columns: minmax(86px, 32%) minmax(0, 1fr); gap: 10px; padding: 7px 0; border: 0; white-space: normal; }
    .invoice-product-results-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; font-weight: 900; }
    .invoice-product-results-table tbody tr td:last-child { display: grid; }
    .product-result-select { width: 100%; min-height: 44px; }
    .invoice-review-modal { align-items: stretch; justify-items: stretch; padding: 8px; }
    .invoice-review-card { width: 100%; max-height: calc(100dvh - 16px); padding: 14px; border-radius: 18px; }
    .stock-overview-cards { display: grid; gap: 12px; }
    .stock-overview-table-wrap { display: none; }
    .stock-location-grid { grid-template-columns: 1fr; }
    .stock-overview-summary { grid-template-columns: 1fr !important; }
    .stock-overview-filter-bar { grid-template-columns: 1fr !important; gap: 9px; }
    .stock-overview-filter-bar .btn { width: 100%; min-height: 42px; }
    .custody-visibility-note, .custody-read-only-message, .custody-view-toolbar { align-items: stretch; flex-direction: column; }
    .custody-visibility-note .status-badge, .custody-view-toolbar > .status-badge { align-self: flex-start; }
    .custody-switcher { grid-template-columns: 1fr; width: 100%; }
    .custody-switcher label { white-space: normal; }
    .custody-switcher .btn { width: 100%; }
    .stock-product-header { display: grid; gap: 10px; }
    .stock-total-badge { justify-self: start; }
    .stock-source-sections { grid-template-columns: 1fr; }
    .stock-product-meta { display: grid; gap: 6px; }
    .movement-card-list { display: grid; gap: 12px; }
    .movement-table-wrap { display: none; }
    .users-page-header { align-items: stretch; padding-bottom: 14px; }
    .users-title-row { align-items: flex-start; justify-content: space-between; }
    .users-add-button { width: 100%; }
    .users-filter-bar { padding: 12px; }
    .users-table-wrap { border: 0; background: transparent; }
    .users-table td, .users-table td span, .users-table td strong { max-width: none; white-space: normal; }
    .users-row-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .users-row-actions .action-btn { width: 100%; min-height: 40px; }
    .role-help-card { padding: 16px; border-radius: 18px; }
    .role-help-grid { grid-template-columns: 1fr; }
    .barcode-count-cards, .label-count-control, .label-preview-action-card, .barcode-search-row { grid-template-columns: 1fr; }
    .barcode-workflow-section { padding: 13px; border-radius: 16px; }
    .barcode-compact-filter-header strong { display: none; }
    .barcode-filter-toggle { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; }
    .barcode-classification-filter.is-collapsed .barcode-compact-filter-body { display: none; }
    .barcode-classification-filter.is-collapsed .when-expanded, .barcode-classification-filter:not(.is-collapsed) .when-collapsed { display: none; }
    .barcode-filter-grid { grid-template-columns: 1fr; gap: 8px; }
    .barcode-search-row .btn { width: 100%; }
    .label-preview-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .selected-count, #preview-labels-button { width: 100%; justify-content: center; min-height: 44px; }
    .barcode-product-table-section { margin-top: 0; }
    .barcode-product-table-section .mobile-card-table .select-column { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; }
    .barcode-product-table-section .mobile-card-table .select-column::before { content: attr(data-label); }
    .barcode-status-toolbar { align-items: stretch; }
    .barcode-status-toolbar .btn { width: 100%; }
}

@media screen and (min-width: 701px) and (max-width: 1180px) {
    .barcode-filter-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

@media screen and (min-width: 701px) and (max-width: 900px) {
    .label-count-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .barcode-search-row { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media screen and (min-width: 901px) and (max-width: 1180px) {
    .invoice-line-row { grid-template-columns: minmax(0, 1fr) 150px; }
    .invoice-line-product-area { grid-column: 1 / -1; }
    .invoice-line-values { grid-column: 1; }
    .invoice-line-actions { grid-column: 2; }
}

@media screen and (max-width: 420px) {
    html { font-size: 14px; }
    .content { padding-inline: 8px; }
    .panel, .login-panel { padding: 13px; border-radius: 16px; }
    .topbar h1 { max-width: 46vw; font-size: 1.1rem; }
    .topbar h1 { max-width: 38vw; }
    .topbar-actions { max-width: 230px; }
    .account-pill-text { display: none; }
    .account-pill { gap: 6px; padding-inline: 5px 8px; }
    .mobile-card-table .data-table td { grid-template-columns: 1fr; gap: 4px; }
    .mobile-card-table .data-table td::before { font-size: 0.78rem; }
    .selected-product-label { min-height: 52px; }
    .invoice-product-cell { grid-template-columns: 1fr; }
    .invoice-open-product-picker { grid-column: 1; grid-row: auto; justify-self: start; min-width: 120px; }
    .role-help-modal { padding: 8px; }
    .role-help-card { max-height: calc(100dvh - 16px); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(100%); }
    body.sidebar-collapsed .sidebar { transform: translateX(0); }
    .main-shell { width: 100%; margin-inline-start: 0; }
    .sidebar-toggle { display: inline-flex; background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 8px 12px; }
    .topbar { padding: 18px; align-items: flex-start; }
    .topbar-actions { justify-content: flex-end; }
    .content { padding: 26px 18px 40px; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-filter { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .module-header { flex-direction: column; }
    .preview-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-detail-hero { flex-direction: column; }
    .invoice-detail-actions { width: 100%; justify-content: flex-start; }
    .invoice-detail-grid, .return-history-body { grid-template-columns: 1fr; }
    .invoice-customer-link-grid { grid-template-columns: 1fr; }
    .return-summary-grid, .return-history-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-preview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .movement-summary-cards, .adjustment-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-do-dont-grid, .inventory-filter-bar, .movement-filter-bar, .sales-rep-filter-bar, .customer-filter-bar, .users-filter-bar { grid-template-columns: 1fr; }
    .stock-count-create-grid, .stock-count-summary-cards, .stock-count-meta-grid, .stock-count-filter-bar { grid-template-columns: 1fr; }
    .reports-grid, .reports-filter-bar, .reports-summary-cards { grid-template-columns: 1fr; }
    .stock-count-mobile-cards { display: none; }
    .stock-count-line-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-count-table .item-name-column { min-width: 0; }
    .stock-count-table input[type="number"], .stock-count-table textarea { width: 100%; min-width: 0; }
    .stock-count-table textarea { min-height: 64px; }
    .stock-count-actions { display: grid; grid-template-columns: 1fr; }
    .stock-count-actions .btn { width: 100%; min-width: 0; }
    .stock-count-cancel-form, .stock-count-cancel-disclosure, .stock-count-cancel-disclosure summary, .stock-count-cancel-panel .btn { width: 100%; }
    .sales-rep-filter-bar .btn, .customer-filter-bar .btn, .users-filter-bar .btn { width: 100%; }
    .invoice-header-card { grid-template-columns: 1fr; }
    .invoice-pos-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-scanner-panel { grid-template-columns: 1fr; }
    .invoice-scanner-copy { grid-row: auto; }
    .invoice-source-lock-note { grid-column: auto; }
    .invoice-cashier-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .invoice-next-action { grid-column: 1 / -1; }
    .pos-source-strip { grid-template-columns: 1fr; align-items: stretch; }
    .invoice-line-head { display: none; }
    .invoice-line-row { grid-template-columns: 1fr; }
    .invoice-line-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-product-area { grid-template-columns: 1fr; }
    .invoice-line-actions { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-row[data-product-state="empty"] .invoice-line-actions, .is-empty-row .invoice-line-actions { grid-template-columns: 1fr; }
    .invoice-product-search-row { grid-template-columns: 1fr auto auto; }
    .invoice-product-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-available-only { justify-content: flex-start; }
    .adjustment-form-grid { grid-template-columns: 1fr; }
    .transfer-stock-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-transfer-grid { grid-template-columns: 1fr; }
    .transfer-product-field, .transfer-notes-field { grid-column: auto; }
    .stock-transfer-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .stock-transfer-actions .btn { width: 100%; min-width: 0; }
    .tool-panel summary { align-items: flex-start; }
    .tool-panel summary small { margin-inline-start: 0; }
    .import-prices { justify-content: flex-start; }
    .import-map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bulk-correction-panel { grid-template-columns: 1fr 1fr; }
    .compact-row-header, .sticky-import-actions { flex-direction: column; align-items: stretch; }
    .row-finance-meta { justify-content: flex-start; }
}

@media (max-width: 620px) {
    .topbar { flex-wrap: wrap; }
    .topbar-heading { width: 100%; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .bulk-actions-bar { align-items: stretch; flex-direction: column; }
    .login-panel { padding: 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .panel-header { align-items: flex-start; flex-direction: column; }
    .import-map-grid { grid-template-columns: 1fr; }
    .bulk-correction-panel { grid-template-columns: 1fr; }
    .preview-summary-cards { grid-template-columns: 1fr; }
    .transfer-stock-panel { grid-template-columns: 1fr; }
    .stock-transfer-form { padding: 14px; border-radius: 18px; }
    .stock-transfer-page .transfer-stock-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-transfer-page .transfer-stat-card { min-height: 74px; padding: 10px; }
    .stock-transfer-actions { grid-template-columns: 1fr; }
    .selected-transfer-product { padding: 11px; }
    .selected-product-details { grid-template-columns: 1fr; }
    .selected-product-chip { width: 100%; justify-content: center; }
    .customer-profile-grid { grid-template-columns: 1fr; }
    .invoice-customer-link-hero { align-items: stretch; flex-direction: column; padding: 15px; }
    .invoice-customer-link-hero .btn { width: 100%; }
    .invoice-customer-link-section { padding: 13px; }
    .invoice-customer-search-form, .invoice-new-customer-grid { grid-template-columns: 1fr; }
    .invoice-new-customer-grid .single-column { grid-column: auto; }
    .invoice-customer-link-actions { display: grid; grid-template-columns: 1fr; }
    .invoice-customer-link-actions .btn { width: 100%; }
    .invoice-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .invoice-detail-actions > .btn, .invoice-detail-actions > .invoice-action-dropdown, .invoice-detail-actions > .invoice-share-controls, .invoice-detail-actions .invoice-share-button, .invoice-action-dropdown > summary { width: 100%; }
    .invoice-action-dropdown > summary, .invoice-detail-actions > .btn, .invoice-detail-actions .invoice-share-button { justify-content: center; }
    .invoice-action-menu { width: min(270px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
    .invoice-action-dropdown[open] > .invoice-action-menu { position: static; width: 100%; max-width: 100%; min-width: 0; margin-top: 8px; }
    .invoice-form-panel { padding: 12px; }
    .invoice-pos-steps { display: flex; gap: 7px; padding: 7px; overflow-x: auto; scrollbar-width: thin; }
    .invoice-pos-steps button { flex: 0 0 186px; min-height: 40px; }
    .pos-step-card { padding: 12px; }
    .pos-step-heading { align-items: stretch; flex-direction: column; }
    .pos-step-heading .invoice-add-line { width: 100%; }
    .pos-step-title { align-items: flex-start; }
    .pos-step-number { flex-basis: 34px; width: 34px; height: 34px; border-radius: 11px; }
    .invoice-info-grid, .return-summary-grid, .return-history-head { grid-template-columns: 1fr; }
    .return-history-meta { padding-inline: 0; border-inline-start: 0; }
    .return-history-value { padding-inline-start: 0; border-inline-start: 0; }
    .return-history-body { grid-template-columns: 1fr; }
    .return-product-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
    .return-quantity-badge { grid-column: 1 / -1; justify-self: start; }
    .customer-quick-grid { grid-template-columns: 1fr; }
    .invoice-line-row, .invoice-total-cards, .invoice-live-totals { grid-template-columns: 1fr; }
    .invoice-product-search-row, .invoice-product-filter-row { grid-template-columns: 1fr; }
    .invoice-picker-search-field, .invoice-picker-filter { width: 100%; }
    .invoice-product-cell { grid-template-columns: 1fr; }
    .invoice-open-product-picker { grid-column: 1; grid-row: auto; justify-self: stretch; }
    .invoice-line-values { grid-template-columns: 1fr; }
    .invoice-scanner-panel { padding: 13px; }
    .invoice-scanner-copy { align-items: flex-start; }
    .invoice-scanner-controls { grid-template-columns: 1fr; }
    .invoice-scanner-focus { width: 100%; }
    .invoice-scanner-status { align-items: flex-start; flex-direction: column; }
    .invoice-unified-product-result { grid-template-columns: 1fr; gap: 8px; }
    .invoice-unified-product-stock { justify-self: start; }
    .invoice-cashier-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px; }
    .invoice-cart-stat.total, .invoice-next-action { grid-column: 1 / -1; }
    .invoice-step-actions { display: grid; grid-template-columns: 1fr; }
    .invoice-step-actions .btn { width: 100%; min-width: 0; }
    .invoice-review-grid { grid-template-columns: 1fr; }
    .invoice-modal-actions { flex-direction: column-reverse; align-items: stretch; }
    .dashboard-section-header { flex-direction: column; align-items: stretch; }
    .dashboard-section-header .badge { align-self: flex-start; }
    .dashboard-warning-actions { justify-content: flex-start; }
    .dashboard-warning-subhead { align-items: flex-start; flex-direction: column; }
    .dashboard-warning-link { width: 100%; justify-content: center; }
    .best-seller-product { grid-template-columns: 1fr; }
    .low-stock-code, .best-seller-product > span { width: fit-content; }
    .primary-filters .module-tab { flex: 1 1 calc(50% - 8px); }
}

@media screen and (max-width: 700px) {
    .topbar { flex-wrap: nowrap; align-items: center; padding: 10px 12px; }
    .topbar-heading { width: auto; min-width: 0; flex: 1 1 auto; }
    .topbar-actions { width: auto; max-width: 250px; flex: 0 0 auto; justify-content: flex-end; }
    .account-pill-text { display: none; }
    .content { padding: 16px 10px 28px; }
    .dashboard-hero { padding: 14px; border-radius: 18px; }
    .dashboard-grid, .preview-summary-cards, .stock-preview-summary, .movement-summary-cards, .adjustment-summary-cards, .transfer-stock-panel { grid-template-columns: 1fr !important; }
    .dashboard-actions { grid-template-columns: 1fr !important; }
    .low-stock-bottom-row { display: grid; grid-template-columns: 1fr; align-items: start; }
    .low-stock-location { white-space: normal; }
    .low-stock-meta { justify-content: flex-start; }
    .best-seller-meta { display: grid; grid-template-columns: 1fr; }
    .stock-alert-product-cell { grid-template-columns: 1fr; min-width: 0; }
    .stock-alert-code { width: fit-content; }
    .stock-transfer-page .transfer-stock-panel { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .invoice-form #id_notes { min-height: 52px; }
    .invoice-line-row { grid-template-columns: 1fr !important; }
    .invoice-form-actions { display: grid; grid-template-columns: 1fr; }
    .invoice-form-actions .btn { width: 100%; min-height: 46px; }
    .invoice-detail-hero, .invoice-info-panel, .invoice-money-panel, .invoice-return-summary-panel, .invoice-lines-panel, .invoice-return-history-panel { padding: 14px; border-radius: 18px; }
    .invoice-title-row { align-items: flex-start; }
    .invoice-product-search-row, .invoice-product-filter-row { grid-template-columns: 1fr !important; }
    .invoice-product-modal-card, .invoice-review-card { width: 100%; max-height: calc(100dvh - 16px); }
}

@media screen and (max-width: 420px) {
    .stock-transfer-page .transfer-stock-panel { grid-template-columns: 1fr !important; }
    .stock-transfer-page .transfer-stat-card strong { font-size: 1.35rem; }
}

@media screen and (min-width: 701px) and (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-product-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.transfer-status-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.transfer-status-options > div { min-width: 0; }
.transfer-status-options label { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 10px 12px; border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 13px; background: rgba(245, 158, 11, 0.08); color: var(--text); cursor: pointer; font-weight: 900; }
.transfer-status-options input { width: 18px; height: 18px; accent-color: #f59e0b; }
.pending-transfer-notice { padding: 11px 13px; border: 1px solid rgba(245, 158, 11, 0.38); border-radius: 13px; background: rgba(245, 158, 11, 0.09); color: #fbbf24; font-weight: 800; line-height: 1.7; }
.pending-transfer-state-card { display: grid; gap: 18px; margin-bottom: 18px; padding: 20px; border-color: rgba(245, 158, 11, 0.45); background: linear-gradient(145deg, rgba(120, 72, 10, 0.28), rgba(17, 31, 49, 0.92)); }
.pending-transfer-state-card.is-overdue { border-color: rgba(248, 113, 113, 0.55); }
.pending-transfer-state-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pending-transfer-state-head h3 { margin: 4px 0; color: #fbbf24; }
.pending-transfer-state-head p { margin: 0; color: var(--muted); }
.pending-transfer-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pending-transfer-facts > div, .pending-stock-item { min-width: 0; padding: 11px 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 13px; background: rgba(5, 13, 24, 0.42); }
.pending-transfer-facts span, .pending-stock-item span { display: block; color: var(--muted); font-size: 0.78rem; }
.pending-transfer-facts strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.pending-stock-check h4 { margin: 0 0 10px; }
.pending-stock-list { display: grid; gap: 8px; }
.pending-stock-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.pending-stock-item.is-insufficient { border-color: rgba(248, 113, 113, 0.45); background: rgba(127, 29, 29, 0.18); }
.pending-transfer-confirm-form { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr) auto; align-items: end; gap: 12px; }
.dashboard-pending-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dashboard-pending-card { display: grid; gap: 9px; min-width: 0; padding: 14px; border: 1px solid rgba(245, 158, 11, 0.32); border-radius: 16px; background: rgba(245, 158, 11, 0.07); }
.dashboard-pending-card.is-overdue { border-color: rgba(248, 113, 113, 0.5); }
.dashboard-pending-head, .dashboard-pending-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dashboard-pending-customer { overflow: hidden; color: var(--text); font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-pending-meta { color: var(--muted); font-size: 0.8rem; }
.dashboard-pending-meta strong { color: var(--text); overflow-wrap: anywhere; text-align: left; }
.pending-duration { display: inline-block; margin-top: 5px; color: #fbbf24; font-weight: 800; }
.pending-duration.is-overdue { color: #f87171; }
.invoice-summary-card > span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 800; }

@media screen and (max-width: 900px) {
    .pending-transfer-facts, .dashboard-pending-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pending-transfer-confirm-form { grid-template-columns: 1fr; }
}

@media screen and (max-width: 620px) {
    .transfer-status-options, .pending-transfer-facts, .dashboard-pending-grid { grid-template-columns: 1fr; }
    .pending-transfer-state-head, .pending-stock-item, .dashboard-pending-head, .dashboard-pending-meta { display: grid; grid-template-columns: 1fr; align-items: start; }
    .pending-transfer-state-card { padding: 14px; border-radius: 18px; }
    .pending-transfer-confirm-form .btn { width: 100%; min-height: 46px; }
    .dashboard-pending-customer { white-space: normal; }
}

/* Scanner/POS item-card layout refinements. */
.invoice-source-lock-note { line-height: 1.6; }

@media screen and (min-width: 901px) and (max-width: 1180px) {
    .invoice-line-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "product actions" "controls controls"; }
    .invoice-line-row.is-empty-row, .invoice-line-row[data-product-state="empty"] { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "product actions"; }
    .invoice-line-product-area, .invoice-line-values, .invoice-line-actions { grid-column: auto; }
}

@media screen and (max-width: 900px) {
    .invoice-line-row { grid-template-columns: 1fr; grid-template-areas: "product" "controls" "actions"; }
    .invoice-line-row.is-empty-row, .invoice-line-row[data-product-state="empty"] { grid-template-columns: 1fr; grid-template-areas: "product" "actions"; }
    .invoice-line-product-area, .invoice-line-values, .invoice-line-actions { grid-column: auto; }
    .invoice-line-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-actions { display: flex; width: 100%; justify-content: flex-start; }
    .invoice-line-actions .btn, .invoice-delete-line { width: auto; min-height: 42px; }
}

@media screen and (max-width: 620px) {
    .invoice-product-heading { align-items: flex-start; }
    .invoice-product-name { flex-basis: 100%; }
    .invoice-line-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-total { grid-column: 1 / -1; }
    .invoice-line-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line-actions .btn, .invoice-delete-line { width: 100%; min-height: 44px; white-space: normal; }
    .invoice-cart-stat { min-height: 68px; }
    .invoice-next-action { min-height: 50px; }
}

@media screen and (max-width: 420px) {
    .invoice-line-values { grid-template-columns: 1fr; }
    .invoice-line-total { grid-column: auto; }
    .invoice-product-meta { align-items: flex-start; }
    .product-summary-badge { white-space: normal; }
}

/* Stock transfer receipt workflow. */
.transfer-notification-menu { position: relative; }
.transfer-notification-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(16, 35, 58, 0.72);
    color: #bfdbfe;
    cursor: pointer;
    font-size: 1rem;
}
.transfer-notification-toggle:hover, .transfer-notification-toggle:focus-visible { border-color: rgba(77, 163, 255, 0.45); background: rgba(77, 163, 255, 0.13); outline: none; }
.transfer-notification-toggle b { position: absolute; inset-block-start: -6px; inset-inline-start: -6px; display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border: 2px solid #0b1628; border-radius: 999px; background: #ef4444; color: white; font-size: 0.68rem; }
.transfer-notification-dropdown {
    position: absolute;
    z-index: 90;
    inset-block-start: calc(100% + 9px);
    inset-inline-end: 0;
    width: min(390px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(77, 163, 255, 0.24);
    border-radius: 17px;
    background: rgba(6, 15, 28, 0.99);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    direction: rtl;
}
.transfer-notification-dropdown.is-hidden { display: none; }
.transfer-notification-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.transfer-notification-head strong { min-width: 0; color: var(--text); font-size: 0.9rem; overflow-wrap: anywhere; }
.transfer-notification-head span { display: inline-grid; place-items: center; min-width: 27px; height: 27px; border-radius: 999px; background: rgba(77, 163, 255, 0.12); color: #bfdbfe; font-weight: 900; }
.transfer-notification-items { display: grid; min-width: 0; max-height: min(420px, 62vh); overflow-y: auto; }
.transfer-notification-item-form { min-width: 0; margin: 0; }
.transfer-notification-item { display: grid; gap: 8px; width: 100%; min-width: 0; padding: 13px 14px; border: 0; border-bottom: 1px solid rgba(148, 163, 184, 0.1); border-radius: 0; background: transparent; cursor: pointer; direction: rtl; text-align: start; white-space: normal; }
.transfer-notification-item:hover, .transfer-notification-item:focus-visible { background: rgba(77, 163, 255, 0.1); outline: none; }
.transfer-notification-item-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.transfer-notification-item-title > strong { min-width: 0; color: #dbeafe; font-size: 0.86rem; overflow-wrap: anywhere; }
.transfer-notification-item-title > b { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: rgba(77, 163, 255, 0.14); color: #93c5fd; font-size: 0.66rem; }
.transfer-notification-route { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 5px; min-width: 0; color: var(--text); font-size: 0.8rem; line-height: 1.5; }
.transfer-notification-route > span { color: var(--muted); font-weight: 800; }
.transfer-notification-route > strong { min-width: 0; color: var(--text); font-size: inherit; overflow-wrap: anywhere; }
.transfer-notification-item > small { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.transfer-notification-item > small span { min-width: 0; overflow-wrap: anywhere; }
.transfer-notification-item > small time { flex: 0 0 auto; }
.transfer-notification-empty { display: grid; gap: 4px; padding: 25px 14px; color: var(--muted); text-align: center; }
.transfer-notification-empty strong { color: var(--text); font-size: 0.86rem; }
.transfer-notification-empty span { font-size: 0.76rem; line-height: 1.6; }
.transfer-notification-all { display: flex; justify-content: center; padding: 10px; color: #93c5fd; font-size: 0.82rem; font-weight: 900; }
.transfer-status { display: inline-flex; align-items: center; justify-content: center; min-height: 29px; padding: 5px 9px; border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 999px; color: #cbd5e1; font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.transfer-status.status-pending_receipt { border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.1); color: #fcd34d; }
.transfer-status.status-accepted { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.1); color: #86efac; }
.transfer-status.status-rejected, .transfer-status.status-cancelled { border-color: rgba(248, 113, 113, 0.3); background: rgba(127, 29, 29, 0.18); color: #fca5a5; }
.transfer-status.status-draft { color: var(--muted); }
.stock-transfer-history { min-width: 0; max-width: 100%; overflow-x: clip; }
.transfer-history-filter-bar { grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(160px, 0.7fr)) auto; align-items: end; }
.transfer-history-filter-field { display: grid; gap: 6px; min-width: 0; }
.transfer-history-filter-field > span { color: var(--muted); font-size: 0.78rem; font-weight: 900; }
.transfer-history-date-input { position: relative; display: block; min-width: 0; color: inherit; font-size: inherit; font-weight: inherit; }
.transfer-history-date-input > input { width: 100%; }
.transfer-history-date-input > span { position: absolute; inset-block-start: 50%; inset-inline: 13px 42px; z-index: 1; color: var(--muted); font-size: 0.82rem; font-weight: 700; pointer-events: none; transform: translateY(-50%); }
.transfer-history-date-input > input:not(.is-empty) + span { display: none; }
.transfer-history-date-input > input.is-empty { color: transparent; }
.transfer-history-date-input > input.is-empty::-webkit-datetime-edit { color: transparent; }
.transfer-history-filter-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.transfer-history-table-wrap { min-width: 0; max-width: 100%; }
.transfer-request-table { width: 100%; min-width: 980px; table-layout: fixed; direction: rtl; }
.transfer-request-table th, .transfer-request-table td { text-align: start; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
.transfer-request-table th:first-child, .transfer-request-table td:first-child { width: 19%; }
.transfer-request-table th:nth-child(2), .transfer-request-table td:nth-child(2) { width: 13%; }
.transfer-request-table th:nth-child(3), .transfer-request-table td:nth-child(3), .transfer-request-table th:nth-child(4), .transfer-request-table td:nth-child(4) { width: 14%; }
.transfer-request-table th:nth-child(5), .transfer-request-table td:nth-child(5), .transfer-request-table th:nth-child(6), .transfer-request-table td:nth-child(6) { width: 9%; text-align: center; }
.transfer-request-table th:nth-child(7), .transfer-request-table td:nth-child(7) { width: 12%; }
.transfer-request-table th:last-child, .transfer-request-table td:last-child { width: 10%; }
.transfer-history-reference { display: grid; gap: 4px; min-width: 0; }
.transfer-history-reference strong { color: var(--text); overflow-wrap: anywhere; }
.transfer-history-reference time { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.transfer-history-item-count { display: grid; gap: 5px; min-width: 0; }
.transfer-history-item-count > span { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.transfer-history-item-count small { padding: 2px 5px; border-radius: 7px; background: rgba(77, 163, 255, 0.09); color: #bfdbfe; font-size: 0.64rem; overflow-wrap: anywhere; }
.transfer-request-table .in-transit-note { display: block; margin-top: 3px; color: #fbbf24; font-size: 0.7rem; }
.legacy-transfer-history { display: grid; gap: 14px; min-width: 0; margin-top: 22px; padding: 16px; border: 1px solid rgba(245, 158, 11, 0.22); border-radius: 18px; background: rgba(120, 53, 15, 0.07); }
.legacy-transfer-heading { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.legacy-transfer-heading > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: rgba(245, 158, 11, 0.14); color: #fcd34d; font-size: 0.7rem; font-weight: 900; }
.legacy-transfer-heading > div { display: grid; gap: 3px; min-width: 0; }
.legacy-transfer-heading strong { color: var(--text); }
.legacy-transfer-heading small { color: var(--muted); line-height: 1.6; }
.legacy-transfer-table { width: 100%; min-width: 1080px; direction: rtl; }
.legacy-transfer-table th, .legacy-transfer-table td { text-align: start; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
.legacy-transfer-product { display: grid; gap: 2px; min-width: 0; }
.legacy-transfer-product span, .legacy-transfer-product small { overflow-wrap: anywhere; }
.legacy-transfer-product small { color: var(--muted); font-size: 0.72rem; }
.transfer-detail-page, .transfer-notifications-page { display: grid; gap: 16px; }
.transfer-detail-page { min-width: 0; max-width: 100%; overflow-x: clip; }
.transfer-notifications-page { min-width: 0; max-width: 100%; overflow-x: clip; }
.transfer-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 4px 2px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.13); }
.transfer-detail-title { display: grid; gap: 5px; min-width: 0; }
.transfer-detail-title h2 { margin: 0; color: var(--text); font-size: clamp(1.28rem, 2.5vw, 1.75rem); overflow-wrap: anywhere; }
.transfer-detail-title p { max-width: 720px; margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
.transfer-detail-meta, .transfer-notification-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.transfer-detail-meta > article, .transfer-notification-facts > div { display: grid; gap: 4px; min-width: 0; padding: 12px 13px; border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 14px; background: rgba(15, 23, 42, 0.34); }
.transfer-detail-meta span, .transfer-notification-facts span { color: var(--muted); font-size: 0.74rem; font-weight: 800; }
.transfer-detail-meta strong, .transfer-notification-facts strong { color: var(--text); font-size: 0.88rem; overflow-wrap: anywhere; }
.in-transit-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid rgba(245, 158, 11, 0.32); border-radius: 16px; background: linear-gradient(135deg, rgba(120, 53, 15, 0.22), rgba(15, 23, 42, 0.3)); }
.in-transit-banner > div { display: grid; gap: 3px; }
.in-transit-banner strong { color: #fde68a; }
.in-transit-banner span { color: #d6b978; font-size: 0.82rem; }
.in-transit-banner > b { flex: 0 0 auto; color: #fbbf24; font-size: 1.15rem; }
.transfer-detail-lines, .transfer-decision-panel { display: grid; gap: 14px; min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 17px; background: rgba(8, 13, 26, 0.28); }
.transfer-detail-table-wrap { min-width: 0; max-width: 100%; }
.transfer-detail-table { width: 100%; min-width: 0; table-layout: fixed; }
.transfer-detail-table th, .transfer-detail-table td { white-space: normal; overflow-wrap: anywhere; }
.transfer-detail-table th:first-child, .transfer-detail-table td:first-child { width: 20%; }
.transfer-detail-table th:nth-child(3), .transfer-detail-table td:nth-child(3), .transfer-detail-table th:nth-child(4), .transfer-detail-table td:nth-child(4) { width: 15%; }
.transfer-detail-note, .transfer-decision-note { padding: 12px 14px; border: 1px solid var(--border); border-radius: 15px; background: rgba(15, 23, 42, 0.34); }
.transfer-detail-note span, .transfer-decision-note span { color: var(--muted); font-size: 0.75rem; font-weight: 900; }
.transfer-detail-note p, .transfer-decision-note p { margin: 5px 0 0; color: var(--text); line-height: 1.7; }
.transfer-decision-note small { display: block; margin-top: 6px; color: var(--muted); }
.transfer-decision-note.is-accepted { border-color: rgba(34, 197, 94, 0.25); }
.transfer-decision-note.is-rejected, .transfer-decision-note.is-cancelled { border-color: rgba(248, 113, 113, 0.25); }
.transfer-decision-panel { align-items: start; }
.transfer-decision-actions { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr); gap: 12px; align-items: stretch; }
.transfer-decision-card { display: grid; align-content: start; gap: 10px; min-width: 0; margin: 0; padding: 14px; border: 1px solid rgba(148, 163, 184, 0.14); border-radius: 15px; background: rgba(15, 23, 42, 0.36); }
.transfer-decision-card > div { display: grid; gap: 3px; }
.transfer-decision-card > div strong { color: var(--text); }
.transfer-decision-card > div span { color: var(--muted); font-size: 0.78rem; line-height: 1.6; }
.transfer-accept-form { border-color: rgba(34, 197, 94, 0.22); background: rgba(34, 197, 94, 0.06); }
.transfer-reject-form { border-color: rgba(248, 113, 113, 0.2); background: rgba(127, 29, 29, 0.08); }
.transfer-accept-form .btn { width: 100%; min-height: 48px; }
.transfer-reject-form, .transfer-cancel-panel form { display: grid; gap: 8px; }
.transfer-reject-form label, .transfer-cancel-panel label { color: var(--muted); font-size: 0.8rem; font-weight: 900; }
.transfer-cancel-panel { padding: 12px 14px; border: 1px solid rgba(248, 113, 113, 0.2); border-radius: 15px; background: rgba(127, 29, 29, 0.09); }
.transfer-cancel-panel summary { color: #fca5a5; cursor: pointer; font-weight: 900; }
.transfer-cancel-panel form { margin-top: 12px; }
.transfer-detail-footer { display: flex; justify-content: flex-end; padding-top: 4px; }
.transfer-notification-list { display: grid; gap: 11px; min-width: 0; }
.transfer-notification-card { display: grid; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 23, 42, 0.34); }
.transfer-notification-card.is-unread { border-color: rgba(77, 163, 255, 0.34); background: linear-gradient(135deg, rgba(30, 64, 175, 0.13), rgba(15, 23, 42, 0.38)); }
.transfer-notification-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.transfer-notification-card-head > div { display: grid; gap: 3px; min-width: 0; }
.transfer-notification-card-head strong { color: var(--text); overflow-wrap: anywhere; }
.transfer-notification-card-head span { color: var(--muted); font-size: 0.78rem; }
.transfer-notification-card-head > b { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: rgba(77, 163, 255, 0.14); color: #93c5fd; font-size: 0.72rem; }
.transfer-notification-products { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.transfer-notification-products > span { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid rgba(148, 163, 184, 0.15); border-radius: 11px; background: rgba(7, 17, 31, 0.5); color: #cbd5e1; font-size: 0.78rem; overflow-wrap: anywhere; white-space: normal; }
.transfer-notification-products small { color: var(--muted); }
.transfer-notification-products b { color: #bfdbfe; }
.transfer-notification-open-form { justify-self: start; margin: 0; }

@media screen and (max-width: 900px) {
    .transfer-history-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transfer-history-search-field, .transfer-history-filter-actions { grid-column: 1 / -1; }
    .transfer-history-filter-actions .btn { flex: 1 1 0; }
    .transfer-detail-meta, .transfer-notification-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transfer-decision-actions { grid-template-columns: 1fr; }
}

@media screen and (max-width: 800px) {
    .stock-transfer-history .transfer-history-table-wrap.mobile-card-table { overflow: visible; }
    .stock-transfer-history .mobile-card-table .data-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; table-layout: auto; }
    .stock-transfer-history .mobile-card-table .data-table thead { display: none; }
    .stock-transfer-history .mobile-card-table .data-table,
    .stock-transfer-history .mobile-card-table .data-table tbody,
    .stock-transfer-history .mobile-card-table .data-table tr,
    .stock-transfer-history .mobile-card-table .data-table td { display: block; width: 100%; }
    .stock-transfer-history .mobile-card-table .data-table tr { padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 35, 58, 0.58); }
    .stock-transfer-history .mobile-card-table .data-table td { display: grid; grid-template-columns: minmax(100px, 32%) minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border: 0; text-align: start; overflow-wrap: anywhere; }
    .stock-transfer-history .mobile-card-table .data-table td::before { color: var(--muted); content: attr(data-label); font-size: 0.82rem; font-weight: 900; }
    .stock-transfer-history .mobile-card-table .data-table td[colspan] { display: block; }
    .stock-transfer-history .mobile-card-table .data-table td[colspan]::before { content: none; }
    .stock-transfer-history .transfer-history-item-count > span { justify-content: flex-start; }
    .stock-transfer-history .transfer-request-table .action-btn { width: 100%; min-height: 40px; }
}

@media screen and (max-width: 620px) {
    .stock-transfer-workflow .topbar h1 { max-width: 44vw; overflow: visible; font-size: 0.96rem; line-height: 1.3; text-overflow: clip; white-space: normal; }
    .transfer-history-filter-bar { grid-template-columns: 1fr; }
    .transfer-history-search-field, .transfer-history-filter-actions { grid-column: auto; }
    .transfer-history-filter-actions { display: grid; grid-template-columns: 1fr; }
    .legacy-transfer-history { padding: 12px; border-radius: 16px; }
    .legacy-transfer-heading { flex-direction: column; }
    .transfer-history-item-count > span { justify-content: flex-start; }
    .transfer-request-table .action-btn { width: 100%; min-height: 40px; }
    .transfer-mobile-location { display: grid; gap: 2px; min-width: 0; padding: 8px 10px; border: 1px solid rgba(77, 163, 255, 0.12); border-radius: 11px; background: rgba(77, 163, 255, 0.05); }
    .transfer-mobile-location b { color: var(--muted); font-size: 0.7rem; }
    .transfer-mobile-location strong { color: var(--text); font-size: 0.78rem; line-height: 1.6; overflow-wrap: anywhere; }
    .transfer-notification-dropdown { position: fixed; inset-block-start: 68px; inset-inline: 8px; width: auto; max-width: calc(100vw - 16px); }
    .transfer-notification-item { padding: 12px; }
    .transfer-notification-item > small { align-items: flex-start; flex-direction: column; }
    .transfer-detail-meta, .transfer-notification-facts { grid-template-columns: 1fr; }
    .transfer-detail-hero, .in-transit-banner { align-items: flex-start; flex-direction: column; }
    .transfer-detail-hero .transfer-status { align-self: flex-start; }
    .transfer-detail-lines, .transfer-decision-panel { padding: 12px; border-radius: 15px; }
    .transfer-detail-table-wrap { overflow: visible; }
    .transfer-detail-table, .transfer-detail-table tbody, .transfer-detail-table tr, .transfer-detail-page .transfer-detail-table td { display: block; width: 100%; }
    .transfer-detail-table thead { display: none; }
    .transfer-detail-table tr { margin-bottom: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: rgba(15, 23, 42, 0.32); }
    .transfer-detail-page .transfer-detail-table td { display: grid; grid-template-columns: minmax(86px, 34%) minmax(0, 1fr); gap: 8px; width: 100%; padding: 6px 0; border: 0; }
    .transfer-detail-table td::before { color: var(--muted); content: attr(data-label); font-size: 0.74rem; font-weight: 900; }
    .transfer-detail-footer, .transfer-detail-footer .btn { width: 100%; }
    .transfer-notification-card { padding: 12px; border-radius: 16px; }
    .transfer-notification-card-head { flex-wrap: wrap; }
    .transfer-notification-products > span { width: 100%; }
    .transfer-notification-open-form, .transfer-notification-open-form .btn { width: 100%; }
}

@media screen and (max-width: 420px) {
    .stock-transfer-history .mobile-card-table .data-table td { grid-template-columns: 1fr; gap: 4px; }
}
