:root {
    color-scheme: light;
    --ink: #17211d;
    --muted: #65746e;
    --line: #dfe8e1;
    --panel: #ffffff;
    --soft: #f5f8f4;
    --green: #126b43;
    --green-2: #0f8a54;
    --red: #b7342b;
    --shadow: 0 18px 55px rgba(23, 33, 29, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #eef4ef;
}

button,
input,
select {
    font: inherit;
}

button,
.button-link {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

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

.ghost {
    background: rgba(255,255,255,.72);
}

.danger {
    border-color: #f0c3bd;
    color: #8b241c;
    background: #fff0ee;
}

.text-danger {
    min-height: 0;
    border: 0;
    padding: 0;
    color: #9b2d25;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
}

.topbar {
    min-height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px clamp(18px, 4vw, 56px);
    color: #fff;
    background:
        linear-gradient(90deg, rgba(12, 68, 45, .94), rgba(18, 107, 67, .83)),
        url("https://images.unsplash.com/photo-1610348725531-843dff563e2c?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.topbar h1,
.login-panel h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 50px);
    line-height: 1;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-shell {
    width: min(1480px, calc(100% - 28px));
    margin: 18px auto 56px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(90deg, rgba(10, 41, 31, .84), rgba(18, 107, 67, .44)),
        url("https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
    width: min(470px, 100%);
    padding: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.95);
    box-shadow: var(--shadow);
}

.muted,
.panel-head p,
.hint {
    color: var(--muted);
}

.stack,
.grid {
    display: grid;
    gap: 18px;
}

.grid {
    margin-top: 18px;
}

.no-top {
    margin-top: 0;
}

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

.panel,
.flash {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    margin-top: 18px;
    padding: 22px;
}

.soft-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.soft-panel h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.accent {
    border-top: 5px solid var(--green-2);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    font-size: 22px;
}

.panel-head p {
    margin: 0;
    max-width: 620px;
    text-align: right;
}

.flash {
    padding: 13px 16px;
    border-left: 5px solid var(--green);
}

.error {
    margin: 16px 0;
    padding: 12px;
    border-radius: 7px;
    color: #fff;
    background: var(--red);
}

.page-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.page-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #33443d;
    text-decoration: none;
    font-weight: 850;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.page-nav a:hover {
    border-color: var(--line);
    background: var(--soft);
}

.page-nav a.active {
    border-color: #0f7047;
    color: #fff;
    background: linear-gradient(180deg, var(--green-2), var(--green));
    box-shadow: 0 10px 24px rgba(18, 107, 67, .22);
}

.subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.subhead h3 {
    margin: 0;
    font-size: 20px;
}

.action-bar,
.status-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-bar {
    align-items: center;
    justify-content: flex-end;
    margin-top: 14px;
}

.status-pills {
    justify-content: flex-end;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 760;
    color: #2a3832;
}

input,
select {
    width: 100%;
    min-height: 43px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 11px;
    background: #fff;
    color: var(--ink);
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

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

.span {
    grid-column: 1 / -1;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

.compact-table table {
    min-width: 420px;
}

.complaint-kpis strong {
    font-size: 18px;
}

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

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--soft);
}

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

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 9px;
    font-weight: 800;
}

.good {
    color: #075032;
    background: #dff4e9;
}

.warn {
    color: #6f4100;
    background: #fff1cf;
}

.empty {
    text-align: center;
    color: var(--muted);
}

.bid-line {
    padding: 5px 0;
    color: var(--muted);
    white-space: nowrap;
}

.bid-line.best {
    color: var(--green);
    font-weight: 850;
}

.inline-delete {
    display: inline;
    margin-left: 8px;
}

.tiny-form {
    margin-top: 6px;
}

.right {
    text-align: right;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.result-grid > div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.result-grid strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
}

.warning-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.warning-card > div {
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.7);
}

.warning-card strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
}

.warning-card.good {
    border-color: #a8d9bf;
    background: #e4f6ec;
}

.warning-card.warn {
    border-color: #edcf8d;
    background: #fff3d6;
}

.warning-card.bad {
    border-color: #ebb1aa;
    background: #ffe3df;
}

.map-frame {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    aspect-ratio: 16 / 9;
    min-height: 520px;
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    display: block;
}

@media (max-width: 980px) {
    .two,
    .form-grid,
    .form-grid.wide,
    .form-grid.compact,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .warning-card {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .topbar,
    .subhead {
        align-items: start;
        flex-direction: column;
    }

    .panel-head p {
        text-align: left;
    }

    .page-nav a {
        flex: 1 1 220px;
    }

    .map-frame,
    .map-frame iframe {
        min-height: 420px;
    }
}
