/* =====================================================================
   ctOS theme, Watch Dogs (2014) inspired
   Flat surveillance-console look: cold cyan, hairline borders, sharp
   corners, bracket ticks, monospace telemetry, subtle CRT scanlines.
   Loaded after app.css; remove the <link> to fall back to the old look.
   ===================================================================== */

:root {
  --font-ui: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

::selection { background: rgba(63, 224, 208, .24); color: var(--text); }

body { letter-spacing: .01em; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: .01em; }
.topbar-title, .auth-card h1, .hero h1 { text-transform: uppercase; }

.topbar-title { font-family: var(--font-ui); font-size: 15px; letter-spacing: .1em; }
.topbar-title span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; margin-top: 3px;
}
.hero h1 {
  font-size: 20px; letter-spacing: .1em;
  display: flex; align-items: center; gap: 10px;
}
.hero h1::before {
  content: ""; flex: 0 0 3px; align-self: stretch; min-height: 20px;
  background: var(--accent); box-shadow: 0 0 12px rgba(63, 224, 208, .7);
}
.hero p { letter-spacing: .015em; }
.card-head h2 { font-size: 12px; letter-spacing: .02em; color: var(--text); }
.card-head h2::before {
  content: "//"; margin-right: 7px; color: var(--accent);
  font-family: var(--font-mono); font-weight: 500; opacity: .85;
}
.card-head .sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; }

/* ------------------------------------------------------------- panels */
.card, .kpi, .module, .auth-card, .notice, .wf-step {
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 1px 2px rgba(0, 0, 0, .3);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="light"] .card,
html[data-theme="light"] .kpi,
html[data-theme="light"] .module,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .notice,
html[data-theme="light"] .wf-step {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 2px rgba(6, 32, 34, .08);
}
.card, .kpi, .auth-card { position: relative; }

.card::before, .kpi::before, .auth-card::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px;
  border-top: 1px solid rgba(63, 224, 208, .7);
  border-left: 1px solid rgba(63, 224, 208, .7);
  background: none; border-radius: 0; filter: none; opacity: .75;
  pointer-events: none; z-index: 3;
}
.card::after, .kpi::after, .auth-card::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; left: auto; top: auto; width: 12px; height: 12px;
  border-bottom: 1px solid rgba(63, 224, 208, .7);
  border-right: 1px solid rgba(63, 224, 208, .7);
  background: none; border-radius: 0; filter: none; opacity: .75;
  pointer-events: none; z-index: 3;
}
html[data-theme="light"] .card::before, html[data-theme="light"] .kpi::before, html[data-theme="light"] .auth-card::before,
html[data-theme="light"] .card::after, html[data-theme="light"] .kpi::after, html[data-theme="light"] .auth-card::after {
  border-color: rgba(6, 122, 114, .55);
}

.kpi { border-radius: 3px; padding: 14px 15px 13px; }
.kpi .label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; color: var(--faint);
}
.kpi .value {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.kpi .sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em; }
.card:hover, .kpi:hover { border-color: rgba(63, 224, 208, .34); }
.card, .kpi { transition: border-color .18s ease; }

/* ------------------------------------------------------------ sidebar */
.sidebar {
  width: 248px; flex-basis: 248px; padding: 18px 14px;
  background: var(--glass-side); border-right: 1px solid var(--border);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.brand { gap: 11px; padding: 2px 4px 16px; border-bottom: 1px solid var(--border); }
.sidebar-close { margin-left: auto; flex: 0 0 auto; }

@media (min-width: 901px) {
  .menu-btn { display: grid; }
  .sidebar {
    transition: width var(--motion-enter) var(--ease-out),
      flex-basis var(--motion-enter) var(--ease-out),
      padding var(--motion-enter) var(--ease-out);
  }
  body.nav-collapsed .sidebar {
    width: 0; flex-basis: 0; padding-left: 0; padding-right: 0;
    border-right-color: transparent; overflow: hidden;
  }
}
@media (max-width: 900px) {
  .sidebar-close { display: none; }
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 2px;
  background: rgba(63, 224, 208, .07);
  border: 1px solid rgba(63, 224, 208, .45);
  color: var(--accent); font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em;
  box-shadow: inset 0 0 18px rgba(63, 224, 208, .12), 0 0 16px rgba(63, 224, 208, .08);
}
.brand-text strong { font-size: 13px; letter-spacing: .14em; text-transform: none; }
.brand-text span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; }
.brand:hover .brand-text strong { animation: ctos-glitch .42s steps(2, end) 1; }
.nav a {
  position: relative; border-radius: 2px; padding: 8px 10px;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 550;
}
.nav a:hover { background: rgba(63, 224, 208, .045); border-color: rgba(63, 224, 208, .12); }
.nav a.active {
  background: linear-gradient(90deg, rgba(63, 224, 208, .13), rgba(63, 224, 208, .015));
  border-color: rgba(63, 224, 208, .24); color: var(--accent); box-shadow: none;
}
.nav a.active::before {
  content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px;
  background: var(--accent); box-shadow: 0 0 10px rgba(63, 224, 208, .8);
}
.nav a svg { opacity: .6; }
.nav a.active svg, .nav a:hover svg { opacity: 1; }
.nav-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; padding-top: 16px; }
.sidebar-foot { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }

/* ------------------------------------------------------------- topbar */
.topbar {
  min-height: 62px; padding: 10px 22px;
  background: var(--glass-bar); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, rgba(63, 224, 208, .55), transparent 38%, transparent 62%, rgba(63, 224, 208, .55));
  opacity: .35; pointer-events: none;
}
.icon-btn { border-radius: 2px; background: rgba(255, 255, 255, .025); backdrop-filter: none; }
.icon-btn:hover { background: rgba(63, 224, 208, .08); border-color: rgba(63, 224, 208, .4); color: var(--accent); }
.user-chip { border-radius: 2px; background: rgba(255, 255, 255, .025); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; backdrop-filter: none; }
.user-chip .avatar { border-radius: 2px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); }
.icon-btn .dot { border-radius: 1px; font-family: var(--font-mono); box-shadow: 0 0 12px rgba(255, 85, 102, .6); }
.nav-badge { border-radius: 1px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .04em; }

/* --------------------------------------------------- monitoring tabs */
.monitor-tabs { top: 62px; border-radius: 2px; }
.monitor-tabs a {
  border-radius: 2px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
}
.monitor-tabs a.active { background: rgba(63, 224, 208, .1); border-color: rgba(63, 224, 208, .32); box-shadow: none; }
.monitor-tabs a.active .tab-code { color: var(--accent); }
.monitor-tabs .tab-code { font-size: 8.5px; letter-spacing: .08em; }

/* ------------------------------------------------------ blocked drawer */
.drawer { border-left-color: rgba(63, 224, 208, .32); box-shadow: -30px 0 80px rgba(0, 0, 0, .68); }
.drawer-head h2 {
  font-family: var(--font-ui); font-size: 16px; letter-spacing: .08em;
  text-transform: uppercase;
}
.drawer-head .sub, .drawer-foot, .drawer-empty .small { font-family: var(--font-mono); letter-spacing: .02em; }
.drawer-section-label { letter-spacing: .2em; color: rgba(63, 224, 208, .65); }
.blocked-item { border-radius: 2px; background: rgba(255, 255, 255, .018); }
.blocked-item::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 2px;
  background: rgba(255, 85, 102, .7); box-shadow: 0 0 9px rgba(255, 85, 102, .35);
}
.blocked-ip { font-family: var(--font-mono); letter-spacing: .02em; }
.blocked-meta { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .02em; }
.drawer-more {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase;
}
.drawer-empty .badge { font-size: 8.5px; }

/* -------------------------------------------------------- pills/badges */
.pill {
  border-radius: 2px; padding: 4px 8px; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255, 255, 255, .03); backdrop-filter: none;
}
.pill .pulse {
  width: 6px; height: 6px; border-radius: 1px; box-shadow: 0 0 8px currentColor;
  animation: ctos-blink 2.6s steps(1, end) infinite;
}
.badge {
  border-radius: 2px; padding: 3px 7px; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .1em; backdrop-filter: none;
}
.legend { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.legend i { border-radius: 1px; }
.chip { border-radius: 2px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; }
.metrics-inline { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; }
.metrics-inline strong { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------- buttons/forms */
.btn {
  border-radius: 2px; padding: 9px 13px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; background: rgba(255, 255, 255, .025); backdrop-filter: none;
}
.btn:hover { border-color: rgba(63, 224, 208, .55); color: var(--accent); background: rgba(63, 224, 208, .06); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #03110f;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  box-shadow: 0 0 22px rgba(63, 224, 208, .22);
}
.btn.primary:hover { filter: brightness(1.1); color: #03110f; background: var(--accent); }
.btn.danger { background: var(--red-soft); border-color: rgba(255, 85, 102, .42); }
.btn.sm { padding: 6px 9px; font-size: 9.5px; }
.btn.ghost { background: transparent; }

input, select, textarea {
  border-radius: 2px; background: var(--field-bg);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  caret-color: var(--accent);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); background: #071012; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(63, 224, 208, .6); background: #071012;
  box-shadow: 0 0 0 1px rgba(63, 224, 208, .45), 0 0 20px rgba(63, 224, 208, .1);
}
label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
select { padding-right: 30px; }
input[type="file"]::file-selector-button {
  border-radius: 2px; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: .08em; text-transform: uppercase; background: rgba(63, 224, 208, .08);
  border-color: rgba(63, 224, 208, .3); color: var(--accent);
}
.seg { border-radius: 2px; background: #060d0f; gap: 1px; }
.seg a {
  border-radius: 1px; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: .08em; text-transform: uppercase;
}
.seg a.active { background: rgba(63, 224, 208, .1); border-color: rgba(63, 224, 208, .4); }

/* -------------------------------------------------------------- tables */
.table-wrap { border-radius: 1px; }
table { font-size: 12.5px; }
td { font-variant-numeric: tabular-nums; }
th {
  background: #060d0f; font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: .16em; color: var(--faint);
}
tbody tr:hover td { background: rgba(63, 224, 208, .045); }
.empty { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }

/* ------------------------------------------------------------- special */
.progress { height: 5px; border-radius: 1px; background: #060d0f; }
.progress > span { border-radius: 0; background: linear-gradient(90deg, var(--accent), var(--green)); box-shadow: 0 0 12px rgba(63, 224, 208, .5); }
.split-bar { border-radius: 1px; background: #060d0f; }
.notice { border-radius: 2px; border-left-width: 2px; font-size: 11.5px; }

.intel-out {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-left: 2px solid rgba(63, 224, 208, .45);
  background: rgba(63, 224, 208, .05);
  font-size: 10.5px;
}
.intel-out[hidden] { display: none; }
.intel-line { display: flex; gap: 10px; flex-wrap: wrap; }
.intel-key {
  min-width: 96px;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.intel-val { color: var(--text); word-break: break-word; }
.intel-val.intel-error { color: var(--red); }
.intel-row td { padding: 0 0 10px; }
.intel-mini { padding: 2px 5px; font-size: 8px; letter-spacing: .08em; margin-left: 5px; vertical-align: middle; }
html[data-theme="light"] .intel-out { background: rgba(6, 122, 114, .06); }
.detail-list .key { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; }
.detail-list .val { font-size: 12.5px; }
pre.code { border-radius: 2px; background: #050c0e; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.page-link { border-radius: 2px; font-family: var(--font-mono); font-size: 10.5px; }
.pagination .info { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; }
.module { border-radius: 3px; backdrop-filter: none; }
.module p { font-size: 11.5px; }
.module .meta { font-family: var(--font-mono); letter-spacing: .05em; }
.wf-step { border-radius: 3px; backdrop-filter: none; }
.wf-step-n { border-radius: 2px; font-family: var(--font-mono); }
.wf-step .chip { margin-top: 8px; }
.wf-canvas text { font-family: var(--font-ui); }
.wf-zone-title { font-size: 13px; letter-spacing: .04em; }

/* ---------------------------------------------------------------- auth */
.auth-shell { padding: 24px; }
.auth-card {
  max-width: 430px; border-radius: 3px; padding: 30px 30px 28px;
  background: linear-gradient(180deg, rgba(9, 19, 22, .98), rgba(5, 11, 13, .99));
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-theme="light"] .auth-card { background: var(--glass-card-strong); }
.auth-brand { margin-bottom: 22px; }
.auth-eyebrow {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent);
}
.auth-eyebrow::before {
  content: ""; width: 20px; height: 1px; background: var(--accent);
  box-shadow: 0 0 8px rgba(63, 224, 208, .8);
}
.auth-card h1 { font-size: 19px; letter-spacing: .1em; }
.auth-card .sub { font-size: 12px; }
.auth-foot { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }

/* --------------------------------------------------------------- chart */
.chart-box { width: 100%; }
.chart-box canvas { display: block; }

/* ------------------------------------------------------------ misc UX */
.btn, .icon-btn, .nav a, .page-link, .seg a { transition: color .15s ease, border-color .15s ease, background .15s ease; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(63, 224, 208, .26) transparent; }
::-webkit-scrollbar-thumb { background: rgba(63, 224, 208, .2); border-radius: 0; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(63, 224, 208, .38); background-clip: padding-box; }

@keyframes ctos-blink {
  0%, 72% { opacity: 1; }
  73%, 88% { opacity: .3; }
  89%, 100% { opacity: 1; }
}
@keyframes ctos-glitch {
  0% { text-shadow: 1.5px 0 rgba(255, 61, 79, .8), -1.5px 0 rgba(63, 224, 208, .8); }
  50% { text-shadow: -1.5px 0 rgba(255, 61, 79, .8), 1.5px 0 rgba(63, 224, 208, .8); }
  100% { text-shadow: none; }
}

@media (max-width: 900px) {
  .sidebar { width: 264px; flex-basis: 264px; }
  .topbar::after { display: none; }
}
@media (max-width: 640px) {
  .kpi .label { font-size: 9px; }
  .card-head h2 { font-size: 11.5px; }
  .hero h1 { font-size: 17px; }
  .topbar-title { font-size: 14px; }
}

/* -------------------------------------------------- light-mode polish */
html[data-theme="light"] th,
html[data-theme="light"] .seg,
html[data-theme="light"] pre.code,
html[data-theme="light"] .progress,
html[data-theme="light"] .split-bar { background: rgba(8, 30, 32, .045); }
html[data-theme="light"] input:hover,
html[data-theme="light"] select:hover,
html[data-theme="light"] textarea:hover,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus { background: #e8e5de; }
html[data-theme="light"] .btn.primary,
html[data-theme="light"] .btn.primary:hover { color: #f4fffd; }
html[data-theme="light"] .brand-mark:not(.logo) {
  background: rgba(6, 122, 114, .06);
  border-color: rgba(6, 122, 114, .45);
  box-shadow: inset 0 0 18px rgba(6, 122, 114, .08);
}
html[data-theme="light"] .nav a.active {
  background: linear-gradient(90deg, rgba(6, 122, 114, .12), transparent);
}
html[data-theme="light"] .nav a.active::before { box-shadow: none; }
html[data-theme="light"] .card:hover, html[data-theme="light"] .kpi:hover { border-color: rgba(6, 122, 114, .35); }
html[data-theme="light"] .kpi .value { text-shadow: none; }
html[data-theme="light"] .topbar::after { opacity: .2; }

/* --------------------------------------------------- mobile identity */
.topbar-title::before { content: "ctOS //"; display: none; }
@media (max-width: 900px) {
  .topbar-title::before {
    display: block; margin-bottom: 2px;
    font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .22em;
    color: var(--accent);
  }
}

/* ------------------------------------------------ boot sequence (sekali muat) */
@media (prefers-reduced-motion: no-preference) {
  .layout::before {
    content: "";
    position: fixed;
    left: 0; right: 0; top: 0;
    height: 18vh;
    z-index: 80;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(63, 224, 208, .06) 45%, rgba(63, 224, 208, .015) 70%, transparent);
    animation: ctos-boot-sweep 1.7s cubic-bezier(.3, .7, .3, 1) 1 forwards;
  }
  .hero h1 { animation: ctos-boot-glitch .8s steps(2, end) 1; }
}

@keyframes ctos-boot-sweep {
  0% { transform: translateY(-20vh); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(108vh); opacity: 0; }
}
@keyframes ctos-boot-glitch {
  0%, 100% { transform: none; text-shadow: none; }
  15% { transform: translateX(-1.5px); text-shadow: 1.5px 0 rgba(255, 61, 79, .55), -1.5px 0 rgba(63, 224, 208, .55); }
  30% { transform: translateX(1.5px); text-shadow: -1.5px 0 rgba(255, 61, 79, .55), 1.5px 0 rgba(63, 224, 208, .55); }
  45% { transform: none; text-shadow: none; }
  55% { transform: translateX(-1px); }
  70% { transform: none; }
}

/* ------------------------------------------------------- verify gate */
.verify-title { font-family: var(--font-mono); letter-spacing: .24em; }
.verify-logo { border-radius: 3px; }
.verify-card { border-radius: 2px; }
.verify-label, .verify-value, .verify-meta, .verify-foot, .verify-status { font-family: var(--font-mono); }
.verify-label { font-size: 11px; letter-spacing: .02em; }
html[data-theme="light"] .verify-card { background: var(--glass-card-strong); }
html[data-theme="light"] .verify-logo {
  background: radial-gradient(circle at 50% 35%, rgba(6, 122, 114, .1), rgba(234, 231, 224, .95) 70%);
}

/* ------------------------------------------------------- live monitor */
.kpis.k8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.kpis.k8 .kpi { padding: 14px 13px 12px; }
.kpis.k8 .kpi .value { font-size: 22px; }
.kpis.k8 .kpi .sub { font-size: 10.5px; line-height: 1.35; }

.nav-badge.live {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
  letter-spacing: .06em;
}

.stream {
  display: flex; flex-direction: column;
  max-height: 348px; overflow: auto;
}
.stream-row {
  display: grid;
  grid-template-columns: 128px 58px minmax(0, 1fr) 44px;
  gap: 9px; align-items: center;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.stream-row:last-child { border-bottom: 0; }
.stream-row:hover { background: var(--field-bg); }
.stream-row .badge { font-size: 9.5px; padding: 1px 6px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px; line-height: 1.5;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--muted);
  background: var(--field-bg);
}

.lookup-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.lookup-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 64px;
  gap: 10px; align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--field-bg);
}

@media (max-width: 1280px) {
  .kpis.k8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpis.k8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-row { grid-template-columns: 96px 52px minmax(0, 1fr) 36px; padding: 7px 12px; }
  .lookup-row { grid-template-columns: 100px minmax(0, 1fr); }
  .lookup-row span:last-child { display: none; }
}

/* =====================================================================
   Motion system
   Masuk memakai ease-out, perpindahan ease-in-out, keluar 20% lebih
   pendek, tanpa bounce untuk UI harian. Semua dihormati reduced-motion.
   ===================================================================== */

:root {
  --motion-fast: 160ms;
  --motion-quick: 180ms;
  --motion-base: 220ms;
  --motion-enter: 260ms;
  --motion-exit: 176ms;
  --motion-stagger: 30ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.45, 0, .25, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
}

/* ---------------------------------------------------------- press state */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .btn, .icon-btn, .page-link, .seg a, .nav a, .monitor-tabs a,
  .wf-osi-row, .wf-flow-item {
    transition-property: color, border-color, background, box-shadow, transform;
    transition-duration: var(--motion-quick);
    transition-timing-function: var(--ease-out);
  }
  /* ditahan = tanpa tween: skala langsung diterapkan */
  .btn:active, .icon-btn:active, .page-link:active, .seg a:active,
  .nav a:active, .monitor-tabs a:active, .wf-osi-row:active,
  .wf-flow-item:active {
    transform: scale(.97);
    transition-duration: 0s;
  }
}

/* ---------------------------------------------- panel masuk / keluar */
@media (prefers-reduced-motion: no-preference) {
  .drawer {
    transition: transform var(--motion-exit) var(--ease-in),
                visibility var(--motion-exit);
  }
  .drawer.open {
    transition: transform var(--motion-enter) var(--ease-out),
                visibility var(--motion-enter);
  }
  .drawer-backdrop {
    transition: opacity var(--motion-exit) var(--ease-in),
                visibility var(--motion-exit);
  }
  .drawer-backdrop.open {
    transition: opacity var(--motion-base) var(--ease-out),
                visibility var(--motion-base);
  }
  .sidebar { transition: transform var(--motion-enter) var(--ease-out); }
  body.nav-open::after { animation: ctos-fade-in var(--motion-quick) var(--ease-out) both; }
}

@keyframes ctos-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------------ popover / toast */
.ctos-toast {
  position: fixed; z-index: 200; left: 0; right: 0; bottom: 22px;
  margin: 0 auto; width: max-content; max-width: calc(100vw - 32px);
  padding: 9px 14px; border-radius: 2px;
  background: var(--card-solid); border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  color: var(--text); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .02em; box-shadow: var(--shadow);
  will-change: transform, opacity;
}
.ctos-toast.ok { border-left-color: var(--green); }
.ctos-toast.error { border-left-color: var(--red); }
.ctos-toast.pulse-ok { animation: ctos-confirm 640ms var(--ease-out) 1; }

@keyframes ctos-confirm {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 42%, transparent), var(--shadow); }
  100% { box-shadow: 0 0 0 9px transparent, var(--shadow); }
}

/* ------------------------------------------------------- mask reveals */
.mask-reveal {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 100%);
  -webkit-mask-size: 200% 100%;
  mask-size: 200% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: ctos-mask-in 340ms var(--ease-out) both;
}

@keyframes ctos-mask-in {
  from { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  to { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}

/* -------------------------------------------- knob segmen (satu elemen) */
.seg { position: relative; }
.seg > a { position: relative; z-index: 1; border: 1px solid transparent; }
.seg-knob {
  position: absolute; left: 0; top: 3px; width: 0; height: calc(100% - 6px);
  z-index: 0; pointer-events: none; opacity: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--accent-soft); border-radius: 9px;
  transform-origin: center;
  transition: left var(--motion-base) var(--ease-in-out),
              width var(--motion-base) var(--ease-in-out),
              top var(--motion-base) var(--ease-in-out),
              height var(--motion-base) var(--ease-in-out),
              transform var(--motion-fast) var(--ease-out),
              opacity var(--motion-fast) var(--ease-out);
}
.seg-knob.is-moving { transform: scaleX(1.12); }
.seg a.active { background: transparent; border-color: transparent; }
html[data-theme="light"] .seg-knob {
  background: rgba(6, 122, 114, .1);
  border-color: rgba(6, 122, 114, .35);
}

/* ------------------------------------------------------- shared element */
.vt-incident { view-transition-name: incident; }

@view-transition { navigation: auto; }

::view-transition-old(root) { animation: ctos-vt-out var(--motion-base) var(--ease-in) both; }
::view-transition-new(root) { animation: ctos-vt-in var(--motion-base) var(--ease-out) both; }
::view-transition-old(incident),
::view-transition-new(incident) {
  animation-duration: var(--motion-enter);
  animation-timing-function: var(--ease-in-out);
}

@keyframes ctos-vt-out {
  from { opacity: 1; filter: blur(0); }
  to { opacity: 0; filter: blur(1.5px); }
}
@keyframes ctos-vt-in {
  from { opacity: 0; filter: blur(1.5px); }
  to { opacity: 1; filter: blur(0); }
}

/* --------------------------------------- batas gulir tetap di kontainer */
.table-wrap, .drawer-body, .nav, .stream,
.wf-scroll, .wf-osi, .wf-flow-list {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ctos-toast.pulse-ok { animation: none; }
  .mask-reveal {
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .seg-knob { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-old(incident), ::view-transition-new(incident) {
    animation-duration: .01ms;
  }
}

/* =====================================================================
   Design system v2, 20-point pass
   Token spacing/radius/type, kontras teks, mono hanya untuk data teknis,
   tanpa glow/scanline/glitch, radius bersarang, tabular numbers, wrapping
   headline, loading state, dan feedback animasi yang punya tujuan.
   ===================================================================== */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 32px;

  --radius-panel: 4px;
  --radius-control: 3px;
  --radius-inner: 1px;

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-md: 13px;
  --text-lg: 15px;
  --text-xl: 20px;

  --muted: #a8bbbd;
  --faint: #8ea6a8;
}

html[data-theme="light"] {
  --muted: #46524d;
  --faint: #59645f;
}

/* ------------------------------------------------ remove embellishments */
body::before,
body::after,
.card::before,
.card::after,
.kpi::before,
.kpi::after,
.auth-card::before,
.auth-card::after,
.card-head h2::before,
.hero h1::before,
.topbar::after,
.layout::before,
.auth-eyebrow::before,
.topbar-title::before,
.drawer-eyebrow {
  content: none;
  display: none;
}

.brand:hover .brand-text strong,
.hero h1,
.pill .pulse {
  animation: none;
}

/* -------------------------------------------- one type system, mono only
   Mono dipertahankan untuk kode, ID, IP, waktu, dan nilai teknis (.mono). */
body,
.btn,
.nav a,
.monitor-tabs a,
.seg a,
.pill,
.badge,
label,
input,
select,
textarea,
.empty,
.legend,
.metrics-inline,
.user-chip,
.page-link,
.pagination .info,
.filter-bar,
.hero p,
.card-head .sub,
.kpi .label,
.kpi .sub,
.kpi .value,
.drawer-head .sub,
.drawer-section-label,
.drawer-foot,
.verify-label,
.verify-meta,
.verify-status,
.verify-next,
.auth-foot,
.stream-row,
.blocked-meta,
.intel-key,
.intel-val {
  font-family: var(--font-ui);
}

code, kbd, samp, pre, .mono, .verify-value, .topbar-title span {
  font-family: var(--font-mono);
}

.btn {
  min-height: 34px;
  padding: 8px 13px;
  font-size: var(--text-sm);
  font-weight: 620;
  letter-spacing: .015em;
  text-transform: none;
}

.btn.sm {
  min-height: 28px;
  padding: 5px 10px;
  font-size: var(--text-xs);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
}

.nav a {
  font-size: var(--text-sm);
  letter-spacing: .015em;
}

.nav-label {
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  letter-spacing: .12em;
}

.monitor-tabs a {
  font-size: var(--text-sm);
  letter-spacing: .015em;
  text-transform: none;
}

.seg a {
  font-size: var(--text-xs);
  letter-spacing: .015em;
  text-transform: none;
}

.pill,
.badge {
  font-size: var(--text-2xs);
  letter-spacing: .07em;
}

label {
  font-size: var(--text-xs);
  letter-spacing: .015em;
  text-transform: none;
}

input,
select,
textarea {
  font-size: var(--text-sm);
  letter-spacing: .01em;
}

th {
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  letter-spacing: .04em;
  text-transform: none;
}

td {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

.empty {
  font-size: var(--text-sm);
  letter-spacing: .015em;
  text-transform: none;
  line-height: 1.55;
}

.legend,
.metrics-inline,
.pagination .info,
.user-chip {
  font-size: var(--text-xs);
  letter-spacing: .015em;
}

.page-link {
  font-size: var(--text-xs);
}

.intel-out {
  font-size: var(--text-xs);
}

.intel-key {
  font-size: var(--text-2xs);
  letter-spacing: .08em;
}

.kpi .label {
  font-size: var(--text-2xs);
  letter-spacing: .11em;
}

.kpi .value {
  font-size: 27px;
  font-weight: 620;
  letter-spacing: -.02em;
  line-height: 1.08;
}

.kpi .sub {
  font-size: var(--text-xs);
  line-height: 1.45;
}

.card-head h2 {
  font-size: var(--text-sm);
  letter-spacing: .02em;
}

.card-head .sub {
  font-size: var(--text-xs);
  letter-spacing: .015em;
}

.verify-label {
  font-size: var(--text-sm);
  letter-spacing: .01em;
}

.verify-meta,
.verify-status,
.verify-foot,
.auth-foot {
  font-size: var(--text-xs);
  letter-spacing: .02em;
}

.verify-status,
.verify-next {
  letter-spacing: .08em;
}

.stream-row {
  font-size: var(--text-xs);
}

/* ------------------------------------------------ spacing and grouping */
.content { gap: var(--space-5); }
.hero { gap: var(--space-4); }
.hero p { max-width: 68ch; line-height: 1.55; }
.grid { gap: var(--space-4); }
.kpis { gap: var(--space-3); }
.card-head { padding: var(--space-4) var(--space-5); }
.card-body { padding: var(--space-5); }
.card-foot { padding: var(--space-3) var(--space-5); }
.filter-bar { padding: var(--space-3) var(--space-5); gap: var(--space-2); }
.drawer-body { padding: var(--space-4) var(--space-5); }
.drawer-head { padding: var(--space-5); }
.drawer-foot { padding: var(--space-3) var(--space-5); }

/* ------------------------------------------------------- nested radius
   inner = outer - padding: seg/monitor-tabs 4px - 3px = 1px. */
.card,
.kpi,
.module,
.notice,
.auth-card,
.verify-card,
.wf-guide,
.wf-policy-status {
  border-radius: var(--radius-panel);
}

.btn,
input,
select,
textarea,
.icon-btn,
.page-link,
.seg,
.monitor-tabs,
.user-chip,
.chip,
.blocked-item {
  border-radius: var(--radius-control);
}

.seg {
  padding: 3px;
}

.seg a,
.seg-knob,
.monitor-tabs a {
  border-radius: var(--radius-inner);
}

.monitor-tabs {
  padding: 3px;
}

.seg-knob {
  top: 3px;
  height: calc(100% - 6px);
}

.badge,
.pill {
  border-radius: 2px;
}

/* ------------------------------------------------- login node status */
.auth-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: -8px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-status span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--faint);
}

.auth-status .accent { color: var(--accent); }

/* ----------------------------------------------------------- accent CTA */
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #03110f;
  clip-path: none;
  box-shadow: none;
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
  border-color: var(--accent);
  color: #03110f;
  filter: none;
}

html[data-theme="light"] .btn.primary,
html[data-theme="light"] .btn.primary:hover {
  color: #f4fffd;
}

.nav a.active {
  background: var(--accent-soft);
}

.progress > span {
  background: var(--accent);
  box-shadow: none;
}

.kpi.green .value,
.kpi.red .value,
.kpi.amber .value,
.kpi.blue .value,
.kpi.violet .value {
  text-shadow: none;
}

/* ------------------------------------------------ headline wrapping */
h1, h2, h3, h4 {
  text-wrap: balance;
}

p,
.hero p,
.card-head .sub,
.detail-list .val {
  text-wrap: pretty;
}

.hero h1 {
  flex-wrap: wrap;
  line-height: 1.25;
}

/* --------------------------------------------------- main feature size */
.chart-box.xl {
  height: 420px;
}

/* ------------------------------------------------------- tabular nums */
.mono,
code,
kbd,
samp,
pre,
table,
.kpi .value,
.kpi .sub,
.metrics-inline,
.pill,
.badge,
.stream-row,
.lookup-row,
.verify-value,
.pagination .info,
#ctos-uptime {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------------------------------------------- optical alignment */
.btn,
.seg a,
.monitor-tabs a,
.page-link {
  line-height: 1.2;
}

.topbar-actions,
.user-chip {
  align-items: center;
}

.nav a svg,
.icon-btn svg {
  flex: 0 0 auto;
}

/* --------------------------------------------------- loading feedback */
#ctos-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease-out);
}

#ctos-progress.on {
  opacity: 1;
}

#ctos-progress::before {
  content: "";
  display: block;
  width: 38%;
  height: 100%;
  background: var(--accent);
  transform: translateX(-100%);
  animation: ctos-progress 950ms var(--ease-in-out) infinite;
}

.btn.is-busy {
  pointer-events: none;
  opacity: .7;
}

.btn.is-busy::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 7px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ctos-spin .7s linear infinite;
}

#events-table.ctos-updated {
  animation: ctos-updated 900ms var(--ease-out) 1;
}

@keyframes ctos-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(360%); }
}

@keyframes ctos-spin {
  to { transform: rotate(360deg); }
}

@keyframes ctos-updated {
  0% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: inset 0 0 0 1px transparent; }
}

/* --------------------------------------------------------- KPI hierarchy
   Tiga angka utama (volume, blokir, kesehatan) membentuk baris fokus;
   turunannya menjadi strip kecil supaya mata punya urutan baca. */
.kpis-primary {
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
}
.kpis-primary .kpi.lead { padding: var(--space-4) var(--space-4) var(--space-3); }
.kpis-primary .kpi.lead .value { font-size: 34px; line-height: 1; }
.kpis-secondary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
}
.kpis-secondary .kpi { padding: var(--space-3); }
.kpis-secondary .kpi .value { font-size: 20px; }
.kpis-secondary .kpi .sub { font-size: var(--text-2xs); }

/* ------------------------------------------------------------- geo map */
:root {
  --map-land: #0c1719;
  --map-line: rgba(94, 202, 198, .16);
  --map-land-hit: #10292b;
}
html[data-theme="light"] {
  --map-land: #dde3da;
  --map-line: rgba(52, 60, 56, .18);
  --map-land-hit: #c8ded5;
}
.geo { display: grid; gap: var(--space-3); }
.geo-stage { position: relative; }
.geo-canvas { position: relative; min-height: 120px; }
.geo-canvas svg { display: block; width: 100%; height: auto; }
.geo-reset {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--card-solid) 82%, transparent);
  color: var(--muted); font-family: var(--font-mono);
  font-size: var(--text-2xs); letter-spacing: .06em;
}
.geo-reset:hover { color: var(--accent); border-color: var(--accent); }
.geo-canvas .world-land path {
  fill: var(--map-land); stroke: var(--map-line); stroke-width: .6;
  vector-effect: non-scaling-stroke;
}
.geo-canvas .world-land path.has-data { fill: var(--map-land-hit); cursor: pointer; }
.geo-canvas .world-land path.has-data:hover { fill: color-mix(in srgb, var(--accent) 18%, var(--map-land-hit)); }
.geo-canvas .world-land path.active {
  fill: color-mix(in srgb, var(--accent) 24%, var(--map-land-hit));
  stroke: var(--accent);
}
.geo-canvas path[tabindex]:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.4; }
.geo-dot {
  fill: var(--accent); stroke: var(--card-solid); stroke-width: 1.2;
  cursor: pointer;
}
.geo-dot:hover { fill: var(--red); }
.geo-dot:focus-visible { outline: none; fill: var(--red); stroke: var(--red); stroke-width: 2; }
.geo-dot.active { fill: var(--red); }
.geo-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.geo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--panel-2); color: var(--muted);
  font-size: var(--text-2xs); letter-spacing: .05em;
}
.geo-chip:hover { border-color: var(--border-strong); color: var(--text); }
.geo-chip .mono { color: var(--text); }
.geo-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.geo-note { color: var(--faint); font-size: var(--text-2xs); }

/* ------------------------------------------------------- confirm dialog */
.ctos-confirm {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: var(--space-4);
}
.ctos-confirm[hidden] { display: none; }
.ctos-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 6, 8, .68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.ctos-confirm-panel {
  position: relative; width: min(420px, 100%);
  padding: var(--space-5);
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  animation: ctos-confirm-in 160ms var(--ease-out) both;
}
.ctos-confirm-title {
  margin: 0; font-size: var(--text-md); font-weight: 600; letter-spacing: .02em;
}
.ctos-confirm-message {
  margin: var(--space-2) 0 0; color: var(--muted);
  font-size: var(--text-md); line-height: 1.55; overflow-wrap: anywhere;
}
.ctos-confirm-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap;
  gap: var(--space-2); margin-top: var(--space-4);
}
body.confirm-open { overflow: hidden; }
@keyframes ctos-confirm-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- live state */
.live-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.live-state[hidden] { display: none; }
.live-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.live-state[data-state="live"] { color: var(--green); }
.live-state[data-state="stale"] {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}

/* --------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .kpis-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .monitor-tabs { position: static; }
  .hero { align-items: flex-start; }
}

@media (max-width: 640px) {
  .content { gap: var(--space-4); }
  .hero h1 { font-size: 17px; }
  .kpi .value { font-size: 22px; }
  .kpis-primary, .kpis-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis-primary .kpi.lead .value { font-size: 27px; }
  .chart-box.xl { height: 300px; }
  .card-head h2 { font-size: 11.5px; }
  .card-head { padding: var(--space-3) var(--space-4); }
  .card-body { padding: var(--space-4); }
  .filter-bar { padding: var(--space-3) var(--space-4); }
}

@media (max-width: 480px) {
  .kpis-primary, .kpis-secondary { grid-template-columns: minmax(0, 1fr); }
  .live-state .live-text { display: none; }
  .live-state { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .ctos-confirm-panel,
  #ctos-progress::before,
  .btn.is-busy::after,
  #events-table.ctos-updated {
    animation: none;
  }
}
