@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
    --primary: #303841;
    --primary-light: #F0F2F4;
    --secondary: #76ABAE;
    --secondary-light: #E8F3F4;
    --accent: #FF5722;
    --accent-light: #FFF0EB;
    --bg: #F5F5F5;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text-primary: #303841;
    --text-secondary: #6B7280;
    --success: #22C55E;
    --success-bg: #F0FDF4;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);
    --radius-btn: 12px;
    --radius-card: 18px;
    --radius-input: 14px;
    --radius-modal: 20px;
    --radius-bottom: 24px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.2s ease;
    --nav-height: 68px;
    --header-height: 60px;
    --page-transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --primary: #E5E7EB;
    --primary-light: #1F2937;
    --secondary: #76ABAE;
    --secondary-light: #1E3A3C;
    --accent: #FF5722;
    --accent-light: #3D1A0E;
    --bg: #0F172A;
    --surface: #1E293B;
    --border: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --success: #4ADE80;
    --success-bg: #052E16;
    --warning: #FBBF24;
    --warning-bg: #451A03;
    --danger: #F87171;
    --danger-bg: #450A0A;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.35);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --primary: #E5E7EB;
        --primary-light: #1F2937;
        --secondary: #76ABAE;
        --secondary-light: #1E3A3C;
        --accent: #FF5722;
        --accent-light: #3D1A0E;
        --bg: #0F172A;
        --surface: #1E293B;
        --border: #334155;
        --text-primary: #F1F5F9;
        --text-secondary: #94A3B8;
        --success: #4ADE80;
        --success-bg: #052E16;
        --warning: #FBBF24;
        --warning-bg: #451A03;
        --danger: #F87171;
        --danger-bg: #450A0A;
        --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
        --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
        --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
        --shadow-lg: 0 16px 40px rgba(0,0,0,0.35);
    }
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; color: var(--primary); }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--primary); }
h3 { font-size: 18px; font-weight: 600; color: var(--primary); }
p { font-size: 16px; color: var(--text-secondary); line-height: 1.6; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-secondary-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ============================
   BUTTON
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
}

/* Ripple effect */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.btn:active::after {
    opacity: 1;
    transition: opacity 0s;
}

.btn-outline::after { background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(48,56,65,0.1) 0%, transparent 60%); }
.btn-ghost::after { background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(48,56,65,0.1) 0%, transparent 60%); }

[data-theme="dark"] .btn-outline::after,
[data-theme="dark"] .btn-ghost::after { background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.12) 0%, transparent 60%); }

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #E64A19; }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #5E9EA0; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16A34A; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 32px; font-size: 18px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-icon { width: 48px; height: 48px; padding: 0; border-radius: var(--radius-btn); }

/* ============================
   INPUT
   ============================ */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block; margin-bottom: 6px;
    font-weight: 500; color: var(--text-primary);
    font-size: 14px;
}

.form-input {
    width: 100%; height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    font-family: var(--font); font-size: 16px;
    color: var(--text-primary); background: var(--surface);
    transition: var(--transition); outline: none;
}

.form-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(118, 171, 174, 0.12);
}

.form-input::placeholder { color: #9CA3AF; }

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    background-size: 20px; padding-right: 44px;
}

textarea.form-input { height: auto; padding: 14px 16px; min-height: 100px; }

/* ============================
   CARD
   ============================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title { font-size: 18px; font-weight: 600; color: var(--primary); }

.card-hover { transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============================
   STATS CARD
   ============================ */
.stats-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-card .stats-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}

.stats-card .stats-label {
    font-size: 14px; color: var(--text-secondary);
    margin-bottom: 4px; font-weight: 500;
}

.stats-card .stats-value {
    font-size: 26px; font-weight: 700;
    color: var(--primary); letter-spacing: -0.5px;
}

/* ============================
   TABLE
   ============================ */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }

th {
    text-align: left; padding: 14px 18px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; background: var(--bg);
}

td {
    padding: 14px 18px; font-size: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-light); }

.table-actions { display: flex; gap: 8px; }

/* ============================
   BADGE
   ============================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600; line-height: 1.4;
}

.badge-primary { background: var(--secondary-light); color: #3D7A7D; }
.badge-secondary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-danger { background: var(--danger-bg); color: #991B1B; }

/* ============================
   PAGE & HEADER
   ============================ */
/* ============================
   PAGE TRANSITION
   ============================ */
.page {
    padding-bottom: calc(var(--nav-height) + 16px);
    min-height: 100vh;
    display: flex; flex-direction: column;
    opacity: 0; transform: translateY(12px) scale(0.98);
    transition: opacity var(--page-transition), transform var(--page-transition);
    will-change: opacity, transform;
}

.page.page-loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stagger: anak-anak .page masuk bergantian */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page.page-loaded .card,
.page.page-loaded .stats-card,
.page.page-loaded .content-section,
.page.page-loaded .chart-container {
    animation: fadeSlideUp 0.4s ease both;
}

.page.page-loaded .stats-card:nth-child(1) { animation-delay: 0.05s; }
.page.page-loaded .stats-card:nth-child(2) { animation-delay: 0.1s; }
.page.page-loaded .stats-card:nth-child(3) { animation-delay: 0.15s; }
.page.page-loaded .stats-card:nth-child(4) { animation-delay: 0.2s; }
.page.page-loaded .content-section:nth-child(2) { animation-delay: 0.1s; }
.page.page-loaded .content-section:nth-child(3) { animation-delay: 0.15s; }
.page.page-loaded .content-section:nth-child(4) { animation-delay: 0.2s; }
.page.page-loaded .content-section:nth-child(5) { animation-delay: 0.25s; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    height: var(--header-height);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.page-header h1 { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ============================
   BOTTOM NAV
   ============================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 1000;
    height: var(--nav-height);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px; padding: 4px 16px;
    cursor: pointer; transition: var(--transition);
    color: #9CA3AF; text-decoration: none;
    font-size: 11px; font-weight: 500;
    min-width: 56px; position: relative;
}

.nav-item svg { width: 22px; height: 22px; transition: var(--transition); }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { stroke: var(--accent); stroke-width: 2.5; }
.nav-item:hover { color: var(--accent); }

/* ============================
   LOGIN PAGE
   ============================ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: var(--bg);
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--surface);
    border-radius: var(--radius-modal);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 28px; color: var(--primary); font-weight: 800; }
.login-logo p { color: var(--text-secondary); margin-top: 4px; }

.login-error {
    background: var(--danger-bg); color: #991B1B;
    padding: 14px 16px; border-radius: var(--radius-input);
    margin-bottom: 20px; font-size: 14px;
    display: none; font-weight: 500;
}

.login-error.show { display: block; }

/* ============================
   PRODUCT GRID (Kasir)
   ============================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px; padding: 16px 20px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 18px 14px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-card .product-image {
    width: 72px; height: 72px;
    object-fit: cover; border-radius: 12px;
    margin: 0 auto 10px;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}

.product-card .product-name {
    font-size: 14px; font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-primary);
}

.product-card .product-price {
    font-size: 16px; font-weight: 700;
    color: var(--primary);
}

.product-card .product-stock {
    font-size: 12px; color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================
   CART (Kasir)
   ============================ */
.cart-item {
    display: flex; align-items: center;
    gap: 12px; padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cart-item-price { font-size: 13px; color: var(--text-secondary); }

.cart-item-qty { display: flex; align-items: center; gap: 10px; }

.qty-btn {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 600;
    transition: var(--transition); color: var(--text-primary);
}

.qty-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: var(--secondary-light);
}

.qty-value { font-weight: 600; min-width: 24px; text-align: center; font-size: 15px; }

.cart-item-subtotal {
    font-weight: 700; color: var(--primary);
    text-align: right; white-space: nowrap; font-size: 14px;
}

.cart-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0;
    border-top: 2px solid var(--border);
    margin-top: 8px;
}

.cart-total-label { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.cart-total-value { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }

/* ============================
   MODAL
   ============================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(48, 56, 65, 0.4);
    z-index: 2000; display: none;
    align-items: flex-end; justify-content: center;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
    transition: background 0.3s ease;
}

[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }

.modal-overlay.show { display: flex; }

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-bottom) var(--radius-bottom) 0 0;
    width: 100%; max-width: 500px;
    max-height: 85vh; overflow-y: auto;
    animation: slideUp 0.25s ease;
    padding: 24px;
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 { font-size: 20px; color: var(--primary); }

.modal-close {
    background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: 50%;
    transition: var(--transition); color: var(--text-secondary);
}

.modal-close:hover { background: var(--bg); color: var(--primary); }

/* ============================
   SEARCH BAR
   ============================ */
.search-bar { position: relative; }
.search-bar input { padding-left: 44px; }

.search-bar .search-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary); pointer-events: none;
}

/* ============================
   FILTER CHIPS
   ============================ */
.filter-chips {
    display: flex; gap: 8px;
    overflow-x: auto; padding: 12px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
    padding: 8px 18px; border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    white-space: nowrap; color: var(--text-secondary);
    font-family: var(--font); height: 36px;
}

.filter-chip:hover, .filter-chip.active {
    background: var(--accent);
    color: white; border-color: var(--accent);
}

/* ============================
   PAYMENT CHIP
   ============================ */
.payment-chip {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 20px;
    border-radius: var(--radius-btn);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    font-family: var(--font); flex: 1; min-height: 48px;
}

.payment-chip:hover { border-color: var(--secondary); background: var(--secondary-light); }

.payment-chip.active { background: var(--secondary); color: white; border-color: var(--secondary); }
.payment-chip.active svg { stroke: white; }
.payment-chip svg { stroke: var(--secondary); }

/* ============================
   TOAST
   ============================ */
#toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-input);
    padding: 14px 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    min-width: 280px; max-width: 400px;
    animation: slideIn 0.25s ease, fadeOut 0.3s ease 3.2s forwards;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

.toast-icon { width: 22px; height: 22px; flex-shrink: 0; }
.toast-message { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* ============================
   PAYMENT MODAL
   ============================ */
.payment-amount {
    font-size: 32px; font-weight: 800;
    text-align: center; color: var(--accent);
    margin: 16px 0; letter-spacing: -1px;
}

.payment-input {
    font-size: 24px !important; text-align: center;
    font-weight: 700 !important; height: 56px !important;
    letter-spacing: 1px;
}

.change-amount {
    font-size: 24px; font-weight: 700;
    text-align: center; padding: 16px;
    border-radius: var(--radius-input); margin-top: 12px;
}

.change-positive { background: var(--success-bg); color: #166534; }
.change-negative { background: var(--danger-bg); color: #991B1B; }

/* ============================
   RECEIPT
   ============================ */
.receipt { background: var(--surface); padding: 24px; max-width: 320px; margin: 0 auto; font-size: 13px; }

.receipt-header { text-align: center; border-bottom: 1px dashed var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.receipt-header h2 { font-size: 18px; color: var(--primary); }

.receipt-items { margin-bottom: 12px; }
.receipt-item { display: flex; justify-content: space-between; padding: 4px 0; }

.receipt-total { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 12px; }
.receipt-total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }

.receipt-footer { text-align: center; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 12px; font-size: 12px; color: var(--text-secondary); }

/* ============================
   CHART
   ============================ */
.chart-container {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 22px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.chart-container h3 { margin-bottom: 16px; font-size: 16px; color: var(--primary); }

/* ============================
   FAB
   ============================ */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: white;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    z-index: 1001;
}

.fab:hover { background: #E64A19; transform: scale(1.08); box-shadow: var(--shadow-lg); }
.fab svg { width: 24px; height: 24px; }

/* ============================
   CART FAB
   ============================ */
.cart-fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--accent); color: white;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    z-index: 100;
}

.cart-fab:hover { background: #E64A19; transform: scale(1.08); }

.cart-fab-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger); color: white;
    font-size: 11px; font-weight: 700;
    min-width: 22px; height: 22px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ============================
   KASIR LAYOUT
   ============================ */
.kasir-layout { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.kasir-search {
    padding: 12px 20px;
    position: sticky; top: var(--header-height);
    z-index: 50; background: var(--bg);
}

.kasir-products { flex: 1; overflow-y: auto; padding-bottom: calc(var(--nav-height) + 80px); }
.kasir-cart { max-height: 40vh; overflow-y: auto; }

/* ============================
   EMPTY STATE
   ============================ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }

.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; }

/* ============================
   SKELETON
   ============================ */
.skeleton {
    background: linear-gradient(90deg, var(--primary-light) 25%, var(--border) 50%, var(--primary-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.skeleton-card { height: 120px; margin-bottom: 12px; border-radius: var(--radius-card); }
.skeleton-text { height: 16px; margin-bottom: 10px; width: 80%; }
.skeleton-text-short { height: 16px; margin-bottom: 10px; width: 40%; }

/* ============================
   DATE FILTER
   ============================ */
.date-filter { display: flex; gap: 8px; align-items: center; }

.date-filter input[type="date"] {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-input);
    font-family: var(--font); font-size: 14px;
    color: var(--text-primary); background: var(--surface);
    outline: none; transition: var(--transition);
    height: 44px;
}

.date-filter input[type="date"]:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(118, 171, 174, 0.12);
}

/* ============================
   MODERN DATE FILTER
   ============================ */
.date-filter-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 16px;
    background: #303841;
    border: 1.5px solid rgba(255,255,255,.08);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    min-height: 48px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.date-filter-trigger:active {
    transform: scale(0.97);
}

.date-filter-trigger:hover {
    border-color: rgba(255,255,255,.15);
}

.date-filter-icon {
    color: #76ABAE;
    flex-shrink: 0;
}

.date-filter-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #F5F5F5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.date-filter-chevron {
    color: rgba(255,255,255,.45);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.date-filter-trigger:active .date-filter-chevron {
    transform: translateY(2px);
}

/* Date Range Bottom Sheet */
.date-range-modal {
    padding: 24px;
    max-width: 420px;
}

.date-range-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.date-range-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-range-body {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 28px;
}

.date-field {
    flex: 1;
}

.date-field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.date-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.date-field-input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.date-field-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(118, 171, 174, 0.12);
}

.date-field-input::-webkit-calendar-picker-indicator {
    opacity: 0.4;
    cursor: pointer;
    padding: 4px;
}

.date-range-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    min-width: 28px;
}

.date-range-divider svg {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ============================
   CONTAINER
   ============================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.content-section { padding: 16px 20px; }

/* ============================
   STATS GRID
   ============================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 16px 20px;
}

/* ============================
   SECTION TITLE
   ============================ */
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--text-primary); }

/* ============================
   RESPONSIVE
   ============================ */
@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 20px 24px; }
    .modal { border-radius: var(--radius-modal); margin: auto; }
    .modal-overlay { align-items: center; }
}

@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 420px) {
    .stats-grid { gap: 10px; padding: 12px 16px; }
    .stats-card .stats-value { font-size: 22px; }
    .content-section { padding: 12px 16px; }
}

/* ============================
   PRINT
   ============================ */
@media print {
    body * { visibility: hidden; }
    .receipt, .receipt * { visibility: visible; }
    .receipt { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
    .bottom-nav, .page-header, .fab, .cart-fab { display: none; }
}
