/* =========================================================
   BeliDong - MASTER STYLESHEET
   Semua pengaturan desain, warna, dan responsif ada di sini!
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    /* 🎨 WARNA UTAMA BRAND (GANTI WARNA WEB DI SINI) */
    --primary-color: #2563eb; /* Biru Utama */
    --primary: #2563eb;       /* Alias */
    --primary-hover: #1d4ed8; /* Biru Gelap saat tombol disorot */
    
    /* 🎨 WARNA STATUS */
    --success: #10b981; /* Hijau */
    --warning: #eab308; /* Kuning (Juga dipakai untuk aksen Admin) */
    --danger: #ef4444;  /* Merah */
    --info: #3b82f6;    /* Biru Muda */

    /* 🎨 WARNA DASBOR (MODE GELAP - ELEGAN) */
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;

    /* 🎨 WARNA HALAMAN DEPAN & LOGIN (MODE TERANG) */
    --bg-light: #ffffff;
    --bg-gray: #f8fafc;
    --text-dark: #0f172a;
    --text-gray-light: #64748b;
    --border-light: #e2e8f0;
}

/* =========================================================
   1. RESET & DASAR
========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body { background-color: var(--bg-body); color: var(--text-primary); line-height: 1.6; overflow-x: hidden; }

/* Struktur Dasbor */
.container { max-width: 1150px; margin: 40px auto; padding: 0 20px; min-height: 80vh; }
.page-header { margin-bottom: 25px; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px;}

/* =========================================================
   2. NAVBAR & MENU (DASBOR)
========================================================= */
.navbar { background-color: var(--bg-surface); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.navbar-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; height: 64px; }
.navbar-brand { font-size: 18px; font-weight: 700; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px;}
.navbar-brand i { color: var(--primary-color); }

.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; }
.navbar-menu { display: flex; list-style: none; gap: 5px; height: 100%; align-items: center; }
.navbar-menu a, .dropdown-btn { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; padding: 0 15px; display: flex; align-items: center; height: 100%; border-bottom: 2px solid transparent; transition: all 0.2s; background: transparent; border-top: none; border-left: none; border-right: none; cursor: pointer; font-family: 'Poppins', sans-serif;}
.navbar-menu a:hover, .navbar-menu a.active, .dropdown-btn:hover { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }
.nav-divider { width: 1px; height: 24px; background-color: var(--border-color); margin: 0 10px; }

/* Dropdown Navbar */
.dropdown { position: relative; display: flex; align-items: center; height: 100%; }
.dropdown-content { display: none; position: absolute; top: 64px; left: 0; background-color: var(--bg-surface); min-width: 220px; border: 1px solid var(--border-color); border-radius: 0 0 8px 8px; flex-direction: column; z-index: 200; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); }
.dropdown:hover .dropdown-content { display: flex; }
.dropdown-content a { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.02) !important; height: auto; width: 100%; }
.dropdown-content a:hover { color: var(--primary-color); border-left: 3px solid var(--primary-color); padding-left: 13px; background-color: rgba(37, 99, 235, 0.05); }

/* Menu Khusus Admin & User */
.admin-menu .dropdown-btn { color: var(--warning); }
.admin-menu:hover .dropdown-btn { color: #fde047; border-bottom: 2px solid var(--warning); }
.admin-menu .dropdown-content a:hover { background-color: rgba(234, 179, 8, 0.05); color: var(--warning); border-left: 3px solid var(--warning); }

.user-menu { left: auto; right: 0; }
.user-info-box { padding: 15px 16px; border-bottom: 1px solid var(--border-color); background: rgba(0,0,0,0.2); }
.user-badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }

/* =========================================================
   3. KOMPONEN UI (Card, Alert, Badge)
========================================================= */
.card { background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); height: fit-content; }
.card h3 { font-size: 16px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; color: var(--text-primary); display: flex; align-items: center; gap: 8px;}

/* Alerts */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 8px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px;}
.alert-success { background-color: rgba(16, 185, 129, 0.1); border: 1px solid var(--success); color: var(--success); }
.alert-danger { background-color: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); }

/* Badges */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-pending { background: rgba(234, 179, 8, 0.1); color: var(--warning); border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* =========================================================
   4. FORM & TOMBOL
========================================================= */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 500;}
.form-control, .form-select { width: 100%; padding: 10px 15px; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 6px; font-size: 14px; transition: 0.3s; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.form-control:disabled { background: rgba(255,255,255,0.05); cursor: not-allowed; opacity: 0.7;}

/* Buttons */
.btn-primary, .btn-submit { background: var(--primary-color); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: 0.2s; text-decoration: none; display: inline-block; }
.btn-primary:hover, .btn-submit:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }

.btn-admin { background: var(--warning); color: #121212; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; transition: 0.2s; }
.btn-admin:hover { opacity: 0.8; }

.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block; transition: 0.2s; }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-action { padding: 6px 12px; border-radius: 4px; font-size: 12px; text-decoration: none; font-weight: 500; display: inline-block; margin-right: 3px; cursor: pointer; border: 1px solid transparent; background: rgba(255,255,255,0.05); color: var(--text-primary);}
.btn-edit { background: rgba(59, 130, 246, 0.1); color: var(--info); border-color: var(--info); }
.btn-delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: var(--danger); }
.btn-action:hover, .btn-edit:hover, .btn-delete:hover { opacity: 0.8; color: #fff; }

/* =========================================================
   5. TABEL (RESPONSIF KARTU UNTUK HP)
========================================================= */
.table-wrapper { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; min-width: 800px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
th { background-color: rgba(255,255,255,0.02); color: var(--text-secondary); font-weight: 500; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px;}
tr:hover { background-color: rgba(255,255,255,0.01); }

.service-wrap { white-space: normal; word-wrap: break-word; line-height: 1.5; min-width: 180px; }
.target-wrap { white-space: normal; word-break: break-all; line-height: 1.5; min-width: 150px; }

/* =========================================================
   6. TATA LETAK GRID & LAINNYA
========================================================= */
.grid-container { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 992px) { .grid-container { grid-template-columns: 350px 1fr; } }
.order-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .order-grid { grid-template-columns: 2fr 1fr; } }

/* Tiket Chat Bubbles */
.chat-container { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.chat-bubble { max-width: 75%; padding: 12px 16px; border-radius: 8px; font-size: 13px; line-height: 1.5; position: relative; }
.chat-me { align-self: flex-end; background: var(--primary-color); color: #fff; border-bottom-right-radius: 0; }
.chat-admin { background: var(--warning); color: #121212; }
.chat-them { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-primary); border-bottom-left-radius: 0; }
.chat-time { font-size: 10px; margin-top: 5px; display: block; opacity: 0.8; }

/* =========================================================
   7. MEDIA QUERY (HP / MOBILE FIXES)
========================================================= */
@media (max-width: 860px) {
    /* Paksa navbar utama berada di kasta tertinggi */
    .navbar { position: relative; z-index: 999999 !important; }
    
    .menu-toggle { display: block; } 
    .nav-divider { display: none; }
    
    /* FIX MENU TEMBUS PANDANG */
    .navbar-menu { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 64px; 
        left: 0; 
        width: 100%; 
        /* Gunakan kode warna HEX solid langsung agar 100% tidak tembus */
        background-color: #1e293b !important; 
        border-bottom: 1px solid var(--border-color); 
        padding: 10px 0; 
        align-items: flex-start; 
        z-index: 999999 !important; 
        box-shadow: 0 20px 40px rgba(0,0,0,0.8); 
    }
    .navbar-menu.active { display: flex; }
    
    .navbar-menu a, .dropdown-btn { padding: 15px 20px; width: 100%; }
    
    .dropdown { flex-direction: column; align-items: flex-start; width: 100%; }
    .dropdown-content { position: static; width: 100%; border: none; background-color: #0f172a !important; display: none; box-shadow: none; margin-left: 0; padding-left: 10px;}
    .dropdown.active .dropdown-content { display: flex; }

    /* Sulap Tabel Menjadi Kartu di HP */
    table, thead, tbody, th, td, tr { display: block; width: 100%; min-width: 100%; }
    thead tr { display: none; }
    tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; background: rgba(255,255,255,0.02); }
    td { display: flex; flex-direction: column; padding: 10px 5px; border-bottom: 1px dashed var(--border-color); text-align: left; }
    td:last-child { border-bottom: none; }
    td::before { content: attr(data-label); font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; font-size: 11px; text-transform: uppercase; }
}

/* Tampilan seperti di foto */
.live-order-popup {
    background: #ebfdf5;
    border: 1px solid #d1fae5;
    border-radius: 50px;
    padding: 10px 20px;
    margin: 20px auto;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.5s ease;
}

.live-order-popup.show { opacity: 1; }
.live-order-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; }
.live-order-text { color: #065f46; font-size: 13px; font-weight: 500; }
.live-order-text strong { color: #065f46; font-weight: 700; }
.live-order-time { 
    color: #059669; 
    font-size: 12px; 
    font-weight: 600; 
    margin-left: 10px; 
    padding-left: 10px; 
    border-left: 1px solid #a7f3d0; 
}