/* ============================================================
   Koceng MRTG — dark modern theme
   ============================================================ */
:root {
  --bg: #080b14;
  --bg-soft: #0d1220;
  --panel: rgba(17, 24, 39, 0.72);
  --panel-solid: #111827;
  --border: #1e2735;
  --border-soft: #1a2230;
  --text: #e6eaf2;
  --muted: #8b94a7;
  --accent: #22d3ee;
  --accent2: #a78bfa;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --grad: linear-gradient(135deg, #22d3ee 0%, #3b82f6 50%, #a78bfa 100%);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% -10%, rgba(167, 139, 250, 0.09), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(34, 211, 238, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243043; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #31445e; }

/* ---------------- navbar ---------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 20, 0.75);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--grad); color: #fff; border-radius: 10px;
  box-shadow: var(--glow-cyan);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-logo img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: 0.2px; }
.brand-name em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.badge-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%;
  box-shadow: 0 0 8px var(--red);
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--panel-solid); transition: all 0.18s ease;
  user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5); }
.btn-ghost { background: transparent; border-color: var(--border); position: relative; }
.btn-ghost:hover { border-color: #33445e; background: rgba(255,255,255,0.04); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- container & views ---------------- */
.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
#app { flex: 1; width: 100%; }

/* ---------------- footer ---------------- */
.app-footer {
  border-top: 1px solid var(--border-soft);
  padding: 20px 24px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.app-footer a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.app-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.brand-footer {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 5px; letter-spacing: 0.3px;
}
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; font-weight: 800; }
.view-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.back-btn:hover { color: var(--text); }

/* ---------------- stat cards row ---------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 18px;
  backdrop-filter: blur(8px);
}
.stat-card .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-card .value { font-size: 22px; font-weight: 800; margin-top: 6px; font-family: var(--mono); }
.stat-card .value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-card.in .value { color: var(--accent); }
.stat-card.out .value { color: var(--accent2); }
.stat-card.cpu .value { color: var(--amber); }
.stat-card.mem .value { color: var(--green); }

/* ---------------- router cards (dashboard) ---------------- */
.router-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.router-card {
  position: relative; background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px; cursor: pointer;
  backdrop-filter: blur(8px); transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden; --rc: var(--accent);
}
.router-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--rc); opacity: 0.55; transition: opacity 0.2s ease;
}
.router-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 45%, #2b3a52); box-shadow: 0 8px 26px color-mix(in srgb, var(--rc) 14%, transparent); }
.router-card:hover::before { opacity: 1; }
.router-card.offline { opacity: 0.85; }
.router-card .rc-top { display: flex; align-items: center; gap: 12px; }
.rc-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 18%, transparent), rgba(167,139,250,0.16));
  border: 1px solid color-mix(in srgb, var(--rc) 55%, var(--border));
}
.rc-title { flex: 1; min-width: 0; }
.rc-title .name { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-title .host { color: var(--muted); font-size: 12.5px; font-family: var(--mono); margin-top: 2px; }
.rc-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.4px; flex-shrink: 0;
}
.rc-status.up { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.rc-status.down { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.led.up { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
.led.down { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.rc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.rc-meta .m { text-align: center; padding: 10px 4px; background: rgba(0,0,0,0.22); border-radius: 10px; border: 1px solid var(--border-soft); }
.rc-meta .m .v { font-family: var(--mono); font-weight: 800; font-size: 14px; }
.rc-meta .m .k { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px; }
.rc-meta .m.tx .v { color: var(--accent); }
.rc-meta .m.rx .v { color: var(--accent2); }

.rc-traffic { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rc-traffic .t { flex: 1; }
.rc-traffic .t .bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; margin-top: 6px; }
.rc-traffic .t .bar span { display: block; height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.rc-traffic .t.rx .bar span { background: linear-gradient(90deg, #22d3ee, #3b82f6); }
.rc-traffic .t.tx .bar span { background: linear-gradient(90deg, #a78bfa, #6366f1); }
.rc-traffic .t .lbl { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }

.rc-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.rc-foot .chips { display: flex; gap: 6px; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border-soft); }
.chip.dyn { color: var(--amber); border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); }
.chip.up { color: var(--green); }
.chip.down { color: var(--red); }
.rc-foot .actions { display: flex; gap: 6px; }

/* ---------------- empty state ---------------- */
.empty {
  text-align: center; padding: 80px 24px; color: var(--muted);
  background: var(--panel); border: 1px dashed #2b3a52; border-radius: var(--radius);
}
.empty .big { font-size: 56px; margin-bottom: 14px; }
.empty h2 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.empty p { max-width: 460px; margin: 0 auto 22px; font-size: 14px; line-height: 1.6; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 11px 18px; border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .cnt { font-size: 11px; background: rgba(255,255,255,0.08); padding: 2px 7px; border-radius: 999px; font-family: var(--mono); }

/* ---------------- interface table ---------------- */
.iface-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.iface-tool-right { display: flex; align-items: center; gap: 10px; }
.page-size {
  background: rgba(0,0,0,0.25); border: 1px solid var(--border-soft); color: var(--text);
  border-radius: 8px; padding: 7px 8px; font-size: 12.5px; outline: none; color-scheme: dark;
  cursor: pointer;
}
.page-size:focus { border-color: var(--accent); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; }
.iface-search { position: relative; flex: 1; max-width: 400px; }
.iface-search .search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: 0.65; }
.iface-search input {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--border-soft); color: var(--text);
  border-radius: 10px; padding: 9px 12px 9px 34px; font-size: 13.5px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.iface-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,0.12); }
.iface-search input::placeholder { color: var(--muted); }
.table-wrap { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.data th {
  text-align: left; padding: 12px 16px; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.7px; border-bottom: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.02); white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th.sort-on { color: var(--accent); }
.sort-ic { font-size: 10px; margin-left: 5px; opacity: 0.5; }
th.sort-on .sort-ic { opacity: 1; }
table.data td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { cursor: pointer; transition: background 0.15s ease; }
table.data tbody tr:hover { background: rgba(34, 211, 238, 0.05); }
table.data tbody tr.selected { background: rgba(34, 211, 238, 0.09); }
.iface-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.iface-name .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.up { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.down { background: var(--red); box-shadow: 0 0 8px var(--red); }
.type-badge { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.type-lan { background: rgba(34,211,238,0.12); color: var(--accent); }
.type-ppp { background: rgba(167,139,250,0.14); color: var(--accent2); }
.type-vlan { background: rgba(251,191,36,0.12); color: var(--amber); }
.type-loopback { background: rgba(139,148,167,0.16); color: var(--muted); }
.type-lag { background: rgba(52,211,153,0.12); color: var(--green); }
.type-tunnel { background: rgba(248,113,113,0.12); color: var(--red); }
.type-pon { background: rgba(59,130,246,0.14); color: #60a5fa; }
.type-other { background: rgba(255,255,255,0.06); color: var(--muted); }
.rate { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.rate.in { color: var(--accent); }
.rate.out { color: var(--accent2); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.speed-badge { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.dyn-tag { font-size: 10px; font-weight: 800; color: var(--amber); border: 1px solid rgba(251,191,36,0.4); padding: 1px 6px; border-radius: 5px; margin-left: 6px; }
.iface-actions { display: inline-flex; align-items: center; gap: 6px; }
.btn-del-iface { padding: 3px 7px; font-size: 12px; }

/* ---------------- graph ---------------- */
.graph-card { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px; }
.graph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.iface-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
.iface-chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.03); color: var(--muted); font-size: 12.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.iface-chip:hover { border-color: #33445e; color: var(--text); }
.iface-chip.active { background: rgba(34,211,238,0.12); border-color: var(--accent); color: var(--accent); }
.iface-chip .cd { width: 7px; height: 7px; border-radius: 50%; }
.range-group { display: flex; gap: 4px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 10px; border: 1px solid var(--border-soft); }
.range-btn { border: none; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-family: var(--mono); }
.range-btn.active { background: var(--grad); color: #fff; }
.exp-fmt-row { display: flex; gap: 8px; }
.exp-fmt.active { border-color: var(--accent); color: var(--accent); background: rgba(34, 211, 238, 0.08); }
#chart { width: 100%; height: 420px; }
.graph-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.gs { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-soft); background: rgba(0,0,0,0.2); }
.gs .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.gs .v { font-family: var(--mono); font-size: 15px; font-weight: 800; margin-top: 4px; }
.gs.rx .v { color: var(--accent); }
.gs.tx .v { color: var(--accent2); }

/* ---------------- events ---------------- */
.events-list { max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.event-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); border-radius: 12px;
}
.event-ico { font-size: 18px; line-height: 1.3; }
.event-body { flex: 1; min-width: 0; }
.event-msg { font-size: 13.5px; font-weight: 600; }
.event-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; font-family: var(--mono); }
.kind-chip { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.4px; text-transform: uppercase; flex-shrink: 0; }
.kind-link-up { background: rgba(52,211,153,0.14); color: var(--green); }
.kind-link-down { background: rgba(248,113,113,0.14); color: var(--red); }
.kind-router-up { background: rgba(52,211,153,0.14); color: var(--green); }
.kind-router-down { background: rgba(248,113,113,0.14); color: var(--red); }
.kind-iface-new { background: rgba(34,211,238,0.14); color: var(--accent); }
.kind-iface-gone { background: rgba(251,191,36,0.14); color: var(--amber); }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px;
  overflow-y: auto;   /* modal tinggi → bisa scroll, gak kepotong di bawah */
}
.modal-backdrop.hidden { display: none; }
.modal {
  width: 100%; max-width: 480px; background: var(--panel-solid);
  border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow); animation: pop 0.2s ease;
  margin: auto;   /* grid item: tetap di tengah kalau muat, ikut scroll kalau tinggi */
}
.modal-lg { max-width: 560px; }
@keyframes pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal form label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.modal form input[type="text"], .modal form input[type="number"], .modal form input[type="month"], .modal form select {
  width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.3); color: var(--text);
  font-size: 14px; font-family: var(--mono); outline: none; transition: border-color 0.15s ease;
}
.modal form input:focus, .modal form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.color-row input[type="color"] { width: 48px; height: 36px; border: none; border-radius: 10px; background: transparent; cursor: pointer; padding: 0; }
.modal-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.spacer { flex: 1; }
.purge-month-input, .modal input[type="month"] {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--border-soft); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px; outline: none; color-scheme: dark;
}
.purge-month-input:focus, .modal input[type="month"]:focus { border-color: var(--accent); }
.test-result { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; border: 1px solid var(--border-soft); }
.test-result.ok { background: rgba(52,211,153,0.1); color: var(--green); border-color: rgba(52,211,153,0.3); }
.test-result.err { background: rgba(248,113,113,0.1); color: var(--red); border-color: rgba(248,113,113,0.3); }

/* ---------------- toasts ---------------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: var(--panel-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: slide-in 0.25s ease; max-width: 360px;
}
.toast.ok { border-left: 4px solid var(--green); }
.toast.err { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--accent); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- misc ---------------- */
.loader { display: grid; place-items: center; padding: 100px 0; color: var(--muted); gap: 14px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.confirm-inline { display: flex; align-items: center; gap: 8px; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--red); font-weight: 600; }

/* ---------------- login screen ---------------- */
.login-screen {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(700px 400px at 15% -10%, rgba(167, 139, 250, 0.12), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 32px; box-shadow: var(--shadow);
  animation: pop 0.25s ease;
}
.login-logo {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 22px;
  display: grid; place-items: center; color: #fff;
  background: var(--grad); box-shadow: var(--glow-cyan);
}
.login-logo svg { width: 52px; height: 52px; }
.login-logo img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; }
.login-title { font-size: 26px; font-weight: 800; }
.login-title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 24px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.3); color: var(--text); font-size: 14.5px; outline: none;
  transition: border-color 0.15s ease;
}
#login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }
.login-btn { justify-content: center; padding: 12px; font-size: 15px; }
.login-error { color: var(--red); font-size: 13px; font-weight: 600; }

/* ---------------- user chip ---------------- */
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}
.user-chip:hover { border-color: #33445e; }
.uc-ava {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; background: var(--grad);
}
.uc-info { display: flex; flex-direction: column; line-height: 1.15; }
.uc-name { font-size: 12.5px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------------- settings modal ---------------- */
.modal-settings { max-width: 680px; }
.settings-body { display: flex; flex-direction: column; gap: 24px; }
.settings-block h4 { font-size: 14px; margin-bottom: 14px; color: var(--text); }
.brand-logo-row { grid-template-columns: auto 1fr; align-items: flex-start; margin-bottom: 12px; }
.brand-name-row { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.brand-name-row label { margin-bottom: 0; }
.logo-preview {
  width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0;
  border: 1px dashed var(--border); background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload { display: flex; flex-direction: column; align-items: flex-start; }
.logo-btns { display: flex; gap: 8px; }
.form-row.pass-row { grid-template-columns: 1fr 1fr; }
.form-row.pass-row label { margin-bottom: 0; }
.user-add {
  display: grid; grid-template-columns: 1fr 1fr 130px auto;
  gap: 8px; margin-bottom: 14px; align-items: center;
}
.user-add input, .user-add select {
  padding: 10px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.3); color: var(--text); font-size: 13px; outline: none;
  width: 100%; height: 40px;
}
.user-add input:focus, .user-add select:focus { border-color: var(--accent); }
.user-add .btn { justify-content: center; height: 40px; white-space: nowrap; }
table.users-table { min-width: 100%; width: 100%; font-size: 13px; }
.settings-body, .modal-settings { overflow-x: auto; }
.users-table select { background: rgba(0,0,0,0.3); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; width: 110px; }
.users-table td { vertical-align: middle; }
.u-name { font-weight: 700; }
.u-actions { text-align: right; white-space: nowrap; }
.edit-row td { background: rgba(34, 211, 238, 0.04); }
.inline-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-edit input {
  padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.3); color: var(--text); font-size: 13px; outline: none;
  flex: 1; min-width: 150px;
}
.inline-edit input:focus { border-color: var(--accent); }

/* ---------------- lisensi ---------------- */
.license-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  text-align: center; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  background: rgba(251, 191, 36, 0.10); color: var(--amber);
  backdrop-filter: blur(8px);
}
.license-banner.warn { background: rgba(251, 191, 36, 0.12); color: var(--amber); }

/* ---------------- update ---------------- */
.update-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 0 0 18px; padding: 10px 16px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(52, 211, 153, 0.10));
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent); font-size: 13px; font-weight: 600;
}
.update-banner .btn { font-weight: 600; }
.upd-notes {
  margin-top: 6px; padding: 9px 12px; border-radius: 10px;
  background: rgba(0,0,0,0.22); border: 1px solid var(--border-soft);
  color: var(--text); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap;
}

.lic-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.3px;
}
.lic-badge.ok   { color: var(--green); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); }
.lic-badge.warn { color: var(--amber); background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.35); }
.lic-badge.err  { color: var(--red);   background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.35); }

#lic-form { display: flex; flex-direction: column; gap: 12px; }
#lic-form textarea {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.3); color: var(--text); font-size: 12.5px; outline: none;
  font-family: var(--mono); resize: vertical; min-height: 76px;
}
#lic-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }
.lic-badge { margin: 10px 0 2px; }

.lic-status-box { display: flex; flex-direction: column; gap: 8px; }
.lic-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(0,0,0,0.22); border: 1px solid var(--border-soft);
}
.lic-key { width: 120px; flex-shrink: 0; color: var(--muted); font-size: 12.5px; }
.lic-val { font-size: 13px; font-weight: 600; }
.lic-warn {
  margin-top: 4px; padding: 9px 12px; border-radius: 10px;
  background: rgba(251, 191, 36, 0.10); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--amber); font-size: 12.5px;
}
#lic-new-code {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0,0,0,0.3); color: var(--text); font-size: 12.5px; outline: none;
  font-family: var(--mono); resize: vertical;
}
#lic-new-code:focus { border-color: var(--accent); }

/* ---------------- graph title ---------------- */
.graph-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: rgba(0,0,0,0.22); border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.graph-title .gt-name { font-weight: 800; font-size: 15.5px; font-family: var(--mono); }
.graph-title .gt-sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.graph-title .gt-loading { color: var(--muted); font-size: 13px; }

/* ---------------- responsive ---------------- */
@media (max-width: 720px) {
  .nav-inner { padding: 10px 16px; }
  .brand-name { font-size: 15px; }
  .btn-primary span { display: none; }
  .container { padding: 18px 14px 50px; }
  .router-grid { grid-template-columns: 1fr; }
  #chart { height: 320px; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
