:root {
    --bg: #f4f0ea;
    --surface: #fffdfa;
    --surface-2: #edf5f2;
    --ink: #172226;
    --muted: #34454d;
    --line: #b8c5bf;
    --brand: #155b61;
    --violet: #70496f;
    --accent: #c98244;
    --danger: #b5454d;
    --ok: #2e7352;
    --shadow: 0 16px 42px rgba(28, 43, 48, 0.10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(255, 253, 250, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 850; text-decoration: none; }
.brand img { width: clamp(190px, 18vw, 270px); height: auto; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--brand); color: white; }
.admin-shell { max-width: 1440px; margin: 0 auto; padding: 28px; }

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 60px;
    align-items: center;
    min-height: calc(100vh - 110px);
}
.login-panel h1 { max-width: 700px; margin: 0; font-size: clamp(40px, 6vw, 70px); line-height: 1.04; }
.login-panel p { max-width: 640px; color: var(--muted); font-size: 19px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 12px; font-weight: 850; text-transform: uppercase; }

.admin-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.admin-nav {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 6px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.nav-item {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 9px 12px;
    text-align: left;
    font-weight: 780;
}
.nav-item.active { color: var(--brand); background: var(--surface-2); }

.admin-workspace { min-width: 0; display: grid; gap: 16px; }
.view { display: none; }
.view.active { display: grid; gap: 16px; }
.heading { display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.heading h2 { margin: 0; font-size: 36px; }
.status { min-height: 28px; color: var(--brand); font-weight: 800; }

.card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.form, .form-grid { display: grid; gap: 14px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 650; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5d1;
    border-radius: 7px;
    background: white;
    color: var(--ink);
    padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(201, 130, 68, 0.35); outline-offset: 2px; }

.primary, .secondary, .ghost {
    min-height: 42px;
    border-radius: 7px;
    border: 1px solid transparent;
    padding: 9px 14px;
    font-weight: 750;
}
.primary { background: var(--brand); color: white; }
.secondary { background: white; color: var(--brand); border-color: var(--brand); }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.metric { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.metric strong { display: block; font-size: 30px; line-height: 1.15; }
.toolbar { display: flex; gap: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.badge { display: inline-flex; min-height: 26px; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--brand); font-weight: 850; font-size: 13px; }
.badge.critical, .badge.high { color: white; background: var(--danger); }
.badge.medium { color: var(--ink); background: #f5dfc7; }
.detail { display: grid; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.price-row {
    display: grid;
    grid-template-columns: 1.1fr repeat(3, minmax(120px, 0.75fr));
    gap: 12px;
    align-items: end;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.price-row strong { align-self: center; }

@media (max-width: 980px) {
    .login-panel, .admin-layout, .metric-grid, .form-grid, .price-row { grid-template-columns: 1fr; }
    .admin-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    body {
        background: #ffffff;
        font-size: 18px;
        line-height: 1.6;
    }

    .admin-topbar {
        padding: 8px;
    }

    .brand img {
        width: min(160px, 48vw);
    }

    .admin-shell {
        padding: 8px;
    }

    .login-panel {
        gap: 14px;
        align-items: start;
        min-height: calc(100svh - 58px);
    }

    .login-panel h1 {
        font-size: 32px;
        line-height: 1.08;
    }

    .login-panel p {
        margin: 0;
        color: #26343a;
        font-size: 18px;
        line-height: 1.38;
    }

    .eyebrow {
        font-size: 12px;
        font-weight: 700;
    }

    .card {
        padding: 14px;
        box-shadow: none;
        overflow-x: auto;
    }

    input,
    select,
    textarea {
        min-height: 48px;
        padding: 9px 10px;
        border-color: #9fb0aa;
        font-size: 18px;
    }

    .primary,
    .secondary,
    .ghost,
    .nav-item {
        min-height: 48px;
        font-size: 17px;
        font-weight: 700;
    }

    .admin-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        scrollbar-width: thin;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .heading {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }

    .heading h2 {
        font-size: 32px;
    }

    .toolbar {
        flex-direction: column;
    }

    .table {
        min-width: 720px;
        font-size: 16px;
    }

    .table th {
        font-size: 14px;
    }
}
