:root {
    --bg: #050b14;
    --surface: #0a1626;
    --surface-raised: #0f1d30;
    --border: #17263c;
    --text: #e8edf4;
    --text-muted: #5b7089;
    --accent: #22d3ee;
    --accent-dim: #7dd3fc;
    --danger: #f87171;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--sans);
    background:
        radial-gradient(circle at 1px 1px, rgba(125, 211, 252, 0.06) 1px, transparent 0) 0 0 / 22px 22px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cg fill='none' stroke='%237dd3fc' stroke-width='0.75' opacity='0.22'%3E%3Crect x='20' y='30' width='60' height='40'/%3E%3Crect x='100' y='20' width='35' height='70' transform='rotate(8 117 55)'/%3E%3Crect x='180' y='60' width='80' height='50'/%3E%3Crect x='300' y='40' width='50' height='90' transform='rotate(-6 325 85)'/%3E%3Crect x='30' y='150' width='90' height='55'/%3E%3Crect x='150' y='170' width='60' height='40' transform='rotate(15 180 190)'/%3E%3Crect x='250' y='190' width='70' height='60'/%3E%3Crect x='340' y='170' width='40' height='80'/%3E%3Crect x='20' y='260' width='50' height='90'/%3E%3Crect x='110' y='280' width='100' height='45' transform='rotate(-4 160 302)'/%3E%3Crect x='240' y='270' width='55' height='70'/%3E%3Crect x='320' y='280' width='60' height='55'/%3E%3Cpath d='M0 120 L420 100'/%3E%3Cpath d='M0 240 L420 260'/%3E%3Cpath d='M90 0 L110 420'/%3E%3Cpath d='M280 0 L260 420'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 420px 420px,
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.7;
}
a { color: var(--accent-dim); }

header {
    position: sticky;
    top: 3px;
    z-index: 10;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
header .brand {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
}
header .brand .mat { color: var(--accent); }
header nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    font-size: 13px;
}
header nav a:hover { color: var(--text); }
.account-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}
.tier-badge {
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}
main.narrow { max-width: 420px; padding-top: 80px; }

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}
h1 {
    font-size: 22px;
    margin: 0;
    letter-spacing: -0.01em;
    font-weight: 600;
}
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.usage {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 36px;
}
.usage strong { color: var(--text); font-weight: 600; }

.zone {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--surface);
    padding: 16px 18px;
}
.zone-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}
.zone-head h2 {
    font-size: 14px;
    font-family: var(--mono);
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.zone-head .count {
    font-size: 12px;
    color: var(--text-muted);
}

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 14px 6px 0;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    word-break: break-word;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-raised); }
.rec-name { font-family: var(--mono); font-size: 13px; color: var(--text); text-decoration: none; }
.rec-value { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }

.type-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--type-color, var(--accent));
}
.type-tag::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--type-color, var(--accent));
    margin-right: 6px;
}
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-on { background: #34d399; }
.status-off { background: #3a3f4d; }
.status-text { font-size: 12px; color: var(--text-muted); }

.empty-note {
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.notice { color: #34d399; font-size: 13px; margin-bottom: 16px; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 16px; }

/* Forms */
form { margin: 0; }
label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-family: var(--sans);
}
.rec-name, .rec-value, input[name$="_value"], input[name="mx_target"],
input[name="ns_value"], input[name="ip_value"], input[name="ipv6_value"] {
    font-family: var(--mono);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
button, input[type="submit"] {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-family: var(--sans);
    cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
form[data-primary] button, .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #05202a;
    font-weight: 600;
}
form[data-primary] button:hover { color: #05202a; opacity: 0.9; }

.icon-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 5px;
    border-radius: 5px;
    line-height: 0;
}
.icon-btn:hover { background: var(--surface-raised); border-color: var(--border); color: var(--accent); }
.icon-btn-danger:hover { color: var(--danger); }
.row-actions { display: flex; gap: 4px; align-items: center; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px 28px;
}
.field-row { margin-bottom: 14px; }
.field-row label { display: flex; }
.field-row input, .field-row select { width: 100%; margin-top: 2px; }
