/* ============================================================
   KASIR PRO V6 - WHATSAPP EDITION
   Stylesheet Utama – Bersih, Dark‑Mode Siap, Mode Fokus Penuh
   ============================================================ */

/* ---------- VARIABEL TEMA ---------- */
:root {
    --bg-body: #f1f5f9;
    --bg-app: white;
    --bg-header: #ea580c;
    --text-header: #ffffff;
    --bg-product: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-cart: white;
    --border-color: #e2e8f0;
    --bg-summary: #1e293b;
    --text-summary: white;
    --bg-payment: white;
    --shadow-color: rgba(0,0,0,0.08);
    --change-bg: #d1fae5;
    --change-border: #22c55e;
    --change-text: #16a34a;
    --toggle-bg: #f8fafc;
    --status-online: #22c55e;
    --status-offline: #ef4444;
}

body.dark-mode {
    --bg-body: #0f172a;
    --bg-app: #1e293b;
    --bg-header: #0f172a;
    --text-header: #f8fafc;
    --bg-product: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-cart: #1e293b;
    --border-color: #334155;
    --bg-summary: #0f172a;
    --text-summary: #f8fafc;
    --bg-payment: #1e293b;
    --shadow-color: rgba(0,0,0,0.4);
    --change-bg: #064e3b;
    --change-border: #22c55e;
    --change-text: #4ade80;
    --toggle-bg: #334155;
    --status-online: #4ade80;
    --status-offline: #f87171;
}

/* ---------- RESET & BASE ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-body);
    display: flex;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
    color: var(--text-primary);
}

.app {
    max-width: 1200px;
    width: 100%;
    background: var(--bg-app);
    border-radius: 24px;
    box-shadow: 0 20px 60px var(--shadow-color);
    padding: 24px;
    transition: background 0.3s, box-shadow 0.3s;
}

/* ---------- MODAL OVERLAY ---------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
.modal-overlay.show {
    display: flex;
}

/* ---------- MODAL CONTENT ---------- */
.modal-content {
    background: var(--bg-app);
    color: var(--text-primary);
    padding: 24px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 600px; }

/* login modal spesifik */
.login-modal-content {
    background: white;
    padding: 40px;
    border-radius: 32px;
    width: 350px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
body.dark-mode .login-modal-content {
    background: #1e293b;
    color: var(--text-primary);
}
.login-title {
    margin-bottom: 20px;
    color: #1d2d35;
}
body.dark-mode .login-title { color: #f1f5f9; }
.login-hint {
    font-size: 0.8rem;
    color: #1d2d35;
    opacity: 0.8;
    margin-top: 12px;
    text-align: center;
}
body.dark-mode .login-hint { color: #cbd5e1; }

/* ---------- INPUT & SELECT ---------- */
.input-modal,
.input-cashier,
.input-search,
.input-compact {
    width: 100%;
    padding: 8px 12px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-app);
}
.input-modal:focus,
.input-cashier:focus,
.input-search:focus,
.input-compact:focus {
    outline: none;
    border-color: #fa7a1e;
    box-shadow: 0 0 0 2px rgba(250,122,30,0.2);
}
.input-compact {
    padding: 4px 8px;
    font-size: 0.8rem;
    width: auto;
}
.flex-1 { flex: 1; }
.full-width { width: 100% !important; }

/* ---------- TOMBOL UMUM ---------- */
button {
    cursor: pointer;
    font-family: inherit;
}

/* Primary (oranye) */
.btn-primary-sm,
.btn-login,
.btn-save {
    background: #fa7a1e;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 6px 14px;
    font-weight: bold;
    font-size: 0.75rem;
    transition: 0.2s;
}
.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    font-size: 1rem;
}
.btn-primary-sm:hover,
.btn-login:hover,
.btn-save:hover { opacity: 0.9; }

/* Danger (merah) */
.btn-danger-sm,
.btn-logout,
.btn-retur-last,
.btn-danger {
    background: #d94040;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.65rem;
    transition: 0.2s;
}
.btn-retur-last {
    display: none;
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
}
.btn-danger-sm:hover,
.btn-logout:hover,
.btn-retur-last:hover,
.btn-danger:hover { opacity: 0.9; }

/* Purple (ungu) */
.btn-purple-sm,
.btn-purple {
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.65rem;
    transition: 0.2s;
}
.btn-purple-sm:hover,
.btn-purple:hover { opacity: 0.9; }

/* Blue */
.btn-blue-sm,
.btn-blue {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.65rem;
    transition: 0.2s;
}
.btn-blue-sm:hover,
.btn-blue:hover { opacity: 0.9; }

/* Green */
.btn-green,
.btn-green-sm {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.btn-green-sm {
    padding: 4px 12px;
    font-size: 0.65rem;
}
.btn-green:hover,
.btn-green-sm:hover { opacity: 0.9; }

/* Warning (kuning) */
.btn-warning-sm {
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 6px 14px;
    font-weight: bold;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}
.btn-warning-sm:hover { opacity: 0.9; }

/* Batal / Tutup */
.btn-cancel,
.btn-close-modal {
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
}
.btn-cancel:hover,
.btn-close-modal:hover { opacity: 0.9; }

/* Tombol khusus */
.btn-change-password {
    background: #d6f0fd;
    color: #fa7a1e;
    border: none;
    border-radius: 40px;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 0.65rem;
    cursor: pointer;
}
body.dark-mode .btn-change-password {
    background: #1e293b;
    color: #fa7a1e;
    border: 1px solid var(--border-color);
}

.btn-clear-member {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: 2px 10px;
    font-size: 0.7rem;
    color: var(--text-primary);
    cursor: pointer;
}
.btn-reset-light {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    background: #ecf1ed;
    color: #1d2d35;
    font-size: 0.85rem;
    transition: 0.2s;
}
body.dark-mode .btn-reset-light {
    background: #334155;
    color: #f1f5f9;
}
.btn-new-transaction {
    margin-top: 12px;
    padding: 8px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ---------- HEADER ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fa7a1e, #ea580c);
    padding: 12px 16px;
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 12px;
    transition: background 0.3s;
    min-height: 44px;
}
body.dark-mode header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}
header h1 {
    font-weight: 600;
    color: var(--text-header);
    font-size: 1.1rem;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-status-group,
.header-user-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.status-badge {
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: white;
}
.status-badge.online { background: #22c55e; }
.status-badge.printer {
    background: #f8fafc;
    color: #1d2d35;
}
body.dark-mode .status-badge.printer {
    background: #334155;
    color: #e2e8f0;
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}
.status-dot.online { background: var(--status-online); }
.status-dot.offline { background: var(--status-offline); }

.user-name-display {
    font-weight: 600;
    color: white;
    font-size: 0.8rem;
}
.omzet-badge {
    font-size: 0.7rem;
    background: #fff;
    padding: 2px 8px;
    border-radius: 40px;
    color: #1d2d35;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}
body.dark-mode .omzet-badge {
    background: #334155;
    color: #f1f5f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.omzet-value { font-weight: 700; }
.omzet-value.profit { color: #fa7a1e; }

header .date,
header .invoice-num {
    color: var(--text-header);
    font-size: 0.7rem;
    opacity: 0.9;
    white-space: nowrap;
}

/* ---------- TABS ---------- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    overflow-x: auto;
    white-space: nowrap;
}
.tabs button {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.tabs button:hover { background: var(--bg-product); }
.tabs button.active {
    background: #ea580c;
    color: white;
}

/* ---------- TAB CONTENT ---------- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- GRID KASIR ---------- */
.grid {
    display: grid;
    grid-template-columns: 1.6fr 1.4fr;
    gap: 16px;
    transition: all 0.3s;
}
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

/* ---------- PRODUK ---------- */
.products {
    background: var(--bg-product);
    border-radius: 20px;
    padding: 16px;
    max-height: 750px;
    overflow-y: auto;
    transition: background 0.3s;
}
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.products-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.stock-alert-badge {
    font-size: 0.6rem;
    background: #d94040;
    color: white;
    padding: 2px 8px;
    border-radius: 40px;
    display: none;
}
.products-actions { display: flex; gap: 6px; }
.search-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
}
.scanner-container {
    display: none;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: black;
    aspect-ratio: 1/1;
    max-height: 200px;
}
.product-list {
    overflow-y: auto;
    flex: 1;
    max-height: 500px;
    padding-right: 4px;
}
.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-app);
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
    color: var(--text-primary);
}
.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
    background: var(--bg-product);
}
.product-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 2px; }
.product-stock { font-size: 0.75rem; color: var(--text-secondary); }
.product-price { font-weight: 800; font-size: 1.1rem; color: #059669; }

/* Category Pills */
.category-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.cat-btn {
    padding: 6px 16px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.cat-btn:hover { border-color: #cbd5e1; background: var(--bg-product); }
.cat-btn.active { background: #fa7a1e; color: white; border-color: #fa7a1e; }
body.dark-mode .cat-btn { background: #334155; color: #e2e8f0; border-color: #475569; }
body.dark-mode .cat-btn.active { background: #ea580c; color: white; }

/* ---------- KERANJANG ---------- */
.cart {
    background: var(--bg-cart);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: background 0.3s, border 0.3s;
}

/* Total Panel */
/* --- Base Total Panel (Styled untuk Dark Mode) --- */
.total-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Initial State (Saat Rp 0): Warna redup sebagai indikasi 'idle' */
    background: #1f2937; /* Warna abu-abu gelap */
    color: #9ca3af;      /* Teks abu-abu */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- State Ketika Ada Transaksi (Jika total > 0) --- */
.total-panel.has-items {
    background: linear-gradient(135deg, #f97316, #ea580c); /* Oranye menyala */
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 25px rgba(234, 88, 12, 0.35);
}

.total-panel .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 2px;
    /* Transisi warna teks */
    transition: color 0.3s ease;
}
.total-panel.has-items .label {
    color: rgba(255, 255, 255, 0.8);
}

.total-panel .amount {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0 8px 0;
    /* Efek jika ada items, angka akan bersinar */
    text-shadow: 0 0 0 transparent;
    transition: all 0.3s ease;
}
.total-panel.has-items .amount {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.total-panel .summary {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5); /* Sangat transparan saat idle */
    transition: color 0.3s ease;
}
.total-panel.has-items .summary {
    color: rgba(255, 255, 255, 0.85); /* Jelas saat aktif */
}

/* Cart breakdown baris */
.cart-breakdown {
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Cart Items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: 260px;
    margin: 0;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    gap: 12px;
}
.cart-item > span { font-weight: 600; font-size: 0.9rem; flex: 1; word-break: break-word; }
.cart-item .qty { display: flex; align-items: center; gap: 6px; }
.cart-item .qty button {
    background: var(--bg-product);
    border: 1px solid var(--border-color);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
}
.cart-item .qty button:hover { background: var(--border-color); }
.cart-item .qty span { font-weight: 700; min-width: 24px; text-align: center; font-size: 0.9rem; }
.cart-item .qty button.danger { background: #fee2e2; color: #dc2626; border-color: #fca5a5; margin-left: 4px; }
.cart-item .qty button.danger:hover { background: #fecaca; }

/* Toggle Section */
.toggle-section {
    background: var(--toggle-bg);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    border: 1px solid var(--border-color);
}
.toggle-section:hover { background: var(--bg-product); }
.toggle-section .label { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.toggle-section .icon { transition: transform 0.3s; color: var(--text-secondary); }
.toggle-section .icon.open { transform: rotate(180deg); }
.toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 12px;
    background: var(--bg-app);
    border-radius: 0 0 12px 12px;
}
.toggle-content.open {
    max-height: 300px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-top: none;
}
.toggle-content-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-primary);
    padding: 4px 0;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}
.member-selected-display {
    font-size: 0.8rem;
    color: #fa7a1e;
    display: none;
    margin-bottom: 4px;
}

/* Payment */
.payment {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
}
.payment button {
    padding: 10px 4px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-payment);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.payment button:hover { background: var(--bg-product); color: var(--text-primary); }
.payment button.active {
    border-color: #ea580c;
    background: #fff7ed;
    color: #ea580c;
    box-shadow: inset 0 0 0 1px #ea580c;
}

/* Quick Money Grid */
.quick-money-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.quick-money-grid .qm-btn {
    padding: 8px 2px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
}
.quick-money-grid .qm-btn:hover { border-color: #fa7a1e; background: #fff7ed; }
.quick-money-grid .qm-btn.active { border-color: #22c55e; background: #d1fae5; color: #065f46; }
.quick-money-grid .qm-btn.pas {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
    grid-column: span 4;
    font-size: 0.8rem;
    padding: 10px;
}
.quick-money-grid .qm-btn.pas:hover { background: #0f172a; }

/* Cash Input Area */
.cash-input-area {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 8px 0;
    flex-wrap: wrap;
}
.cash-input-area label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* Debt Input */
.debt-input-area {
    display: none;
    margin: 4px 0;
    padding: 8px;
    background: #d6f0fd;
    border-radius: 8px;
}
body.dark-mode .debt-input-area { background: #1e293b; }
.debt-input-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* Upsell */
.upsell-area {
    display: none;
    margin-top: 4px;
    padding: 6px 10px;
    background: #d6f0fd;
    border-radius: 8px;
    border-left: 4px solid #fa7a1e;
}
body.dark-mode .upsell-area { background: #1e293b; }
.upsell-title { font-weight: 600; color: #1d2d35; font-size: 0.8rem; }
body.dark-mode .upsell-title { color: #f1f5f9; }
.upsell-list { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* Receipt */
.receipt {
    margin-top: 16px;
    background: var(--bg-product);
    padding: 16px;
    border-radius: 16px;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    display: none;
    border: 2px dashed var(--border-color);
    color: var(--text-primary);
}
.receipt.show { display: block; }
.receipt-actions { margin-top: 4px; text-align: right; }

/* Cart Actions */
.cart-actions {
    display: flex;
    gap: 6px;
    margin: 8px 0 4px 0;
}

/* Change Box */
#changeBox {
    background: var(--change-bg);
    border: 2px solid var(--change-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin: 12px 0;
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
#changeBox.show { display: block; }
#changeBox .label {
    color: #065f46;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#changeBox .amount {
    color: var(--change-text);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
}
#changeBox .detail {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Checkout Button */
.btn-checkout-glow {
    background: linear-gradient(135deg, #fa7a1e, #ea580c);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 015s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 16px rgba(30, 165, 126, 0.3);
    width: 100%;
    text-align: center;
}
.btn-checkout-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(250, 122, 30, 0.6);
}
.btn-checkout-glow:active { transform: scale(0.98); }

/* ---------- TAB LAINNYA ---------- */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.total-debt {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.text-danger { color: #d94040; }
.text-orange { color: #fa7a1e; }
.text-green { color: #22c55e; }
.text-blue { color: #3b82f6; }
.text-muted { color: var(--text-secondary); font-size: 0.8rem; }

/* Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}
.dashboard-card,
.report-card {
    background: var(--bg-product);
    padding: 16px;
    border-radius: 16px;
    text-align: center;
}
.card-label { font-size: 0.8rem; color: var(--text-secondary); }
.card-value { font-size: 1.8rem; font-weight: 800; color: var(--text-primary); }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-wide { grid-column: span 2; }
@media (max-width: 600px) {
    .charts-grid { grid-template-columns: 1fr; }
    .chart-wide { grid-column: span 1; }
}

/* Pareto */
.pareto-insight {
    background: var(--bg-product);
    padding: 16px;
    border-radius: 12px;
    margin: 12px 0;
}
.pareto-list { margin-top: 12px; }

/* Report */
.report-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
    align-items: center;
}
.report-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.report-detail-list { margin-top: 16px; }

/* Stock */
.stock-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}
.opname-history { margin-top: 16px; }

/* Modal grid */
.modal-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}
.modal-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 12px 0;
}
.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.modal-actions button { flex: 1; }

.radio-group {
    display: flex;
    gap: 12px;
}

/* ---------- SUPPLIER LIST ---------- */
.supplier-item {
    background: var(--bg-product);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #fa7a1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- STOK DANGER & WARNING ---------- */
.stock-danger {
    border-left: 4px solid #ef4444 !important;
    background: #fee2e2 !important;
}
body.dark-mode .stock-danger {
    background: #450a0a !important;
    border-left-color: #f87171 !important;
}
.stock-warning {
    border-left: 4px solid #f59e0b !important;
    background: #fef3c7 !important;
}
body.dark-mode .stock-warning {
    background: #451a03 !important;
    border-left-color: #fbbf24 !important;
}

/* ---------- TOMBOL HEADER OUTLINE (TAMBAHAN) ---------- */
.btn-outline-header {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 40px;
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
}
.btn-outline-header:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
}
body.dark-mode .btn-outline-header {
    color: #e2e8f0;
    border-color: #475569;
}
body.dark-mode .btn-outline-header:hover {
    background: rgba(255,255,255,0.1);
    border-color: #94a3b8;
}

/* ---------- DROPDOWN PEMILIH TOKO ---------- */
#storeSelectorContainer select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}
#storeSelectorContainer select option {
    background: #1e293b;
    color: white;
}
body.dark-mode #storeSelectorContainer select {
    background: #334155;
    border-color: #475569;
}

/* ---------- DARK MODE & FOCUS TOGGLE ---------- */
#darkModeToggle, .focus-toggle-btn {
    background: #1d2d35;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 4px 10px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.65rem;
    transition: 0.2s;
}
#darkModeToggle:hover, .focus-toggle-btn:hover { opacity: 0.9; transform: scale(1.02); }
.focus-toggle-btn.active { background: #fa7a1e; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(16px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .header-status-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    #storeSelectorContainer {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
    }
}
@media (max-width: 750px) {
    header { flex-direction: column; align-items: flex-start; }
    .header-left { width: 100%; justify-content: space-between; }
    .header-status-group { width: 100%; justify-content: flex-start; margin-top: 8px; }
    .header-user-group { width: 100%; justify-content: space-between; margin-top: 8px; }
}
@media (max-width: 600px) {
    body { padding: 10px; }
    .app { padding: 12px; border-radius: 16px; }
    .tabs { gap: 4px; padding-bottom: 8px; }
    .tabs button { padding: 6px 10px; font-size: 0.7rem; }
    .products { max-height: 400px; padding: 12px; }
    .cart { padding: 12px; }
    .total-panel .amount { font-size: 1.8rem; }
    .quick-money-grid { gap: 4px; }
    .quick-money-grid .qm-btn { font-size: 0.7rem; padding: 6px 2px; }
    .payment button { font-size: 0.7rem; padding: 4px 6px; }
    #changeBox .amount { font-size: 2rem; }
    .btn-checkout-glow { font-size: 1rem; padding: 12px 16px; }
    #cashInputArea, #debtInputArea { flex-direction: column; align-items: stretch; }
}
@media (max-width: 500px) {
    header .invoice-num { display: none; }
    #printerStatus { display: none; }
    #storeStatus { font-size: 0.55rem; padding: 2px 6px; }
    .omzet-badge { font-size: 0.65rem; }
}

/* ============================================================
   MODE FOKUS – MINIMALIS, TETAP FUNGSIONAL
   ============================================================ */

body.focus-mode {
    --bg-primary: #f8fafc;
    background: var(--bg-primary);
    transition: background 0.3s ease;
}

/* Header tetap ramping */
body.focus-mode header {
    padding: 6px 16px !important;
    background: #1e293b !important;
    transition: all 0.3s ease;
}
body.focus-mode .header-left h1 {
    font-size: 1rem;
}
body.focus-mode .invoice-num {
    font-size: 0.7rem;
}
body.focus-mode #dateDisplay {
    font-size: 0.8rem;
    color: white;
}

/* SEMBUNYIKAN elemen administratif (hanya mengganggu) */
body.focus-mode .focus-hide,
body.focus-mode .tabs,
body.focus-mode .products-actions,
body.focus-mode #manageUsersBtn,
body.focus-mode #openShopSettingsBtn,
body.focus-mode #btnDiscountSettings,
body.focus-mode #btnLoyaltySettings,
body.focus-mode #btnOpenBarcode,
body.focus-mode #btnBackup,
body.focus-mode #btnBackupLokal,
body.focus-mode #btnRestoreLokal,
body.focus-mode #customerDisplayBtn,
body.focus-mode .omzet-badge,
body.focus-mode .header-user-group .btn-change-password,
body.focus-mode .header-user-group .btn-logout,
body.focus-mode .header-status-group .btn-outline-header,
body.focus-mode #storeSelectorContainer,
body.focus-mode #stockAlertBadge,
body.focus-mode .category-pills,
body.focus-mode #scanBtn,
body.focus-mode #upsellArea,
body.focus-mode .receipt-actions,
body.focus-mode .cart-actions,
body.focus-mode .cart-breakdown,
body.focus-mode #toggleSectionBtn,
body.focus-mode #toggleContent,
body.focus-mode #debtInputArea,
body.focus-mode #splitPaymentArea {
    display: none !important;
}

/* ---------- GRID UTAMA: TETAP 2 KOLOM ATAU 1 KOLOM? ---------- */
/* Biarkan 2 kolom jika layar lebar, atau susun vertikal */
body.focus-mode #mainGrid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr; /* produk lebih kecil, keranjang lebih besar */
    gap: 12px;
    height: calc(100vh - 90px);
    padding: 4px 0;
    overflow: hidden;
}

/* Produk: tetap terlihat tapi ringkas */
body.focus-mode .products {
    max-height: 100%;
    overflow-y: auto;
    padding: 8px;
    border-radius: 12px;
}
body.focus-mode .product-item {
    padding: 6px 10px;
    font-size: 0.85rem;
}
body.focus-mode .product-price {
    font-size: 0.9rem;
}

/* Keranjang: mengisi sisa, fokus utama */
body.focus-mode .cart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-cart);
    border-radius: 16px;
    overflow: hidden;
}
body.focus-mode .cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

/* Total panel: besar, jelas, di atas */
body.focus-mode .total-panel {
    padding: 12px;
    text-align: left;
}
body.focus-mode .total-panel .amount {
    font-size: 2.4rem;
}

/* ---------- TETAP TAMPILKAN ELEMEN PEMBAYARAN ---------- */
body.focus-mode .payment {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin: 4px 0;
}
body.focus-mode .payment button {
    padding: 8px 4px;
    font-size: 0.7rem;
    border-radius: 8px;
}

body.focus-mode .quick-money-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
body.focus-mode .quick-money-grid .qm-btn {
    padding: 6px 2px;
    font-size: 0.7rem;
}

body.focus-mode .cash-input-area {
    display: flex !important;
    gap: 8px;
    margin: 4px 0;
}
body.focus-mode .cash-input-area input {
    flex: 1;
    padding: 8px 12px;
    font-size: 1.2rem;
}
body.focus-mode #checkoutBtn {
    display: block !important;
    font-size: 1.1rem;
    padding: 12px;
    margin-top: 4px;
}

/* Change box tetap terlihat */
body.focus-mode #changeBox {
    display: none;
}
body.focus-mode #changeBox.show {
    display: block !important;
}

/* Responsif untuk layar kecil */
@media (max-width: 700px) {
    body.focus-mode #mainGrid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }
    body.focus-mode .products {
        max-height: 30vh;
    }
}


/* =========================
   Admin visibility helpers
   - Tambahkan ini di akhir stylesheet utama
   ========================= */

/* Class helper: beri class="admin-only" pada elemen yang hanya boleh dilihat admin */
.admin-only {
    /* default: visible; JS akan mengatur display sesuai role */
}

/* Jika focus-mode aktif, sembunyikan semua admin-only secara paksa */
body.focus-mode .admin-only {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Jika ingin memastikan elemen admin tidak mengambil ruang saat disembunyikan */
.admin-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Safety: sembunyikan beberapa selector admin yang sering muncul (fallback CSS) */
body.focus-mode #exportAccountingMenu,
body.focus-mode .export-accounting,
body.focus-mode #manageUsersBtn,
body.focus-mode #openShopSettingsBtn,
body.focus-mode #btnDiscountSettings,
body.focus-mode #btnLoyaltySettings,
body.focus-mode #btnOpenBarcode,
body.focus-mode #btnBackup,
body.focus-mode #btnBackupLokal,
body.focus-mode #btnRestoreLokal,
body.focus-mode #customerDisplayBtn,
body.focus-mode #storeSelectorContainer {
    display: none !important;
}
