:root {
    --navy: #0b2a4a;
    --navy-deep: #071e36;
    --ink: #10243d;
    --muted: #5c6b80;
    --line: #485276;
    --canvas: #eef3f8;
    --paper: #fff;
    --accent: #1d6fe8;
    --accent-strong: #1558c0;
    --on-navy: #f5f9ff;
    --ok: #157a45;
    --ok-soft: #e7f6ee;
    --info: #1d4f91;
    --info-soft: #b9d8fe;
    --warn: #b45309;
    --warn-soft: #fff4e8;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --neutral: #f3f6fa;
    --radius: 1.25rem;
    --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3 {
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0;
}

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

img {
    max-width: 100%;
    display: block;
}

button, [role="button"], .btn {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.75rem;
    display: grid;
    gap: 1rem;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgb(11 42 74 / 0.05);
    min-width: 0;
}

.pad {
    padding: 1.25rem;
}

.btn {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.3rem;
    border: 1px solid transparent;
    padding: 0 1rem;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    color: var(--ink);
    background: transparent;
}

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

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-navy {
    background: var(--navy);
    color: var(--on-navy);
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.field {
    display: grid;
    gap: 0.35rem;
    font-size: 0.86rem;
    font-weight: 700;
}

.input, .select, .textarea {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 0.3rem;
    padding: 0.55rem 0.75rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

.textarea {
    min-height: 6rem;
    resize: vertical;
}

.muted {
    color: var(--muted);
}

.topbar, .page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    font-weight: 800;
}

.logo small {
    display: block;
    font-weight: 600;
    color: var(--muted);
}

.logo.light, .logo.light small {
    color: var(--on-navy);
}

.logo.light small {
    opacity: 0.75;
}

.mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: var(--on-navy);
}

.logo.light .mark {
    background: rgb(255 255 255 / 0.12);
}

.nav-links {
    display: flex;
    gap: 1.1rem;
    margin-left: auto;
    font-weight: 800;
    color: var(--muted);
}

.hero {
    display: grid;
    overflow: hidden;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 16rem;
}

.kicker {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.checks {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.55rem;
    font-weight: 700;
}

.grid-3 {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    display: grid;
    gap: 1rem;
}

.navy-box {
    background: var(--navy);
    color: var(--on-navy);
    border-radius: 1rem;
    padding: 1.25rem;
}

.shell {
    min-height: 100vh;
}

.side {
    background: var(--navy);
    color: var(--on-navy);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.side a, .side button.linkish {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--on-navy);
    text-decoration: none;
    font-weight: 700;
    border-radius: 0.8rem;
    padding: 0.7rem 0.75rem;
    background: transparent;
    border: 0;
    font: inherit;
    width: 100%;
    text-align: left;
}

.side a.active, .side a:hover, .side button.linkish:hover {
    background: rgb(255 255 255 / 0.1);
}

.side .grow {
    margin-top: auto;
}

.main {
    min-width: 0;
}

.header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgb(238 243 248 / 0.92);
    backdrop-filter: blur(8px);
}

.content {
    padding: 1.1rem;
    display: grid;
    gap: 1rem;
}

.kpis {
    display: grid;
    gap: 0.75rem;
}

.kpi {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
}

.kpi b {
    display: block;
    font-size: 1.5rem;
}

.icon {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: var(--info-soft);
    color: var(--accent);
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th, table.data td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.data th {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
    background: var(--neutral);
}

.st-draft {
    background: var(--neutral);
}

.st-submitted, .st-in_review {
    background: var(--info-soft);
    color: var(--info);
}

.st-adopted, .st-confirmed, .st-completed {
    background: var(--ok-soft);
    color: var(--ok);
}

.st-query {
    background: var(--warn-soft);
    color: var(--warn);
}

.st-rejected, .st-cancelled {
    background: var(--danger-soft);
    color: var(--danger);
}

.flash {
    border-radius: 0.8rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

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

.flash.ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.steps {
    display: grid;
    gap: 0.5rem;
}

.step {
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
    text-align: center;
}

.step.on {
    border-color: var(--accent);
    background: var(--info-soft);
    color: var(--info);
}

.form-grid {
    display: grid;
    gap: 0.75rem;
}

.slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.slot {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 0.8rem;
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-weight: 800;
}

.slot.on {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.slot:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.timeline {
    display: grid;
    gap: 0.8rem;
}

.bar {
    height: 0.35rem;
    border-radius: 999px;
    background: var(--line);
    margin-bottom: 0.35rem;
}

.bar.done {
    background: var(--ok);
}

.menu-btn {
    display: none;
}

.filters {
    display: grid;
    gap: 0.75rem;
}

.pager {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

pre.code {
    overflow: auto;
    background: var(--navy);
    color: var(--on-navy);
    border-radius: 0.8rem;
    padding: 0.8rem;
    font-size: 0.78rem;
}

@media (min-width: 720px) {
    .hero {
        grid-template-columns: 1.05fr 0.95fr;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .kpis {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .filters {
        grid-template-columns: 1.4fr repeat(4, 1fr);
        align-items: end;
    }

    .steps {
        grid-template-columns: repeat(5, 1fr);
        list-style-type: none;
    }

    .timeline {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .shell {
        display: grid;
        grid-template-columns: 16.5rem 1fr;
    }

    .side {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

@media (max-width: 1023px) {
    .menu-btn {
        display: grid;
        place-items: center;
        width: 2.75rem;
        height: 2.75rem;
    }

    .side {
        position: fixed;
        inset: 0 auto 0 0;
        width: 16.5rem;
        z-index: 20;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .side.open {
        transform: none;
    }

    .nav-links {
        display: none;
    }
}

.auth-split {
    max-width: 46rem;
    margin: 4vh auto;
    display: grid;
}

.auth-aside {
    background: var(--navy);
    color: var(--on-navy);
    padding: 1.25rem;
    border-radius: 1.25rem 1.25rem 0 0;
}

@media (min-width: 800px) {
    .auth-split {
        grid-template-columns: 16rem 1fr;
    }

    .auth-aside {
        border-radius: 1.25rem 0 0 1.25rem;
    }
}

@media print {
    .side, .header, .no-print {
        display: none !important;
    }

    .shell {
        display: block;
    }

    body {
        background: #fff;
    }
}