@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
    --navy:#0a0f1e;
    --navy-2:#111827;
    --navy-3:#1a2236;
    --gold:#c9a227;
    --gold-light:#f0d060;
    --gold-dark:#a07d18;
    --green:#10b981;
    --green-bg:rgba(16,185,129,.1);
    --orange:#f59e0b;
    --orange-bg:rgba(245,158,11,.1);
    --red:#ef4444;
    --red-bg:rgba(239,68,68,.1);
    --purple:#8b5cf6;
    --purple-bg:rgba(139,92,246,.1);
    --blue:#3b82f6;
    --blue-bg:rgba(59,130,246,.1);
    --bg:#f0f2f7;
    --text-dark:#1b2436;
    --text-muted:#6b7280;
    --border:#e5e7eb;
    --radius:14px;
    --sidebar-width:270px;
}

*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'Inter',system-ui,sans-serif;background:var(--bg);color:var(--text-dark);}
a{text-decoration:none;color:inherit;}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar{width:5px;height:5px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:10px;}

/* ===== LAYOUT ===== */
.app{display:flex;min-height:100vh;}

/* ===== SIDEBAR ===== */
.sidebar{
    width:var(--sidebar-width);
    background:var(--navy);
    display:flex;flex-direction:column;
    flex-shrink:0;position:fixed;
    top:0;left:0;height:100vh;
    overflow-y:auto;z-index:200;
    transition:transform .3s cubic-bezier(.4,0,.2,1);
    border-right:1px solid rgba(201,162,39,.1);
}

/* Sidebar brand with logo */
.sidebar-brand{
    display:flex;gap:12px;align-items:center;
    padding:20px 18px;
    border-bottom:1px solid rgba(201,162,39,.1);
    background:rgba(201,162,39,.03);
}
.sidebar-logo{
    width:46px;height:46px;border-radius:12px;
    overflow:hidden;flex-shrink:0;
    background:rgba(201,162,39,.1);
    display:flex;align-items:center;justify-content:center;
    border:1px solid rgba(201,162,39,.2);
}
.sidebar-logo img{width:100%;height:100%;object-fit:contain;}
.brand-text strong{
    display:block;font-size:12px;font-weight:700;
    background:linear-gradient(135deg,var(--gold),var(--gold-light));
    -webkit-background-clip:text;-webkit-text-fill-color:transparent;
    line-height:1.4;
}
.brand-text span{font-size:10px;color:rgba(255,255,255,.4);letter-spacing:.5px;text-transform:uppercase;}

.sidebar-section{
    padding:18px 18px 6px;font-size:10px;
    letter-spacing:1px;color:rgba(255,255,255,.25);
    font-weight:700;text-transform:uppercase;
}
.sidebar nav a{
    display:flex;align-items:center;gap:11px;
    padding:10px 18px;margin:2px 10px;
    border-radius:10px;font-size:13.5px;
    color:rgba(255,255,255,.55);transition:.2s;
    font-weight:500;
}
.sidebar nav a svg{width:17px;height:17px;flex-shrink:0;}
.sidebar nav a:hover{
    background:rgba(255,255,255,.06);
    color:rgba(255,255,255,.9);
}
.sidebar nav a.active{
    background:linear-gradient(135deg,rgba(201,162,39,.2),rgba(201,162,39,.05));
    color:var(--gold-light);
    border:1px solid rgba(201,162,39,.2);
}
.sidebar nav a.active svg{color:var(--gold);}

.sidebar-subnav{display:none;padding:0 10px 8px 34px;}
.sidebar-subnav.open{display:block;}
.sidebar-subnav .subnav-item{
    display:flex;align-items:center;gap:10px;
    padding:8px 12px;margin:2px 0;border-radius:8px;
    font-size:12.5px;color:rgba(255,255,255,.45);
}
.sidebar-subnav .subnav-item svg{width:14px;height:14px;}
.sidebar-subnav .subnav-item:hover{background:rgba(255,255,255,.05);color:rgba(255,255,255,.85);}
.sidebar-subnav .subnav-item.active{background:rgba(201,162,39,.12);color:var(--gold-light);}

.section-intro h2{font-size:44px;line-height:1.05;font-weight:800;color:#fff;margin-bottom:4px;text-transform:lowercase;}
.section-intro p{font-size:28px;color:rgba(255,255,255,.85);font-weight:700;margin-bottom:6px;text-transform:lowercase;}
.section-intro .sub{font-size:20px;color:rgba(255,255,255,.55);text-transform:lowercase;}

.mini-tabs{display:flex;gap:10px;margin:14px 0 16px;}
.mini-tab{
    display:inline-flex;align-items:center;justify-content:center;
    padding:8px 16px;border-radius:10px;border:1px solid rgba(255,255,255,.2);
    color:rgba(255,255,255,.75);font-size:13px;font-weight:600;
    background:rgba(255,255,255,.04);
}
.mini-tab.active{background:rgba(201,162,39,.18);border-color:rgba(201,162,39,.3);color:var(--gold-light);}

.sidebar-footer{
    margin-top:auto;padding:14px 18px;
    border-top:1px solid rgba(201,162,39,.1);
    display:flex;align-items:center;gap:10px;
    background:rgba(0,0,0,.2);
}
.avatar-circle{
    width:36px;height:36px;border-radius:50%;
    background:linear-gradient(135deg,var(--gold),var(--gold-dark));
    display:flex;align-items:center;justify-content:center;
    color:var(--navy);font-weight:700;font-size:14px;flex-shrink:0;
}
.sidebar-footer .who strong{display:block;font-size:13px;color:#fff;font-weight:600;}
.sidebar-footer .who span{font-size:11px;color:rgba(255,255,255,.4);display:flex;align-items:center;gap:4px;}
.dot-online{width:6px;height:6px;border-radius:50%;background:var(--green);display:inline-block;}

/* Overlay */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:199;backdrop-filter:blur(2px);}
.sidebar-overlay.open{display:block;}

/* ===== MAIN ===== */
.main{flex:1;margin-left:var(--sidebar-width);min-width:0;}

/* ===== TOPBAR ===== */
.topbar{
    background:#fff;padding:14px 24px;
    display:flex;align-items:center;justify-content:space-between;
    border-bottom:1px solid var(--border);
    position:sticky;top:0;z-index:100;gap:12px;
    box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.topbar-left{display:flex;align-items:center;gap:12px;}
.hamburger{display:none;background:none;border:0;cursor:pointer;width:36px;height:36px;border-radius:8px;align-items:center;justify-content:center;color:var(--text-dark);flex-shrink:0;}
.hamburger svg{width:20px;height:20px;}
.hamburger:hover{background:#f1f5f9;}
.topbar h1{font-size:17px;margin:0 0 2px;font-weight:700;color:var(--navy);}
.breadcrumb{font-size:11px;color:var(--text-muted);}
.topbar-right{display:flex;align-items:center;gap:10px;flex-shrink:0;}
.profile-mini{display:flex;align-items:center;gap:8px;}
.profile-mini .av{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--gold),var(--gold-dark));display:flex;align-items:center;justify-content:center;color:var(--navy);font-weight:700;font-size:13px;}
.profile-mini strong{display:block;font-size:13px;font-weight:600;}
.profile-mini span{font-size:11px;color:var(--text-muted);}
.profile-text{display:block;}
.logout-btn{width:34px;height:34px;border-radius:50%;background:#fde8ec;display:flex;align-items:center;justify-content:center;text-decoration:none;transition:.2s;}
.logout-btn:hover{background:#fcc2ce;}
.guest-badge{background:var(--orange-bg);color:#b45309;font-size:11px;font-weight:600;padding:5px 12px;border-radius:20px;border:1px solid rgba(245,158,11,.2);}

/* ===== CONTENT ===== */
.content{padding:22px 24px;}

/* ===== STATS GRID ===== */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-bottom:22px;}
.stat-card{
    background:#fff;border-radius:var(--radius);padding:18px;
    border:1px solid var(--border);position:relative;overflow:hidden;
    transition:.2s;cursor:default;
}
.stat-card:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,.08);}
.stat-card::before{content:'';position:absolute;top:0;right:0;width:80px;height:80px;border-radius:0 0 0 80px;opacity:.06;}
.stat-card.c-blue::before{background:var(--blue);}
.stat-card.c-green::before{background:var(--green);}
.stat-card.c-orange::before{background:var(--orange);}
.stat-card.c-red::before{background:var(--red);}
.stat-card.c-gold::before{background:var(--gold);}
.stat-card.c-purple::before{background:var(--purple);}
.stat-card.c-teal::before{background:#14b8a6;}
.stat-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;margin-bottom:12px;}
.stat-icon svg{width:20px;height:20px;color:#fff;}
.bg-blue{background:linear-gradient(135deg,#3b82f6,#1d4ed8);}
.bg-green{background:linear-gradient(135deg,#10b981,#059669);}
.bg-orange{background:linear-gradient(135deg,#f59e0b,#d97706);}
.bg-red{background:linear-gradient(135deg,#ef4444,#dc2626);}
.bg-gold{background:linear-gradient(135deg,var(--gold),var(--gold-dark));}
.bg-purple{background:linear-gradient(135deg,#8b5cf6,#6d28d9);}
.bg-teal{background:linear-gradient(135deg,#14b8a6,#0f766e);}
.stat-label{font-size:11px;font-weight:600;letter-spacing:.5px;color:var(--text-muted);margin-bottom:4px;text-transform:uppercase;}
.stat-value{font-size:24px;font-weight:800;margin-bottom:2px;color:var(--navy);}
.stat-sub{font-size:11px;color:var(--text-muted);}

/* ===== PANEL ===== */
.panel{background:#fff;border-radius:var(--radius);border:1px solid var(--border);overflow:hidden;margin-bottom:20px;box-shadow:0 1px 3px rgba(0,0,0,.04);}
.panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;flex-wrap:wrap;gap:10px;border-bottom:1px solid var(--border);}
.panel-header h2{font-size:15px;margin:0;display:flex;align-items:center;gap:8px;font-weight:700;color:var(--navy);}
.panel-header h2 svg{width:17px;height:17px;color:var(--gold);}
.panel-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.search-box{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid var(--border);border-radius:9px;padding:8px 13px;min-width:220px;}
.search-box input{border:0;background:transparent;outline:none;font-size:13px;width:100%;font-family:inherit;}
.search-box svg{width:15px;height:15px;color:#94a3b8;flex-shrink:0;}

/* ===== BUTTONS ===== */
.btn{border:0;border-radius:9px;padding:9px 16px;font-size:13px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:7px;transition:.2s;font-family:inherit;}
.btn svg{width:15px;height:15px;}
.btn-primary{background:linear-gradient(135deg,var(--gold),var(--gold-dark));color:var(--navy);}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 4px 15px rgba(201,162,39,.3);}
.btn-success{background:linear-gradient(135deg,#10b981,#059669);color:#fff;}
.btn-success:hover{transform:translateY(-1px);box-shadow:0 4px 15px rgba(16,185,129,.25);}
.btn-outline{background:#fff;border:1px solid var(--border);color:var(--text-dark);}
.btn-outline:hover{background:#f8fafc;}
.btn-sm{padding:6px 10px;font-size:12px;}

/* ===== TABLE ===== */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
table{width:100%;border-collapse:collapse;min-width:600px;}
thead{background:linear-gradient(135deg,var(--navy),var(--navy-3));}
thead th{color:rgba(255,255,255,.85);font-size:11px;font-weight:600;text-align:left;padding:12px 16px;white-space:nowrap;letter-spacing:.4px;text-transform:uppercase;}
tbody td{padding:13px 16px;font-size:13px;border-bottom:1px solid #f3f4f6;vertical-align:middle;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:#fafbfc;}
.thumb{width:40px;height:40px;border-radius:9px;background:#f3f4f6;display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;}
.thumb img{width:100%;height:100%;object-fit:cover;}
.thumb svg{width:17px;height:17px;color:#94a3b8;}

/* ===== BADGES ===== */
.badge-pill{padding:4px 11px;border-radius:20px;font-size:11px;font-weight:600;display:inline-block;white-space:nowrap;}
.pill-baik{background:var(--green-bg);color:#059669;border:1px solid rgba(16,185,129,.2);}
.pill-ringan{background:var(--orange-bg);color:#d97706;border:1px solid rgba(245,158,11,.2);}
.pill-berat{background:var(--red-bg);color:#dc2626;border:1px solid rgba(239,68,68,.2);}

/* ===== ACTION BUTTONS ===== */
.actions-row{display:flex;gap:6px;}
.icon-btn{width:30px;height:30px;border-radius:8px;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;background:#fff;cursor:pointer;transition:.15s;}
.icon-btn svg{width:14px;height:14px;}
.icon-btn.view{color:var(--blue);}.icon-btn.edit{color:var(--orange);}.icon-btn.add{color:#059669;}.icon-btn.del{color:var(--red);}
.icon-btn:hover{transform:scale(1.1);}
.empty-row td{text-align:center;padding:48px;color:var(--text-muted);}

.stock-mode-banner{display:none;margin-bottom:14px;padding:12px 14px;border-radius:12px;border:1px solid rgba(16,185,129,.2);background:linear-gradient(135deg,#ecfdf5,#f0fdf4);color:#065f46;font-weight:600;font-size:12.5px;display:flex;align-items:center;gap:8px;}
.stock-mode-banner .dot{width:10px;height:10px;border-radius:50%;background:#10b981;box-shadow:0 0 0 4px rgba(16,185,129,.15);}

/* ===== MODAL ===== */
.modal-overlay{position:fixed;inset:0;background:rgba(10,15,30,.6);display:none;align-items:flex-start;justify-content:center;padding:20px 16px;z-index:1000;overflow-y:auto;backdrop-filter:blur(4px);}
.modal-overlay.open{display:flex;}
.modal-box{background:#fff;border-radius:16px;width:100%;max-width:680px;box-shadow:0 25px 60px rgba(0,0,0,.3);}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--border);}
.modal-head h3{margin:0;font-size:17px;font-weight:700;color:var(--navy);}
.modal-close{background:none;border:0;cursor:pointer;color:#9ca3af;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;}
.modal-close:hover{background:#f3f4f6;}
.modal-close svg{width:18px;height:18px;}
.modal-body{padding:20px 22px;}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.form-grid .full{grid-column:1/-1;}
.form-group label{display:block;font-size:12px;font-weight:600;margin-bottom:6px;color:#374151;text-transform:uppercase;letter-spacing:.3px;}
.form-group label .req{color:var(--red);}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:10px 13px;border:1.5px solid var(--border);border-radius:9px;font-size:13.5px;outline:none;background:#fff;font-family:inherit;transition:.2s;color:var(--text-dark);}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,39,.1);}
.input-prefix{display:flex;align-items:center;border:1.5px solid var(--border);border-radius:9px;overflow:hidden;}
.input-prefix span{padding:0 12px;background:#f8fafc;color:var(--text-muted);font-size:13px;border-right:1px solid var(--border);align-self:stretch;display:flex;align-items:center;font-weight:500;}
.input-prefix input{border:0;border-radius:0;}
.input-suffix{display:flex;align-items:center;border:1.5px solid var(--border);border-radius:9px;overflow:hidden;}
.input-suffix input{border:0;border-radius:0;}
.input-suffix span{padding:0 12px;background:#f8fafc;color:var(--text-muted);font-size:13px;border-left:1px solid var(--border);align-self:stretch;display:flex;align-items:center;font-weight:500;}
.photo-upload{border:2px dashed #d1d5db;border-radius:12px;padding:24px;text-align:center;cursor:pointer;color:var(--text-muted);font-size:13px;background:#fafbfc;position:relative;transition:.2s;}
.photo-upload:hover{border-color:var(--gold);background:rgba(201,162,39,.02);}
.photo-upload svg{width:28px;height:28px;color:#94a3b8;margin-bottom:8px;}
.photo-upload input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;}
.photo-upload img.preview{max-height:80px;border-radius:8px;margin-bottom:8px;}
.modal-foot{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px;border-top:1px solid var(--border);background:#fafbfc;border-radius:0 0 16px 16px;}
.alert{padding:11px 14px;border-radius:9px;font-size:13px;margin-bottom:16px;font-weight:500;}
.alert-success{background:var(--green-bg);color:#059669;border:1px solid rgba(16,185,129,.2);}
.alert-danger{background:var(--red-bg);color:#dc2626;border:1px solid rgba(239,68,68,.2);}

/* ===== MAP ===== */
#peta{height:300px;border-radius:10px;border:1.5px solid var(--border);margin-top:8px;}
.map-info{font-size:12px;color:var(--text-muted);margin-top:6px;}
.coord-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px;}
.coord-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px;}

/* ===== FOLDER QUICK ADD ===== */
.folder-quickadd{display:flex;justify-content:flex-end;padding:16px 20px;}

/* ===== RESPONSIVE ===== */
@media(max-width:1100px){.stats-grid{grid-template-columns:repeat(3,1fr);}}
@media(max-width:1024px){.profile-text{display:none;}.search-box{min-width:160px;}}

@media(max-width:768px){
    .sidebar{transform:translateX(-100%);}
    .sidebar.open{transform:translateX(0);}
    .main{margin-left:0;}
    .hamburger{display:flex;}
    .topbar{padding:12px 16px;}
    .topbar h1{font-size:15px;}
    .breadcrumb{display:none;}
    .content{padding:14px;}
    .stats-grid{grid-template-columns:repeat(2,1fr);gap:10px;}
    .stat-value{font-size:20px;}
    .stat-card{padding:14px;}
    .panel-header{padding:12px 14px;}
    .panel-actions{width:100%;}
    .search-box{flex:1;min-width:0;}
    .modal-overlay{padding:8px;}
    .form-grid{grid-template-columns:1fr;}
    .form-grid .full{grid-column:1;}
    .modal-body{padding:16px;}
    .modal-foot{padding:12px 16px;}
    .coord-row{grid-template-columns:1fr;}
}

@media(max-width:480px){
    .stats-grid{grid-template-columns:1fr;}
    .stat-sub{display:none;}
    .stat-label{font-size:10px;}
    .stat-value{font-size:17px;}
}

@media print{
    .sidebar,.topbar,.no-print{display:none!important;}
    .main{margin:0!important;}
    .content{padding:0!important;}
    .panel{border:none!important;box-shadow:none!important;}
    .print-header{display:block!important;}
    body{background:white!important;}
}
.print-header{display:none;text-align:center;margin-bottom:20px;}
