/* ========================================= */
/* 1. VARIABEL & RESET DASAR               */
/* ========================================= */
:root {
    --lapak-kosong-bg: #e0ffe0; /* Hijau muda */
    --lapak-terisi-bg: #ffe0e0; /* Merah muda default */
    --primary-color: #3f51b5;   /* Biru Utama */
    --text-color: #333;
    --grid-columns: 5;          /* Desktop: 5 kolom */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    padding-bottom: 80px; /* Ruang untuk checkout bar di HP */
}

/* ========================================= */
/* 2. DASHBOARD & KARTU RINGKASAN          */
/* ========================================= */
.dashboard {
    margin-bottom: 30px;
}
.summary-cards {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 15px;
}
.card h3 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.1em;
}
.card p {
    font-size: 1.8em;
    font-weight: bold;
    margin: 5px 0;
}

/* Warna Spesifik Kartu Dashboard */
.card.occupied h3, .card.occupied p { color: #d32f2f; }
.card.total h3, .card.total p { color: #6c757d; }

/* Dashboard Keuangan */
#financial-dashboard #total-pemasukan { color: #28a745; }
#financial-dashboard #total-tunggakan { color: #dc3545; }
#financial-dashboard #total-potensi { color: #007bff; }

/* Loading Animation */
.data-loading {
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.3s;
}
#lapak-kosong-count:empty::before, 
#lapak-terisi-count:empty::before, 
#total-lapak-count:empty::before {
    content: "0"; visibility: hidden;
}

/* ========================================= */
/* 3. FORMULIR & INPUT                     */
/* ========================================= */
.form-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}
.form-section label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
}
.form-section input[type="text"],
.form-section input[type="number"],
.form-section input[type="email"],
.form-section input[type="password"],
.form-section input[type="date"],
.form-section input[type="time"],
.form-section select,
.form-section textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

/* Tombol Utama */
button {
    cursor: pointer;
    transition: opacity 0.2s;
}
button:active { transform: scale(0.98); }

.login-btn {
    background-color: #3f51b5; 
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
}
.logout-btn {
    background-color: #d32f2f;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
}
.secondary-btn {
    background-color: #6c757d !important;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: bold;
}
.remove-btn {
    background-color: #dc3545 !important;
    color: white;
    border: none;
}

/* Pesan Notifikasi */
.message { margin-top: 10px; font-weight: bold; padding: 10px; border-radius: 4px; }
.message.error { background-color: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; }
.message.success { background-color: #e8f5e9; color: #388e3c; border: 1px solid #c8e6c9; }
.message.info { background-color: #e3f2fd; color: #0d47a1; border: 1px solid #bbdefb; }

/* ========================================= */
/* 4. DENAH LAPAK (FLOOR PLAN)             */
/* ========================================= */
.floor-plan {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.lapak-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: 10px;
    border: 3px solid #ddd; 
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.lapak-item {
    border: 1px solid #aaa;
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    position: relative; /* Untuk tooltip & history button */
}
.lapak-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    z-index: 5;
}

/* Status Warna Lapak */
.lapak-item.kosong { background-color: var(--lapak-kosong-bg); border-color: #388e3c; }
.lapak-item.kosong:hover { background-color: #b2ffb2; }

.lapak-item.terisi { background-color: #fbecec; border-color: #d32f2f; }
.lapak-item.terisi h4 { margin: 5px 0 0 0; font-size: 0.95em; color: #333; }
.lapak-item.terisi p { margin: 2px 0; font-size: 0.8em; color: #666; }

/* Status Pembayaran Spesifik */
.lapak-item.lunas { background-color: #d8f5d8; border-color: #388e3c; } /* Hijau */
.lapak-item.jatuh-tempo { background-color: #fff9c4; border-color: #ff9800; color: #e65100; } /* Kuning */
.lapak-item.menunggak {
    background-color: #ffcdd2; border-color: #c62828; color: #b71c1c;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

/* Tooltip Hover Lapak */
.lapak-item .tooltip {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 20;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8em;
    min-width: 180px;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.lapak-item:hover .tooltip { visibility: visible; opacity: 1; }
.tooltip strong { color: #ffd700; }

/* Tombol Riwayat di Lapak */
.lapak-item.has-history-btn { padding-bottom: 35px; }
.lapak-item .history-btn {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 0.7em;
    cursor: pointer;
    z-index: 6;
}
.lapak-item .history-btn:hover { background-color: #0056b3; }

/* ========================================= */
/* 5. FILTER & KONTROL                     */
/* ========================================= */
.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-controls label { margin: 0; white-space: nowrap; color: var(--primary-color); }
.filter-controls input, .filter-controls select { flex-grow: 1; min-width: 150px; }

.container-gated {
    display: none; opacity: 0; transition: opacity 0.5s;
}
.container-gated.show { display: block; opacity: 1; }

/* ========================================= */
/* 6. FORM MENU MANAGER (RESPONSIVE)       */
/* ========================================= */
.menu-item-row {
    margin-bottom: 10px;
}

/* Baris Atas: Nama, Harga Asli, Harga Jual, Stok, Hapus */
.menu-item-row-main {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.menu-item-row-main .menu-name-input { flex: 3; min-width: 120px; }
.menu-item-row-main .menu-price-original-input { flex: 1; min-width: 80px; }
.menu-item-row-main .menu-price-input { flex: 1; min-width: 80px; }
.menu-item-row-main .menu-stock-input { width: 100%; }

/* Baris Bawah: File Gambar & Checkbox */
.menu-item-row-file {
    display: flex;
    align-items: center;
    font-size: 0.85em;
    gap: 10px;
}
.menu-item-row-file label { flex: 0 0 auto; font-weight: normal; margin: 0; }
.menu-item-row-file .menu-image-file { flex: 1; padding: 2px; border: none; }

/* Tampilan HP untuk Form Menu */
@media (max-width: 768px) {
    .menu-item-row-main {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .menu-item-row-main input { width: 100%; min-width: unset; }
    
    /* Penataan Input Stok & Hapus di HP */
    .menu-item-row-main > div { width: 100% !important; } /* Container Stok */
    
    .menu-item-row-file {
        flex-direction: column;
        align-items: flex-start;
    }
    .menu-item-row-file > div {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
        margin-top: 10px;
    }
}

/* Checkbox Stok Habis */
.stok-toggle-label {
    font-size: 0.85em;
    color: #d32f2f;
    font-weight: bold;
    display: flex; align-items: center; gap: 5px;
    cursor: pointer; white-space: nowrap;
}

/* ========================================= */
/* 7. DASHBOARD PEDAGANG                   */
/* ========================================= */
.pedagang-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.info-box {
    background: #f8f9fa; border: 1px solid #e9ecef;
    border-radius: 8px; padding: 15px;
    display: flex; flex-direction: column;
}
.info-label { font-size: 0.85em; color: #6c757d; font-weight: bold; margin-bottom: 5px; }
.info-value { font-size: 1.25em; font-weight: bold; color: #333; }
.info-value.loading { color: #999; font-style: italic; }

#pd-status-bayar.status-lunas { color: #28a745; }
#pd-status-bayar.status-jatuh-tempo { color: #ff9800; }
#pd-status-bayar.status-menunggak { color: #dc3545; }

/* ========================================= */
/* 8. BROADCAST & NOTIFIKASI               */
/* ========================================= */
.broadcast-alert {
    background-color: #fff3cd; color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px; border-radius: 8px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: slideDown 0.5s ease-out;
}
.broadcast-icon { font-size: 1.5em; }
#broadcast-text { font-weight: bold; font-size: 1.1em; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================= */
/* 9. MODAL (POP-UP)                       */
/* ========================================= */
.modal {
    z-index: 2000;
    display: none; 
    position: fixed; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center; align-items: center;
    overflow-y: auto;
    padding: 20px; box-sizing: border-box;
}
.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%; max-width: 600px;
    position: relative;
    max-height: 90vh; overflow-y: auto;
}

/* --- FIX POSISI TOMBOL CLOSE & STATUS --- */
.modal .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 101;
    background: white; /* Background putih agar tidak transparan */
    width: 30px; height: 30px;
    border-radius: 50%;
    text-align: center; line-height: 30px;
    font-size: 20px; color: #555;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#menu-modal-status {
    position: absolute;
    top: 20px;
    left: 20px; /* Pindah ke kiri agar tidak tabrakan */
    right: auto;
    z-index: 100;
    padding: 5px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Modal Menu Detail Spesifik */
.modal-content-menu {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    width: 100%; max-width: 500px;
    position: relative;
    max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
}
#menu-modal-header {
    padding: 20px; text-align: center;
    background: white; border-bottom: 1px solid #eee;
    position: relative; flex-shrink: 0;
}
#menu-modal-list-container {
    overflow-y: auto; padding: 15px; flex-grow: 1;
    padding-bottom: 80px; background-color: #f8f9fa;
}

/* ========================================= */
/* 10. ITEM MENU DI KATALOG                */
/* ========================================= */
.menu-list-item {
    display: flex; flex-direction: column;
    padding: 12px; background: white;
    border-radius: 8px; margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border: none;
    position: relative;
}
.menu-list-item.disabled { opacity: 0.6; background-color: #f9f9f9; }
.menu-list-item.item-habis {
    opacity: 0.6; background-color: #eee; pointer-events: none;
}
.menu-list-item.item-habis img { filter: grayscale(100%); }

.menu-item-details img {
    height: 60px; width: 60px;
    object-fit: cover; border-radius: 6px;
}
.menu-item-price { font-weight: bold; color: #d32f2f; }
.menu-item-price-original { font-size: 0.85em; color: #999; text-decoration: line-through; }

/* Badges */
.promo-badge { background-color: #f44336; color: white; font-size: 0.7em; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; }
.habis-badge { background-color: #dc3545; color: white; font-size: 0.7em; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; }
.status-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.7em; font-weight: bold; color: white; }
.status-buka { background-color: #28a745; }
.status-tutup { background-color: #dc3545; }

/* Rating & Favorit */
.rating-stars { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 0.85em; }
.rate-btn { background: none; border: 1px solid #ffc107; color: #ffc107; padding: 2px 6px; border-radius: 10px; cursor: pointer; font-size: 0.8em; }
.rate-btn:hover { background-color: #ffc107; color: white; }

.favorite-btn {
    position: absolute; top: 10px; right: 10px; z-index: 10;
    background-color: rgba(255,255,255,0.8); border: none;
    border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.5em; line-height: 1; color: #ccc;
    transition: transform 0.2s, color 0.2s;
}
.favorite-btn.active { color: #e91e63; animation: heart-beat 0.3s ease-in-out; background: white; }
@keyframes heart-beat { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Tombol +/- Keranjang */
.menu-item-controls { display: flex; align-items: center; gap: 8px; }
.control-btn {
    background-color: #d32f2f; color: white; border: none;
    border-radius: 50%; width: 28px; height: 28px;
    font-size: 1.2em; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.control-btn.remove { background-color: #f1f1f1; color: #999; border: 1px solid #ddd; visibility: hidden; }
.control-btn:disabled { background-color: #e0e0e0 !important; color: #999 !important; cursor: not-allowed; }
.item-qty-display { font-size: 1.1em; font-weight: bold; min-width: 15px; text-align: center; }

/* ========================================= */
/* 11. CHECKOUT BAR (STICKY BOTTOM)        */
/* ========================================= */
#katalog-checkout-bar {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: white; border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 15px; box-sizing: border-box;
    display: none; flex-direction: column;
    z-index: 150;
}
#katalog-checkout-bar.show { display: flex; }
#checkout-totals-wrapper { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#checkout-total-price { font-size: 1.2em; color: #d32f2f; font-weight: bold; }
#checkout-wa-btn {
    background-color: #25d366; color: white;
    padding: 12px; border: none; border-radius: 8px;
    font-size: 1em; font-weight: bold; width: 100%;
}
#checkout-wa-btn:disabled { background-color: #999; cursor: not-allowed; }

/* ========================================= */
/* 12. RESPONSIF UMUM (MEDIA QUERY HP)     */
/* ========================================= */
@media (max-width: 768px) {
    .lapak-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 Kolom di HP */
        gap: 8px; padding: 10px;
    }
    .lapak-item { min-height: 100px; }
    .lapak-item h4 { font-size: 0.9em; }
    .lapak-item p { font-size: 0.75em; }
    .lapak-item .history-btn { padding: 3px 5px; font-size: 0.65em; bottom: 4px; }
    
    .filter-controls { flex-direction: column; align-items: stretch; }
    
    .menu-item-row-main { flex-wrap: wrap; }
}
/* --- FITUR EDUKASI & TOMBOL MELAYANG --- */

/* Tombol Melayang di Pojok Kanan Bawah */
#floating-help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3f51b5;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
#floating-help:hover {
    transform: scale(1.05);
    background-color: #303f9f;
}

/* Desain Accordion (Buka-Tutup) */
.edu-topic {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.edu-topic summary {
    background-color: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    list-style: none; /* Hilangkan panah default browser */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Efek Hover pada Judul Topik */
.edu-topic summary:hover {
    background-color: #e8eaf6;
    color: #3f51b5;
}

/* Tambahkan ikon panah kustom */
.edu-topic summary::after {
    content: '+'; 
    font-weight: bold;
    font-size: 1.2em;
    color: #999;
}
.edu-topic[open] summary::after {
    content: '-';
}

.edu-content {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #eee;
    color: #555;
    line-height: 1.6;
    font-size: 0.95em;
}

.edu-content ul, .edu-content ol {
    padding-left: 20px;
    margin: 0;
}
.edu-content li {
    margin-bottom: 8px;
}
/* CSS Tooltip Sederhana */
.tooltip-trigger {
    font-size: 0.8em;
    color: #007bff;
    cursor: help;
    margin-left: 5px;
}
/* --- FITUR RATING & ULASAN --- */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.9em;
}

.star-icon {
    color: #ffc107; /* Warna Emas */
    font-weight: bold;
}

.rate-btn {
    background: none;
    border: 1px solid #ffc107;
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.rate-btn:hover {
    background-color: #ffc107;
    color: white;
}

/* Modal Ulasan */
.review-item {
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    font-size: 0.85em;
}
.review-star { color: #ffc107; }
.review-text { color: #555; font-style: italic; }
/* --- FITUR FOMO (STOK MENIPIS) --- */

/* 1. Badge Berkedip di Katalog */
.fomo-badge {
    background-color: #d32f2f;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 5px;
    animation: blink-panic 1s infinite alternate;
    display: inline-block;
    vertical-align: middle;
}

@keyframes blink-panic {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.05); }
}

/* 2. Running Text di TV */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: #d32f2f; /* Merah Mendesak */
    color: #fff;
    z-index: 9999; /* Paling atas */
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.5);
    border-top: 3px solid #ff9800;
}

.ticker-content {
    white-space: nowrap;
    padding-left: 100%; /* Mulai dari luar layar kanan */
    animation: ticker-move 20s linear infinite;
    font-family: 'Oswald', sans-serif;
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 1px;
}

@keyframes ticker-move {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}
/* --- FITUR LUCKY SPIN (RODA REZEKI) --- */
.wheel-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 20px auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.83, 0.67); /* Efek melambat */
    background: conic-gradient(
        #f44336 0deg 60deg,   /* Merah */
        #ff9800 60deg 120deg, /* Orange */
        #2196f3 120deg 180deg,/* Biru */
        #4caf50 180deg 240deg,/* Hijau */
        #9c27b0 240deg 300deg,/* Ungu */
        #ffeb3b 300deg 360deg /* Kuning */
    );
    transform: rotate(0deg);
}

/* Jarum Penunjuk */
.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #333;
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

/* Tombol Tengah */
.spin-btn-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: white;
    border-radius: 50%;
    border: 4px solid #333;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 5;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.spin-btn-center:active { transform: translate(-50%, -50%) scale(0.95); }

.prize-text {
    text-align: center;
    font-size: 1.4em;
    font-weight: bold;
    color: #d32f2f;
    margin-top: 15px;
    min-height: 50px;
    line-height: 1.2;
}
/* --- PERBAIKAN TAMPILAN TOMBOL TAMBAH/KURANG --- */

/* Pastikan area kanan (harga & tombol) tidak menyempit */
.menu-item-right-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0; /* JANGAN MENGECIL */
    min-width: 90px; /* Lebar minimal agar muat */
}

/* Wadah tombol +/- */
.menu-item-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    background-color: #f5f5f5; /* Beri background abu tipis biar terlihat */
    padding: 3px;
    border-radius: 20px;
}

/* Tombol + dan - */
.control-btn {
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px; /* Sedikit diperbesar biar gampang dipencet */
    height: 32px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation; /* Biar responsif di layar sentuh */
}

/* Angka jumlah di tengah */
.item-qty-display {
    font-size: 1.1em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    color: #333;
}

/* Pastikan tombol hapus (-) terlihat jika ada isinya */
.control-btn.remove {
    background-color: #fff;
    color: #d32f2f;
    border: 1px solid #d32f2f;
    visibility: hidden; /* Default hidden, muncul lewat JS */
}
/* ========================================= */
/* 🚑 PERBAIKAN TOMBOL + TERTUTUP PROMO 🚑 */
/* ========================================= */

/* 1. Kunci Baris Menu agar tidak berantakan */
.menu-list-item > div {
    display: flex !important;
    flex-wrap: nowrap !important; /* Jangan biarkan jatuh ke bawah */
    align-items: flex-start !important; /* Ratakan atas */
    width: 100% !important;
    position: relative;
}

/* 2. Batasi Lebar Bagian Kiri (Nama & Promo) */
.menu-item-details {
    flex: 1 1 auto !important; /* Boleh membesar tapi jangan serakah */
    min-width: 0 !important;   /* Wajib ada: Biarkan teks terpotong jika kepanjangan */
    padding-right: 8px !important; /* Beri jarak dengan tombol kanan */
}

/* Agar badge promo tidak menabrak harga, paksa turun baris jika sempit */
.menu-item-details div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 3. Kunci Bagian Kanan (Harga & Tombol) */
.menu-item-right-group {
    flex: 0 0 auto !important; /* JANGAN PERNAH MENGECIL */
    width: 95px !important;    /* Paksa lebar tetap */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: space-between;
    z-index: 5 !important;     /* Pastikan selalu di atas layer lain */
}

/* 4. Pastikan Tombol Selalu Terlihat Jelas */
.menu-item-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    background-color: #f0f0f0;
    border-radius: 20px;
    padding: 2px;
    margin-top: 5px;
    min-width: 80px; /* Lebar minimal container tombol */
}

/* Tombol + dan - */
.control-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important; /* Jangan sampai gepeng */
    border-radius: 50%;
    font-size: 1.2em;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge Promo diperkecil sedikit agar muat */
.promo-badge, .habis-badge {
    display: inline-block;
    font-size: 0.65em !important;
    padding: 2px 5px !important;
    white-space: nowrap; /* Jangan terputus teksnya */
    margin-top: 2px;
    margin-left: 0 !important; /* Reset margin kiri */
}
/* --- FIX: RUANG KOSONG AGAR TIDAK TERTUTUP CHECKOUT --- */

/* Beri jarak di bawah list menu agar saat checkout bar muncul,
   menu paling bawah masih bisa di-scroll ke atas & diklik */
#menu-modal-list-container {
    padding-bottom: 200px !important; /* Dibuat sangat lega */
    overflow-y: auto; /* Pastikan bisa discroll */
    max-height: 70vh; /* Batasi tinggi list */
}

/* Pastikan Checkout Bar menempel di bawah tapi di atas konten */
#katalog-checkout-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100; /* Layer paling atas */
    background: white;
    border-top: 1px solid #ddd;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
}
/* ========================================= */
/* ✨ MAKE OVER DASHBOARD PEDAGANG (MODERN UI) ✨ */
/* ========================================= */

/* 1. Card Informasi (Omzet, Transaksi, dll) */
.summary-cards .card {
    background: white;
    border: none !important; /* Hapus border lama */
    border-radius: 15px; /* Sudut lebih bulat */
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Bayangan lembut */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.summary-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Garis warna di kiri card dibuat lebih elegan */
.summary-cards .card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 6px;
}

/* Warna khusus tiap card (sesuaikan urutan child) */
.summary-cards .card:nth-child(1)::before { background: #4caf50; } /* Hijau */
.summary-cards .card:nth-child(2)::before { background: #2196f3; } /* Biru */
.summary-cards .card:nth-child(3)::before { background: #ff9800; } /* Orange */

.summary-cards h3 {
    font-size: 1em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.summary-cards p {
    font-size: 2em;
    font-weight: 800; /* Lebih tebal */
    color: #333;
}


/* 2. Grafik & Chart Wrapper */
.chart-wrapper {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
}

.chart-wrapper h3, .chart-wrapper h4 {
    font-weight: 700;
    color: #444;
    border-left: 4px solid #3f51b5;
    padding-left: 15px;
    margin-bottom: 20px;
}


/* 3. Tabel Pesanan (Orders Table) */
#orders-table {
    border-collapse: separate; 
    border-spacing: 0 10px; /* Jarak antar baris */
    width: 100%;
}

#orders-table thead tr {
    background-color: transparent;
}

#orders-table thead th {
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    border: none;
    padding-bottom: 10px;
}

#orders-table tbody tr {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border-radius: 10px;
    transition: transform 0.2s;
}

#orders-table tbody tr:hover {
    transform: scale(1.01);
}

#orders-table td {
    padding: 20px 15px;
    border: none;
    vertical-align: middle;
}

/* Buat sudut baris tabel melengkung */
#orders-table td:first-child { border-radius: 10px 0 0 10px; }
#orders-table td:last-child { border-radius: 0 10px 10px 0; }


/* 4. Tombol Tab (Perlu Disiapkan vs Riwayat) */
.tab-btn {
    border-radius: 50px !important; /* Bulat kapsul */
    padding: 12px 25px !important;
    font-size: 0.95em !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tab-btn.active {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(63, 81, 181, 0.3);
}


/* 5. Form Input Pengeluaran */
#expense-form {
    background: linear-gradient(135deg, #fff0f0 0%, #fff 100%) !important;
    border: 1px solid #ffcdd2 !important;
    box-shadow: 0 10px 25px rgba(244, 67, 54, 0.1);
}

#expense-list li {
    padding: 15px 0 !important;
    border-bottom: 1px solid #eee !important;
}

#expense-list li:last-child {
    border-bottom: none !important;
}
/* --- CSS UNTUK MODAL PANDUAN (ACCORDION) --- */
.edu-topic {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.edu-topic summary {
    background-color: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    list-style: none; /* Hilangkan panah default */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edu-topic summary:hover {
    background-color: #e8eaf6;
    color: #3f51b5;
}

/* Ikon Tambah/Kurang Kustom */
.edu-topic summary::after {
    content: '+'; 
    font-weight: bold;
    font-size: 1.2em;
    color: #999;
}
.edu-topic[open] summary::after {
    content: '-';
}

.edu-content {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #eee;
    color: #555;
    line-height: 1.6;
    font-size: 0.95em;
}

.edu-content ul, .edu-content ol {
    padding-left: 20px;
    margin: 0;
}
.edu-content li {
    margin-bottom: 8px;
}
/* Warna Netral untuk Lapak Orang Lain */
.lapak-item.terisi-public {
    background-color: #f5f5f5; /* Abu-abu terang */
    border: 1px solid #ccc;
    color: #333;
}
.lapak-item.terisi-public h4 { color: #555; }
@media (max-width: 768px) {
    .menu-item-row-main {
        flex-wrap: wrap; /* Biarkan turun ke bawah */
    }
    .menu-item-row-main .menu-name-input {
        width: 100%; /* Nama menu full width di HP */
        flex: none;
    }
}
/* --- GAYA BUKU ALAMAT --- */
#savedAddressContainer {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.address-chip {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    border: 1px solid #ddd;
    color: #555;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.address-chip:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #0d47a1;
    transform: translateY(-1px);
}

.address-chip i.icon-place {
    margin-right: 6px;
    color: #ff9800;
}

.address-chip .btn-del {
    margin-left: 8px;
    color: #ff5252;
    padding: 0 4px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1;
}

.address-chip .btn-del:hover {
    background: #ffebee;
    color: #d32f2f;
}

.btn-save-addr {
    font-size: 0.8em;
    color: #2196f3;
    background: none;
    border: 1px dashed #2196f3;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}
.btn-save-addr:hover {
    background: #e3f2fd;
}