:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --border: #e3e8ef; --text: #1b2533; --muted: #66748a;
  --brand: #1d4ed8; --brand-ink: #ffffff; --head: #233650;
  --ok: #16833f; --ok-bg: #e3f5ea; --warn: #b26b00; --warn-bg: #fff3d6; --orange: #c2410c; --orange-bg: #ffedd5;
  --bad: #c81e1e; --bad-bg: #fde4e4; --idle: #7a8699; --idle-bg: #eef1f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1520; --surface: #161e2b; --surface-2: #1b2534; --border: #273246; --text: #e6ebf2; --muted: #93a0b5;
    --brand: #4f7cff; --head: #c9d6ea;
    --ok: #4ade80; --ok-bg: #15301f; --warn: #fbbf24; --warn-bg: #36290b; --orange: #fb923c; --orange-bg: #3a2210;
    --bad: #f87171; --bad-bg: #3b1717; --idle: #94a3b8; --idle-bg: #232d3d;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--bad); min-height: 1em; margin: 6px 0; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* brand */
.brand { display: flex; gap: 10px; align-items: center; }
.brand b { display: block; letter-spacing: .5px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.brand-lg .logo { width: 42px; height: 42px; font-size: 22px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 28px; }
.login-card button { width: 100%; justify-content: center; margin-top: 6px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button { font: inherit; border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tabs button.on { color: var(--text); background: var(--surface-2); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 4px; }
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.fresh i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.fresh.stale i { background: var(--warn); }
.banner { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.ok .v { color: var(--ok); } .kpi.warn .v { color: var(--warn); } .kpi.orange .v { color: var(--orange); } .kpi.bad .v { color: var(--bad); }
.card .kpis .kpi { box-shadow: none; background: var(--surface-2); }

/* chips */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button { font: inherit; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 5px 10px; border-radius: 99px; cursor: pointer; }
.chips button.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chips button .n { opacity: .7; margin-left: 4px; }

/* table */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th.sorted::after { content: " ▾"; }
.tbl th.sorted.asc::after { content: " ▴"; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .num { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-normal, .b-up { color: var(--ok); background: var(--ok-bg); }
.b-failover, .b-pending { color: var(--warn); background: var(--warn-bg); }
.b-lte_down { color: var(--orange); background: var(--orange-bg); }
.b-down { color: var(--bad); background: var(--bad-bg); }
.b-prelive { color: var(--brand); background: var(--idle-bg); }
.b-paused, .b-maintenance, .b-unknown, .b-none { color: var(--idle); background: var(--idle-bg); }
.link { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.link .meta { font-size: 11.5px; color: var(--muted); }
.pct-ok { color: var(--ok); font-weight: 600; } .pct-bad { color: var(--bad); font-weight: 600; } .pct-na { color: var(--muted); }
.legend { margin: 12px 2px 0; }

/* trend */
.trend { width: 100%; }
.trend svg { display: block; width: 100%; height: 150px; }
.trend .bar { fill: var(--ok); }
.trend .bar.bad { fill: var(--bad); }
.trend .bar.na { fill: var(--border); }
.trend .tl { stroke: var(--warn); stroke-dasharray: 4 3; stroke-width: 1; }
.trend text { fill: var(--muted); font-size: 10px; }

/* forms */
.row-form { display: flex; gap: 8px; flex-wrap: wrap; }
.row-form input, .row-form select { flex: 1 1 160px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.note { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 8px; font-size: 13px; }

/* drawer / modal */
.drawer { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; }
.drawer-bg { position: absolute; inset: 0; background: rgba(10, 15, 25, .45); }
.drawer-panel { position: relative; width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--bg); padding: 18px; border-left: 1px solid var(--border); }
.drawer-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.drawer-h h2 { font-size: 18px; }
#pwModal { justify-content: center; align-items: center; padding: 16px; }
.modal { position: relative; width: 100%; max-width: 380px; }
.modal h2 { margin-bottom: 12px; }
.drawer .kpi .v { font-size: 20px; }
.links2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.links2 .card { margin: 0; padding: 12px; }
.links2 .t { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list li:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .top-right { margin-left: auto; }
  .fresh span { display: none; }
  .wrap { padding: 16px; }
  .kpi .v { font-size: 22px; }
  .links2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* logo & identitas iNETPLUS */
:root { --ip-red: #ff1a1a; --ip-blue: #0033cc; --ip-cyan: #0bb4e6;
  --ip-accent: linear-gradient(90deg, var(--ip-red) 0%, var(--ip-blue) 55%, var(--ip-cyan) 100%); }
.brands { display: flex; align-items: center; gap: 8px; }
.brands .lg { display: inline-flex; align-items: center; }
.brands .lg img { width: auto; object-fit: contain; display: none; }
.brands .lg.has-img img { display: block; }
.brands .lg.has-img b { display: none; }
.brands .lg b { font-weight: 800; letter-spacing: .5px; }

/* header: logo di panel putih + garis aksen warna logo */
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--ip-accent); }
.top .brands .lg img { height: 30px; max-width: 150px; background: #fff; padding: 4px 10px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .18); box-sizing: content-box; }

/* login: latar bernuansa merah-biru, kartu dengan aksen, logo besar */
.login { background:
  radial-gradient(900px 520px at 8% 0%, rgba(0, 51, 204, .22), transparent 60%),
  radial-gradient(700px 420px at 100% 100%, rgba(255, 26, 26, .14), transparent 60%),
  var(--bg); }
.login-card { position: relative; overflow: hidden; padding-top: 34px; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--ip-accent); }
.brands-lg { justify-content: center; margin-bottom: 20px; }
.brands-lg .lg img { height: 62px; max-width: 250px; background: #fff; padding: 14px 22px; border-radius: 16px; box-sizing: content-box;
  box-shadow: 0 12px 32px rgba(0, 51, 204, .22), 0 0 0 1px rgba(0, 51, 204, .08); }
.brands-lg .lg b { font-size: 22px; }
.login-card h1 { text-align: center; margin-bottom: 2px; }
.login-card .sub { text-align: center; margin: 0 0 18px; }
.login-card .foot-note { text-align: center; margin: 14px 0 0; }
.login-card button.primary { background: linear-gradient(90deg, var(--ip-blue), #0b74e6); }
@media (prefers-reduced-motion: no-preference) {
  .login-card { animation: rise .45s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 420px) {
  .login-card { padding: 30px 16px 20px; }
  .brands-lg .lg img { height: 50px; max-width: 210px; padding: 12px 16px; }
  .top .brands .lg img { height: 26px; padding: 3px 8px; }
}
