/* Light dashboard — Server Status */
:root {
    --canvas: #f4f7fe;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border: #e8ecf4;
    --border-strong: #dce3f0;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --primary-soft-strong: rgba(37, 99, 235, 0.14);

    --text: #1e293b;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --orange: #ea580c;
    --orange-soft: rgba(234, 88, 8, 0.12);

    --table-head-bg: #e8f0fe;
    --table-head-text: #1e40af;

    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-dropdown: 0 12px 40px rgba(15, 23, 42, 0.12);
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--canvas);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.is-authed {
    overflow-x: hidden;
}

/* ----- App layout (authenticated) ----- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    z-index: 50;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0;
}

.sidebar-brand__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    flex-shrink: 0;
}

.sidebar-brand__mark--sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.mobile-nav-toggle {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav__label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0.5rem 0.75rem 0.35rem;
    margin: 0;
}

.sidebar-nav__list {
    list-style: none;
}

.sidebar-nav__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.sidebar-nav__link:hover {
    background: var(--canvas);
    color: var(--text);
}

.sidebar-nav__link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-nav__link.is-active .sidebar-nav__icon {
    color: var(--primary);
}

.sidebar-nav__icon {
    display: flex;
    color: var(--text-faint);
    flex-shrink: 0;
}

.sidebar-nav__link:hover .sidebar-nav__icon {
    color: inherit;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-nav__link--logout {
    color: var(--text-muted);
}

.sidebar-nav__link--logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.app-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem 0.35rem 0.35rem;
    background: var(--canvas);
    border-radius: 999px;
    border: 1px solid var(--border);
    max-width: 200px;
}

.user-chip__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft-strong);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-chip__name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-main {
    flex: 1;
    padding: 1.5rem 1.75rem 2rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.app-footer {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: auto;
}

.app-footer p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-faint);
}

/* ----- Auth layout (guest) ----- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-header {
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
}

.auth-brand__text {
    letter-spacing: 0;
}

.page-main--auth {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 3rem;
    max-width: none;
}

.auth-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.auth-footer p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-faint);
}

/* ----- Page sections ----- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
    margin: 0 0 0.25rem;
}

.page-header__meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.page-intro {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    max-width: 48rem;
    line-height: 1.55;
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.card--accent-left {
    border-left: 4px solid var(--primary);
}

.card--success-left {
    border-left: 4px solid var(--success);
}

.diagnostics-kv {
    width: 100%;
    font-size: 0.875rem;
}

.diagnostics-kv td {
    padding: 0.35rem 0;
    vertical-align: top;
}

.diagnostics-kv td:first-child {
    color: var(--text-muted);
    padding-right: 1rem;
    white-space: nowrap;
}

.text-ok {
    color: var(--success);
    font-weight: 600;
}

.text-bad {
    color: var(--danger);
    font-weight: 600;
}

.stack-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
}

.stack-actions .btn {
    display: inline-flex;
}

.test-result {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.test-result--ok {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.25);
    color: #166534;
}

.test-result--err {
    background: var(--danger-soft);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #991b1b;
}

.test-result ul {
    margin: 0.35rem 0 0 1.25rem;
    padding: 0;
}

.test-result__divider {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.mt-sm {
    margin-top: 0.65rem;
}

.mb-0 {
    margin-bottom: 0;
}

.callout-warn {
    background: var(--warning-soft);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: #92400e;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.instructions-block {
    background: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.instructions-block h3,
.instructions-block h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--text);
}

.instructions-block h4 {
    margin-top: 1.25rem;
    font-size: 0.9375rem;
}

.instructions-block ol {
    margin: 0 0 0 1.25rem;
    padding: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.instructions-block a {
    color: var(--primary);
    font-weight: 500;
}

.code-block {
    display: block;
    background: var(--canvas);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.65rem;
    overflow-x: auto;
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
    line-height: 1.45;
    color: var(--text);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.kpi-card__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.kpi-card__value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.1;
    color: var(--text);
}

.kpi-card--accent .kpi-card__value {
    color: var(--primary);
}

.kpi-card--success .kpi-card__value {
    color: var(--success);
}

.kpi-card--warning .kpi-card__value {
    color: var(--orange);
}

.kpi-grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi-grid--admin-extra {
    margin-top: 0;
}

/* ----- Stat tiles (dashboard / insights) ----- */
.stat-tile-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-tile-grid--dash {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-items: center;
}

.stat-tile-grid--dash > .stat-tile {
    width: min(100%, 19.5rem);
    box-sizing: border-box;
}

.stat-tile-grid--insights {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
    justify-items: center;
}

.stat-tile-grid--insights > .stat-tile {
    width: min(100%, 20.5rem);
    box-sizing: border-box;
}

.stat-tile-grid--finance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    align-items: stretch;
    justify-items: stretch;
}

.stat-tile-grid--finance > .stat-tile {
    width: 100%;
    max-width: none;
}

.stat-tile-grid--mail {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
    justify-items: center;
}

.stat-tile-grid--mail > .stat-tile {
    width: min(100%, 20.5rem);
    box-sizing: border-box;
}

.stat-tile {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
    row-gap: 0;
    padding: 1rem 1.25rem;
    min-height: 6.875rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-tile:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.stat-tile--compact {
    padding: 1rem 1.25rem;
}

.stat-tile__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--canvas);
    color: var(--text-muted);
}

.stat-tile__icon--sm {
    width: 52px;
    height: 52px;
}

.stat-tile__icon--sm .stat-tile__svg {
    width: 26px;
    height: 26px;
}

.stat-tile--accent .stat-tile__icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-tile--success .stat-tile__icon {
    background: var(--success-soft);
    color: var(--success);
}

.stat-tile--violet .stat-tile__icon {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
}

.stat-tile--warn .stat-tile__icon {
    background: var(--warning-soft);
    color: var(--warning);
}

.stat-tile--neutral .stat-tile__icon {
    background: var(--canvas);
    color: var(--text-muted);
}

.stat-tile__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.stat-tile__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: var(--text-muted);
    line-height: 1.25;
    margin: 0;
}

.stat-tile__value {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.12;
    color: var(--text);
    margin: 0;
}

.stat-tile__value--money {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text);
}

.stat-tile__meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
    padding-top: 0.15rem;
}

.stat-tile__meta-warn {
    color: var(--danger);
    font-weight: 600;
}

.stat-tile__meta-muted {
    color: var(--text-faint);
}

.charts-grid--3col {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Side-by-side horizontal bar charts on Insights */
.charts-grid--bars-split {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    align-items: stretch;
}

.chart-card--bar .chart-card__title {
    margin-bottom: 0.35rem;
}

.chart-card--bar .chart-card__hint {
    margin-bottom: 0.5rem;
}

.chart-wrap--bars {
    position: relative;
    height: min(280px, 42vh);
    min-height: 200px;
    max-height: 320px;
}

.chart-card__hint--tight {
    margin-bottom: 0.4rem;
}

@media (max-width: 720px) {
    .stat-tile-grid--finance {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .stat-tile-grid--dash > .stat-tile,
    .stat-tile-grid--insights > .stat-tile,
    .stat-tile-grid--mail > .stat-tile {
        width: 100%;
        max-width: none;
    }

    .stat-tile-grid--dash,
    .stat-tile-grid--insights,
    .stat-tile-grid--mail {
        justify-items: stretch;
    }
}

@media (max-width: 520px) {
    .stat-tile {
        grid-template-columns: 48px minmax(0, 1fr);
        column-gap: 0.875rem;
        padding: 0.9rem 1rem;
        min-height: 6.25rem;
    }

    .stat-tile__icon {
        width: 48px;
        height: 48px;
    }
}

.kpi-card__value--danger {
    color: var(--danger);
}

.kpi-card__value--warning {
    color: var(--warning);
}

.kpi-card__value--money {
    font-size: 1.35rem;
    color: var(--primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.charts-grid--dashboard {
    margin-bottom: 1.5rem;
}

/* Dashboard donuts: same header + hint height so canvases line up */
.chart-card--dashboard-chart {
    display: flex;
    flex-direction: column;
}

.chart-card--dashboard-chart .chart-card__head {
    flex-shrink: 0;
    min-height: 1.75rem;
    margin-bottom: 0.25rem;
    align-items: center;
}

.chart-card--dashboard-chart .chart-card__hint--dash {
    flex-shrink: 0;
    margin: 0 0 0.35rem;
    min-height: 2.35rem;
    line-height: 1.35;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chart-card--dashboard-chart .chart-card__hint--dash code {
    font-size: 0.6875rem;
}

.chart-card--dashboard-chart .chart-wrap {
    flex: none;
    height: 120px;
    min-height: 120px;
}

/* Insights donuts: equal title + hint band so charts share a baseline */
.chart-card--insights-donut {
    display: flex;
    flex-direction: column;
}

.chart-card--insights-donut .chart-card__title {
    flex-shrink: 0;
    margin: 0 0 0.25rem;
    min-height: 1.25rem;
    line-height: 1.3;
}

.chart-card--insights-donut .chart-card__hint--insights-donut {
    flex-shrink: 0;
    margin: 0 0 0.35rem;
    min-height: 2.35rem;
    line-height: 1.35;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chart-card--insights-donut .chart-card__hint--insights-donut code {
    font-size: 0.6875rem;
}

.chart-card--insights-donut .chart-wrap {
    flex: none;
    height: 125px;
    min-height: 125px;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 0.9rem 1rem;
}

.chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.chart-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.chart-card__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.chart-card__link:hover {
    text-decoration: underline;
}

.chart-card__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.chart-wrap {
    position: relative;
    height: 220px;
}

.chart-wrap--sm {
    height: 200px;
}

.chart-wrap--tall {
    height: min(380px, 52vh);
    min-height: 220px;
}

.chart-empty {
    padding: 2rem 0;
    margin: 0;
}

.link-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.link-list a {
    color: var(--primary);
    font-weight: 500;
}

.notif-row-unread {
    background: rgba(37, 99, 235, 0.04);
}

.page-back {
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

.page-back a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.page-back a:hover {
    text-decoration: underline;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    min-height: 3rem;
}

.toolbar__left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.toolbar__meta {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
    padding: 0.35rem 0;
}

.toolbar__meta strong {
    color: var(--text);
    font-weight: 600;
}

.toolbar__meta a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.toolbar__meta a:hover {
    text-decoration: underline;
}

/* ----- Cards & tables ----- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.card--muted {
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.2);
}

.card__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75rem;
    letter-spacing: 0;
}

.card__desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
    line-height: 1.55;
}

.table-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--table-head-bg);
    color: var(--table-head-text);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-strong);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
    white-space: nowrap;
}

thead th:hover {
    background: #dbe8fd;
}

.table-static thead th {
    cursor: default;
    user-select: auto;
}

.table-static thead th:hover {
    background: var(--table-head-bg);
}

.table-static thead th::after {
    display: none !important;
}

thead th[data-sort-column]::after {
    content: '';
    display: inline-block;
    width: 0;
    margin-left: 0.35rem;
    opacity: 0.35;
    vertical-align: middle;
    border: 4px solid transparent;
}

thead th.sort-asc::after {
    border-bottom-color: var(--primary);
    border-top: none;
    margin-bottom: 2px;
    opacity: 1;
}

thead th.sort-desc::after {
    border-top-color: var(--primary);
    border-bottom: none;
    margin-top: 2px;
    opacity: 1;
}

tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

tbody tr:last-child td {
    border-bottom: none;
}

.manage-users-section {
    margin-top: 1.5rem;
}

.manage-users-section .card__title {
    margin-bottom: 1rem;
}

.table-card__header {
    padding: 1.25rem 1.25rem 0.5rem;
}

.table-card__header .card__title {
    margin-bottom: 0;
}

.table-card__flash {
    margin: 0 1.25rem 1rem;
}

.table-card__footer {
    padding: 1rem 1.25rem 1.25rem;
    margin: 0;
}

.table-card__footer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
}

.table-card__footer a:hover {
    text-decoration: underline;
}

.hint-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Row status */
.status-blacklisted td.col-blacklisted,
.status-blacklisted .status-indicator {
    color: var(--orange);
    font-weight: 600;
}

.status-down td.col-status,
.status-down .status-indicator {
    color: var(--danger);
    font-weight: 600;
}

.status-up td.col-status,
.status-up .status-indicator {
    color: var(--success);
    font-weight: 600;
}

thead th.col-mail-sent-th {
    text-align: left;
}

.col-blacklisted {
    text-align: left;
    vertical-align: middle;
}

.col-mail-sent {
    vertical-align: middle;
    text-align: left;
    /* Keep column only as wide as the compact block + padding */
    width: 1%;
    white-space: nowrap;
}

.mail-sent-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.mail-sent-stack__row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.35rem;
}

.mail-sent-stack__lbl {
    flex: 0 0 1.75rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: left;
}

.mail-sent-stack__val {
    flex: 0 0 4.75rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1.2;
}

.mail-sent-stack__state {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
}

.mail-sent-stack__state::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-faint);
    content: "";
}

.mail-sent-stack__state--fresh {
    color: var(--success);
}

.mail-sent-stack__state--fresh::before {
    background: var(--success);
}

.mail-sent-stack__state--failed {
    color: var(--danger);
}

.mail-sent-stack__state--failed::before {
    background: var(--danger);
}

/* ----- Badges & pills ----- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.badge--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge--warning {
    background: var(--orange-soft);
    color: #c2410c;
}

.badge--neutral {
    background: var(--canvas);
    color: var(--text-muted);
}

.code-inline {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 0.8125rem;
    padding: 0.2rem 0.45rem;
    background: var(--canvas);
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text);
}

.money-pill {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 6px;
}

.due-date {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--warning);
}

.relay-domains-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.relay-domains-cell .relay-more {
    color: var(--text-faint);
    font-style: normal;
}

.relay-domains-cell--health {
    max-width: 340px;
    white-space: normal;
    vertical-align: middle;
}

.relay-domains-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.relay-domains-inline {
    display: inline;
    line-height: 1.45;
}

.relay-domain-sep {
    display: inline-block;
    width: 0.25rem;
}

.relay-domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8125rem;
}

.relay-domain-tag__name {
    color: var(--text-muted);
}

.relay-domain-tag--ok .relay-domain-tag__name {
    color: var(--text);
}

.relay-domain-tag--bad .relay-domain-tag__name {
    color: var(--danger);
    font-weight: 600;
}

.relay-domain-tag--pending .relay-domain-tag__name {
    color: var(--text-faint);
}

.domain-health-icon {
    flex-shrink: 0;
}

.domain-health-icon--ok {
    color: var(--success);
}

.domain-health-icon--bad {
    color: var(--danger);
}

.domain-health-icon--pending {
    color: var(--text-faint);
}

tbody tr.table-row--risk td {
    background: var(--danger-soft);
}

tbody tr.table-row--risk td:first-child {
    box-shadow: inset 3px 0 0 var(--danger);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-weight: 500;
}

.empty-state .empty-state__hint {
    margin-top: 0.5rem;
    font-weight: 400;
    font-size: 0.875rem;
}

.empty-state a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* ----- Buttons ----- */
.btn,
.action-btn,
input[type="submit"],
.btn-submit,
button.btn {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    transition: background var(--transition), box-shadow var(--transition), transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    text-align: center;
    line-height: 1.25;
}

.btn,
.action-btn,
input[type="submit"].btn,
.btn-submit,
button.btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn:hover,
.action-btn:hover,
input[type="submit"].btn:hover,
.btn-submit:hover,
button.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn:active,
.action-btn:active {
    transform: translateY(1px);
}

.btn-danger,
button.btn-danger {
    background: var(--danger);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover,
button.btn-danger:hover {
    background: #b91c1c;
}

.add-btn {
    background: #0891b2;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.add-btn:hover {
    background: #0e7490;
}

.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn--secondary:hover {
    background: var(--canvas);
    border-color: var(--text-faint);
}

.btn--sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* ----- Forms ----- */
.form-container {
    background: var(--surface);
    padding: 1.75rem 2rem;
    border-radius: var(--radius);
    max-width: 640px;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.form-container .card__title,
.form-container h2 {
    text-align: left;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.form-container > div {
    margin-bottom: 1.15rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

textarea.monospace-field {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 0.875rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.form-callout {
    background: var(--canvas);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--primary);
}

.form-callout label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
}

.form-callout input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.form-callout .form-hint {
    margin: 0.5rem 0 0 1.75rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-actions a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-actions a:hover {
    text-decoration: underline;
}

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

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ----- Messages ----- */
.error-message,
.success-message {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: var(--danger-soft);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #991b1b;
}

.success-message {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.25);
    color: #166534;
}

.flash-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.flash-banner .flash-banner__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ----- Login ----- */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem 2rem 2.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(28, 37, 43, 0.11);
}

.login-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-heading__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
}
.login-heading p {
    margin: 0 0 0.15rem;
    color: var(--primary);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}
.login-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.22rem;
}
.login-heading > span:last-child {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.login-container form > div {
    margin-bottom: 1.15rem;
}

.login-container .btn-submit,
.login-container input[type="submit"] {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem;
}
.password-field { position: relative; }
.password-field input { padding-right: 2.75rem; }
.password-field button {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: var(--text-faint);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}
.password-field button:hover { color: var(--text); background: var(--canvas); }

/* ----- Notifications ----- */
.notification-bell-area {
    position: relative;
}

.notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    position: relative;
}

.notification-bell:hover {
    background: var(--canvas);
    color: var(--primary);
    border-color: var(--border-strong);
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    width: min(380px, calc(100vw - 2rem));
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
    animation: slideDown 0.2s ease-out;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    color: var(--table-head-text);
    background: var(--table-head-bg);
}

.notification-header__title {
    flex-shrink: 0;
}

.notification-mark-all {
    flex-shrink: 0;
    padding: 0.35rem 0.65rem;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.notification-mark-all:hover {
    background: #fff;
    color: var(--primary-hover);
}

#notificationList {
    list-style: none;
}

#notificationList li.notification-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem;
    align-items: start;
    padding: 0.85rem 0.65rem 0.85rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

#notificationList li.notification-item:hover {
    background: var(--canvas);
}

.notification-item__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item__icon--blacklist {
    background: var(--orange-soft);
    color: #c2410c;
}

.notification-item__icon--delisted,
.notification-item__icon--smtp_ok {
    background: var(--success-soft);
    color: var(--success);
}

.notification-item__icon--domain_ok {
    background: var(--success-soft);
    color: var(--success);
}

.notification-item__icon--domain_bad,
.notification-item__icon--smtp_bad {
    background: var(--danger-soft);
    color: var(--danger);
}

.notification-item__icon--default {
    background: var(--canvas);
    color: var(--text-muted);
}

.notification-item__svg {
    display: block;
}

.notification-item__body {
    min-width: 0;
}

#notificationList li .notification-message {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text);
    font-weight: 500;
    word-wrap: break-word;
}

#notificationList li .notification-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

#notificationList li .dismiss-notification {
    position: static;
    align-self: start;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-faint);
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
}

#notificationList li .dismiss-notification:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

#notificationList li.no-notifications {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
}

.notification-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--canvas);
}

.notification-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* ----- Modal ----- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-dialog {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-dropdown);
}

.modal-dialog h3 {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.modal-dialog p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.modal-dialog__highlight {
    background: var(--danger-soft);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.modal-dialog__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-dialog__actions form {
    display: inline;
}

/* ----- Utilities ----- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.stack-gap {
    margin-top: 1.5rem;
}

/* ----- Automation command center ----- */
.automation-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.automation-eyebrow {
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 0.2rem;
}

.automation-heading h2 {
    font-size: 1.45rem;
    line-height: 1.3;
    margin: 0 0 0.3rem;
}

.automation-heading p:not(.automation-eyebrow) {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.automation-ready {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.automation-ready span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px var(--success-soft);
}

.automation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.automation-job {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.automation-job.is-running { border-color: rgba(37, 99, 235, 0.55); }
.automation-job.is-success { border-color: rgba(22, 163, 74, 0.4); }
.automation-job.is-failed { border-color: rgba(220, 38, 38, 0.4); }

.automation-job__top,
.automation-job__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.automation-job__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--primary);
    background: var(--primary-soft);
}

.automation-job__icon--green { color: var(--success); background: var(--success-soft); }
.automation-job__icon--cyan { color: #0891b2; background: rgba(8, 145, 178, 0.11); }
.automation-job__icon--orange { color: var(--orange); background: var(--orange-soft); }

.automation-job__state {
    color: var(--text-faint);
    font-size: 0.75rem;
    font-weight: 600;
}

.automation-job.is-running .automation-job__state { color: var(--primary); }
.automation-job.is-success .automation-job__state { color: var(--success); }
.automation-job.is-failed .automation-job__state { color: var(--danger); }

.automation-job h3 {
    font-size: 1rem;
    margin: 1rem 0 0.35rem;
}

.automation-job > p {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.5;
    min-height: 2.5rem;
    margin: 0 0 1rem;
}

.automation-job__footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.automation-job__footer > span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-faint);
    font-size: 0.75rem;
}

.automation-run {
    padding: 0.52rem 0.85rem;
    min-width: 104px;
}

.automation-run:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.automation-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: automation-spin 0.7s linear infinite;
}

@keyframes automation-spin { to { transform: rotate(360deg); } }

.automation-console {
    overflow: hidden;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    background: #172033;
    color: #d8e2f2;
    border: 1px solid #29354c;
}

.automation-console__header {
    min-height: 48px;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #29354c;
}

.automation-console__header > div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.automation-console__indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}

.automation-console.is-active .automation-console__indicator { background: #38bdf8; }
.automation-console__header strong { font-size: 0.82rem; }
.automation-console__header span:last-child { color: #8fa0b9; font-size: 0.72rem; }

.automation-console__clear {
    padding: 0.3rem;
    color: #8fa0b9;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.automation-console__clear:hover { color: #fff; }

.automation-console pre {
    margin: 0;
    padding: 1rem;
    min-height: 112px;
    max-height: 360px;
    overflow: auto;
    color: #c8d5e8;
    font: 0.76rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.automation-cron {
    margin-top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.automation-cron summary {
    padding: 1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.automation-cron summary::-webkit-details-marker { display: none; }
.automation-cron summary > span:first-child { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 0.9rem; }
.automation-cron__hint { color: var(--text-faint); font-size: 0.78rem; }
.automation-cron__body { padding: 0 1.15rem 1.15rem; border-top: 1px solid var(--border); }
.automation-cron__body > p { color: var(--text-muted); font-size: 0.82rem; margin: 1rem 0; }

.automation-cron__row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}

.automation-cron__row:first-of-type { border-top: 0; }
.automation-cron__row strong, .automation-cron__row span { display: block; }
.automation-cron__row strong { font-size: 0.82rem; }
.automation-cron__row span { color: var(--text-faint); font-size: 0.72rem; }
.automation-cron__row code { overflow-x: auto; padding: 0.6rem 0.75rem; background: var(--canvas); border-radius: 5px; color: var(--text); font-size: 0.72rem; white-space: nowrap; }

.automation-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.2rem;
    margin-top: 1rem;
    color: var(--text-faint);
    font-size: 0.78rem;
}

.automation-tools a { color: var(--text-muted); text-decoration: none; }
.automation-tools a:hover { color: var(--primary); }

@media (max-width: 800px) {
    .automation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .automation-heading { display: block; }
    .automation-ready { margin-top: 0.75rem; }
    .automation-job__footer { align-items: flex-end; }
    .automation-job__footer > span { max-width: 120px; }
    .automation-console__header span:last-child { display: none; }
    .automation-cron__hint { display: none; }
    .automation-cron__row { grid-template-columns: 1fr; gap: 0.45rem; }
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-brand {
        width: 100%;
        border-bottom: 1px solid var(--border);
        padding: 0.85rem 1rem;
    }

    .sidebar-nav {
        display: flex;
        flex: 1;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem 0.5rem 0.5rem 0.75rem;
        gap: 0.25rem;
    }

    .sidebar-nav__label {
        width: 100%;
        padding-top: 0.25rem;
    }

    .sidebar-nav__list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .sidebar-nav__list li {
        margin: 0;
    }

    .sidebar-nav__link {
        margin-bottom: 0;
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
    }

    .sidebar-footer {
        width: auto;
        border-top: none;
        padding: 0.5rem;
        margin-top: 0;
    }

    .sidebar-nav__link--logout {
        padding: 0.5rem 0.65rem;
    }

    .topbar {
        padding: 0 1rem;
    }

    .page-main {
        padding: 1.25rem 1rem 1.5rem;
    }

    .user-chip__name {
        display: none;
    }

    .user-chip {
        padding: 0.35rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .kpi-card__value {
        font-size: 1.65rem;
    }

    .form-container {
        padding: 1.25rem;
    }

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

    .form-actions a,
    .form-actions input[type="submit"],
    .form-actions .btn-group {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn,
    .btn-group button {
        width: 100%;
    }
}

/* ===== Command center visual system ===== */
:root {
    --canvas: #f3f5f6;
    --surface: #ffffff;
    --border: #e1e5e8;
    --border-strong: #cfd5da;
    --primary: #06737e;
    --primary-hover: #055f68;
    --primary-soft: rgba(8, 127, 140, 0.09);
    --primary-soft-strong: rgba(8, 127, 140, 0.14);
    --text: #20262b;
    --text-muted: #58646c;
    --text-faint: #5f6b73;
    --success: #087a38;
    --table-head-bg: #f5f7f8;
    --table-head-text: #4a555d;
    --sidebar-width: 232px;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-card: 0 1px 2px rgba(22, 29, 34, 0.04);
}

body { background: var(--canvas); }

.sidebar {
    background: #191d20;
    border-right: 0;
    color: #fff;
}

.sidebar-brand {
    padding: 1.1rem 1rem;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sidebar-brand__link { color: #f7f9fa; font-size: 0.88rem; }
.sidebar-brand__text { max-width: 148px; line-height: 1.25; }

.sidebar-brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #18a0ae;
    position: relative;
}

.sidebar-brand__mark::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 9px;
    left: 9px;
    top: 10px;
    border: 2px solid #fff;
    border-top-width: 1px;
    border-radius: 2px;
}

.sidebar-nav { padding: 0.75rem 0.65rem; }
.sidebar-nav__label { color: #8d989e; padding: 0.8rem 0.65rem 0.3rem; font-size: 0.61rem; }
.sidebar-nav__link { color: #aeb7bc; font-size: 0.82rem; padding: 0.55rem 0.65rem; border-radius: 5px; }
.sidebar-nav__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-nav__link.is-active { color: #fff; background: rgba(24, 160, 174, 0.18); }
.sidebar-nav__icon { color: #76838a; }
.sidebar-nav__link.is-active .sidebar-nav__icon { color: #45c2cd; }
.sidebar-footer { border-top-color: rgba(255, 255, 255, 0.08); }
.sidebar-nav__link--logout:hover { background: rgba(220, 38, 38, 0.14); }
.logout-form { margin: 0; }
.logout-form button { width: 100%; border: 0; background: transparent; font-family: inherit; cursor: pointer; }

.topbar {
    height: 58px;
    padding: 0 1.5rem;
    border-bottom-color: var(--border);
}

.topbar-title { font-size: 1rem; font-weight: 650; letter-spacing: 0; }
.page-main { padding: 1.4rem 1.5rem 2.25rem; max-width: 1600px; width: 100%; }
.app-footer { border-top: 0; background: transparent; }

.user-chip { border-radius: 6px; background: #f6f7f8; padding: 0.25rem 0.55rem 0.25rem 0.25rem; }
.user-chip__avatar { width: 28px; height: 28px; border-radius: 5px; }

.card,
.table-card,
.chart-card,
.stat-tile {
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.stat-tile { min-height: 116px; padding: 1.05rem; }
.stat-tile__icon { width: 42px; height: 42px; border-radius: 6px; }
.stat-tile__label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-faint); }
.stat-tile__value { font-size: 1.35rem; letter-spacing: 0; }
.stat-tile__meta { font-size: 0.72rem; }
.stat-tile-grid--dash { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-tile-grid {
    gap: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat-tile-grid > .stat-tile {
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}
.stat-tile-grid > .stat-tile:last-child { border-right: 0; }

.btn,
.action-btn,
input[type="submit"].btn,
.btn-submit,
button.btn {
    border-radius: 5px;
    box-shadow: none;
    letter-spacing: 0;
}
.btn:hover, .action-btn:hover, input[type="submit"].btn:hover, .btn-submit:hover, button.btn:hover { box-shadow: none; }
.add-btn { background: var(--primary); box-shadow: none; }
.add-btn:hover { background: var(--primary-hover); }

thead th { font-size: 0.68rem; font-weight: 650; text-transform: uppercase; color: var(--table-head-text); }
tbody td { color: #465159; }
tbody tr:hover { background: #f8fafb; }
.badge { border-radius: 4px; }

.command-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
}

.command-page-head__eyebrow {
    margin: 0 0 0.15rem;
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.command-page-head h2 { margin: 0 0 0.25rem; font-size: 1.35rem; line-height: 1.3; }
.command-page-head > div > p:last-child { margin: 0; color: var(--text-muted); font-size: 0.82rem; }
.command-head-actions { display: flex; gap: 0.55rem; }

.metric-strip {
    display: grid;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.metric-strip--three { grid-template-columns: 1.25fr repeat(2, 1fr); }

.metric-block { min-width: 0; padding: 1rem 1.15rem; border-left: 1px solid var(--border); }
.metric-block:first-child { border-left: 0; }
.metric-block span, .metric-block small { display: block; }
.metric-block span { color: var(--text-muted); font-size: 0.7rem; font-weight: 600; }
.metric-block strong { display: block; margin: 0.25rem 0 0.1rem; font-size: 1.45rem; line-height: 1.3; overflow-wrap: anywhere; }
.metric-block:not(.metric-block--primary) strong { font-size: 1rem; min-height: 1.9rem; display: flex; align-items: center; }
.metric-block small { color: var(--text-faint); font-size: 0.68rem; }
.metric-block--primary { border-top: 3px solid var(--primary); }

.command-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 1rem; }
.command-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.command-panel__head { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.command-panel__head h3 { margin: 0 0 0.15rem; font-size: 0.9rem; }
.command-panel__head p { margin: 0; color: var(--text-muted); font-size: 0.7rem; }
.panel-range { color: var(--text-muted); font-size: 0.7rem; padding: 0.25rem 0.45rem; background: var(--canvas); border-radius: 4px; align-self: flex-start; }
.chart-wrap--trend { height: 310px; padding: 1rem; }

.panel-empty { min-height: 280px; padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text-muted); }
.panel-empty strong { color: var(--text); font-size: 0.9rem; }
.panel-empty span { margin-top: 0.3rem; max-width: 390px; font-size: 0.75rem; }
.panel-empty--compact { min-height: 190px; padding: 1rem; }

.coverage-meter { padding: 1.2rem 1.15rem 0.8rem; }
.coverage-meter > div { height: 7px; overflow: hidden; background: #e9edef; border-radius: 3px; margin-bottom: 0.6rem; }
.coverage-meter > div span { display: block; height: 100%; background: var(--success); }
.coverage-meter strong { font-size: 0.82rem; }
.signal-list { margin: 0; padding: 0 1.15rem 1rem; }
.signal-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-top: 1px solid var(--border); font-size: 0.72rem; }
.signal-list dt { color: var(--text-muted); }
.signal-list dd { margin: 0; font-weight: 600; text-align: right; }

.command-table td { font-size: 0.76rem; }
.delivery-rate {
    display: grid;
    grid-template-columns: minmax(64px, 1fr) 42px;
    align-items: center;
    gap: 0.45rem;
    min-width: 116px;
}
.delivery-rate__track {
    height: 7px;
    overflow: hidden;
    background: #e9edef;
    border-radius: 3px;
}
.delivery-rate__track span {
    display: block;
    height: 100%;
    background: var(--success);
}
.delivery-rate--warning .delivery-rate__track span { background: var(--warning); }
.delivery-rate--poor .delivery-rate__track span { background: var(--danger); }
.delivery-rate__value strong,
.delivery-rate__value small {
    display: block;
    text-align: right;
}
.delivery-rate__value strong {
    color: var(--text);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}
.delivery-rate__value small {
    margin-top: 0.05rem;
    color: var(--text-faint);
    font-size: 0.58rem;
    font-variant-numeric: tabular-nums;
}
.delivery-rate__empty {
    color: var(--text-faint);
    font-size: 0.7rem;
    white-space: nowrap;
}
.host-error { display: block; color: var(--danger); font-size: 0.63rem; font-weight: 600; margin-top: 0.15rem; }
.freshness { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.freshness::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.freshness--ok::before { background: var(--success); }
.freshness--stale::before { background: var(--warning); }

.reason-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.reason-item {
    min-width: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.reason-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.75rem;
}
.reason-item summary::-webkit-details-marker { display: none; }
.reason-item__label { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.reason-item__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 1px solid #b8c2c9;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
}
.reason-item[open] { background: #f8fafb; }
.reason-item p {
    margin: 0;
    padding: 0 1rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.69rem;
    line-height: 1.5;
}

.domain-check-tool { margin-bottom: 1rem; }
.domain-check-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.15rem;
}
.domain-check-form__field { min-width: 0; }
.domain-check-form__field label {
    color: #465159;
    font-size: 0.75rem;
}
.domain-check-form__field input { min-height: 42px; }
.domain-check-form > .btn {
    min-width: 120px;
    min-height: 42px;
    margin-bottom: 1.55rem;
}

.mail-overview {
    display: grid;
    grid-template-columns: minmax(380px, 0.85fr) minmax(420px, 1.15fr);
    min-height: 270px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.mail-overview__metrics { padding: 1.25rem; border-right: 1px solid var(--border); position: relative; }
.mail-overview__lead > span { display: block; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; }
.mail-overview__lead > strong { display: block; font-size: 2.15rem; line-height: 1.2; margin: 0.25rem 0; }
.mail-overview__lead > small { color: var(--text-faint); font-size: 0.72rem; }
.mail-overview__signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-top: 1.2rem; }
.mail-overview__signals > div { padding-top: 0.75rem; border-top: 1px solid var(--border); min-width: 0; }
.mail-overview__signals span, .mail-overview__signals small { display: block; color: var(--text-faint); font-size: 0.63rem; }
.mail-overview__signals strong { display: block; margin: 0.18rem 0; font-size: 0.85rem; overflow-wrap: anywhere; }
.mail-overview__link { position: absolute; left: 1.25rem; bottom: 1.1rem; color: var(--primary); text-decoration: none; font-size: 0.74rem; font-weight: 600; }
.mail-overview__chart { min-width: 0; padding: 1rem; height: 270px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 1.45rem 0 0.75rem; }
.section-heading h3 { margin: 0; font-size: 0.95rem; }
.section-heading p { margin: 0.1rem 0 0; color: var(--text-muted); font-size: 0.7rem; }
.section-heading a { color: var(--primary); text-decoration: none; font-size: 0.72rem; font-weight: 600; }

.toolbar__right { display: flex; align-items: center; gap: 0.55rem; }
.inventory-search {
    position: relative;
    width: min(320px, 34vw);
}
.inventory-search svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}
.inventory-search input[type="search"] {
    width: 100%;
    min-height: 36px;
    padding: 0.45rem 0.7rem 0.45rem 2.15rem;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    font: 0.72rem/1.4 inherit;
}
.inventory-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.inventory-filter { width: 155px; min-height: 36px; padding: 0.42rem 0.6rem; font-size: 0.7rem; }
.inventory-count { color: var(--text-faint); font-size: 0.68rem; white-space: nowrap; }
.inventory-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
.inventory-no-results strong,
.inventory-no-results span { display: block; }
.inventory-no-results strong { color: var(--text); font-size: 0.82rem; }
.inventory-no-results span { margin-top: 0.2rem; font-size: 0.68rem; }
.inventory-table-wrap:has(tbody tr[data-server-row][hidden]:only-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

@media (max-width: 1150px) {
    .stat-tile-grid--dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mail-overview { grid-template-columns: 1fr; }
    .mail-overview__metrics { border-right: 0; border-bottom: 1px solid var(--border); min-height: 255px; }
}

@media (max-width: 900px) {
    .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-block:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
    .metric-block:nth-child(4) { border-top: 1px solid var(--border); }
    .command-layout { grid-template-columns: 1fr; }
    .sidebar { border-bottom: 0; }
    .sidebar-brand { border-bottom-color: rgba(255, 255, 255, 0.08); }
    .sidebar-nav {
        display: none;
        width: 100%;
        padding: 0.45rem 0.75rem 0.7rem;
        overflow: visible;
        white-space: normal;
    }
    .sidebar.is-mobile-open .sidebar-nav { display: block; }
    .sidebar-nav__label {
        display: block;
        padding: 0.75rem 0.65rem 0.25rem;
    }
    .sidebar-nav__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.2rem;
        margin: 0;
    }
    .sidebar-nav__link {
        width: 100%;
        min-height: 42px;
        margin: 0;
    }
    .sidebar-footer {
        display: none;
        position: static;
        width: 100%;
        padding: 0.45rem 0.75rem 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .sidebar.is-mobile-open .sidebar-footer { display: block; }
    .sidebar-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.7rem 1rem;
    }
    .mobile-nav-toggle {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 38px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 5px;
        background: transparent;
        color: #d8dfe2;
        cursor: pointer;
    }
    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:focus-visible {
        color: #fff;
        background: rgba(255, 255, 255, 0.07);
        outline: none;
    }
    .mobile-nav-toggle__close { display: none; }
    .sidebar.is-mobile-open .mobile-nav-toggle__menu { display: none; }
    .sidebar.is-mobile-open .mobile-nav-toggle__close { display: block; }
    .toolbar { align-items: stretch; }
    .toolbar__left { flex: 1; }
    .inventory-search { width: min(300px, 55vw); }
}

@media (max-width: 760px) {
    .page-main { padding: 1rem; }
    .sidebar { background: #191d20; }
    .command-page-head { display: block; }
    .command-page-head > .btn, .command-head-actions { margin-top: 0.75rem; }
    .mail-overview { display: block; min-height: 0; }
    .mail-overview__metrics { min-height: 0; }
    .mail-overview__chart { height: 240px; }
    .mail-overview__signals { grid-template-columns: 1fr; gap: 0.35rem; }
    .mail-overview__signals > div { display: grid; grid-template-columns: 1fr auto; gap: 0 0.75rem; }
    .mail-overview__signals small { grid-column: 1 / -1; }
    .mail-overview__link {
        position: static;
        display: inline-block;
        margin-top: 0.9rem;
    }
}

@media (max-width: 620px) {
    .domain-check-form { grid-template-columns: 1fr; }
    .domain-check-form > .btn {
        width: 100%;
        margin-bottom: 0;
    }
}

@media (max-width: 520px) {
    .sidebar-nav__list { grid-template-columns: 1fr; }
    .metric-strip { grid-template-columns: 1fr; }
    .metric-block { border-left: 0; border-top: 1px solid var(--border); }
    .metric-block:first-child { border-top: 3px solid var(--primary); }
    .stat-tile-grid--dash { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    .stat-tile-grid--dash > .stat-tile {
        grid-template-columns: 38px minmax(0, 1fr);
        column-gap: 0.65rem;
        min-height: 96px;
        padding: 0.75rem;
    }
    .stat-tile-grid--dash .stat-tile__icon {
        width: 38px;
        height: 38px;
    }
    .stat-tile-grid--dash .stat-tile__svg {
        width: 22px;
        height: 22px;
    }
    .stat-tile-grid--dash .stat-tile__value { font-size: 1.2rem; }
    .stat-tile-grid--dash .stat-tile__meta { font-size: 0.68rem; }
    .command-head-actions { flex-wrap: wrap; }
    .toolbar, .toolbar__left, .toolbar__right { flex-direction: column; align-items: stretch; }
    .inventory-search, .inventory-filter { width: 100%; }
    .inventory-count { text-align: right; }
}

/* ===== Access management and activity feed ===== */
.alert {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 550;
}
.alert--danger { color: #9f2020; background: #fff7f7; border-color: #f3c7c7; }
.alert--success { color: #176b3a; background: #f3fbf6; border-color: #bfe5cd; }

.access-summary {
    align-self: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.access-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1rem;
    align-items: start;
}

.access-directory,
.access-create,
.activity-feed {
    box-shadow: 0 8px 28px rgba(28, 37, 43, 0.05);
}
.access-directory { overflow: visible; }

.access-list { padding: 0 1.15rem; }
.access-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, auto) 36px;
    align-items: center;
    gap: 1rem;
    min-height: 76px;
    border-bottom: 1px solid var(--border);
}
.access-row:last-child { border-bottom: 0; }

.access-identity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.access-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #076b76;
    background: #e5f4f5;
    font-size: 0.75rem;
    font-weight: 750;
}
.access-identity strong,
.access-identity span { display: block; }
.access-identity strong { font-size: 0.8rem; }
.access-identity span { color: var(--text-faint); font-size: 0.66rem; margin-top: 0.08rem; }

.access-role-form { display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; }
.access-role-form select { width: 150px; height: 34px; padding: 0.35rem 0.55rem; font-size: 0.72rem; }
.access-role-form select:disabled { border-color: transparent; background: transparent; color: var(--text-muted); opacity: 1; }

.access-actions { position: relative; }
.access-actions > summary {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
}
.access-actions > summary::-webkit-details-marker { display: none; }
.access-actions > summary:hover,
.access-actions[open] > summary { color: var(--text); background: var(--canvas); }
.access-actions__menu {
    position: absolute;
    z-index: 25;
    top: 38px;
    right: 0;
    width: 250px;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: 0 16px 40px rgba(25, 31, 35, 0.16);
}
.access-actions__menu form + form { margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.access-actions__menu label { font-size: 0.68rem; }
.access-actions__menu input { margin-bottom: 0.5rem; font-size: 0.75rem; }
.access-actions__menu .btn { width: 100%; }
.access-delete {
    width: 100%;
    padding: 0.35rem;
    color: var(--danger);
    background: transparent;
    border: 0;
    font: 600 0.72rem/1.4 inherit;
    text-align: left;
    cursor: pointer;
}
.access-delete:hover { color: #9f1515; }

.compact-form { padding: 1rem 1.15rem 1.2rem; }
.compact-form > div { margin-bottom: 0.85rem; }
.compact-form label { font-size: 0.72rem; }
.compact-form input,
.compact-form select { font-size: 0.78rem; }
.compact-form .btn { width: 100%; margin-top: 0.2rem; }

.activity-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}
.activity-toolbar > span { color: var(--text-faint); font-size: 0.68rem; }
.activity-tabs { display: inline-flex; gap: 0.2rem; padding: 0.2rem; background: #e8ecee; border-radius: 6px; }
.activity-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.65rem;
    color: var(--text-muted);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
}
.activity-tabs a span { color: var(--text-faint); }
.activity-tabs a.is-active { color: var(--text); background: #fff; box-shadow: 0 1px 2px rgba(25, 31, 35, 0.08); }

.activity-feed {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 0.8rem;
    min-height: 72px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item.is-unread { background: #f8fcfc; }
.activity-item.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.activity-item__icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #5e6b73;
    background: #eff2f3;
}
.activity-item__icon--domain_ok,
.activity-item__icon--delisted,
.activity-item__icon--smtp_ok { color: var(--success); background: var(--success-soft); }
.activity-item__icon--domain_bad,
.activity-item__icon--blacklist,
.activity-item__icon--smtp_bad { color: var(--danger); background: var(--danger-soft); }
.activity-item__body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; }
.activity-item__body strong,
.activity-item__body span { display: block; }
.activity-item__body strong { color: #384148; font-size: 0.75rem; font-weight: 550; line-height: 1.45; }
.activity-item.is-unread .activity-item__body strong { color: var(--text); font-weight: 650; }
.activity-item__body span { margin-top: 0.12rem; color: var(--text-faint); font-size: 0.64rem; }
.activity-item__body time { flex: 0 0 auto; color: var(--text-faint); font-size: 0.65rem; white-space: nowrap; }
.activity-read {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.activity-read span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.activity-read:hover { background: var(--primary-soft); }
.activity-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; }
.activity-empty__icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.7rem; color: var(--success); background: var(--success-soft); border-radius: 50%; }
.activity-empty strong { color: var(--text); font-size: 0.85rem; }
.activity-empty > span:last-child { margin-top: 0.2rem; font-size: 0.7rem; }
.activity-more-wrap { display: flex; justify-content: center; padding: 1rem 0; }

.freshness--failed::before { background: var(--danger); }
.collection-time { display: block; margin-top: 0.15rem; color: var(--text-faint); font-size: 0.62rem; white-space: nowrap; }

/* Make legacy data-entry pages feel like operational forms, not floating cards. */
.form-container {
    max-width: 780px;
    border: 0;
    box-shadow: 0 8px 28px rgba(28, 37, 43, 0.05);
}
.form-container input,
.form-container select,
.form-container textarea { min-height: 40px; }
.form-container label { color: #465159; font-size: 0.75rem; }

.editor-panel {
    max-width: 1040px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(28, 37, 43, 0.05);
}
.editor-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.editor-panel__head h3 { margin: 0 0 0.12rem; font-size: 0.9rem; }
.editor-panel__head p,
.editor-panel__head > span { margin: 0; color: var(--text-faint); font-size: 0.66rem; }
.editor-form { padding: 0 1.25rem; }
.editor-section {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.3rem 0;
    border-bottom: 1px solid var(--border);
}
.editor-section__title strong,
.editor-section__title span { display: block; }
.editor-section__title strong { font-size: 0.76rem; }
.editor-section__title span { max-width: 170px; margin-top: 0.2rem; color: var(--text-faint); font-size: 0.64rem; line-height: 1.45; }
.editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}
.editor-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-grid label,
.editor-form--single label { color: #465159; font-size: 0.7rem; }
.editor-grid input,
.editor-grid select,
.editor-form--single textarea { min-height: 40px; font-size: 0.78rem; }
.editor-form--single { padding-top: 1.2rem; }
.editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}
.editor-actions > a:not(.btn) { color: var(--text-muted); text-decoration: none; font-size: 0.72rem; }
.editor-delete-trigger {
    padding: 0.45rem 0;
    color: var(--danger);
    background: transparent;
    border: 0;
    font: 600 0.72rem/1.4 inherit;
    cursor: pointer;
}
.editor-delete-trigger:hover { color: #9f1515; }

@media (max-width: 980px) {
    .access-layout { grid-template-columns: 1fr; }
    .access-create { max-width: none; }
}

@media (max-width: 700px) {
    .access-row { grid-template-columns: minmax(0, 1fr) 36px; padding: 0.8rem 0; gap: 0.65rem; }
    .access-role-form { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; padding-left: 48px; }
    .access-actions { grid-column: 2; grid-row: 1; }
    .activity-item { grid-template-columns: 34px minmax(0, 1fr) 24px; padding: 0.75rem; gap: 0.6rem; }
    .activity-item__body { display: block; }
    .activity-item__body time { display: block; margin-top: 0.25rem; }
    .editor-section { grid-template-columns: 1fr; gap: 0.75rem; }
    .editor-section__title span { max-width: none; }
    .editor-grid, .editor-grid--two { grid-template-columns: 1fr; }
    .charts-grid--dashboard,
    .charts-grid--insights-donuts { gap: 0.65rem; }
    .chart-card--dashboard-chart,
    .chart-card--insights-donut { padding: 0.75rem 0.85rem; }
    .chart-card--dashboard-chart .chart-card__head {
        min-height: 1.5rem;
        margin-bottom: 0.15rem;
    }
    .chart-card--dashboard-chart .chart-card__hint--dash,
    .chart-card--insights-donut .chart-card__hint--insights-donut {
        min-height: 0;
        margin-bottom: 0.25rem;
        font-size: 0.65rem;
    }
    .chart-card--dashboard-chart .chart-wrap,
    .chart-card--insights-donut .chart-wrap {
        height: 108px;
        min-height: 108px;
    }
}

@media (max-width: 350px) {
    .stat-tile-grid--dash { grid-template-columns: 1fr; }
}

/* Keyboard and reduced-motion support */
.skip-link {
    position: fixed;
    left: 1rem;
    top: 0.75rem;
    z-index: 1000;
    padding: 0.55rem 0.8rem;
    border-radius: 5px;
    background: #ffffff;
    color: #20262b;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #0e8793;
    outline-offset: 2px;
}

th[data-sort-column] {
    cursor: pointer;
}

th[data-sort-column]:focus-visible,
.table-responsive:focus-visible {
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ----- Admin finances ----- */
.command-page-head--finance {
    align-items: center;
}

.finance-private {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    padding: 0.42rem 0.62rem;
    color: #465159;
    background: #f4f7f8;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 650;
}

.finance-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.finance-kpi {
    min-width: 0;
    padding: 1rem 1.05rem;
    border-right: 1px solid var(--border);
}

.finance-kpi:last-child {
    border-right: 0;
}

.finance-kpi > span,
.finance-kpi > strong,
.finance-kpi > small {
    display: block;
}

.finance-kpi > span {
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 650;
    line-height: 1.35;
}

.finance-kpi > strong {
    margin-top: 0.28rem;
    color: var(--text);
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    line-height: 1.15;
}

.finance-kpi > small {
    min-height: 1.9em;
    margin-top: 0.32rem;
    color: var(--text-faint);
    font-size: 0.61rem;
    line-height: 1.45;
}

.finance-kpi--revenue {
    box-shadow: inset 0 3px 0 #0891b2;
}

.finance-kpi--cost {
    box-shadow: inset 0 3px 0 #e07a2f;
}

.finance-kpi--tax {
    box-shadow: inset 0 3px 0 #b45353;
}

.finance-kpi--profit,
.finance-kpi--annual,
.finance-kpi--margin {
    box-shadow: inset 0 3px 0 #16865b;
}

.finance-kpi.is-negative {
    box-shadow: inset 0 3px 0 var(--danger);
}

.finance-kpi.is-positive > strong {
    color: #126b4b;
}

.finance-kpi.is-negative > strong {
    color: var(--danger);
}

.finance-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.finance-facts > div {
    min-width: 0;
    padding: 0.15rem 1rem;
    border-right: 1px solid var(--border);
}

.finance-facts > div:first-child {
    padding-left: 0;
}

.finance-facts > div:last-child {
    border-right: 0;
}

.finance-facts span,
.finance-facts strong,
.finance-facts small {
    display: block;
}

.finance-facts span {
    color: var(--text-muted);
    font-size: 0.63rem;
    font-weight: 600;
}

.finance-facts strong {
    margin-top: 0.15rem;
    font-size: 0.85rem;
}

.finance-facts small {
    margin-top: 0.08rem;
    color: var(--text-faint);
    font-size: 0.59rem;
    line-height: 1.4;
}

.finance-charts {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.finance-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.finance-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid var(--border);
}

.finance-panel__head h3 {
    margin: 0;
    font-size: 0.82rem;
}

.finance-panel__head p {
    margin: 0.18rem 0 0;
    color: var(--text-faint);
    font-size: 0.62rem;
    line-height: 1.45;
}

.finance-panel__head > span {
    flex: 0 0 auto;
    color: var(--text-faint);
    font-size: 0.6rem;
    font-weight: 650;
    text-transform: uppercase;
}

.finance-panel__head > a {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 0.66rem;
    font-weight: 650;
    text-decoration: none;
}

.finance-panel__head > a:hover {
    text-decoration: underline;
}

.finance-chart {
    position: relative;
    height: 230px;
    padding: 0.8rem 0.9rem 0.65rem;
}

.finance-chart--forecast {
    height: 285px;
}

.finance-tax-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
}

.finance-tax-formula {
    padding: 0.9rem 1rem;
    border-right: 1px solid var(--border);
}

.finance-tax-formula__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.55rem;
}

.finance-tax-formula__head strong {
    font-size: 0.7rem;
}

.finance-tax-formula__head span {
    color: var(--text-faint);
    font-size: 0.58rem;
}

.finance-tax-formula dl {
    margin: 0;
}

.finance-tax-formula dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.46rem 0;
    border-top: 1px solid var(--border);
}

.finance-tax-formula dt,
.finance-tax-formula dd {
    margin: 0;
    font-size: 0.67rem;
}

.finance-tax-formula dt {
    color: var(--text-muted);
}

.finance-tax-formula dd {
    flex: 0 0 auto;
    color: var(--text);
    font-weight: 650;
}

.finance-tax-formula .is-subtotal {
    color: var(--text);
    background: #f7f9fa;
}

.finance-tax-formula .is-subtotal dt,
.finance-tax-formula .is-subtotal dd,
.finance-tax-formula .is-total dt,
.finance-tax-formula .is-total dd {
    color: var(--text);
    font-weight: 700;
}

.finance-tax-formula .is-minimum dt,
.finance-tax-formula .is-minimum dd {
    color: #9b3f3f;
}

.finance-tax-formula .is-total {
    margin-top: 0.15rem;
    padding-top: 0.6rem;
    border-top-color: var(--border-strong);
}

.finance-tax-summary {
    padding: 0.9rem 1rem;
}

.finance-tax-summary__lead span,
.finance-tax-summary__lead strong,
.finance-tax-summary__lead small {
    display: block;
}

.finance-tax-summary__lead > span {
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 650;
}

.finance-tax-summary__lead > strong {
    margin-top: 0.2rem;
    color: #126b4b;
    font-size: 1.35rem;
}

.finance-tax-summary__lead.is-negative > strong {
    color: var(--danger);
}

.finance-tax-summary__lead > small {
    margin-top: 0.2rem;
    color: var(--text-faint);
    font-size: 0.6rem;
    line-height: 1.45;
}

.finance-tax-scenarios {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.85rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.finance-tax-scenarios > div {
    min-width: 0;
    padding: 0.7rem 0.7rem 0.7rem 0;
    border-right: 1px solid var(--border);
}

.finance-tax-scenarios > div:last-child {
    padding-left: 0.7rem;
    border-right: 0;
}

.finance-tax-scenarios span,
.finance-tax-scenarios strong,
.finance-tax-scenarios small {
    display: block;
}

.finance-tax-scenarios span {
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 650;
}

.finance-tax-scenarios strong {
    margin-top: 0.16rem;
    font-size: 0.88rem;
}

.finance-tax-scenarios small {
    margin-top: 0.12rem;
    color: var(--text-faint);
    font-size: 0.56rem;
    line-height: 1.4;
}

.finance-tax-explainer {
    padding-top: 0.72rem;
}

.finance-tax-explainer strong {
    font-size: 0.66rem;
}

.finance-tax-explainer p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.6rem;
    line-height: 1.5;
}

.finance-tax-examples {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.62rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.finance-tax-examples span {
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.4;
}

.finance-tax-examples strong {
    color: var(--text);
}

.finance-tax-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.62rem 1rem;
    color: #536069;
    background: #f4f7f8;
    border-top: 1px solid var(--border);
    font-size: 0.57rem;
    line-height: 1.45;
}

.finance-tax-note a {
    color: var(--primary);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.finance-tax-note a:hover {
    text-decoration: underline;
}

.finance-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
    gap: 0.75rem;
    align-items: start;
}

.finance-table {
    font-size: 0.72rem;
}

.finance-table th,
.finance-table td {
    padding: 0.68rem 0.8rem;
}

.finance-table td strong,
.finance-table td small {
    display: block;
}

.finance-table td small {
    margin-top: 0.12rem;
    color: var(--text-faint);
    font-size: 0.58rem;
}

.finance-table tfoot td {
    color: var(--text);
    background: #f7f9fa;
    border-top: 1px solid var(--border-strong);
    font-weight: 700;
}

.finance-edit-link {
    color: var(--primary);
    font-size: 0.66rem;
    font-weight: 650;
    text-decoration: none;
}

.finance-edit-link:hover {
    text-decoration: underline;
}

.finance-exclusion-note {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.65rem 0.8rem;
    color: #425059;
    background: #f2f7f7;
    border-top: 1px solid #dbe9e9;
    font-size: 0.62rem;
    line-height: 1.45;
}

.finance-exclusion-note strong {
    flex: 0 0 auto;
}

.finance-exclusion-note span {
    color: var(--text-muted);
}

.finance-form {
    padding: 0.2rem 1rem 0;
}

.finance-field {
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--border);
}

.finance-field label {
    display: block;
    margin-bottom: 0.35rem;
    color: #465159;
    font-size: 0.68rem;
    font-weight: 650;
}

.finance-field > small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-faint);
    font-size: 0.58rem;
    line-height: 1.4;
}

.finance-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 0.55rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    font-size: 0.7rem;
}

.money-input {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 38px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
}

.money-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.money-input > span {
    display: flex;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: #f4f7f8;
    border-right: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 650;
}

.money-input input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 0.76rem;
}

.money-input input:focus {
    outline: 0;
    box-shadow: none;
}

.money-input em {
    padding-right: 0.55rem;
    color: var(--text-faint);
    font-size: 0.58rem;
    font-style: normal;
    white-space: nowrap;
}

.finance-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
}

.finance-form__footer > small {
    color: var(--text-faint);
    font-size: 0.57rem;
}

@media (max-width: 1180px) {
    .finance-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-kpi {
        border-bottom: 1px solid var(--border);
    }

    .finance-kpi:nth-child(3) {
        border-right: 0;
    }

    .finance-kpi:nth-child(4),
    .finance-kpi:nth-child(5),
    .finance-kpi:nth-child(6) {
        border-bottom: 0;
    }

    .finance-kpi:nth-child(6) {
        border-right: 0;
    }

    .finance-detail-layout {
        grid-template-columns: 1fr;
    }

    .finance-panel--assumptions {
        max-width: none;
    }

    .finance-tax-layout {
        grid-template-columns: 1fr;
    }

    .finance-tax-formula {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 780px) {
    .finance-private {
        margin-top: 0.7rem;
    }

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

    .finance-kpi,
    .finance-kpi:nth-child(3) {
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .finance-kpi:nth-child(even) {
        border-right: 0;
    }

    .finance-kpi:nth-child(5),
    .finance-kpi:nth-child(6) {
        border-bottom: 0;
    }

    .finance-kpi:last-child {
        border-right: 0;
    }

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

    .finance-facts > div {
        padding: 0.45rem 0.65rem;
    }

    .finance-facts > div:first-child {
        padding-left: 0.65rem;
    }

    .finance-facts > div:nth-child(2) {
        border-right: 0;
    }

    .finance-facts > div:nth-child(-n+2) {
        border-bottom: 1px solid var(--border);
    }

    .finance-charts {
        grid-template-columns: 1fr;
    }

    .finance-chart {
        height: 215px;
    }

    .finance-chart--forecast {
        height: 260px;
    }

    .finance-exclusion-note {
        display: block;
    }

    .finance-exclusion-note span {
        display: block;
        margin-top: 0.15rem;
    }

    .finance-tax-note {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .finance-kpi {
        padding: 0.82rem;
    }

    .finance-kpi > strong {
        font-size: 1.12rem;
    }

    .finance-panel__head {
        display: block;
    }

    .finance-panel__head > span,
    .finance-panel__head > a {
        display: inline-block;
        margin-top: 0.35rem;
    }

    .finance-chart {
        padding: 0.55rem 0.4rem 0.45rem;
    }

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

    .finance-form__footer .btn {
        width: 100%;
    }

    .finance-tax-formula__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .finance-tax-scenarios {
        grid-template-columns: 1fr;
    }

    .finance-tax-scenarios > div {
        padding-right: 0;
        border-right: 0;
    }

    .finance-tax-scenarios > div:last-child {
        padding-left: 0;
        border-top: 1px solid var(--border);
    }

    .finance-panel--renewals .table-responsive {
        contain: inline-size;
    }

    .finance-table {
        table-layout: fixed;
    }

    .finance-table .finance-col-monthly,
    .finance-table .finance-col-edit {
        display: none;
    }

    .finance-table th:first-child {
        width: 38%;
    }

    .finance-table th:nth-child(2) {
        width: 24%;
    }

    .finance-table th:nth-child(3) {
        width: 38%;
    }

    .finance-table td:first-child strong {
        overflow-wrap: anywhere;
    }
}
