:root {
    /* Default Theme: Blue */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 12px;
    --sidebar-width: 280px;
}

/* ===== THEME COLORS (4 Pilihan) ===== */
body[data-theme-color="green"] {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.1);
}
body[data-theme-color="purple"] {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: rgba(139, 92, 246, 0.1);
}
body[data-theme-color="orange"] {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: rgba(249, 115, 22, 0.1);
}

[data-theme="dark"] {
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}
body[data-theme-color="green"][data-theme="dark"] { --primary: #34d399; --primary-dark: #10b981; }
body[data-theme-color="purple"][data-theme="dark"] { --primary: #a78bfa; --primary-dark: #8b5cf6; }
body[data-theme-color="orange"][data-theme="dark"] { --primary: #fb923c; --primary-dark: #f97316; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s, 
    color 0.3s;
}

/* ===== HEADER ===== */
.header {
    background: var(--card-bg);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hamburger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px 8px;
    border-radius: 6px;
}
.hamburger-btn:hover { background: var(--bg); }
.header-title { flex: 1; cursor: pointer; min-width: 0; }
.header h1 { font-size: 1.05rem; color: var(--primary); transition: color 0.3s; }
.tagline { font-size: 0.65rem; color: var(--text-secondary); }

/* ===== SIDEBAR ===== */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 100%; z-index: 200; pointer-events: none; visibility: hidden; }
.sidebar.open { pointer-events: auto; visibility: visible; }
.sidebar-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.3s; }
.sidebar.open .sidebar-overlay { opacity: 1; }
.sidebar-content {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    max-width: 85%;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s;    overflow-y: auto;
    padding: 16px 0;
}
.sidebar.open .sidebar-content { transform: translateX(0); }
.sidebar-header { padding: 12px 20px 16px; display: flex; align-items: center; gap: 12px; }
.store-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: background 0.3s;
}
.store-info { flex: 1; min-width: 0; }
.store-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-owner { font-size: 0.75rem; color: var(--text-secondary); }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
    transition: background 0.2s;
}
.sidebar-item:hover { background: var(--bg); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-icon { font-size: 1.2rem; }

/* ===== MAIN ===== */
.main { padding: 14px; padding-bottom: 80px; max-width: 800px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
.page-title { font-size: 1.15rem; margin-bottom: 14px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CARD ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);}
.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}
.stat-card .icon { font-size: 1.3rem; margin-bottom: 4px; }
.stat-card .value { font-size: 1.1rem; font-weight: 700; }
.stat-card .label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== BRIEFING ===== */
.briefing-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}
.briefing-box:hover { transform: translateY(-2px); }
.briefing-box h3 { font-size: 0.95rem; margin-bottom: 6px; }
.briefing-box p { font-size: 0.8rem; opacity: 0.95; }

/* ===== ALERTS & INSIGHTS ===== */
.alert-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.alert-item:last-child { border-bottom: none; }
.alert-item .badge { background: var(--warning); color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; }
.alert-item.danger .badge { background: var(--danger); }

.insight-item { padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; font-size: 0.85rem; line-height: 1.4; }
.insight-item.positive { background: rgba(16, 185, 129, 0.1); border-left: 3px solid var(--success); }
.insight-item.warning { background: rgba(245, 158, 11, 0.1); border-left: 3px solid var(--warning); }
.insight-item.danger { background: rgba(239, 68, 68, 0.1); border-left: 3px solid var(--danger); }
.insight-item.info { background: var(--primary-light); border-left: 3px solid var(--primary); }
/* ===== INSIGHT CARDS ===== */
.insight-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    transition: all 0.2s;
}
.insight-card:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.insight-card.critical { border-left-color: var(--danger); background: rgba(239, 68, 68, 0.05); }
.insight-card.warning { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.05); }
.insight-card.success { border-left-color: var(--success); background: rgba(16, 185, 129, 0.05); }
.insight-card.info { border-left-color: var(--primary); background: var(--primary-light); }
.insight-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.insight-icon { font-size: 1.3rem; }
.insight-title { font-weight: 700; font-size: 0.88rem; flex: 1; }
.insight-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.insight-badge.critical { background: var(--danger); color: white; }
.insight-badge.warning { background: var(--warning); color: white; }
.insight-badge.success { background: var(--success); color: white; }
.insight-badge.info { background: var(--primary); color: white; }
.insight-content { font-size: 0.82rem; line-height: 1.5; color: var(--text); }
.insight-content strong { color: var(--primary); }
.insight-metric {
    display: inline-block;
    background: var(--card-bg);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    margin: 0 2px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;    gap: 5px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 5px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }

/* ===== TABLE ===== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-secondary); font-size: 0.7rem; text-transform: uppercase; }
.stock-badge { padding: 2px 7px; border-radius: 10px; font-size: 0.68rem; font-weight: 600; }
.stock-safe { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stock-low { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stock-empty { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.search-box { position: relative; margin-bottom: 12px; }
.search-box input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--card-bg);
    color: var(--text);
}
.search-box::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; background: var(--bg); padding: 4px; border-radius: 8px; }
.tab {
    flex: 1;
    padding: 7px;    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: none;
}
.tab.active { background: var(--primary); color: white; }

/* ===== STOCK ===== */
.stock-section { margin-bottom: 16px; }
.stock-section h4 { font-size: 0.82rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stock-list { display: flex; flex-wrap: wrap; gap: 6px; }
.stock-chip { 
    padding: 6px 12px; 
    border-radius: 16px; 
    font-size: 0.78rem; 
    font-weight: 500; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.stock-chip .stock-qty {
    background: rgba(0,0,0,0.1);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.72rem;
}
.stock-chip.low { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.stock-chip.empty { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.stock-chip.safe { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }

/* ===== RANK ===== */
.rank-list { list-style: none; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-number {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
    flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-number { background: #fbbf24; }
.rank-item:nth-child(2) .rank-number { background: #94a3b8; }.rank-item:nth-child(3) .rank-number { background: #cd7f32; }

/* ===== SETTINGS ===== */
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.setting-item:last-child { border-bottom: none; }
.setting-label { font-size: 0.88rem; }
.setting-desc { font-size: 0.72rem; color: var(--text-secondary); }
.toggle { position: relative; width: 44px; height: 24px; background: var(--border); border-radius: 12px; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
.toggle.active { background: var(--primary); }
.toggle::after { content: ''; position: absolute; width: 20px; height: 20px; background: white; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.3s; }
.toggle.active::after { transform: translateX(20px); }
.prediction-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; background: var(--bg); border-radius: 8px; font-size: 0.82rem; }
.prediction-days { font-weight: 700; color: var(--danger); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 2px;
    z-index: 100;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.6rem;
    color: var(--text-secondary);
    border: none;
    background: none;
    flex: 1;
    transition: all 0.2s;
}
.bottom-nav-item.active { color: var(--primary); background: var(--primary-light); }
.bottom-nav-item .nav-icon { font-size: 1.2rem; margin-bottom: 2px; }

/* ===== FAB ===== */
.chat-fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--primary);    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    z-index: 99;
    transition: transform 0.2s, background 0.3s;
}
.chat-fab:hover { transform: scale(1.1); }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; }
.modal-header h3 { font-size: 1.05rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); }

/* ===== MODAL KONFIRMASI MODERN (BARU) ===== */
.confirm-content {
    text-align: center;
    padding: 10px 0;
}
.confirm-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--warning), var(--danger));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;    color: white;
    animation: confirmPulse 1.5s ease-in-out infinite;
}
@keyframes confirmPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}
.confirm-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===== CHAT ===== */
.chat-question-btn {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s;
}
.chat-question-btn:hover { background: var(--primary); color: white; border-color: var(--primary); transform: translateX(4px); }
.chat-answer-box { background: var(--bg); padding: 14px; border-radius: 10px; margin-top: 14px; line-height: 1.5; }

/* ===== CART ===== */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 8px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.cart-item-detail { font-size: 0.75rem; color: var(--text-secondary); }
.cart-item-price { font-weight: 700; font-size: 0.9rem; color: var(--primary); white-space: nowrap; }
.cart-item-remove {
    background: var(--danger);
    color: white;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;    cursor: pointer;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.cart-summary { background: linear-gradient(135deg, var(--primary-light), rgba(16, 185, 129, 0.05)); }
.cart-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; }
.cart-summary-row.total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--success);
    border-top: 2px dashed var(--border);
    padding-top: 10px;
    margin-top: 6px;
}

/* ===== RECEIPT ===== */
.receipt {
    background: white;
    color: #1e293b;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    border: 1px dashed var(--border);
}
.receipt-header { text-align: center; margin-bottom: 12px; border-bottom: 1px dashed #94a3b8; padding-bottom: 10px; }
.receipt-logo { font-size: 2.5rem; margin-bottom: 4px; }
.receipt-store-name { font-weight: 700; font-size: 1rem; }
.receipt-store-address { font-size: 0.75rem; color: #64748b; }
.receipt-info { margin-bottom: 10px; font-size: 0.78rem; }
.receipt-info-row { display: flex; justify-content: space-between; }
.receipt-divider { border-top: 1px dashed #94a3b8; margin: 8px 0; }
.receipt-items { margin-bottom: 8px; }
.receipt-item { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.8rem; }
.receipt-item-name { flex: 1; }
.receipt-item-qty { width: 80px; text-align: center; font-size: 0.75rem; }
.receipt-item-price { width: 80px; text-align: right; font-weight: 600; }
.receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 0;
    border-top: 2px solid #1e293b;
    margin-top: 8px;
}
.receipt-footer { text-align: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #94a3b8; font-size: 0.78rem; color: #64748b; }
.receipt-thanks { font-weight: 600; color: #1e293b; margin-bottom: 4px; }
/* Catatan Transaksi di Struk (BARU) */
.receipt-notes {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid #2563eb;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #475569;
    font-style: italic;
}
.receipt-notes-label {
    font-weight: 700;
    font-style: normal;
    color: #1e293b;
    display: block;
    margin-bottom: 2px;
}

.receipt-list-item {
    background: var(--bg);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--primary);
}
.receipt-list-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.receipt-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.receipt-list-no { font-weight: 700; font-size: 0.85rem; color: var(--primary); }
.receipt-list-total { font-weight: 700; color: var(--success); }
.receipt-list-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== SEARCH DROPDOWN ===== */
.search-dropdown { position: relative; margin-bottom: 0; }
.dropdown-results {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow);
    margin-top: 4px;
}.dropdown-results.show { display: block; }
.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item.create-new {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    font-weight: 600;
}
.dropdown-item.create-new:hover { background: rgba(16, 185, 129, 0.15); }
.dropdown-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== CUSTOMER LIST ===== */
.customer-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--primary);
}
.customer-list-item:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.customer-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
}

/* ===== LOYAL CUSTOMER ===== */
.loyal-customer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);    cursor: pointer;
    transition: background 0.2s;
}
.loyal-customer-item:last-child { border-bottom: none; }
.loyal-customer-item:hover { background: var(--bg); }
.loyal-rank {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.loyal-customer-item:nth-child(1) .loyal-rank { background: #fbbf24; }
.loyal-customer-item:nth-child(2) .loyal-rank { background: #94a3b8; }
.loyal-customer-item:nth-child(3) .loyal-rank { background: #cd7f32; }
.loyal-info { flex: 1; min-width: 0; }
.loyal-name { font-weight: 600; font-size: 0.88rem; }
.loyal-stats { font-size: 0.72rem; color: var(--text-secondary); }
.loyal-total { font-weight: 700; color: var(--success); font-size: 0.88rem; }

/* ===== LOYAL PAGINATION ===== */
.loyal-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.loyal-pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    color: var(--text);
}
.loyal-pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}.loyal-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.loyal-pagination .page-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ===== ACHIEVEMENT ===== */
.achievement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.achievement-item {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    position: relative;
}
.achievement-item.unlocked { border-color: var(--warning); background: rgba(245, 158, 11, 0.05); }
.achievement-item.locked { opacity: 0.5; filter: grayscale(1); }
.achievement-icon { font-size: 1.7rem; margin-bottom: 4px; }
.achievement-name { font-size: 0.68rem; font-weight: 600; margin-bottom: 2px; }
.achievement-desc { font-size: 0.58rem; color: var(--text-secondary); line-height: 1.2; }
.achievement-item.unlocked::after {
    content: '✓';
    position: absolute;
    top: 3px; right: 5px;
    background: var(--success);
    color: white;
    width: 14px; height: 14px;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.progress-container { background: var(--bg); border-radius: 10px; height: 10px; overflow: hidden; margin: 6px 0; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); transition: width 0.5s; }

/* ===== TOAST ATAS ===== */
.toast {
    position: fixed;
    top: 70px; right: 16px;
    background: var(--card-bg);
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 2000;
    max-width: 300px;    animation: slideIn 0.4s;
    display: flex;
    gap: 10px;
    align-items: center;
}
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }
.toast.hide { animation: slideOut 0.4s forwards; }
.toast-icon { font-size: 1.8rem; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.85rem; color: var(--warning); }
.toast-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.toast.success { border-color: var(--success); }
.toast.warning { border-color: var(--warning); }
.toast.danger { border-color: var(--danger); }
.toast.info { border-color: var(--primary); }

/* ===== TOAST BAWAH (UNTUK AKSI) ===== */
.toast-bottom {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: var(--card-bg);
    color: var(--text);
    border: 3px solid var(--success);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 3000;
    max-width: 360px;
    width: 90%;
    display: flex;
    gap: 16px;
    align-items: center;
    animation: toastBounceUp 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}
.toast-bottom.hide { animation: toastBounceOut 0.4s ease forwards; }
@keyframes toastBounceUp {
    0% { transform: translateX(-50%) translateY(150px) scale(0.5); opacity: 0; }
    60% { transform: translateX(-50%) translateY(-15px) scale(1.05); opacity: 1; }
    80% { transform: translateX(-50%) translateY(5px) scale(0.98); }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@keyframes toastBounceOut {
    0% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) translateY(150px) scale(0.8); opacity: 0; }
}
.toast-bottom-icon {
    width: 50px; height: 50px;    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: iconBounce 0.5s ease 0.3s both;
}
@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.toast-bottom-content { flex: 1; min-width: 0; }
.toast-bottom-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.toast-bottom-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.toast-bottom.success { border-color: var(--success); }
.toast-bottom.success .toast-bottom-icon { background: var(--success); }
.toast-bottom.warning { border-color: var(--warning); }
.toast-bottom.warning .toast-bottom-icon { background: var(--warning); }
.toast-bottom.danger { border-color: var(--danger); }
.toast-bottom.danger .toast-bottom-icon { background: var(--danger); }
.toast-bottom.info { border-color: var(--primary); }
.toast-bottom.info .toast-bottom-icon { background: var(--primary); }

/* ===== KATEGORI ===== */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.category-item:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.category-info { flex: 1; }
.category-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.category-count { font-size: 0.75rem; color: var(--text-secondary); }
.category-actions { display: flex; gap: 6px; }

/* ===== THEME PICKER (BARU - 4 Warna) ===== */
.theme-picker {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 10px 0;
}.theme-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.theme-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.theme-option.active {
    border-color: var(--text);
    transform: scale(1.1);
}
.theme-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.theme-option[data-theme-color="blue"] { background: #2563eb; }
.theme-option[data-theme-color="green"] { background: #10b981; }
.theme-option[data-theme-color="purple"] { background: #8b5cf6; }
.theme-option[data-theme-color="orange"] { background: #f97316; }

/* ===== EXPORT PAGE (BARU) ===== */
.export-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.export-summary-item:last-child { border-bottom: none; }
.export-summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.export-summary-value {
    font-weight: 700;
    font-size: 1rem;    color: var(--text);
}
.export-summary-value.success { color: var(--success); }
.export-summary-value.primary { color: var(--primary); }

/* ===== LINIMASA / TIMELINE (BARU) ===== */
.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.timeline-subtitle { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 2px; }
.timeline-time { font-size: 0.7rem; color: var(--text-secondary); }
.timeline-item.transaction .timeline-icon { background: var(--primary-light); }
.timeline-item.achievement .timeline-icon { background: rgba(245, 158, 11, 0.1); }
.timeline-item.stock_warning .timeline-icon { background: rgba(245, 158, 11, 0.1); }
.timeline-item.stock_empty .timeline-icon { background: rgba(239, 68, 68, 0.1); }

/* ===== CASH FLOW INSIGHT (BARU) ===== */
.cashflow-card {
    background: linear-gradient(135deg, var(--primary-light), rgba(16, 185, 129, 0.05));
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
}
.cashflow-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}
.cashflow-grid {
    display: grid;    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.cashflow-item {
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}
.cashflow-item-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.cashflow-item-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}
.cashflow-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    padding: 8px 0;
}
.cashflow-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), var(--primary-dark));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: all 0.3s;
}
.cashflow-bar:hover {
    opacity: 0.8;
}
.cashflow-bar-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== MISC ===== */
.version-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; }.badge-free { background: rgba(100, 116, 139, 0.1); color: var(--text-secondary); }
.empty-state { text-align: center; padding: 30px 16px; color: var(--text-secondary); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ===== CHART ===== */
.chart-container { position: relative; width: 100%; height: 280px; margin: 12px 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .stats-grid { gap: 6px; }
    .stat-card { padding: 10px; }
    .stat-card .value { font-size: 1rem; }
    .achievement-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-container { height: 240px; }
    .cashflow-grid { grid-template-columns: 1fr; }
    .theme-option { width: 44px; height: 44px; }
}

/* ===== PRINT ===== */
@media print {
    body * { visibility: hidden; }
    .receipt, .receipt * { visibility: visible; }
    .receipt { position: absolute; left: 0; top: 0; width: 100%; border: none; }
}