* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e6edf3;
    background:
        radial-gradient(circle at top left, rgba(90, 116, 255, 0.25), transparent 30%),
        radial-gradient(circle at top right, rgba(0, 184, 217, 0.18), transparent 24%),
        linear-gradient(180deg, #0b1020 0%, #0f172a 100%);
    min-height: 100vh;
}
a { color: #9dd6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}
.topbar-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #f2f6fc;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.header-logo {
    display: block;
    width: 128px;
    max-height: 46px;
    object-fit: contain;
    flex: 0 0 auto;
}
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em; }
.subtitle, .muted { color: #9aa7b8; font-size: 0.95rem; }
.shell { max-width: 1540px; margin: 0 auto; padding: 1.5rem; }
.panel {
    background: rgba(7, 12, 24, 0.78);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 22px 60px rgba(0,0,0,0.28);
}
.login-panel { max-width: 460px; margin: 6rem auto; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #66a6ff, #7f7cff);
    color: white;
    font: 600 1rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
}
.button[hidden] {
    display: none !important;
}
.button-ghost {
    background: rgba(255,255,255,0.08);
    color: #d7e3f4;
}
.inline-form { display: inline; }
.stack, .grid-form { display: grid; gap: 0.9rem; }
.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-form .wide { grid-column: 1 / -1; }
label { display: grid; gap: 0.35rem; color: #c8d5e3; }
input, select {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #eef4fb;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
}
textarea {
    width: 100%;
    min-height: 320px;
    resize: vertical;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #eef4fb;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font: 0.9rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
input::placeholder { color: #6f7f93; }
.actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.page-primary-actions .button {
    width: 150px;
    min-height: 43px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed;
}
.table th, .table td {
    padding: 0.8rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: top;
    text-align: left;
}
.table th:nth-child(1), .table td:nth-child(1) { width: 13%; }
.table th:nth-child(2), .table td:nth-child(2) { width: 7%; }
.table th:nth-child(4), .table td:nth-child(4) { width: 7%; }
.table th:nth-child(5), .table td:nth-child(5) { width: 7%; }
.table th:nth-child(6), .table td:nth-child(6) { width: 7%; }
.table th:nth-child(7), .table td:nth-child(7) { width: 7%; }
.table th:nth-child(8), .table td:nth-child(8) { width: 19%; }
.table td:nth-child(3) { overflow-wrap: anywhere; }
.records-table th:nth-child(1), .records-table td:nth-child(1) { width: 150px; }
.records-table th:nth-child(2), .records-table td:nth-child(2) { width: 90px; }
.records-table th:nth-child(3), .records-table td:nth-child(3) { width: auto; }
.records-table th:nth-child(4), .records-table td:nth-child(4) { width: 86px; }
.records-table th:nth-child(5), .records-table td:nth-child(5) { width: 86px; }
.records-table th:nth-child(6), .records-table td:nth-child(6) { width: 96px; }
.records-table th:nth-child(7), .records-table td:nth-child(7) { width: 106px; }
.records-table th:nth-child(8), .records-table td:nth-child(8) { width: 270px; }
.records-table th:nth-child(8) {
    padding-right: 1.7rem;
    text-align: right;
}
.records-table input,
.records-table select { min-width: 0; }
.domain-table th:first-child,
.domain-table td:first-child {
    width: 70%;
}
.domain-table .domain-actions-column {
    width: 30%;
    text-align: right !important;
    padding-right: 0;
}
.domain-table .domain-actions-buttons {
    display: flex;
    width: 100%;
    margin-left: auto;
    justify-content: flex-end !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.65rem;
}
.domain-table td:last-child .button {
    font: 600 1rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.domain-search-box {
    width: min(520px, 100%);
    margin: 1.15rem auto 0;
}
.domain-search-box label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}
.domain-search-box input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(157,214,255,0.22);
}
.domain-search-box input:focus {
    outline: none;
    border-color: #66a6ff;
    box-shadow: 0 0 0 3px rgba(102,166,255,0.14);
}
.domain-search-empty {
    padding: 1.4rem 0.7rem !important;
    color: #9aa7b8;
    text-align: center !important;
}
.domain-ns-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.12) inset;
}
.domain-ns-status.is-ok {
    background: #39d98a;
}
.domain-ns-status.is-bad {
    background: #ff5c70;
}
.domain-ns-status.is-unknown {
    background: #8b97a8;
}
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 13%; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 17%; }
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 10%; }
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 8%; }
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 18%; }
.users-table .users-actions-column {
    width: 34%;
    padding-right: 0;
    text-align: right !important;
}
.users-password-column input {
    width: 170px;
    max-width: 100%;
    min-width: 0;
}
.users-actions-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: 100%;
}
.users-actions-buttons .button {
    min-width: 96px;
}
.record-actions {
    white-space: nowrap;
    text-align: right;
}
.record-actions .record-form {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.record-actions .record-form .button {
    white-space: nowrap;
    min-width: 112px;
}
.record-delete-form {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}
.record-delete-form .button {
    white-space: nowrap;
    min-width: 112px;
}
.record-delete-disabled {
    opacity: 0.62;
}
.record-action-placeholder {
    visibility: hidden;
    pointer-events: none;
}
.row-between, .split {
    display: grid;
    gap: 1rem;
}
.row-between {
    grid-template-columns: 1fr auto;
    align-items: start;
}
.split {
    grid-template-columns: 1fr 1.3fr;
}
.grid-form-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kv { margin: 0; display: grid; gap: 0.7rem; }
.kv > div { display: grid; grid-template-columns: 180px 1fr; gap: 0.75rem; }
.kv dt { font-weight: 700; color: #dce6f2; }
.kv dd { margin: 0; color: #b6c2d3; }
.flash {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.flash-success { background: rgba(52, 211, 153, 0.16); border: 1px solid rgba(52, 211, 153, 0.25); }
.flash-error { background: rgba(248, 113, 113, 0.16); border: 1px solid rgba(248, 113, 113, 0.25); }
.dyn-list {
    display: grid;
    gap: 0.6rem;
}
.dyn-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    align-items: center;
}
.dyn-row select,
.dyn-row input {
    min-width: 0;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.section-head h2 {
    margin: 0;
    font-size: 1rem;
}
.advanced-box {
    margin-top: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}
.advanced-box > summary {
    cursor: pointer;
    color: #dce6f2;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.advanced-grid {
    margin-top: 0.6rem;
}
.panel-subtitle {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}
.ns-list {
    margin: 0.75rem 0 0;
    padding-left: 1.2rem;
    color: #c8d5e3;
}
.badge {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #dce6f2;
    font-size: 0.8rem;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(3, 8, 20, 0.72);
    backdrop-filter: blur(10px);
}
.modal-overlay[hidden] {
    display: none !important;
}
.modal-card {
    width: min(100%, 520px);
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(12, 18, 34, 0.98), rgba(7, 12, 24, 0.98));
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
    padding: 1.2rem;
}
.import-zone-card {
    width: min(100%, 900px);
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}
.modal-head h2 {
    margin: 0;
}
.modal-message {
    margin: 1rem 0 1.2rem;
    color: #d7e3f4;
    line-height: 1.5;
}
.modal-actions {
    justify-content: flex-end;
}
.modal-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}
.record-footer-row td {
    border-bottom: 0;
    padding-top: 1rem;
}
.record-cta-cell {
    text-align: right;
    white-space: nowrap;
}
.record-cta-cell .button {
    min-width: 112px;
}
.record-draft-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    white-space: nowrap;
}
.record-actions .record-draft-actions .button {
    min-width: 112px;
}
.bulk-import-table th:nth-child(1), .bulk-import-table td:nth-child(1) { width: 40%; }
.bulk-import-table th:nth-child(2), .bulk-import-table td:nth-child(2) { width: 15%; }
.bulk-import-table th:nth-child(3), .bulk-import-table td:nth-child(3) { width: 20%; }
.bulk-import-table th:nth-child(4), .bulk-import-table td:nth-child(4) { width: 25%; }
.bulk-overwrite {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 0.55rem;
}
.bulk-overwrite input { width: auto; }
.bulk-import-actions { justify-content: flex-end; margin-top: 1rem; }
.bulk-import-errors th:first-child, .bulk-import-errors td:first-child { width: 28%; }
.bulk-import-errors th:last-child, .bulk-import-errors td:last-child { width: 72%; }
.domain-picker-field {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #eef4fb;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.domain-picker-field:hover,
.domain-picker-field:focus-visible {
    border-color: rgba(102,166,255,0.72);
    background: rgba(102,166,255,0.08);
    outline: none;
}
.domain-picker-card {
    width: min(100%, 760px);
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.domain-picker-search { flex: 0 0 auto; }
.domain-picker-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}
.domain-picker-option {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    color: #dce6f2;
    padding: 0.7rem 0.8rem;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.domain-picker-option:hover,
.domain-picker-option:focus-visible,
.domain-picker-option.is-selected {
    border-color: rgba(102,166,255,0.72);
    background: rgba(102,166,255,0.14);
    outline: none;
}
.domain-picker-option:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}
.domain-picker-empty { margin: 0; text-align: center; }
@media (max-width: 860px) {
    .topbar {
        display: grid;
        grid-template-columns: 1fr auto;
    }
    .topbar-title {
        position: static;
        grid-column: 1 / -1;
        grid-row: 2;
        transform: none;
        justify-self: center;
    }
    .grid-form, .split, .row-between { grid-template-columns: 1fr; }
    .grid-form-2 { grid-template-columns: 1fr; }
    .kv > div { grid-template-columns: 1fr; }
    .dyn-row { grid-template-columns: 1fr; }
    .header-logo { width: 104px; max-height: 38px; }
}
