:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #eef2f5;
    --text: #18212b;
    --muted: #627184;
    --line: #d9e0e7;
    --brand: #0057c2;
    --brand-strong: #003f8f;
    --accent: #16a085;
    --danger: #ba2d2d;
    --shadow: 0 10px 28px rgba(24, 33, 43, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a {
    color: var(--brand);
    font-weight: 650;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1120px;
    min-height: 68px;
    padding: 0 20px;
}

.brand {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.nav a,
.nav button,
.button,
button {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 9px 14px;
}

.nav a:hover,
.nav button:hover,
.button:hover,
button:hover {
    background: #e5edf5;
    text-decoration: none;
}

.button-primary,
button[type="submit"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.button-primary:hover,
button[type="submit"]:hover {
    background: var(--brand-strong);
}

.page {
    margin: 0 auto;
    max-width: 1120px;
    padding: 32px 20px 56px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.page-title {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

h1,
h2,
h3 {
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0 0 14px;
}

h2 {
    font-size: clamp(1.7rem, 2.5vw, 2.25rem);
}

h3 {
    font-size: 1.15rem;
    margin-top: 26px;
}

p {
    margin: 0 0 14px;
}

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

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    background: #e8f7f2;
    border: 1px solid #b7e4d7;
    border-radius: 7px;
    color: #0b5e4d;
    padding: 12px 14px;
}

form {
    display: grid;
    gap: 16px;
}

form p {
    margin: 0;
}

label {
    color: var(--muted);
    display: inline-block;
    font-size: 0.92rem;
    font-weight: 750;
    margin-bottom: 7px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #cfd8e3;
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input[type="checkbox"] {
    min-height: auto;
    width: auto;
}

table {
    background: var(--surface);
    border-collapse: collapse;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
}

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

th {
    background: #eef3f8;
    color: #344456;
    font-size: 0.86rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.meta-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.meta-item {
    background: var(--surface-muted);
    border-radius: 8px;
    padding: 14px;
}

.meta-item strong {
    display: block;
    font-size: 1.3rem;
}

.qr-thumb {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.qr-print-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.qr-card {
    align-items: center;
    background: #fff;
    border: 2px solid #17212b;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    padding: 18px;
    text-align: center;
}

.qr-card img {
    height: 180px;
    margin: 12px 0;
    width: 180px;
}

.qr-card-title {
    font-size: 1.25rem;
    font-weight: 850;
}

.qr-card-url {
    color: var(--muted);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.order-shell {
    margin: 0 auto;
    max-width: 640px;
}

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

.menu-product {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
}

.menu-product h3 {
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.product-category {
    background: var(--surface-muted);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 750;
    padding: 4px 9px;
}

.product-order {
    align-items: flex-end;
    display: grid;
    gap: 10px;
    justify-items: end;
}

.quantity-control {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: inline-grid;
    grid-template-columns: 38px 48px 38px;
    overflow: hidden;
}

.quantity-control button {
    border: 0;
    border-radius: 0;
    justify-content: center;
    min-height: 38px;
    padding: 0;
}

.quantity-control input {
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    border-right: 1px solid var(--line);
    min-height: 38px;
    padding: 0;
    text-align: center;
}

.checkout-bar {
    align-items: center;
    background: #101820;
    border-radius: 8px;
    color: #fff;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 4px;
    padding: 16px;
}

.checkout-bar .muted {
    color: #aebaca;
    display: block;
}

.checkout-bar strong {
    font-size: 1.35rem;
}

.payment-methods {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 4px 0 0;
    padding: 14px;
}

.payment-methods legend {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    padding: 0 6px;
}

.payment-method-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.payment-method {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    margin: 0;
    min-height: 48px;
    padding: 10px 12px;
}

.payment-method:has(input:checked) {
    background: #eaf3ff;
    border-color: var(--brand);
    color: var(--brand-strong);
}

.payment-method input {
    min-height: auto;
    width: auto;
}

@media (max-width: 720px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 14px;
        padding-top: 14px;
    }

    .nav {
        justify-content: flex-start;
    }

    th,
    td {
        padding: 12px 10px;
    }

    .menu-product {
        grid-template-columns: 1fr;
    }

    .product-order {
        align-items: center;
        grid-template-columns: 1fr auto;
        justify-items: stretch;
    }

    .checkout-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

@media print {
    body {
        background: #fff;
    }

    .site-header,
    .no-print {
        display: none !important;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .qr-print-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qr-card {
        break-inside: avoid;
        box-shadow: none;
        min-height: 330px;
        page-break-inside: avoid;
    }
}
