:root {
  color-scheme: light;
  --page: #fafafa;
  --surface: #ffffff;
  --text: #1b1d20;
  --muted: #656b73;
  --line: #dedfe2;
  --line-strong: #b9bdc4;
  --accent: #2459a9;
  --accent-hover: #194782;
  --danger: #a33030;
  --success: #246b48;
  --notice: #f1f3f5;
  --radius: 0px;
  --content-width: 1100px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background: var(--page);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.wordmark { color: var(--text); font-size: 14px; font-weight: 700; letter-spacing: 0; text-decoration: none; }
.wordmark span { color: var(--accent); margin-left: 3px; }
.topbar-user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.layout { min-height: calc(100vh - 104px); display: flex; }
.sidebar {
  width: 210px;
  flex: 0 0 210px;
  padding: 26px 14px;
  border-right: 1px solid var(--line);
  background: #f7f7f7;
}
.nav-label { margin: 0 10px 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-list { display: grid; gap: 3px; }
.nav-button {
  width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid transparent; border-radius: 0;
  background: transparent; color: #41464d; text-align: left;
}
.nav-button:hover { background: #eceef0; }
.nav-button[aria-current="page"] { color: var(--text); background: #e9ebee; border-color: #e0e2e5; font-weight: 600; }
.main { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 28px 32px 48px; min-width: 0; }
.auth-main { max-width: 440px; min-height: calc(100vh - 104px); padding-top: 52px; }
.page-heading { margin-bottom: 25px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
h1 { margin: 0 0 5px; font-size: 20px; font-weight: 600; letter-spacing: 0; line-height: 1.3; }
h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: 0; }
h3 { margin: 0 0 7px; font-size: 12px; font-weight: 600; }
p { margin: 0 0 12px; }
.lede, .muted { color: var(--muted); }
.lede { max-width: 560px; font-size: 13px; }
.small { font-size: 12px; color: var(--muted); }
.eyebrow { display: none; }

.auth-switch { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 25px 0 22px; }
.auth-tab { padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.auth-tab[aria-selected="true"] { border-color: var(--accent); color: var(--text); font-weight: 650; }
.form { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .label { color: #393e44; font-size: 13px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 37px; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--surface); color: var(--text);
}
.field textarea { min-height: 88px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8a9098; }
.field-hint { font-size: 12px; line-height: 1.45; color: var(--muted); }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none;
}
.button:hover { background: #f2f3f4; color: var(--text); }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #fff; }
.button-danger { border-color: #d5aaaa; color: var(--danger); }
.button-danger:hover { background: #fbf2f2; color: var(--danger); }
.button-quiet { min-height: 30px; padding: 4px 8px; border-color: transparent; background: transparent; color: var(--accent); }
.button-quiet:hover { border-color: var(--line); background: #f7f8f9; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.columns { display: grid; grid-template-columns: minmax(270px, .82fr) minmax(0, 1.18fr); gap: 32px; align-items: start; }
.section { min-width: 0; }
.section + .section { border-left: 1px solid var(--line); padding-left: 30px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 3px; }
.stats { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 25px; border-bottom: 1px solid var(--line); }
.stat { min-width: 140px; padding: 0 24px 16px 0; margin: 0 24px 0 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value { font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 4px; color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th:last-child, td:last-child { padding-right: 0; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.table-primary { display: block; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.table-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status { display: inline; padding: 0; border: 0; border-radius: 0; color: #555b63; background: transparent; font-size: 12px; font-weight: 500; white-space: nowrap; text-transform: capitalize; }
.status-approved, .status-applied { color: var(--success); background: transparent; }
.status-rejected, .status-revoked, .status-failed { color: var(--danger); background: transparent; }
.empty { padding: 19px 0; color: var(--muted); font-size: 13px; }
.rule { height: 1px; margin: 27px 0; border: 0; background: var(--line); }
.inline-note { padding: 10px 12px; border-left: 3px solid var(--line-strong); background: #f3f4f5; color: #4f555d; font-size: 12px; }
.notice {
  position: fixed; right: 20px; bottom: 18px; z-index: 5; max-width: min(430px, calc(100vw - 40px));
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: #fff; box-shadow: none;
}
.notice[data-type="error"] { border-left: 3px solid var(--danger); }
.notice[data-type="success"] { border-left: 3px solid var(--success); }
.loading-state { padding: 45px 0; color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 14px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.dns-test { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.dns-test-result { color: var(--muted); font-size: 12px; }
.code-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .topbar { padding: 0 18px; }
  .sidebar { width: 170px; flex-basis: 170px; }
  .main { padding: 28px 22px 44px; }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .section + .section { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 25px; }
}
@media (max-width: 620px) {
  .layout { display: block; }
  .sidebar { width: 100%; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-label { display: none; }
  .nav-list { display: flex; gap: 5px; }
  .nav-button { width: auto; padding: 7px 10px; }
  .main { padding: 24px 16px 38px; }
  .auth-main { min-height: calc(100vh - 100px); padding-top: 42px; }
  .topbar-user { gap: 8px; font-size: 12px; }
  .topbar-user .user-email { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .footer { padding: 12px 16px; flex-direction: column; gap: 4px; }
}
