:root {
    --bg: #eef2ef;
    --surface: #ffffff;
    --ink: #122022;
    --muted: #617174;
    --line: #d7dfdc;
    --primary: #0f3d3e;
    --primary-2: #195d55;
    --accent: #f0b429;
    --danger: #b42318;
    --shadow: 0 20px 50px rgba(16, 39, 38, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--primary-2);
    text-decoration: none;
}

small {
    display: block;
    color: var(--muted);
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    background: #fff;
    color: var(--ink);
}

label {
    display: grid;
    gap: 0.4rem;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: #0b2629;
    color: #fff;
}

.brand {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: inherit;
}

.brand.large {
    margin-bottom: 2rem;
    color: var(--ink);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #102120;
    font-weight: 900;
}

.brand small {
    color: rgba(255, 255, 255, 0.68);
}

.brand.large small {
    color: var(--muted);
}

.nav {
    display: grid;
    gap: 0.35rem;
    margin-top: 2rem;
}

.nav a {
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    padding: 0.8rem 0.9rem;
    font-weight: 700;
}

.nav a.active,
.nav a:hover {
    background: #fff;
    color: var(--primary);
}

.sidebar-footer {
    display: grid;
    gap: 0.6rem;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.sidebar-footer a {
    color: #fff;
}

.content {
    margin-left: 260px;
    padding: 2rem;
}

.auth-content {
    min-height: 100vh;
}

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

.page-header h1 {
    margin: 0.15rem 0 0.4rem;
    font-size: clamp(1.8rem, 3vw, 3rem);
}

.page-header p {
    max-width: 820px;
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--primary-2);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 0.72rem 1rem;
    font-weight: 800;
    cursor: pointer;
}

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

.button.secondary {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--primary);
}

.actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric,
.panel,
.login-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
}

.metric span,
.muted,
.disclaimer {
    color: var(--muted);
}

.metric strong {
    font-size: 1.65rem;
}

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

.panel {
    padding: 1.15rem;
}

.panel h2 {
    margin: 0 0 1rem;
}

.span-2 {
    grid-column: span 2;
}

.narrow {
    max-width: 760px;
}

.stack-form {
    display: grid;
    gap: 0.9rem;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar label {
    min-width: 170px;
}

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

.badge {
    display: inline-flex;
    border-radius: 999px;
    background: #e6f0ec;
    color: var(--primary);
    padding: 0.25rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flow span {
    border-radius: 999px;
    background: #edf6f3;
    padding: 0.45rem 0.75rem;
    font-weight: 800;
}

.list {
    display: grid;
    gap: 0.7rem;
}

.list a {
    display: grid;
    gap: 0.15rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.7rem;
}

.data-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1rem;
}

.data-list dt {
    color: var(--muted);
}

.data-list dd {
    margin: 0;
    font-weight: 800;
}

.reason-list {
    margin: 0;
    padding-left: 1.1rem;
}

.map-panel {
    margin-bottom: 1rem;
}

.map-canvas {
    min-height: 520px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(135deg, #132f31, #60706c);
}

.empty-state {
    display: grid;
    min-height: 140px;
    place-content: center;
    gap: 0.35rem;
    padding: 1.2rem;
    color: var(--muted);
    text-align: center;
}

.flash {
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #e6f0ec;
    color: var(--primary);
    font-weight: 700;
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.login-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.login-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    background: radial-gradient(circle at 20% 20%, rgba(240, 180, 41, 0.22), transparent 34%), #e8eeeb;
}

.login-copy h1 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 1.03;
}

.login-copy p {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.08rem;
}

.login-card {
    align-self: center;
    width: min(420px, calc(100% - 2rem));
    margin: 2rem;
    padding: 1.4rem;
    justify-self: center;
}

.login-card h2 {
    margin-top: 0;
}

.login-card label {
    margin-top: 0.8rem;
}

.login-card .button {
    width: 100%;
    margin-top: 1rem;
}

.disclaimer {
    margin-top: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .metric-grid,
    .content-grid,
    .login-layout {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .page-header {
        display: grid;
    }

    .login-copy {
        padding: 2rem 1rem;
    }
}

