/* ============================================================
   NetRadar — tema biru putih terang, modern
   ============================================================ */
:root {
  --blue-900: #0c2d6b;
  --blue-800: #1240a0;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --bg:       #f2f6ff;
  --card:     #ffffff;
  --line:     #e3eaf6;
  --text:     #17233f;
  --muted:    #64748b;
  --green:    #10b981;
  --amber:    #f59e0b;
  --red:      #ef4444;
  --shadow:   0 1px 2px rgba(23, 43, 99, .05), 0 8px 24px -12px rgba(23, 43, 99, .14);
  --shadow-lg:0 2px 4px rgba(23, 43, 99, .06), 0 20px 44px -16px rgba(23, 43, 99, .22);
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
code { background: var(--blue-50); color: var(--blue-700); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ============ LOGIN ============ */
.login-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf2ff 0%, #f8fbff 45%, #e3edff 100%);
  overflow: hidden;
}
.login-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(37, 99, 235, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.orb-1 { width: 480px; height: 480px; background: #93c5fd; top: -140px; right: -100px; }
.orb-2 { width: 420px; height: 420px; background: #bfdbfe; bottom: -160px; left: -80px; }

.login-card {
  position: relative; width: 400px; max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px; padding: 38px 36px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.brand-logo {
  width: 62px; height: 62px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .55);
}
.brand-logo.sm { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; margin: 0; }
.login-brand h1 { font-size: 1.85rem; letter-spacing: -.5px; }
.login-brand h1 span, .brand-name span { color: var(--blue-600); }
.login-brand p { color: var(--muted); font-size: .85rem; margin-top: 4px; }

#login-form label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .6px; }
#login-form input {
  width: 100%; padding: 12px 14px; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  background: #fff; transition: border .15s, box-shadow .15s;
  font-family: var(--font); color: var(--text);
}
#login-form input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .14); }
.btn-primary {
  width: 100%; margin-top: 20px; padding: 13px; font-size: .95rem; font-weight: 700;
  color: #fff; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  box-shadow: 0 10px 22px -8px rgba(37, 99, 235, .6);
  transition: transform .12s, box-shadow .12s; font-family: var(--font);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -8px rgba(37, 99, 235, .65); }
.login-error { margin-top: 12px; padding: 10px 12px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 10px; font-size: .84rem; }
.login-foot { margin-top: 22px; text-align: center; }
.login-demo { font-size: .8rem; color: var(--muted); }
.login-stack { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.stack-pill { font-size: .72rem; padding: 4px 10px; background: var(--blue-50); color: var(--blue-700); border-radius: 20px; border: 1px solid var(--blue-100); font-weight: 600; }

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

.sidebar {
  width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar-brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.4px; }
.brand-sub { font-size: .7rem; color: var(--muted); }

.nav { flex: 1; margin-top: 12px; overflow-y: auto; }
.nav-section { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0; border-radius: 11px;
  color: #47566f; text-decoration: none; font-size: .9rem; font-weight: 600;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-item.active { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55); }
.nav-ic { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; min-width: 19px; height: 19px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.nav-item.active .nav-badge { background: #fff; color: var(--red); }

.sidebar-router { border-top: 1px solid var(--line); padding: 14px 8px 2px; }
.router-status { font-size: .72rem; color: var(--green); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.router-name { font-weight: 700; font-size: .88rem; margin-top: 6px; }
.router-meta { font-size: .72rem; color: var(--muted); }
.router-gauges { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mini-gauge { display: flex; align-items: center; gap: 8px; }
.mini-gauge-label { font-size: .66rem; font-weight: 700; color: var(--muted); width: 28px; }
.mini-bar { flex: 1; height: 6px; background: var(--blue-50); border-radius: 4px; overflow: hidden; }
.mini-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue-500), var(--blue-400)); border-radius: 4px; transition: width .6s; }
.mini-fill.hot { background: linear-gradient(90deg, var(--amber), var(--red)); }
.mini-val { font-size: .68rem; font-weight: 700; width: 34px; text-align: right; color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; background: rgba(242, 246, 255, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h2 { font-size: 1.25rem; letter-spacing: -.4px; }
.breadcrumb { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-pill {
  display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 700;
  background: #fff; border: 1px solid var(--line); padding: 7px 13px; border-radius: 20px;
  color: var(--text); box-shadow: var(--shadow);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--green); box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.user-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); padding: 6px 8px 6px 6px; border-radius: 14px; box-shadow: var(--shadow); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-600), var(--blue-400)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.user-chip-txt { line-height: 1.15; }
.user-chip-txt b { font-size: .8rem; display: block; }
.user-chip-txt small { font-size: .66rem; color: var(--muted); }
.btn-ghost { border: none; background: transparent; cursor: pointer; font-size: 1rem; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }

.page { padding: 24px 28px 40px; }

/* ============ KOMPONEN UMUM ============ */
.grid { display: grid; gap: 18px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-title { font-size: .95rem; font-weight: 700; }
.card-sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }

.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--blue-50); opacity: .7; }
.kpi-ico { font-size: 1.25rem; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--blue-50); margin-bottom: 12px; position: relative; z-index: 1; }
.kpi-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.8px; margin-top: 2px; position: relative; z-index: 1; }
.kpi-value small { font-size: .85rem; color: var(--muted); font-weight: 600; }
.kpi-trend { font-size: .72rem; margin-top: 6px; font-weight: 700; position: relative; z-index: 1; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted); }
.kpi.kpi-alert::after { background: #fef2f2; }
.kpi.kpi-alert .kpi-ico { background: #fef2f2; }

.seg { display: flex; background: var(--blue-50); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 14px; font-size: .76rem; font-weight: 700; color: var(--muted); border-radius: 8px; cursor: pointer; font-family: var(--font); }
.seg button.active { background: #fff; color: var(--blue-700); box-shadow: 0 1px 4px rgba(23,43,99,.12); }

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.sm { height: 230px; }

/* Tabel */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .7px; color: #8aa0b8; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #eef3fb; vertical-align: middle; white-space: nowrap; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--blue-50); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Halaman Anomali & Alert */
.alert-mid { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .alert-mid { grid-template-columns: 1fr; } }
.cat-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cat-row:last-child { border-bottom: none; }
.cat-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.cat-body { flex: 1; min-width: 0; }
.cat-top { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; margin-bottom: 5px; }
.cat-top b { color: var(--blue-700); font-variant-numeric: tabular-nums; }
.alert-search {
  flex: 1; min-width: 200px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 20px; outline: none;
  font-size: .78rem; font-family: var(--font); color: var(--text); background: #fff;
}
.alert-search:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.about-item { display: flex; gap: 12px; align-items: flex-start; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 14px; padding: 14px 16px; }
.about-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: var(--shadow); }
.about-item b { font-size: .85rem; display: block; margin-bottom: 4px; }
.about-item p { font-size: .78rem; color: #47566f; line-height: 1.55; margin: 0; }

/* Pagination */
.pagi { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pagi-info { font-size: .78rem; color: var(--muted); font-weight: 600; }
.pagi-btns { display: flex; gap: 4px; align-items: center; }
.pagi-btns button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: .8rem; font-weight: 700; cursor: pointer; font-family: var(--font);
  transition: background .12s, color .12s;
}
.pagi-btns button:hover:not(:disabled) { background: var(--blue-50); color: var(--blue-700); }
.pagi-btns button.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 4px 10px -4px rgba(37, 99, 235, .5); }
.pagi-btns button:disabled { opacity: .4; cursor: default; }
.pagi-dots { color: var(--muted); font-size: .8rem; padding: 0 2px; }
.pg-size {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .78rem; font-weight: 700; color: var(--text); background: #fff;
  font-family: var(--font); cursor: pointer; outline: none;
}
.pg-size:focus { border-color: var(--blue-500); }

th.sortable { cursor: pointer; user-select: none; transition: color .12s; }
th.sortable:hover { color: var(--blue-600); }
th.sortable.sort-desc, th.sortable.sort-asc { color: var(--blue-700); }
th.sortable.sort-desc::after { content: " ▼"; font-size: .58rem; }
th.sortable.sort-asc::after { content: " ▲"; font-size: .58rem; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--blue-50); color: var(--blue-700); font-weight: 800; font-size: .76rem; display: inline-flex; align-items: center; justify-content: center; }
.rank.r1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank.r2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank.r3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.host-cell { display: flex; align-items: center; gap: 10px; }
.host-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.host-name { font-weight: 700; font-size: .84rem; }
.host-ip { font-size: .72rem; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; }
.rate-down { color: var(--blue-700); font-weight: 700; }
.rate-up { color: var(--green); font-weight: 700; }
.spark { display: block; }
.usagebar { height: 6px; border-radius: 4px; background: var(--blue-50); overflow: hidden; min-width: 90px; }
.usagebar > div { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--blue-400)); border-radius: 4px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.badge-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-warning  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-info     { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); }
.badge-ok       { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-off      { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.badge-anom     { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* Alert list */
.alert-item { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff; transition: box-shadow .15s; align-items: flex-start; }
.alert-item:hover { box-shadow: var(--shadow); }
.alert-item.sev-critical { border-left: 4px solid var(--red); }
.alert-item.sev-warning  { border-left: 4px solid var(--amber); }
.alert-item.sev-info     { border-left: 4px solid var(--blue-500); }
.alert-item.acked { opacity: .55; }
.alert-ico { font-size: 1.1rem; width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.sev-critical .alert-ico { background: #fef2f2; }
.sev-warning  .alert-ico { background: #fffbeb; }
.sev-info     .alert-ico { background: var(--blue-50); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 700; font-size: .88rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert-detail { font-size: .8rem; color: var(--muted); margin-top: 3px; line-height: 1.45; white-space: normal; }
.alert-meta { font-size: .7rem; color: #94a3b8; margin-top: 6px; }
.btn-ack { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 12px; font-size: .74rem; font-weight: 700; color: var(--blue-700); cursor: pointer; font-family: var(--font); flex-shrink: 0; }
.btn-ack:hover { background: var(--blue-50); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 20px; font-size: .78rem; font-weight: 700; color: var(--muted); cursor: pointer; font-family: var(--font); }
.chip.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* Interface (tabel) */
.if-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.if-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; color: var(--muted);
  background: var(--blue-50); border: 1px solid var(--blue-100);
  padding: 6px 12px; border-radius: 20px;
}
.if-chip b { color: var(--text); }
.if-chip.chip-ok { color: #059669; background: #ecfdf5; border-color: #a7f3d0; font-weight: 700; }
.if-chip.chip-down { color: #dc2626; background: #fef2f2; border-color: #fecaca; font-weight: 700; }
.if-table td { padding: 12px; }
tr.if-down td { opacity: .5; }
tr.if-down:hover td { opacity: .8; }

/* Health gauges */
.gauge-row { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-around; }
.gauge { text-align: center; }
.gauge-ring { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; position: relative; }
.gauge-ring::before { content: ""; position: absolute; inset: 9px; background: var(--card); border-radius: 50%; }
.gauge-val { position: relative; font-weight: 800; font-size: 1.05rem; letter-spacing: -.5px; }
.gauge-label { font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: 8px; }

/* Settings */
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.form-row input, .form-row select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .86rem; font-family: var(--font); color: var(--text); background: #fff; outline: none;
}
.form-row input:focus { border-color: var(--blue-500); }
.form-row input[readonly] { background: #f8fafc; color: var(--muted); }
.ro-note { display: flex; gap: 10px; align-items: center; background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-800); border-radius: 12px; padding: 12px 14px; font-size: .8rem; margin-bottom: 16px; }
.arch-list { list-style: none; }
.arch-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .84rem; align-items: flex-start; }
.arch-list li:last-child { border: none; }
.arch-ic { font-size: 1.1rem; }
.arch-list b { display: block; }
.arch-list small { color: var(--muted); }

/* Tombol view detail */
.btn-view {
  border: 1px solid var(--blue-100); background: var(--blue-50); color: var(--blue-700);
  border-radius: 9px; padding: 6px 12px; font-size: .74rem; font-weight: 700;
  cursor: pointer; font-family: var(--font); transition: background .12s, transform .1s;
}
.btn-view:hover { background: var(--blue-100); transform: translateY(-1px); }

/* Modal detail per-IP */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(12, 30, 70, .38); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 20px; width: 940px; max-width: 100%;
  max-height: 92vh; overflow-y: auto; padding: 24px;
  box-shadow: var(--shadow-lg); animation: popin .18s ease;
}
@keyframes popin { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.modal-close { font-size: 1.05rem; }
.modal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.mstat { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 12px; padding: 10px 14px; }
.mstat span { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.mstat b { font-size: .98rem; letter-spacing: -.3px; }

/* Torch (rincian trafik per tujuan) */
.torch-sec { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.torch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.torch-table td { padding: 9px 12px; font-size: .82rem; }
.svc-cell { display: flex; align-items: center; gap: 9px; }
.svc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.svc-name { font-size: .82rem; font-weight: 700; }
.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: .76rem; color: var(--muted); }
.proto-badge {
  display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 7px; font-family: Consolas, monospace;
}
.proto-badge.tcp { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); }
.proto-badge.udp { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.share-cell { display: flex; align-items: center; gap: 8px; }
.share-bar { flex: 1; height: 7px; border-radius: 4px; background: #eef3fb; overflow: hidden; min-width: 70px; }
.share-bar > div { height: 100%; border-radius: 4px; transition: width .5s; }
.share-cell span { font-size: .72rem; font-weight: 800; color: var(--muted); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* Toasts */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue-500);
  border-radius: 13px; padding: 13px 16px; width: 340px; box-shadow: var(--shadow-lg);
  animation: slidein .25s ease; font-size: .82rem;
}
.toast.sev-critical { border-left-color: var(--red); }
.toast.sev-warning { border-left-color: var(--amber); }
.toast b { display: block; font-size: .84rem; margin-bottom: 2px; }
.toast span { color: var(--muted); font-size: .76rem; line-height: 1.4; display: block; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* Dashboard layout helpers */
.dash-main { grid-template-columns: 2fr 1fr; }
.dash-bottom { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 1100px) { .dash-main, .dash-bottom { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .page { padding: 16px; }
}

.section-gap { margin-top: 18px; }
.link-more { font-size: .78rem; font-weight: 700; color: var(--blue-600); text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: .85rem; }

/* ============================================================
   SETTINGS v2 — tab interaktif, multi-router, toggle, dsb.
   ============================================================ */
.settings-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.settings-tabs { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 8px; }
.s-tab {
  display: flex; gap: 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-family: var(--font);
  transition: border .15s, box-shadow .15s, background .15s;
}
.s-tab:hover { border-color: var(--blue-400); }
.s-tab.active { border-color: var(--blue-500); background: linear-gradient(135deg, var(--blue-50), #fff); box-shadow: 0 0 0 3px rgba(59, 130, 246, .13); }
.s-tab-ic { font-size: 1.05rem; width: 38px; height: 38px; background: var(--blue-50); border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.s-tab-txt b { font-size: .84rem; display: block; color: var(--text); }
.s-tab-txt small { font-size: .68rem; color: var(--muted); }
.settings-body { min-width: 0; }
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .s-tab { flex-shrink: 0; }
  .s-tab-txt small { display: none; }
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.sw-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; cursor: pointer; transition: background .2s; }
.sw-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + .sw-slider { background: var(--blue-600); }
.switch input:checked + .sw-slider::before { transform: translateX(20px); }

/* Field layout */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 760px) { .field-grid, .field-grid-3 { grid-template-columns: 1fr; } }
.form-row-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.form-row-inline label { margin: 0; }
.form-row label small { font-weight: 500; text-transform: none; }
.form-row textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .72rem; font-family: "Cascadia Code", Consolas, monospace; color: var(--text);
  background: #fff; outline: none; resize: vertical;
}
.form-row textarea:focus { border-color: var(--blue-500); }
.pair { display: flex; gap: 8px; }
.pair select { flex: 1; }

/* Secret / copy input */
.secret-wrap { position: relative; }
.secret-wrap input { padding-right: 42px; }
.btn-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: none; background: transparent; cursor: pointer; font-size: .9rem; padding: 5px 7px; border-radius: 8px; color: var(--muted); }
.btn-eye:hover { background: var(--blue-50); }

/* Buttons */
.btn-inline { width: auto; margin-top: 0; padding: 9px 18px; font-size: .8rem; }
.btn-secondary { border: 1px solid var(--line); background: #fff; color: var(--blue-700); border-radius: 10px; padding: 9px 14px; font-size: .78rem; font-weight: 700; cursor: pointer; font-family: var(--font); transition: background .12s; }
.btn-secondary:hover { background: var(--blue-50); }
.btn-secondary:disabled, .btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-danger-ghost { border: 1px solid #fecaca; background: #fff; color: #dc2626; border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: .78rem; font-weight: 700; font-family: var(--font); }
.btn-danger-ghost:hover { background: #fef2f2; }
.save-row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.hint { font-size: .76rem; color: var(--blue-800); background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 10px; padding: 10px 12px; margin-top: 12px; line-height: 1.55; }
.spin { display: inline-block; animation: tsspin 1s linear infinite; }

/* Hasil tes */
.test-area:empty { display: none; }
.tr { border-radius: 10px; padding: 10px 12px; font-size: .78rem; margin-top: 10px; line-height: 1.55; animation: fadein .2s ease; }
.tr-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.tr-fail { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* Router cards */
.router-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.router-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: linear-gradient(180deg, #fff, #fbfdff); transition: box-shadow .15s, opacity .2s; }
.router-card:hover { box-shadow: var(--shadow); }
.router-card.disabled { opacity: .55; }
.router-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.router-ident { display: flex; gap: 12px; align-items: center; min-width: 0; }
.router-num { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-600), var(--blue-400)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.router-title { font-weight: 700; font-size: .9rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.router-host { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.router-note { font-size: .76rem; color: var(--muted); margin-top: 10px; background: var(--blue-50); border-radius: 8px; padding: 6px 10px; }
.router-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Turnstile preview */
.ts-preview { display: flex; align-items: center; gap: 12px; border: 1px solid #d4d4d4; background: #fafafa; border-radius: 6px; padding: 12px 14px; width: 310px; max-width: 100%; cursor: pointer; user-select: none; font-size: .84rem; color: #232323; }
.ts-box { width: 24px; height: 24px; border: 2px solid #cbd5e1; border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; color: #16a34a; font-weight: 800; flex-shrink: 0; transition: border-color .2s; }
.ts-box.busy { border-color: var(--blue-500); border-top-color: transparent; border-radius: 50%; animation: tsspin .7s linear infinite; }
.ts-box.ok { border-color: #16a34a; }
@keyframes tsspin { to { transform: rotate(360deg); } }
.ts-brand { margin-left: auto; font-size: .52rem; color: #94a3b8; text-align: right; line-height: 1.35; letter-spacing: .5px; font-weight: 700; }

/* Gateway */
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 760px) { .radio-cards { grid-template-columns: 1fr; } }
.radio-card { border: 1.5px solid var(--line); border-radius: 13px; padding: 13px 14px; cursor: pointer; transition: border .15s, background .15s, box-shadow .15s; }
.radio-card:hover { border-color: var(--blue-400); }
.radio-card.active { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.rc-ic { font-size: 1.2rem; margin-bottom: 6px; }
.radio-card b { display: block; font-size: .82rem; }
.radio-card small { color: var(--muted); font-size: .7rem; line-height: 1.4; display: block; margin-top: 3px; }
.cert-box { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 12px; padding: 12px 14px; font-size: .8rem; margin-top: 12px; }
.cert-meta { font-size: .74rem; margin-top: 4px; color: #047857; }
.gw-preview { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--blue-900); color: #e2ecff; border-radius: 12px; padding: 12px 14px; font-size: .8rem; }
.gw-url { font-family: "Cascadia Code", Consolas, monospace; font-weight: 700; }
.gw-chip { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.gw-chip.on { background: rgba(16, 185, 129, .28); color: #6ee7b7; }
.gw-chip.off { background: rgba(255, 255, 255, .12); color: #b8c8e8; }
.modal-sm { width: 560px; }

/* ============ GATEWAY v2: domain + proteksi ============ */
.domain-list { display: flex; flex-direction: column; gap: 8px; }
.domain-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  background: linear-gradient(180deg, #fff, #fbfdff); transition: box-shadow .15s, opacity .2s;
}
.domain-row:hover { box-shadow: var(--shadow); }
.domain-row.disabled { opacity: .55; }
.dom-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--blue-50); color: var(--blue-700); display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.dom-main { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.dom-host { font-size: .86rem; font-weight: 700; }
.dom-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.domain-add { display: flex; gap: 10px; margin-top: 12px; }
.domain-add input {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .86rem; font-family: var(--font); color: var(--text); background: #fff; outline: none;
}
.domain-add input:focus { border-color: var(--blue-500); }

/* Rate limit table */
.rl-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
.rl-head label { font-size: .74rem; font-weight: 700; color: var(--muted); }
.rl-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rl-row { display: grid; grid-template-columns: 1fr 120px 100px 44px; gap: 8px; padding: 8px 10px; align-items: center; border-bottom: 1px solid #eef3fb; }
.rl-row:last-child { border-bottom: none; }
.rl-row.rl-header { background: var(--blue-50); padding: 8px 10px; }
.rl-row.rl-header span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #8aa0b8; }
.rl-row input { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; font-size: .8rem; font-family: "Cascadia Code", Consolas, monospace; color: var(--text); background: #fff; outline: none; width: 100%; }
.rl-row input:focus { border-color: var(--blue-500); }
.rl-row.rl-add { background: #fbfdff; }
@media (max-width: 700px) { .rl-row { grid-template-columns: 1fr 70px 60px 40px; } }

/* Blocked IP list */
.blk-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: #fff;
}
.blk-row.st-blocked   { border-left: 4px solid var(--amber); }
.blk-row.st-permanent { border-left: 4px solid var(--red); }
.blk-row.st-watch     { border-left: 4px solid var(--blue-400); }
.blk-ic { font-size: 1rem; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--blue-50); display: flex; align-items: center; justify-content: center; }
.st-blocked .blk-ic { background: #fffbeb; }
.st-permanent .blk-ic { background: #fef2f2; }
.blk-body { flex: 1; min-width: 0; }
.blk-ip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: .86rem; }
.blk-meta { font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* ============ GATEWAY v3: tabel domain + SSL jadi satu ============ */
tr.row-disabled td { opacity: .5; }
tr.row-disabled td:last-child { opacity: 1; }
td .dom-actions { display: flex; align-items: center; gap: 8px; }
.pair input { width: 50%; }

/* ============ LIST IP: KPI + tentang halaman ============ */
.kpi-value.kpi-sm { font-size: 1.05rem; line-height: 1.3; margin-top: 6px; word-break: break-word; }
.kpi-click { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi-click:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.page-about { background: linear-gradient(180deg, #fff, #fbfdff); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.about-item { display: flex; gap: 12px; align-items: flex-start; }
.about-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--blue-50); display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.about-item b { display: block; font-size: .82rem; margin-bottom: 2px; }
.about-item small { color: var(--muted); font-size: .76rem; line-height: 1.55; display: block; }

/* ============ Resource Server (dashboard) ============ */
.srv-stats { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.srv-stat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 10px;
  padding: 9px 13px; font-size: .78rem;
}
.srv-stat span { font-weight: 700; color: var(--muted); }
.srv-stat b { font-variant-numeric: tabular-nums; }
