:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #f1f5f4;
    --ink: #16202a;
    --muted: #66717f;
    --line: #dfe5e8;
    --primary: #0f766e;
    --primary-dark: #0a4d48;
    --accent: #e95d3f;
    --amber: #f59e0b;
    --cyan: #0ea5b7;
    --success: #17a36b;
    --danger: #dc2626;
    --shadow: 0 12px 30px rgba(22, 32, 42, 0.08);
    --radius: 8px;
    --sidebar: 280px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color: var(--ink);
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button {
    gap: 8px;
    padding: 0 16px;
    font-weight: 800;
}

.button svg,
.icon-button svg {
    width: 18px;
    height: 18px;
}

.button:hover,
.icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.4);
}

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

.danger-button {
    border-color: rgba(220, 38, 38, 0.28);
    color: var(--danger);
}

.button.ghost {
    background: var(--surface-soft);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    padding: 0;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.field input,
.field textarea,
.field select,
.top-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    outline: none;
}

.field input,
.field select {
    min-height: 44px;
    padding: 0 12px;
}

.field textarea {
    padding: 12px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.top-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.readonly-value {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--ink);
}

.check-line,
.priority-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.check-line input,
.priority-line input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-weight: 900;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup p,
.brand-lockup h1,
.brand-lockup h2 {
    margin: 0;
}

.brand-lockup p {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.brand-lockup h1,
.brand-lockup h2 {
    font-size: 1.15rem;
}

.status-pill,
.mini-badge,
.priority-badge,
.table-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.status-pill {
    background: #eef2f4;
    color: var(--muted);
}

.tone-new {
    background: #e0f2fe;
    color: #036982;
}

.tone-work {
    background: #fff4d6;
    color: #8a5a00;
}

.tone-ready {
    background: #dff7ed;
    color: #08704a;
}

.tone-delivery {
    background: #eef2ff;
    color: #3345a0;
}

.tone-done {
    background: #dcfce7;
    color: #15803d;
}

.tone-muted {
    background: #eef0f2;
    color: #69737e;
}

.priority-badge {
    background: #fee2e2;
    color: #be123c;
}

.priority-badge svg,
.table-badge svg,
.promo-pill svg {
    width: 16px;
    height: 16px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-weight: 800;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state,
.empty-panel {
    display: grid;
    place-items: center;
    min-height: 70vh;
    padding: 32px;
    text-align: center;
}

.empty-panel {
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-panel svg {
    width: 42px;
    height: 42px;
    color: var(--muted);
}

/* Landing */
.landing-app {
    background: #ffffff;
}

.landing-page {
    min-height: 100vh;
    background: #ffffff;
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px max(18px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid rgba(223, 229, 232, 0.86);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.landing-nav nav,
.landing-auth,
.landing-hero-actions,
.contact-list,
.public-restaurants {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav nav a {
    color: var(--muted);
    font-weight: 900;
}

.landing-nav nav a:hover {
    color: var(--primary);
}

.landing-hero {
    display: flex;
    align-items: flex-end;
    min-height: min(760px, calc(100vh - 72px));
    padding: 110px max(18px, calc((100vw - 1180px) / 2)) 74px;
    background:
        linear-gradient(90deg, rgba(10, 28, 31, 0.86), rgba(10, 28, 31, 0.45), rgba(10, 28, 31, 0.18)),
        url("https://images.unsplash.com/photo-1552566626-52f8b828add9?auto=format&fit=crop&w=1800&q=76") center/cover;
    color: #fff;
}

.landing-hero-content {
    width: min(680px, 100%);
}

.landing-hero .eyebrow {
    color: rgba(255, 255, 255, 0.76);
}

.landing-hero h2 {
    margin: 10px 0 16px;
    font-size: clamp(3rem, 10vw, 6.5rem);
    line-height: 0.92;
}

.landing-hero p {
    max-width: 58ch;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.15rem;
    line-height: 1.55;
}

.landing-hero-actions {
    flex-wrap: wrap;
    margin-top: 26px;
}

.landing-band {
    padding: 70px max(18px, calc((100vw - 1180px) / 2));
}

.landing-band.alt {
    background: #f6f7f9;
}

.landing-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.landing-section-head h2,
.contact-layout h2 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.02;
}

.feature-grid,
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

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

.feature-grid article,
.pricing-grid article,
.access-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(22, 32, 42, 0.05);
}

.feature-grid article,
.pricing-grid article {
    padding: 20px;
}

.feature-grid svg {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.feature-grid h3,
.pricing-grid h3,
.access-panel h3 {
    margin: 14px 0 8px;
}

.feature-grid p,
.pricing-grid p,
.contact-layout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.text-link {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    color: var(--primary);
    font-weight: 900;
}

.product-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--line);
}

.product-strip div {
    min-height: 150px;
    padding: 18px;
    background: #fff;
}

.product-strip strong,
.product-strip span,
.pricing-grid span,
.pricing-grid strong {
    display: block;
}

.product-strip strong {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.product-strip span {
    color: var(--muted);
    line-height: 1.45;
}

.pricing-grid article.featured {
    border-color: rgba(15, 118, 110, 0.38);
    background: #ecfdf7;
}

.pricing-grid span {
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
}

.pricing-grid strong {
    margin: 10px 0;
    font-size: 2rem;
}

.service-access-grid article {
    display: grid;
    gap: 12px;
    align-content: start;
}

.service-access-grid .button {
    justify-self: start;
    margin-top: 4px;
}

.price-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 26px;
    align-items: start;
}

.contact-layout > div:first-child {
    display: grid;
    gap: 16px;
}

.contact-list {
    align-items: flex-start;
    flex-direction: column;
}

.contact-list a,
.contact-list span,
.public-restaurants a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 900;
}

.contact-list svg,
.public-restaurants svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.access-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.access-panel h3 {
    margin: 0 0 4px;
}

.public-restaurants {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.public-restaurants > span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* Client */
.client-app {
    background: #f8f5ef;
}

.login-app {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 18px;
    background:
        linear-gradient(rgba(22, 32, 42, 0.62), rgba(22, 32, 42, 0.72)),
        url("https://images.unsplash.com/photo-1514933651103-005eec06c04b?auto=format&fit=crop&w=1400&q=72") center/cover;
}

.login-shell {
    width: min(420px, 100%);
}

.login-card {
    display: grid;
    gap: 18px;
    padding: 26px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.login-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

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

.client-shell {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 16px 96px;
    background: #fffdfa;
}

.client-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -18px -16px 14px;
    padding: 18px 16px 12px;
    border-bottom: 1px solid rgba(223, 229, 232, 0.8);
    background: rgba(255, 253, 250, 0.94);
    backdrop-filter: blur(12px);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -4px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.client-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    min-height: 180px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: var(--radius);
    background:
        linear-gradient(rgba(22, 32, 42, 0.15), rgba(22, 32, 42, 0.62)),
        url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?auto=format&fit=crop&w=1200&q=72") center/cover;
    color: #fff;
}

.client-hero h2 {
    max-width: 390px;
    margin: 10px 0 8px;
    font-size: clamp(1.65rem, 8vw, 2.5rem);
    line-height: 1;
}

.client-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
}

.table-badge {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.category-strip,
.promo-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 12px;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar,
.promo-row::-webkit-scrollbar {
    display: none;
}

.chip,
.promo-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.chip {
    padding: 0 15px;
    cursor: pointer;
}

.chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.promo-pill {
    gap: 8px;
    padding: 0 12px;
    color: #8a4b00;
    background: #fff7db;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.28rem;
}

.section-heading > span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

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

.dish {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border: 1px solid #ece6dc;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(22, 32, 42, 0.05);
}

.dish.is-disabled {
    opacity: 0.55;
}

.dish img {
    width: 132px;
    height: 132px;
    border-radius: var(--radius);
    object-fit: cover;
}

.dish-body {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.dish-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.dish-title h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.dish-title p {
    display: -webkit-box;
    max-width: 32ch;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dish-title strong {
    white-space: nowrap;
}

.dish-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dish-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.dish-meta svg {
    width: 15px;
    height: 15px;
}

.mini-badge.warm {
    background: #ffe7d6;
    color: #9a3412;
}

.mini-badge.cool {
    background: #dff7ed;
    color: #08704a;
}

.dish .button {
    align-self: end;
    justify-self: start;
    min-height: 38px;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(420px, 100%);
    height: 100vh;
    padding: 22px;
    background: #fff;
    box-shadow: -20px 0 40px rgba(22, 32, 42, 0.18);
    transform: translateX(105%);
    transition: transform 0.22s ease;
}

.cart-panel.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-header h2,
.otp-dialog h2,
.order-toast h3 {
    margin: 0;
}

.cart-items {
    display: grid;
    gap: 10px;
    overflow-y: auto;
}

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

.cart-item img {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    object-fit: cover;
}

.cart-item h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.cart-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-control button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.priority-line {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.priority-line strong,
.priority-line small {
    display: block;
}

.priority-line small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.cart-total strong {
    font-size: 1.35rem;
}

.panel-backdrop,
.otp-modal {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: none;
    background: rgba(22, 32, 42, 0.45);
}

.panel-backdrop.open,
.otp-modal.open {
    display: block;
}

.otp-modal {
    z-index: 80;
    place-items: center;
    padding: 18px;
}

.otp-modal.open {
    display: grid;
}

.otp-dialog {
    position: relative;
    display: grid;
    gap: 14px;
    width: min(420px, 100%);
    padding: 26px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.otp-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.otp-visual {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: var(--radius);
    background: #e0f2fe;
    color: #036982;
}

.otp-visual svg {
    width: 38px;
    height: 38px;
}

.otp-dialog p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.otp-inputs input {
    width: 100%;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1.35rem;
    font-weight: 900;
}

.order-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    width: min(360px, calc(100% - 36px));
    padding: 16px;
    border: 1px solid #bfe8d8;
    border-radius: var(--radius);
    background: #f0fdf4;
    box-shadow: var(--shadow);
}

/* Station */
.station-shell {
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.station-topbar,
.page-title,
.panel-head,
.staff-order-head,
.staff-order-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.station-topbar h1,
.page-title h1 {
    margin: 0;
    font-size: 2rem;
}

.station-topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.station-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.station-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.station-stats div,
.metric-grid article,
.panel,
.staff-order {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(22, 32, 42, 0.05);
}

.station-stats div {
    padding: 18px;
}

.station-stats span,
.metric-grid span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.station-stats strong,
.metric-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
}

.order-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.staff-order {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.staff-order h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.order-id {
    color: var(--muted);
    font-weight: 900;
}

.order-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.order-lines,
.rank-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-lines li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.order-lines strong {
    color: var(--primary);
}

.order-lines em {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
}

.order-note {
    margin: 0;
    padding: 10px;
    border-radius: var(--radius);
    background: #fff7db;
    color: #8a4b00;
    font-weight: 700;
}

.staff-order-foot {
    color: var(--muted);
}

.order-actions,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form {
    display: inline;
}

.reset-access-form {
    display: grid;
    grid-template-columns: 150px 110px auto;
    gap: 8px;
    align-items: end;
    width: min(430px, 100%);
    padding-top: 8px;
}

.compact-field {
    gap: 4px;
    font-size: 0.74rem;
}

.compact-field input {
    min-height: 36px;
}

.subscription-panel {
    margin-bottom: 18px;
}

.subscription-price-form {
    display: grid;
    gap: 12px;
}

.subscription-price-row {
    display: grid;
    grid-template-columns: 120px 130px 120px minmax(240px, 1fr);
    gap: 10px;
    align-items: end;
}

.restaurant-plan-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.restaurant-plan-form select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-weight: 800;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-actions .button {
    justify-content: flex-start;
    width: 100%;
}

.menu-edit-page-form {
    width: min(760px, 100%);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Admin */
.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

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

.admin-sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 26px;
}

.admin-sidebar nav a,
.customer-site {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--muted);
    font-weight: 900;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
    background: var(--ink);
    color: #fff;
}

.admin-sidebar svg {
    width: 20px;
    height: 20px;
}

.customer-site {
    margin-top: auto;
    background: var(--surface-soft);
    color: var(--ink);
}

.admin-content {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 74px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 247, 249, 0.9);
    backdrop-filter: blur(12px);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(520px, 100%);
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.top-search svg {
    width: 18px;
    color: var(--muted);
}

.top-search input {
    min-width: 0;
    min-height: 38px;
    padding: 0;
    border: 0;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 900;
}

.restaurant-switch {
    margin-left: auto;
}

.logout-form {
    margin: 0;
}

.restaurant-switch label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
}

.restaurant-switch select {
    min-width: 190px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-weight: 900;
}

.restaurant-switch.locked strong {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dff7ed;
    color: var(--primary-dark);
    font-weight: 900;
}

.admin-main {
    padding: 28px;
}

.page-title {
    margin-bottom: 20px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-grid article {
    padding: 18px;
}

.metric-grid small {
    color: var(--success);
    font-weight: 800;
}

.admin-columns {
    display: grid;
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
    gap: 18px;
    align-items: start;
}

.admin-columns .wide {
    min-width: 0;
}

.panel {
    padding: 18px;
}

.panel-head {
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.08rem;
}

.panel-head a {
    color: var(--primary);
    font-weight: 900;
}

.compact-orders {
    display: grid;
    gap: 10px;
}

.compact-orders article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.compact-orders strong,
.compact-orders span {
    display: block;
}

.compact-orders span {
    margin-top: 3px;
    color: var(--muted);
}

.rank-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.rank-list span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff7db;
    color: #8a4b00;
    font-weight: 900;
}

.rank-list em {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.data-table td > span,
.table-product span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.table-product {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-product img {
    width: 54px;
    height: 54px;
    border-radius: var(--radius);
    object-fit: cover;
}

.form-panel {
    display: grid;
    gap: 13px;
}

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

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

.settings-form {
    display: grid;
    gap: 16px;
}

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

.settings-toggles .check-line {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-filters {
    margin-bottom: 12px;
}

.qr-thumb {
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* Invoice */
.invoice-app {
    background: #eef2f4;
}

.invoice-shell {
    width: min(880px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0;
}

.invoice-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.invoice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.invoice-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.invoice-meta div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.invoice-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.invoice-meta strong {
    display: block;
    margin-top: 5px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: 13px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.invoice-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.invoice-totals {
    display: grid;
    gap: 8px;
    width: min(360px, 100%);
    margin: 22px 0 0 auto;
}

.invoice-totals div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.invoice-totals span {
    color: var(--muted);
}

.grand-total {
    padding-top: 10px;
    border-top: 2px solid var(--ink);
    font-size: 1.2rem;
}

.invoice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

@media (max-width: 1100px) {
    .landing-nav {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .landing-nav nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .feature-grid,
    .pricing-grid,
    .contact-layout {
        grid-template-columns: 1fr 1fr;
    }

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

    .admin-shell {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .admin-sidebar {
        padding-inline: 12px;
    }

    .admin-sidebar .brand-lockup div:last-child,
    .admin-sidebar nav span,
    .customer-site {
        display: none;
    }

    .admin-sidebar nav a {
        justify-content: center;
        padding: 0;
    }

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

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

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

@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .landing-nav {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .landing-nav nav,
    .landing-auth {
        width: 100%;
        overflow-x: auto;
    }

    .landing-auth .button {
        flex: 1 0 auto;
    }

    .landing-hero {
        min-height: 620px;
        padding: 82px 16px 46px;
        background:
            linear-gradient(rgba(10, 28, 31, 0.82), rgba(10, 28, 31, 0.48)),
            url("https://images.unsplash.com/photo-1552566626-52f8b828add9?auto=format&fit=crop&w=900&q=74") center/cover;
    }

    .landing-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .landing-band {
        padding: 46px 14px;
    }

    .landing-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .feature-grid,
    .pricing-grid,
    .contact-layout,
    .product-strip {
        grid-template-columns: 1fr;
    }

    .client-shell {
        padding-inline: 12px;
    }

    .client-topbar {
        margin-inline: -12px;
        padding-inline: 12px;
    }

    .top-actions .admin-shortcut {
        display: none;
    }

    .client-hero {
        align-items: flex-start;
        flex-direction: column;
        min-height: 210px;
    }

    .dish {
        grid-template-columns: 104px minmax(0, 1fr);
    }

    .dish img {
        width: 104px;
        height: 124px;
    }

    .dish-title {
        display: grid;
    }

    .dish .button {
        width: 100%;
    }

    .station-shell,
    .invoice-shell {
        width: min(100% - 22px, 100%);
    }

    .station-topbar,
    .page-title,
    .invoice-head {
        align-items: stretch;
        flex-direction: column;
    }

    .station-stats,
    .order-board,
    .metric-grid,
    .admin-columns,
    .subscription-price-row,
    .form-grid,
    .form-grid.three,
    .settings-toggles,
    .invoice-meta {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        display: block;
        padding-bottom: 72px;
    }

    .admin-sidebar {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 60;
        display: block;
        width: 100%;
        height: 66px;
        padding: 8px;
        border-top: 1px solid var(--line);
        border-right: 0;
    }

    .admin-sidebar .brand-lockup,
    .admin-sidebar nav a:nth-child(n+6) {
        display: none;
    }

    .admin-sidebar nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        margin: 0;
    }

    .admin-sidebar nav a {
        min-height: 50px;
    }

    .admin-topbar {
        height: auto;
        padding: 12px;
    }

    .admin-profile {
        display: none;
    }

    .restaurant-switch {
        width: 100%;
        margin-left: 0;
    }

    .restaurant-switch label {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .restaurant-switch select {
        width: 100%;
    }

    .admin-main {
        padding: 18px 12px;
    }

    .data-table {
        min-width: 980px;
    }

    .panel {
        overflow-x: auto;
    }

    .compact-orders article {
        grid-template-columns: 1fr;
    }

    .invoice-card {
        padding: 18px;
    }
}

@media print {
    .admin-sidebar,
    .admin-topbar,
    .invoice-actions,
    .button,
    .icon-button {
        display: none !important;
    }

    body,
    .invoice-app {
        background: #fff;
    }

    .invoice-shell {
        width: 100%;
        padding: 0;
    }

    .invoice-card {
        border: 0;
        box-shadow: none;
    }
}
