:root {
    --ink: #152238;
    --muted: #64748b;
    --line: #d7e0ea;
    --panel: #ffffff;
    --soft: #f5f8fc;
    --brand: #073b63;
    --brand-2: #00a3ad;
    --accent: #18b7c7;
    --danger: #b42318;
    --warning: #b54708;
    --ok: #087443;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(24, 183, 199, 0.16), transparent 30%),
        linear-gradient(180deg, #eef5fb 0%, #f8fafc 45%, #eef3f8 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

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

.topbar {
    align-items: center;
    background: linear-gradient(90deg, #052f50 0%, #064b78 55%, #047987 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 24px;
}

.topbar strong {
    font-size: 17px;
}

.topbar nav {
    align-items: center;
    display: flex;
    gap: 16px;
}

.topbar a,
.topbar button {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.page {
    margin: 0 auto;
    max-width: 1180px;
    padding: 24px;
}

.auth-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: 24px;
}

.auth-card,
.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 35, 60, 0.07);
}

.auth-card {
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

.panel {
    padding: 20px;
}

.card {
    padding: 18px;
    position: relative;
}

.card::before {
    background: var(--accent);
    border-radius: 8px 8px 0 0;
    content: "";
    height: 3px;
    left: -1px;
    position: absolute;
    right: -1px;
    top: -1px;
}

.metric {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
}

.metric-value.metric-text {
    font-size: 18px;
    overflow-wrap: anywhere;
}

h1 {
    font-size: 26px;
    margin: 0 0 18px;
}

h2 {
    font-size: 18px;
    margin: 0 0 14px;
}

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

.actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.btn {
    background: linear-gradient(135deg, var(--brand), #086a86);
    border: 1px solid #075173;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    padding: 10px 14px;
}

.btn.secondary {
    background: #fff;
    color: var(--brand);
}

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

.inline-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 260px;
}

.inline-actions form {
    margin: 0;
}

.list-controls,
.pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.list-controls {
    margin-bottom: 14px;
}

.list-controls label {
    margin: 0;
}

.list-controls select {
    width: auto;
}

.pagination {
    justify-content: flex-end;
    margin-top: 14px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select {
    background: #fff;
    border: 1px solid #bbc6d4;
    border-radius: 6px;
    color: var(--ink);
    min-height: 40px;
    padding: 9px 10px;
    width: 100%;
}

.field {
    margin-bottom: 14px;
}

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

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 10px;
    text-align: left;
}

th {
    background: var(--soft);
    font-size: 12px;
    text-transform: uppercase;
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.status.ok {
    background: #dcfce7;
    color: var(--ok);
}

.status.warn {
    background: #fff7ed;
    color: var(--warning);
}

.alert {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    color: #9a3412;
    margin-bottom: 16px;
    padding: 12px;
}

.success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: var(--ok);
}

.result-band {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.proposal-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.result-panel {
    position: sticky;
    top: 18px;
}

.result-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.kpi-main {
    background: linear-gradient(135deg, #062f50, #078097);
    border-radius: 8px;
    color: #fff;
    margin: 14px 0;
    padding: 18px;
}

.kpi-main span {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    text-transform: uppercase;
}

.kpi-main strong {
    display: block;
    font-size: 30px;
    margin-top: 6px;
}

.tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.tab-button {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    padding: 10px 12px;
}

.tab-button.active {
    border-bottom-color: var(--brand-2);
    color: var(--brand);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.result-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.result-line.important {
    background: #ecfeff;
    border: 1px solid #b6edf2;
    border-radius: 6px;
    margin-top: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.result-line + .result-line {
    border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .proposal-layout {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: static;
    }
}
