:root {
    --bg: #f4f7f2;
    --panel: #ffffff;
    --ink: #15241c;
    --muted: #66756d;
    --green: #1f6b43;
    --green-strong: #16462e;
    --line: #d8e4dc;
    --soft: #eaf2ec;
    --warn: #9b3d24;
    --shadow: 0 18px 45px rgba(22, 70, 46, .10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    min-height: 70px;
    padding: 14px 28px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.brand {
    display: inline-flex;
    align-items: center;
    color: var(--green-strong);
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 0;
    text-decoration: none;
}
.brand span { color: #8fcf2f; }
.top-meta {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    color: var(--muted);
}
.top-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 8px 12px;
}
.top-meta b { color: var(--green-strong); }
.logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}
.logout button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--green-strong);
    padding: 8px 12px;
    font-weight: 750;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 60px;
}
.search-hero {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
    gap: 26px;
    align-items: end;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
    margin-bottom: 0;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: 0;
}
h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}
.search-form { display: grid; gap: 12px; }
.search-box {
    display: grid;
    gap: 6px;
}
.search-box span,
.login-form label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.search-box input,
.login-form input {
    width: 100%;
    min-height: 54px;
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 0 16px;
    outline: 0;
    background: #fbfdfb;
    color: var(--ink);
    font-size: 17px;
}
.search-box input:focus,
.login-form input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(31,107,67,.12);
}
.controls {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}
.segments {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}
.segments button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--green-strong);
    padding: 0 14px;
    font-weight: 750;
}
.segments button.active {
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(22,70,46,.14);
}
.primary {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    padding: 0 20px;
    font-weight: 850;
}

.status-line {
    min-height: 46px;
    display: flex;
    align-items: center;
    color: var(--muted);
}
.result-section {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.section-head span {
    color: var(--muted);
    font-weight: 750;
}
.result-list { display: grid; }
.row {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(180px, .8fr) minmax(115px, .45fr) minmax(130px, .55fr) auto;
    gap: 16px;
    align-items: center;
    min-height: 78px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf2ee;
}
.row:last-child { border-bottom: 0; }
.row strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 16px;
}
.row small,
.muted {
    color: var(--muted);
}
.num {
    color: var(--green-strong);
    font-weight: 850;
    white-space: nowrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--green-strong);
    padding: 0 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--green-strong);
    background: #fff;
    padding: 0 12px;
    text-decoration: none;
    font-weight: 850;
    white-space: nowrap;
}
.empty {
    padding: 26px 20px;
    color: var(--muted);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 28px;
}
.login-brand { margin-bottom: 22px; }
.login-card h1 {
    margin-bottom: 8px;
    font-size: 30px;
}
.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}
.login-form label { display: grid; gap: 6px; }
.alert {
    margin-top: 16px;
    border: 1px solid #f0c6b7;
    border-radius: 8px;
    background: #fff2ed;
    color: var(--warn);
    padding: 12px;
}

@media (max-width: 840px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 14px 18px;
    }
    .top-meta { justify-content: flex-start; flex-wrap: wrap; }
    .logout { justify-content: space-between; }
    .search-hero { grid-template-columns: 1fr; padding: 20px; }
    h1 { font-size: 28px; }
    .controls { align-items: stretch; flex-direction: column; }
    .segments { width: 100%; }
    .segments button { flex: 1; padding: 0 8px; }
    .row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .actions { justify-content: flex-start; }
}

