:root {
    --brand-900: #1f347f;
    --brand-800: #273f91;
    --brand-700: #2256b9;
    --brand-600: #2382df;
    --brand-500: #12aadc;
    --brand-100: #e8f5ff;
    --brand-50: #f3f9ff;
    --ink: #102033;
    --muted: #66758a;
    --soft: #eef5fb;
    --line: #d9e4f0;
    --panel: rgba(255, 255, 255, .92);
    --danger: #c0362c;
    --success: #087f5b;
    --shadow: 0 22px 55px rgba(18, 43, 82, .12);
    --shadow-soft: 0 12px 30px rgba(18, 43, 82, .08);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(18, 170, 220, .14), transparent 32%),
        linear-gradient(180deg, #f7fbff 0%, #eef5fb 48%, #eaf1f8 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

button:hover {
    transform: translateY(-1px);
}

input,
select {
    min-width: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(31, 52, 127, .95), rgba(35, 130, 223, .9) 48%, rgba(18, 170, 220, .88)),
        linear-gradient(180deg, #ffffff, #e8f5ff);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 430px);
    gap: clamp(28px, 6vw, 76px);
    align-items: center;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.login-brand {
    color: #fff;
}

.login-logo {
    width: clamp(132px, 18vw, 188px);
    aspect-ratio: 1;
    height: auto;
    display: block;
    border-radius: 0;
    object-fit: contain;
    box-shadow: 0 22px 58px rgba(4, 20, 53, .22);
}

.login-brand .eyebrow {
    margin-top: 28px;
    color: rgba(255, 255, 255, .78);
}

.login-brand h1 {
    max-width: 660px;
    margin: 18px 0;
    font-size: clamp(42px, 7vw, 78px);
    line-height: .96;
    letter-spacing: 0;
}

.brand-copy {
    max-width: 590px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.65;
}

.signal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 34px;
}

.signal-row span {
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 9px 13px;
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
}

.client-portal-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.client-hero,
.client-card.full-span {
    grid-column: 1 / -1;
}

.client-hero {
    background:
        linear-gradient(135deg, rgba(35, 130, 223, .12), rgba(18, 170, 220, .08)),
        var(--panel);
}

.client-data-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.client-data-list div {
    display: grid;
    gap: 5px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
}

.client-data-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.client-data-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.client-notes-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.55;
}

.login-card {
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: var(--radius);
    padding: clamp(24px, 4vw, 36px);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 90px rgba(3, 21, 56, .32);
}

.card-heading h2,
.topbar h1,
.section-heading h2 {
    margin: 0;
}

.card-heading h2 {
    font-size: clamp(25px, 4vw, 31px);
}

.login-form,
.admin-form,
.user-row,
.security-form {
    display: grid;
    gap: 14px;
}

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

.login-form label,
.admin-form label,
.user-row label,
.security-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.login-form input,
.admin-form input,
.admin-form select,
.user-row input,
.user-row select,
.security-form input,
.security-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.login-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.user-row input:focus,
.user-row select:focus,
.security-form input:focus,
.security-form select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px rgba(35, 130, 223, .14);
}

.login-form button,
.logout-form button,
.admin-form button,
.row-actions button,
.security-form button {
    min-height: 40px;
    border: 0;
    border-radius: var(--radius);
    padding: 0 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(35, 130, 223, .18);
    font-size: 14px;
}

.login-form button:hover,
.admin-form button:hover,
.row-actions button:hover,
.security-form button:hover {
    background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
}

.admin-form button,
.row-actions button,
.security-form button {
    width: auto;
    justify-self: start;
}

.alert,
.flash {
    border-radius: var(--radius);
    padding: 13px 15px;
    font-weight: 800;
}

.alert {
    margin-top: 22px;
    border: 1px solid rgba(192, 54, 44, .22);
    color: var(--danger);
    background: #fff3f1;
}

.flash {
    margin-bottom: 18px;
}

.flash.success {
    border: 1px solid rgba(8, 127, 91, .24);
    color: var(--success);
    background: #ecfdf6;
}

.flash.error {
    border: 1px solid rgba(192, 54, 44, .22);
    color: var(--danger);
    background: #fff3f1;
}

.panel-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    padding: 24px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(31, 52, 127, .98), rgba(16, 32, 74, .98)),
        var(--brand-900);
    box-shadow: 16px 0 45px rgba(15, 36, 74, .12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 64px;
}

.brand img {
    width: 58px;
    height: 58px;
    display: block;
    border-radius: 8px;
    object-fit: contain;
    padding: 5px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .66);
}

.nav-list {
    display: grid;
    gap: 7px;
}

.nav-list a {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px 14px;
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nav-list a:hover,
.nav-list a.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .14);
    transform: translateX(2px);
}

.logout-form {
    margin-top: auto;
}

.logout-form button {
    width: 100%;
    background: rgba(255, 255, 255, .12);
    box-shadow: none;
}

.logout-form button:hover {
    background: rgba(255, 255, 255, .18);
}

.content {
    width: min(1480px, 100%);
    padding: clamp(20px, 3.2vw, 42px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 26px;
}

.topbar h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
}

.user-pill {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 12px;
    align-items: center;
    justify-content: flex-end;
    border: 1px solid rgba(217, 228, 240, .9);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-soft);
}

.user-pill strong {
    border-radius: 999px;
    padding: 4px 9px;
    color: #fff;
    background: var(--brand-800);
    font-size: 12px;
    text-transform: uppercase;
}

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

.metric-card,
.panel-section {
    border: 1px solid rgba(217, 228, 240, .82);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.metric-card {
    position: relative;
    display: grid;
    gap: 8px;
    min-height: 128px;
    padding: 21px;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -26px;
    bottom: -34px;
    width: 96px;
    height: 96px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(18, 170, 220, .16), rgba(35, 130, 223, .06));
    transform: rotate(18deg);
}

.metric-card span,
.metric-card small {
    position: relative;
    z-index: 1;
    color: var(--muted);
}

.metric-card strong {
    position: relative;
    z-index: 1;
    font-size: clamp(22px, 2.6vw, 28px);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.metric-card--dense {
    min-height: 118px;
    padding: 18px;
    gap: 6px;
}

.metric-primary {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 850;
}

.metric-primary--path {
    font-size: 15px;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    gap: 16px;
    margin-top: 16px;
}

.panel-section {
    padding: clamp(18px, 2.2vw, 24px);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.text-action {
    border-radius: 999px;
    padding: 8px 11px;
    color: var(--brand-800);
    background: var(--brand-100);
    font-size: 13px;
    font-weight: 850;
}

.domain-list,
.action-grid {
    display: grid;
    gap: 10px;
}

.domain-list a,
.action-tile {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
    background: #fbfdff;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.domain-list a {
    overflow-wrap: anywhere;
    font-weight: 800;
}

.domain-list-card {
    display: grid;
    gap: 6px;
}

.domain-list-card strong {
    color: var(--brand-800);
}

.ssl-inline {
    font-size: 12px;
    font-weight: 700;
}

.domain-list a:hover,
.action-tile:hover {
    border-color: rgba(35, 130, 223, .42);
    box-shadow: 0 10px 24px rgba(35, 130, 223, .1);
    transform: translateY(-1px);
}

.action-tile {
    display: grid;
    gap: 5px;
}

.action-tile strong {
    color: var(--brand-800);
}

.action-tile span {
    color: var(--muted);
}

.action-tile.admin-action {
    border-color: rgba(18, 170, 220, .42);
    background: linear-gradient(135deg, #f4fbff, #ffffff);
}

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

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.domain-provision-panel {
    grid-column: 2;
}

.users-panel {
    min-width: 0;
}

.users-list {
    display: grid;
    gap: 12px;
}

.users-list--table {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fbfdff;
}

.domain-records {
    display: grid;
    gap: 12px;
}

.domain-record {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdff;
}

.domain-record__identity {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
}

.domain-record__identity strong,
.domain-record__meta span {
    overflow-wrap: anywhere;
}

.domain-record__identity strong {
    color: var(--brand-800);
    font-size: 15px;
    line-height: 1.35;
}

.domain-record__identity small,
.domain-record__meta span {
    color: var(--muted);
}

.domain-record__meta {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) 88px 110px minmax(190px, 1fr) minmax(240px, 1.15fr);
    gap: 8px 12px;
    font-size: 13px;
    align-items: start;
}

.domain-record__meta span {
    min-width: 0;
    line-height: 1.4;
}

.domain-record__meta span:nth-child(2),
.domain-record__meta span:nth-child(3) {
    white-space: nowrap;
}

.ssl-meta.ssl-valid {
    color: #1d6f42;
}

.ssl-meta.ssl-expiring {
    color: #9a5b00;
}

.ssl-meta.ssl-expired,
.ssl-meta.ssl-missing,
.ssl-meta.ssl-error {
    color: #b42318;
}

.domain-inline-form {
    display: flex;
    justify-content: flex-start;
}

.domain-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.domain-edit-panel {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
}

.domain-edit-panel summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--brand-800);
}

.domain-label-form {
    margin-top: 12px;
}

.section-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.domain-inline-form button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    color: var(--brand-800);
    background: #fff;
    font-weight: 800;
    font-size: 13px;
    box-shadow: none;
    cursor: pointer;
}

.domain-inline-form button:hover {
    border-color: var(--brand-600);
    background: var(--brand-50);
}

.live-log-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 14px;
}

.live-log-toolbar label {
    display: grid;
    gap: 8px;
    max-width: 320px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.live-log-toolbar select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    background: #fff;
}

.dns-probe-form {
    grid-template-columns: minmax(240px, 420px) minmax(220px, 360px) auto;
    align-items: end;
}

.dns-toolbar {
    margin-top: 16px;
}

.dns-table td,
.dns-table th {
    font-size: 13px;
}

.status-dns-match {
    color: #1d6f42;
    background: #ecfdf6;
}

.status-dns-mismatch,
.status-dns-error {
    color: #b42318;
    background: #fff3f1;
}

.status-dns-unresolved {
    color: #9a5b00;
    background: #fff3d6;
}

.status-dns-ok {
    color: var(--brand-800);
    background: #eef4fb;
}

.live-log-meta {
    display: grid;
    gap: 4px;
    justify-items: end;
    color: var(--muted);
    font-size: 13px;
}

.live-log-meta strong {
    color: var(--ink);
}

.live-log-meta--inline {
    justify-items: start;
}

.live-log-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: auto;
    background: #fbfdff;
    max-height: 620px;
}

.live-log-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-size: 13px;
}

.live-log-table th,
.live-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.live-log-table th {
    position: sticky;
    top: 0;
    background: #f5f9fe;
    z-index: 1;
}

.live-log-url {
    min-width: 260px;
    max-width: 420px;
    overflow-wrap: anywhere;
}

.logs-shell {
    display: grid;
    gap: 16px;
}

.docs-shell {
    display: grid;
    gap: 16px;
}

.docs-hero {
    display: grid;
    gap: 16px;
}

.docs-intro {
    max-width: 980px;
}

.docs-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.doc-card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.doc-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.doc-card h3 {
    font-size: 21px;
    line-height: 1.2;
}

.doc-meta {
    display: grid;
    gap: 10px;
    margin: 0;
}

.doc-meta div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdff;
}

.doc-meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.doc-meta dd {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.doc-preview {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7fbff;
}

.doc-preview p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.log-filter-form {
    display: grid;
    grid-template-columns: minmax(320px, 460px) auto;
    gap: 12px;
    align-items: end;
}

.log-filter-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.log-filter-form select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    background: #fff;
}

.log-mode-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.log-mode-tabs {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.log-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    background: #fff;
    color: var(--brand-800);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.log-mode-tab.is-active {
    border-color: var(--brand-600);
    background: var(--brand-50);
}

.log-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.log-action-row .domain-inline-form {
    margin: 0;
}

.log-action-row .domain-inline-form button {
    min-width: 138px;
}

.log-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.fail2ban-jail-grid,
.security-lists-grid {
    display: grid;
    gap: 12px;
}

.fail2ban-jail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.fail2ban-jail-card {
    gap: 5px;
}

.fail2ban-jail-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.mono-cell {
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 800;
}

.table-action-form {
    margin: 0;
}

.table-action-form button,
.security-list-row button {
    min-height: 32px;
    border-radius: 999px;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 850;
}

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

.security-list-card {
    border: 1px solid rgba(217, 228, 240, .86);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 251, 255, .92)),
        #fff;
    overflow: hidden;
}

.security-list-card__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(217, 228, 240, .82);
    background: rgba(243, 249, 255, .74);
}

.security-list-card__head div {
    display: grid;
    gap: 5px;
}

.security-list-card__head strong {
    color: var(--brand-800);
    font-size: 16px;
}

.security-list-card__head span:not(.count-pill) {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.security-list-form {
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto;
    align-items: end;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(217, 228, 240, .72);
}

.security-list-form button {
    min-width: 112px;
}

.security-list-table {
    display: grid;
    gap: 8px;
    padding: 14px 18px 18px;
}

.security-list-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(217, 228, 240, .72);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .72);
}

.security-list-row div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.security-list-row strong {
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.security-list-row span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.http-method,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 800;
    background: var(--brand-50);
    color: var(--brand-800);
}

.status-badge.status-200,
.status-badge.status-204 {
    background: #ecfdf6;
    color: var(--success);
}

.status-badge.status-301,
.status-badge.status-302 {
    background: #eef4ff;
    color: var(--brand-800);
}

.status-badge.status-403,
.status-badge.status-404,
.status-badge.status-500 {
    background: #fff3f1;
    color: var(--danger);
}

.note-text {
    margin: 14px 0 0;
}

.user-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(130px, .7fr) minmax(150px, .9fr) auto;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdff;
}

.user-identity {
    display: grid;
    gap: 5px;
    align-self: center;
}

.user-identity strong {
    overflow-wrap: anywhere;
}

.user-identity small,
.count-pill {
    color: var(--muted);
}

.count-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.count-pill--warning {
    color: #9a5b00;
    background: #fff3d6;
    border-color: #f0d28c;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.row-actions .danger-button,
.security-form .danger-button,
.danger-button {
    background: linear-gradient(135deg, #d2453c, var(--danger));
    box-shadow: 0 12px 24px rgba(192, 54, 44, .18);
}

.row-actions .danger-button:hover,
.security-form .danger-button:hover,
.danger-button:hover {
    background: linear-gradient(135deg, #b52e25, #93221b);
}

.manager-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-areas:
        "header header"
        "nav main"
        "editor editor";
    gap: 16px;
    align-items: start;
}

.manager-layout .full-span,
.admin-grid .full-span {
    grid-column: 1 / -1;
}

.security-form--inline {
    grid-template-columns: minmax(220px, 320px) minmax(220px, 320px) auto;
    align-items: end;
}

.manager-header-panel,
.manager-nav-panel,
.manager-actions-panel,
.manager-table-panel,
.manager-editor-panel,
.users-create-panel,
.users-directory-panel {
    border-radius: 6px;
    backdrop-filter: none;
    box-shadow: none;
}

.manager-header-panel {
    grid-area: header;
    padding: 16px 18px;
}

.manager-titlebar,
.manager-toolbar,
.manager-table-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.manager-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 8px 10px;
    background: #f5f7fa;
}

.manager-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.manager-path {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    max-width: 100%;
}

.manager-path strong {
    overflow-wrap: anywhere;
}

.manager-main {
    grid-area: main;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.manager-nav-panel {
    grid-area: nav;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
}

.manager-editor-panel {
    grid-area: editor;
}

.manager-nav-top,
.manager-actions-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.manager-nav-top h2,
.manager-table-heading h2 {
    font-size: 15px;
}

.folder-tree-shell {
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    padding: 8px 0;
    max-height: 680px;
    overflow: auto;
}

.folder-tree-root,
.folder-tree__link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 12px;
    color: #22364d;
    font-size: 13px;
    line-height: 1.4;
}

.folder-tree-root::before,
.folder-tree__link::before {
    content: "";
    width: 14px;
    height: 11px;
    flex: 0 0 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f4be58, #eeaa32);
    box-shadow: inset 0 0 0 1px rgba(168, 104, 7, .18);
}

.folder-tree-root {
    margin-bottom: 4px;
    font-weight: 850;
}

.folder-tree-root:hover,
.folder-tree__link:hover {
    background: #f5f9ff;
}

.folder-tree-root.is-current,
.folder-tree__item.is-current > .folder-tree__link {
    color: var(--brand-800);
    font-weight: 850;
    background: #edf5ff;
}

.folder-tree {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.folder-tree__item > .folder-tree {
    margin-left: 14px;
    padding-left: 10px;
    border-left: 1px solid #e6edf6;
}

.folder-tree__name {
    overflow-wrap: anywhere;
}

.folder-empty {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--muted);
}

.compact-form {
    display: grid;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
}

.compact-form--toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.compact-form--toolbar label {
    min-width: 0;
}

.compact-form--toolbar button {
    min-width: 104px;
    justify-self: start;
}

.compact-form--user-create {
    grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) 140px 180px auto;
    align-items: end;
}

.compact-form label,
.field-compact {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.compact-form input,
.compact-form select,
.field-compact input,
.field-compact select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 10px;
    background: #fff;
}

.compact-form button,
.editor-actions button {
    min-height: 34px;
    border-radius: 4px;
    box-shadow: none;
    align-self: end;
    padding: 0 12px;
    font-size: 13px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumbs a {
    color: var(--brand-800);
    font-weight: 800;
}

.path-summary {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    background: #fbfdff;
}

.path-summary--compact strong {
    font-size: 14px;
}

.path-summary strong,
.file-name {
    overflow-wrap: anywhere;
}

.path-summary small {
    color: var(--muted);
}

.manager-actions-panel {
    padding: 10px 14px;
}

.manager-actions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.manager-actions-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.toolbar-popover {
    position: relative;
}

.toolbar-popover summary,
.toolbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 10px;
    color: #22364d;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.toolbar-popover summary::-webkit-details-marker {
    display: none;
}

.toolbar-popover[open] summary,
.toolbar-popover summary:hover,
.toolbar-link:hover {
    border-color: rgba(35, 130, 223, .34);
    color: var(--brand-800);
    background: #f5f9ff;
}

.toolbar-form {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    width: min(320px, 72vw);
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(16, 32, 51, .14);
}

.toolbar-form input[type="text"],
.toolbar-form input[type="file"] {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 10px;
    background: #fff;
}

.toolbar-form button {
    min-height: 34px;
    border: 0;
    border-radius: 4px;
    padding: 0 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
    font-size: 13px;
    font-weight: 800;
    box-shadow: none;
}

.manager-layout .text-action {
    border-radius: 4px;
    padding: 0;
    color: var(--brand-700);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.manager-layout .text-action:hover,
.file-actions .link-button:hover {
    color: var(--brand-900);
}

.manager-table-panel {
    padding: 0;
    overflow: hidden;
}

.manager-table-heading {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfdff;
}

.manager-current-label {
    max-width: min(48vw, 420px);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    overflow-wrap: anywhere;
}

.files-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
}

.manager-grid-wrap {
    border: 0;
    border-radius: 0;
    background: #fff;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
    font-size: 13px;
}

.files-table th,
.files-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.files-table th {
    color: var(--brand-700);
    font-size: 12px;
    text-transform: uppercase;
    background: #f7f9fc;
    position: sticky;
    top: 0;
}

.files-table tbody tr:hover {
    background: #f8fbff;
}

.entry-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
}

.entry-icon {
    position: relative;
    width: 16px;
    height: 14px;
    flex: 0 0 16px;
}

.entry-icon.is-folder {
    border-radius: 2px;
    background: linear-gradient(180deg, #f4be58, #eeaa32);
    box-shadow: inset 0 0 0 1px rgba(168, 104, 7, .18);
}

.entry-icon.is-folder::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 2px;
    width: 8px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: #f2c56f;
}

.entry-icon.is-file {
    border: 1px solid #c7d4e3;
    border-radius: 2px;
    background: linear-gradient(180deg, #ffffff, #f4f7fb);
}

.entry-icon.is-file::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #dfe8f3 50%, transparent 50%);
}

.files-table td:nth-child(2),
.files-table td:nth-child(4),
.files-table td:nth-child(5),
.files-table td:nth-child(6) {
    font-size: 12px;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inline-form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    min-height: auto;
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover {
    transform: none;
    color: var(--brand-900);
    background: transparent;
}

.danger-text {
    color: var(--danger);
}

.editor-form {
    display: grid;
    gap: 14px;
}

.code-editor {
    width: 100%;
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px;
    color: var(--ink);
    background: #fbfdff;
    font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical;
    outline: none;
}

.code-editor:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px rgba(35, 130, 223, .14);
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.users-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.user-grid-head {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(180px, .9fr) 140px minmax(180px, .9fr) 170px;
    gap: 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: #f6f9fc;
}

.user-grid-head span {
    padding: 11px 0 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.user-row--dense {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(180px, .9fr) 140px minmax(180px, .9fr) 170px;
    gap: 0 12px;
    align-items: center;
    margin: 0;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.user-row--dense:last-child {
    border-bottom: 0;
}

.user-row--dense:hover {
    background: #f8fbff;
}

.user-identity--dense {
    gap: 3px;
}

.user-identity--dense strong {
    font-size: 14px;
}

.field-compact span {
    display: none;
}

.field-compact input,
.field-compact select {
    min-height: 36px;
}

.users-create-panel .compact-form--user-create,
.users-directory-panel .user-row--dense {
    gap: 12px;
}

.users-create-panel .compact-form--user-create button,
.user-row--dense .row-actions button {
    min-height: 36px;
    border-radius: 4px;
    padding: 0 12px;
    box-shadow: none;
    font-size: 13px;
}

.row-actions--dense {
    justify-content: flex-end;
}

.row-actions--dense button {
    min-height: 36px;
    border-radius: 4px;
    box-shadow: none;
}

.report-shell {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdff;
    overflow: hidden;
}

.report-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--brand-50);
}

.report-head strong {
    color: var(--brand-800);
}

.report-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.report-output {
    margin: 0;
    padding: 14px;
    min-height: 220px;
    max-height: 560px;
    overflow: auto;
    color: var(--ink);
    background: #fbfdff;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.info-tile {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdff;
    min-width: 0;
}

.info-tile b {
    color: var(--ink);
}

.info-tile strong {
    color: var(--brand-800);
}

.info-tile span {
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.backup-config-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(140px, .8fr) minmax(120px, .55fr) minmax(140px, .8fr);
    align-items: end;
}

.backup-actions,
.backup-run-form {
    display: flex;
    align-items: end;
}

.backup-actions {
    justify-content: flex-start;
}

.backup-scope-list {
    margin: 0;
    padding: 0;
    color: var(--muted);
    display: grid;
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
    list-style: none;
}

.backup-scope-list li {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(217, 228, 240, .72);
    border-radius: 10px;
    padding: 8px 10px 8px 30px;
    color: #354762;
    background: rgba(255, 255, 255, .72);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.backup-scope-list li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
    box-shadow: 0 0 0 4px rgba(35, 130, 223, .1);
    transform: translateY(-50%);
}

.backup-scope-list li span,
.backup-scope-list li code {
    display: block;
    min-width: 0;
}

.backup-scope-list li code {
    color: #243653;
    font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: -.01em;
}

.backup-button-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.backup-run-form {
    margin: 0;
}

.backup-run-form button,
.backup-actions button {
    min-width: 168px;
}

.backup-scope-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, .9fr);
    gap: 12px;
    margin-top: 18px;
}

.backup-scope-grid--pro {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    align-items: start;
    gap: 14px;
}

.backup-scope-card {
    position: relative;
    gap: 14px;
    padding: 0;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 251, 255, .94)),
        #fff;
}

.backup-scope-card::after {
    content: "";
    position: absolute;
    right: -42px;
    top: -42px;
    width: 126px;
    height: 126px;
    border-radius: 42px;
    background: linear-gradient(135deg, rgba(35, 130, 223, .14), rgba(18, 170, 220, .05));
    transform: rotate(14deg);
    pointer-events: none;
}

.backup-scope-card__head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(217, 228, 240, .78);
    background: rgba(243, 249, 255, .72);
}

.backup-scope-card__head strong {
    color: var(--brand-800);
    font-size: 15px;
}

.backup-scope-card__head span {
    flex: 0 0 auto;
    border: 1px solid rgba(35, 130, 223, .18);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--brand-800);
    background: #fff;
    font-size: 12px;
    font-weight: 850;
}

.backup-scope-card .backup-scope-list {
    position: relative;
    z-index: 1;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    padding: 18px;
}

.backup-scope-note {
    min-height: 132px;
    align-content: start;
    gap: 10px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(243, 249, 255, .96), rgba(255, 255, 255, .92)),
        #fff;
}

.backup-scope-note strong {
    font-size: 15px;
}

.info-tile--summary span {
    font-size: 14px;
    line-height: 1.65;
}

.button-secondary {
    background: #eef4fb;
    color: var(--brand-800);
    box-shadow: none;
    border: 1px solid rgba(35, 130, 223, .18);
}

.button-secondary:hover {
    background: #e5eef9;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 248px minmax(0, 1fr);
    }

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

    .workspace,
    .admin-grid,
    .logs-shell,
    .docs-grid,
    .docs-summary-grid,
    .users-admin-layout {
        grid-template-columns: 1fr;
    }

    .manager-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "nav"
            "main"
            "editor";
    }

    .user-row {
        grid-template-columns: 1fr 1fr;
    }

    .security-form--inline,
    .security-list-form,
    .security-lists-grid,
    .fail2ban-jail-grid,
    .backup-config-grid,
    .info-grid,
    .backup-scope-grid,
    .log-summary-grid,
    .log-filter-form,
    .dns-probe-form,
    .compact-form--user-create {
        grid-template-columns: 1fr;
    }

    .domain-provision-panel {
        grid-column: auto;
    }

    .backup-actions,
    .backup-run-form,
    .backup-button-row,
    .log-mode-bar,
    .log-action-row {
        max-width: none;
        width: 100%;
    }

    .log-mode-tabs,
    .log-action-row {
        width: 100%;
    }

    .user-grid-head,
    .user-row--dense {
        grid-template-columns: 1fr 1fr;
    }

    .manager-toolbar,
    .manager-actions-top,
    .manager-nav-top,
    .manager-actions-meta {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .folder-tree-shell {
        max-height: 360px;
    }

    .row-actions--dense {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .domain-record__meta {
        grid-template-columns: 1fr;
    }

    .row-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
        align-content: center;
        width: min(100% - 32px, 560px);
        padding: 28px 0;
    }

    .login-brand h1 {
        font-size: clamp(34px, 12vw, 54px);
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .brand {
        min-height: 54px;
    }

    .brand img {
        width: 48px;
        height: 48px;
        padding: 4px;
    }

    .nav-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-list a {
        display: grid;
        place-items: center;
        min-height: 42px;
        padding: 10px 8px;
        text-align: center;
        font-size: 13px;
    }

    .nav-list a:hover,
    .nav-list a.active {
        transform: none;
    }

    .logout-form {
        margin-top: 0;
    }

    .content {
        padding: 20px 16px 28px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-pill {
        justify-content: flex-start;
        border-radius: var(--radius);
    }

    .client-portal-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .login-shell {
        width: min(100% - 24px, 440px);
    }

    .login-card,
    .panel-section {
        padding: 18px;
    }

    .metrics-grid,
    .nav-list,
    .user-row {
        grid-template-columns: 1fr;
    }

    .files-table {
        min-width: 640px;
    }

    .manager-titlebar,
    .manager-toolbar,
    .manager-table-heading,
    .user-grid-head,
    .user-row--dense {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .compact-form--toolbar {
        grid-template-columns: 1fr;
    }

    .compact-form--toolbar button {
        width: 100%;
    }

    .toolbar-form {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-shadow: none;
    }

    .manager-current-label,
    .manager-path {
        max-width: 100%;
    }

    .user-grid-head {
        display: none;
    }

    .user-row--dense {
        gap: 10px;
    }

    .metric-card {
        min-height: 112px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .row-actions {
        flex-direction: column;
    }

    .editor-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .row-actions button {
        width: 100%;
    }
}
