:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ink: #182230;
    --muted: #667085;
    --line: #dfe4ea;
    --surface: #ffffff;
    --canvas: #f4f6f8;
    --nav: #121a24;
    --brand: #e85d20;
    --brand-dark: #bd4211;
    --focus: #2e90fa;
    --danger: #b42318;
    --shadow: 0 12px 34px rgb(16 24 40 / 8%);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
a { color: #175cd3; text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: .8rem clamp(1rem, 3vw, 2.5rem);
    color: #fff;
    background: var(--nav);
    border-bottom: 3px solid var(--brand);
    box-shadow: 0 4px 16px rgb(0 0 0 / 18%);
}

.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    color: #fff;
    font-weight: 800;
    background: var(--brand);
    border-radius: .65rem;
}
.brand span:last-child { display: grid; line-height: 1.05; }
.brand small { margin-top: .25rem; color: #aeb9c6; font-size: .68rem; font-weight: 500; }

.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.main-nav a {
    padding: .48rem .65rem;
    color: #d8dee7;
    font-size: .82rem;
    font-weight: 600;
    border-radius: .45rem;
}
.main-nav a:hover { color: #fff; background: #263445; text-decoration: none; }
.logout-form { margin: 0; }

.page-content { width: min(1480px, 100%); margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem); }
h1 { margin: 0 0 1.4rem; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.035em; }
h2 { margin: 0 0 1rem; font-size: 1.35rem; }
h3 { margin: 1.25rem 0 .75rem; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.eyebrow { color: var(--brand-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    margin: .25rem .35rem .25rem 0;
    padding: .62rem 1rem;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: .55rem;
    cursor: pointer;
}
button:hover, .button:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
.button-secondary { color: #fff; background: transparent; border-color: #4a596b; white-space: nowrap; }
.button-secondary:hover { background: #263445; border-color: #69798c; }

form:not(.logout-form), section {
    margin: 1rem 0;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .85rem;
    box-shadow: var(--shadow);
}
form:not(.logout-form) { display: flex; flex-wrap: wrap; align-items: end; gap: .9rem; }
label { display: grid; gap: .4rem; color: #344054; font-size: .82rem; font-weight: 700; }
input, select, textarea {
    width: min(100%, 24rem);
    min-height: 2.55rem;
    padding: .58rem .72rem;
    color: var(--ink);
    font: inherit;
    background: #fff;
    border: 1px solid #b8c2cf;
    border-radius: .5rem;
    outline: none;
}
textarea { min-height: 6rem; resize: vertical; }
input[type="checkbox"] { width: 1rem; min-height: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(46 144 250 / 18%); }

table { width: 100%; margin: 1rem 0; overflow: hidden; background: #fff; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); }
th, td { padding: .85rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf0f3; }
th { color: #475467; font-size: .72rem; letter-spacing: .045em; text-transform: uppercase; background: #f8fafb; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffaf7; }
td button { min-height: 2.15rem; padding: .42rem .7rem; font-size: .78rem; }

[role="alert"], .alert { padding: .8rem 1rem; color: var(--danger); background: #fef3f2; border: 1px solid #fecdca; border-radius: .55rem; }
.hero-panel { min-height: 22rem; padding: clamp(2rem, 6vw, 5rem); background: linear-gradient(130deg, #fff 0%, #fff 55%, #fff1e9 100%); }
.hero-panel h1 { max-width: 14ch; margin-top: .6rem; font-size: clamp(2.5rem, 6vw, 4.75rem); }
.hero-panel p { max-width: 58ch; color: var(--muted); font-size: 1.1rem; }
.hero-actions { margin-top: 1.5rem; }

.auth-shell { display: grid; place-items: center; min-height: calc(100vh - 9rem); }
.auth-card { width: min(100%, 29rem); padding: clamp(1.5rem, 4vw, 2.5rem); }
.auth-card h1 { margin: .55rem 0 .4rem; font-size: 2rem; }
.auth-card form { display: grid; padding: 0; border: 0; box-shadow: none; }
.auth-card input { width: 100%; }
.auth-card button { width: 100%; margin-top: .3rem; }
.secure-note { margin: 1.25rem 0 0; color: var(--muted); font-size: .75rem; text-align: center; }

ul { padding-left: 1.4rem; }
li { margin: .4rem 0; line-height: 1.45; }

@media (max-width: 980px) {
    .app-header { position: static; grid-template-columns: 1fr auto; }
    .main-nav { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 680px) {
    .page-content { padding: 1rem; }
    .main-nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; }
    .main-nav a { white-space: nowrap; }
    form:not(.logout-form) { display: grid; align-items: stretch; }
    input, select, textarea { width: 100%; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .brand small { display: none; }
}
