:root {
    --bg: #f4f7fb;
    --sidebar: #ffffff;
    --ink: #263238;
    --muted: #6b778c;
    --line: #e5eaef;
    --panel: #ffffff;
    --accent: #5d87ff;
    --accent-dark: #3f6ff2;
    --accent-soft: #ecf2ff;
    --success: #13deb9;
    --warn: #fa896b;
    --shadow: 0 12px 30px rgba(90, 106, 133, 0.08);
}

* {
    box-sizing: border-box;
}

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

.app-body {
    min-height: 100vh;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    flex: 0 0 260px;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    align-items: center;
    background: var(--accent);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-nav a {
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    padding: 12px 14px;
    text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.workspace {
    flex: 1;
    min-width: 0;
}

.topbar {
    align-items: center;
    background: transparent;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 24px 30px 8px;
}

.topbar h1,
.topbar p,
h2,
h3 {
    margin: 0;
}

.topbar p,
.eyebrow {
    color: var(--muted);
}

.topbar h1 {
    font-size: 24px;
    line-height: 1.2;
    margin-top: 4px;
}

.topbar p {
    margin-top: 6px;
}

.eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

main {
    padding: 22px 30px 30px;
}

.metrics,
.grid,
.form-grid,
.order-lines {
    display: grid;
    gap: 14px;
}

.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

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

.metrics article {
    padding: 18px;
}

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

.metrics strong {
    display: block;
    font-size: 26px;
    margin-top: 8px;
}

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

.grid.two:has(.panel:only-child) {
    grid-template-columns: 1fr;
}

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

.panel h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

table {
    border-collapse: collapse;
    margin-bottom: 18px;
    width: 100%;
}

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

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

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

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

input,
select {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

button {
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 8px 14px;
}

button:hover {
    background: var(--accent-dark);
}

.logout-form {
    align-items: center;
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.logout-form span {
    color: var(--muted);
    font-size: 14px;
}

.login-page {
    min-height: 100vh;
}

.login-shell {
    align-items: center;
    display: grid;
    min-height: 100vh;
    padding: 20px;
}

.login-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 auto;
    max-width: 420px;
    padding: 24px;
    width: 100%;
}

.login-panel h1,
.login-panel p {
    margin: 0;
}

.login-panel p {
    color: var(--muted);
    margin: 8px 0 18px;
}

.login-panel label {
    display: grid;
    gap: 6px;
}

.login-panel label span {
    color: var(--muted);
    font-size: 13px;
}

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

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

.order-lines label {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

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

.alert,
.success {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert {
    background: #fff4f0;
    border: 1px solid #ffd6ca;
    color: var(--warn);
}

.error-list {
    margin: 0;
    padding-left: 18px;
}

.success {
    background: #e6fffa;
    border: 1px solid #adf5e9;
    color: #0b7b69;
}

@media (max-width: 900px) {
    .admin-shell {
        display: block;
    }

    .sidebar {
        border-bottom: 1px solid var(--line);
        border-right: 0;
        height: auto;
        padding: 16px;
        position: static;
    }

    .brand {
        margin-bottom: 14px;
    }

    .side-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .side-nav a {
        flex: 0 0 auto;
    }

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

    main {
        padding: 18px 16px;
    }

    .metrics,
    .grid.two,
    .form-grid,
    .order-lines,
    .inline-form {
        grid-template-columns: 1fr;
    }
}
