:root {
    --tomato: #c9271e;
    --tomato-dark: #8f1712;
    --cream: #fff6e3;
    --paper: #fffdf6;
    --charcoal: #1f1c18;
    --muted: #70675f;
    --gold: #f5b72f;
    --green: #22744c;
    --orange: #c86a12;
    --danger: #a81d18;
    --line: #eadfc9;
    --shadow: 0 10px 30px rgba(31, 28, 24, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    color: var(--charcoal);
    background: var(--cream);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: var(--tomato-dark);
    font-weight: 800;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 246, 227, 0.96);
    border-bottom: 2px solid var(--charcoal);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 950;
    font-size: 1rem;
}

.brand img {
    width: 40px;
    height: 40px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    object-fit: cover;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.header-nav a {
    color: var(--charcoal);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

.page-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    padding: 18px 14px 42px;
}

.admin-shell {
    width: min(100%, 1180px);
}

.narrow {
    max-width: 680px;
}

.hero {
    position: relative;
    min-height: calc(100vh - 86px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 34px 0 28px;
}

.hero::after {
    content: "";
    width: min(52vw, 210px);
    aspect-ratio: 1;
    background: url("/assets/images/pizza-king-mark.png") center / cover no-repeat;
    border: 3px solid var(--charcoal);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero h1,
.panel h1,
.kitchen-hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 12vw, 4.5rem);
    line-height: 0.95;
    font-weight: 950;
}

.panel h1,
.kitchen-hero h1 {
    font-size: clamp(1.9rem, 8vw, 3.4rem);
}

.hero h2,
.panel h2 {
    margin: 0 0 10px;
    font-size: 1.4rem;
}

.lead {
    max-width: 620px;
    color: #332b25;
    font-size: 1.1rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--tomato-dark);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.eyebrow.success {
    color: var(--green);
}

.eyebrow.danger {
    color: var(--danger);
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--paper);
    color: var(--charcoal);
    box-shadow: 3px 3px 0 var(--charcoal);
    font: inherit;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    background: var(--tomato);
    color: #fff;
}

.button.secondary {
    background: var(--gold);
}

.button.danger {
    background: var(--danger);
    color: #fff;
}

.button.disabled,
.button:disabled {
    cursor: not-allowed;
    color: #6e6760;
    background: #e4d8c4;
    box-shadow: none;
}

.button.small {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.button.full {
    width: 100%;
}

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

.quick-facts span,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--paper);
    font-weight: 850;
}

.panel {
    margin: 14px 0;
    padding: 18px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

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

.flash {
    margin: 12px 0;
    padding: 12px 14px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--gold);
    font-weight: 800;
}

.flash.error {
    background: #f7cac2;
}

.flash.success {
    background: #caead5;
}

.progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.progress li {
    padding: 8px 6px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--paper);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 950;
}

.progress li.active {
    background: var(--gold);
}

.day-grid,
.slot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.choice-card,
.slot-button {
    width: 100%;
    display: flex;
    min-height: 82px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 14px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
    color: var(--charcoal);
    text-align: left;
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--charcoal);
}

.choice-card.selected,
.slot-button:focus {
    background: var(--gold);
}

.choice-card.disabled,
.slot-button.sold-out {
    opacity: 0.55;
    box-shadow: none;
}

.slot-form {
    margin: 0;
}

.collection-summary h1 {
    font-size: clamp(1.4rem, 6vw, 2.4rem);
}

.menu-layout,
.account-grid,
.dashboard-grid,
.kitchen-order {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.menu-list {
    display: grid;
    gap: 12px;
}

.pizza-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--paper);
}

.pizza-card h2 {
    margin: 0 0 6px;
}

.pizza-art {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--gold);
    font-size: 1.8rem;
}

.add-form,
.stack-form,
.grid-form {
    display: grid;
    gap: 12px;
}

label span,
legend {
    display: block;
    margin-bottom: 6px;
    font-size: 0.86rem;
    font-weight: 900;
}

input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
    color: var(--charcoal);
    font: inherit;
}

textarea {
    resize: vertical;
}

.quantity-control {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 8px;
}

.quantity-control span {
    margin: 0;
}

.toppings-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 2px dashed var(--charcoal);
    border-radius: 8px;
}

.toppings-box.compact {
    margin-top: 8px;
    padding: 8px;
}

.check-pill {
    display: inline-flex;
}

.check-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-pill span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 8px 10px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
}

.check-pill input:checked + span {
    background: var(--gold);
}

.mini-details {
    margin-top: 8px;
}

.mini-details summary {
    cursor: pointer;
    color: var(--tomato-dark);
    font-weight: 900;
}

.cart-panel {
    position: sticky;
    bottom: 0;
    padding: 14px;
    border: 2px solid var(--charcoal);
    border-radius: 8px 8px 0 0;
    background: var(--cream);
    box-shadow: 0 -8px 24px rgba(31, 28, 24, 0.16);
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr 76px auto;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line small,
.table-wrap small {
    display: block;
    color: var(--muted);
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 1.1rem;
}

.sticky-cta {
    width: 100%;
}

.hold-banner {
    position: sticky;
    top: 62px;
    z-index: 15;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--gold);
    font-weight: 900;
}

.hold-banner.expired {
    background: #f7cac2;
}

.review-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.review-list dt {
    color: var(--muted);
    font-weight: 900;
}

.review-list dd {
    margin: 0 0 10px;
}

.status-card {
    margin: 14px 0;
    padding: 14px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
}

.status-card.warning,
.badge.warning {
    background: #ffe0a6;
}

.status-card.success,
.badge.success {
    background: #cdeed6;
}

.status-card.danger,
.badge.danger {
    background: #f6c6bf;
}

.empty-state {
    padding: 18px;
    border: 2px dashed var(--charcoal);
    border-radius: 8px;
    background: #fff8ea;
}

.section-head,
.kitchen-hero,
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kitchen-hero {
    margin-bottom: 14px;
    padding: 18px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: var(--gold);
    box-shadow: var(--shadow);
}

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

.stat-grid div {
    padding: 12px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
}

.stat-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
}

.stat-grid strong {
    font-size: 2rem;
}

.order-list {
    display: grid;
    gap: 8px;
}

.order-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
    color: var(--charcoal);
    text-decoration: none;
}

.new-order,
.table-warning {
    background: #fff0bc;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: #fff;
}

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

th {
    color: var(--tomato-dark);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.grid-form {
    grid-template-columns: 1fr;
}

.grid-form .full {
    grid-column: 1 / -1;
}

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

.checkbox-row input {
    width: 22px;
    min-height: 22px;
}

.checkbox-row span {
    margin: 0;
}

.danger-form,
.inline-delete {
    margin-top: 12px;
}

.slot-admin-list {
    display: grid;
    gap: 8px;
}

.slot-admin-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 8px;
}

.inline-form {
    display: inline;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0 12px;
}

.filter-tabs a {
    padding: 8px 10px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff;
    color: var(--charcoal);
    text-decoration: none;
    white-space: nowrap;
}

.filter-tabs a.active {
    background: var(--gold);
}

.live-orders-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px;
    padding: 12px;
    border: 2px solid var(--charcoal);
    border-radius: 8px;
    background: #fff8df;
}

.live-waiting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-waiting small {
    display: block;
    color: var(--muted);
}

.live-spinner {
    width: 26px;
    height: 26px;
    border: 4px solid #f4d58c;
    border-top-color: var(--tomato);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.live-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 14px;
    border: 3px solid var(--charcoal);
    border-radius: 8px;
    background: var(--tomato);
    color: #fff;
    box-shadow: 4px 4px 0 var(--charcoal);
    font-size: 1.05rem;
}

.live-alert strong {
    font-size: 1.25rem;
}

.new-order-arrived {
    animation: orderPulse 1s ease-in-out 8;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes orderPulse {
    0%,
    100% {
        outline: 0 solid rgba(201, 39, 30, 0);
    }
    50% {
        outline: 5px solid rgba(201, 39, 30, 0.6);
    }
}

.big-time {
    font-size: 1.3rem;
    font-weight: 950;
}

.order-item {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.timeline {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.timeline li {
    padding-left: 4px;
}

.timeline span,
.timeline small {
    display: block;
    color: var(--muted);
}

.site-footer {
    display: grid;
    gap: 4px;
    padding: 24px 14px;
    border-top: 2px solid var(--charcoal);
    background: var(--charcoal);
    color: var(--cream);
    text-align: center;
}

code {
    padding: 2px 4px;
    border-radius: 4px;
    background: #f2e3c7;
}

@media (min-width: 680px) {
    .page-shell {
        padding: 28px 22px 58px;
    }

    .hero {
        min-height: 620px;
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
        align-items: center;
        column-gap: 36px;
    }

    .hero::after {
        grid-row: 1 / span 4;
        grid-column: 2;
        width: 100%;
    }

    .quick-facts,
    .day-grid,
    .slot-grid,
    .dashboard-grid,
    .account-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .pizza-card {
        grid-template-columns: 70px 1fr;
    }

    .pizza-card form {
        grid-column: 1 / -1;
    }

    .order-row {
        grid-template-columns: 70px 1fr 110px 150px;
    }

    .slot-admin-row {
        grid-template-columns: 160px 120px 150px 1fr auto;
        align-items: end;
    }
}

@media (min-width: 960px) {
    .menu-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        align-items: start;
    }

    .cart-panel {
        top: 86px;
        bottom: auto;
        border-radius: 8px;
    }

    .kitchen-order {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        align-items: start;
    }
}
