:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #18212f;
    --muted: #667085;
    --line: #d9dee7;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --warn: #b45309;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #111827;
    color: #f9fafb;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
}

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

.brand span,
.login-brand p {
    color: #9ca3af;
    display: block;
    margin: 0;
}

.brand-mark {
    align-items: center;
    background: var(--brand);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.nav a {
    border-radius: 8px;
    color: #d1d5db;
    padding: 10px 12px;
}

.nav a.active,
.nav a:hover {
    background: #1f2937;
    color: #fff;
}

.logout {
    margin-top: auto;
}

.logout button,
.login-form button {
    background: var(--brand);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 14px;
    width: 100%;
}

.logout button:hover,
.login-form button:hover {
    background: var(--brand-dark);
}

.content {
    padding: 32px;
}

.page-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 30px;
}

.panel {
    margin-bottom: 18px;
    padding: 18px;
}

.panel p {
    color: var(--muted);
    margin: 0;
    max-width: 760px;
}

.table-link {
    color: var(--brand);
    font-weight: 800;
}

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

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 860px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.badge,
.keyword-list span {
    background: #eef2f6;
    border-radius: 999px;
    color: #344054;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 9px;
}

.compliance.low_risk {
    background: #dcfce7;
    color: #166534;
}

.compliance.needs_review {
    background: #fef3c7;
    color: var(--warn);
}

.compliance.rejected {
    background: #fee4e2;
    color: var(--danger);
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.login-brand {
    margin-bottom: 24px;
}

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

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    color: var(--muted);
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.login-form input {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: 10px 12px;
    width: 100%;
}

.alert {
    background: #fee4e2;
    border-radius: 8px;
    color: var(--danger);
    font-weight: 700;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.public-page {
    background: #f3f6f8;
}

.public-shell {
    margin: 0 auto;
    max-width: 1040px;
    padding: 28px 20px 56px;
}

.public-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 26px;
}

.public-header .brand {
    color: var(--ink);
}

.public-header .brand span:not(.brand-mark) {
    color: var(--muted);
}

.public-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.public-nav a,
.button-link {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: inline-flex;
    font-weight: 800;
    padding: 9px 12px;
}

.button-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    margin-top: 18px;
}

.button-link.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
    margin-top: 0;
}

.form-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 auto;
    max-width: 900px;
    padding: 24px;
}

.form-heading {
    margin-bottom: 20px;
}

.form-heading p,
.thank-you p {
    color: var(--muted);
    margin: 8px 0 0;
}

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

.intake-form label {
    color: var(--muted);
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.intake-form input,
.intake-form textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    min-width: 0;
    padding: 10px 12px;
    width: 100%;
}

.intake-form textarea {
    min-height: 110px;
    resize: vertical;
}

.intake-form .wide {
    grid-column: 1 / -1;
}

.intake-form button {
    background: var(--brand);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 11px 14px;
}

.hp-field {
    display: none;
}

.thank-you {
    max-width: 640px;
}

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

.details {
    display: grid;
    gap: 10px;
    grid-template-columns: 150px 1fr;
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-weight: 800;
}

.details dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 880px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

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

    .public-header,
    .detail-grid {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .public-header {
        display: grid;
        gap: 16px;
    }
}

@media (max-width: 560px) {
    .content {
        padding: 22px 16px;
    }

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

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

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