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

:root{
  --bg:#10141b;
  --panel:#171d26;
  --panel-2:#1f2730;
  --accent:#00d9b5;
  --accent-dim:#0a3f38;
  --text:#edf1f5;
  --text-muted:#8a94a6;
  --danger:#ff6b6b;
  --success:#4ade80;
  --border:#2a323d;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{ font-family:'Inter', sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
h1,h2,h3,.brand-name{ font-family:'Sora', sans-serif; }
.mono{ font-family:'JetBrains Mono', monospace; }

/* ---- Login ---- */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.login-box{ width:100%; max-width:380px; background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:36px; }
.login-box h2{ font-size:22px; margin-bottom:6px; }
.login-box .sub{ color:var(--text-muted); font-size:13.5px; margin-bottom:26px; }

.field{ margin-bottom:18px; }
.field label{ display:block; font-size:12.5px; color:var(--text-muted); margin-bottom:7px; font-weight:500; }
.field input, .field select, .form-card select{
  width:100%; background:var(--panel-2); border:1px solid var(--border); border-radius:8px;
  padding:12px 14px; color:var(--text); font-size:14px; outline:none;
}
.field input:focus, .field select:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-dim); }

.btn-primary{ width:100%; background:var(--accent); color:#08110f; border:none; border-radius:8px; padding:13px; font-weight:600; font-size:14px; cursor:pointer; }
.btn-primary:hover{ filter:brightness(1.08); }

.error-msg{ background:rgba(255,107,107,0.08); border:1px solid rgba(255,107,107,0.35); color:var(--danger); font-size:13px; padding:10px 12px; border-radius:8px; margin-bottom:18px; }
.flash-success{ background:rgba(74,222,128,0.08); border:1px solid rgba(74,222,128,0.35); color:var(--success); font-size:13px; padding:10px 12px; border-radius:8px; margin-bottom:18px; }
.flash-error{ background:rgba(255,107,107,0.08); border:1px solid rgba(255,107,107,0.35); color:var(--danger); font-size:13px; padding:10px 12px; border-radius:8px; margin-bottom:18px; }

/* ---- Layout dashboard ---- */
.topbar{ height:64px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; padding:0 28px; background:var(--panel); }
.brand-top{ display:flex; align-items:center; gap:10px; }
.brand-dot{ width:10px; height:10px; border-radius:2px; background:var(--accent); transform:rotate(45deg); }
.brand-name{ font-weight:700; font-size:14px; }
.logout-btn{ background:transparent; border:1px solid var(--border); color:var(--text-muted); padding:8px 16px; border-radius:7px; font-size:13px; text-decoration:none; }
.logout-btn:hover{ color:var(--text); border-color:var(--text-muted); }

.dash-body{ display:flex; }
.sidebar{ width:220px; border-right:1px solid var(--border); min-height:calc(100vh - 64px); padding:24px 14px; display:flex; flex-direction:column; gap:4px; }
.nav-item{ display:block; padding:10px 14px; border-radius:7px; font-size:13.5px; color:var(--text-muted); text-decoration:none; }
.nav-item.active{ background:var(--accent-dim); color:var(--accent); font-weight:600; }
.nav-item:hover:not(.active){ color:var(--text); }

.main{ flex:1; padding:32px 36px; }
.main-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:14px; }
.main-head h2{ font-size:20px; }
.main-head .sub{ color:var(--text-muted); font-size:13px; margin-top:4px; }

.btn-accent{ background:var(--accent); color:#08110f; border:none; padding:10px 18px; border-radius:8px; font-weight:600; font-size:13.5px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; }
.btn-accent:hover{ filter:brightness(1.08); }
.btn-ghost{ background:transparent; border:1px solid var(--border); color:var(--text-muted); padding:11px; border-radius:8px; cursor:pointer; font-size:13.5px; text-decoration:none; display:inline-flex; align-items:center; }
.btn-ghost:hover{ color:var(--text); }

.stats-row{ display:flex; gap:16px; margin-bottom:26px; flex-wrap:wrap; }
.stat-card{ background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:16px 20px; min-width:150px; flex:1; }
.stat-card .num{ font-family:'Sora', sans-serif; font-size:26px; font-weight:700; color:var(--accent); }
.stat-card .lbl{ font-size:12px; color:var(--text-muted); margin-top:4px; }

.form-card{ background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:28px; max-width:420px; }

table{ width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
thead tr{ background:var(--panel-2); }
th{ text-align:left; padding:12px 18px; font-size:11.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; border-bottom:1px solid var(--border); }
td{ padding:14px 18px; font-size:13.5px; border-bottom:1px solid var(--border); }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:rgba(255,255,255,0.015); }

.badge{ display:inline-block; padding:4px 10px; border-radius:20px; font-size:11px; font-weight:600; font-family:'JetBrains Mono', monospace; }
.badge-admin{ background:rgba(0,217,181,0.12); color:var(--accent); }
.badge-editor{ background:rgba(255,193,7,0.12); color:#ffc107; }
.badge-viewer{ background:rgba(138,148,166,0.15); color:var(--text-muted); }

.icon-btn{ background:transparent; border:none; color:var(--text-muted); cursor:pointer; font-size:13px; padding:6px 8px; border-radius:6px; }
.icon-btn:hover{ color:var(--danger); background:rgba(255,107,107,0.08); }

.wilayah-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:20px; align-items:start; }
@media (max-width: 1100px){ .wilayah-grid{ grid-template-columns: 1fr; } }

.tabs{ display:flex; gap:6px; margin-bottom:20px; border-bottom:1px solid var(--border); }
.tab-item{ padding:10px 16px; font-size:13px; color:var(--text-muted); text-decoration:none; border-bottom:2px solid transparent; }
.tab-item.active{ color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }
.tab-item:hover:not(.active){ color:var(--text); }

.modal-overlay{ display:none; position:fixed; inset:0; background:rgba(8,11,15,0.7); backdrop-filter:blur(2px); align-items:center; justify-content:center; z-index:50; }
.modal{ background:var(--panel); border:1px solid var(--border); border-radius:12px; width:100%; max-width:400px; padding:28px; margin:16px; }
.modal h3{ font-size:17px; margin-bottom:4px; }
.modal .sub{ color:var(--text-muted); font-size:12.5px; margin-bottom:22px; }
.modal-actions{ display:flex; gap:10px; margin-top:22px; }
.modal-actions .btn-ghost, .modal-actions .btn-primary{ flex:1; }

@media (max-width: 720px){
  .sidebar{ display:none; }
  .main{ padding:22px 16px; }
  table, thead, tbody, th, td, tr{ display:block; }
  thead{ display:none; }
  tbody tr{ border-bottom:1px solid var(--border); padding:12px 4px; }
  td{ border:none; padding:6px 14px; display:flex; justify-content:space-between; }
  td::before{ content: attr(data-label); color:var(--text-muted); font-size:11px; text-transform:uppercase; }
}
