/* Theme */
:root {
    color-scheme: light;
    --ink: #263b32;
    --muted: #718078;
    --line: #e3e9e4;
    --green: #276047;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f6f8f5;
    color: var(--ink);
    font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Page header */
header {
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

header strong {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.4px;
    color: var(--green);
}

/* Desktop layout and recipe navigation */
main {
    display: flex;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
}

aside {
    width: clamp(225px, 21vw, 285px);
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 14px;
    background: #fff;
    border-right: 1px solid var(--line);
}

label {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
}

.muted {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: #f8faf7;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    outline-offset: 2px;
}

input::placeholder {
    color: #7b8780;
}

nav {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #ced9d0 transparent;
}

nav a {
    display: block;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 7px;
    text-decoration: none;
    color: #526057;
    line-height: 1.45;
    transition: background .12s;
}

nav a:hover {
    background: #f2f6f1;
    color: var(--ink);
}

nav a[aria-current] {
    background: #eaf2e9;
    color: #205239;
    font-weight: 600;
    box-shadow: inset 3px 0 #43805b;
}

/* Keyboard focus */
:focus-visible {
    outline: 2px solid #43805b;
    outline-offset: 2px;
}

/* Recipe content */
.workspace {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
}

.heading {
    flex-shrink: 0;
}

h1 {
    margin: 0;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -.6px;
    overflow-wrap: anywhere;
}

.grid {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ced9d0 transparent;
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.grid td {
    padding: 11px 12px;
    border-right: 1px solid #edf0ec;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.65;
    font-variant-numeric: tabular-nums;
}

td:last-child {
    border-right: 0;
}

tr:last-child td {
    border-bottom: 0;
}

/* Utility states */
.empty {
    padding: 12px;
    color: var(--muted);
}

[hidden] {
    display: none !important;
}

/* Tablets and smaller screens */
@media (max-width: 900px) {
    header {
        height: 48px;
        padding: 0 16px;
    }

    header strong {
        font-size: 17px;
    }

    main {
        height: calc(100vh - 48px);
        height: calc(100dvh - 48px);
        flex-direction: column;
    }

    aside {
        width: 100%;
        padding: 10px 14px 6px;
        gap: 7px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    label {
        padding: 0;
        font-size: 12px;
    }

    input {
        font-size: 16px;
        min-height: 40px;
        padding: 8px 11px;
    }

    nav {
        display: flex;
        flex-shrink: 0;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 9px 12px;
        margin: 0;
        font-size: 13px;
    }

    nav a[aria-current] {
        box-shadow: inset 0 -2px #43805b;
    }

    .workspace {
        padding: 14px;
        gap: 12px;
    }

    h1 {
        font-size: 21px;
    }

    .grid td {
        padding: 9px 8px;
        font-size: 14px;
        line-height: 1.55;
    }

}

/* Staff sign-in */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.login-card p {
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 12px;
}

.login-card label {
    padding: 0;
}

.login-card input {
    font-size: 16px;
}

.login-card button,
.logout-form button {
    border: 0;
    border-radius: 7px;
    padding: 11px 16px;
    background: var(--green);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.login-card .login-error {
    margin: 0;
    color: #a12e2e;
}

.logout-form {
    margin-left: auto;
}

.logout-form button {
    padding: 7px 12px;
    background: #eaf2e9;
    color: var(--green);
}

/* Phones */
@media (max-width: 480px) {
    .workspace {
        padding: 10px 6px;
        gap: 10px;
    }

    .heading {
        padding: 0 6px;
    }

    h1 {
        font-size: 19px;
    }

    .grid {
        border-radius: 7px;
    }

    .grid td {
        padding: 8px 5px;
        font-size: 11px;
    }

}
