/* ============================================================
   WarungPOS - Main Stylesheet
   Mobile-First, PWA-Ready
   ============================================================ */

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8C5A;
    --primary-soft: rgba(255, 107, 53, 0.12);

    --secondary: #1a1a2e;
    --secondary-mid: #16213e;
    --secondary-light: #0f3460;

    --accent: #f5a623;
    --accent-green: #27ae60;
    --accent-red: #e74c3c;
    --accent-blue: #3498db;
    --accent-purple: #9b59b6;

    --bg-app: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-alt: #fafafa;
    --bg-sidebar: #1a1a2e;

    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    --border: #e5e7eb;
    --border-focus: var(--primary);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

    --header-h: 56px;
    --bottom-nav-h: 64px;
    --sidebar-w: 280px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* ── App Shell ── */
#app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top Header ── */
.top-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 150;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
    width: 36px; height: 36px;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 5px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    transition: background var(--transition);
}
.menu-toggle:active { background: rgba(255,255,255,0.15); }
.menu-toggle span {
    display: block; width: 18px; height: 2px;
    background: #fff; border-radius: 2px;
    transition: var(--transition);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 22px; }
.brand-name {
    font-size: 17px; font-weight: 800;
    color: #fff; letter-spacing: -0.3px;
}
.header-right {}
.user-chip {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    padding: 4px 12px 4px 4px;
}
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.user-name-short { color: #fff; font-size: 13px; font-weight: 600; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--secondary);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }
.sidebar-header { padding: 16px; padding-top: calc(env(safe-area-inset-top) + 16px); border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff; font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-weight: 700; font-size: 15px; }
.sidebar-user-role {
    color: var(--primary-light); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section { margin-bottom: 8px; }
.nav-section-label {
    padding: 8px 16px 4px;
    font-size: 10px; font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px;
    color: rgba(255,255,255,0.7);
    font-size: 14px; font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.nav-item:active, .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-light);
    border-left-color: var(--primary);
}
.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-btn { border-radius: var(--radius-sm); color: rgba(255,100,100,0.8) !important; }
.logout-btn:hover { background: rgba(255,100,100,0.1) !important; color: #ff6b6b !important; }

/* ── Main Content ── */
.main-content {
    margin-top: var(--header-h);
    margin-bottom: var(--bottom-nav-h);
    padding: 16px;
    flex: 1;
    max-width: 100%;
    min-height: calc(100vh - var(--header-h) - var(--bottom-nav-h));
    position: relative;
    z-index: 1;
}

/* ── Bottom Nav ── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.3px;
    transition: color var(--transition);
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-icon { font-size: 20px; }

/* ── Page Header ── */
.page-header {
    margin-bottom: 20px;
}
.page-title {
    font-size: 22px; font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.card-title {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
}
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--stat-color, var(--primary));
}
.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}
.stat-value {
    font-size: 18px; font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}
.stat-label {
    font-size: 11px; font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 700;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}
.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 4px 14px rgba(255,107,53,0.35);
}
.btn-primary:active { background: var(--primary-dark); transform: scale(0.98); }
.btn-secondary { background: var(--bg-app); color: var(--text-primary); }
.btn-secondary:active { background: var(--border); }
.btn-success { background: var(--accent-green); color: #fff; box-shadow: 0 4px 14px rgba(39,174,96,0.3); }
.btn-danger { background: var(--accent-red); color: #fff; box-shadow: 0 4px 14px rgba(231,76,60,0.3); }
.btn-outline {
    border: 2px solid var(--primary); color: var(--primary); background: transparent;
}
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 14px 24px; font-size: 16px; min-height: 52px; }
.btn-full { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px; font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    min-height: 48px;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control::placeholder { color: var(--text-muted); font-weight: 400; }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--accent-red); margin-top: 4px; }
.input-group { position: relative; }
.input-prefix {
    position: absolute; left: 0; top: 0; bottom: 0;
    display: flex; align-items: center;
    padding: 0 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-right: 2px solid var(--border);
    pointer-events: none;
}
.input-group .form-control { padding-left: 56px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    padding: 10px 12px;
    text-align: left; font-weight: 700;
    color: var(--text-secondary); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--bg-app);
    border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-alt); }

/* ── Badges ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }

/* ── List Items ── */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    background: var(--bg-app);
}
.list-content { flex: 1; min-width: 0; }
.list-title {
    font-size: 14px; font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.list-value { font-size: 15px; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.list-actions { display: flex; gap: 6px; }

/* ── POS Specific ── */
.pos-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.product-card:active { transform: scale(0.96); }
.product-card.out-of-stock { opacity: 0.5; pointer-events: none; }
.product-card-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.product-card-price { font-size: 13px; color: var(--primary); font-weight: 700; }
.product-card-stock { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.product-emoji { font-size: 28px; display: block; margin-bottom: 6px; }

.cart-area {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.cart-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--border);
}
.cart-title { font-size: 15px; font-weight: 800; }
.cart-items { min-height: 60px; }
.cart-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { flex: 1; font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 12px; color: var(--text-muted); }
.qty-control {
    display: flex; align-items: center; gap: 8px;
}
.qty-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-app);
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    transition: background var(--transition);
}
.qty-btn:active { background: var(--primary-soft); }
.qty-num { width: 24px; text-align: center; font-weight: 700; font-size: 15px; }
.cart-item-subtotal { font-size: 14px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.cart-empty {
    text-align: center; padding: 24px;
    color: var(--text-muted); font-size: 14px;
}
.cart-total-area {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px dashed var(--border);
}
.cart-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0;
    font-size: 14px;
}
.cart-total-row.big {
    font-size: 18px; font-weight: 800; margin-top: 6px;
    color: var(--primary);
}

/* Order Type Toggle */
.order-type-toggle {
    display: flex; gap: 0;
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 12px;
}
.order-type-btn {
    flex: 1; padding: 9px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-align: center;
}
.order-type-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Payment Modal */
.payment-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.payment-row:last-child { border-bottom: none; }
.payment-row.total {
    font-size: 20px; font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}
.change-display {
    background: var(--accent-green);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    font-size: 18px; font-weight: 800;
    margin-top: 12px;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: 12px; left: 12px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: slideInToast 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; align-items: center; gap: 10px;
}
@keyframes slideInToast {
    from { transform: translateY(-16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.toast-success { background: var(--accent-green); color: #fff; }
.toast-error { background: var(--accent-red); color: #fff; }
.toast-info { background: var(--accent-blue); color: #fff; }
.toast-warning { background: var(--accent); color: #fff; }

/* ── Modal (Popup Center - Scrollable) ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow-y: auto;
}
.modal-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 40px);
    max-height: calc(100vh - 40px);
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    /* Penting: harus ada position relative agar footer sticky bisa kerja */
    position: relative;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-app);
    font-size: 16px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-footer .btn { flex: 1; }


/* ── Loading ── */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    background: var(--secondary);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 100%; max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    text-align: center; margin-bottom: 28px;
}
.login-logo-icon { font-size: 52px; display: block; margin-bottom: 8px; }
.login-logo-name { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.login-logo-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 20px; }

/* ── Receipt ── */
.receipt {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #000;
    background: #fff;
    padding: 16px;
}
.receipt-header { text-align: center; margin-bottom: 12px; }
.receipt-title { font-size: 18px; font-weight: 900; }
.receipt-divider { border: none; border-top: 1px dashed #000; margin: 8px 0; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-total { font-size: 15px; font-weight: 900; }

/* ── Chart Placeholder ── */
.chart-wrap {
    width: 100%; height: 200px;
    position: relative;
    margin-top: 8px;
}
canvas { max-width: 100%; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-text { font-size: 14px; font-weight: 600; }
.empty-sub { font-size: 13px; margin-top: 4px; }

/* ── Tabs ── */
.tab-bar {
    display: flex;
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 16px;
    gap: 4px;
}
.tab-btn {
    flex: 1; padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    transition: all var(--transition);
}
.tab-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Chips / Filters ── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px; font-weight: 600;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Dashboard Realtime ── */
.realtime-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    display: inline-block;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.margin-positive { color: var(--accent-green); }
.margin-negative { color: var(--accent-red); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-primary-color { color: var(--primary); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-none { display: none; }
.w-full { width: 100%; }

/* ── Print Styles — hanya cetak struk, cocok thermal printer ── */
@media print {
    /* Sembunyikan SEMUA elemen halaman */
    body > * { display: none !important; }

    /* Tampilkan hanya #receiptPrintArea yang di-inject JS */
    #receiptPrintArea {
        display: block !important;
        position: fixed !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important;
        font-family: 'Courier New', monospace !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        color: #000 !important;
        background: #fff !important;
        padding: 4px !important;
        margin: 0 !important;
    }
    #receiptPrintArea * {
        color: #000 !important;
        background: transparent !important;
        font-family: 'Courier New', monospace !important;
    }
}

/* ── Tablet/Desktop ── */
@media (min-width: 768px) {
    :root { --sidebar-w: 260px; }
    .main-content {
        margin-left: var(--sidebar-w);
        padding: 24px;
    }
    .sidebar {
        transform: translateX(0);
        box-shadow: none;
    }
    .sidebar-overlay { display: none !important; }
    .menu-toggle { display: none; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .pos-container { flex-direction: row; }
    .pos-products { flex: 1; }
    .pos-cart { width: 340px; position: sticky; top: calc(var(--header-h) + 16px); }
}

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

/* ============================================================
   v22 Overrides — Font Inter global + Nav active + FA icons
   ============================================================ */

/* Font Inter ke seluruh elemen KECUALI Font Awesome */
body, button, input, select, textarea, canvas,
*:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands):not([class*="fa-"]) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Font Awesome icons — jangan disentuh sama sekali, biarkan FA CSS yang handle */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands,
.fa::before, .fas::before, .far::before, .fab::before,
.fa-solid::before, .fa-regular::before, .fa-brands::before {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands' !important;
    font-style: normal !important;
    line-height: 1 !important;
    display: inline-block !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Nav item active — lebih tegas dan modern */
.nav-item.active {
    background: rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
    border-left: 3px solid var(--primary) !important;
    font-weight: 700 !important;
}
.nav-item.active .nav-icon i,
.nav-item.active .nav-icon {
    color: var(--primary) !important;
    opacity: 1 !important;
}
.nav-item .nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    opacity: 0.75;
    color: rgba(255,255,255,0.85);
}
.nav-item.active .nav-icon {
    opacity: 1;
}

/* Bottom nav active */
.bottom-nav-item.active {
    color: var(--primary) !important;
    font-weight: 700;
}
.bottom-nav-item.active .bottom-nav-icon i {
    color: var(--primary) !important;
}

/* Stat icon — ganti emoji dengan FA icon, harus terlihat */
.stat-icon {
    font-size: 22px !important;
    margin-bottom: 10px;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--stat-color, var(--primary));
    color: #fff !important;
    opacity: 1 !important;
}
.stat-icon i {
    font-size: 18px !important;
    color: #fff !important;
    margin: auto;
}

/* Chart canvas — Inter font override via chart.js defaults */
.chart-wrap canvas { font-family: 'Inter', sans-serif !important; }

/* Page title emoji → sembunyikan jika ada, teks saja */
.page-title { font-weight: 800; font-size: 22px; letter-spacing: -0.3px; }
