:root {
    color-scheme: dark;
    font-family: "Geist", "Inter", "Segoe UI", sans-serif;
    color: #edf3f8;
    background: #0b111b;
    --sidebar: #0d1520;
    --panel: #111b29;
    --panel-alt: #0e1825;
    --line: #243346;
    --muted: #9bacc1;
    --accent: #67e9bd;
    --accent-text: #06271f;
    --focus: #77e8c3;
    --danger: #ff9b9e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; line-height: 1.5; }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: .55rem; }
button { min-height: 2.45rem; padding: .4rem .85rem; background: #172436; color: inherit; cursor: pointer; white-space: nowrap; }
button:hover { background: #203249; border-color: #3f5875; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 730; padding-inline: 1rem; }
button.primary:hover { background: #97f4d6; border-color: #97f4d6; }
button.primary span { font-size: 1.18rem; vertical-align: -.03rem; margin-right: .15rem; }
button.danger { background: #a93d4b; border-color: #d05e6c; font-weight: 700; }
button.danger:hover { background: #bd4a59; }
button.subtle-danger { color: var(--danger); }
button.small { min-height: 2.1rem; padding: .25rem .65rem; font-size: .875rem; }
button.icon-button { min-width: 2.2rem; min-height: 2.2rem; padding: 0 .45rem; font-size: 1.34rem; background: transparent; border-color: transparent; }
button.icon-button:hover { background: #203249; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

input, select, textarea {
    min-width: 0;
    color: #eff5fa;
    background: #0c1522;
    min-height: 2.55rem;
    padding: .48rem .65rem;
}
input::placeholder, textarea::placeholder { color: #8397af; opacity: 1; }
input[type="checkbox"] { min-height: 0; accent-color: var(--accent); width: 1.06rem; height: 1.06rem; }
input:disabled, select:disabled { opacity: .62; }
select { width: 100%; }
textarea { resize: vertical; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
label small, td small { display: block; color: var(--muted); font-weight: 400; font-size: .83rem; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 750; font-size: 1rem; white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .085em; font-weight: 600; line-height: 1.3; }
.mark { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: .72rem; background: var(--accent); color: var(--accent-text); font-size: 1.62rem; line-height: 1; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.4rem; background: radial-gradient(ellipse at 50% 10%, #163247, transparent 59%), #0b111b; }
.auth-card { width: min(100%, 28rem); background: #111b29; border: 1px solid #304158; padding: clamp(1.5rem, 5vw, 2.5rem); border-radius: 1.15rem; box-shadow: 0 18px 75px #0006; }
.auth-brand { margin-bottom: 2.15rem; }
.auth h1 { font-size: clamp(1.85rem, 5vw, 2.2rem); line-height: 1.12; letter-spacing: -.04em; margin-bottom: .65rem; }
.auth form { display: grid; gap: 1rem; margin-top: 1.45rem; }
.auth form button { margin-top: .2rem; }

.workspace { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 1.25rem .8rem .8rem; background: var(--sidebar); }
.sidebar .brand { padding-inline: .45rem; }
.sidebar nav { display: grid; gap: .35rem; margin-top: 2rem; }
.sidebar nav button { display: flex; align-items: center; gap: .72rem; padding: .57rem .68rem; color: #b4c4d6; text-align: left; font-size: .9rem; background: transparent; border-color: transparent; }
.sidebar nav button:hover { background: #162537; color: white; }
.sidebar nav button[aria-current] { color: var(--accent); background: #153328; border-color: #244e42; font-weight: 650; }
.nav-icon { font-size: 1.1rem; display: inline-grid; width: 1.1rem; place-items: center; line-height: 1; }
.sidebar-footer { display: flex; align-items: center; gap: .45rem; margin-top: auto; padding: .7rem .25rem .15rem; border-top: 1px solid var(--line); }
.avatar { flex: 0 0 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: #273a53; color: #d4e5f6; font-weight: 700; font-size: .9rem; }
.owner { font-size: .86rem; }
.sidebar-footer button { margin-left: auto; }
.main { min-width: 0; background: radial-gradient(ellipse 75% 23rem at 95% -2%, #142839, transparent), #0b111b; }
.top { min-height: 4.2rem; padding: .8rem clamp(1rem, 3vw, 2.5rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); color: #c2d0e0; font-size: .9rem; }
.environment { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); }
.environment i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); }
.content { max-width: 105rem; margin-inline: auto; padding: clamp(1.2rem, 3.2vw, 2.65rem); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.65rem; }
.page-heading h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 760; line-height: 1.1; letter-spacing: -.044em; }
.page-heading p { color: var(--muted); margin-top: .58rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.metric { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; min-height: 6rem; border: 1px solid var(--line); background: linear-gradient(135deg, #142235, var(--panel)); border-radius: .8rem; }
.metric-icon, .row-icon {
    flex: 0 0 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    color: #83e6c5;
    background: #1d3839;
    border: 1px solid #2d514e;
    border-radius: .52rem;
    font-size: .97rem;
}
.metric div span { color: var(--muted); font-size: .85rem; }
.metric strong { display: block; font-size: 1.72rem; line-height: 1.12; margin-top: .19rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; }
.panel-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.15rem 1.12rem; }
.panel-heading h2 { font-size: 1.19rem; line-height: 1.35; letter-spacing: -.018em; }
.panel-heading p { color: var(--muted); margin-top: .2rem; font-size: .91rem; }
.search { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: .55rem; padding: 0 .65rem; background: #0c1522; color: var(--muted); }
.search span { font-size: 1.15rem; line-height: 1; }
.search input { width: 100%; border: 0; padding-inline: 0; background: transparent; font-weight: 400; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.server-table { min-width: 43rem; }
.dns-table { min-width: 58rem; }
th { background: var(--panel-alt); color: #a7bbd0; font-size: .8rem; font-weight: 650; }
th, td { border-top: 1px solid var(--line); padding: .76rem .8rem; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.1rem; }
th:last-child, td:last-child { padding-right: 1.1rem; }
tbody tr:hover { background: #162232; }
td .server-name { display: flex; align-items: flex-start; gap: .65rem; min-width: 11rem; overflow-wrap: anywhere; }
.server-name strong { font-weight: 690; }
.server-name small { margin-top: .16rem; }
.row-icon { flex-basis: 1.85rem; height: 1.85rem; color: #9ac9f7; background: #20364e; border-color: #304e68; }
.address-list { display: flex; align-items: center; gap: .32rem; flex-wrap: wrap; min-width: 8rem; }
.address-list code, .type, .pill { background: #192b40; border: 1px solid #29435c; color: #c7ddf5; border-radius: .35rem; padding: .1rem .35rem; white-space: nowrap; }
code { font-family: "IBM Plex Mono", Consolas, monospace; font-size: .8rem; }
.type { font-weight: 675; font-size: .8rem; }
.pill { color: #ffc794; background: #402d23; border-color: #5b3c2b; font-size: .8rem; }
.actions { text-align: right; white-space: nowrap; }
.actions button + button { margin-left: .3rem; }
.empty { display: grid; justify-items: center; gap: .8rem; padding: 2.2rem 1rem; color: var(--muted); text-align: center; }
.dns-controls { justify-content: flex-start; align-items: end; flex-wrap: wrap; }
.dns-controls label { flex: 1 0 12rem; max-width: 22rem; }
.dns-controls .refresh { min-height: 2.55rem; }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; padding: .65rem 1.12rem .85rem; }
.filters .search { flex: 1 1 10rem; }
.filters select { width: auto; flex: 0 1 13rem; }
.record-value { max-width: 22rem; overflow-wrap: anywhere; }
.scan-errors { padding: .9rem 1.1rem; color: #ffc794; }
.scan-errors summary { cursor: pointer; }
.scan-errors ul { margin-bottom: 0; }

dialog { width: min(33rem, calc(100% - 1.8rem)); max-height: calc(100% - 2rem); background: #132033; color: #edf3f8; border: 1px solid #38536e; border-radius: .88rem; padding: 0; box-shadow: 0 16px 75px #0009; }
dialog::backdrop { background: #070b13c7; }
.dialog-header, .dialog-footer { display: flex; align-items: center; gap: .55rem; padding: .85rem 1rem; }
.dialog-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.28rem; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-body { display: grid; gap: .9rem; padding: 1rem; }
.dialog-body > button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.check { display: flex; align-items: center; gap: .55rem; }
.form-error { padding: .56rem .68rem; color: #ffd2d3; background: #48252f; border: 1px solid #713b48; border-radius: .45rem; font-size: .9rem; }
dialog .form-error { margin: 0 1rem .85rem; }
.toast { position: fixed; bottom: 1.15rem; right: 1.15rem; max-width: calc(100vw - 2.3rem); padding: .7rem 1rem; background: #15372f; border: 1px solid #3b7966; color: #c9f9e9; border-radius: .6rem; box-shadow: 0 10px 25px #0006; }

@media (max-width: 57rem) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .75rem .8rem .5rem; }
    .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; margin-top: .7rem; }
    .sidebar-footer { margin: 0; padding: 0; border: 0; }
    .sidebar-footer .owner { display: none; }
    .sidebar .brand { padding: 0; }
    .top { min-height: 3rem; }
}

@media (max-width: 37rem) {
    .page-heading { flex-direction: column; align-items: flex-start; }
    .metrics { gap: .4rem; }
    .metric { display: grid; padding: .55rem; gap: .33rem; }
    .metric .metric-icon { display: none; }
    .metric strong { font-size: 1.35rem; }
    .panel-heading { align-items: stretch; flex-direction: column; gap: .65rem; }
    .dns-controls label { flex-basis: auto; max-width: none; }
    .dns-controls .refresh { align-self: start; }
    .filters select { flex: 1 1 8rem; }
}
