:root {
    --bg: #070b11;
    --bg-soft: #0b111a;
    --sidebar: rgba(12, 24, 38, 0.94);
    --surface: #101821;
    --surface-2: #141f2b;
    --surface-3: #182535;
    --line: #2c3a4a;
    --line-strong: #40506a;
    --text: #f4f7fb;
    --muted: #9aa8b8;
    --muted-2: #748295;
    --primary: #2f7df6;
    --primary-soft: rgba(47, 125, 246, 0.16);
    --primary-border: #2f6ed8;
    --cloudflare: #f48120;
    --danger: #ff5c5c;
    --danger-soft: rgba(255, 92, 92, 0.12);
    --success: #49d17d;
    --success-soft: rgba(73, 209, 125, 0.14);
    --warning: #ffc533;
    --warning-soft: rgba(255, 197, 51, 0.14);
    --sidebar-width: 280px;
    --radius: 8px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% -10%, rgba(47, 125, 246, 0.14), transparent 34%),
        linear-gradient(145deg, #07101a 0%, var(--bg) 44%, #05080d 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 220ms ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(160deg, rgba(16, 30, 48, 0.98), rgba(7, 15, 25, 0.96)),
        var(--sidebar);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
    color: #dbe7f5;
    padding: 34px 16px 24px;
    transform: translateX(0);
    transition: transform 220ms ease, opacity 180ms ease, padding 220ms ease;
    white-space: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 46px;
    color: #f7fbff;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 42px;
    flex: 0 0 auto;
    color: var(--cloudflare);
    font-family: "Font Awesome 6 Brands";
    font-size: 42px;
    font-weight: 400;
    line-height: 1;
}

.brand-mark::before {
    content: "\e07d";
}

.sidebar nav {
    display: grid;
    gap: 12px;
}

.sidebar nav a,
.logout-form button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0 10px 0 44px;
    background: transparent;
    color: #b8c4d3;
    font: inherit;
    font-size: 16px;
    font-weight: 560;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.sidebar nav a::before,
.logout-form button::before {
    position: absolute;
    left: 10px;
    width: 24px;
    color: #d6deeb;
    font-family: "Font Awesome 6 Free";
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.nav-dashboard::before {
    content: "\f624";
}

.nav-domains::before {
    content: "\f0ac";
}

.nav-accounts::before {
    content: "\f0c2";
}

.nav-domains::before,
.nav-accounts::before {
    font-weight: 400;
}

.nav-users::before {
    content: "\f502";
}

.nav-signout::before {
    content: "\f2f5";
}

.sidebar nav a:hover,
.logout-form button:hover {
    border-color: rgba(82, 126, 180, 0.5);
    background: rgba(25, 48, 76, 0.72);
    color: #fff;
}

.sidebar nav a.is-active {
    border-color: rgba(47, 125, 246, 0.8);
    background: linear-gradient(90deg, rgba(47, 125, 246, 0.26), rgba(47, 125, 246, 0.08));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.14);
}

.sidebar-count {
    color: #c7d7ea;
    font-size: 12px;
    font-weight: 600;
}

.logout-form {
    margin-top: 42px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
}

.sidebar-peek {
    position: fixed;
    top: 50vh;
    left: calc(var(--sidebar-width) - 1px);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 100px;
    min-height: 60px;
    border: 1px solid var(--line-strong);
    border-left-color: var(--line);
    border-radius: 0 7px 7px 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(22, 34, 49, 0.98), rgba(12, 22, 34, 0.98));
    color: #d7e1ef;
    cursor: pointer;
    transform: translateY(-50%);
    transition: left 220ms ease, background 180ms ease, border-color 180ms ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.28);
}

.sidebar-peek:hover {
    border-color: rgba(47, 125, 246, 0.78);
    background: linear-gradient(180deg, rgba(30, 48, 70, 0.98), rgba(16, 30, 46, 0.98));
    transform: translateY(-50%);
}

.sidebar-peek-icon::before {
    content: "\f104";
    display: block;
    color: currentColor;
    font-family: "Font Awesome 6 Free";
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    transform: translateX(-100%);
}

.sidebar-is-collapsed .sidebar-peek {
    left: 0;
}

.sidebar-is-collapsed .sidebar-peek-icon::before {
    content: "\f105";
}

.sidebar-collapsed .main {
    padding-left: 40px;
}

.main {
    min-width: 0;
    padding: 50px 24px 24px 38px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px;
}

.page-head h1,
.login-panel h1,
.empty h1,
.empty h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(30px, 3.4vw, 32px);
    font-weight: 700;
    line-height: 1.08;
}

.panel h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 19px;
}

.heading-count {
    color: #e6edf7;
    font-size: 0.8em;
    font-weight: 400;
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-actions,
.inline-actions,
.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.page-actions form,
.inline-actions form,
.actions form {
    display: inline-flex;
    margin: 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 10px 14px;
    background: rgba(17, 27, 40, 0.9);
    color: #e8f0fa;
    font: inherit;
    font-size: 14px;
    font-weight: 740;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
    border-color: rgba(85, 138, 210, 0.85);
    background: rgba(25, 42, 61, 0.95);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(139, 165, 197, 0.18), 0 10px 20px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px) scale(1.025);
}

.primary {
    border-color: var(--primary-border);
    background: linear-gradient(180deg, rgba(47, 125, 246, 0.98), #215ac3);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(47, 125, 246, 0.16), 0 10px 24px rgba(47, 125, 246, 0.17);
}

.button,
button,
.button.primary,
button.primary,
.domain-tag,
.account-tag,
.account-name-chip,
.purge-cache-button,
.sync-action,
.danger,
.delete-confirm-button:not(:disabled) {
    will-change: transform;
}

.primary:hover,
.primary:focus-visible {
    border-color: #6fa9ff;
    background: linear-gradient(180deg, #408bff, #2567da);
    box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.28), 0 14px 30px rgba(47, 125, 246, 0.28);
    color: #fff;
    transform: translateY(-1px) scale(1.03);
}

.danger {
    border-color: rgba(255, 92, 92, 0.72);
    background: var(--danger-soft);
    color: #ffb3b3;
}

.danger:hover,
.danger:focus-visible {
    border-color: var(--danger);
    background: rgba(255, 92, 92, 0.2);
    color: #ffb3b3;
    box-shadow: 0 0 0 1px rgba(255, 135, 135, 0.24), 0 10px 22px rgba(255, 92, 92, 0.18);
    transform: translateY(-1px) scale(1.035);
}

.purge-cache-button {
    border-color: rgba(244, 129, 32, 0.72);
    background: rgba(244, 129, 32, 0.12);
    color: #ffb167;
}

.purge-cache-button:hover,
.purge-cache-button:focus-visible {
    border-color: var(--cloudflare);
    background: rgba(244, 129, 32, 0.2);
    color: #ffb167;
    box-shadow: 0 0 0 1px rgba(255, 177, 103, 0.24), 0 10px 22px rgba(244, 129, 32, 0.2);
    transform: translateY(-1px) scale(1.035);
}

.sync-action {
    border-color: rgba(73, 209, 125, 0.58);
    background: var(--success-soft);
    color: var(--success);
}

.sync-action:hover,
.sync-action:focus-visible {
    border-color: rgba(73, 209, 125, 0.82);
    background: rgba(73, 209, 125, 0.22);
    color: var(--success);
    box-shadow: 0 0 0 1px rgba(168, 247, 193, 0.2), 0 10px 22px rgba(73, 209, 125, 0.18);
    transform: translateY(-1px) scale(1.035);
}

.subtle {
    color: #c7d2df;
}

.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.table-actions .button,
.table-actions button,
.record-actions .button,
.record-actions button,
.account-row-actions .button,
.account-row-actions button,
td.actions .button,
td.actions button {
    height: 34px;
    min-height: 34px;
    border-width: 1px;
    border-style: solid;
    border-radius: 7px;
    background: rgba(13, 22, 34, 0.72);
    box-shadow: none;
}

.table-actions .button:hover,
.table-actions .button:focus-visible,
.table-actions button:hover,
.table-actions button:focus-visible,
.record-actions .button:hover,
.record-actions .button:focus-visible,
.record-actions button:hover,
.record-actions button:focus-visible,
.account-row-actions .button:hover,
.account-row-actions .button:focus-visible,
.account-row-actions button:hover,
.account-row-actions button:focus-visible,
td.actions .button:hover,
td.actions .button:focus-visible,
td.actions button:hover,
td.actions button:focus-visible {
    border-color: rgba(139, 165, 197, 0.72);
    background: rgba(25, 42, 61, 0.92);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(139, 165, 197, 0.16), 0 9px 18px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px) scale(1.035);
}

.table-actions .danger:hover,
.table-actions .danger:focus-visible,
.record-actions .danger:hover,
.record-actions .danger:focus-visible,
.account-row-actions .danger:hover,
.account-row-actions .danger:focus-visible,
td.actions .danger:hover,
td.actions .danger:focus-visible {
    border-color: var(--danger);
    background: rgba(255, 92, 92, 0.22);
    color: #ffb3b3;
    box-shadow: 0 0 0 1px rgba(255, 135, 135, 0.24), 0 10px 22px rgba(255, 92, 92, 0.18);
    transform: translateY(-1px) scale(1.035);
}

.table-actions .primary,
.record-actions .primary,
.account-row-actions .primary,
td.actions .primary {
    border-color: rgba(47, 125, 246, 0.78);
    background: rgba(47, 125, 246, 0.13);
    color: #9dc3ff;
}

.table-actions .primary:hover,
.table-actions .primary:focus-visible,
.record-actions .primary:hover,
.record-actions .primary:focus-visible,
.account-row-actions .primary:hover,
.account-row-actions .primary:focus-visible,
td.actions .primary:hover,
td.actions .primary:focus-visible {
    border-color: #6fa9ff;
    background: rgba(47, 125, 246, 0.26);
    color: #d9e9ff;
    box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.24), 0 10px 22px rgba(47, 125, 246, 0.24);
    transform: translateY(-1px) scale(1.035);
}

.table-actions .sync-action,
.account-row-actions .sync-action,
td.actions .sync-action {
    border-color: rgba(73, 209, 125, 0.58);
    background: var(--success-soft);
    color: var(--success);
}

.table-actions .sync-action:hover,
.table-actions .sync-action:focus-visible,
.account-row-actions .sync-action:hover,
.account-row-actions .sync-action:focus-visible,
td.actions .sync-action:hover,
td.actions .sync-action:focus-visible {
    border-color: rgba(73, 209, 125, 0.82);
    background: rgba(73, 209, 125, 0.22);
    color: #a8f7c1;
    box-shadow: 0 0 0 1px rgba(168, 247, 193, 0.2), 0 10px 22px rgba(73, 209, 125, 0.18);
    transform: translateY(-1px) scale(1.035);
}

.flash {
    margin-bottom: 18px;
    border: 1px solid rgba(47, 125, 246, 0.38);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: rgba(47, 125, 246, 0.12);
    color: #b8d5ff;
}

.flash.success {
    border-color: rgba(73, 209, 125, 0.45);
    background: var(--success-soft);
    color: #b5f6cc;
}

.flash.error {
    border-color: rgba(255, 92, 92, 0.45);
    background: var(--danger-soft);
    color: #ffb3b3;
}

.guest {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 12%, rgba(47, 125, 246, 0.18), transparent 30%),
        linear-gradient(145deg, #07101a 0%, #05080d 100%);
}

.login-wrap {
    width: min(620px, calc(100vw - 32px));
}

.login-panel,
.panel,
.empty,
.account-card,
.table-wrap,
.pagination-bar,
.metric-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(20, 31, 43, 0.96), rgba(13, 21, 32, 0.96));
    box-shadow: var(--shadow);
}

.login-panel {
    position: relative;
    padding: 44px 48px 42px;
}

.login-brand {
    margin-bottom: 18px;
}

.login-panel .brand-mark {
    display: block;
}

.login-panel .eyebrow {
    margin-bottom: 8px;
}

.login-panel h1 {
    max-width: 520px;
    font-size: clamp(34px, 4vw, 44px);
}

.login-panel .form-stack {
    margin-top: 28px;
}

.panel,
.empty {
    padding: 24px;
}

.dns-add-panel {
    margin-bottom: 30px;
}

.dns-add-panel h2 {
    font-size: 22px;
}

.empty p {
    color: var(--muted);
}

.form-stack,
.form-grid,
.dns-form {
    display: grid;
    gap: 16px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dns-form {
    grid-template-columns:
        minmax(110px, 140px)
        minmax(190px, 1fr)
        minmax(250px, 1.2fr)
        minmax(105px, 130px)
        minmax(105px, 130px)
        minmax(110px, 120px);
    align-items: start;
    column-gap: 14px;
    row-gap: 14px;
}

.dns-form .dns-comment {
    grid-column: 1 / -1;
}

.dns-form .dns-proxied {
    margin-top: 20px;
}

.dns-form .primary {
    justify-self: start;
    min-width: 140px;
}

.wide {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 7px;
    color: #d6e0eb;
    font-size: 14px;
    font-weight: 720;
}

input,
select,
textarea {
    width: 100%;
    height: 42px;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 8px 11px;
    background: rgba(6, 12, 20, 0.86);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    outline: none;
}

textarea {
    min-height: 112px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.16);
}

::placeholder {
    color: #6f7f91;
}

.hint {
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 520;
}

.account-name-field,
.account-id-field,
.password-field {
    align-self: start;
}

.password-control {
    position: relative;
    display: block;
}

.password-control input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 7px;
    padding: 0;
    background: transparent;
    color: #8fa0b4;
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(47, 125, 246, 0.14);
    color: #ADD8FF;
    box-shadow: none;
    transform: translateY(-50%) scale(1.04);
}

.password-toggle span::before {
    content: "\f06e";
    font-family: "Font Awesome 6 Free";
    font-size: 15px;
    font-weight: 900;
}

.password-toggle.is-visible span::before {
    content: "\f070";
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    cursor: pointer;
}

.checkbox input,
.centre input[type="checkbox"] {
    width: 38px;
    height: 22px;
    min-height: 22px;
    appearance: none;
    border-radius: 999px;
    border-color: var(--line-strong);
    background: #0a111a;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.checkbox input::before,
.centre input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #7d8998;
    transition: transform 150ms ease, background 150ms ease;
}

.checkbox input:checked,
.centre input[type="checkbox"]:checked {
    border-color: rgba(73, 209, 125, 0.58);
    background: rgba(73, 209, 125, 0.17);
}

.checkbox input:checked::before,
.centre input[type="checkbox"]:checked::before {
    transform: translateX(16px);
    background: var(--success);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    display: block;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.metric-link {
    cursor: pointer;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-link,
.metric-link:visited,
.metric-link:hover,
.metric-link:focus-visible,
.metric-link span,
.metric-link strong {
    text-decoration: none;
}

.metric-link-blue {
    border-color: rgba(47, 125, 246, 0.5);
    background: rgba(47, 125, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.08);
}

.metric-link-blue:hover,
.metric-link-blue:focus-visible {
    border-color: rgba(47, 125, 246, 0.78);
    background: linear-gradient(180deg, rgba(22, 38, 56, 0.98), rgba(13, 25, 39, 0.98));
    box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.18), 0 12px 28px rgba(47, 125, 246, 0.18);
    transform: translateY(-1px) scale(1.018);
}

.metric-link-orange {
    border-color: rgba(255, 197, 51, 0.5);
    background: rgba(255, 197, 51, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 197, 51, 0.08);
}

.metric-link-orange:hover,
.metric-link-orange:focus-visible {
    border-color: rgba(255, 197, 51, 0.78);
    background: rgba(255, 197, 51, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 216, 106, 0.18), 0 12px 28px rgba(255, 197, 51, 0.16);
    transform: translateY(-1px) scale(1.018);
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    color: #fff;
    font-size: 20px;
}

.metric-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
    text-transform: uppercase;
}

.account-grid {
    display: grid;
    gap: 12px;
}

.account-card {
    padding: 0;
}

.account-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 15px 15px;
    cursor: pointer;
}

.account-card summary::marker {
    color: transparent;
}

.account-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.account-card strong {
    font-size: 18px;
}

.count,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(47, 125, 246, 0.46);
    border-radius: 7px;
    padding: 5px 10px;
    background: rgba(47, 125, 246, 0.12);
    color: #9cc3ff;
    font-size: 13px;
    font-weight: 800;
}

.badge::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.badge.status-active,
.badge.status-active::before {
    color: var(--success);
}

.badge.status-active {
    border-color: rgba(73, 209, 125, 0.38);
    background: var(--success-soft);
}

.badge.status-pending,
.badge.status-pending::before,
.badge.status-moved,
.badge.status-moved::before {
    color: var(--warning);
}

.badge.status-pending,
.badge.status-moved {
    border-color: rgba(255, 197, 51, 0.45);
    background: var(--warning-soft);
}

.badge.status-initializing,
.badge.status-initializing::before {
    color: #9cc3ff;
}

.badge.status-initializing {
    border-color: rgba(47, 125, 246, 0.46);
    background: rgba(47, 125, 246, 0.12);
}

.badge.status-needs-review,
.badge.status-needs-review::before,
.badge.status-error,
.badge.status-error::before {
    color: var(--danger);
}

.badge.status-needs-review,
.badge.status-error {
    border-color: rgba(255, 92, 92, 0.44);
    background: var(--danger-soft);
}

.badge.soft {
    margin-left: 8px;
}

#users-table .badge {
    border-radius: 16px;
}

.badge.role-admin {
    border-color: rgba(73, 209, 125, 0.38);
    background: var(--success-soft);
    color: var(--success);
}

.badge.role-user {
    border-color: rgba(255, 197, 51, 0.45);
    background: var(--warning-soft);
    color: var(--warning);
}

.muted-note,
.user-role-note {
    color: var(--muted);
}

.account-actions {
    display: flex;
    gap: 8px;
    padding: 14px 22px 22px;
}

.domain-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
    padding: 10px 22px 4px;
}

.domain-tag,
.account-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    border-radius: 7px;
    padding: 5px 10px;
    font-weight: 760;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.domain-tag {
    border: 2px solid rgba(47, 125, 246, 0.36);
    background: rgba(47, 125, 246, 0.1);
    color: #9dc3ff;
}

.domain-tag:hover,
.domain-tag:focus-visible {
    border-color: #6fa9ff;
    background: rgba(47, 125, 246, 0.26);
    color: #d9e9ff;
    box-shadow: 0 0 0 1px rgba(111, 169, 255, 0.24), 0 10px 22px rgba(47, 125, 246, 0.24);
    transform: translateY(-1px) scale(1.035);
}

.account-tag {
    border: 1px solid rgba(255, 197, 51, 0.45);
    background: var(--warning-soft);
    color: var(--warning);
}

.account-tag:not(.account-tag-static):hover,
.account-tag:not(.account-tag-static):focus-visible {
    border-color: rgba(255, 197, 51, 0.78);
    background: rgba(255, 197, 51, 0.2);
    color: #ffd86a;
    box-shadow: 0 0 0 1px rgba(255, 216, 106, 0.18), 0 8px 18px rgba(255, 197, 51, 0.16);
    transform: translateY(-1px) scale(1.035);
}

.account-tag-static {
    cursor: default;
}

.account-card .account-tag-static {
    border-radius: 16px;
    font-weight: 600;
}

.account-name-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid rgba(255, 197, 51, 0.45);
    border-radius: 7px;
    padding: 6px 11px;
    background: var(--warning-soft);
    color: var(--warning);
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.account-name-chip:hover,
.account-name-chip:focus-visible {
    border-color: rgba(255, 197, 51, 0.78);
    background: rgba(255, 197, 51, 0.2);
    color: #ffd86a;
    box-shadow: 0 0 0 1px rgba(255, 216, 106, 0.18), 0 8px 18px rgba(255, 197, 51, 0.16);
    transform: translateY(-1px) scale(1.035);
}

.account-name-chip::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-failed-text {
    color: #ffb3b3;
}

.account-empty {
    margin: 0;
    padding: 12px 22px 6px;
    color: var(--muted);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.table-toolbar .search-field {
    width: min(420px, 100%);
}

.segmented-control {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(7, 13, 22, 0.74);
}

.segmented-control button {
    min-height: 40px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
}

.segmented-control button:last-child {
    border-right: 0;
}

.segmented-control button.is-active {
    background: rgba(47, 125, 246, 0.22);
    color: #fff;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.all-domains-table {
    min-width: 1040px;
}

.all-domains-table .badge {
    border-radius: 16px;
    font-weight: 600;
}

#account-domains-table .badge {
    border-radius: 16px;
    font-weight: 600;
}

.dns-records-table {
    table-layout: fixed;
    min-width: 1240px;
}

.dns-records-table .col-type { width: 12%; }
.dns-records-table .col-name { width: 16%; }
.dns-records-table .col-content { width: 21%; }
.dns-records-table .col-ttl { width: 10%; }
.dns-records-table .col-priority { width: 10%; }
.dns-records-table .col-proxy { width: 8%; }
.dns-records-table .col-actions { width: 17%; }

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: rgba(19, 30, 42, 0.92);
    color: #c3cedc;
    font-size: 12px;
    font-weight: 820;
}

tbody tr {
    transition: background 150ms ease;
}

tbody tr:hover {
    background: rgba(47, 125, 246, 0.055);
}

th.actions {
    display: table-cell;
    text-align: right;
}

td code {
    color: #d0d9e6;
}

tr:last-child td {
    border-bottom: 0;
}

.sort-button {
    position: relative;
    min-height: 0;
    border: 0;
    padding: 0 18px 0 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 820;
}

.sort-button:hover {
    border-color: transparent;
    background: transparent;
}

.sort-button::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 10px;
    height: 14px;
    transform: translateY(-50%);
    background:
        linear-gradient(135deg, transparent 50%, #7e8b9c 50%) top 1px left 1px / 6px 6px no-repeat,
        linear-gradient(315deg, transparent 50%, #7e8b9c 50%) bottom 1px left 1px / 6px 6px no-repeat;
}

.sort-button[data-sort-direction="asc"]::after {
    background: linear-gradient(135deg, transparent 50%, var(--primary) 50%) top 4px left 1px / 7px 7px no-repeat;
}

.sort-button[data-sort-direction="desc"]::after {
    background: linear-gradient(315deg, transparent 50%, var(--primary) 50%) bottom 4px left 1px / 7px 7px no-repeat;
}

.stacked-lines {
    display: grid;
    gap: 3px;
    line-height: 1.45;
}

.muted-inline {
    color: var(--muted);
}

td input,
td select {
    min-width: 110px;
    height: 38px;
    min-height: 38px;
}

.dns-records-table td input,
.dns-records-table td select {
    min-width: 0;
    width: 100%;
}

td.centre {
    text-align: center;
    vertical-align: middle;
}

td.actions {
    display: table-cell;
    min-width: 0;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

td.actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.table-actions,
.record-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.record-actions button {
    min-width: 72px;
}

.comment-toggle {
    border-color: rgba(139, 165, 197, 0.6);
    background: rgba(13, 22, 34, 0.72);
    color: #c9d4e3;
}

.comment-toggle:hover,
.comment-toggle:focus-visible {
    border-color: rgba(111, 169, 255, 0.72);
    background: rgba(47, 125, 246, 0.18);
    color: #ADD8FF;
}

.dns-comment-row[hidden] {
    display: none;
}

.dns-comment-row td {
    padding-top: 10px;
    padding-bottom: 10px;
    background: rgba(10, 18, 29, 0.58);
}

.dns-comment-row:hover {
    background: transparent;
}

.dns-comment-field {
    display: grid;
    grid-template-columns: 80px minmax(420px, 1fr);
    gap: 16px;
    align-items: center;
    max-width: 900px;
}

.dns-comment-field label {
    color: #d6e0eb;
    font-size: 13px;
    font-weight: 740;
    text-align: right;
}

.dns-comment-field input {
    width: 100%;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    padding: 12px 14px;
    color: var(--muted);
    font-size: 13px;
    box-shadow: none;
}

.pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pagination-controls button {
    min-height: 32px;
    padding: 6px 10px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 4px;
    color: var(--muted);
    font-weight: 800;
}

.pagination-controls .is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: #fff;
}

.zone-name-servers {
    display: block;
    margin-top: 34px;
    color: var(--muted);
}

.zone-name-servers-title {
    margin-bottom: 8px;
    color: #eaf1fb;
    font-weight: 760;
}

.zone-name-server {
    display: inline-flex;
    margin: 0 8px 8px 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 10px;
    background: rgba(17, 27, 40, 0.72);
    color: #dbe6f3;
}

.delete-modal[hidden] {
    display: none;
}

.delete-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
}

.delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, 0.72);
    backdrop-filter: blur(8px);
}

.delete-dialog {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100vw - 36px));
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(20, 31, 43, 0.98), rgba(10, 17, 27, 0.98));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.54);
}

.delete-dialog h2 {
    margin: 0 0 10px;
    color: #fff;
}

.delete-dialog p {
    margin: 0 0 16px;
    color: var(--muted);
}

.delete-dialog strong {
    color: #fff;
}

.delete-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.delete-confirm-button,
.delete-confirm-button:disabled {
    border-color: rgba(255, 92, 92, 0.72);
    background: var(--danger-soft);
    color: #ffb3b3;
}

.delete-confirm-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.delete-confirm-button:not(:disabled),
.delete-confirm-button:not(:disabled):hover,
.delete-confirm-button:not(:disabled):focus-visible {
    border-color: var(--danger);
    background: rgba(255, 92, 92, 0.22);
    color: #ffb3b3;
    box-shadow: 0 0 0 1px rgba(255, 135, 135, 0.24), 0 10px 22px rgba(255, 92, 92, 0.18);
    transform: translateY(-1px) scale(1.035);
}

.modal-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 286px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main {
        padding: 42px 28px;
    }
}

@media (max-width: 900px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 60;
        height: 80px;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line-strong);
        padding: 20px 20px 20px 30px;
        opacity: 1;
        transform: translateY(0);
        transition: height 220ms ease, opacity 180ms ease;
    }

    .mobile-menu-open .sidebar {
        height: 100vh;
    }

    .sidebar-collapsed .sidebar {
        padding-left: 30px;
        padding-right: 30px;
        opacity: 1;
        transform: translateY(0);
    }

    .brand {
        margin-bottom: 42px;
        padding-right: 60px;
    }

    .brand-mark {
        width: 50px;
        height: 38px;
        font-size: 42px;
    }

    .brand span:last-child {
        font-size: 20px;
    }

    .sidebar nav,
    .logout-form {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-14px);
        transition: opacity 160ms ease, transform 200ms ease;
    }

    .mobile-menu-open .sidebar nav,
    .mobile-menu-open .logout-form {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .sidebar nav {
        gap: 18px;
    }

    .sidebar nav a,
    .logout-form button {
        min-height: 58px;
        padding-left: 52px;
        font-size: 18px;
        justify-content: flex-start;
    }

    .sidebar nav a::before,
    .logout-form button::before {
        left: 14px;
        width: 26px;
        font-size: 24px;
    }

    .logout-form {
        margin-top: 38px;
        padding-top: 26px;
    }

    .sidebar-peek {
        top: 20px;
        right: 20px;
        left: auto;
        z-index: 80;
        width: 32px;
        height: 32px;
        min-height: 32px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #fff;
        transform: none;
        box-shadow: none;
        transition: none;
    }

    .sidebar-peek:hover,
    .sidebar-peek:focus,
    .sidebar-peek:focus-visible,
    .sidebar-peek:active,
    .mobile-menu-open .sidebar-peek,
    .mobile-menu-open .sidebar-peek:hover,
    .mobile-menu-open .sidebar-peek:focus,
    .mobile-menu-open .sidebar-peek:focus-visible,
    .mobile-menu-open .sidebar-peek:active {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
        outline: none;
        transform: none;
    }

    .sidebar-peek-icon {
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        overflow: hidden;
    }

    .sidebar-peek-icon::before {
        content: "\f0c9";
        display: block;
        font-size: 32px;
        line-height: 1;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
    }

    .sidebar-is-collapsed .sidebar-peek {
        left: auto;
    }

    .sidebar-is-collapsed .sidebar-peek-icon::before {
        content: "\f0c9";
    }

    .mobile-menu-open .sidebar-peek-icon::before {
        content: "\f00d";
    }

    .main,
    .sidebar-collapsed .main {
        padding: 128px 15px 28px;
    }

    .account-card strong {
        font-size: 17px;
        font-weight: 600;
    }

    .account-card .account-tag-static {
        border-radius: 16px;
        font-size: 15px;
        font-weight: 600;
    }

    .page-head,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-bar {
        align-items: stretch;
        flex-direction: column;
        overflow: hidden;
        padding: 10px 12px;
    }

    .pagination-controls {
        justify-content: flex-start;
        max-width: 100%;
    }

    .pagination-controls button {
        min-width: 34px;
        padding: 6px 9px;
    }

    .dns-form,
    .form-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
