/* RLM Monitor · console design system
   Same paper / ink / vermilion language as the public site. */

:root {
  --paper: #f2f0e9;
  --paper-raised: #faf8f2;
  --paper-deep: #e8e5dc;
  --ink: #191a17;
  --ink-soft: #505148;
  --muted: #77766d;
  --faint: #a3a094;
  --line: #cbc7bb;
  --line-soft: #dfdcd2;
  --accent: #df5435;
  --accent-dark: #bb3f25;
  --accent-soft: #f5d8cc;
  --ok: #4f7a52;
  --warn: #a87524;
  --danger: #b23a2b;
  --olive: #6f7357;
  --sidebar: #191a17;
  --sidebar-soft: #262721;
  --serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: Arial, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  --mono: Consolas, "SFMono-Regular", "Courier New", monospace;
  --shadow: 0 24px 60px rgba(39, 35, 25, .14);
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
code, kbd, .mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }

.brand { font-family: var(--serif); font-weight: 900; letter-spacing: -.08em; text-decoration: none; }
.brand span { color: var(--accent); }
.brand-large { font-size: 32px; line-height: 1; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0;
  color: var(--accent); font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow > span { width: 22px; height: 1px; background: currentColor; }
.mono-label { font: 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.noscript { position: fixed; inset: auto 0 0; background: var(--ink); color: #fff; padding: 14px; text-align: center; z-index: 999; }

/* ---------- buttons / fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 10px 16px; text-decoration: none; font-size: 12px; line-height: 1;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
  border-radius: var(--radius);
}
.btn:hover { background: var(--paper-deep); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { padding: 7px 11px; font-size: 11px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-arrow { font-size: 15px; line-height: 1; }
.icon-button {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 17px;
  border-radius: 50%; transition: border-color .18s, background .18s;
}
.icon-button:hover { border-color: var(--ink); background: var(--paper-raised); }

.field { display: block; margin-bottom: 20px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 12px; }
.field-hint { font: 9px var(--mono); letter-spacing: .12em; color: var(--faint); }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 10px 12px; font-size: 13px; border-radius: var(--radius); outline: none;
  transition: border-color .18s, background .18s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: rgba(250, 248, 242, .7); }
textarea { resize: vertical; min-height: 96px; line-height: 1.65; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 58px; }
.reveal-button { position: absolute; right: 0; top: 0; bottom: 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 12px; }
.reveal-button:hover { color: var(--accent); }
.checkline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.checkline input { accent-color: var(--accent); }
.form-error { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--danger); background: rgba(178, 58, 43, .07); color: var(--danger); font-size: 12px; line-height: 1.6; }
.form-ok { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--ok); background: rgba(79, 122, 82, .08); color: var(--ok); font-size: 12px; }

/* ---------- login ---------- */
.auth-page { min-height: 100vh; background: var(--paper); }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); }
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 38px 48px 30px; background: var(--sidebar); color: var(--paper);
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(242, 240, 233, .18) 40px 41px);
  transform: rotate(-8deg) scale(1.2);
}
.auth-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.auth-top .brand { color: var(--paper); }
.auth-top .mono-label { color: rgba(242, 240, 233, .55); }
.auth-copy { position: relative; z-index: 2; margin-top: clamp(50px, 9vh, 110px); max-width: 620px; }
.auth-copy .eyebrow { color: var(--accent); }
.auth-copy h1 { margin: 28px 0 26px; font-size: clamp(52px, 6.4vw, 90px); line-height: 1.06; letter-spacing: -.065em; color: var(--paper); }
.auth-copy h1 em { color: var(--accent); font-style: normal; }
.auth-lede { max-width: 430px; color: rgba(242, 240, 233, .66); font-family: var(--serif); font-size: 15px; line-height: 2; }
.auth-record { position: absolute; right: -70px; bottom: 8%; width: min(35vw, 460px); aspect-ratio: 1; z-index: 1; opacity: .9; }
.record-disc {
  position: absolute; inset: 8%; border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #2c2d27 0 2px, #20211d 3px 5px, #34352e 6px 7px);
  box-shadow: 24px 30px 80px rgba(0, 0, 0, .45);
  animation: spin 34s linear infinite;
}
.record-disc::after { content: ""; position: absolute; inset: 33%; border-radius: 50%; background: var(--accent); }
.record-ring { position: absolute; inset: 0; border: 1px solid rgba(242, 240, 233, .14); border-radius: 50%; }
.record-ring::before { content: ""; position: absolute; inset: 9%; border: 1px solid rgba(242, 240, 233, .08); border-radius: 50%; }
.record-center { position: absolute; inset: 39%; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font: 9px var(--mono); letter-spacing: .16em; }
.record-center span { font-family: var(--serif); font-size: 27px; font-weight: 900; letter-spacing: -.06em; }
.record-center small { margin-top: 2px; font-size: 7px; }
.record-arm { position: absolute; right: 11%; top: 4%; width: 2px; height: 35%; background: rgba(242, 240, 233, .4); transform: rotate(22deg); transform-origin: top center; }
.record-arm::after { content: ""; position: absolute; left: -4px; bottom: -7px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); }
.auth-bottom { position: relative; z-index: 2; margin-top: auto; display: flex; gap: 40px; padding-top: 28px; border-top: 1px solid rgba(242, 240, 233, .14); }
.auth-bottom > div { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: rgba(242, 240, 233, .72); }
.auth-bottom .mono-label { color: rgba(242, 240, 233, .4); }
.auth-bottom a { text-decoration: none; border-bottom: 1px solid rgba(242, 240, 233, .25); }
.auth-bottom a:hover { color: var(--accent); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 42px clamp(26px, 5vw, 84px) 26px; background: var(--paper); }
.auth-card { width: 100%; max-width: 430px; margin: auto; }
.auth-card h2 { margin: 22px 0 10px; font-size: clamp(34px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.04em; }
.auth-sub { margin: 0 0 32px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.auth-form-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 2px 0 22px; }
#caps-warning { color: var(--accent); }
.auth-note { display: flex; gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-note p { margin: 0; }
.lock-mark { font-size: 18px; color: var(--accent); line-height: 1.2; }
.auth-footer { width: 100%; max-width: 430px; margin: 44px auto 0; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; color: var(--faint); font: 9px var(--mono); letter-spacing: .08em; }
.auth-footer a { text-decoration: none; border-bottom: 1px solid var(--line); }
.auth-footer a:hover { color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- app shell ---------- */
.app-page { background: var(--paper); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--sidebar); color: var(--paper); padding: 26px 18px 18px; z-index: 40;
}
.side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px 22px; }
.side-brand { font-family: var(--serif); font-size: 30px; font-weight: 900; letter-spacing: -.08em; color: var(--paper); text-decoration: none; }
.side-brand span { color: var(--accent); }
.side-tag { font: 8px var(--mono); letter-spacing: .18em; color: rgba(242, 240, 233, .45); }
.side-site { padding: 15px 8px 20px; border-top: 1px solid rgba(242, 240, 233, .12); border-bottom: 1px solid rgba(242, 240, 233, .12); }
.side-site .mono-label { display: block; margin-bottom: 5px; color: rgba(242, 240, 233, .35); }
.side-site a { color: rgba(242, 240, 233, .8); font-size: 11px; text-decoration: none; line-height: 1.5; }
.side-site a:hover { color: var(--accent); }
.side-nav { display: flex; flex-direction: column; gap: 1px; padding: 14px 0; overflow-y: auto; }
.side-nav a {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px;
  padding: 9px 10px; color: rgba(242, 240, 233, .62); text-decoration: none; font-size: 12px;
  border-left: 2px solid transparent; transition: background .16s, color .16s, border-color .16s;
}
.side-nav a:hover { color: var(--paper); background: rgba(242, 240, 233, .05); }
.side-nav a.is-active { color: var(--paper); background: rgba(223, 84, 53, .14); border-left-color: var(--accent); }
.nav-index { font: 9px var(--mono); letter-spacing: .08em; color: rgba(242, 240, 233, .32); }
.side-nav a.is-active .nav-index { color: var(--accent); }
.nav-en { font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(242, 240, 233, .25); }
.side-nav a.is-active .nav-en { color: rgba(242, 240, 233, .55); }
.side-status { margin-top: auto; padding: 14px 8px; border-top: 1px solid rgba(242, 240, 233, .12); display: flex; flex-direction: column; gap: 7px; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 9px var(--mono); letter-spacing: .06em; color: rgba(242, 240, 233, .62); }
.status-line.muted { color: rgba(242, 240, 233, .38); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #86b58a; box-shadow: 0 0 0 4px rgba(134, 181, 138, .12); }
.side-foot { border-top: 1px solid rgba(242, 240, 233, .12); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.alerts-button { display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; color: rgba(242, 240, 233, .7); padding: 6px 8px; font-size: 11px; }
.alerts-button:hover { color: var(--paper); }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; font: 9px var(--mono); }
.side-link { padding: 0 8px; color: rgba(242, 240, 233, .38); font-size: 10px; text-decoration: none; }
.side-link:hover { color: var(--accent); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 8px; background: rgba(242, 240, 233, .05); cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 14px; flex: none; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-user-text b { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { font: 7px var(--mono); letter-spacing: .1em; color: rgba(242, 240, 233, .35); }
.logout-button { margin-left: auto; border: 0; background: transparent; color: rgba(242, 240, 233, .4); font-size: 10px; padding: 4px; }
.logout-button:hover { color: var(--accent); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 26px 38px 22px; border-bottom: 1px solid var(--line); background: rgba(242, 240, 233, .72); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.top-title .eyebrow { margin-bottom: 7px; }
.top-title h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); line-height: 1.1; letter-spacing: -.04em; }
.top-sub { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.top-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.global-search { position: relative; display: flex; align-items: center; border: 1px solid var(--line); background: var(--paper-raised); padding: 0 9px; height: 36px; min-width: 220px; }
.global-search > span { color: var(--muted); font-size: 18px; line-height: 1; }
.global-search input { border: 0; background: transparent; padding: 0 8px; height: 34px; font-size: 11px; }
.global-search input:focus { background: transparent; }
.global-search kbd { font: 9px var(--mono); color: var(--faint); border-left: 1px solid var(--line); padding-left: 7px; }
.range-group { display: flex; border: 1px solid var(--line); background: var(--paper-raised); height: 36px; }
.range-group button { border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 0 12px; font-size: 11px; transition: background .16s, color .16s; }
.range-group button:last-child { border-right: 0; }
.range-group button:hover { color: var(--ink); background: var(--paper-deep); }
.range-group button.is-active { background: var(--ink); color: var(--paper); }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font: 9px var(--mono); letter-spacing: .12em; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(223, 84, 53, .35); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(223, 84, 53, 0); } }
.nav-toggle { display: none; border: 1px solid var(--line); background: transparent; width: 36px; height: 36px; font-size: 18px; }
.custom-range { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 38px; border-bottom: 1px solid var(--line); background: var(--paper-raised); }
.custom-range label { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.custom-range input { width: 140px; padding: 7px 9px; font-size: 11px; }
.custom-range-note { color: var(--faint); font-size: 10px; }
.view { padding: 28px 38px 70px; width: 100%; max-width: 1680px; margin: 0 auto; min-height: 60vh; outline: none; }
.view:focus, .view:focus-visible { outline: none; }
.app-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 38px; border-top: 1px solid var(--line); color: var(--faint); font: 9px var(--mono); letter-spacing: .06em; }
.app-footer a { text-decoration: none; border-bottom: 1px solid var(--line); }
.app-footer a:hover { color: var(--accent); }

/* ---------- layout / panels ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.panel { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-title { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.panel-kicker { margin: 0 0 4px; color: var(--faint); font: 8px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-link { border: 0; background: transparent; color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); padding: 2px 0; text-decoration: none; }
.panel-link:hover { color: var(--accent); border-color: var(--accent); }
.panel-dark { background: var(--sidebar); border-color: var(--sidebar); color: var(--paper); }
.panel-dark .panel-title { color: var(--paper); }
.panel-dark .panel-kicker, .panel-dark .panel-sub { color: rgba(242, 240, 233, .45); }
.panel-dark .panel-link { color: rgba(242, 240, 233, .6); border-color: rgba(242, 240, 233, .2); }
.panel-dark .panel-link:hover { color: var(--accent); }
.panel-flush { padding: 0; }
.panel-flush .panel-head { padding: 18px 20px 0; margin-bottom: 12px; }
.panel-flush .table-wrap { border-top: 1px solid var(--line); }
.panel-flush .panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); }

/* ---------- KPI ---------- */
.kpi-card { position: relative; background: var(--paper-raised); border: 1px solid var(--line); padding: 18px 18px 14px; min-height: 138px; display: flex; flex-direction: column; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s; }
.kpi-card:hover::after { transform: scaleX(1); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font: 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.kpi-icon { color: var(--faint); font-size: 14px; }
.kpi-value { margin: 12px 0 4px; font-family: var(--serif); font-size: clamp(32px, 3.2vw, 46px); line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--faint); font-size: 10px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font: 10px var(--mono); }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); } .delta.flat { color: var(--muted); }
.sparkline { width: 72px; height: 24px; opacity: .85; }
.kpi-note { color: var(--faint); font-size: 9px; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; width: 100%; }
.chart-canvas { display: block; width: 100%; height: 280px; }
.chart-canvas-sm { height: 180px; }
.chart-tooltip { position: fixed; z-index: 120; pointer-events: none; background: var(--ink); color: var(--paper); padding: 8px 10px; font: 10px var(--mono); line-height: 1.7; box-shadow: var(--shadow); transform: translate(-50%, -110%); white-space: nowrap; opacity: 0; transition: opacity .12s; }
.chart-tooltip.is-visible { opacity: 1; }
.chart-legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.chart-empty { height: 260px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-family: var(--serif); font-size: 16px; }

/* ---------- bars / lists ---------- */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 12px; align-items: center; }
.bar-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 11px; }
.bar-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label small { color: var(--faint); font: 9px var(--mono); }
.bar-track { height: 5px; background: var(--paper-deep); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); transform-origin: left; animation: bar-in .6s cubic-bezier(.2,.7,.2,1) both; }
.bar-fill.olive { background: var(--olive); } .bar-fill.ink { background: var(--ink); } .bar-fill.muted { background: var(--faint); }
.bar-value { text-align: right; font: 11px var(--mono); color: var(--ink); }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.rank-item:last-child { border-bottom: 0; }
.rank-index { color: var(--faint); font: 9px var(--mono); }
.rank-main { min-width: 0; }
.rank-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.rank-sub { color: var(--faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font: 11px var(--mono); color: var(--ink); }
.rank-meta { color: var(--faint); font: 9px var(--mono); }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { padding: 9px 12px; text-align: left; font: 8px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr { transition: background .14s; }
table.data tbody tr:hover { background: var(--paper-deep); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .mono-cell { font-family: var(--mono); font-size: 10px; }
.ip-cell { font-family: var(--mono); font-size: 10px; color: var(--ink-soft); white-space: nowrap; }
.cell-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { color: var(--faint); font-size: 9px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { text-align: right; white-space: nowrap; }
.row-strong { font-weight: 600; }
.empty-row { text-align: center; color: var(--faint); padding: 34px 12px !important; font-family: var(--serif); font-size: 15px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pagination-buttons { display: flex; align-items: center; gap: 6px; }
.page-btn { min-width: 26px; height: 26px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 10px var(--mono); }
.page-btn:hover { border-color: var(--ink); color: var(--ink); }
.page-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- filters / tags ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-bar .search-input { min-width: 220px; flex: 1 1 220px; }
.filter-bar select { width: auto; min-width: 120px; }
.filter-bar .btn { flex: none; }
.filter-spacer { flex: 1; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); letter-spacing: .04em; white-space: nowrap; }
.tag-accent { border-color: var(--accent); color: var(--accent); background: rgba(223, 84, 53, .06); }
.tag-ok { border-color: rgba(79, 122, 82, .4); color: var(--ok); background: rgba(79, 122, 82, .07); }
.tag-danger { border-color: rgba(178, 58, 43, .4); color: var(--danger); background: rgba(178, 58, 43, .07); }
.tag-warn { border-color: rgba(168, 117, 36, .4); color: var(--warn); background: rgba(168, 117, 36, .07); }
.tag-muted { color: var(--faint); }
.tag-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.method { font: 8px var(--mono); letter-spacing: .08em; color: var(--faint); }

/* ---------- realtime ---------- */
.pulse-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(242, 240, 233, .14); border: 1px solid rgba(242, 240, 233, .14); }
.pulse-cell { padding: 14px; background: var(--sidebar); }
.pulse-cell b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.1; color: var(--paper); }
.pulse-cell span { display: block; margin-top: 4px; font: 8px var(--mono); letter-spacing: .1em; color: rgba(242, 240, 233, .45); text-transform: uppercase; }
.feed { display: flex; flex-direction: column; max-height: 460px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.feed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.feed-dot.search { background: var(--olive); }
.feed-main { min-width: 0; }
.feed-title { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { color: var(--faint); font: 9px var(--mono); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { color: var(--faint); font: 9px var(--mono); white-space: nowrap; }
.live-page-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.live-page-row:last-child { border-bottom: 0; }
.live-page-title { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-page-count { font: 10px var(--mono); color: var(--accent); }

/* ---------- drawer / modal / toast ---------- */
.drawer-root, .modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(25, 26, 23, .45); opacity: 0; transition: opacity .2s; pointer-events: auto; }
.drawer-backdrop.is-open, .modal-backdrop.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(25, 26, 23, .18); transform: translateX(102%); transition: transform .28s cubic-bezier(.2,.7,.2,1); pointer-events: auto; display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; background: var(--sidebar); color: var(--paper); }
.drawer-kicker { margin: 0 0 4px; color: rgba(242, 240, 233, .45); font: 8px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.drawer-title { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--paper); }
.drawer-sub { margin: 5px 0 0; color: rgba(242, 240, 233, .55); font-size: 10px; }
.drawer-close { border: 1px solid rgba(242, 240, 233, .25); background: transparent; color: var(--paper); width: 30px; height: 30px; font-size: 16px; flex: none; }
.drawer-close:hover { border-color: var(--accent); color: var(--accent); }
.drawer-body { padding: 22px 24px 40px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 26px; }
.drawer-section h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 19px; }
.drawer-section h3 small { margin-left: 6px; color: var(--faint); font: 8px var(--mono); letter-spacing: .1em; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin-bottom: 20px; }
.drawer-stat { background: var(--paper-raised); padding: 12px; }
.drawer-stat b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.1; }
.drawer-stat span { display: block; margin-top: 3px; color: var(--faint); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.timeline-time { color: var(--faint); font: 9px var(--mono); }
.timeline-main { min-width: 0; }
.timeline-title { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; font-size: 11px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.code-box { background: var(--ink); color: var(--paper); padding: 12px 14px; font: 11px var(--mono); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); width: min(520px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transition: opacity .18s, transform .18s; pointer-events: auto; }
.modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 18px 22px; background: var(--sidebar); color: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; color: var(--paper); font-size: 22px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.modal-error { margin-top: 10px; color: var(--danger); font-size: 11px; }
.modal fieldset { border: 1px solid var(--line); padding: 10px 12px; margin: 0 0 16px; }
.modal legend { padding: 0 6px; color: var(--muted); font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 15px; font-size: 11px; box-shadow: var(--shadow); border-left: 2px solid var(--accent); min-width: 220px; max-width: 360px; animation: toast-in .22s cubic-bezier(.2,.7,.2,1); pointer-events: auto; }
.toast.ok { border-left-color: #86b58a; } .toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.stat-cell { background: var(--paper-raised); padding: 14px 16px; }
.stat-cell b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.1; }
.stat-cell span { display: block; margin-top: 3px; color: var(--faint); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-table th, .mini-table td { padding: 8px 10px; }
.note-box { padding: 12px 14px; border-left: 2px solid var(--accent); background: rgba(223, 84, 53, .06); color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.warning-box { padding: 12px 14px; border-left: 2px solid var(--warn); background: rgba(168, 117, 36, .07); color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.status-item { padding: 12px; border: 1px solid var(--line-soft); background: var(--paper-raised); }
.status-item b { display: block; font-size: 12px; margin-bottom: 4px; }
.status-item span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.section-divider { height: 1px; background: var(--line); margin: 26px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions .hint { color: var(--faint); font-size: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { display: block; font-size: 12px; font-weight: 500; }
.toggle-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 10px; transition: background .18s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skeleton { background: linear-gradient(90deg, var(--paper-deep) 25%, var(--paper-raised) 37%, var(--paper-deep) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton-kpi { height: 138px; } .skeleton-chart { grid-column: span 8; height: 330px; } .skeleton-panel { grid-column: span 4; height: 330px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.empty-state { text-align: center; padding: 44px 20px; color: var(--faint); }
.empty-state b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--muted); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 11px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
.loading-overlay { position: fixed; inset: 0; z-index: 160; background: rgba(242, 240, 233, .7); display: flex; align-items: center; justify-content: center; font: 10px var(--mono); letter-spacing: .1em; color: var(--muted); backdrop-filter: blur(2px); }
.loading-overlay .spinner { width: 18px; height: 18px; margin-right: 8px; }

/* ---------- privacy / error / blocked ---------- */
.privacy-page, .error-page { min-height: 100vh; background: var(--paper); }
.privacy-wrap { max-width: 780px; margin: 0 auto; padding: 9vh 24px 80px; }
.privacy-wrap .brand { display: inline-block; margin-bottom: 34px; }
.privacy-wrap h1 { margin: 18px 0 16px; font-size: clamp(38px, 6vw, 62px); line-height: 1.08; letter-spacing: -.05em; }
.privacy-lede { color: var(--ink-soft); font-family: var(--serif); font-size: 16px; line-height: 2; margin-bottom: 34px; }
.privacy-wrap section { padding: 20px 0; border-top: 1px solid var(--line); }
.privacy-wrap h2 { margin: 0 0 10px; font-size: 23px; }
.privacy-wrap p, .privacy-wrap li { color: var(--ink-soft); font-size: 13px; line-height: 1.95; }
.privacy-wrap ul { padding-left: 18px; }
.privacy-wrap a { color: var(--accent); }
.privacy-foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 18px; color: var(--faint); font: 9px var(--mono); }
.privacy-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.error-page { display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { max-width: 540px; padding: 34px; border: 1px solid var(--line); background: var(--paper-raised); }
.error-code { display: block; font-family: var(--serif); font-size: 84px; line-height: 1; color: var(--accent-soft); letter-spacing: -.06em; margin-bottom: 8px; }
.error-card h1 { margin: 16px 0 12px; font-size: 34px; }
.error-card p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.error-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.blocked-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); color: var(--paper); padding: 24px; }
.blocked-card { max-width: 560px; }
.blocked-card .brand { display: block; margin-bottom: 38px; color: var(--paper); }
.blocked-card h1 { font-size: clamp(40px, 7vw, 64px); line-height: 1.08; margin: 18px 0 18px; color: var(--paper); }
.blocked-card p { color: rgba(242, 240, 233, .6); font-family: var(--serif); font-size: 15px; line-height: 2; }
.blocked-card .meta { margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(242, 240, 233, .16); color: rgba(242, 240, 233, .35); font: 9px var(--mono); letter-spacing: .1em; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; }
  .span-4 { grid-column: span 6; }
  .span-5, .span-7, .span-8, .span-9 { grid-column: span 12; }
  .pulse-grid { grid-template-columns: repeat(2, 1fr); }
  .global-search { min-width: 170px; }
}
@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { min-height: 46vh; padding: 28px 28px 24px; }
  .auth-copy { margin-top: 38px; }
  .auth-copy h1 { font-size: clamp(46px, 12vw, 70px); }
  .auth-record { width: 260px; right: -80px; bottom: -60px; opacity: .5; }
  .auth-bottom { display: none; }
  .auth-panel { min-height: 54vh; padding: 38px 28px 26px; }
  .auth-card { margin: 0 auto; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 252px; transform: translateX(-102%); transition: transform .25s; box-shadow: 20px 0 60px rgba(25, 26, 23, .25); }
  .sidebar.is-open { transform: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 18px 20px; flex-wrap: wrap; align-items: flex-start; }
  .top-tools { width: 100%; justify-content: flex-start; }
  .view { padding: 20px 20px 60px; }
  .custom-range { padding: 12px 20px; }
  .app-footer { padding: 16px 20px; }
}
@media (max-width: 720px) {
  .top-title h1 { font-size: 30px; }
  .top-sub { display: none; }
  .global-search { flex: 1 1 100%; }
  .range-group { flex: 1 1 auto; }
  .range-group button { flex: 1; padding: 0 8px; }
  .grid { gap: 12px; }
  .span-3, .span-4, .span-6 { grid-column: span 12; }
  .kpi-card { min-height: 124px; }
  .kpi-value { font-size: 38px; }
  .panel { padding: 16px; }
  .stat-strip, .drawer-stats, .status-grid, .form-grid, .split { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
  .pulse-grid { grid-template-columns: 1fr 1fr; }
  .drawer { width: 100vw; }
  .timeline-item { grid-template-columns: 78px 1fr; }
  .app-footer { flex-wrap: wrap; }
  .auth-bottom { display: none; }
  .privacy-wrap { padding: 7vh 20px 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
