:root {
    --page-background: #f4f7f6;
    --surface: #ffffff;
    --surface-soft: #f8faf9;

    --sidebar: #10241e;
    --sidebar-hover: #19372e;

    --primary: #0d7654;
    --primary-soft: #e5f4ed;
    --primary-strong: #085b40;

    --text: #17241f;
    --text-soft: #445048;
    --muted: #6c7b75;
    --muted-soft: #9ab0a7;

    --border: #e1e8e5;
    --border-strong: #cbd7d1;

    --success: #14825c;
    --success-soft: #e2f5ed;
    --warning: #b27a18;
    --warning-soft: #fff2d9;
    --danger: #c64a4a;
    --danger-soft: #fce7e7;
    --danger-border: #f3caca;
    --info: #1d5fae;
    --info-soft: #e7f0fb;

    /* Categorical chart series — validated for CVD/contrast, see dataviz palette check */
    --chart-1: #1baf7a;
    --chart-2: #2a78d6;
    --chart-3: #eb6834;

    --shadow:
        0 10px 35px rgba(25, 48, 40, 0.06);

    --sidebar-width: 260px;
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;

    font-family: "Inter", sans-serif;

    background: var(--page-background);
    color: var(--text);
}


a {
    color: inherit;
}


.app-shell {
    min-height: 100vh;
}


.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    padding: 26px 18px;

    background: var(--sidebar);
    color: white;

    transition: transform 0.25s ease;
}


.sidebar-overlay {
    display: none;
}


.sidebar-toggle,
.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;

    color: var(--text-soft);
    background: var(--surface);

    cursor: pointer;
}


.sidebar-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
}


.sidebar-toggle svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
}


.sidebar-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-left: auto;

    border-color: rgba(255, 255, 255, 0.14);
    color: #c8d7d2;
    background: transparent;
}


.sidebar-close svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 10px 30px;
}


.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 19px;
    font-weight: 800;
}


.brand-title {
    font-size: 17px;
    font-weight: 700;
}


.brand-subtitle {
    margin-top: 3px;

    color: #9ab2a9;

    font-size: 11px;
}


.sidebar-navigation {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 12px 13px;

    border-radius: 10px;

    color: #c8d7d2;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;
}


.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: white;
}


.sidebar-link.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}


.sidebar-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;
}


.sidebar-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}


.sidebar-section-label {
    margin: 25px 13px 8px;

    color: #81978f;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: auto;
    padding: 16px 12px 2px;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}


.system-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #4cc995;
}


.system-status-title {
    font-size: 11px;
    font-weight: 600;
}


.system-status-text {
    margin-top: 3px;

    color: #91a99f;

    font-size: 10px;
}


.main-area {
    min-height: 100vh;

    margin-left: var(--sidebar-width);
}


.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 25px 32px;

    border-bottom: 1px solid var(--border);

    background: rgba(255, 255, 255, 0.92);
}


.topbar-heading {
    min-width: 0;
}


.page-title {
    margin: 0;

    font-size: 24px;
    font-weight: 700;
}


.page-subtitle {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}


.date-badge {
    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: white;
    color: var(--muted);

    font-size: 12px;
}


.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border-radius: 50%;

    background: var(--primary);
    color: white;

    font-size: 13px;
    font-weight: 700;
}


.page-container {
    padding: 30px 32px 45px;
}


.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;
}


.welcome-section h2 {
    margin: 0;

    font-size: 20px;
}


.welcome-section p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.last-updated {
    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: white;
    color: var(--muted);

    font-size: 11px;
}


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


.kpi-grid-five {
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
}


.kpi-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);

    box-shadow: var(--shadow);
}


.kpi-card {
    padding: 20px;
}


.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.kpi-label {
    color: var(--muted);

    font-size: 12px;
    font-weight: 600;
}


.kpi-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 8px;

    background: var(--primary-soft);
    color: var(--primary);
}


.kpi-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}


.kpi-value {
    margin-top: 15px;

    font-size: 31px;
    font-weight: 700;

    line-height: 1;
}


.kpi-description {
    margin-top: 9px;

    color: var(--muted);

    font-size: 11px;
}


.dashboard-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);
    gap: 18px;

    margin-top: 18px;
    margin-bottom: 18px;
}


.panel {
    padding: 22px;
}


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


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}


.panel-header h3 {
    margin: 0;

    font-size: 15px;
}


.panel-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 11px;
}


.channel-list,
.rate-summary,
.system-log-list {
    margin-top: 17px;
}


.channel-row,
.rate-item,
.system-log-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}


.channel-row:last-child,
.rate-item:last-child,
.system-log-row:last-child {
    border-bottom: 0;
}


.channel-row div:first-child,
.system-log-row div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.channel-row strong,
.system-log-row strong {
    font-size: 12px;
}


.channel-row span,
.system-log-row span {
    color: var(--muted);

    font-size: 10px;
}


.channel-number {
    font-size: 17px;
    font-weight: 700;
}


.rate-item span {
    color: var(--muted);

    font-size: 11px;
}


.rate-item strong {
    font-size: 13px;
}


.chart-wrapper {
    position: relative;

    height: 330px;
    margin-top: 18px;
}


.log-status {
    padding: 5px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


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


.log-status.warning,
.status-warning {
    background: var(--warning-soft);
    color: var(--warning);
}


.log-status.failed,
.status-failed {
    background: var(--danger-soft);
    color: var(--danger);
}


.status-success {
    color: var(--success);
}


.table-scroll {
    width: 100%;
    margin-top: 18px;

    overflow-x: auto;
}


.dashboard-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 12px;
}


.dashboard-table th {
    padding: 12px 13px;

    border-bottom: 1px solid var(--border);

    background: var(--surface-soft);
    color: var(--muted);

    font-size: 10px;
    font-weight: 700;

    text-align: left;
    text-transform: uppercase;

    white-space: nowrap;
}


.dashboard-table td {
    padding: 14px 13px;

    border-bottom: 1px solid var(--border);

    vertical-align: top;
}


.dashboard-table tbody tr:hover {
    background: var(--surface-soft);
}


.dashboard-table td:first-child {
    min-width: 250px;
}


.table-subtext {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
}


.empty-state {
    padding: 30px;

    color: var(--muted);

    font-size: 12px;
    text-align: center;
}


@media (max-width: 1250px) {
    .kpi-grid-five {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


@media (max-width: 1050px) {
    .kpi-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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


@media (max-width: 760px) {
    .main-area {
        margin-left: 0;
    }

    .sidebar {
        width: min(82vw, 300px);

        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 39;

        display: block;

        background: rgba(9, 18, 15, 0.45);
        opacity: 0;

        transition: opacity 0.2s ease;

        pointer-events: none;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar,
    .page-container {
        padding-left: 18px;
        padding-right: 18px;
    }

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

    .date-badge,
    .user-account-details {
        display: none;
    }

    .welcome-section {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .kpi-grid,
    .kpi-grid-five {
        grid-template-columns: 1fr;
    }
}


@media (min-width: 761px) {
    .sidebar-close {
        display: none !important;
    }
}



.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}


.period-filter {
    display: flex;
    align-items: center;
    padding: 3px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}


.period-button {
    padding: 7px 10px;

    border-radius: 7px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

    text-decoration: none;
}


.period-button:hover {
    color: var(--primary);
}


.period-button.active {
    background: var(--primary-soft);
    color: var(--primary);
}


.source-chart-wrapper {
    height: 260px;
}


.source-highlight {
    display: flex;
    flex-direction: column;
    align-items: center;

    margin-top: 15px;
    padding-top: 15px;

    border-top: 1px solid var(--border);
}


.source-highlight span {
    color: var(--muted);

    font-size: 10px;
}


.source-highlight strong {
    margin-top: 5px;

    font-size: 15px;
}


.source-highlight small {
    margin-top: 4px;

    color: var(--muted);
}


.table-link {
    display: block;

    max-width: 500px;
    margin-top: 5px;

    overflow: hidden;

    color: var(--primary);

    font-size: 9px;

    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.table-link:hover {
    text-decoration: underline;
}


.collector-error {
    margin-top: 16px;
    padding: 12px;

    border: 1px solid var(--danger-border);
    border-radius: 9px;

    background: var(--danger-soft);
    color: var(--danger);

    font-size: 10px;
    line-height: 1.5;
}


@media (max-width: 900px) {
    .dashboard-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.sc-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.sc-header h1 {
    margin: 4px 0 8px;
    font-size: 32px;
    line-height: 1.2;
    color: var(--text);
}

.sc-eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.sc-description {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.sc-period-filter {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
}

.sc-period-filter a {
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.sc-period-filter a:hover {
    background: var(--surface-soft);
}

.sc-period-filter a.active {
    color: #ffffff;
    background: var(--primary);
}

.sc-date-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

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

.sc-kpi-card {
    display: flex;
    flex-direction: column;
    min-height: 145px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.sc-kpi-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.sc-kpi-card strong {
    margin-top: 15px;
    color: var(--text);
    font-size: 30px;
    line-height: 1;
}

.sc-kpi-note {
    margin-top: auto;
    padding-top: 14px;
    color: var(--muted-soft);
    font-size: 12px;
}

.sc-chart-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(300px, 1fr);
    gap: 20px;
}

.sc-panel {
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.sc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.sc-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.sc-panel-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.sc-chart-wrapper {
    position: relative;
    height: 320px;
}

.sc-split-charts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 4px;
}

.sc-mini-chart-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.sc-mini-chart-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sc-mini-chart-dot-clicks {
    background: var(--chart-1);
}

.sc-mini-chart-dot-impressions {
    background: var(--chart-2);
}

.sc-mini-chart-wrapper {
    position: relative;
    height: 138px;
}

.sc-table-panel {
    padding: 0;
}

.sc-table-panel .sc-panel-header {
    padding: 22px 22px 0;
}

.sc-table-wrapper {
    overflow-x: auto;
}

.sc-table {
    width: 100%;
    border-collapse: collapse;
}

.sc-table th {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.sc-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--surface-soft);
    color: var(--text-soft);
    font-size: 13px;
    vertical-align: middle;
}

.sc-table tbody tr:last-child td {
    border-bottom: 0;
}

.sc-table tbody tr:hover {
    background: var(--surface-soft);
}

.sc-query-cell {
    max-width: 340px;
    color: var(--text) !important;
    font-weight: 600;
}

.sc-page-cell {
    min-width: 320px;
    max-width: 500px;
}

.sc-page-cell strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
}

.sc-page-cell a {
    display: block;
    overflow: hidden;
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.sc-status-grid > div {
    padding: 16px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.sc-status-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.sc-status-grid strong {
    color: var(--text);
    font-size: 14px;
}

.sc-status {
    display: inline-flex !important;
    padding: 5px 10px;
    border-radius: 999px;
}

.sc-status-success {
    color: var(--success) !important;
    background: var(--success-soft);
}

.sc-status-warning {
    color: var(--warning) !important;
    background: var(--warning-soft);
}

.sc-status-failed {
    color: var(--danger) !important;
    background: var(--danger-soft);
}

.sc-status-running {
    color: var(--info) !important;
    background: var(--info-soft);
}

.sc-log-error {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 13px;
    white-space: pre-wrap;
}

.sc-empty {
    padding: 30px !important;
    color: var(--muted-soft) !important;
    text-align: center !important;
}

@media (max-width: 1100px) {
    .sc-kpi-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .sc-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .sc-header {
        flex-direction: column;
    }

    .sc-kpi-grid {
        grid-template-columns: 1fr;
    }

    .sc-period-filter {
        width: 100%;
    }

    .sc-period-filter a {
        flex: 1;
        text-align: center;
    }

    .sc-status-grid {
        grid-template-columns: 1fr;
    }

    .sc-header h1 {
        font-size: 27px;
    }
}

.overview-section-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-soft);
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.overview-section-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.overview-search-queries {
    margin-top: 26px;
}

.weekly-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.weekly-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.weekly-header h1 {
    margin: 5px 0 8px;
    color: var(--text);
    font-size: 30px;
}

.weekly-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.weekly-eyebrow {
    color: var(--primary) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.weekly-period {
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--text-soft);
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

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

.weekly-kpi-card {
    display: flex;
    flex-direction: column;
    min-height: 135px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.weekly-kpi-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.weekly-kpi-card strong {
    margin-top: 14px;
    color: var(--text);
    font-size: 30px;
}

.weekly-kpi-card small {
    margin-top: auto;
    padding-top: 12px;
    color: var(--muted-soft);
}

.weekly-kpi-card small.positive {
    color: var(--success);
}

.weekly-kpi-card small.negative {
    color: var(--danger);
}

.weekly-content-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);
    gap: 20px;
}

.weekly-panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.weekly-panel-header {
    margin-bottom: 20px;
}

.weekly-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.weekly-panel-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.weekly-recommendations {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.weekly-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.weekly-recommendation > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #ffffff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.weekly-recommendation p {
    margin: 2px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.weekly-details {
    display: grid;
    gap: 12px;
}

.weekly-details > div {
    padding: 14px;
    border-radius: 9px;
    background: var(--surface-soft);
}

.weekly-details span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.weekly-details strong {
    color: var(--text);
    font-size: 14px;
}

.weekly-history-panel {
    padding: 0;
    overflow: hidden;
}

.weekly-history-panel .weekly-panel-header {
    padding: 22px 22px 0;
}

.weekly-table-wrapper {
    overflow-x: auto;
}

.weekly-table {
    width: 100%;
    border-collapse: collapse;
}

.weekly-table th {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    background: var(--surface-soft);
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.weekly-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-soft);
    color: var(--text-soft);
    font-size: 13px;
}

.weekly-table a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

.weekly-status-grid > div {
    padding: 15px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.weekly-status-grid span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

.weekly-status {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
}

.weekly-status-success {
    color: var(--success) !important;
    background: var(--success-soft);
}

.weekly-status-failed {
    color: var(--danger) !important;
    background: var(--danger-soft);
}

.weekly-status-running {
    color: var(--info) !important;
    background: var(--info-soft);
}

.weekly-empty {
    color: var(--muted-soft);
    text-align: center;
}

@media (max-width: 1100px) {
    .weekly-kpi-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .weekly-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .weekly-header {
        flex-direction: column;
    }

    .weekly-kpi-grid {
        grid-template-columns: 1fr;
    }

    .weekly-status-grid {
        grid-template-columns: 1fr;
    }
}

.health-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.health-header h1 {
    margin: 5px 0 8px;
    color: var(--text);
    font-size: 30px;
}

.health-header p {
    margin: 0;
    color: var(--muted);
}

.health-eyebrow {
    color: var(--primary) !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.health-overall {
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

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

.health-overall-failed {
    color: var(--danger);
    background: var(--danger-soft);
}

.health-overall-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.health-overall-no_data {
    color: var(--text-soft);
    background: var(--surface-soft);
}

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

.health-kpi-card {
    display: flex;
    flex-direction: column;
    min-height: 135px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.health-kpi-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.health-kpi-card strong {
    margin-top: 14px;
    color: var(--text);
    font-size: 30px;
}

.health-kpi-card small {
    margin-top: auto;
    padding-top: 12px;
    color: var(--muted-soft);
}

.health-date-value {
    font-size: 20px !important;
}

.health-panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.health-panel-header {
    margin-bottom: 20px;
}

.health-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.health-panel-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

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

.health-module-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.health-module-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.health-module-top h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.health-module-top span {
    display: block;
    margin-top: 5px;
    color: var(--muted-soft);
    font-size: 11px;
}

.health-status {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
}

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

.health-status-failed {
    color: var(--danger);
    background: var(--danger-soft);
}

.health-status-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.health-status-running {
    color: var(--info);
    background: var(--info-soft);
}

/* Skipped, waiting or not run: neutral, neither success nor a problem. */
.health-status-skipped {
    color: var(--muted);
    background: var(--surface-soft);
    box-shadow: inset 0 0 0 1px var(--border);
}

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

.health-module-details > div {
    padding: 12px;
    border-radius: 8px;
    background: #ffffff;
}

.health-module-details span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
}

.health-module-details strong {
    color: var(--text);
    font-size: 13px;
}

.health-error {
    max-height: 130px;
    overflow-y: auto;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 12px;
    white-space: pre-wrap;
}

.health-empty {
    padding: 30px;
    color: var(--muted-soft);
    text-align: center;
}

@media (max-width: 1000px) {
    .health-kpi-grid,
    .health-module-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .health-header {
        flex-direction: column;
    }

    .health-kpi-grid,
    .health-module-grid,
    .health-module-details {
        grid-template-columns: 1fr;
    }
}

.user-account {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-account-details {
    display: flex;
    flex-direction: column;
}

.user-account-details strong {
    color: var(--text);
    font-size: 13px;
}

.user-account-details span {
    margin-top: 2px;
    color: var(--muted-soft);
    font-size: 11px;
}

.logout-button {
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-soft);
    background: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.logout-button:hover {
    color: var(--danger);
    border-color: var(--danger-border);
    background: var(--danger-soft);
}


/* Login page */

.login-body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--page-background);
    font-family: "Inter", sans-serif;
}

.login-page {
    display: grid;
    grid-template-columns:
        minmax(360px, 0.9fr)
        minmax(460px, 1.1fr);
    min-height: 100vh;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #ffffff;
    background: #082c24;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 22px;
    font-weight: 700;
}

.login-brand strong {
    display: block;
    font-size: 18px;
}

.login-brand span {
    display: block;
    margin-top: 4px;
    color: #a9c8bf;
    font-size: 12px;
}

.login-brand-content {
    max-width: 500px;
    padding-bottom: 40px;
}

.login-eyebrow {
    color: #74d8b5 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.login-brand-content h1 {
    max-width: 480px;
    margin: 12px 0 18px;
    font-size: 42px;
    line-height: 1.15;
}

.login-brand-content > p:last-child {
    margin: 0;
    color: #c4d8d2;
    font-size: 15px;
    line-height: 1.8;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 18px 45px rgba(16, 24, 40, 0.08);
}

.login-card-header {
    margin-bottom: 28px;
}

.login-card-header h2 {
    margin: 0;
    font-size: 27px;
}

.login-card-header p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.login-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    outline: none;
    color: var(--text);
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
}

.login-field input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px rgba(13, 118, 84, 0.14);
}

.login-button {
    width: 100%;
    margin-top: 6px;
    padding: 13px;
    border: 0;
    border-radius: 9px;
    color: #ffffff;
    background: var(--primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-button:hover {
    background: var(--primary-strong);
}

.login-error {
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 13px;
}

.login-security-note {
    margin: 22px 0 0;
    color: var(--muted-soft);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 850px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: 240px;
        padding: 30px;
    }

    .login-brand-content {
        padding: 40px 0 0;
    }

    .login-brand-content h1 {
        font-size: 30px;
    }

    .login-form-panel {
        padding: 30px 20px;
    }

    .user-account-details {
        display: none;
    }
}

/* Website Analytics: custom date range and secondary GA4 metrics */
.date-range-form {
    gap: 6px;
    padding: 3px 3px 3px 10px;
}

.date-range-form label {
    display: flex;
    align-items: center;
    gap: 5px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;
}

.date-range-form input {
    padding: 5px 6px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface);
    color: var(--text);

    font: inherit;
    font-size: 10px;
}

.date-range-form button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.metric-strip-panel {
    margin-top: 18px;
    padding: 14px 22px;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.metric-strip .rate-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

@media (max-width: 1100px) {
    .dashboard-toolbar {
        flex-wrap: wrap;
    }

    .metric-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dashboard-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-toolbar .last-updated,
.dashboard-toolbar .period-button {
    white-space: nowrap;
}

/* Search Console: custom range, data availability and notes */
.sc-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.sc-date-form {
    align-items: center;
    padding-left: 10px;
}

.sc-date-form label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.sc-date-form input {
    padding: 5px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.sc-date-form button {
    padding: 8px 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

.sc-date-form button:hover {
    background: var(--surface-soft);
}

.sc-date-form button.active {
    color: #ffffff;
    background: var(--primary);
}

.sc-freshness-line {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
}

.sc-freshness-pending {
    color: var(--muted);
    font-weight: 500;
}

.sc-status-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.sc-details {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.sc-details summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.sc-details[open] summary {
    margin-bottom: 16px;
}

.sc-details-notes {
    margin: 16px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.sc-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.sc-panel .sc-note {
    margin-top: 12px;
}

.sc-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sc-status-grid strong {
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .sc-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .sc-toolbar {
        width: 100%;
        align-items: stretch;
    }

    .sc-date-form {
        flex-wrap: wrap;
    }

    .sc-date-form label {
        flex: 1 1 130px;
    }

    .sc-date-form input {
        width: 100%;
    }

    .sc-status-grid {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------ */
/* Content Intelligence                                                */
/* ------------------------------------------------------------------ */

.ci-notice {
    margin-bottom: 18px;
}

.ci-status {
    margin: 14px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.ci-status p {
    margin: 0;
}

.ci-status strong {
    color: var(--text-soft);
    font-weight: 600;
}

.ci-status-windows {
    margin-top: 2px !important;
    font-size: 12px;
}

a.ci-card {
    color: inherit;
    text-decoration: none;
}

.ci-card-declining strong { color: var(--danger); }
.ci-card-seo strong { color: var(--warning); }
.ci-card-growing strong { color: var(--success); }

.ci-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.ci-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ci-item {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.ci-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.ci-item-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ci-item-title h3 {
    margin: 0;
    font-size: 15px;
}

.ci-item-title a,
.ci-path {
    color: var(--primary);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.ci-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.ci-signal,
.ci-action {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ci-action {
    border: 1px solid var(--primary);
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 12px;
}

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

.ci-key-metrics div {
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.ci-key-metrics dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.ci-key-metrics dd {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    margin: 3px 0 0;
}

.ci-key-metrics strong {
    color: var(--text);
    font-size: 16px;
}

.ci-key-metrics span {
    color: var(--muted);
    font-size: 11px;
}

.ci-item-details {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.ci-item-details summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.ci-item-details .sc-table-wrapper {
    margin-top: 10px;
}

.ci-detail-meta {
    margin: 8px 0 0;
}

.ci-signal-declining { background: var(--danger-soft); color: var(--danger); }
.ci-signal-seo-opportunity { background: var(--warning-soft); color: var(--warning); }
.ci-signal-growing { background: var(--success-soft); color: var(--success); }
.ci-signal-insufficient-data,
.ci-signal-no-strong-signal { background: var(--primary-soft); color: var(--primary); }

.ci-indexing {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

.ci-metrics th,
.ci-metrics td,
.ci-compact th,
.ci-compact td {
    padding: 8px 12px;
}

.ci-reason,
.ci-secondary {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

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

.ci-why {
    min-width: 260px;
    font-size: 12px;
}

.ci-more {
    margin: 14px 0 0;
    font-size: 13px;
}

.ci-details {
    margin-top: 18px;
}

.ci-details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .ci-key-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ci-item-top {
        flex-direction: column;
    }

    .ci-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .ci-item {
        padding: 14px;
    }

    .sc-period-filter.ci-filter {
        flex-wrap: wrap;
    }

    .ci-metrics th,
    .ci-metrics td {
        padding: 7px 8px;
        white-space: normal;
    }
}


/* Collection control ("Fetch latest data") in the dashboard header */

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

.collection-control {
    position: relative;
}

.collection-control[hidden] {
    display: none;
}

.collection-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.collection-buttons {
    display: flex;
    align-items: stretch;
}

.collection-button,
.collection-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.collection-button {
    padding: 8px 12px;
    border-radius: 8px 0 0 8px;
    white-space: nowrap;
}

/* Shown instead of the text on narrow screens (see the media query). */
.collection-button-icon {
    display: none;
    font-size: 15px;
    line-height: 1;
}

.collection-toggle {
    padding: 8px 9px;
    border-left-color: rgba(255, 255, 255, 0.35);
    border-radius: 0 8px 8px 0;
}

.collection-button:hover:not(:disabled),
.collection-toggle:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

.collection-button:focus-visible,
.collection-toggle:focus-visible,
.collection-actions a:focus-visible,
.collection-actions button:focus-visible {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

.collection-button:disabled {
    border-color: var(--border-strong);
    background: var(--surface-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.collection-button:disabled + .collection-toggle {
    border-color: var(--border-strong);
    background: #ffffff;
    color: var(--text-soft);
}

.collection-spinner {
    display: none;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: collection-spin 0.8s linear infinite;
}

.collection-control[data-busy="true"] .collection-spinner {
    display: inline-block;
}

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

@media (prefers-reduced-motion: reduce) {
    .collection-spinner {
        animation: none;
    }
}

.collection-line {
    max-width: 280px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

.collection-line[data-tone="success"] {
    color: var(--success);
}

.collection-line[data-tone="warning"] {
    color: var(--warning);
}

.collection-line[data-tone="error"] {
    color: var(--danger);
}

.collection-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(360px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.collection-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
}

.collection-message[data-tone="success"] {
    background: var(--success-soft);
    color: var(--success);
}

.collection-message[data-tone="warning"] {
    background: var(--warning-soft);
    color: var(--warning);
}

.collection-message[data-tone="error"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.collection-message[data-tone="info"] {
    background: var(--info-soft);
    color: var(--info);
}

.collection-steps {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-steps:empty {
    display: none;
}

.collection-step {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}

.collection-step-label {
    color: var(--text);
}

.collection-step-error,
.collection-step-note {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.collection-step-status {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.collection-step-status[data-status="success"] {
    background: var(--success-soft);
    color: var(--success);
}

.collection-step-status[data-status="warning"],
.collection-step-status[data-status="skipped"] {
    background: var(--warning-soft);
    color: var(--warning);
}

/* A benign skip (nothing to do) is neutral, not a warning. */
.collection-step-status[data-status="skipped"][data-benign] {
    background: var(--surface-soft);
    color: var(--muted);
}

.collection-step-status[data-status="failed"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.collection-step-status[data-status="running"] {
    background: var(--info-soft);
    color: var(--info);
}

.collection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.collection-actions:empty {
    display: none;
}

.collection-actions a,
.collection-actions button {
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-soft);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.collection-actions .collection-primary-action {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.health-collections {
    margin-top: 22px;
}

.health-job-summary {
    display: block;
    margin-bottom: 8px;
}

.health-job-steps {
    display: grid;
    gap: 6px;
    min-width: 260px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
}

.health-job-steps li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.health-job-steps .health-status {
    flex-shrink: 0;
    padding: 2px 8px;
    font-size: 11px;
    white-space: nowrap;
}

.health-job-step-detail {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

/* Narrow screens: each collection becomes a card (the five-column
   table would hide the status and steps behind a sideways scroll). */
@media (max-width: 1100px) {
    .health-collections-table,
    .health-collections-table tbody,
    .health-collections-table tr,
    .health-collections-table td {
        display: block;
        width: 100%;
    }

    .health-collections-table thead {
        display: none;
    }

    .health-collections-table tr {
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }

    .health-collections-table tr:last-child {
        border-bottom: 0;
    }

    .health-collections-table tbody tr:hover {
        background: transparent;
    }

    .dashboard-table.health-collections-table td {
        min-width: 0;
        padding: 4px 0;
        border: 0;
    }

    .health-collections-table td[data-label] {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 10px;
    }

    .health-collections-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 76px;
        color: var(--muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .health-collections-table td[data-label="Steps"] {
        display: block;
        margin-top: 6px;
    }

    .health-collections-table td[data-label="Steps"]::before {
        display: block;
        margin-bottom: 6px;
    }

    .health-collections-table .health-job-steps {
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .collection-line {
        display: none;
    }

    .collection-button {
        padding: 8px 8px;
    }

    .collection-toggle {
        padding: 8px 6px;
    }

    /* Icon-only button; the text stays available to screen readers. */
    .collection-button-icon {
        display: inline;
    }

    .collection-control[data-busy="true"] .collection-button-icon {
        display: none;
    }

    .collection-button-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    /* Span the screen: anchored to the button it would run off the left
       edge. top stays auto, so it opens just below the control. */
    .collection-panel {
        position: fixed;
        top: auto;
        right: 16px;
        left: 16px;
        width: auto;
        margin-top: 8px;
    }

    /* Only when the control is shown (the header is otherwise unchanged):
       keep room for the page title; on very narrow screens the header
       actions wrap onto a second line instead of squeezing it. */
    .topbar:has(.collection-control) .topbar-heading {
        flex: 1 1 120px;
        min-width: 120px;
    }

    .topbar-actions:has(.collection-control) {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 8px;
    }
}
