/* ============================================================
   SIGAP — Sistem Informasi Gerbang Akses Perumahan
   style.css — Stylesheet Utama
   ============================================================ */

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

:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #dbeafe;
  --success: #10b981; --success-light: #d1fae5;
  --warning: #f59e0b; --warning-light: #fef3c7;
  --danger: #ef4444;  --danger-light: #fee2e2;
  --bg: #f8fafc; --card: #fff; --border: #e2e8f0; --border-light: #f1f5f9;
  --text: #0f172a; --text-muted: #64748b; --text-light: #94a3b8;
  --sidebar: #0f172a; --sidebar-hover: #1e293b;
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -4px rgba(15,23,42,.05);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,.12), 0 8px 10px -6px rgba(15,23,42,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5; min-height: 100vh;
}

/* ===== LOGIN ===== */
#loginPage { display: flex; min-height: 100vh; }

.login-left {
  flex: 1;
  background: linear-gradient(160deg, #0f172a 0%, #1e2d4a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px; position: relative; overflow: hidden;
}
.login-left::before {
  content: ""; position: absolute;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 65%);
  top: -120px; left: -120px; pointer-events: none;
}
.login-left::after {
  content: ""; position: absolute;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.1) 0%, transparent 65%);
  bottom: -100px; right: -80px; pointer-events: none;
}
.ll-inner { position: relative; z-index: 2; max-width: 440px; width: 100%; }
.ll-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.ll-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 14px; display: grid; place-items: center;
  color: white; box-shadow: 0 8px 24px rgba(37,99,235,.4); flex-shrink: 0;
}
.ll-logo-text h1 { font-size: 22px; font-weight: 800; color: white; letter-spacing: -.02em; }
.ll-logo-text p { font-size: 11px; color: #4a6080; margin-top: 3px; letter-spacing: .04em; text-transform: uppercase; }

.ll-headline { font-size: 40px; font-weight: 800; color: white; letter-spacing: -.04em; line-height: 1.15; margin-bottom: 16px; }
.ll-headline span { background: linear-gradient(135deg, #60a5fa, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ll-desc { color: #4a6080; font-size: 14px; line-height: 1.7; margin-bottom: 48px; }

.ll-features { display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }
.ll-feat { display: flex; align-items: center; gap: 14px; }
.ll-feat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.ll-feat-icon.c1 { background: rgba(59,130,246,.15); color: #60a5fa; }
.ll-feat-icon.c2 { background: rgba(16,185,129,.15); color: #34d399; }
.ll-feat-icon.c3 { background: rgba(245,158,11,.15); color: #fbbf24; }
.ll-feat-icon.c4 { background: rgba(139,92,246,.15); color: #a78bfa; }
.ll-feat-text { font-size: 13.5px; color: #94a3b8; font-weight: 500; }
.ll-feat-text strong { color: #cbd5e1; font-weight: 600; }

.ll-divider { border: none; border-top: 1px solid rgba(255,255,255,.07); margin-bottom: 24px; }
.ll-tagline { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #3d5273; font-weight: 600; letter-spacing: .04em; }
.ll-tagline::before, .ll-tagline::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.06); }

.login-right {
  width: 460px; background: white;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 48px; position: relative;
}
.login-right::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #3b82f6, #818cf8, #34d399);
}
.login-form-wrap { width: 100%; }
.lf-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eff6ff; color: #2563eb;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px; margin-bottom: 20px;
}
.login-form-wrap h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; color: #0f172a; }
.login-form-wrap .subtitle { color: #64748b; font-size: 13.5px; margin-bottom: 28px; line-height: 1.6; }

.account-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.account-card {
  border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px 14px;
  cursor: pointer; transition: all .2s; position: relative; background: white;
}
.account-card:hover { border-color: #93c5fd; box-shadow: 0 4px 16px rgba(37,99,235,.1); transform: translateY(-1px); }
.account-card.selected { border-color: #2563eb; background: #f8fbff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.ac-check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #2563eb; color: white;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  opacity: 0; transform: scale(.5); transition: all .2s;
}
.account-card.selected .ac-check { opacity: 1; transform: scale(1); }
.account-card .ac-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; color: white; }
.account-card.admin-card .ac-icon { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.account-card.op-card .ac-icon { background: linear-gradient(135deg, #10b981, #047857); }
.account-card.op-card .ac-check { background: #10b981; }
.account-card .ac-name { font-weight: 700; font-size: 13px; color: #0f172a; }
.account-card .ac-role { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-top: 4px; display: inline-block; }
.account-card.admin-card .ac-role { background: #dbeafe; color: #1d4ed8; }
.account-card.op-card .ac-role { background: #d1fae5; color: #047857; }

.divider-label { font-size: 11px; color: #94a3b8; text-align: center; margin-bottom: 16px; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }

.login-hint { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 11px 14px; font-size: 12px; color: #64748b; margin-bottom: 16px; line-height: 1.8; }
.login-hint strong { color: #1e40af; font-family: 'JetBrains Mono', monospace; }

.err-msg { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #dc2626; margin-bottom: 14px; display: none; align-items: center; gap: 10px; }
.err-msg.show { display: flex; }

.fl-group { margin-bottom: 18px; }
.fl-label { display: block; font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 7px; letter-spacing: .02em; }
.fl-wrap { position: relative; }
.fl-wrap svg.prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #9ca3af; pointer-events: none; }
.fl-input {
  width: 100%; padding: 12px 44px;
  border: 1.5px solid #e5e7eb; border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: #fafafa; color: #0f172a; transition: all .2s;
}
.fl-input:focus { outline: none; border-color: #3b82f6; background: white; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.fl-input.err { border-color: #ef4444; }
.fl-eye { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; border-radius: 6px; display: flex; align-items: center; transition: color .15s; }
.fl-eye:hover { color: #374151; }

.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.4); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-footer { text-align: center; font-size: 11.5px; color: #94a3b8; margin-top: 18px; }

@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
}

/* ===== APP LAYOUT ===== */
#appPage { display: none; }
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  background: linear-gradient(180deg, #0c1220 0%, #0f172a 100%);
  color: #cbd5e1; padding: 20px 0; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}
.logo { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 8px; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 38px; height: 38px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-radius: 10px; display: grid; place-items: center; color: white; box-shadow: 0 4px 16px rgba(37,99,235,.4); }
.logo-text h1 { font-size: 17px; font-weight: 800; color: white; letter-spacing: -.03em; }
.logo-text small { font-size: 9.5px; color: #475569; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

.role-badge { margin: 8px 12px 12px; padding: 9px 14px; border-radius: 10px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.role-badge.admin { background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.2); }
.role-badge.operator { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.2); }
.role-badge .rdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

.nav-section { margin-bottom: 4px; }
.nav-label { padding: 14px 20px 7px; font-size: 9.5px; color: #334155; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: #94a3b8; cursor: pointer; font-size: 13.5px; font-weight: 500; margin: 1px 8px; border-radius: 8px; transition: all .18s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-item.active { background: linear-gradient(135deg, rgba(37,99,235,.2), rgba(37,99,235,.08)); color: white; box-shadow: inset 3px 0 0 #3b82f6; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge { margin-left: auto; background: rgba(59,130,246,.3); color: #93c5fd; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 700; border: 1px solid rgba(59,130,246,.3); }

.sidebar-footer { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); transition: all .15s; }
.user-card:hover { background: rgba(255,255,255,.08); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: white; font-weight: 700; font-size: 13px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.user-info { flex: 1; min-width: 0; }
.user-info .nm { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .rl { font-size: 10.5px; color: #475569; margin-top: 1px; }
.logout-btn { width: 28px; height: 28px; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.2); border-radius: 7px; color: #f87171; cursor: pointer; display: grid; place-items: center; transition: all .15s; flex-shrink: 0; }
.logout-btn:hover { background: rgba(239,68,68,.3); color: white; }

/* ===== TOPBAR ===== */
.main { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: white; border-bottom: 1px solid #f1f5f9; padding: 0 32px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.page-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.breadcrumb { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; border-radius: 20px; font-size: 11px; font-weight: 700; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; animation: pulse 1.6s infinite; }
.clk { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 500; color: #64748b; padding: 7px 13px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.ib { width: 36px; height: 36px; border: 1px solid #e2e8f0; background: white; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: #64748b; transition: all .15s; }
.ib:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }

/* ===== CONTENT & PAGES ===== */
.content { padding: 24px 32px; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); } }

/* ===== CARDS ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid #f1f5f9; border-radius: 14px; padding: 20px; transition: all .25s; position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 14px 14px 0 0; }
.stat-card.sc-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.sc-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.sc-orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.sc-red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.1); transform: translateY(-3px); }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.stat-icon.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.stat-icon.green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.stat-icon.orange { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.stat-icon.red { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }
.stat-label { font-size: 11.5px; color: #64748b; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat-foot { font-size: 11px; color: #94a3b8; margin-top: 8px; }

/* ===== DASHBOARD ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-bottom: 20px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.chart-box h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.chart-box .sub { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.cc { height: 220px; position: relative; }
.cc canvas { width: 100%; height: 100%; }
.cl { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--text-muted); }
.li { display: flex; align-items: center; gap: 6px; }
.ls { width: 10px; height: 10px; border-radius: 2px; }

/* ===== FEED ===== */
.feed-list { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 42px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border-light); transition: background .15s; }
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--bg); }
.feed-item.fresh { animation: flashRow 1.5s ease; }
@keyframes flashRow { 0% { background: #fef9c3; } 100% { background: transparent; } }
.fav { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: white; }
.fi-name { font-weight: 600; font-size: 14px; }
.fi-uid { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.ft { text-align: right; font-size: 13px; font-weight: 500; font-family: 'JetBrains Mono', monospace; }
.ft .fd { font-size: 11px; color: var(--text-muted); font-weight: 400; font-family: inherit; margin-top: 2px; }
.bs { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 12px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bs.in { background: var(--success-light); color: #047857; }
.bs.out { background: var(--warning-light); color: #b45309; }
.bs.deny { background: var(--danger-light); color: #b91c1c; }
.bs::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.empty-s { padding: 60px 20px; text-align: center; color: var(--text-light); }
.empty-s svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .5; display: block; margin-left: auto; margin-right: auto; }

/* ===== QUICK PANEL ===== */
.quick-card { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; padding: 20px; border-radius: 12px; margin-bottom: 16px; }
.quick-card h3 { font-size: 15px; margin-bottom: 4px; font-weight: 700; }
.quick-card p { font-size: 12px; opacity: .85; margin-bottom: 14px; }
.qa { display: grid; gap: 8px; }
.qb { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); color: white; padding: 9px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; display: flex; justify-content: space-between; align-items: center; transition: all .15s; font-family: inherit; }
.qb:hover { background: rgba(255,255,255,.25); }
.qb .qu { opacity: .7; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.qb.deny { background: rgba(239,68,68,.4); border-color: rgba(239,68,68,.5); }
.qb.deny:hover { background: rgba(239,68,68,.6); }

.gate-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.gate-card h3 { font-size: 14px; margin-bottom: 14px; font-weight: 700; }
.gate-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.gate-row:last-child { border-bottom: none; }
.gate-row .gk { color: var(--text-muted); }
.gate-row .gv { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.gate-row .gv .gdot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ===== TABLE ===== */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead { background: var(--bg); }
th { text-align: left; padding: 12px 20px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--bg); }
.cu { display: flex; align-items: center; gap: 12px; }
.cuid { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); }
.ra { display: flex; gap: 6px; justify-content: flex-end; }
.bis { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); transition: all .15s; }
.bis:hover { background: var(--bg); color: var(--text); }
.bis.danger:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s; font-family: inherit; }
.btn-p { background: var(--primary); color: white; }
.btn-p:hover { background: var(--primary-dark); }
.btn-s { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-s:hover { background: var(--bg); }
.btn-d { background: var(--danger); color: white; }
.btn-d:hover { background: #dc2626; }

/* ===== FORMS ===== */
.fg { margin-bottom: 16px; }
.fl { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.fi, .fs { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit; background: var(--card); color: var(--text); transition: all .15s; }
.fi:focus, .fs:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fh { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.si { flex: 1; min-width: 200px; position: relative; }
.si input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--card); font-family: inherit; }
.si input:focus { outline: none; border-color: var(--primary); }
.si svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); }

/* ===== TOGGLE ===== */
.tgl { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl .sl { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: .2s; }
.tgl .sl::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tgl input:checked + .sl { background: var(--primary); }
.tgl input:checked + .sl::before { transform: translateX(18px); }
.sr { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.sr:last-child { border-bottom: none; }
.si-label { font-weight: 600; font-size: 13.5px; }
.si-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== AVATAR COLORS ===== */
.av1 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.av2 { background: linear-gradient(135deg, #10b981, #047857); }
.av3 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.av4 { background: linear-gradient(135deg, #ec4899, #be185d); }
.av5 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.av6 { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.avd { background: linear-gradient(135deg, #ef4444, #b91c1c); }

/* ===== MODAL ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; z-index: 100; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-bg.show { display: flex; }
.modal { background: var(--card); border-radius: 12px; width: 100%; max-width: 480px; box-shadow: var(--shadow-xl); animation: mIn .2s; }
@keyframes mIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.mh { padding: 18px 20px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.mh h3 { font-size: 16px; font-weight: 700; }
.mb { padding: 20px; }
.mf { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 200; transform: translateY(100px); opacity: 0; transition: all .3s; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #0f172a; color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--primary); color: white; }

/* ===== TAP NOTIFICATION ===== */
#tapNotifStack { position: fixed; top: 80px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.tap-notif { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-xl); min-width: 300px; max-width: 340px; pointer-events: all; transform: translateX(380px); opacity: 0; transition: all .35s cubic-bezier(.34,1.56,.64,1); position: relative; overflow: hidden; }
.tap-notif.show { transform: translateX(0); opacity: 1; }
.tap-notif.hide { transform: translateX(380px); opacity: 0; transition: all .25s ease; }
.tap-notif::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.tap-notif.n-in::before { background: var(--success); }
.tap-notif.n-out::before { background: var(--warning); }
.tap-notif.n-deny::before { background: var(--danger); }
.tn-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: white; flex-shrink: 0; }
.tn-body { flex: 1; min-width: 0; }
.tn-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-row { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.tn-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.tap-notif.n-in .tn-badge { background: var(--success-light); color: #047857; }
.tap-notif.n-out .tn-badge { background: var(--warning-light); color: #b45309; }
.tap-notif.n-deny .tn-badge { background: var(--danger-light); color: #b91c1c; }
.tn-uid { font-size: 11px; color: var(--text-light); font-family: 'JetBrains Mono', monospace; }
.tn-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.tn-close { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; background: var(--bg); border: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); font-size: 11px; }
.tn-close:hover { background: var(--border); }
.tn-bar { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; transform-origin: left; animation: shrinkBar 5s linear forwards; }
.tap-notif.n-in .tn-bar { background: var(--success); }
.tap-notif.n-out .tn-bar { background: var(--warning); }
.tap-notif.n-deny .tn-bar { background: var(--danger); }
@keyframes shrinkBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ===== BELL NOTIF ===== */
.notif-btn { position: relative; }
.n-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; background: var(--danger); color: white; border-radius: 9px; font-size: 10px; font-weight: 700; display: none; place-items: center; border: 2px solid var(--card); padding: 0 3px; }
.n-badge.show { display: grid; }
.notif-panel { position: fixed; top: 68px; right: 24px; width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xl); z-index: 250; display: none; overflow: hidden; animation: mIn .2s; }
.notif-panel.show { display: block; }
.np-head { padding: 14px 18px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.np-head h3 { font-size: 14px; font-weight: 700; }
.np-clr { font-size: 12px; color: var(--primary); cursor: pointer; font-weight: 600; background: none; border: none; font-family: inherit; }
.np-clr:hover { text-decoration: underline; }
.np-list { max-height: 380px; overflow-y: auto; }
.np-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border-light); transition: background .15s; }
.np-item:last-child { border-bottom: none; }
.np-item:hover { background: var(--bg); }
.np-item.unread { background: linear-gradient(90deg, #fefce8, var(--card)); }
.np-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: white; flex-shrink: 0; }
.np-name { font-weight: 600; font-size: 13px; }
.np-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.np-ntime { font-size: 10px; color: var(--text-light); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.np-empty { padding: 40px 20px; text-align: center; color: var(--text-light); font-size: 13px; }
.np-foot { padding: 11px 18px; border-top: 1px solid var(--border-light); text-align: center; }
.np-foot span { font-size: 13px; color: var(--primary); font-weight: 600; cursor: pointer; }
.np-foot span:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } .chart-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .sidebar { display: none; } .content { padding: 16px; } .topbar { padding: 12px 16px; } }


/* =========================================================
   LOGIN ROLE BADGE — identitas fixed per halaman
   (index.html = operator, admin.html = admin)
   ========================================================= */
.login-role-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1.5px solid;
}

/* Operator variant (hijau) */
.login-role-badge--operator {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
}
.login-role-badge--operator .lrb-icon {
  background: linear-gradient(135deg, #10b981, #047857);
}

/* Admin variant (biru) */
.login-role-badge--admin {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}
.login-role-badge--admin .lrb-icon,
.lrb-icon--admin {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.lrb-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.lrb-info { flex: 1; }
.lrb-name { font-weight: 700; font-size: 14px; color: var(--text); }
.lrb-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.lrb-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
.lrb-dot--green { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.lrb-dot--blue  { background: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }

/* ====================================================
   ADMIN LOGIN — Sisi kiri biru gelap, semua teks di-override agar kontras
   ==================================================== */
.login-left--admin {
  background: linear-gradient(160deg, #0c1e4a 0%, #1233a0 55%, #1d4ed8 100%) !important;
}

/* Dekorasi lingkaran: sesuaikan warna agar cocok di biru */
.login-left--admin::before {
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 65%) !important;
}
.login-left--admin::after {
  background: radial-gradient(circle, rgba(99,179,237,.12) 0%, transparent 65%) !important;
}

/* Logo subtitle */
.login-left--admin .ll-logo-text p {
  color: #93c5fd !important;
}

/* Headline biasa putih, span gradient cerah */
.login-left--admin .ll-headline {
  color: #ffffff !important;
}
.login-left--admin .ll-headline span {
  background: linear-gradient(135deg, #fbbf24, #f9a8d4) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Deskripsi — cukup terang di atas biru gelap */
.login-left--admin .ll-desc {
  color: #bfdbfe !important;
}

/* Feature icons — warna lebih cerah agar terlihat */
.login-left--admin .ll-feat-icon.c1 { background: rgba(255,255,255,.12) !important; color: #93c5fd !important; }
.login-left--admin .ll-feat-icon.c2 { background: rgba(255,255,255,.12) !important; color: #6ee7b7 !important; }
.login-left--admin .ll-feat-icon.c3 { background: rgba(255,255,255,.12) !important; color: #fcd34d !important; }
.login-left--admin .ll-feat-icon.c4 { background: rgba(255,255,255,.12) !important; color: #c4b5fd !important; }

/* Feature text — putih agar terbaca */
.login-left--admin .ll-feat-text {
  color: #bfdbfe !important;
}
.login-left--admin .ll-feat-text strong {
  color: #ffffff !important;
}

/* Divider & tagline */
.login-left--admin .ll-divider {
  border-top-color: rgba(255,255,255,.15) !important;
}
.login-left--admin .ll-tagline {
  color: #93c5fd !important;
}
.login-left--admin .ll-tagline::before,
.login-left--admin .ll-tagline::after {
  background: rgba(255,255,255,.12) !important;
}

/* Eyebrow kanan — badge biru muda */
.lf-eyebrow--admin {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* Tombol login admin */
.btn-login--admin {
  background: linear-gradient(135deg, #2563eb, #1e3a8a) !important;
}
.btn-login--admin:hover {
  background: linear-gradient(135deg, #1d4ed8, #0c1e4a) !important;
  transform: translateY(-2px);
}
