:root {
    --sibyla-brand: #ec007a;
    --sibyla-brand-dark: #bd0062;
    --sibyla-ink: #161f2d;
    --sibyla-muted: #647085;
    --sibyla-line: #dde3ec;
    --sibyla-line-strong: #c9d2df;
    --sibyla-surface: #ffffff;
    --sibyla-surface-soft: #f7f8fb;
    --sibyla-info: #137d99;
    --sibyla-good: #147447;
    --sibyla-warn: #8a5a00;
    --sibyla-bad: #a32020;
}

html,
body {
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--sibyla-ink);
    background: linear-gradient(180deg, #ffffff 0, #f8f9fc 15rem, #f3f5f9 100%);
}

a,
.btn-link {
    color: var(--sibyla-brand-dark);
}

a:hover,
.btn-link:hover {
    color: #94004d;
}

h1 {
    font-size: 2rem;
    font-weight: 760;
    line-height: 1.15;
    margin: 0;
}

h2 {
    color: var(--sibyla-ink);
    font-size: 0.98rem;
    font-weight: 760;
    line-height: 1.25;
    margin: 0 0 1rem;
}

p {
    color: var(--sibyla-muted);
}

.content {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 2.25rem;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eyebrow {
    color: var(--sibyla-brand-dark);
    font-size: 0.78rem;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel {
    background: var(--sibyla-surface);
    border: 1px solid var(--sibyla-line);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(22, 31, 45, 0.06);
    overflow-x: auto;
    padding: 1rem;
}

.panel + .panel {
    margin-top: 1rem;
}

.dashboard-grid .panel + .panel {
    margin-top: 0;
}

.panel.narrow {
    max-width: 42rem;
}

.overview-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1rem;
    border-top: 4px solid var(--sibyla-brand);
}

.overview-copy {
    min-width: 0;
}

.overview-wordmark {
    width: 19rem;
    max-width: 100%;
    height: auto;
    margin-bottom: 0.65rem;
}

.overview-text {
    max-width: 40rem;
    margin: 0;
}

.session-block {
    min-width: 0;
    border-left: 1px solid var(--sibyla-line);
    padding-left: 1.25rem;
}

.session-user {
    color: var(--sibyla-ink);
    font-weight: 650;
    margin: 0.75rem 0 0;
    overflow-wrap: anywhere;
}

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

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.metric-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.foundation-panel .metric-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-list div {
    min-height: 5.25rem;
    border: 1px solid #e6ebf2;
    border-left: 3px solid var(--sibyla-info);
    border-radius: 7px;
    background: #fbfcfe;
    padding: 0.75rem;
}

.metric-list dt {
    color: var(--sibyla-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-list dd {
    color: var(--sibyla-ink);
    margin: 0.25rem 0 0;
    font-weight: 700;
}

.brand-sample {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.environment-panel {
    display: flex;
    flex-direction: column;
}

.environment-panel .brand-sample {
    flex: 1;
    justify-content: center;
    border: 1px solid #e6ebf2;
    border-radius: 7px;
    background: #fbfcfe;
}

.brand-sample img {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
}

.brand-sample strong,
.brand-sample span {
    display: block;
}

.brand-sample span {
    color: var(--sibyla-muted);
    margin-top: 0.15rem;
}

.intake-grid {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.75fr);
}

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

.field {
    display: grid;
    gap: 0.35rem;
    color: #3f4c5f;
    font-size: 0.82rem;
    font-weight: 720;
}

.field-wide {
    grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 2.45rem;
    border: 1px solid var(--sibyla-line-strong);
    border-radius: 7px;
    background: #ffffff;
    color: var(--sibyla-ink);
    font: inherit;
    font-weight: 520;
    padding: 0.45rem 0.65rem;
}

.field textarea {
    min-height: 5.8rem;
    resize: vertical;
}

.field input[type="file"] {
    padding: 0.5rem;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.selected-file {
    overflow-wrap: anywhere;
}

.selected-file-list {
    display: grid;
    gap: 0.35rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.selected-file-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--sibyla-line);
    padding: 0.45rem 0;
    color: var(--sibyla-ink);
}

.selected-file-list li span:first-child {
    overflow-wrap: anywhere;
}

.selected-file-list li span:last-child {
    color: var(--sibyla-muted);
    white-space: nowrap;
}

.form-message {
    margin-top: 1rem;
}

.intake-metrics {
    grid-template-columns: 1fr;
}

.table-note {
    display: block;
    color: var(--sibyla-muted);
    font-size: 0.8rem;
    font-weight: 620;
    margin-top: 0.18rem;
}

.data-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e7ebf1;
    padding: 0.72rem 0.75rem;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #3f4c5f;
    background: #f3f6fa;
    font-size: 0.78rem;
    font-weight: 760;
    text-transform: uppercase;
}

.data-table tbody tr:hover td {
    background: #fbfcfe;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 760;
}

.status.good {
    color: var(--sibyla-good);
    background: #e8f6ef;
}

.status.warn {
    color: var(--sibyla-warn);
    background: #fff4d6;
}

.status.bad {
    color: var(--sibyla-bad);
    background: #ffe8eb;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    border: 1px solid var(--sibyla-line-strong);
    border-radius: 7px;
    padding: 0.48rem 0.9rem;
    color: var(--sibyla-ink);
    background: #ffffff;
    font-weight: 760;
    line-height: 1.1;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.button.primary {
    color: #ffffff;
    border-color: var(--sibyla-brand);
    background: var(--sibyla-brand);
}

.button.subtle {
    color: var(--sibyla-ink);
    background: #f8fafc;
}

.table-action {
    min-height: 2rem;
    padding: 0.36rem 0.65rem;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.button:hover {
    color: var(--sibyla-ink);
    border-color: #b8c3d1;
    background: #f8fafc;
    text-decoration: none;
}

.button.primary:hover {
    color: #ffffff;
    border-color: var(--sibyla-brand-dark);
    background: var(--sibyla-brand-dark);
}

.button.danger {
    color: var(--sibyla-bad);
    border-color: #f2b5bd;
    background: #fff6f7;
}

.button.danger:hover {
    color: #ffffff;
    border-color: var(--sibyla-bad);
    background: var(--sibyla-bad);
}

.button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 0, 122, 0.18);
}

.auth-gate {
    display: grid;
    min-height: calc(100vh - 8rem);
    place-items: center;
    padding: 1rem 0;
}

.auth-card {
    width: min(100%, 29rem);
    border: 1px solid var(--sibyla-line);
    border-top: 5px solid var(--sibyla-brand);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(22, 31, 45, 0.12);
    padding: 2rem;
}

.auth-logo {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
    margin-bottom: 1.25rem;
}

.auth-card h1 {
    margin-bottom: 0.75rem;
}

.auth-card p:not(.eyebrow) {
    margin-bottom: 1.25rem;
}

.auth-button {
    width: 100%;
}

.empty-state {
    max-width: 34rem;
    margin: 3rem auto;
    border: 1px solid var(--sibyla-line);
    border-top: 4px solid var(--sibyla-brand);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(22, 31, 45, 0.08);
    padding: 2rem;
    text-align: center;
}

.empty-state-logo {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    margin-bottom: 1rem;
}

.empty-state h1 {
    margin-bottom: 0.75rem;
}

.empty-state p {
    margin-bottom: 1.25rem;
}

h1:focus {
    outline: none;
}

.validation-message {
    color: var(--sibyla-bad);
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff4d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.65rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 760px) {
    h1 {
        font-size: 1.7rem;
    }

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

    .overview-panel {
        grid-template-columns: 1fr;
    }

    .dashboard-grid,
    .intake-grid,
    .form-grid,
    .foundation-panel .metric-list {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .environment-panel .brand-sample {
        justify-content: flex-start;
    }

    .session-block {
        border-left: 0;
        border-top: 1px solid var(--sibyla-line);
        padding-left: 0;
        padding-top: 1rem;
    }

    .auth-card,
    .empty-state {
        padding: 1.4rem;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .foundation-panel .metric-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .environment-panel .brand-sample {
        justify-content: flex-start;
    }
}
