* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef4f7;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8e0e7;
  --accent: #0f766e;
  --accent-2: #255a9b;
  --danger: #b42318;
  --warn: #a15c07;
  --ok: #217a43;
  --shadow: 0 12px 28px rgba(21, 31, 45, 0.08);
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
}
.login-brief {
  padding: clamp(36px, 7vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #102027 0%, #184e55 48%, #f4b860 100%);
  color: #fff;
}
.login-brief h1 { margin: 0; font-size: clamp(3rem, 8vw, 6rem); line-height: .9; letter-spacing: 0; }
.login-brief p { max-width: 650px; color: rgba(255,255,255,.82); font-size: 1.15rem; }
.login-panel { background: var(--surface); padding: clamp(28px, 6vw, 58px); display: flex; flex-direction: column; justify-content: center; }
.brand { font-weight: 850; letter-spacing: 0; font-size: 1.1rem; margin-bottom: 34px; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-weight: 750; color: #344054; }
input, select {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 3px solid rgba(15,118,110,.18); border-color: var(--accent); }
.primary-button, .ghost-button, .icon-button {
  min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; text-decoration: none;
}
.primary-button { background: var(--accent); color: #fff; border-color: var(--accent); }
.ghost-button:hover, .icon-button:hover { background: var(--surface-2); }
.error { color: var(--danger); font-weight: 750; min-height: 22px; }
.turnstile-widget { min-height: 68px; display: flex; align-items: center; color: var(--muted); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: #111827; color: #f9fafb; padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; }
.sidebar .brand { margin: 0; }
.nav-list { display: grid; gap: 6px; }
.nav-link { text-decoration: none; color: #cbd5e1; padding: 11px 12px; border-radius: 8px; font-weight: 760; display: flex; gap: 10px; align-items: center; }
.nav-link.active, .nav-link:hover { background: #263449; color: #fff; }
.nav-icon { width: 24px; text-align: center; color: #8bd8d1; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; color: #b6c2d1; font-size: .88rem; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 68px; padding: 12px clamp(18px, 3vw, 34px); background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 3; backdrop-filter: blur(12px); }
.topbar h1 { font-size: 1.25rem; margin: 0; flex: 0 0 auto; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; flex: 1; }
.lookup-form { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 360px; max-width: 520px; }
.lookup-form input { min-height: 42px; }
.lookup-form .icon-button { min-height: 42px; flex: 0 0 auto; white-space: nowrap; }
.page { padding: clamp(18px, 3vw, 34px); display: grid; gap: 20px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-header h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1; letter-spacing: 0; }
.page-header p { margin: 8px 0 0; color: var(--muted); max-width: 760px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); min-height: 118px; }
.metric span { color: var(--muted); font-weight: 760; font-size: .84rem; text-transform: uppercase; }
.metric strong { display: block; margin-top: 10px; font-size: 2rem; line-height: 1; }
.metric small { color: var(--muted); display: block; margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.panel-header { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: 16px 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
.row-link { color: var(--accent-2); font-weight: 800; text-decoration: none; }
.badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 0 10px; font-weight: 850; font-size: .78rem; background: #e8eef7; color: #28435f; }
.badge.ok { background: #e6f4ec; color: var(--ok); }
.badge.warn { background: #fff4df; color: var(--warn); }
.badge.critical { background: #fde8e5; color: var(--danger); }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 14px; }
.kv dt { color: var(--muted); font-weight: 800; }
.kv dd { margin: 0; word-break: break-word; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wide-form { flex: 1; justify-content: flex-end; }
.wide-form input { max-width: 520px; }
.empty { padding: 26px; color: var(--muted); text-align: center; }
.list { display: grid; gap: 10px; }
.signal { border-left: 4px solid var(--line); padding: 12px 14px; background: #fbfcfd; border-radius: 8px; }
.signal.ok { border-left-color: var(--ok); }
.signal.warning { border-left-color: var(--warn); }
.signal.critical { border-left-color: var(--danger); }
.signal strong { display: block; }
.signal span { color: var(--muted); }
.mobile-menu { display: none; }
@media (max-width: 1040px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-layout, .layout { grid-template-columns: 1fr; }
  .login-brief { min-height: 42vh; }
  .sidebar { position: sticky; top: 0; z-index: 4; flex-direction: row; overflow-x: auto; align-items: center; }
  .sidebar-footer { display: none; }
  .nav-list { display: flex; }
  .nav-link { white-space: nowrap; }
  .topbar { position: static; align-items: stretch; flex-direction: column; }
  .topbar-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .lookup-form { max-width: none; width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .kv { grid-template-columns: 1fr; }
  table { min-width: 760px; }
  .panel { overflow-x: auto; }
}
