:root {
    --wine: #5b1b36;
    --wine-dark: #3f1025;
    --wine-soft: #f7eef2;
    --cream: #fffaf3;
    --ink: #211a1d;
    --muted: #6f666a;
    --line: #e7dde1;
    --surface: #ffffff;
    --success: #176b46;
    --success-soft: #e9f7f0;
    --danger: #a32929;
    --danger-soft: #fff0f0;
    --warning: #8a5a00;
    --shadow: 0 16px 40px rgba(48, 22, 32, .10);
    --radius: 18px;
    --topbar-height: 68px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #f6f1f3; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #f6f1f3;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--wine); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .4rem; font-size: clamp(1.65rem, 2.5vw, 2.35rem); line-height: 1.08; }
h2 { margin-bottom: .35rem; }
small { color: var(--muted); }
code { font-size: .88em; }

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 10px max(18px, env(safe-area-inset-left)) 10px max(18px, env(safe-area-inset-right));
    color: white;
    background: rgba(63, 16, 37, .98);
    box-shadow: 0 8px 25px rgba(45, 8, 26, .16);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; color: white; }
.brand-mark, .login-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: white;
    background: linear-gradient(145deg, #b76b82, #7a2947);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 13px;
    font-family: Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
}
.brand span:last-child { display: grid; }
.brand small { color: rgba(255,255,255,.67); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.topnav { display: flex; gap: 4px; }
.nav-link { padding: 10px 12px; color: rgba(255,255,255,.78); border-radius: 10px; font-weight: 700; }
.nav-link:hover, .nav-link:focus-visible { color: white; background: rgba(255,255,255,.1); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.user-menu form { margin: 0; }

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--wine); box-shadow: 0 8px 18px rgba(91,27,54,.18); }
.btn-primary:hover:not(:disabled) { background: var(--wine-dark); }
.btn-secondary { color: var(--wine); background: var(--wine-soft); border-color: #ead8df; }
.btn-ghost { color: inherit; background: transparent; border-color: var(--line); }
.topbar .btn-ghost { color: white; border-color: rgba(255,255,255,.25); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #f2c8c8; }
.btn-small { min-height: 36px; padding: 7px 11px; font-size: .84rem; }
.btn-large { min-height: 54px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn {
    width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
    border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink);
    font-size: 1.5rem; cursor: pointer;
}

.eyebrow { margin-bottom: 6px; color: #94667a; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.55; }
.flash-stack { position: fixed; z-index: 100; top: calc(var(--topbar-height) + 12px); left: 50%; width: min(560px, calc(100% - 28px)); transform: translateX(-50%); }
.flash { margin-bottom: 8px; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 750; }
.flash-success { color: var(--success); background: var(--success-soft); border: 1px solid #bfe5d1; }
.flash-error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f2c8c8; }

/* Login */
.login-shell, .center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #f4dce6, #f6f1f3 45%, #eee7e9); }
.login-card, .empty-card { width: min(430px, 100%); padding: clamp(26px, 6vw, 42px); background: rgba(255,255,255,.94); border: 1px solid white; border-radius: 26px; box-shadow: var(--shadow); }
.login-logo { width: 58px; height: 58px; margin-bottom: 22px; font-size: 2rem; }
.stack-form, .admin-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #4d4448; font-size: .88rem; font-weight: 750; }
input, select, textarea {
    width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: white;
    border: 1px solid #d8cdd1; border-radius: 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #a85a78; box-shadow: 0 0 0 3px rgba(168,90,120,.12); }
input[type="color"] { padding: 5px; }
input[type="checkbox"] { width: 19px; min-height: 19px; margin: 0; accent-color: var(--wine); }
.check-label { grid-template-columns: 20px 1fr; align-items: center; gap: 9px; }

/* POS */
.pos-page { overflow: hidden; }
.pos-shell { height: calc(100vh - var(--topbar-height)); display: grid; grid-template-columns: minmax(0, 1fr) 390px; }
.catalog-pane { min-width: 0; overflow-y: auto; padding: 24px 26px 100px; overscroll-behavior: contain; }
.pos-heading, .page-heading, .section-heading, .cart-head, .dialog-head, .entity-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.category-tabs {
    position: sticky; z-index: 10; top: -24px; display: flex; gap: 8px; overflow-x: auto;
    margin: 14px -26px 20px; padding: 16px 26px 12px; background: rgba(246,241,243,.96); backdrop-filter: blur(10px);
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab { min-height: 42px; padding: 9px 15px; white-space: nowrap; color: #66565e; background: white; border: 1px solid var(--line); border-radius: 999px; font-weight: 800; cursor: pointer; }
.category-tab.is-active { color: white; background: var(--wine); border-color: var(--wine); box-shadow: 0 6px 16px rgba(91,27,54,.18); }
.category-section { display: none; }
.category-section.is-active { display: block; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product-card { overflow: hidden; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px rgba(47,25,34,.045); }
.product-card::before { content: ""; display: block; height: 4px; margin: -16px -16px 15px; background: var(--product-accent); }
.product-head { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.product-head h2 { margin: 0; font-size: 1.08rem; }
.product-head small { display: block; margin-top: 2px; }
.product-dot { flex: 0 0 auto; width: 18px; height: 18px; background: var(--product-accent); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: #f4eff1; border-radius: 11px; }
.mode-btn { min-height: 39px; padding: 6px 8px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-weight: 850; cursor: pointer; }
.mode-btn small { display: block; font-size: .66rem; }
.mode-btn.is-active { color: var(--wine); background: white; box-shadow: 0 2px 8px rgba(35,15,23,.09); }
.variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.variant-btn { position: relative; min-height: 64px; display: grid; align-content: center; gap: 2px; padding: 9px; color: var(--ink); background: #fffafc; border: 1px solid #e7d9df; border-radius: 12px; cursor: pointer; }
.variant-btn span { font-weight: 900; }
.variant-btn strong { color: var(--wine); font-size: .78rem; }
.variant-btn:hover, .variant-btn:focus-visible { border-color: var(--product-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--product-accent) 15%, transparent); }
.variant-btn:active { transform: scale(.97); }
.variant-btn.is-mode-hidden { display: none; }
.variant-count { position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 6px; color: white; background: var(--wine); border: 2px solid white; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 900; }

.cart-pane { position: relative; z-index: 20; height: 100%; display: flex; flex-direction: column; padding: 20px; background: white; border-left: 1px solid var(--line); box-shadow: -10px 0 28px rgba(55,25,37,.06); }
.cart-head { flex: 0 0 auto; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; }
.cart-items { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 12px 2px; overscroll-behavior: contain; }
.cart-empty { height: 100%; min-height: 180px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.cart-empty span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 10px; color: #b18a9a; background: var(--wine-soft); border-radius: 50%; font-size: 1.6rem; }
.cart-empty p { margin-bottom: 3px; font-weight: 850; }
.cart-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eee6e9; }
.cart-line-title { display: flex; align-items: baseline; gap: 6px; }
.cart-line-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-title span { color: var(--wine); font-size: .74rem; font-weight: 900; }
.cart-line-meta { margin-top: 4px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.cart-line-total { margin-top: 5px; color: var(--wine-dark); font-weight: 900; }
.cart-stepper { display: grid; grid-template-columns: 34px 34px 34px; align-items: center; align-self: center; }
.cart-stepper button, .stepper button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--wine); background: var(--wine-soft); border: 0; border-radius: 9px; font-size: 1.15rem; font-weight: 900; cursor: pointer; }
.cart-stepper output, .stepper output { text-align: center; font-weight: 900; }
.cart-actions { flex: 0 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 5px; }
.summary-list { flex: 0 0 auto; display: grid; gap: 8px; margin: 15px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.summary-list > div { display: flex; justify-content: space-between; gap: 15px; font-size: .88rem; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 850; }
.summary-return dd { color: var(--success); }
.summary-total { align-items: baseline; margin-top: 3px; padding-top: 12px; border-top: 1px dashed #cfbdc5; }
.summary-total dt { color: var(--ink); font-size: 1.05rem; font-weight: 900; }
.summary-total dd { color: var(--wine); font-size: 1.55rem; }
.btn-checkout { flex: 0 0 auto; min-height: 58px; justify-content: space-between; padding-inline: 18px; font-size: .96rem; }
.btn-checkout strong { font-size: 1.12rem; }
.mobile-cart-bar { display: none; }

/* Dialog */
.dialog { width: min(540px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 22px; background: transparent; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(31,14,22,.58); backdrop-filter: blur(3px); }
.dialog-card { max-height: min(82vh, 720px); overflow-y: auto; padding: 24px; background: white; border-radius: 22px; }
.dialog-head { margin-bottom: 10px; }
.dialog-head h2 { margin: 0; }
.return-list { display: grid; gap: 10px; margin: 18px 0; }
.return-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; background: #faf6f8; border: 1px solid var(--line); border-radius: 13px; }
.return-row strong, .return-row small { display: block; }
.return-row small { margin-top: 3px; }
.stepper { display: grid; grid-template-columns: 40px 44px 40px; align-items: center; }
.stepper button { width: 40px; height: 40px; }
.dialog-total { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.dialog-total strong { color: var(--success); font-size: 1.4rem; }
.payment-total { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0; padding: 16px; background: var(--wine-soft); border-radius: 14px; font-weight: 850; }
.payment-total strong { color: var(--wine); font-size: 1.75rem; }
.cash-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; }
.cash-entry .btn { min-height: 46px; }
.payment-result { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 16px; margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.payment-result span { font-weight: 850; }
.payment-result strong { color: var(--success); font-size: 1.65rem; }
.payment-result small { grid-column: 1 / -1; }
.payment-result.is-insufficient strong, .payment-result.is-insufficient small { color: var(--danger); }
.success-card { text-align: center; }
.success-icon { width: 66px; height: 66px; display: grid; place-items: center; margin: 0 auto 18px; color: white; background: var(--success); border-radius: 50%; font-size: 2rem; font-weight: 900; }
.success-number { color: var(--muted); font-family: ui-monospace, monospace; }
.success-total { color: var(--wine); font-size: 2.2rem; font-weight: 950; }
.success-change { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0; padding: 14px 16px; color: var(--success); background: var(--success-soft); border-radius: 13px; font-weight: 850; }
.success-change strong { font-size: 1.35rem; }
.success-change.is-insufficient { color: var(--danger); background: var(--danger-soft); }

/* General/Admin */
.page-shell { width: min(1440px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 70px; }
.page-heading { margin-bottom: 22px; }
.table-card, .section-card { margin-bottom: 22px; padding: clamp(16px, 3vw, 24px); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(48,22,32,.045); }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 12px 11px; text-align: left; white-space: nowrap; border-bottom: 1px solid #eee6e9; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tr.is-cancelled { opacity: .55; text-decoration: line-through; }
.table-empty { padding: 34px; color: var(--muted); text-align: center; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; }
.status-completed { color: var(--success); background: var(--success-soft); }
.status-cancelled { color: var(--danger); background: var(--danger-soft); }
.admin-nav { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 24px; padding: 5px; background: #e9e0e3; border-radius: 13px; }
.admin-nav a { padding: 9px 13px; white-space: nowrap; color: #5f5358; border-radius: 9px; font-size: .86rem; font-weight: 850; }
.admin-nav a.is-active { color: var(--wine); background: white; box-shadow: 0 2px 8px rgba(45,20,30,.08); }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { min-height: 126px; display: grid; align-content: space-between; padding: 19px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card small { font-weight: 800; }
.stat-card strong { color: var(--wine); font-size: clamp(1.5rem, 2.3vw, 2.15rem); line-height: 1; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.page-actions, .form-actions-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.form-heading { margin-bottom: 0; }
.product-create-fields { grid-template-columns: 1.35fr 1fr 1.5fr .75fr .55fr .65fr; align-items: start; }
.field-help { max-width: 48ch; font-weight: 500; line-height: 1.35; }
.section-count { color: var(--muted); font-size: .84rem; font-weight: 800; }
.narrow-card { max-width: 820px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.inline-checks { display: flex; flex-wrap: wrap; gap: 18px; }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.entity-card { padding: 17px; background: #fcfafb; border: 1px solid var(--line); border-radius: 14px; }
.entity-card h3 { margin: 0; }
.compact-form { gap: 10px; }
.new-card { border-style: dashed; background: var(--wine-soft); }
.catalog-admin-list, .product-admin-list { display: grid; gap: 10px; }
.catalog-category, .product-admin-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 14px; }
.catalog-category + .catalog-category { margin-top: 10px; }
.new-category { margin-top: 14px; border-style: dashed; }
.accordion-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; list-style: none; cursor: pointer; user-select: none; }
.accordion-summary::-webkit-details-marker { display: none; }
.accordion-summary:hover { background: #fcf8fa; }
.accordion-summary:focus-visible { outline: 3px solid rgba(168,90,120,.2); outline-offset: -3px; }
.accordion-title, .accordion-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.accordion-title > span:last-child { min-width: 0; display: grid; gap: 3px; }
.accordion-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accordion-title small { font-weight: 600; }
.accordion-icon { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; color: var(--wine); background: var(--wine-soft); border-radius: 10px; font-weight: 900; }
.accordion-chevron { color: var(--muted); font-size: 1.7rem; line-height: 1; transition: transform .16s ease; }
details[open] > summary .accordion-chevron { transform: rotate(90deg); }
.category-summary { min-height: 70px; }
.category-content { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.category-settings { grid-template-columns: minmax(180px, 1fr) 140px auto auto; align-items: end; margin: 0 -14px 14px; padding: 14px; background: #fcfafb; border-bottom: 1px solid var(--line); }
.category-settings .check-label { align-self: center; }
.status-inactive { color: var(--muted); background: #eee9eb; }
.product-admin-card { background: #fcfafb; }
.product-summary { min-height: 62px; padding: 12px 14px; }
.product-editor { border-top: 1px solid var(--line); }
.product-main-form { padding: 18px; background: #fcfafb; border-bottom: 1px solid var(--line); }
.product-fields { grid-template-columns: 2fr 1.5fr 1fr .7fr .7fr; }
.product-swatch { width: 26px; height: 26px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.variant-admin-list { padding: 15px; }
.variant-head { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: .8rem; }
.variant-form { display: grid; grid-template-columns: 1.15fr .55fr .7fr 1fr 1fr .65fr .55fr auto auto; gap: 8px; align-items: end; padding: 10px 0; border-top: 1px solid #eee6e9; }
.variant-form label { font-size: .72rem; }
.variant-form input, .variant-form select { min-height: 40px; padding: 7px 8px; }
.new-variant { margin-top: 8px; padding: 13px; background: var(--wine-soft); border: 1px dashed #cdaebb; border-radius: 12px; }
.empty-inline { margin: 0; padding: 18px; color: var(--muted); text-align: center; }
.utility-accordion > summary { margin: -8px; }
.section-summary .eyebrow { margin: 0; }
.utility-content { padding-top: 24px; }

.desktop-hidden { display: none; }

@media (max-width: 1100px) {
    .pos-shell { grid-template-columns: minmax(0, 1fr) 355px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .product-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .product-create-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .category-settings { grid-template-columns: 1fr 140px; }
    .variant-form { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
    .variant-form .btn { align-self: end; }
}

@media (max-width: 780px) {
    :root { --topbar-height: 60px; }
    .topbar { gap: 8px; padding: 8px 12px; }
    .brand-mark { width: 40px; height: 40px; }
    .brand span:last-child, .user-menu > span { display: none; }
    .topnav { margin-left: auto; }
    .nav-link { padding: 9px 8px; font-size: .78rem; }
    .user-menu { margin-left: 0; }
    .user-menu .btn { min-height: 38px; padding: 6px 8px; font-size: 0; }
    .user-menu .btn::after { content: "↪"; font-size: 1rem; }
    .pos-page { overflow: auto; }
    .pos-shell { height: auto; min-height: calc(100vh - var(--topbar-height)); display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .catalog-pane { overflow: visible; padding: 18px 14px 80px; }
    .category-tabs { top: var(--topbar-height); margin: 10px -14px 15px; padding: 12px 14px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
    .product-card { padding: 13px; border-radius: 15px; }
    .product-card::before { margin: -13px -13px 12px; }
    .product-head { align-items: flex-start; }
    .product-head h2 { font-size: .98rem; }
    .product-dot { display: none; }
    .mode-btn { font-size: .77rem; }
    .variant-grid { grid-template-columns: 1fr; gap: 7px; }
    .variant-btn { min-height: 58px; }
    .desktop-hidden { display: inline-flex; }
    .cart-pane {
        position: fixed; z-index: 80; inset: var(--topbar-height) 0 0; height: auto; padding: 18px 14px max(18px, env(safe-area-inset-bottom));
        transform: translateY(105%); transition: transform .2s ease; border: 0; border-radius: 20px 20px 0 0;
    }
    body.cart-open { overflow: hidden; }
    body.cart-open .cart-pane { transform: translateY(0); }
    .cart-items { min-height: 100px; }
    .cart-actions { grid-template-columns: 1fr 1fr; }
    .cash-entry { grid-template-columns: 1fr; }
    .mobile-cart-bar {
        position: fixed; z-index: 60; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px;
        min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 10px 18px;
        color: white; background: var(--wine); border: 0; border-radius: 16px; box-shadow: 0 12px 30px rgba(62,15,36,.32); font-weight: 850;
    }
    .mobile-cart-bar strong { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 5px; color: var(--wine); background: white; border-radius: 50%; }
    .mobile-cart-bar b { font-size: 1.1rem; }
    .page-shell { padding: 20px 12px 60px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 180px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { min-height: 105px; padding: 15px; }
    .form-grid.two, .product-fields, .product-create-fields, .category-settings { grid-template-columns: 1fr; }
    .form-heading { align-items: flex-start; }
    .form-heading .btn { width: 100%; }
    .accordion-summary { padding: 13px 12px; }
    .accordion-meta .status { display: none; }
    .variant-form { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 14px 0; }
    .variant-form .btn { grid-column: 1 / -1; }
    .section-card, .table-card { padding: 14px; }
}

@media (max-width: 410px) {
    .product-grid { grid-template-columns: 1fr; }
    .variant-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: 1fr; }
    .cart-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
