:root {
  color-scheme: light;
  --nav: #142031;
  --nav-light: #27374b;
  --canvas: #f3f6fa;
  --surface: #fff;
  --ink: #17243a;
  --muted: #64748b;
  --stroke: #e2e8f0;
  --accent: #066758;
  --accent-light: #dcf4ec;
  --danger: #ac3441;
  --danger-bg: #fbe9ec;
  --blue: #224e84;
  --radius: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #129781; outline-offset: 3px; }
button:disabled, option:disabled { cursor: default; opacity: .58; }
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #e9f2fe; padding: 27px 15px 20px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 24px; color: #fff; font-size: 20px; font-weight: 720; letter-spacing: -.5px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: 9px; letter-spacing: .18em; color: #a4b9d1; margin-top: 2px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; background: #89dec9; color: #11382f; font-size: 32px; line-height: 1; }
.sidebar nav, .sidebar-bottom { display: grid; gap: 4px; }
.sidebar-bottom { margin-top: auto; }
.sidebar nav a, .sidebar nav button, .sidebar-bottom a, .sidebar-bottom button { display: flex; gap: 11px; align-items: center; border: 0; min-height: 41px; padding: 9px 11px; border-radius: 8px; background: transparent; color: #c1cde0; text-align: left; width: 100%; }
.sidebar nav span, .sidebar-bottom span { width: 18px; text-align: center; font-size: 17px; color: #a5b7cd; }
.sidebar a.active, .sidebar nav button:hover, .sidebar-bottom button:hover, .sidebar nav a:hover, .sidebar-bottom a:hover { background: var(--nav-light); color: #fff; text-decoration: none; }
.content { min-width: 0; }
.topbar { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--stroke); background: var(--surface); color: var(--muted); }
.status-pill, .badge { display: inline-flex; gap: 7px; align-items: center; padding: 5px 9px; border-radius: 6px; background: #edf2f7; color: #425570; white-space: nowrap; font-size: 12px; font-weight: 650; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #0c8b73; }
.status-pill.alert i { background: var(--danger); }
.badge.good { background: var(--accent-light); color: var(--accent); }
.badge.warn { background: #fff1d6; color: #855612; }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.blue { background: #e8f0fc; color: var(--blue); }
main { padding: 28px 32px 38px; max-width: 1560px; margin: auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 3.2vw, 33px); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 18px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
.subtitle { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.right { margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 7px 12px; gap: 7px; white-space: nowrap; border: 1px solid var(--stroke); border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 620; }
.btn:hover { background: #f2f6fb; text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #045345; }
.btn.danger { color: var(--danger); }
.btn.compact { min-height: 29px; padding: 4px 8px; font-size: 12px; }
.btn.text { background: transparent; border-color: transparent; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.metric { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 15px 16px; }
.metric strong { display: block; font-size: 25px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.metric > span { color: var(--muted); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 15px 16px; }
.panel-body { padding: 15px 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 660px; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th { padding: 10px 12px; color: var(--muted); background: #f8fafc; font-weight: 640; font-size: 11px; letter-spacing: .025em; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid #eef2f6; vertical-align: middle; }
tr:hover > td { background: #fbfcfe; }
th:first-child, td:first-child { padding-left: 16px; }
.symbol { font-weight: 730; font-size: 15px; white-space: nowrap; }
.small, .muted { color: var(--muted); }
.small { display: block; font-size: 12px; margin-top: 3px; }
.empty { padding: 20px 16px; color: var(--muted); }
.tabbar { display: flex; gap: 5px; flex-wrap: wrap; }
.tabbar .btn { border-color: transparent; color: var(--muted); }
.tabbar .btn.active { background: var(--accent-light); color: var(--accent); }
.logs { overflow: auto; max-height: 264px; }
.log-line { display: grid; grid-template-columns: 82px 132px minmax(0, 1fr); gap: 10px; padding: 9px 16px; border-top: 1px solid #eef2f6; min-height: 37px; align-items: baseline; }
.log-line time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.log-line .event-kind { overflow: hidden; text-overflow: ellipsis; color: var(--blue); font-family: ui-monospace, monospace; font-size: 10px; }
.log-line.error { background: #fff6f6; }
.log-line.error .event-kind { color: var(--danger); }
.log-details summary { cursor: pointer; }
pre { padding: 12px; margin: 8px 0; background: #f4f7fb; border: 1px solid var(--stroke); border-radius: 7px; overflow: auto; max-height: 260px; font-size: 11px; }
.alert-box { border: 1px solid #e8bec3; background: var(--danger-bg); color: var(--danger); border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; }
.form-grid .full, .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 620; font-size: 12px; color: #41526b; }
label input:not([type=checkbox]), label select, label textarea, .filters input, .filters select { min-width: 0; width: 100%; border: 1px solid #ccd7e4; border-radius: 7px; color: var(--ink); background: #fff; padding: 8px 9px; min-height: 36px; }
label.checkbox { flex-direction: row; align-items: center; }
label input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 13px; }
.filters > * { flex: 1 1 125px; }
.form-error { color: var(--danger); font-size: 13px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--stroke); }
dialog { width: min(940px, calc(100vw - 28px)); max-height: min(90vh, 1050px); padding: 0; border: 1px solid var(--stroke); border-radius: 13px; color: var(--ink); box-shadow: 0 12px 58px #111f3d37; overflow: auto; }
dialog.narrow { width: min(570px, calc(100vw - 28px)); }
dialog::backdrop { background: #14203191; }
.modal-head { position: sticky; top: 0; z-index: 1; background: white; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--stroke); }
.modal-body { padding: 16px 18px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #e9f0f7; }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--stroke); padding: 27px; border-radius: 16px; }
.auth-card .brand-mark { margin-bottom: 16px; }
.auth-card form { display: grid; gap: 13px; margin-top: 17px; }
.auth-card .btn { width: 100%; }
.toasts { position: fixed; bottom: 14px; right: 14px; z-index: 3; display: grid; gap: 7px; max-width: min(480px, 90vw); }
.toast { padding: 11px 15px; color: #fff; border-radius: 7px; background: #173c34; box-shadow: 0 4px 16px #13213432; }
.toast.error { background: #8e3040; }
.mono { font-family: ui-monospace, monospace; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: 170px minmax(0, 1fr); }
  main { padding: 22px 20px; }
  .topbar { padding: 0 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .workspace { display: block; }
  .sidebar { height: auto; position: static; padding: 10px; gap: 9px; }
  .brand { padding: 5px; }
  .sidebar nav, .sidebar-bottom { display: flex; flex-wrap: wrap; gap: 2px; }
  .sidebar nav a, .sidebar nav button, .sidebar-bottom a, .sidebar-bottom button { width: auto; min-height: 31px; font-size: 12px; padding: 4px 6px; gap: 4px; }
  main, .topbar { padding-left: 13px; padding-right: 13px; }
  .log-line { grid-template-columns: 62px minmax(0,1fr); }
  .log-line .event-kind { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
