:root {
    --ink: #20242c;
    --muted: #656d7a;
    --line: #d9dde5;
    --panel: #ffffff;
    --canvas: #f3f4f6;
    --nav: #181b21;
    --accent: #1d55a5;
    --accent-dark: #153f7d;
    --danger: #bd252d;
    --gold: #a97800;
    --brand-blue: #1d55a5;
    --brand-blue-soft: #eaf0fa;
    --brand-red: #c5242d;
    --brand-gold: #d6a900;
    --brand-graphite: #181b21;
}

html {
    accent-color: var(--brand-blue);
}

body {
    background: var(--canvas);
    color: var(--ink);
}

::selection {
    background: #f5df83;
    color: #17191e;
}

a,
button,
input,
select,
textarea {
    outline-color: var(--brand-gold);
}

input,
select,
textarea {
    border-color: #b8bfca;
    background: #fff;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #929caa;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-blue);
    outline: 2px solid rgb(214 169 0 / 28%);
    outline-offset: 1px;
}

h1,
h2,
h3 {
    color: #1e222a;
}

.app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
    position: relative;
    padding: 20px 14px 18px;
    border-top: 4px solid var(--brand-gold);
    border-right: 1px solid #2c3038;
    background: var(--brand-graphite);
    color: #f5f6f8;
}

.brand,
.auth-brand {
    gap: 12px;
}

.brand-logo,
.owner-brand-logo {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

.sidebar .brand-logo {
    width: 56px;
    height: 56px;
}

.brand-copy {
    min-width: 0;
    font-size: 17px;
    line-height: 1.2;
}

.brand-copy small {
    margin-top: 3px;
    letter-spacing: 0;
}

.sidebar .brand-copy small {
    color: #abb1bc;
}

.sidebar nav {
    gap: 5px;
    margin-top: 30px;
}

.nav-link {
    position: relative;
    padding: 10px 11px;
    border: 1px solid transparent;
    color: #c9cdd4;
}

.nav-link:hover {
    border-color: #363b45;
    background: #262a32;
    color: #fff;
}

.nav-link:focus-visible,
.brand:focus-visible,
.text-button:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

.sidebar-footer {
    border-top-color: #393e47;
}

.role-name {
    color: #9fa6b2;
}

.text-button {
    color: #f3cf45;
    font-weight: 700;
}

.text-button:hover {
    color: #fff1a8;
}

.main-content {
    padding-top: 38px;
}

.page-header {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.page-header.compact {
    padding-bottom: 14px;
}

.page-header h1 {
    line-height: 1.2;
}

.eyebrow {
    color: var(--brand-blue) !important;
    letter-spacing: .06em;
}

.button {
    border-radius: 5px;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button-primary {
    background: var(--brand-blue);
    color: #fff;
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-primary:focus-visible,
.button-secondary:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: 2px;
}

.button-secondary {
    border-color: #aeb6c2;
    background: #fff;
    color: #303945;
}

.button-secondary:hover {
    border-color: var(--brand-blue);
    background: var(--brand-blue-soft);
    color: var(--accent-dark);
}

.text-link,
.table-link {
    color: var(--brand-blue);
}

.text-link:hover,
.table-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.stat,
.detail-strip,
.form-panel,
.assignment-group,
.assignment-user-row,
.assignment-row,
.data-table-wrap,
.instructions-grid,
.evidence-item,
.generated-link {
    border-color: var(--line);
}

.stat {
    border-top: 3px solid #bdc6d2;
}

.stat:nth-child(4n + 1) {
    border-top-color: var(--brand-blue);
}

.stat:nth-child(4n + 2) {
    border-top-color: var(--brand-gold);
}

.stat:nth-child(4n + 3) {
    border-top-color: var(--brand-red);
}

.stat:nth-child(4n + 4) {
    border-top-color: #333944;
}

.data-table-wrap,
.form-panel,
.auth-panel {
    box-shadow: 0 1px 2px rgb(25 29 36 / 5%);
}

th {
    background: #eceff3;
    color: #4d5663;
}

tbody tr:hover td {
    background: #f8f9fb;
}

.empty-state {
    border-color: #aeb7c3;
    background: #fafbfc;
}

.status-message {
    border-color: #9eb6dd;
    background: #edf3fc;
    color: #153f72;
}

.generated-link {
    border-left: 4px solid var(--brand-blue);
    background: #f1f5fb;
}

.generated-link p {
    color: #465a77;
}

.auth-body {
    border-top: 5px solid var(--brand-gold);
    background: #eceef2;
}

.auth-main {
    min-height: calc(100vh - 5px);
}

.auth-panel {
    position: relative;
    padding: 32px;
    border-color: #ccd2dc;
    border-top: 4px solid var(--brand-blue);
    background: #fff;
    box-shadow: 0 18px 46px rgb(24 27 33 / 13%);
}

.auth-brand {
    margin-bottom: 30px;
    color: var(--brand-graphite);
}

.auth-brand .brand-logo {
    width: 78px;
    height: 78px;
}

.auth-brand .brand-copy {
    font-size: 20px;
}

.auth-brand .brand-copy small {
    color: var(--muted);
    font-size: 12px;
}

.auth-panel h1 {
    margin-bottom: 7px;
}

.auth-panel .button-primary {
    min-height: 40px;
    margin-top: 4px;
}

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

    .sidebar {
        padding: 12px 14px 14px;
        border-top-width: 3px;
        border-right: 0;
        border-bottom: 1px solid #323740;
    }

    .sidebar .brand-logo {
        width: 46px;
        height: 46px;
    }

    .sidebar .brand-copy {
        font-size: 16px;
    }

    .sidebar nav {
        margin-top: 12px;
    }

    .main-content {
        padding-top: 26px;
    }
}

@media (max-width: 480px) {
    .auth-main {
        align-items: start;
        padding: 18px 14px;
    }

    .auth-panel {
        margin-top: 4vh;
        padding: 25px 22px;
    }

    .auth-brand .brand-logo {
        width: 68px;
        height: 68px;
    }

    .page-header {
        gap: 14px;
    }
}
