/* WGN Monitoring Switch — posisi port, VLAN & status link (hanya baca). */
:root {
  --accent: #1d4ed8;
  --accent-strong: #1e3a8a;
  --accent-2: #2563eb;
  --accent-soft: #dbe7ff;
  --accent-grad: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1e3a8a 100%);
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --field: #f1f3f8;
  --line: #e5e8f0;
  --line-2: #d5dae6;
  --text: #172033;
  --text-2: #4d5872;
  --muted: #8a93a8;
  --ok: #15803d;      --ok-soft: #e3f6e9;
  --danger: #dc2626;  --danger-soft: #fdeaea;
  --warn: #b45309;    --warn-soft: #fdf1df;
  --info: #2563eb;    --info-soft: #e6eefe;
  --slate: #64748b;   --slate-soft: #eef1f5;
  /* Status port */
  --st-terpakai: #22c55e;
  --st-terputus: #ef4444;
  --st-admin: #f59e0b;
  --st-kosong: #cbd5e1;
  --chassis: #1f2633;
  --chassis-2: #2b3445;
  --cage: #0f141d;
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, .05), 0 2px 8px rgba(23, 32, 51, .04);
  --shadow: 0 10px 30px -12px rgba(23, 32, 51, .2);
  --shadow-lg: 0 30px 60px -20px rgba(23, 32, 51, .38);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --side-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-soft: #1c2a4d; --accent-strong: #9db8ff;
    --bg: #0e121a; --surface: #161c27; --surface-2: #1b2230; --field: #1d2431; --line: #273042; --line-2: #333e54;
    --text: #e6ebf5; --text-2: #b0bad0; --muted: #7c879e;
    --ok: #4ade80; --ok-soft: #12301f; --danger: #f87171; --danger-soft: #3a1717; --warn: #fbbf24; --warn-soft: #3a2a10;
    --info: #7aa2ff; --info-soft: #18254a; --slate: #94a3b8; --slate-soft: #222a38;
    --st-kosong: #4b5568; --chassis: #0b0f16; --chassis-2: #182030; --cage: #05070b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-soft: #1c2a4d; --accent-strong: #9db8ff;
  --bg: #0e121a; --surface: #161c27; --surface-2: #1b2230; --field: #1d2431; --line: #273042; --line-2: #333e54;
  --text: #e6ebf5; --text-2: #b0bad0; --muted: #7c879e;
  --ok: #4ade80; --ok-soft: #12301f; --danger: #f87171; --danger-soft: #3a1717; --warn: #fbbf24; --warn-soft: #3a2a10;
  --info: #7aa2ff; --info-soft: #18254a; --slate: #94a3b8; --slate-soft: #222a38;
  --st-kosong: #4b5568; --chassis: #0b0f16; --chassis-2: #182030; --cage: #05070b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace; font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 16px; height: 16px; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 600px at 10% -10%, #cfe0ff 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #d9f5e3 0%, transparent 60%), var(--bg);
}
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 6px; }
.logo-mark { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .6); flex: none; }

/* ---------- Form ---------- */
label.f { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.inp { width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; font-weight: 500; color: var(--text); outline: none; min-height: 40px; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea.inp { resize: vertical; min-height: 80px; line-height: 1.5; }
.inp:focus { border-color: var(--accent-2); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 1em; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 8px 14px; font-weight: 700; font-size: 13.5px; min-height: 38px; white-space: nowrap; transition: transform .1s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(37, 99, 235, .8); }
.btn-primary:hover { background: var(--accent-grad); filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--field); border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12.5px; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; color: var(--text-2); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 600; }
.nav { display: grid; gap: 3px; }
.nav a, .bottom-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: var(--field); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav .sep { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 11px 4px; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--st-kosong); }
.nav .dot.ok { background: var(--st-terpakai); }
.nav .dot.bad { background: var(--st-terputus); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { padding: 8px 28px 40px; display: grid; gap: 18px; align-content: start; }
.bottom-nav { display: none; }

/* ---------- Card, chip, tile ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px; min-width: 0; }
.card h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--field); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--info-soft); color: var(--info); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.st-terpakai { background: var(--ok-soft); color: var(--ok); }
.badge.st-terputus { background: var(--danger-soft); color: var(--danger); }
.badge.st-admin_down { background: var(--warn-soft); color: var(--warn); }
.badge.st-kosong { background: var(--slate-soft); color: var(--slate); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; text-align: left; display: grid; gap: 2px; position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st-kosong); }
.tile.st-terpakai::after { background: var(--st-terpakai); }
.tile.st-terputus::after { background: var(--st-terputus); }
.tile.st-admin_down::after { background: var(--st-admin); }
.tile b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
button.tile:hover { border-color: var(--line-2); background: var(--surface); }
button.tile.active { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600; }
.banner.bad { background: var(--danger-soft); color: var(--danger); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mt { margin-top: 14px; }
.count-line { margin-top: 8px; }
.sect-top { margin: 18px 0 4px; font-size: 14px; }
.show-sm { display: none; }
.t .c-mob { display: none; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.nav a .dot + .nav-count { margin-left: 6px; }
.bottom-nav a { position: relative; }
.bottom-nav .nav-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
.cr-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; background: var(--surface-2); }
.cr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.cr-grid .span-all { grid-column: 1 / -1; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.hint { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.cmd { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.cmd-text { margin: 0; padding: 12px 14px; border-radius: 10px; background: #0f141d; color: #d6f5dd; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; line-height: 1.55; overflow: auto; white-space: pre-wrap; word-break: break-all; max-height: 520px; }
.modal.wide { width: min(640px, calc(100% - 32px)); }
.mfa-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; }
.mfa-qr { width: 200px; height: 200px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.mfa-steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.mfa-secret { margin-top: 4px; padding: 4px 8px; border-radius: 8px; background: var(--field); word-break: break-all; user-select: all; }
.mfa-code { text-align: center; font-size: 22px; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); user-select: all; font-size: 15px; text-align: center; }
@media (max-width: 520px) { .mfa-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-weight: 600; }

/* ---------- Panel depan switch (3D, proyeksi miring ala foto produk) ---------- */
.panel-wrap { overflow-x: auto; overflow-y: hidden; padding: 4px 0 6px; -webkit-overflow-scrolling: touch; }
.dev3d {
  --pw: 25px; --ph: 20px; --qw: 36px; --qh: 24px; --dy: 24px; --dx: 34px;
  --f1: #2d3b54; --f2: #1f2a3d; --f3: #172030; --edge: #0b111a;
  --t1: #4a5973; --t2: #34425b; --s1: #1c2535; --s2: #10161f;
  --ink: #e8eef8; --ink2: #9fb0c8; --gl: #5aa9ff; --cage1: #e2e6ec; --cage2: #8f98a6; --hole: #06080c; --holeink: #5d6b82;
  position: relative; display: inline-block; padding: var(--dy) var(--dx) 0 0; margin: 2px 0 20px; min-width: max-content;
}
.dev3d.mikrotik {
  --f1: #f4f6f9; --f2: #e2e6ec; --f3: #d3d8e0; --edge: #9aa3b0;
  --t1: #fbfcfd; --t2: #e8ebf0; --s1: #c9cfd8; --s2: #b2b9c4;
  --ink: #1f2937; --ink2: #5b6577; --gl: #2563eb; --cage1: #b9c0ca; --cage2: #6f7886; --hole: #12161d; --holeink: #6b778d;
}
.dev3d::after { content: ''; position: absolute; left: 1%; right: calc(var(--dx) - 6px); bottom: -16px; height: 20px; background: radial-gradient(ellipse at center, rgba(10, 16, 28, .38), transparent 70%); filter: blur(3px); z-index: 0; pointer-events: none; }
.dev-top { position: absolute; left: 0; top: 0; z-index: 1; height: var(--dy); width: calc(100% - var(--dx)); transform-origin: 0 100%; transform: skewX(-55deg);
  background: linear-gradient(180deg, var(--t1), var(--t2)); border: 1px solid var(--edge); border-bottom: 0; border-radius: 2px 2px 0 0; overflow: hidden; }
.dev-top::after { content: ''; position: absolute; left: 3%; right: 3%; bottom: 3px; height: 42%; opacity: .85;
  background-image: radial-gradient(circle, rgba(5, 8, 14, .8) 0 .9px, transparent 1.3px); background-size: 4px 4px; }
.dev3d.mikrotik .dev-top::after { opacity: .35; }
.dev-side { position: absolute; right: 0; top: var(--dy); z-index: 1; width: var(--dx); height: calc(100% - var(--dy)); transform-origin: 0 0; transform: skewY(-35deg);
  background: linear-gradient(90deg, var(--s1), var(--s2)); border: 1px solid var(--edge); border-left: 0; overflow: hidden; }
.dev-side::after { content: ''; position: absolute; left: 22%; right: 22%; top: 22%; bottom: 22%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .55) 0 2px, transparent 2px 5px); opacity: .7; }
.dev-front { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 7px; padding: 12px 12px 12px 12px;
  background: linear-gradient(180deg, var(--f1) 0%, var(--f2) 55%, var(--f3) 100%); border: 1px solid var(--edge); border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -2px 0 rgba(0, 0, 0, .3); }
.dev-brand { display: grid; gap: 1px; align-self: center; padding-right: 6px; min-width: 92px; }
.dev-brand b { color: var(--ink); font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.dev3d.mikrotik .dev-brand b { letter-spacing: 0; font-size: 15px; }
.dev-brand span { color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.dev-brand small { color: var(--ink2); font-size: 9px; font-weight: 600; }
.pgroup { display: grid; gap: 6px; justify-items: stretch; }
.pgroup .glabel { position: relative; text-align: center; color: var(--gl); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid color-mix(in srgb, var(--gl) 55%, transparent); line-height: 1.5; }
.pgroup .glabel span { padding: 0 4px; }
.pgroup.mgmt .glabel { color: var(--ink2); border-color: transparent; }
.pblock { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: 11px 3px; padding: 6px 4px; border-radius: 2px;
  background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.dev3d.mikrotik .pblock { background: rgba(30, 41, 59, .1); box-shadow: inset 0 0 0 1px rgba(30, 41, 59, .12); }
.pblock.one-row { grid-template-rows: auto; }
.port { position: relative; width: var(--pw); height: var(--ph); padding: 2px; border: 0; border-radius: 2px; display: grid;
  background: linear-gradient(180deg, var(--cage1), var(--cage2)); box-shadow: 0 1px 0 rgba(0, 0, 0, .45); transition: transform .1s, box-shadow .15s, opacity .15s; }
.port .hole { display: grid; place-items: center; border-radius: 1px; font-size: 9.5px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  background: var(--hole); color: var(--holeink); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .75); }
.port.qsfp { width: var(--qw); height: var(--qh); }
.port.mgmt { width: calc(var(--pw) - 2px); }
.port.mgmt .hole { border-radius: 1px 1px 3px 3px; }
.port.st-terpakai .hole { background: linear-gradient(180deg, #4ade80, #16a34a); color: #052e14; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 3px rgba(0, 0, 0, .35); }
.port.st-terputus .hole { background: linear-gradient(180deg, #f87171, #dc2626); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -2px 3px rgba(0, 0, 0, .35); }
.port.st-admin_down .hole { background: linear-gradient(180deg, #fbbf24, #d97706); color: #3a1d00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -2px 3px rgba(0, 0, 0, .35); }
.port:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(96, 165, 250, .7); }
.port.lag { box-shadow: 0 0 0 1.5px #60a5fa, 0 1px 0 rgba(0, 0, 0, .45); }
.port.note::before { content: ''; position: absolute; top: -3px; right: -3px; z-index: 2; width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; border: 1.5px solid var(--f2); }
.port.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent-2); z-index: 3; }
.port.dim { opacity: .25; }

/* Lampu indikator per port (di atas port baris atas, di bawah port baris bawah) */
.led { position: absolute; left: 50%; width: 7px; height: 3px; margin-left: -3.5px; border-radius: 1px; background: #2a3243; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .5); }
.port.top .led { top: -7px; }
.port.bot .led { bottom: -7px; }
.dev3d.mikrotik .led { background: #8892a1; }
.led.on { background: #4ade80; box-shadow: 0 0 4px 1px rgba(74, 222, 128, .85); animation: led-act 1.6s linear infinite; }
.led.on.fast { animation-duration: .55s; }
.led.red { background: #ef4444; box-shadow: 0 0 5px 1px rgba(239, 68, 68, .9); animation: led-alarm 1.8s ease-in-out infinite; }
.led.amber { background: #f59e0b; box-shadow: 0 0 4px 1px rgba(245, 158, 11, .75); }
.led.d1 { animation-delay: -.27s; } .led.d2 { animation-delay: -.61s; } .led.d3 { animation-delay: -.93s; } .led.d4 { animation-delay: -1.18s; } .led.d5 { animation-delay: -1.42s; }
@keyframes led-act { 0%, 100% { opacity: 1; } 7% { opacity: .2; } 12% { opacity: 1; } 43% { opacity: 1; } 47% { opacity: .25; } 53% { opacity: 1; } 71% { opacity: .3; } 75% { opacity: 1; } }
@keyframes led-alarm { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .led { animation: none !important; } }

/* Versi kecil (dasbor) */
.panel-small .dev3d { --pw: 11px; --ph: 10px; --qw: 16px; --qh: 12px; --dy: 12px; --dx: 17px; margin-bottom: 12px; }
.panel-small .dev-front { gap: 4px; padding: 6px 7px; }
.panel-small .dev-brand { min-width: 0; padding-right: 2px; }
.panel-small .dev-brand b { font-size: 8px; }
.panel-small .dev-brand span, .panel-small .dev-brand small, .panel-small .pgroup .glabel { display: none; }
.panel-small .pblock { gap: 6px 2px; padding: 3px 2px; }
.panel-small .port { padding: 1px; }
.panel-small .port .hole { font-size: 0; }
.panel-small .led { width: 4px; height: 2px; margin-left: -2px; }
.panel-small .port.top .led { top: -4px; }
.panel-small .port.bot .led { bottom: -4px; }
.panel-small .port.note::before { display: none; }
.panel-small .dev-top::after { background-size: 3px 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; background: var(--st-kosong); }
.legend i.st-terpakai { background: var(--st-terpakai); }
.legend i.st-terputus { background: var(--st-terputus); }
.legend i.st-admin_down { background: var(--st-admin); }
.legend i.st-kosong { background: #06080c; border: 1.5px solid #8f98a6; }
.legend i.lag { width: 12px; height: 9px; background: transparent; border: 1.5px solid #60a5fa; }
.legend i.lg-led { width: 9px; height: 4px; border-radius: 1px; }
.legend i.lg-led.on { background: #4ade80; box-shadow: 0 0 4px 1px rgba(74, 222, 128, .8); animation: led-act 1.6s linear infinite; }
.legend i.lg-led.red { background: #ef4444; box-shadow: 0 0 4px 1px rgba(239, 68, 68, .8); }
.legend i.note { width: 9px; height: 9px; border-radius: 50%; background: #60a5fa; }

/* ---------- Tabel ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; margin-bottom: 12px; align-items: end; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
@media (hover: hover) { table.t tbody tr.click:hover td { background: var(--surface-2); } }
table.t td.port-name { font-weight: 700; white-space: nowrap; }
.vl { display: inline-block; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--field); margin: 1px 2px 1px 0; white-space: nowrap; }
.vl.u { background: var(--info-soft); color: var(--info); }
.vl.dflt { color: var(--muted); }
.opt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt.baik { color: var(--ok); }
.opt.lemah { color: var(--warn); }
.opt.mati { color: var(--danger); }
.opt.kuat { color: var(--info); }
.desc-cell { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
.note-text { color: var(--info); font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ---------- List ---------- */
.list { display: grid; }
.list .li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.list .li .grow b { font-size: 13px; }
.list .li .grow div { font-size: 12.5px; color: var(--text-2); }
.list button.li { background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; color: inherit; }
.list button.li:hover { background: var(--surface-2); }
.ev-kind { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--field); color: var(--text-2); white-space: nowrap; }
.ev-kind.down { background: var(--danger-soft); color: var(--danger); }
.ev-kind.up { background: var(--ok-soft); color: var(--ok); }
.ev-kind.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- VLAN ---------- */
.vlan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; background: var(--surface-2); }
.vlan-card .vid { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.vlan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; margin: 2px 4px 2px 0; color: var(--text); }
.pchip:hover { border-color: var(--accent-2); }
.pchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-kosong); display: inline-block; }
.pchip i.st-terpakai { background: var(--st-terpakai); }
.pchip i.st-terputus { background: var(--st-terputus); }
.pchip i.st-admin_down { background: var(--st-admin); }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--field); }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.drawer-body { overflow-y: auto; padding: 16px 18px 28px; display: grid; gap: 18px; align-content: start; }
.sect h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lanes { display: flex; flex-wrap: wrap; gap: 6px; }
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 14px; }
.modal h2 { margin: 0; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.overlay.m { z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #172033; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters .f:first-child { grid-column: span 2; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 18px; }
  .view { padding: 6px 16px 96px; gap: 14px; }
  .card { padding: 14px; border-radius: var(--radius); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 4px; flex: 1; text-align: center; }
  .bottom-nav a.active { color: var(--accent-2); }
  .drawer { width: 100%; }
  .hide-sm { display: none; }
  .show-sm { display: inline-grid; }
  .t.resp thead { display: none; }
  .t.resp, .t.resp tbody { display: block; }
  .t.resp tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .t.resp tr:last-child { border-bottom: 0; }
  .t.resp td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; }
  .t.resp td.c-wide, .t.resp td.c-mob { grid-column: 1 / -1; }
  .t.resp td.c-desk { display: none; }
  .cr-grid { grid-template-columns: minmax(0, 1fr); }
  .t.resp td.c-mob { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; }
  .list .li { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters .f:first-child { grid-column: auto; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .vlan-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) { .port:hover { transform: none; } }
