:root {
    --blue-900: #174578;
    --blue-700: #1E679B;
    --bg: #EDEEEE;
    --text: #1d2730;
    --muted: #6b7785;
    --border: #d9dee3;
    --white: #ffffff;
    --danger: #b42318;
    --warning: #b76e00;
    --success: #087443;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

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

.auth-page,
.public-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}

.auth-card,
.public-card {
    width: min(100%, 480px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 48px rgba(23, 69, 120, 0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--blue-900);
    margin-bottom: 18px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--blue-900);
    color: var(--white);
    display: grid;
    place-items: center;
    font-weight: 700;
}

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

.sidebar {
    background: var(--blue-900);
    color: var(--white);
    padding: 22px 16px;
}

.sidebar .brand {
    color: var(--white);
}

.sidebar .brand-mark {
    background: rgba(255, 255, 255, 0.16);
}

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

.nav a {
    color: rgba(255, 255, 255, 0.88);
    padding: 11px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.main {
    min-width: 0;
}

.topbar {
    height: 66px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
}

.content {
    padding: 28px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 24px;
    color: var(--blue-900);
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

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

.panel,
.metric,
.table-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.metric {
    padding: 18px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    color: var(--blue-900);
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

th {
    color: var(--blue-900);
    font-size: 12px;
    text-transform: uppercase;
}

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

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    color: var(--blue-900);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: var(--white);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: var(--blue-900);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.btn.secondary {
    background: var(--blue-700);
}

.btn.ghost {
    background: var(--white);
    color: var(--blue-900);
    border-color: var(--border);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #e8f2f8;
    color: var(--blue-900);
    font-size: 12px;
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    background: #e9f8ef;
    color: var(--success);
    border: 1px solid #bfe7cd;
}

.alert.error {
    background: #fff0ed;
    color: var(--danger);
    border-color: #ffd0c8;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    border-left: 3px solid var(--blue-700);
    padding-left: 12px;
}

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

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

    .sidebar {
        position: static;
    }

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

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

@media (max-width: 640px) {
    .content,
    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-head,
    .topbar {
        align-items: stretch;
        flex-direction: column;
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
    }

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