:root {
    color-scheme: light;
    --forest: #173f2a;
    --leaf: #2f7a45;
    --gold: #f0b84f;
    --cream: #f7f0df;
    --paper: rgba(255, 255, 255, 0.86);
    --ink: #192319;
    --muted: #64705f;
    --line: rgba(54, 45, 31, 0.14);
    --danger: #b4233a;
    --success: #14804f;
    --shadow: 0 24px 70px rgba(37, 30, 18, 0.14);
    --radius: 24px;
    font-family: "Trebuchet MS", "Aptos", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(240, 184, 79, 0.25), transparent 24rem),
        radial-gradient(circle at 88% 16%, rgba(47, 122, 69, 0.18), transparent 22rem),
        linear-gradient(145deg, #fbf6ea, #eee2cc 55%, #f7f0df);
    color: var(--ink);
}

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

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

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

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-wrap {
    display: grid;
    width: min(1040px, 100%);
    grid-template-columns: 1.1fr 420px;
    gap: 24px;
    align-items: stretch;
}

.login-hero,
.login-card,
.panel,
.sidebar,
.topbar,
.metric,
.mini-card,
.product-card,
.table-card,
.order-card {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-hero {
    min-height: 520px;
    border-radius: 34px;
    padding: clamp(28px, 5vw, 54px);
    background:
        linear-gradient(135deg, rgba(23, 63, 42, 0.9), rgba(47, 122, 69, 0.72)),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,.14)'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E");
    color: white;
}

.login-hero h1,
.qr-hero h1 {
    margin: 24px 0 12px;
    max-width: 680px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.95;
}

.login-hero p,
.qr-hero p {
    max-width: 580px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
    line-height: 1.65;
}

.login-card {
    display: grid;
    align-content: center;
    gap: 18px;
    border-radius: 34px;
    padding: 32px;
}

.brand-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(240, 184, 79, 0.18);
    color: var(--forest);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    padding: 9px 13px;
    text-transform: uppercase;
}

.login-hero .brand-pill,
.qr-hero .brand-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
    padding: 12px 14px;
}

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

.primary,
.secondary,
.ghost,
.danger,
.tiny {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 16px;
    font-weight: 900;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary {
    background: linear-gradient(135deg, var(--forest), var(--leaf));
    color: #fff;
    padding: 14px 18px;
}

.secondary {
    border: 1px solid var(--line);
    background: #fff8e9;
    color: var(--forest);
    padding: 10px 13px;
}

.ghost {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink);
    padding: 10px 13px;
}

.danger {
    background: rgba(180, 35, 58, 0.1);
    color: var(--danger);
}

.tiny {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
}

.primary:hover,
.secondary:hover,
.ghost:hover {
    transform: translateY(-1px);
}

.full {
    width: 100%;
}

.app {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    gap: 18px;
    min-height: 100vh;
    padding: 18px;
}

.sidebar {
    position: sticky;
    top: 18px;
    display: flex;
    height: calc(100vh - 36px);
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
    border-radius: 30px;
    padding: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 950;
}

.logo span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--forest), var(--gold));
    color: white;
}

.user-card {
    display: grid;
    gap: 4px;
    border-radius: 22px;
    background: rgba(23, 63, 42, 0.08);
    padding: 15px;
}

.user-card small,
td small,
.mini-card small,
.order-card small,
.product-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.sidebar nav {
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.sidebar nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(23, 63, 42, 0.24);
}

.sidebar nav a {
    border-radius: 17px;
    color: var(--muted);
    font-weight: 850;
    padding: 12px 14px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: linear-gradient(135deg, rgba(23, 63, 42, 0.13), rgba(240, 184, 79, 0.2));
    color: var(--forest);
}

.main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    border-radius: 30px;
    padding: 20px;
}

.topbar h1 {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1;
}

.mobile-menu {
    display: none;
}

.alert {
    margin-bottom: 16px;
    border-radius: 18px;
    padding: 13px 15px;
    font-weight: 800;
}

.alert.success {
    background: rgba(20, 128, 79, 0.12);
    color: var(--success);
}

.alert.error {
    background: rgba(180, 35, 58, 0.12);
    color: var(--danger);
}

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

.metric {
    display: grid;
    gap: 8px;
    border-radius: 24px;
    padding: 20px;
}

.metric span {
    color: var(--muted);
    font-weight: 900;
}

.metric strong {
    font-size: clamp(24px, 4vw, 36px);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: start;
}

.panel {
    border-radius: 30px;
    padding: 20px;
}

.panel + .panel,
.panel h2 + .form-grid,
.panel h2 + .product-grid,
.panel h2 + .cards {
    margin-top: 14px;
}

.panel h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

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

.wide {
    grid-column: 1 / -1;
}

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

.check input {
    width: auto;
}

.cards,
.product-grid,
.table-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 13px;
}

.mini-card,
.product-card,
.table-card,
.order-card {
    overflow: hidden;
    border-radius: 24px;
}

.mini-card {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.alert-card {
    border-color: rgba(240, 184, 79, 0.55);
    background: rgba(255, 246, 225, 0.92);
}

.product-card img {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    background: #f2eadb;
}

.product-card div {
    display: grid;
    gap: 5px;
    padding: 13px;
}

.product-card span {
    width: fit-content;
    border-radius: 999px;
    background: var(--forest);
    color: white;
    font-size: 13px;
    font-weight: 900;
    padding: 7px 10px;
}

.table-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    text-align: center;
}

.table-card.is-passive {
    opacity: 0.58;
    filter: grayscale(0.45);
}

.table-card img {
    margin: auto;
    border-radius: 18px;
    background: white;
    padding: 8px;
}

.table-wrap {
    overflow-x: auto;
}

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

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

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

.pos-picker,
.inline-form,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.pos-picker select {
    flex: 1 1 260px;
}

.pos-picker input,
.inline-form input {
    max-width: 90px;
}

.cart-lines {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.cart-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 11px;
}

.order-card {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 15px;
}

.order-card > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.order-card ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
}

.order-card li span {
    color: var(--muted);
}

.inline {
    display: inline-block;
    margin-left: 8px;
}

.qr-body {
    background: #f7f0df;
}

.qr-hero {
    padding: clamp(28px, 6vw, 68px);
    background:
        linear-gradient(135deg, rgba(23, 63, 42, 0.95), rgba(47, 122, 69, 0.78)),
        radial-gradient(circle at 80% 12%, rgba(240, 184, 79, 0.38), transparent 20rem);
    color: white;
}

.waiter-form {
    display: flex;
    max-width: 680px;
    flex-wrap: wrap;
    gap: 10px;
}

.waiter-form input {
    flex: 1 1 280px;
}

.qr-menu {
    display: grid;
    gap: 30px;
    max-width: 1180px;
    margin: auto;
    padding: 24px;
}

.qr-menu section h2 {
    font-size: clamp(26px, 4vw, 42px);
}

.store-body {
    background:
        radial-gradient(circle at 12% 8%, rgba(240, 184, 79, 0.28), transparent 25rem),
        radial-gradient(circle at 88% 0%, rgba(23, 63, 42, 0.18), transparent 24rem),
        #f8f0df;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 240, 223, 0.86);
    padding: 14px clamp(16px, 4vw, 52px);
    backdrop-filter: blur(16px);
}

.store-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 950;
}

.store-logo span,
.store-logo img {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 17px;
    background: var(--forest);
    color: #fff;
    object-fit: cover;
}

.store-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.store-header nav a,
.store-nav-button {
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    font-family: inherit;
    padding: 9px 12px;
}

.store-header nav a:hover,
.store-header nav .store-nav-button:hover,
.store-header nav .admin-link {
    background: rgba(23, 63, 42, 0.1);
    color: var(--forest);
}

.store-nav-button [data-cart-count],
.floating-cart strong {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: var(--forest);
    color: #fff;
    font-size: 12px;
    margin-left: 4px;
    padding: 0 6px;
}

.store-cart-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    background: var(--forest);
    color: #fff;
    box-shadow: 0 14px 30px rgba(23, 63, 42, 0.18);
}

.store-header nav .store-cart-button:hover {
    background: #102f20;
    color: #fff;
}

.store-cart-button .cart-icon::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 11px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 3px 3px 5px 5px;
    box-shadow: 0 -5px 0 -3px currentColor;
}

.store-cart-button [data-cart-count] {
    background: #f0b84f;
    color: #173f2a;
    margin-left: 0;
}

.storefront {
    max-width: 1440px;
    margin: auto;
    padding: clamp(16px, 4vw, 46px);
}

.store-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 28px;
}

.store-hero > div:first-child,
.hero-card,
.store-section,
.checkout-cart,
.checkout-customer,
.store-preview {
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.store-hero > div:first-child {
    position: relative;
    overflow: hidden;
    border-radius: 38px;
    padding: clamp(28px, 5vw, 58px);
}

.store-hero h1 {
    max-width: 780px;
    margin: 22px 0 14px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.92;
    letter-spacing: -0.05em;
}

.store-hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.65;
}

.hero-actions,
.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.hero-facts span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    padding: 9px 12px;
}

.hero-card {
    display: grid;
    align-content: start;
    gap: 16px;
    border-radius: 38px;
    padding: 20px;
}

.hero-card > strong {
    font-size: 22px;
}

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

.hero-products article {
    overflow: hidden;
    border-radius: 24px;
    background: #fff8e9;
}

.hero-products img {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
}

.hero-products span {
    display: block;
    font-size: 13px;
    font-weight: 900;
    padding: 10px;
}

.store-section {
    border-radius: 34px;
    margin-top: 22px;
    padding: clamp(18px, 3vw, 28px);
}

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

.section-title h2 {
    max-width: 700px;
    margin: 10px 0 0;
    font-size: clamp(30px, 5vw, 58px);
    line-height: 0.98;
}

#store-search {
    max-width: 420px;
    border-radius: 999px;
}

.category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.category-pills button {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    padding: 10px 14px;
}

.category-pills button.active {
    background: var(--forest);
    color: white;
}

.store-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 16px;
}

.store-product {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.86);
}

.store-product.is-hidden {
    display: none;
}

.store-product > img {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    background: #efe3ce;
}

.store-product > div {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.store-product h3 {
    margin: 0;
    font-size: 22px;
}

.store-product p {
    min-height: 40px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.product-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.product-buy strong {
    border-radius: 999px;
    background: var(--forest);
    color: white;
    padding: 9px 12px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
    gap: 20px;
    align-items: start;
}

.customer-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: 16px;
}

.checkout-cart,
.checkout-customer {
    border-radius: 28px;
    padding: clamp(18px, 2.2vw, 26px);
}

.checkout-cart h3,
.checkout-customer h3 {
    margin-top: 0;
}

.empty-cart {
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: var(--muted);
    padding: 14px;
}

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

.store-cart-line img {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
}

.store-cart-line strong {
    display: block;
}

.store-cart-line small {
    color: var(--muted);
}

.qty-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.qty-tools button {
    min-width: 32px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    cursor: pointer;
    font-weight: 950;
}

.qty-tools button[data-store-remove] {
    width: auto;
    min-width: 44px;
    padding: 0 10px;
    background: #fff4ef;
    color: #a53824;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    border-top: 2px solid var(--line);
    margin-top: 12px;
    padding-top: 14px;
    font-size: 20px;
    font-weight: 950;
}

.checkout-button {
    width: 100%;
    margin-top: 14px;
}

.checkout-cart .checkout-button {
    width: auto;
    justify-self: start;
    padding-inline: 18px;
}

.checkout-button.is-disabled {
    opacity: 0.5;
    pointer-events: auto;
}

.cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(21, 18, 12, 0.28);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.cart-drawer-backdrop.open {
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 70;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(440px, 100vw);
    height: 100dvh;
    border-left: 1px solid var(--line);
    background:
        radial-gradient(circle at 20% 0%, rgba(240, 184, 79, 0.2), transparent 18rem),
        #fffaf0;
    box-shadow: -28px 0 70px rgba(23, 63, 42, 0.24);
    transform: translateX(105%);
    transition: transform 0.24s ease;
}

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

.cart-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 22px;
}

.cart-drawer-head h2 {
    margin: 8px 0 0;
    font-size: 28px;
    line-height: 1;
}

.cart-close {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--forest);
    cursor: pointer;
    font-size: 28px;
    font-weight: 900;
}

.drawer-lines {
    overflow-y: auto;
    padding: 8px 22px;
}

.cart-drawer-footer {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 18px 22px 22px;
}

.cart-drawer-footer small {
    color: var(--muted);
    line-height: 1.45;
}

.floating-cart {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    display: none;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--forest);
    color: white;
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 950;
    padding: 13px 16px;
}

.floating-cart strong {
    background: #f0b84f;
    color: #173f2a;
    margin-left: 0;
}

.narrow-storefront {
    max-width: 1180px;
}

.checkout-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: clamp(22px, 4vw, 38px);
}

.checkout-hero h1 {
    margin: 10px 0;
    max-width: 760px;
    font-size: clamp(34px, 4.8vw, 56px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.checkout-hero p,
.account-hint {
    max-width: 820px;
    color: var(--muted);
    line-height: 1.6;
}

.checkout-hero > .secondary {
    align-self: center;
    white-space: nowrap;
}

.checkout-page .checkout-cart,
.checkout-page .checkout-customer,
.account-page .checkout-cart,
.account-page .checkout-customer {
    background: rgba(255, 255, 255, 0.92);
}

.checkout-page .checkout-cart {
    position: sticky;
    top: 96px;
}

.store-preview {
    display: grid;
    gap: 12px;
    border-radius: 30px;
    margin-bottom: 14px;
    padding: 24px;
}

.store-preview img {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    object-fit: cover;
}

.store-preview h3 {
    margin: 0;
    color: var(--preview-color);
    font-size: 34px;
    line-height: 1;
}

.store-preview p {
    color: var(--muted);
}

.settings-extra {
    margin-top: 18px;
}

.critical-row {
    background: rgba(180, 35, 58, 0.08);
    color: var(--danger);
    font-weight: 900;
}

.kitchen-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.kitchen-ticket {
    display: grid;
    gap: 12px;
    border: 2px solid var(--line);
    border-radius: 28px;
    background: #fffaf0;
    padding: 16px;
    box-shadow: 0 16px 34px rgba(37, 30, 18, 0.1);
}

.kitchen-ticket header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kitchen-ticket header strong {
    font-size: 22px;
}

.kitchen-ticket header span {
    border-radius: 999px;
    background: var(--forest);
    color: white;
    font-size: 12px;
    font-weight: 950;
    padding: 7px 10px;
}

.kitchen-ticket p {
    margin: 0;
    color: var(--muted);
    font-weight: 850;
}

.kitchen-ticket ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kitchen-ticket li {
    border-radius: 16px;
    background: white;
    padding: 10px;
}

.kitchen-ticket li b {
    color: var(--forest);
}

.kitchen-ticket li small {
    display: block;
    color: var(--muted);
}

.kitchen-ticket.status-received {
    border-color: rgba(240, 184, 79, 0.72);
}

.kitchen-ticket.status-preparing {
    border-color: rgba(47, 122, 69, 0.45);
}

.kitchen-ticket.status-ready {
    border-color: rgba(37, 99, 235, 0.35);
}

.map-preview {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.map-preview iframe {
    width: 100%;
    min-height: 320px;
    border: 0;
    border-radius: 24px;
    background: #efe3ce;
}

.courier-cards {
    margin-top: 14px;
}

.courier-card a {
    width: fit-content;
}

.courier-mobile .section-title {
    align-items: center;
}

.courier-order p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.manage-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 26px;
}

.manage-card,
.edit-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.manage-card.critical-row {
    border-color: rgba(221, 75, 57, 0.42);
    background: rgba(255, 242, 238, 0.86);
}

.permission-matrix {
    display: grid;
    gap: 12px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    padding: 0 12px 12px;
}

.permission-check {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    padding: 10px 12px;
}

.manage-card summary,
.edit-panel summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    list-style: none;
}

.manage-card summary::-webkit-details-marker,
.edit-panel summary::-webkit-details-marker {
    display: none;
}

.manage-card summary img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f8f2df;
}

.manage-card summary span,
.product-card .edit-panel {
    min-width: 0;
}

.manage-card summary strong,
.manage-card summary small {
    display: block;
}

.manage-card summary b {
    margin-left: auto;
    color: var(--green);
    font-size: 0.82rem;
}

.manage-card .form-grid,
.edit-panel .form-grid {
    padding: 0 12px 12px;
}

.admin-product-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-product-card {
    align-self: start;
}

.admin-product-card.is-passive {
    opacity: 0.62;
    filter: grayscale(0.35);
}

.manage-card.is-passive {
    opacity: 0.62;
    filter: grayscale(0.35);
}

.admin-product-card .edit-panel {
    margin: 12px 0 0;
    box-shadow: none;
}

.admin-product-card .edit-panel summary {
    justify-content: center;
    font-weight: 800;
    color: var(--green);
}

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

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
}

.notification-item.unread {
    border-color: rgba(240, 184, 79, 0.72);
    box-shadow: 0 16px 36px rgba(240, 184, 79, 0.16);
}

.notification-item.priority-high {
    background: linear-gradient(135deg, rgba(255, 247, 214, 0.94), rgba(255, 255, 255, 0.9));
}

.notification-item p {
    margin: 7px 0;
    color: var(--muted);
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 24px;
    color: var(--muted);
}

.receipt-body {
    margin: 0;
    background: #f3f0e8;
    color: #111;
    font-family: "Courier New", monospace;
}

.receipt {
    width: min(380px, calc(100vw - 24px));
    margin: 18px auto;
    padding: 18px;
    background: #fff;
    border: 1px solid #d8d0be;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.receipt header {
    text-align: center;
    border-bottom: 1px dashed #111;
    padding-bottom: 10px;
}

.receipt h1 {
    margin: 0 0 8px;
    font-size: 22px;
}

.receipt p {
    margin: 4px 0;
}

.receipt-meta {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px dashed #111;
}

.receipt-meta div,
.receipt-lines div,
.receipt footer div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.receipt-lines {
    display: grid;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px dashed #111;
}

.receipt-note {
    padding: 10px 0;
    border-bottom: 1px dashed #111;
}

.receipt footer {
    display: grid;
    gap: 8px;
    padding-top: 12px;
}

.receipt .grand {
    font-size: 20px;
    border-top: 2px solid #111;
    padding-top: 8px;
}

.print-button {
    width: 100%;
    margin-top: 16px;
}

@media (max-width: 1080px) {
    .login-wrap,
    .app,
    .split {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 10;
        inset: 12px auto 12px 12px;
        width: min(310px, calc(100vw - 24px));
        max-height: calc(100vh - 24px);
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu {
        display: inline-flex;
    }

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

    .store-hero,
    .checkout-grid,
    .customer-grid {
        grid-template-columns: 1fr;
    }

    .checkout-hero {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    #store-search {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .login-body,
    .app {
        padding: 10px;
    }

    .login-hero {
        min-height: auto;
    }

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

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

    .panel,
    .login-card,
    .login-hero {
        border-radius: 24px;
        padding: 18px;
    }

    .store-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .store-header nav {
        width: 100%;
        justify-content: flex-start;
    }

    .storefront {
        padding: 12px;
    }

    .cart-drawer {
        width: 100vw;
    }

    .checkout-page .checkout-cart {
        position: static;
    }

    .floating-cart {
        display: inline-flex;
    }

    .store-hero h1 {
        font-size: 42px;
    }

    .hero-products {
        grid-template-columns: 1fr 1fr;
    }

    .store-products {
        grid-template-columns: 1fr;
    }
}

@media print {
    .sidebar,
    .topbar,
    .ghost,
    .primary,
    .secondary,
    .danger,
    form {
        display: none !important;
    }

    .print-button {
        display: none !important;
    }

    .receipt {
        width: 72mm;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .app {
        display: block;
        padding: 0;
    }

    .panel,
    .table-card {
        box-shadow: none;
        break-inside: avoid;
    }
}
