/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0a0d16;
    --bg-secondary: #121622;
    --bg-card: #151a28;
    --bg-hover: #1e2538;
    --accent: #e2e8f0;
    --accent-light: #f8fafc;
    --accent-dark: #cbd5e1;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #263045;
    --border-light: #334155;
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --radius: 4px;
    --radius-lg: 6px;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
    --transition: 0.15s ease-in-out;
}

.font-mono {
    font-family: 'JetBrains Mono', 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    font-size: 15px;
    scroll-behavior: smooth;
}
/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.25); }
body {
    font-family: "DM Sans", system-ui, sans-serif;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.04) 0%, transparent 60%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--text-primary);
}

/* ===== LAYOUT ===== */
/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh; /* excludes Android/iOS nav bar so logout button stays reachable */
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

body.sidebar-open #sidebar-backdrop {
    display: block;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}
.brand-icon {
    background: var(--text-primary);
    color: var(--bg-primary);
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}
.user-avatar {
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 0;
    background: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}
.user-info {
    transition: opacity 0.2s ease;
    min-width: 0;
    overflow: hidden;
}
.user-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 1px;
    text-transform: capitalize;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
    text-decoration: none;
    position: relative;
    border-left: 2px solid transparent;
}
.nav-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-left: 2px solid var(--text-primary);
}
.nav-icon {
    min-width: 20px; width: 20px; height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.18s ease;
    display: flex; align-items: center; justify-content: center;
}
.nav-item:hover .nav-icon { color: var(--text-secondary); }
.nav-item.active .nav-icon { color: var(--accent-light); }
.nav-text { transition: opacity 0.2s ease; }

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-footer .nav-item {
    color: #94a3b8;
}
.sidebar-footer .nav-item:hover {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}
.sidebar-footer .nav-item:hover .nav-icon { color: #f87171; }

.main-content {
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== SIDEBAR TOGGLE (di dalam topbar) ===== */
.btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}
.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}
.btn-sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

/* ===== MOBILE FAB MENU BUTTON (visible on tablet/phone when sidebar closed) ===== */
.btn-mobile-menu-fab {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 95;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.btn-mobile-menu-fab:hover {
    background: var(--bg-hover);
    color: var(--accent-light);
    border-color: rgba(99, 102, 241, 0.4);
}
.btn-mobile-menu-fab:active {
    transform: scale(0.96);
}
.btn-mobile-menu-fab svg {
    width: 20px;
    height: 20px;
}
body.sidebar-open .btn-mobile-menu-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

/* ===== SIDEBAR CLOSE BUTTON (visible on all sizes) ===== */
.btn-sidebar-close {
    display: inline-flex;
    margin-left: auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}
.btn-sidebar-close:hover {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border-color: rgba(239,68,68,0.3);
}
.btn-sidebar-close svg {
    width: 18px;
    height: 18px;
}


.topbar {
    height: var(--topbar-height);
    padding: 0 28px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.03em;
}
.content-wrapper {
    padding: 24px 28px;
    /* extra bottom clears Android/iOS nav bar so last row is never obscured */
    padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 20px));
    flex: 1;
    width: 100%;
}

/* =====================================================
   SHARED PAGE TOOLBAR (untuk konsistensi semua halaman list)
   ===================================================== */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.page-toolbar form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

/* Search input — pakai di semua halaman */
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}
.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.search-input-wrap input[type="search"],
.search-input-wrap input[type="text"] {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px 10px 38px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Filter pill — konsisten untuk dropdown/filter di toolbar */
.filter-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    position: relative;
    transition: border-color var(--transition);
    height: 40px;
}
.filter-pill:hover {
    border-color: var(--border-light);
}
.filter-pill > i,
.filter-pill > svg {
    color: var(--text-muted);
    flex-shrink: 0;
}
.filter-pill .filter-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.filter-pill select {
    appearance: none;
    background: transparent;
    border: none;
    padding: 8px 24px 8px 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}
.filter-pill .filter-chevron {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Page toolbar variant: filter chips/badges */
.toolbar-chips {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.toolbar-chips .btn-sm {
    border-radius: 8px;
}

/* Card header reused-shared style */
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

/* Bulk actions strip below toolbar — konsisten di semua list pages */
.bulk-actions {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

/* =====================================================
   ULTRA-WIDE SCREENS (≥ 1600px)
   Padding scales sehingga content tidak terlalu lebar di
   monitor besar (mis: 2560×1600, 4K). Topbar + content
   menggunakan padding yang sama supaya selalu sejajar.
   ===================================================== */
@media (min-width: 1600px) {
    .content-wrapper {
        padding: 32px max(36px, calc((100% - 1600px) / 2 + 36px));
    }
    .topbar {
        padding-left: max(28px, calc((100% - 1600px) / 2 + 28px));
        padding-right: max(28px, calc((100% - 1600px) / 2 + 28px));
    }
    .stats-grid {
        gap: 24px;
    }
    .page-title {
        font-size: 1.6rem;
    }
}

/* 2K & 4K monitors (≥ 1920px) */
@media (min-width: 1920px) {
    html { font-size: 16px; }
    .content-wrapper {
        padding: 36px max(40px, calc((100% - 1720px) / 2 + 40px));
    }
    .topbar {
        padding-left: max(32px, calc((100% - 1720px) / 2 + 32px));
        padding-right: max(32px, calc((100% - 1720px) / 2 + 32px));
    }
}

/* ===== ALERTS (TOASTS) ===== */
.alert-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    animation: toastSlideIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275)
        forwards;
    max-width: 360px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}
.alert-success {
    background: var(--bg-card);
    color: var(--success);
    border: 1px solid var(--success);
}
.alert-error {
    background: var(--bg-card);
    color: var(--danger);
    border: 1px solid var(--danger);
}
/* Progress bar at bottom of toast */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.35);
    animation: toastProgress 4s linear forwards;
    animation-play-state: paused;
    transform-origin: left;
}
@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}
@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
    overflow: hidden;
    transition: border-color var(--transition);
}
.card:hover {
    border-color: var(--text-muted);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    display: none;
}
.stat-card:hover {
    border-color: var(--text-muted);
}
.stat-card:hover::before {
    display: none;
}
.stat-card.stat-alert { border-color: var(--warning); }
.stat-card.stat-alert::before { display: none; }
.stat-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: var(--radius);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: color 0.2s ease;
}
.stat-card:hover .stat-icon {
    color: var(--accent-light);
    border-color: var(--text-muted);
}
.stat-alert .stat-icon {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.2);
    color: var(--warning);
}
.stat-icon-warn { color: var(--warning) !important; }
.stat-info { flex: 1; min-width: 0; }
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-all;
    font-family: 'JetBrains Mono', 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* kasir avatar in dashboard table */
.kasir-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kasir-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    color: #cbd5e1;
    flex-shrink: 0;
}

/* ===== TABLE ===== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}
.table thead th {
    background: var(--bg-primary);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 20px;
    text-align: left;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    color: var(--text-secondary);
    transition: background 0.15s ease;
}
.table tbody tr {
    transition: background 0.15s ease;
}
.table tbody tr:hover td {
    background: rgba(99,102,241,0.03);
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table .row-alert td {
    background: rgba(245, 158, 11, 0.05);
}
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge-success, .badge-active, .badge-qris { border-color: var(--success); color: var(--success); }
.badge-danger, .badge-expired { border-color: var(--danger); color: var(--danger); }
.badge-warning, .badge-trial, .badge-transfer { border-color: var(--warning); color: var(--warning); }
.badge-cash { border-color: var(--text-primary); color: var(--text-primary); }
.badge-role-superadmin { border-color: var(--danger); color: var(--danger); }
.badge-role-owner { border-color: var(--accent); color: var(--accent); }
.badge-role-manager { border-color: var(--success); color: var(--success); }
.badge-role-cashier { border-color: var(--warning); color: var(--warning); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    font-family: inherit;
    text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--text-secondary); }
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-light);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-info { background: #3b82f6; color: white; }
.btn-info:hover:not(:disabled) { background: #2563eb; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; border-radius: var(--radius); }
.btn-icon { padding: 8px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; }
.btn-full { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 20px;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.form-inline {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.page-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-form input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}
.search-form input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.section-title::before {
    display: none;
}

/* ===== AUTH ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg-primary);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: none;
}
.auth-header {
    text-align: left;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 16px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.brand-icon {
    background: var(--text-primary);
    color: var(--bg-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
    margin-bottom: 0;
}
.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-card .btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    transition: background 0.2s;
}
.auth-card .btn-primary:hover {
    transform: none;
    box-shadow: none;
    background: var(--text-muted);
}

/* ===== POS LAYOUT ===== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 110px);
}
.pos-products {
    overflow-y: auto;
    padding-right: 4px;
}
.search-bar {
    margin-bottom: 16px;
}
.search-bar input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.product-card:hover {
    border-color: var(--accent-light);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
}
.product-card.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.product-card-icon {
    color: var(--accent-light);
    opacity: 0.65;
}
.product-name {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 3px;
    line-height: 1.3;
}
.product-sku {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 4px;
}
.product-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-light);
    letter-spacing: -0.01em;
}
.product-stock-row {
    margin-top: 6px;
}
.product-stock {
    font-size: 0.73rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.stock-low {
    color: var(--warning) !important;
    font-weight: 600;
}
.out-of-stock-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
}

/* ===== POS CART ===== */
.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
.cart-title {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.05);
}
.cart-count-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
}
.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.cart-empty {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
    border-radius: 8px;
    padding: 10px 8px;
    margin: 2px 0;
}
.cart-item:hover {
    background: rgba(255, 255, 255, 0.025);
}
.cart-item-info {
    flex: 1;
    min-width: 0;
}
.cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.cart-item-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Minus button - red tint */
.qty-btn {
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.qty-minus {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}
.qty-minus:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: var(--danger);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
/* Plus button - green tint */
.qty-plus {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}
.qty-plus:hover {
    background: rgba(16, 185, 129, 0.85);
    border-color: var(--success);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.qty-val {
    font-weight: 800;
    min-width: 28px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--bg-hover);
    border-radius: 6px;
    padding: 2px 4px;
    color: var(--text-primary);
}
.cart-item-subtotal {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--accent-light);
    white-space: nowrap;
}
.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.remove-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.cart-summary {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.summary-row strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-light);
    letter-spacing: -0.02em;
}

.payment-section {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-section label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.payment-section select,
.payment-section input[type="number"] {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s ease;
}
.payment-section select:focus,
.payment-section input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.change-display {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ===== RECEIPT ===== */
.receipt-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.receipt {
    background: white;
    color: #111;
    width: 300px;
    padding: 20px;
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 0.85rem;
}
.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}
.receipt-header h2 {
    font-size: 1.1rem;
}
.receipt-meta p {
    margin: 2px 0;
}
.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.receipt-table th,
.receipt-table td {
    padding: 4px 0;
}
.receipt-table th {
    border-bottom: 1px dashed #ccc;
}
.receipt-total {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-weight: bold;
}
.receipt-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #666;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== ERROR PAGE ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page h1 {
    font-size: 5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.error-page p {
    color: var(--text-muted);
    margin: 12px 0 24px;
    font-size: 1.1rem;
}

/* ===== FILTER FORM ===== */
.filter-form {
    margin-bottom: 24px;
}
.filter-select {
    appearance: none;
    -webkit-appearance: none;
}
.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}
.filter-badges a {
    transition: all var(--transition);
}
.card-header {
    flex-wrap: wrap;
}

/* ===== TABLE RESPONSIVE WRAPPER ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    .pos-cart {
        max-height: 400px;
    }
}

/* =====================================================
   SIDEBAR BACKDROP (overlay for tablet/mobile)
   ===================================================== */
#sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
body.sidebar-open #sidebar-backdrop {
    opacity: 1;
}

/* =====================================================
   TABLET + MOBILE (≤1024px)
   ===================================================== */
@media (max-width: 1024px) {
    .content-wrapper {
        padding: 20px;
        padding-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    }

    /* Tablet stats: 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Table improvements */
    .table th,
    .table td {
        padding: 12px 12px;
        font-size: 0.86rem;
    }
    .table th {
        font-size: 0.76rem;
    }
}

/* =====================================================
   PHONE PORTRAIT + small tablets (≤768px)
   ===================================================== */
@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 56px;
        padding: 0 12px;
    }
    .content-wrapper {
        padding: 16px;
        padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    }
    .page-title {
        font-size: 1.2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-value {
        font-size: 1.3rem;
    }

    .table {
        font-size: 0.85rem;
    }
    .table thead th,
    .table tbody td {
        padding: 12px 10px;
        min-width: 120px;
    }
    .table th:first-child,
    .table td:first-child {
        min-width: 40px;
    }

    .pagination {
        justify-content: center;
        flex-direction: column;
        gap: 8px;
    }

    /* Better touch targets — nav items saja; tombol header & filter diatur terpisah */
    .nav-item {
        min-height: 44px;
    }
    input,
    select,
    textarea {
        font-size: 16px !important;
    } /* Prevent iOS zoom */

    /* Mobile FAB sizing */
    .btn-mobile-menu-fab {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    .btn-mobile-menu-fab svg {
        width: 20px;
        height: 20px;
    }
}

/* =====================================================
   PHONE LANDSCAPE (height ≤ 500px, any orientation)
   ===================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .topbar {
        height: 52px;
        min-height: 52px;
        padding: 0 16px;
    }
    .page-title {
        font-size: 1.1rem;
    }
    .content-wrapper {
        padding: 14px 16px;
        padding-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 10px));
    }
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    .stat-icon {
        width: 38px;
        height: 38px;
    }
    .stat-value {
        font-size: 1.15rem;
    }
    .stat-label {
        font-size: 0.68rem;
        margin-bottom: 3px;
    }
    .section-title {
        margin: 16px 0 8px;
        font-size: 0.92rem;
    }
    /* Compact sidebar drawer in landscape */
    .sidebar {
        width: 260px;
    }
    .sidebar-brand {
        padding: 14px 16px;
    }
    .sidebar-user {
        padding: 10px 12px;
        margin: 8px 10px;
    }
    .nav-item {
        padding: 8px 12px;
        min-height: 40px;
    }
    .btn-mobile-menu-fab {
        top: 8px;
        left: 8px;
        width: 38px;
        height: 38px;
    }
}

/* =====================================================
   VERY SMALL PHONES (≤480px portrait)
   ===================================================== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .auth-card {
        padding: 24px;
        margin: 16px;
    }
    .table thead th,
    .table tbody td {
        padding: 10px 8px;
    }
}

/* =====================================================
   SPACING & RESPONSIVENESS IMPROVEMENTS
   ===================================================== */

/* ── Section title margin pada mobile ─────────────── */
@media (max-width: 768px) {
    .section-title { margin: 16px 0 10px; }
}
@media (max-width: 480px) {
    .section-title { margin: 12px 0 8px; }
}

/* ── Card body padding responsif ──────────────────── */
.card-body { padding: 20px; }
@media (max-width: 1024px) {
    .card-body { padding: 16px; }
}
@media (max-width: 768px) {
    .card-body { padding: 14px; }
}
@media (max-width: 480px) {
    .card-body { padding: 12px; }
}

/* ── Page toolbar wrap di mobile ──────────────────── */
@media (max-width: 768px) {
    .page-toolbar { gap: 8px; padding: 10px 14px; }
    .search-input-wrap { min-width: 100%; max-width: 100%; }
}

/* ── Stats grid gap konsisten ─────────────────────── */
@media (max-width: 768px) {
    .stats-grid { gap: 14px; }
}

/* ── Pagination wrap di mobile kecil ─────────────── */
@media (max-width: 480px) {
    .pagination-controls { flex-wrap: wrap; justify-content: center; gap: 6px; }
    .pagination-btn { min-width: 36px; height: 36px; padding: 0; font-size: 0.85rem; }
}

/* ── Table min-width kurang ketat di mobile ────────── */
@media (max-width: 480px) {
    .table thead th,
    .table tbody td { min-width: 80px; padding: 10px 8px; }
    .table th:first-child,
    .table td:first-child { min-width: 36px; }
}

/* =====================================================
   TABLET PORTRAIT & LANDSCAPE — Specific Improvements
   Target: 640–1024px (typical Android/iPad tablet)
   ===================================================== */

/* ── Tablet portrait (640–768px) ─────────────────────
   Override the ≤768px "64px left topbar padding" yang
   dibuat untuk FAB mobile — pada tablet portrait, sidebar
   toggle sudah ada di topbar jadi tidak perlu extra indent.
   ─────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 768px) {
    .topbar {
        height: var(--topbar-height);
        min-height: var(--topbar-height);
        padding: 0 20px;
    }
    .content-wrapper {
        padding: 16px;
        padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    }
}

/* ── Table kolom lebih compact di tablet portrait ────
   Mengurangi min-width dari 120px → 88px agar tabel
   7-8 kolom tidak overflow di viewport 640–768px.
   (7 × 88px = 616px, muat di 640px - 32px padding = 608px)
   ─────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 1024px) {
    .table {
        font-size: 0.82rem;
    }
    .table thead th,
    .table tbody td {
        padding: 10px 8px;
        min-width: 88px;
    }
    .table th:first-child,
    .table td:first-child {
        min-width: 36px;
    }
    /* Action buttons kompak */
    .table .btn-sm {
        padding: 5px 8px;
        font-size: 0.76rem;
        gap: 4px;
    }
    .table .actions { gap: 6px; }
}

/* ── Filter pills & toolbar wrap di tablet ───────────
   Pastikan filter-pill wrap ke baris baru alih-alih
   membuat toolbar overflow secara horizontal.
   ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .page-toolbar form {
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter-pill {
        flex: 1 1 140px;
        min-width: 140px;
    }
    .toolbar-chips {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* ── Tablet landscape (769–1024px) tweaks ────────────
   Layar lebih lebar: tabel dapat sedikit lebih besar,
   grid stats bisa 4 kolom jika tersedia ruang.
   ─────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-wrapper {
        padding: 16px 20px;
        padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    }
    .table thead th,
    .table tbody td {
        padding: 10px 10px;
        min-width: 100px;
    }
    .table { font-size: 0.84rem; }
    /* 3-kolom stats jika cukup lebar */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Tablet portrait: halaman form tetap usable ──────
   Form grid 2-kolom di ≥640px hingga <768px portrait
   (pada 768px sudah collapse ke 1-kolom dari rule global)
   ─────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 768px) {
    /* Card form max-width tidak terlalu lebar */
    .card { max-width: 100%; }
    /* Form grid: 1 kolom di portrait tablet */
    .form-grid { grid-template-columns: 1fr; }
    .form-group[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
    /* stat-card padding kompak */
    .stat-card { padding: 14px 16px; }
    .stat-value { font-size: 1.25rem; }
    /* Page actions wrap di tablet portrait */
    .page-actions { flex-wrap: wrap; gap: 8px; }
    .page-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Dashboard: payment breakdown card lebih kecil ── */
@media (max-width: 1024px) {
    .section-title { font-size: 0.95rem; }
    /* Dashboard table compact */
    .dashboard-table th,
    .dashboard-table td { padding: 10px 10px; font-size: 0.82rem; }
}

/* =====================================================
   SKELETON LOADING
   ===================================================== */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.skeleton-box {
    background: linear-gradient(90deg, #1a2135 25%, #263045 50%, #1a2135 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
.skeleton-stat {
    height: 88px;
    border-radius: 16px;
}
.skeleton-row {
    display: grid;
    grid-template-columns: 36px 1fr 1.5fr 1fr 80px;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    align-items: center;
}
.skeleton-row .sk { height: 14px; border-radius: 4px; }

/* ── Page-transition overlay ── */
.page-skeleton-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: var(--bg-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.page-skeleton-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.page-skeleton-content {
    padding: calc(var(--topbar-height) + 28px) 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.page-skeleton-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 14px;
    z-index: 9991;
}
.page-skeleton-topbar .sk-title {
    height: 22px; width: 120px; border-radius: 6px;
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide sidebar, topbar, buttons, and other UI elements */
    .sidebar,
    .topbar,
    .page-actions,
    .btn,
    .alert,
    .pagination,
    .btn-sidebar-toggle,
    .btn-mobile-menu-fab,
    .btn-sidebar-close,
    #sidebar-backdrop,
    .sidebar-footer {
        display: none !important;
    }

    /* Reset layout to allow receipt to show */
    body,
    html {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        width: 100% !important;
    }

    .sidebar,
    .topbar,
    .page-actions,
    .btn-sidebar-toggle,
    .btn-mobile-menu-fab,
    .btn-sidebar-close {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    .receipt-wrapper {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        background: white !important;
    }

    .receipt {
        width: 100% !important;
        max-width: 58mm !important; /* Standard narrow thermal paper */
        margin: 0 auto !important;
        padding: 2mm !important;
        box-shadow: none !important;
        border: none !important;
        color: black !important;
        background: white !important;
        visibility: visible !important;
        font-size: 10pt !important;
        font-family: "Courier New", Courier, monospace !important;
    }

    .receipt * {
        color: black !important;
        background: transparent !important;
    }

    .divider {
        text-align: center;
        margin: 5px 0;
        letter-spacing: -1px;
    }

    .meta-row,
    .receipt-total {
        display: flex;
        justify-content: space-between;
        font-size: 9pt;
    }

    .receipt-header h2 {
        font-size: 14pt !important;
        margin-bottom: 5px;
    }

    .receipt-type {
        font-weight: bold;
        font-size: 10pt;
        margin: 5px 0;
    }

    .receipt-table {
        width: 100%;
        margin: 10px 0;
    }

    .item-name {
        font-weight: bold;
        padding-top: 5px;
    }

    .price-row td {
        font-size: 9pt;
        padding-bottom: 5px;
    }

    .item-subtotal {
        text-align: right;
    }

    @page {
        margin: 0;
    }
}

/* ===== ACCESSIBILITY & MOBILE OVERLAY ===== */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.15s ease;
}
.skip-to-content:focus {
    top: 8px;
}

#sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}
body.sidebar-open #sidebar-backdrop {
    display: block;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =====================================================
   PHONE ONLY (≤639px) — topbar & header-actions fixes
   Hanya berlaku di layar phone portrait; tablet (≥640px)
   tidak terpengaruh karena min-width:640px override.
   ===================================================== */
@media (max-width: 639px) {
    /* Hamburger lebih kecil dan merapat ke kiri */
    .btn-sidebar-toggle {
        width: 32px;
        height: 32px;
        min-height: 32px;
    }
    .btn-sidebar-toggle svg {
        width: 16px;
        height: 16px;
    }

    /* Header action buttons kompak agar judul tidak terpotong */
    .header-actions .btn {
        padding: 6px 11px;
        font-size: 0.78rem;
        min-height: 36px;
        gap: 5px;
    }
    .header-actions .btn svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }
    .header-actions {
        gap: 6px;
    }

    /* Filter pills di page-toolbar lebih tipis */
    .filter-pill {
        height: 36px;
        padding: 0 10px;
    }
    .filter-pill .filter-label {
        font-size: 0.78rem;
    }
    .filter-pill select {
        font-size: 0.78rem;
        padding: 6px 20px 6px 4px;
    }

    /* Toolbar chips (Cash / QRIS / Transfer) tidak terlalu tinggi */
    .toolbar-chips .btn-sm,
    .page-toolbar .btn-sm {
        padding: 5px 10px;
        font-size: 0.76rem;
        min-height: 32px;
    }

    /* Kurangi gap & padding toolbar agar tidak terlalu longgar */
    .page-toolbar {
        gap: 6px;
        padding: 8px 12px;
    }
    .page-toolbar form {
        gap: 6px;
    }

    /* topbar-left gap lebih sempit */
    .topbar-left {
        gap: 10px;
    }
}
