:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #10231e;
  --muted: #667a74;
  --line: #dfe8e5;
  --green: #087f68;
  --green-2: #00a884;
  --green-soft: #e9f8f3;
  --red: #bf3d3d;
  --shadow: 0 12px 35px rgba(22, 52, 44, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--green); text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 245px; background: #102b25; color: #fff; padding: 24px 16px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 25px; }
.brand-mark, .auth-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(135deg, var(--green-2), #64d5b6); color: white; font-size: 20px; box-shadow: 0 8px 22px rgba(0,168,132,.25); }
.brand strong, .brand small { display: block; }
.brand small { color: #9db9b1; margin-top: 2px; font-size: 11px; }
nav { display: grid; gap: 6px; }
nav a { padding: 12px 14px; color: #bdd0cb; border-radius: 10px; font-weight: 650; font-size: 14px; }
nav a:hover, nav a.active { background: rgba(255,255,255,.10); color: white; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 15px 8px 0; display: grid; gap: 8px; font-size: 12px; color: #9db9b1; }
.sidebar-footer a { color: #fff; }
.main { margin-left: 245px; padding: 34px; max-width: 1500px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.page-header h1 { margin: 4px 0 6px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.04em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .11em; }
.status-pill, .secure-badge { border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; }
.status-pill.online, .secure-badge { color: var(--green); background: var(--green-soft); }
.status-pill.offline { color: var(--red); background: #ffeded; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.metric { padding: 18px; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 8px 0 4px; font-size: 25px; letter-spacing: -.03em; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 22px; margin-bottom: 18px; }
.card.compact { padding: 17px 22px; }
.card h2 { margin: 0 0 15px; font-size: 17px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.card-head h2 { margin: 0; }
.details { margin: 0; }
.details div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.details div:first-child { border-top: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #1d5a4c; background: #edf6f3; border-radius: 7px; padding: 3px 6px; overflow-wrap: anywhere; }
.mode-row { margin: 14px 0; }
.mode-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; }
.bar { height: 8px; border-radius: 999px; background: #edf2f0; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--green-2)); }
.steps { color: var(--muted); padding-left: 20px; line-height: 1.8; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.settings-form { padding-bottom: 75px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
label { display: grid; gap: 7px; color: #29483f; font-size: 13px; font-weight: 720; }
label.wide { grid-column: 1 / -1; }
label small { color: var(--muted); font-weight: 450; line-height: 1.45; }
input, textarea, select { width: 100%; border: 1px solid #cddbd7; border-radius: 10px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(0,168,132,.12); }
label.check { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 44px; }
label.check input { width: 18px; height: 18px; accent-color: var(--green); }
button { border: 0; border-radius: 10px; padding: 11px 15px; cursor: pointer; font-weight: 780; }
button.primary { background: linear-gradient(135deg, var(--green), var(--green-2)); color: white; box-shadow: 0 7px 20px rgba(0,127,104,.20); }
button.secondary { background: var(--green-soft); color: var(--green); }
button.danger { background: #fff0f0; color: var(--red); border: 1px solid #ffd1d1; }
.sticky-actions { position: fixed; left: 245px; right: 0; bottom: 0; padding: 13px 34px; background: rgba(244,247,246,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 10; text-align: right; }
.inline-danger { margin-bottom: 18px; }
.stack { display: grid; gap: 15px; }
.test-grid { align-items: start; }
.result-card { position: sticky; top: 25px; }
.result-text { white-space: pre-wrap; padding: 18px; min-height: 150px; border-radius: 13px; background: #f0f8f5; line-height: 1.65; margin-bottom: 18px; }
.empty-state, .empty-cell { color: var(--muted); text-align: center; padding: 35px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); background: #f9fbfa; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.mode-tag { border-radius: 999px; background: var(--green-soft); color: var(--green); padding: 5px 8px; font-weight: 800; }
.ok { color: var(--green); font-weight: 800; }
.fail, .field-error { color: var(--red); }
.field-error { background: #fff0f0; border: 1px solid #ffd0d0; padding: 11px; border-radius: 10px; margin-bottom: 14px; }
.flash { margin-bottom: 18px; padding: 12px 14px; border-radius: 11px; }
.flash.success { background: var(--green-soft); color: var(--green); }
.flash.error { background: #fff0f0; color: var(--red); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #e5faf3, #f5f8f7 55%); padding: 20px; }
.auth-main { width: min(440px, 100%); }
.auth-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: 0 22px 65px rgba(21,61,49,.13); }
.auth-logo { margin-bottom: 18px; width: 48px; height: 48px; }
.auth-card h1 { margin: 0 0 7px; font-size: 25px; }
.auth-card > p { color: var(--muted); margin: 0 0 22px; }
@media (max-width: 950px) {
  .sidebar { position: static; width: 100%; min-height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  nav { display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; padding: 20px; }
  .sticky-actions { left: 0; padding: 12px 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .grid.two, .form-grid { grid-template-columns: 1fr; }
  label.wide { grid-column: auto; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { padding: 14px; }
  .metric strong { font-size: 20px; }
  .page-header { display: block; }
  .status-pill { display: inline-block; margin-top: 13px; }
  .copy-row { flex-direction: column; }
  .result-card { position: static; }
}
