@font-face {
    font-family: "Roboto";
    src: url("/fonts/roboto-latin-400-normal.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("/fonts/roboto-latin-500-normal.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("/fonts/roboto-latin-700-normal.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --sidebar: #4f83c2;
    --sidebar-active: #20538e;
    --page: #f3f5f8;
    --surface: #ffffff;
    --text: #183653;
    --muted: #72849a;
    --line: #e4e9ef;
    --blue: #397df3;
    --green: #38cf7c;
    --amber: #b76a15;
    --shadow: 0 4px 15px rgb(27 48 74 / 8%);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px;
}

.dashboard-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 2;
    display: flex;
    width: 236px;
    flex-direction: column;
    padding: 28px 16px 20px;
    background: var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    height: 92px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 2px 44px;
    border-radius: 8px;
    background: transparent;
}

/* Keep the complete white logo visible against the existing sidebar colour. */
.brand img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.workspace-label,
.eyebrow {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .11em;
}

.workspace-label {
    padding: 0 12px 12px;
    color: rgb(255 255 255 / 75%);
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: 0 12px;
    border-radius: 7px;
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: rgb(255 255 255 / 15%);
    outline: none;
}

.nav-link.active {
    background: var(--sidebar-active);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 12px;
    color: rgb(255 255 255 / 84%);
    font-size: 12px;
}

.signed-in {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding: 12px;
    color: rgb(255 255 255 / 84%);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.signed-in + .sidebar-footer {
    margin-top: 0;
}

.sign-out-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 7px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.sign-out-button:hover,
.sign-out-button:focus-visible {
    background: rgb(255 255 255 / 15%);
    outline: none;
}

.environment-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ce9c0;
}

.main-content {
    width: min(1600px, calc(100% - 236px));
    margin-left: 236px;
    padding: 30px 28px 20px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--sidebar-active);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.page-description {
    margin-bottom: 0;
    color: var(--muted);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}

.demo-badge,
.panel-tag {
    border-radius: 999px;
    background: #e7f0fc;
    color: #245a99;
    font-size: 11px;
    font-weight: 700;
}

.demo-badge {
    padding: 7px 11px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    border: 1px solid #e8ebef;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 126px;
    padding: 18px 20px;
}

.metric-card p {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}

.metric-card strong {
    display: block;
    margin-bottom: 7px;
    font-size: 29px;
    font-weight: 700;
    line-height: 1;
}

.metric-card span {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    padding: 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading h2,
.setup-panel h2 {
    margin-bottom: 5px;
    font-size: 16px;
    font-weight: 700;
}

.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
}

.panel-tag {
    padding: 5px 8px;
    letter-spacing: .06em;
}

.chart {
    display: flex;
    height: 228px;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;
    padding: 28px 12px 0;
}

.chart-column {
    display: flex;
    width: 48px;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.chart-value,
.chart-label {
    color: var(--muted);
    font-size: 11px;
}

.chart-track {
    display: flex;
    width: 24px;
    height: 148px;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 6px;
    background: #eff3f8;
}

.chart-bar {
    width: 100%;
    min-height: 10px;
    border-radius: 6px 6px 0 0;
    background: var(--blue);
}

.queue-list {
    margin-top: 18px;
}

.queue-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.queue-row > div {
    display: grid;
    gap: 5px;
}

.queue-row strong {
    font-size: 13px;
    font-weight: 700;
}

.queue-row div span {
    color: var(--muted);
    font-size: 11px;
}

.status-pill {
    flex: 0 0 auto;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.status-review {
    background: #fff2df;
    color: #9a5810;
}

.status-waiting {
    background: #eaf1fa;
    color: #42688f;
}

.demo-note {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.text-link {
    color: var(--sidebar-active);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.setup-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 18px 20px;
}

.setup-copy {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.setup-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #e7f0fc;
    color: #245a99;
    font-weight: 700;
}

.setup-panel h2 {
    margin-top: 2px;
}

.setup-panel p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
}

.setup-status {
    flex: 0 0 auto;
    color: #245a99;
    font-size: 12px;
    font-weight: 500;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 2px;
    color: var(--muted);
    font-size: 11px;
}

/* One copyright line under every page; it sits beside the sidebar, not under it. */
.site-copyright {
    padding: 8px 28px 20px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.dashboard-shell ~ .site-copyright {
    margin-left: 236px;
}

/* The first page a visitor sees: a title, the logo as the sign-in button, and the copyright line below. */
.welcome-shell {
    display: grid;
    min-height: calc(100vh - 60px);
    place-content: center;
    justify-items: center;
    gap: 20px;
    padding: 24px 16px;
    text-align: center;
}

.welcome-shell h1 {
    margin: 0;
    font-size: 28px;
}

.logo-button {
    display: block;
    width: min(380px, 86vw);
    padding: 30px 26px;
    border: 0;
    border-radius: 16px;
    background: var(--sidebar);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.logo-button:hover {
    background: var(--sidebar-active);
}

.logo-button:focus-visible {
    outline: 3px solid #9bc4f4;
    outline-offset: 3px;
}

.logo-button img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 700px) {
    .dashboard-shell ~ .site-copyright {
        margin-left: 0;
    }
}

.referral-workspace {
    display: grid;
    grid-template-columns: minmax(240px, .72fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 18px;
    margin-bottom: 18px;
}

.question-panel { margin-bottom: 18px; padding: 20px; }
.question-form { display: grid; gap: 10px; max-width: 520px; }
.question-form input, .question-form select, .question-form textarea { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.question-form input:focus-visible, .question-form select:focus-visible, .question-form textarea:focus-visible { outline: 3px solid #9bc4f4; outline-offset: 2px; }
.audit-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 12px; }
.audit-filter label { display: block; margin-bottom: 4px; }
.audit-filter input[type="date"] { min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.question-form .check-row { display: flex; align-items: center; gap: 8px; }
.question-form .check-row input { width: auto; min-height: 0; }
.question-table td { white-space: normal; overflow-wrap: anywhere; min-width: 120px; }
.notice-error { padding: 12px 24px; color: #8b2323; background: #fff0f0; border-radius: 8px; }
.validation-summary-valid { display: none; }
.candidate-content { width: min(100%, 680px); margin: 30px auto; padding: 0 14px; }
.invitation-code { overflow-wrap: anywhere; user-select: all; }

.create-panel,
.referral-list-panel {
    min-width: 0;
}

.form-help {
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.primary-button {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 7px;
    background: var(--sidebar-active);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
}

.primary-button:hover,
.primary-button:focus-visible {
    background: #173f70;
}

.primary-button:focus-visible {
    outline: 3px solid #9bc4f4;
    outline-offset: 2px;
}

.notice-success {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #b9e8ce;
    border-radius: 8px;
    background: #edfbf3;
    color: #21633d;
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 16px;
}

.referral-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.referral-table th,
.referral-table td {
    padding: 13px 10px;
    border-top: 1px solid var(--line);
    white-space: nowrap;
}

.referral-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.referral-table td {
    font-size: 12px;
}

.referral-table td strong {
    color: var(--sidebar-active);
    font-size: 13px;
}

.empty-state {
    display: grid;
    gap: 6px;
    margin-top: 16px;
    padding: 22px 14px;
    border-top: 1px solid var(--line);
}

.empty-state strong {
    font-size: 13px;
}

.empty-state span {
    color: var(--muted);
    font-size: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1050px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .referral-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .sidebar {
        position: static;
        width: 100%;
        gap: 14px;
        padding: 12px 14px;
    }

    .brand {
        width: 160px;
        height: 58px;
        margin: 0;
    }

    .brand img {
        height: auto;
    }

    .workspace-label,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 2px;
    }

    .nav-link {
        min-height: 38px;
        flex: 0 0 auto;
        padding: 0 11px;
        font-size: 12px;
    }

    .main-content {
        width: 100%;
        margin: 0;
        padding: 22px 16px;
    }

    .page-header {
        align-items: flex-start;
    }

    h1 {
        font-size: 25px;
    }

    .header-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .metric-grid {
        gap: 10px;
    }

    .metric-card {
        min-height: 112px;
        padding: 15px;
    }

    .metric-card strong {
        font-size: 25px;
    }

    .panel {
        padding: 16px;
    }

    .page-footer {
        flex-direction: column;
    }
}

@media (max-width: 390px) {
    .updated-label {
        display: none;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .setup-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Page updates (htmx): an element with this class shows only while its request is running. */
.htmx-indicator {
    opacity: 0;
    transition: opacity 150ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}
