
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;700;800&family=Noto+Sans:wght@400;500;700;800&display=swap');

:root {
    --font-sans: "Inter", "Noto Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --texture-opacity: 0.18;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    position: relative;
    isolation: isolate;
    margin: 0;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top left, rgba(255, 90, 122, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
    color: #eef2f7;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('/assets/texture.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: var(--texture-opacity);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

input,
button,
select,
textarea {
    font: inherit;
}

.container {
    max-width: 100%;
    min-height: 100%;
    margin: 0 auto;
    padding: 24px
}

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(255, 90, 122, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 26%),
        rgba(7, 10, 16, 0.72);
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.intro-overlay[data-visible='true'] {
    opacity: 1;
}

.intro-overlay.is-visible {
    visibility: visible;
    pointer-events: auto;
}

.intro-overlay:not(.is-visible) {
    pointer-events: none;
}

.intro-panel {
    width: min(100%, 620px);
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(14, 18, 25, 0.96), rgba(19, 23, 31, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.42);
    color: #eef2f7;
}

.intro-kicker {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: rgba(238, 242, 247, 0.62);
}

.intro-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.95;
}

.intro-copy {
    margin: 14px 0 0;
    max-width: 56ch;
    color: rgba(238, 242, 247, 0.8);
    line-height: 1.6;
    font-size: 1rem;
}

.intro-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
}

.intro-button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    font-weight: 800;
}

.intro-button--primary {
    background: linear-gradient(180deg, var(--accent), #e54967);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 90, 122, 0.28);
}

.pull-refresh {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 25;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 16px 0 12px;
    border-radius: 999px;
    background: rgba(14, 18, 25, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eef2f7;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translateX(-50%) translateY(0) scale(1);
    transition: opacity 120ms ease;
    pointer-events: none;
    will-change: transform, opacity;
}

.pull-refresh[hidden] {
    display: none;
}

.pull-refresh__orb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(238, 242, 247, 0.28);
    border-top-color: var(--accent);
    animation: cards-spin 0.8s linear infinite;
}

.pull-refresh__text {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Two-column layout: left sidebar narrow, right content flexible */
.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: stretch;
    min-height: calc(100dvh - 48px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-self: start;
}

.brand-row {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-height: 24px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.brand-mark img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.brand {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 800;
    font-family: "Bebas Neue", var(--font-sans);
    letter-spacing: 0.02em;
    display: inline-block;
    vertical-align: bottom;
    line-height: 1;
    transform: translateY(3px);
}

/* Search form styles */
.search-form {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    border-radius: 9999px;
    background: #202124;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 1px 2px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.search-panel {
    width: 100%;
    height: 40px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(167, 176, 190, 0.9);
    display: inline-flex;
    align-items: center;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0 16px 0 40px;
    /* left padding for icon */
    border: 0;
    box-sizing: border-box;
    border-radius: 9999px;
    background: transparent;
    color: #eef2f7;
    outline: none;
    box-shadow: none;
    appearance: none;
    font-size: 0.95rem;
    line-height: 1;
}

.search-input::placeholder {
    color: rgba(167, 176, 190, 0.55);
}

.search-input:focus {
    outline: none;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2f7;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.admin-link:hover,
.admin-link:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 90, 122, 0.12);
    border-color: rgba(255, 90, 122, 0.28);
    outline: none;
}

.content {
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.grid-shell {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.cards-loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: 3;
    background: linear-gradient(180deg, rgba(15, 17, 21, 0.18), rgba(15, 17, 21, 0.42));
    backdrop-filter: blur(4px) saturate(0.9);
    -webkit-backdrop-filter: blur(4px) saturate(0.9);
    border-radius: 16px;
}

.cards-loader[data-visible='true'] {
    opacity: 1;
}

.cards-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(167, 176, 190, 0.2);
    border-top-color: var(--accent);
    border-right-color: rgba(255, 255, 255, 0.65);
    animation: cards-spin 0.85s linear infinite;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 0 22px rgba(255, 90, 122, 0.12);
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0 36%, transparent 37%);
}

.grid-shell[aria-busy='true'] .grid {
    opacity: 0.34;
    filter: blur(1.6px) saturate(0.8);
    pointer-events: none;
}

.header {
    display: flex;
    gap: 8px;
    min-height: 32px;
    align-items: center;
}

.input,
.button,
.small {
    padding: 8px 12px;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: inherit;
}

.button {
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg, var(--accent), #e54967);
    color: #fff;
    font-weight: 700;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 3%;
}

.card {
    background: transparent;
    border-radius: 12px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 222px;
}

.card .title-wrap {
    width: 100%;
    text-align: center;
    padding: 6px 4px
}

.card .title {
    font-size: 0.85rem;
    margin: 0;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden
}

/* Footer below thumbnail: left-aligned title, same width as thumb */
.card .footer {
    width: 100%;
    max-width: 200px;
    /* match .card .thumb max-width */
    box-sizing: border-box;
    text-align: left;
    padding: 6px 8px 8px 6px;
}

.card .footer .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-size: 0.9rem;
}

.card .thumb {
    position: relative;
    width: 100%;
    max-width: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.98);
}

.card .thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    /* don't intercept pointer events so anchor receives clicks */
    pointer-events: none;
    z-index: 1;
}

/* Maintain 9:16 aspect ratio */
.thumb::before {
    content: '';
    display: block;
    padding-top: 177.78%;
}

.thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

/* Make the anchor cover the full thumbnail area so it's fully clickable */
.thumb a,
.thumb .thumb-link {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: inherit;
    z-index: 2;
    /* ensure anchor sits above overlay */
}

.thumb a img,
.thumb .thumb-link img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

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

.error {
    color: #ff8aa2
}

body.admin-page {
    background:
        radial-gradient(circle at top left, rgba(255, 90, 122, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 30%),
        linear-gradient(180deg, #0d1015 0%, #10141b 40%, #0b0d11 100%);
}

.admin-shell {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    padding: 24px 26px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(18, 20, 25, 0.96), rgba(24, 29, 38, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.admin-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.58);
}

.admin-title {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 0.95;
}

.admin-lead {
    margin: 12px 0 0;
    max-width: 68ch;
    color: rgba(238, 242, 247, 0.78);
    line-height: 1.55;
}

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

.refresh-btn,
.ghost-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.refresh-btn {
    background: linear-gradient(180deg, var(--accent), #e54967);
    color: #fff;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #eef2f7;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.refresh-btn:hover,
.refresh-btn:focus-visible,
.ghost-btn:hover,
.ghost-btn:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

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

.metric-card {
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: rgba(17, 20, 27, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
}

.metric-label {
    margin: 0 0 8px;
    color: rgba(238, 242, 247, 0.64);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-value {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    font-weight: 800;
}

.metric-subtitle {
    margin: 8px 0 0;
    color: rgba(238, 242, 247, 0.64);
    font-size: 0.92rem;
    line-height: 1.45;
}

.dashboard-panel {
    padding: 18px;
    border-radius: 24px;
    background: rgba(12, 15, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
}

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

.search-chip {
    min-width: min(100%, 360px);
    flex: 1 1 360px;
    padding: 0 16px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #eef2f7;
    outline: none;
}

.search-chip::placeholder {
    color: rgba(238, 242, 247, 0.48);
}

.dashboard-note {
    margin: 0;
    color: rgba(238, 242, 247, 0.62);
    font-size: 0.92rem;
}

.dashboard-status {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.dashboard-status[data-kind='error'] {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.26);
    color: #ffe4e4;
}

.dashboard-status[data-kind='info'] {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
    color: #e6f0ff;
}

.dashboard-status[data-kind='loading'] {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.32);
    color: #e2e8f0;
}
.table-shell {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: rgba(8, 11, 16, 0.78);
}

.stats-table th,
.stats-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
    text-align: left;
}

.stats-table th {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.stats-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stats-title {
    font-weight: 700;
    color: #fff;
    display: block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-meta,
.stats-link {
    color: rgba(238, 242, 247, 0.66);
    font-size: 0.9rem;
}

.stats-link {
    display: block;
    margin-top: 4px;
    word-break: break-word;
}

.stats-link a {
    color: inherit;
    text-decoration: none;
}

.stats-link a:hover,
.stats-link a:focus-visible {
    text-decoration: underline;
}

.row-action-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.42);
    background: rgba(239, 68, 68, 0.14);
    color: #ffe7e7;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.row-action-btn:hover,
.row-action-btn:focus-visible {
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.22);
    outline: none;
}

.row-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.stats-clicks {
    font-size: 1.1rem;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-pill[data-status='ok'] {
    background: rgba(16, 185, 129, 0.16);
    color: #c8f7e6;
}

.status-pill[data-status='pending'] {
    background: rgba(59, 130, 246, 0.14);
    color: #d8e9ff;
}

.status-pill[data-status='fallback'] {
    background: rgba(245, 158, 11, 0.16);
    color: #ffe8bf;
}

.status-pill[data-status='unconfigured'],
.status-pill[data-status='error'],
.status-pill[data-status='invalid'] {
    background: rgba(239, 68, 68, 0.14);
    color: #ffd4d4;
}

.empty-row {
    padding: 26px 16px;
    text-align: center;
    color: rgba(238, 242, 247, 0.72);
}

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

/* Detect device theme and apply appropriate colors */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --panel: #121417;
        --muted: #a7b0be;
        --accent: #ff5a7a;
        --texture-opacity: 0.07;
        color-scheme: dark;
    }

    body {
        background:
            radial-gradient(circle at top left, rgba(255, 90, 122, 0.2), transparent 30%),
            radial-gradient(circle at top right, rgba(99, 102, 241, 0.14), transparent 26%),
            linear-gradient(180deg, #0f1115 0%, #0b0d12 100%);
        color: #eef2f7
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --panel: #f6f7f9;
        --muted: #536277;
        --accent: #ff3f6c;
        --texture-opacity: 0.2;
        color-scheme: light;
    }

    body {
        background:
            radial-gradient(circle at 10% -4%, rgba(255, 75, 117, 0.34) 0%, rgba(255, 75, 117, 0.14) 28%, transparent 56%),
            radial-gradient(circle at 34% 0%, rgba(255, 176, 109, 0.2) 0%, rgba(255, 176, 109, 0.08) 20%, transparent 45%),
            radial-gradient(circle at 88% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.04) 22%, transparent 48%),
            linear-gradient(180deg, #fffefb 0%, #f8f3eb 100%);
        color: #0b1220;
    }

    .card .thumb {
        border: 0;
        box-shadow: 0 16px 36px rgba(11, 18, 32, 0.12), 0 4px 14px rgba(11, 18, 32, 0.08);
    }

    .card .thumb::after {
        border: 0;
    }

    .card .footer .title {
        color: #0b1220;
        text-shadow: none;
    }

    .search-form {
        height: 100%;
        min-height: 40px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(15, 23, 42, 0.14);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 1px 2px rgba(0, 0, 0, 0.35);
    }

    .search-icon {
        color: rgba(15, 23, 42, 0.42);
    }

    .search-input {
        height: 40px;
        color: #0f172a;
    }

    .search-input::placeholder {
        color: rgba(15, 23, 42, 0.4);
    }

    body.admin-page {
        background:
            radial-gradient(circle at 10% -4%, rgba(255, 128, 145, 0.24) 0%, rgba(255, 128, 145, 0.1) 24%, transparent 54%),
            radial-gradient(circle at 34% 0%, rgba(255, 176, 109, 0.2) 0%, rgba(255, 176, 109, 0.08) 20%, transparent 45%),
            radial-gradient(circle at 88% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.04) 22%, transparent 48%),
            linear-gradient(180deg, #fffefb 0%, #f8f3eb 100%);
        color: #0b1220;
    }

    .admin-hero {
        background: linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(252, 243, 231, 0.9));
        border-color: rgba(11, 18, 32, 0.12);
        box-shadow: 0 28px 72px rgba(11, 18, 32, 0.12);
    }

    .admin-kicker {
        color: rgba(11, 18, 32, 0.56);
    }

    .admin-title {
        color: #101827;
    }

    .admin-lead {
        color: rgba(15, 23, 42, 0.74);
    }

    .ghost-btn {
        background: rgba(255, 255, 255, 0.72);
        color: #0f172a;
        border-color: rgba(15, 23, 42, 0.16);
    }

    .metric-card {
        background: rgba(255, 255, 255, 0.86);
        border-color: rgba(11, 18, 32, 0.12);
        box-shadow: 0 16px 44px rgba(11, 18, 32, 0.1);
    }

    .metric-label {
        color: rgba(15, 23, 42, 0.52);
    }

    .metric-value {
        color: #0f172a;
    }

    .metric-subtitle {
        color: rgba(15, 23, 42, 0.6);
    }

    .dashboard-panel {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(11, 18, 32, 0.12);
        box-shadow: 0 24px 64px rgba(11, 18, 32, 0.12);
    }

    .search-chip {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(15, 23, 42, 0.14);
        color: #0f172a;
    }

    .search-chip::placeholder {
        color: rgba(15, 23, 42, 0.4);
    }

    .dashboard-note {
        color: rgba(15, 23, 42, 0.62);
    }

    .dashboard-status[data-kind='error'] {
        background: rgba(220, 38, 38, 0.1);
        border-color: rgba(220, 38, 38, 0.28);
        color: #7f1d1d;
    }

    .dashboard-status[data-kind='info'] {
        background: rgba(37, 99, 235, 0.1);
        border-color: rgba(37, 99, 235, 0.24);
        color: #1e3a8a;
    }

    .dashboard-status[data-kind='loading'] {
        background: rgba(148, 163, 184, 0.16);
        border-color: rgba(100, 116, 139, 0.28);
        color: #334155;
    }

    .table-shell {
        border-color: rgba(15, 23, 42, 0.12);
    }

    .stats-table {
        background: rgba(255, 255, 255, 0.92);
    }

    .stats-table th,
    .stats-table td {
        border-bottom-color: rgba(15, 23, 42, 0.1);
    }

    .stats-table th {
        color: #0f172a;
        background: rgba(15, 23, 42, 0.06);
    }

    .stats-table tbody tr:hover {
        background: rgba(15, 23, 42, 0.04);
    }

    .stats-title {
        color: #0f172a;
    }

    .stats-meta,
    .stats-link,
    .empty-row {
        color: rgba(15, 23, 42, 0.66);
    }

    .status-pill[data-status='ok'] {
        background: rgba(16, 185, 129, 0.16);
        color: #065f46;
    }

    .status-pill[data-status='pending'] {
        background: rgba(59, 130, 246, 0.14);
        color: #1e3a8a;
    }

    .status-pill[data-status='fallback'] {
        background: rgba(245, 158, 11, 0.2);
        color: #92400e;
    }

    .status-pill[data-status='unconfigured'],
    .status-pill[data-status='error'],
    .status-pill[data-status='invalid'] {
        background: rgba(239, 68, 68, 0.16);
        color: #991b1b;
    }

}

/* Responsive: stack sidebar above content on small screens and center cards */
@media (max-width: 700px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sidebar {
        order: 0;
        width: 100%;
    }

    .content {
        order: 1;
        width: 100%;
    }

    /* center the cards horizontally in the content area */
    .content .grid {
        justify-content: center;
    }

    .cards-loader {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        z-index: 999;
    }

    .card {
        margin: 6px;
    }

    .card .footer .title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        display: block;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .admin-shell {
        padding: 16px;
    }

    .admin-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

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

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .intro-panel {
        padding: 22px;
        border-radius: 24px;
    }

    .intro-actions {
        justify-content: stretch;
    }

    .intro-button {
        width: 100%;
    }

    .pull-refresh {
        top: 12px;
        width: min(92vw, 360px);
        justify-content: center;
    }
}