/* =====================================================
   POS System - Milky Light Theme
   ===================================================== */

:root {
    --primary-cyan: #b08a56;
    --primary-emerald: #d8c3a5;
    --primary-teal: #c7ad88;
    --cyan-900: #fdfbf7;
    --teal-900: #f6f2ea;
    --emerald-900: #efe8dd;

    --text-main: #1f2933;
    --text-muted: #4b5563;
    --text-soft: #6b7280;

    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(140, 121, 90, 0.22);
    --glass-shadow: rgba(58, 45, 22, 0.12);
    --navbar-space: 0px;
    --sidebar-width: 272px;
    --topbar-height: 64px;
    --btn-primary-start: #cfa158;
    --btn-primary-end: #a9782f;
    --btn-secondary-start: #ead7b2;
    --btn-secondary-end: #c79d5b;
}

body.theme-dark {
    --primary-cyan: #dfbf82;
    --primary-emerald: #3a3122;
    --primary-teal: #58472e;
    --cyan-900: #0f1319;
    --teal-900: #141a22;
    --emerald-900: #11161d;
    --text-main: #edf2f7;
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --glass-bg: rgba(17, 24, 39, 0.82);
    --glass-border: rgba(214, 183, 125, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.35);
    --btn-primary-start: #d4a65f;
    --btn-primary-end: #8e6326;
    --btn-secondary-start: #2d3748;
    --btn-secondary-end: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--cyan-900) 0%, var(--teal-900) 50%, var(--emerald-900) 100%);
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 48vw;
    height: 48vw;
    border-radius: 50%;
    filter: blur(70px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.45;
}

body::before {
    top: -16vw;
    right: -8vw;
    background: radial-gradient(circle, rgba(233, 210, 179, 0.85), rgba(233, 210, 179, 0));
    animation: driftCloudA 12s ease-in-out infinite alternate;
}

body::after {
    bottom: -18vw;
    left: -12vw;
    background: radial-gradient(circle, rgba(216, 195, 165, 0.85), rgba(216, 195, 165, 0));
    animation: driftCloudB 14s ease-in-out infinite alternate;
}

body.theme-dark::before {
    background: radial-gradient(circle, rgba(164, 122, 55, 0.28), rgba(164, 122, 55, 0));
}

body.theme-dark::after {
    background: radial-gradient(circle, rgba(87, 65, 34, 0.35), rgba(87, 65, 34, 0));
}

/* ===== Glassmorphism Components ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    padding: 1.5rem;
    color: var(--text-main);
}

.glass-card-sm {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 1rem;
    color: var(--text-main);
}

/* ===== Container ===== */
.container {
    max-width: 1460px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.container-fluid {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

/* ===== App Shell: Sidebar ===== */
.has-shell {
    padding-left: calc(var(--sidebar-width) + 1rem);
    padding-top: 0.9rem;
    transition: padding-left 0.25s ease;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 1200;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    box-shadow: 6px 0 20px rgba(58, 45, 22, 0.08);
    padding: 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: sidebarIn 0.35s ease-out;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 0.65rem;
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: linear-gradient(135deg, #ddc9ad, #cfae82);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2933;
}

.brand-logo-image {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.98);
    padding: 0.28rem;
    border: 1px solid rgba(140, 121, 90, 0.18);
    box-shadow: 0 6px 18px rgba(58, 45, 22, 0.08);
    flex: 0 0 auto;
}

.brand-logo-image-sidebar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    padding: 0.24rem;
}

.brand-logo-image-sm {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.sidebar-brand-title {
    font-size: 1.18rem;
    line-height: 1.2;
    font-weight: 700;
}

.sidebar-meta {
    font-size: 0.78rem;
    color: var(--text-soft);
    line-height: 1.35;
    margin-bottom: 0.9rem;
}

.sidebar-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.theme-toggle-card {
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.9rem;
}

.theme-toggle-label {
    font-size: 0.76rem;
    color: var(--text-soft);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
}

.theme-toggle-compact {
    margin-right: 0.1rem;
}

.theme-toggle-btn {
    border: none;
    min-width: 56px;
    height: 34px;
    padding: 0 0.85rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
}

.theme-toggle-btn.active {
    background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
    color: #fff;
    box-shadow: 0 6px 16px rgba(169, 120, 47, 0.24);
}

.theme-toggle-btn:not(.active):hover {
    color: var(--text-main);
    background: rgba(207, 161, 88, 0.12);
}

.sidebar-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.45rem 0.55rem;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(236, 223, 199, 0.96), rgba(216, 190, 146, 0.92));
    color: #493114;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 5px 14px rgba(169, 120, 47, 0.12);
}

.sidebar-shortcut:hover,
.sidebar-shortcut.active {
    background: linear-gradient(135deg, #d9b272, #b98436);
    color: #ffffff;
}

.sidebar-scroll {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.22rem;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.65) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.65);
    border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.75);
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.62rem 0.78rem;
    border-radius: 11px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 600;
    line-height: 1.2;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.nav-link:hover {
    background: rgba(216, 195, 165, 0.24);
    color: var(--text-main);
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #e9dcc8, #dcc5a3);
    color: #1b2730;
    box-shadow: 0 6px 14px rgba(136, 109, 73, 0.18);
}

.sidebar-branch-wrap {
    flex: 0 0 auto;
    padding-top: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-branch-wrap .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-soft);
}

body.theme-dark .sidebar,
body.theme-dark .mobile-topbar,
body.theme-dark .mobile-drawer,
body.theme-dark .theme-toggle,
body.theme-dark .theme-toggle-card,
body.theme-dark .sidebar-branch-wrap,
body.theme-dark .glass-card-sm,
body.theme-dark .product-card,
body.theme-dark .cart-item,
body.theme-dark .stat-card {
    background: rgba(15, 23, 34, 0.9);
}

body.theme-dark .sidebar {
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.32);
}

body.theme-dark .sidebar-brand-icon,
body.theme-dark .stat-icon {
    color: #fff;
    background: linear-gradient(135deg, #b78945, #7b5621);
}

body.theme-dark .sidebar-shortcut {
    background: linear-gradient(135deg, rgba(68, 52, 30, 0.95), rgba(128, 91, 41, 0.92));
    color: #f8e7cb;
}

body.theme-dark .sidebar-shortcut:hover,
body.theme-dark .sidebar-shortcut.active,
body.theme-dark .nav-link.active,
body.theme-dark .mobile-shortcut-btn.active {
    background: linear-gradient(135deg, #d0a05a, #926224);
    color: #fff;
}

body.theme-dark .nav-link:hover {
    background: rgba(212, 166, 95, 0.14);
}

.branch-switch-select {
    min-width: 100%;
    padding: 0.5rem 0.66rem;
    font-size: 0.9rem;
}

.mobile-topbar {
    display: none;
}

.mobile-drawer,
.mobile-drawer-overlay {
    display: none;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(169, 120, 47, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(169, 120, 47, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--btn-secondary-start), var(--btn-secondary-end));
    color: #3f2c12;
    box-shadow: 0 4px 14px rgba(199, 157, 91, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 24px rgba(199, 157, 91, 0.42);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #ead7b2, #cfa158);
    color: #3f2c12;
}

body.theme-dark .btn,
body.theme-dark .btn span {
    color: #f8fafc;
}

body.theme-dark .btn-primary,
body.theme-dark .btn-primary:hover,
body.theme-dark .btn-danger,
body.theme-dark .btn-danger:hover {
    color: #ffffff;
}

body.theme-dark .btn-secondary,
body.theme-dark .btn-secondary:hover {
    background: linear-gradient(135deg, #475569, #334155);
    color: #f8fafc;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
}

body.theme-dark .btn-success,
body.theme-dark .btn-success:hover {
    background: linear-gradient(135deg, #c9973f, #8e6326);
    color: #ffffff;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

body.theme-dark .form-control {
    background: rgba(15, 23, 34, 0.94);
    color: var(--text-main);
    border-color: rgba(214, 183, 125, 0.2);
}

.form-control::placeholder {
    color: #8a93a1;
}

body.theme-dark .form-control::placeholder {
    color: #7f8ea3;
}

.form-control:focus {
    outline: none;
    border-color: #d0b48d;
    box-shadow: 0 0 0 3px rgba(208, 180, 141, 0.25);
    background: #fff;
}

body.theme-dark .form-control:focus {
    background: rgba(15, 23, 34, 0.98);
    border-color: #d0a05a;
    box-shadow: 0 0 0 3px rgba(208, 160, 90, 0.18);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

/* ===== Grid System ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col {
    flex: 1;
    padding: 0.5rem;
}

.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ===== Product Cards ===== */
.product-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.32s ease;
    text-align: center;
}

.product-card:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-5px) scale(1.015);
    box-shadow: 0 10px 28px rgba(62, 48, 23, 0.16);
}

.product-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.product-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.product-price {
    color: #111827;
    font-size: 1.25rem;
    font-weight: bold;
}

/* ===== Cart Items ===== */
.cart-item {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-main);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #fff;
}

.quantity-display {
    min-width: 32px;
    text-align: center;
    font-weight: bold;
    color: var(--text-main);
}

/* ===== Tables ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: rgba(216, 195, 165, 0.25);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1f2933;
    border-bottom: 2px solid var(--glass-border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(160, 134, 95, 0.16);
    color: #222;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: rgba(216, 195, 165, 0.12);
}

body.theme-dark .table thead {
    background: rgba(212, 166, 95, 0.12);
}

body.theme-dark .table th {
    color: var(--text-main);
    border-bottom-color: rgba(214, 183, 125, 0.18);
}

body.theme-dark .table td {
    color: #e5e7eb;
    border-bottom-color: rgba(214, 183, 125, 0.12);
}

body.theme-dark .table tbody tr:hover {
    background: rgba(212, 166, 95, 0.08);
}

/* ===== Badges & Tags ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: linear-gradient(135deg, #d6ad67, #b88334);
    color: #fff;
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.badge-info {
    background: linear-gradient(135deg, #c9ab84, #ad8a5b);
    color: #fff;
}

/* ===== Stats Cards ===== */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(244, 236, 225, 0.9));
    backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(157, 128, 88, 0.26);
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ddc9ad, #cfae82);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.page-header {
    margin-bottom: 1.35rem;
}

.page-title {
    font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.45;
}

/* ===== Force Dark Text On Light Theme ===== */
.glass-card,
.glass-card p,
.glass-card span,
.glass-card strong,
.glass-card label,
.glass-card h1,
.glass-card h2,
.glass-card h3,
.glass-card h4,
.glass-card h5,
.glass-card h6,
.glass-card-sm,
.glass-card-sm p,
.glass-card-sm span,
.glass-card-sm strong,
.glass-card-sm label {
    color: var(--text-main);
}

.product-price,
#subtotalAmount,
#gstAmount,
#totalAmount,
#modalTotal,
#modalBreakdown,
#changeAmount,
#splitTotal {
    color: #111827 !important;
}

body.theme-dark .product-price,
body.theme-dark #subtotalAmount,
body.theme-dark #gstAmount,
body.theme-dark #totalAmount,
body.theme-dark #modalTotal,
body.theme-dark #modalBreakdown,
body.theme-dark #changeAmount,
body.theme-dark #splitTotal {
    color: #f8fafc !important;
}

#emptyCart,
.product-stock-text {
    color: var(--text-soft) !important;
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

body.theme-dark .alert-success {
    color: #bbf7d0;
}

body.theme-dark .alert-danger {
    color: #fecaca;
}

body.theme-dark .alert-warning {
    color: #fde68a;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 34, 21, 0.25);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(62, 48, 23, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9999;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

body.theme-dark .modal-overlay {
    background: rgba(3, 7, 18, 0.52);
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    :root {
        --navbar-space: var(--topbar-height);
    }

    .has-shell {
        padding-left: 0;
        padding-top: calc(var(--topbar-height) + 0.7rem);
    }

    .sidebar {
        display: none;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        height: var(--topbar-height);
        z-index: 1250;
        background: rgba(255, 255, 255, 0.94);
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 4px 12px rgba(58, 45, 22, 0.08);
        padding: 0.65rem 0.85rem;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        gap: 0.6rem;
    }

    .mobile-topbar-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-decoration: none;
        color: var(--text-main);
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .mobile-topbar-brand .sidebar-brand-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        font-size: 1rem;
    }

.mobile-topbar-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
    max-width: 72px;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.mobile-shortcut-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 0.6rem;
    border-radius: 10px;
    color: #493114;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid rgba(184, 145, 83, 0.2);
    transition: all 0.22s ease;
}

.mobile-shortcut-btn-filled {
    background: linear-gradient(135deg, #efdfc0, #d4ae6e);
    color: #4a2f0b;
    box-shadow: 0 6px 16px rgba(169, 120, 47, 0.18);
}

body.theme-dark .mobile-shortcut-btn-filled {
    background: linear-gradient(135deg, #4b3720, #915f23);
    color: #fff4df;
}

.mobile-shortcut-btn-filled:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(169, 120, 47, 0.24);
}

.mobile-shortcut-btn.active {
    background: linear-gradient(135deg, #c99546, #a77226);
    color: #ffffff;
    border-color: rgba(167, 114, 38, 0.35);
    box-shadow: 0 8px 18px rgba(167, 114, 38, 0.3);
}

.mobile-menu-icon-btn {
    min-width: 38px;
    width: 38px;
    height: 34px;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
}

    .theme-toggle-compact .theme-toggle-btn {
        min-width: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 0.72rem;
    }

body.theme-dark .mobile-menu-icon-btn {
    color: #e5e7eb;
}

    .mobile-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(25, 20, 13, 0.2);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
        z-index: 1290;
    }

    .mobile-drawer-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        background: rgba(255, 255, 255, 0.96);
        border-right: 1px solid var(--glass-border);
        box-shadow: 8px 0 24px rgba(58, 45, 22, 0.16);
        z-index: 1300;
        transform: translateX(-105%);
        transition: transform 0.26s ease;
        padding: 0.9rem 0.8rem;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .mobile-drawer.open {
        transform: translateX(0);
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.6rem;
    }

    .mobile-drawer-links {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        min-height: 0;
        flex: 1;
    }

    .mobile-drawer-links .nav-link {
        font-size: 0.95rem;
        padding: 0.68rem 0.78rem;
    }

    .mobile-branch-wrap {
        border-top: 1px solid var(--glass-border);
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }

    .mobile-branch-wrap .form-label {
        margin-bottom: 0.35rem;
        font-size: 0.82rem;
    }

    body.drawer-open {
        overflow: hidden;
    }
    
    .glass-card {
        padding: 1rem;
    }

    .container,
    .container-fluid {
        padding: 0.75rem;
    }
    
    .col-2, .col-3, .col-4, .col-6, .col-8, .col-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .product-icon {
        font-size: 2.5rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.55s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes driftCloudA {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-28px, 20px) scale(1.08); }
}

@keyframes driftCloudB {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(24px, -16px) scale(1.06); }
}

@keyframes sidebarIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes riseSoft {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card,
.stat-card,
.table-responsive {
    animation: riseSoft 0.45s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .sidebar,
    .mobile-topbar,
    .mobile-drawer,
    .mobile-drawer-overlay,
    .btn,
    .no-print {
        display: none !important;
    }

    .has-shell {
        padding-left: 0 !important;
        padding-top: 0 !important;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(201, 176, 141, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c9ab84, #dfcfb6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b69366, #d6c0a0);
}
