:root {
  --ink: #111820;
  --muted: #6d7680;
  --page: #f3f5f9;
  --panel: #ffffff;
  --sidebar: #a9dded;
  --lime: #dfff35;
  --blue: #147df5;
  --line: #dfe4ea;
  --danger: #d72d4a;
  --warning: #f1a511;
  --ok: #0c9560;
  --shadow: 0 2px 0 rgba(17, 24, 32, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { font-size: 16px; }
a { color: inherit; }
button, input, select { font: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; padding: 22px 14px; background: linear-gradient(180deg, #91cfe5, #c4e9f4); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 12px 24px; font-weight: 900; font-size: 25px; letter-spacing: -.8px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--ink); color: var(--lime); font-size: 14px; }
.nav { display: grid; gap: 7px; }
.nav a { text-decoration: none; padding: 13px 15px; border-radius: 24px; font-weight: 700; display: flex; gap: 11px; align-items: center; }
.nav a.active, .nav a:hover { background: var(--lime); }
.nav-dot { width: 10px; height: 10px; background: currentColor; border-radius: 50%; opacity: .78; }
.side-status { margin-top: auto; padding: 17px; border-radius: 20px; background: rgba(255,255,255,.64); font-size: 13px; line-height: 1.5; }
.side-status strong { display: block; font-size: 16px; margin: 3px 0; }
.main { grid-column: 2; min-width: 0; }
.topbar { min-height: 66px; padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 4; }
.topbar h1 { font: 700 30px/1.1 Georgia, serif; margin: 0; }
.top-meta { display: flex; align-items: center; gap: 14px; color: #35404b; font-size: 14px; }
.status-pill { padding: 9px 14px; border-radius: 999px; background: var(--lime); font-weight: 800; }
.content { padding: 20px 28px 42px; max-width: 1800px; margin: 0 auto; }

.window-bar { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; align-items: center; }
.window-tabs { display: inline-flex; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.window-tabs a { min-width: 64px; padding: 9px 17px; border-radius: 20px; text-decoration: none; text-align: center; font-weight: 750; }
.window-tabs a.active { background: var(--lime); }
.freshness { color: var(--muted); font-size: 13px; text-align: right; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 16px; }
.card, .panel { background: var(--panel); border: 1px solid #e9edf1; border-radius: 20px; box-shadow: var(--shadow); }
.card { min-height: 130px; padding: 19px 20px; }
.card-label { font-size: 14px; font-weight: 750; color: #303a45; }
.card-value { margin-top: 12px; color: var(--blue); font-size: clamp(27px, 2.2vw, 39px); line-height: 1; letter-spacing: -1.8px; font-weight: 750; }
.card-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, .8fr); gap: 16px; margin-bottom: 16px; }
.panel { padding: 18px 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.panel-title { margin: 0; font-size: 18px; }
.eyebrow { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.chart { display: block; width: 100%; height: auto; min-height: 250px; overflow: visible; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: url(#yp-fill); }
.chart circle { fill: #fff; stroke: var(--blue); stroke-width: 3; }
.metric-explain { padding: 14px 15px; background: #f3f7fb; border-radius: 14px; line-height: 1.45; font-size: 13px; color: #43505c; }
.metric-explain code { color: var(--ink); font-weight: 800; }

.alert-list { display: grid; gap: 10px; }
.alert { border: 1px solid #ffd7a3; background: #fffaf0; border-radius: 15px; padding: 14px; }
.alert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.alert strong { display: block; margin-bottom: 3px; }
.alert-meta { color: var(--muted); font-size: 12px; }
.domain-change { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 10px; font-size: 11px; }
.domain-box { min-width: 0; padding: 7px; border-radius: 9px; background: white; border: 1px solid #f1dfc6; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #edf1f5; font-size: 11px; font-weight: 800; }
.badge.pending { background: #fff0c9; color: #8b5700; }
.badge.ok { background: #d9f6e9; color: #06754a; }
.badge.error { background: #ffe0e5; color: #a61731; }
.button-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn { appearance: none; border: 0; padding: 9px 14px; border-radius: 20px; background: #d9eaf2; color: var(--ink); text-decoration: none; font-weight: 800; cursor: pointer; }
.btn.primary { background: var(--lime); }
.btn.danger { color: #fff; background: var(--danger); }
.btn:hover { filter: brightness(.97); transform: translateY(-1px); }

.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { background: #f4f6f9; text-align: left; color: #34404d; font-size: 12px; padding: 11px 13px; white-space: nowrap; }
td { padding: 11px 13px; border-bottom: 1px solid #edf0f3; font-size: 13px; }
tbody tr:hover { background: #f8fbfd; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.money { color: #006fe8; font-weight: 850; }
.winner { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px #17202a; margin-right: 7px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.footer { display: flex; justify-content: space-between; padding-top: 18px; color: var(--muted); font-size: 12px; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--sidebar), #f5f7fb 55%); padding: 20px; }
.login-card { width: min(440px, 100%); background: #fff; padding: 30px; border-radius: 25px; box-shadow: 0 20px 80px rgba(20, 60, 80, .18); }
.login-card h1 { margin: 0 0 5px; font-size: 28px; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { font-size: 13px; font-weight: 800; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; }
.error-box { padding: 11px 13px; border-radius: 12px; color: #9b1630; background: #ffe7ec; font-size: 13px; }
.code-box { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; max-height: 440px; overflow: auto; border-radius: 14px; background: #111820; color: #e5eff6; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-column h3 { margin: 12px 0 7px; font-size: 13px; }
.note-input { padding: 9px; border: 1px solid var(--line); border-radius: 20px; }
.back-link { margin-top: 16px; }

@media (max-width: 1150px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; padding: 12px; }
  .brand { padding-bottom: 10px; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .nav a { justify-content: center; padding: 10px; font-size: 13px; }
  .side-status { display: none; }
  .topbar { padding: 12px 16px; }
  .top-meta .status-pill { display: none; }
  .content { padding: 15px; }
  .window-bar { align-items: flex-start; flex-direction: column; }
  .window-tabs { width: 100%; overflow-x: auto; }
  .window-tabs a { min-width: 58px; padding-inline: 12px; }
  .cards { grid-template-columns: 1fr; }
  .code-compare { grid-template-columns: 1fr; }
  .card { min-height: 110px; }
  .footer { gap: 8px; flex-direction: column; }
}
