:root {
  --bg: #f3f5f7; --surface: #fff; --text: #18212b; --muted: #697586;
  --line: #dfe4e8; --line-strong: #cbd2d9; --accent: #176b4d; --accent-hover: #12563e;
  --danger: #b42318; --danger-bg: #fff1f0; --warning: #9a6700; --warning-bg: #fff8e5;
  --success: #18794e; --success-bg: #eaf7f0; --focus: #2f80ed;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f3; }
.login-shell { width: min(380px, 100%); }
.login-brand { margin-bottom: 18px; display: flex; align-items: center; justify-content: center; gap: 11px; }
.login-brand div { display: flex; flex-direction: column; }
.login-brand strong { font-size: 16px; }
.login-brand span:last-child { color: var(--muted); font-size: 12px; }
.login-panel { padding: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.login-panel h1 { margin: 0; font-size: 20px; }
.login-panel > p { margin: 5px 0 22px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 16px; }
.login-form .field input { height: 42px; }
.login-form .primary-button { width: 100%; min-height: 42px; margin-top: 2px; }
.login-error { margin: 0 !important; padding: 9px 11px; border: 1px solid #f2b8b5; border-radius: 6px; color: var(--danger) !important; background: var(--danger-bg); }
.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: #173f35; color: #fff; font-weight: 750; font-size: 12px; }
.brand div { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 15px; }
.brand span:last-child { color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.logout-form { margin: 0; }
.health { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.health i { width: 8px; height: 8px; border-radius: 50%; background: #20a66a; box-shadow: 0 0 0 3px #dcf5e9; }
.health.error i { background: var(--danger); box-shadow: 0 0 0 3px #fde2df; }
.icon-button, .primary-button, .secondary-button, .text-button, .danger-button { min-height: 36px; border-radius: 6px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; }
.icon-button { width: 36px; padding: 0; color: #475467; background: var(--surface); border-color: var(--line-strong); font-size: 19px; }
.icon-button:hover, .secondary-button:hover { background: #f7f8f9; }
.primary-button { padding: 0 14px; color: #fff; background: var(--accent); border-color: var(--accent); }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled, button:disabled { cursor: wait; opacity: .6; }
.secondary-button { padding: 0 14px; background: #fff; border-color: var(--line-strong); color: #344054; }
.text-button, .danger-button { min-height: 30px; padding: 0 9px; background: transparent; color: #344054; font-size: 13px; }
.text-button:hover { background: #edf1f3; }
.danger-button { color: var(--danger); }
.danger-button:hover { background: var(--danger-bg); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.workspace { max-width: 1240px; margin: 0 auto; padding: 26px 28px 48px; }
.summary { min-height: 78px; display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(220px, 1.4fr); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.summary > div { padding: 15px 20px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); min-width: 0; }
.summary > div:last-child { border-right: 0; }
.summary span { color: var(--muted); font-size: 12px; }
.summary strong { margin-top: 3px; font-size: 23px; line-height: 1.2; }
.summary .domain-value { font-size: 15px; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 22px; margin-top: 24px; border-bottom: 1px solid var(--line-strong); }
.tab { height: 42px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; }
.tab span { margin-left: 5px; padding: 1px 6px; border-radius: 10px; background: #e7eaee; color: #5f6b7a; font-size: 11px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.active span { background: #dff1e9; color: var(--accent); }
.view { display: none; }
.view.active { display: block; }
.section-heading { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading h1 { margin: 0; font-size: 18px; line-height: 1.35; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.search { width: min(280px, 45%); height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.table-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { height: 42px; color: #596576; background: #f8f9fa; font-size: 12px; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfb; }
.primary-cell { min-width: 175px; }
.primary-cell strong, .primary-cell span { display: block; }
.primary-cell span, .muted { margin-top: 2px; color: var(--muted); font-size: 12px; }
.key-id { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.usage { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.usage-bar { width: 70px; height: 6px; overflow: hidden; border: 0; border-radius: 3px; background: #e8ecef; appearance: none; }
.usage-bar::-webkit-progress-bar { background: #e8ecef; }
.usage-bar::-webkit-progress-value { background: var(--accent); }
.usage-bar::-moz-progress-bar { background: var(--accent); }
.resources { white-space: nowrap; color: #344054; font-size: 13px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }
.badge.warning { color: var(--warning); background: var(--warning-bg); }
.badge.neutral { color: #596576; background: #edf0f2; }
.actions-column { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 1px; white-space: nowrap; }
.host-link { color: #1761a0; text-decoration: none; }
.host-link:hover { text-decoration: underline; }
.empty-state { min-height: 210px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong { color: #344054; }
.empty-state span { margin-top: 5px; font-size: 13px; }
dialog { width: min(580px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 8px; color: var(--text); box-shadow: 0 20px 60px rgba(16, 24, 40, .22); }
dialog::backdrop { background: rgba(15, 23, 32, .46); }
.dialog-header { padding: 20px 22px 16px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 18px; }
.dialog-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dialog-header .icon-button { border: 0; }
.form-grid { padding: 20px 22px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: #344054; }
.field.full, .toggle-field.full { grid-column: 1 / -1; }
.field input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.toggle-field { min-height: 58px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); border-radius: 6px; }
.toggle-field span { display: flex; flex-direction: column; }
.toggle-field small { margin-top: 2px; color: var(--muted); font-weight: 400; }
input[role="switch"] { appearance: none; width: 38px; height: 22px; margin: 0; padding: 2px; flex: 0 0 auto; border-radius: 11px; background: #b8c0c8; transition: background .15s; }
input[role="switch"]::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
input[role="switch"]:checked { background: var(--accent); }
input[role="switch"]:checked::after { transform: translateX(16px); }
.dialog-actions { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 10; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 11px 14px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,40,.14); }
.toast.error { border-left-color: var(--danger); }
.loading-row td { height: 140px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 64px; padding: 12px 16px; align-items: flex-start; }
  .health { display: none; }
  .primary-button { padding: 0 10px; }
  .logout-form .secondary-button { padding: 0 10px; }
  .workspace { padding: 18px 14px 36px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div { border-bottom: 1px solid var(--line); }
  .summary > div:nth-child(2) { border-right: 0; }
  .summary > div:nth-child(3), .summary > div:nth-child(4) { border-bottom: 0; }
  .summary strong { font-size: 20px; }
  .section-heading { align-items: flex-end; }
  .search { width: 50%; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .toggle-field.full { grid-column: auto; }
}
@media (max-width: 480px) {
  .brand div span { display: none; }
  .topbar-actions { gap: 6px; }
  #create-account-button { font-size: 0; width: 38px; padding: 0; }
  #create-account-button span { font-size: 20px; }
  .logout-form .secondary-button { font-size: 0; width: 38px; padding: 0; }
  .logout-form .secondary-button::before { content: "\21AA"; font-size: 18px; }
  .section-heading { display: block; padding: 16px 0 12px; }
  .search { width: 100%; margin-top: 10px; }
  .tabs { margin-top: 18px; }
  .summary > div { padding: 12px 14px; }
  .domain-value { font-size: 13px !important; }
  .dialog-actions button { flex: 1; }
}
