:root {
    color-scheme: light;
    --orange: #FF6B35;
    --orange-600: #F05223;
    --red: #FF3B30;
    --blue: #2563EB;
    --green: #22C55E;
    --amber: #F59E0B;
    --violet: #7C3AED;
    --bg: #F5F7FA;
    --bg-strong: #E8EEF7;
    --surface: rgba(255,255,255,.88);
    --surface-solid: #FFFFFF;
    --surface-soft: #F8FAFC;
    --surface-muted: #EEF2F7;
    --text: #111827;
    --heading: #0B1220;
    --muted: #64748B;
    --line: rgba(15,23,42,.1);
    --line-strong: rgba(15,23,42,.16);
    --sidebar: rgba(255,255,255,.72);
    --sidebar-text: #334155;
    --sidebar-active: #111827;
    --menu-accent: var(--orange);
    --danger: #B42318;
    --success: #087443;
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-soft: 0 12px 32px rgba(15,23,42,.08);
    --shadow: 0 24px 70px rgba(15,23,42,.14);
    --shadow-glow: 0 18px 56px rgba(255,107,53,.22);
    --sidebar-width: 292px;
    --sidebar-collapsed: 92px;
    --topbar-height: 78px;
    --transition: 180ms cubic-bezier(.2,.8,.2,1);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0F172A;
    --bg-strong: #111C33;
    --surface: rgba(15,23,42,.78);
    --surface-solid: #111827;
    --surface-soft: #162033;
    --surface-muted: #1E293B;
    --text: #DCE6F3;
    --heading: #F8FAFC;
    --muted: #94A3B8;
    --line: rgba(226,232,240,.11);
    --line-strong: rgba(226,232,240,.18);
    --sidebar: rgba(15,23,42,.76);
    --sidebar-text: #CBD5E1;
    --sidebar-active: #FFFFFF;
    --shadow-soft: 0 16px 44px rgba(0,0,0,.24);
    --shadow: 0 28px 80px rgba(0,0,0,.36);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255,107,53,.14), transparent 34rem),
        radial-gradient(circle at 80% 12%, rgba(37,99,235,.16), transparent 30rem),
        linear-gradient(135deg, var(--bg), var(--bg-strong));
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 74%);
}

html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

a:hover { color: var(--orange); }

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 850;
    letter-spacing: 0;
}

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

svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.15;
    flex: 0 0 auto;
}

.dashboard-body,
.login-body,
.tablet-body,
.public-body {
    background:
        radial-gradient(circle at 12% 10%, rgba(255,107,53,.18), transparent 28rem),
        radial-gradient(circle at 86% 18%, rgba(37,99,235,.2), transparent 32rem),
        radial-gradient(circle at 50% 90%, rgba(34,197,94,.13), transparent 28rem),
        linear-gradient(145deg, var(--bg), var(--bg-strong));
}

.login-body {
    background:
        linear-gradient(120deg, rgba(15,23,42,.78), rgba(37,99,235,.3)),
        url("https://images.unsplash.com/photo-1555396273-367ea4eb4db5?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

.public-body {
    background:
        linear-gradient(120deg, rgba(15,23,42,.74), rgba(255,107,53,.28)),
        url("https://images.unsplash.com/photo-1559329007-40df8a9345d8?auto=format&fit=crop&w=1800&q=80") center / cover fixed;
}

.app-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
}

body.sidebar-collapsed .app-layout {
    grid-template-columns: 92px minmax(0, 1fr);
}

.main-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 0;
    height: 100vh;
    max-height: 100vh;
    z-index: 30;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    background: var(--sidebar);
    border-right: 1px solid rgba(255,255,255,.56);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(145%);
    overflow: hidden;
    transition: width var(--transition), background var(--transition);
}

html[data-theme="dark"] .dashboard-sidebar {
    border-color: rgba(255,255,255,.09);
}

.sidebar-brand {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(255,107,53,.18);
}

.brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
    flex: 1;
}

.sidebar-brand strong {
    display: block;
    color: var(--heading);
    font-size: 18px;
    line-height: 1.05;
}

.sidebar-brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collapse-toggle,
.mobile-menu-toggle,
.theme-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,.66);
    color: var(--text);
    padding: 0;
    min-height: 0;
}

html[data-theme="dark"] .sidebar-collapse-toggle,
html[data-theme="dark"] .mobile-menu-toggle,
html[data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,.06);
}

.mobile-menu-toggle {
    display: none;
    flex: 0 0 42px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-link-main,
.nav-section a,
.nav-section-title {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--sidebar-text);
    font-weight: 750;
    font-size: 14px;
    border: 0;
    background: transparent;
}

.nav-section-title {
    justify-content: space-between;
    cursor: pointer;
}

.nav-section-title span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-section-title::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .58;
    transition: transform var(--transition);
}

.nav-section-title[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

.nav-link-main {
    margin-bottom: 8px;
    color: var(--sidebar-active);
    background: linear-gradient(135deg, rgba(255,107,53,.14), rgba(37,99,235,.1));
    box-shadow: inset 0 0 0 1px rgba(255,107,53,.12);
}

.nav-section { margin-bottom: 8px; }

.nav-section a {
    min-height: 40px;
    margin: 3px 0;
    padding-left: 14px;
    font-size: 13px;
}

.nav-link-main:hover,
.nav-section-title:hover,
.nav-section a:hover,
.nav-section a.active,
.nav-link-main.active {
    color: var(--sidebar-active);
    background: rgba(255,255,255,.64);
    transform: translateX(2px);
}

html[data-theme="dark"] .nav-link-main:hover,
html[data-theme="dark"] .nav-section-title:hover,
html[data-theme="dark"] .nav-section a:hover,
html[data-theme="dark"] .nav-section a.active,
html[data-theme="dark"] .nav-link-main.active {
    background: rgba(255,255,255,.08);
}

.nav-section a.active::before,
.nav-link-main.active::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 11px;
    bottom: 11px;
    width: 4px;
    border-radius: 99px;
    background: linear-gradient(var(--orange), var(--red));
}

.dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 16px 24px 0;
    padding: 14px 22px;
    color: var(--text);
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.58);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px) saturate(145%);
    transition: background var(--transition), margin var(--transition);
}

html[data-theme="dark"] .dashboard-topbar {
    background: rgba(15,23,42,.76);
    border-color: rgba(255,255,255,.09);
}

.dashboard-topbar strong {
    display: block;
    color: var(--heading);
    font-size: 21px;
    line-height: 1.15;
}

.topbar-eyebrow {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 850;
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions > span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-weight: 750;
}

.topbar-actions form { margin: 0; }

.topbar-actions .btn {
    border-radius: 12px;
    color: var(--heading);
    border-color: var(--line-strong);
    background: rgba(255,255,255,.55);
}

html[data-theme="dark"] .topbar-actions .btn {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.dashboard-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 24px;
}

body.sidebar-collapsed .dashboard-sidebar {
    width: 100%;
    min-width: 0;
    flex: none;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-link-main span,
body.sidebar-collapsed .nav-section a span,
body.sidebar-collapsed .nav-section-title .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsed .sidebar-brand {
    min-height: 122px;
    flex-direction: column;
    justify-content: center;
    padding: 14px 10px;
}

body.sidebar-collapsed .sidebar-collapse-toggle {
    position: static;
}

body.sidebar-collapsed .nav-link-main,
body.sidebar-collapsed .nav-section a,
body.sidebar-collapsed .nav-section-title {
    justify-content: center;
    gap: 0;
    padding: 10px;
}

body.sidebar-collapsed .nav-section-title::after {
    display: none;
}

body.sidebar-collapsed .nav-section a.active::before,
body.sidebar-collapsed .nav-link-main.active::before {
    left: 6px;
}

.sidebar-backdrop {
    display: none;
}

.dashboard-main > header,
.dashboard-main > section,
.dashboard-main > form,
.dashboard-main > table,
.tablet-main > *,
.public-main > *,
.auth-shell > * {
    animation: surfaceIn .26s ease both;
}

@keyframes surfaceIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 26% 24%, rgba(255,107,53,.38), transparent 24rem),
        radial-gradient(circle at 78% 20%, rgba(37,99,235,.28), transparent 26rem);
}

.login-panel {
    width: min(430px, 100%);
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.54);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 34px 110px rgba(15,23,42,.36);
    backdrop-filter: blur(22px) saturate(150%);
}

.login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255,107,53,.18), transparent 42%),
        radial-gradient(circle at top right, rgba(37,99,235,.16), transparent 18rem);
}

.login-panel > * { position: relative; z-index: 1; }

.auth-logo {
    width: clamp(198px, 70%, 288px);
    max-width: calc(100% - 16px);
    height: auto;
    display: block;
    margin: 0 auto 8px;
    object-fit: contain;
}

.login-panel label {
    color: rgba(15,23,42,.74);
}

html[data-theme="dark"] .login-panel {
    background: rgba(15,23,42,.76);
    border-color: rgba(255,255,255,.12);
}

html[data-theme="dark"] .login-panel label {
    color: var(--text);
}

.google-auth-button {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(15,23,42,.14);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    color: #111827;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(15,23,42,.12);
}

.google-auth-button:hover {
    color: #111827;
    border-color: rgba(37,99,235,.28);
    background: #fff;
    transform: translateY(-1px);
}

.google-mark {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    border: 1px solid rgba(15,23,42,.12);
    border-radius: 999px;
    background: #fff;
    color: #4285F4;
    font-family: Arial, sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(100,116,139,.92);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(15,23,42,.14);
}

.auth-divider span {
    white-space: nowrap;
}

html[data-theme="dark"] .google-auth-button {
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #F8FAFC;
    box-shadow: 0 18px 42px rgba(0,0,0,.24);
}

html[data-theme="dark"] .google-auth-button:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}

html[data-theme="dark"] .auth-divider::before,
html[data-theme="dark"] .auth-divider::after {
    background: rgba(255,255,255,.14);
}

.tablet-main {
    min-height: 100vh;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 20px;
}

.public-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.page-head,
.dashboard-hero,
.panel,
.form-grid,
.toolbar,
.inline-form,
.data-table,
.sale-cart-panel,
.sale-checkout-panel,
.public-card,
.public-menu-head,
.public-menu-list,
.public-cart,
.tablet-head,
.tablet-order-summary {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

html[data-theme="dark"] .page-head,
html[data-theme="dark"] .dashboard-hero,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-grid,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .inline-form,
html[data-theme="dark"] .data-table,
html[data-theme="dark"] .sale-cart-panel,
html[data-theme="dark"] .sale-checkout-panel,
html[data-theme="dark"] .public-card,
html[data-theme="dark"] .public-menu-head,
html[data-theme="dark"] .public-menu-list,
html[data-theme="dark"] .public-cart,
html[data-theme="dark"] .tablet-head,
html[data-theme="dark"] .tablet-order-summary {
    border-color: rgba(255,255,255,.09);
}

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

.page-head h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
}

.page-head p { margin: 6px 0 0; }

.dashboard-hero {
    position: relative;
    overflow: hidden;
    min-height: 230px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 30px;
    margin-bottom: 18px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255,107,53,.95), rgba(255,59,48,.88) 42%, rgba(37,99,235,.92)),
        radial-gradient(circle at top right, rgba(255,255,255,.25), transparent 22rem);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -110px;
    top: -130px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    filter: blur(.2px);
}

.dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.dashboard-hero h1 {
    margin: 4px 0 8px;
    color: #fff;
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 930;
}

.dashboard-hero p {
    max-width: 580px;
    margin: 0;
    color: rgba(255,255,255,.86);
    font-size: 16px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-action {
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 46px rgba(15,23,42,.22);
}

.hero-action:hover {
    background: #F8FAFC;
    color: #111827;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 16px;
}

.dashboard-metrics { margin-bottom: 18px; }

.metrics div,
.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 148px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .12;
    background: linear-gradient(135deg, currentColor, transparent 64%);
}

.metric-card > * { position: relative; z-index: 1; }

.metrics span,
.metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
}

.metrics strong,
.metric-card strong {
    display: block;
    margin-top: 6px;
    color: var(--heading);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1;
    font-weight: 930;
}

.metric-card small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-weight: 700;
}

.metric-card > svg {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 34px;
    height: 34px;
    opacity: .36;
}

.accent-orange { color: var(--orange); }
.accent-blue { color: var(--blue); }
.accent-green { color: var(--green); }
.accent-red { color: var(--red); }

.onboarding-checklist {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.onboarding-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.onboarding-items a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--heading);
    background: var(--surface-soft);
    font-weight: 800;
}

.onboarding-items a:hover {
    color: var(--orange);
    border-color: rgba(255,107,53,.24);
    background: rgba(255,255,255,.72);
    transform: translateY(-1px);
}

html[data-theme="dark"] .onboarding-items a:hover {
    background: rgba(255,255,255,.08);
}

.setup-panel {
    position: relative;
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
    overflow: hidden;
}

.setup-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .08;
    background:
        radial-gradient(circle at 18% 0%, var(--orange), transparent 28%),
        radial-gradient(circle at 100% 12%, var(--blue), transparent 30%);
}

.setup-panel > * { position: relative; z-index: 1; }

.setup-panel-head,
.setup-progress-label,
.setup-next-step,
.setup-actions,
.setup-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setup-panel-head {
    justify-content: space-between;
}

.setup-panel-head h2,
.setup-tour-step h3,
.setup-help-grid h2 {
    margin: 0;
    color: var(--heading);
}

.setup-panel-head p,
.setup-tour-step p,
.setup-help-grid p {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 650;
}

.setup-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--orange);
    background: rgba(255,107,53,.12);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.setup-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.setup-progress {
    display: grid;
    gap: 8px;
}

.setup-progress-label {
    justify-content: space-between;
    color: var(--heading);
    font-size: 13px;
}

.setup-progress-label span {
    color: var(--muted);
    font-weight: 850;
}

.setup-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(100,116,139,.14);
}

.setup-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--orange), var(--green), var(--blue));
    transition: width .35s ease;
}

.setup-next-step {
    justify-content: space-between;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,107,53,.22);
    background: linear-gradient(135deg, rgba(255,107,53,.12), rgba(37,99,235,.08));
}

.setup-next-step > svg {
    flex: 0 0 auto;
    color: var(--orange);
}

.setup-next-step div {
    flex: 1;
    min-width: 0;
}

.setup-next-step strong,
.setup-next-step span {
    display: block;
}

.setup-next-step span {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 650;
}

.setup-step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.setup-step-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    min-height: 164px;
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.setup-step-card .button {
    grid-column: 1 / -1;
    width: fit-content;
}

.setup-step-card.done {
    border-color: rgba(34,197,94,.32);
    background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(255,255,255,.62));
}

html[data-theme="dark"] .setup-step-card.done {
    background: linear-gradient(135deg, rgba(34,197,94,.13), rgba(255,255,255,.05));
}

.setup-step-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--blue);
    background: rgba(37,99,235,.12);
}

.setup-step-card.done .setup-step-icon {
    color: var(--green);
    background: rgba(34,197,94,.14);
}

.setup-step-copy h3 {
    margin: 4px 0 0;
    color: var(--heading);
    font-size: 16px;
}

.setup-step-copy p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.setup-step-status {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.setup-step-card.done .setup-step-status { color: var(--green); }

.setup-empty-cards,
.setup-help-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.setup-help-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setup-help-grid .panel {
    display: grid;
    gap: 10px;
}

.setup-help-grid .panel > svg {
    color: var(--orange);
    width: 34px;
    height: 34px;
}

.setup-page-head {
    align-items: center;
}

.setup-welcome-modal .modal-body {
    display: grid;
    gap: 14px;
    padding: 28px;
}

.setup-modal-actions {
    flex-wrap: wrap;
}

.setup-dismiss-form {
    margin: 0;
}

button.link-button {
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-weight: 850;
}

button.link-button:hover {
    color: var(--orange);
    transform: none;
    box-shadow: none;
}

.setup-tour-step {
    display: none;
    min-height: 260px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.setup-tour-step.active {
    display: grid;
    place-items: start;
    align-content: center;
    gap: 10px;
}

.setup-tour-step > svg {
    width: 44px;
    height: 44px;
    color: var(--orange);
}

.setup-tour-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
}

.setup-tour-dots button {
    width: 9px;
    height: 9px;
    min-height: 0;
    padding: 0;
    border-radius: 999px;
    background: rgba(100,116,139,.28);
    box-shadow: none;
}

.setup-tour-dots button.active {
    width: 28px;
    background: var(--orange);
}

.button.small,
button.small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
    gap: 18px;
}

.panel { padding: 22px; }

.assistant-dashboard-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.assistant-dashboard-card span,
.assistant-suggestions h2 {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.assistant-dashboard-card h2 {
    margin: 5px 0 0;
    color: var(--heading);
    font-size: 20px;
    font-weight: 900;
}

.assistant-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 18px;
}

.assistant-chat-panel {
    display: grid;
    gap: 16px;
}

.assistant-history {
    min-height: 420px;
    max-height: 58vh;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 12px;
    padding-right: 4px;
}

.assistant-message {
    width: min(760px, 92%);
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.assistant-message span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.assistant-message p {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.assistant-message-user {
    justify-self: end;
    background: rgba(255,107,53,.12);
    border-color: rgba(255,107,53,.24);
}

.assistant-message-bot {
    justify-self: start;
}

.assistant-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.assistant-question-field textarea {
    min-height: 72px;
}

.assistant-suggestions {
    align-self: start;
    display: grid;
    gap: 10px;
}

.assistant-suggestions h2 {
    margin: 0 0 4px;
}

.assistant-suggestions button {
    justify-content: flex-start;
    text-align: left;
}

.chart-panel canvas {
    width: 100%;
    max-height: 320px;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 999px;
    color: #047857;
    background: rgba(34,197,94,.13);
    font-weight: 850;
    font-size: 12px;
}

.category-list {
    display: grid;
    gap: 10px;
}

.category-list div:not(.empty-state) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.category-list span {
    color: var(--muted);
    font-weight: 800;
}

.category-list strong {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--violet));
}

button:not(.btn-close):not(.btn):not(.nav-section-title):not(.sidebar-collapse-toggle):not(.mobile-menu-toggle):not(.sidebar-backdrop):not(.theme-toggle),
.button {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--orange), var(--red));
    color: #fff;
    padding: 11px 16px;
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    box-shadow: 0 12px 26px rgba(255,107,53,.22);
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

button:not(.btn-close):not(.btn):not(.nav-section-title):not(.sidebar-collapse-toggle):not(.mobile-menu-toggle):not(.sidebar-backdrop):not(.theme-toggle):hover,
.button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(255,107,53,.3);
}

button:not(.btn-close):not(.btn):not(.nav-section-title):not(.sidebar-collapse-toggle):not(.mobile-menu-toggle):not(.sidebar-backdrop):not(.theme-toggle):active,
.button:active {
    transform: translateY(0) scale(.99);
}

.ghost {
    background: rgba(255,255,255,.72) !important;
    color: var(--text) !important;
    border-color: var(--line-strong) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .ghost {
    background: rgba(255,255,255,.06) !important;
}

.link {
    background: transparent !important;
    color: var(--blue) !important;
    padding: 0 !important;
    border: 0 !important;
    min-height: auto !important;
    box-shadow: none !important;
}

.full { width: 100%; }

.ripple-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(255,255,255,.48);
    transform: translate(-50%, -50%) scale(1);
    animation: ripple .58s ease-out forwards;
}

@keyframes ripple {
    to { opacity: 0; transform: translate(-50%, -50%) scale(22); }
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: rgba(255,255,255,.74);
    color: var(--text);
    min-height: 44px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: rgba(15,23,42,.56);
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(255,107,53,.68);
    box-shadow: 0 0 0 4px rgba(255,107,53,.15);
    outline: 0;
}

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

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

.stack { display: grid; gap: 14px; }

.toolbar,
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
}

.toolbar input { min-width: min(320px, 100%); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 15px;
    padding: 20px;
}

.compact-form { margin-bottom: 16px; }
.span-2 { grid-column: span 2; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
    gap: 18px;
}

.split > div {
    padding: 20px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

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

.data-table th {
    background: rgba(248,250,252,.72);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 900;
}

html[data-theme="dark"] .data-table th {
    background: rgba(255,255,255,.05);
}

.data-table tr {
    transition: background var(--transition), transform var(--transition);
}

.data-table tr:hover td {
    background: rgba(255,107,53,.055);
}

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

.data-table td small {
    display: block;
    max-width: 360px;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.35;
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.table-pagination span {
    margin-right: auto;
    color: var(--muted);
    font-weight: 850;
    font-size: 13px;
}

.table-pagination button:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

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

.inline-delete-form {
    display: inline-flex;
    margin: 0 0 0 6px;
    vertical-align: middle;
}

.inline-delete-form button,
.data-table .button {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 12px;
}

.table-status-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.table-status-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.status-dot.free { background: var(--green); }
.status-dot.busy { background: var(--red); }
.status-dot.waiting { background: var(--amber); }
.status-dot.reserved { background: var(--blue); }

.table-grid,
.tablet-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 16px;
}

.new-table-form {
    display: grid;
    grid-template-columns: minmax(160px, 230px) auto;
    gap: 10px;
    align-items: center;
}

.table-button,
.tablet-table-button {
    width: 100%;
    min-height: 138px;
    display: grid !important;
    align-content: center;
    justify-items: center;
    gap: 9px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(34,197,94,.95), rgba(16,185,129,.9)) !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    box-shadow: 0 18px 44px rgba(34,197,94,.2) !important;
}

.table-button.busy,
.tablet-table-button.busy {
    background:
        linear-gradient(145deg, rgba(255,59,48,.96), rgba(255,107,53,.92)) !important;
    box-shadow: 0 18px 44px rgba(255,59,48,.22) !important;
}

.table-button.waiting { background: linear-gradient(145deg, #F59E0B, #FF6B35) !important; }
.table-button.reserved { background: linear-gradient(145deg, #2563EB, #7C3AED) !important; }

.table-button strong,
.tablet-table-button strong {
    color: #fff;
    font-size: 32px;
    line-height: 1;
}

.table-button span,
.tablet-table-button span {
    color: rgba(255,255,255,.82);
    font-size: 13px;
    font-weight: 850;
}

.table-button svg,
.tablet-table-button svg {
    color: rgba(255,255,255,.8);
    width: 26px;
    height: 26px;
}

.tablet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 18px;
}

.tablet-head strong {
    display: block;
    font-size: 26px;
    line-height: 1.1;
}

.tablet-head span {
    color: var(--muted);
    font-weight: 750;
}

.tablet-head form { margin: 0; }

.tablet-order {
    display: grid;
    gap: 16px;
}

.tablet-order-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    align-items: center;
    padding: 20px;
}

.tablet-order-summary span {
    color: var(--muted);
    font-weight: 850;
}

.tablet-order-summary strong {
    font-size: 34px;
    color: var(--orange);
}

.tablet-order-summary button {
    grid-row: span 2;
    min-width: 190px;
    min-height: 56px;
}

.sale-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
    gap: 18px;
    align-items: start;
}

.sale-cart-panel,
.sale-checkout-panel {
    padding: 20px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-title-row h2 {
    margin: 0;
    font-size: 22px;
}

.section-title-row p { margin: 4px 0 0; }

.cart-item-list,
.payment-list {
    display: grid;
    gap: 12px;
}

.cart-line,
.payment-line,
.public-product,
.public-cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-solid);
    box-shadow: 0 8px 22px rgba(15,23,42,.05);
}

html[data-theme="dark"] .cart-line,
html[data-theme="dark"] .payment-line,
html[data-theme="dark"] .public-product,
html[data-theme="dark"] .public-cart-line {
    background: rgba(255,255,255,.045);
}

.cart-line strong,
.payment-line strong,
.public-product strong,
.public-cart-line strong {
    display: block;
    color: var(--heading);
}

.cart-line span,
.payment-line span,
.public-product span {
    color: var(--muted);
    font-weight: 750;
}

.cart-line-actions {
    display: grid;
    justify-items: end;
    gap: 5px;
}

.cart-line-actions form {
    display: grid;
    grid-template-columns: 94px auto;
    gap: 8px;
    align-items: end;
    justify-items: end;
    margin: 0;
}

.cart-reversal-control {
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

.cart-reversal-control input {
    min-height: 36px;
    padding: 7px 8px;
}

.sale-checkout-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 36px);
    display: grid;
    gap: 16px;
}

.sale-checkout-panel h2,
.sale-cart-panel h2 {
    margin: 0;
}

.checkout-totals {
    display: grid;
    gap: 10px;
}

.checkout-totals div,
.summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.summary {
    display: grid;
    grid-template-columns: 1fr auto;
    margin: 10px 0 16px;
}

.checkout-totals span,
.summary span {
    color: var(--muted);
    font-weight: 850;
}

.checkout-totals strong,
.summary strong {
    color: var(--heading);
    font-size: 21px;
}

.checkout-totals .due {
    border-color: rgba(255,59,48,.32);
    background: rgba(255,59,48,.08);
}

.checkout-totals .ok {
    border-color: rgba(34,197,94,.32);
    background: rgba(34,197,94,.1);
}

.checkout-payment-form {
    display: grid;
    gap: 10px;
}

.checkout-close-form {
    display: grid;
    gap: 12px;
}

.checkout-customer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.checkout-customer-row button {
    min-width: 156px;
}

.empty-payment,
.empty-state {
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    background: var(--surface-soft);
}

.checkout-close-button:disabled {
    opacity: .52;
    cursor: not-allowed;
    transform: none;
}

.checkout-warning {
    margin: -8px 0 0;
    color: var(--red);
    font-weight: 850;
}

.product-modal-content,
.cash-close-modal,
.quick-customer-modal,
.public-account-modal,
.success-modal-content {
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-title { color: var(--heading); }

.quick-customer-feedback {
    padding: 10px 12px;
    border: 1px solid rgba(255,59,48,.32);
    border-radius: 12px;
    background: rgba(255,59,48,.09);
    color: var(--danger);
    font-weight: 850;
    font-size: 13px;
}

.product-modal-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 280px);
    gap: 10px;
    margin-bottom: 16px;
}

.product-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 12px;
}

.product-picker-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-solid);
    box-shadow: 0 10px 26px rgba(15,23,42,.07);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.product-picker-card::before {
    content: "";
    height: 68px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,107,53,.95), rgba(37,99,235,.78)),
        radial-gradient(circle at 70% 20%, rgba(255,255,255,.4), transparent 5rem);
}

.product-picker-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,107,53,.36);
    box-shadow: var(--shadow-soft);
}

.product-picker-card strong {
    display: block;
    font-size: 16px;
    color: var(--heading);
}

.product-picker-card span,
.product-picker-card small {
    color: var(--muted);
    font-size: 13px;
}

.product-picker-meta {
    display: grid;
    gap: 2px;
}

.product-picker-meta span {
    font-size: 20px;
    font-weight: 900;
    color: var(--orange);
}

.product-picker-actions {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
}

.product-picker-feedback {
    padding: 9px 10px;
    border: 1px solid rgba(34,197,94,.32);
    border-radius: 12px;
    background: rgba(34,197,94,.11);
    color: var(--success);
    font-size: 13px;
    font-weight: 850;
}

.product-picker-feedback.error {
    border-color: rgba(255,59,48,.32);
    background: rgba(255,59,48,.09);
    color: var(--danger);
}

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

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

.kitchen-ticket {
    position: relative;
    overflow: hidden;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

.kitchen-ticket::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, var(--amber), var(--orange), var(--red));
}

.kitchen-ticket.done {
    opacity: .8;
}

.kitchen-ticket.done::before {
    background: linear-gradient(90deg, var(--green), #14B8A6);
}

.kitchen-ticket > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.kitchen-ticket > header strong {
    display: block;
    color: var(--heading);
    font-size: 26px;
    line-height: 1.1;
}

.kitchen-ticket > header span {
    color: var(--muted);
    font-weight: 750;
}

.kitchen-ticket > header em {
    min-width: 96px;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(255,107,53,.12);
    color: var(--orange);
    text-align: center;
    font-style: normal;
    font-weight: 900;
    font-size: 12px;
}

.kitchen-ticket.done > header em {
    background: rgba(34,197,94,.12);
    color: var(--success);
}

.kitchen-items {
    display: grid;
    gap: 10px;
}

.kitchen-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(245,158,11,.22);
    border-radius: 18px;
    background: rgba(245,158,11,.08);
}

.kitchen-item.ready {
    border-color: rgba(34,197,94,.28);
    background: rgba(34,197,94,.1);
}

.kitchen-item strong {
    display: block;
    color: var(--heading);
    font-size: 18px;
}

.kitchen-item span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.kitchen-item form { margin: 0; }

.checkbox-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-line small {
    flex-basis: 100%;
    color: var(--muted);
    font-weight: 650;
}

.checkbox-line input,
.checks input {
    width: auto;
    min-height: auto;
}

.muted-field {
    opacity: .62;
}

.checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 8px;
}

.checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.company-logo-upload {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.company-logo-preview,
.company-logo-empty {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,.72);
}

.company-logo-preview {
    object-fit: contain;
    padding: 8px;
}

.company-logo-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.company-logo-upload small {
    color: var(--muted);
    font-weight: 750;
}

.flash {
    position: relative;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.24);
    color: var(--success);
    font-weight: 850;
    box-shadow: var(--shadow-soft);
}

.flash.error {
    background: rgba(255,59,48,.1);
    border-color: rgba(255,59,48,.24);
    color: var(--danger);
}

.success-modal-content {
    text-align: center;
}

.success-modal-content .modal-body {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 34px;
}

.success-modal-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(34,197,94,.13);
    color: var(--success);
    border: 1px solid rgba(34,197,94,.3);
    font-weight: 900;
}

.cash-summary-metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.cash-summary-panel h2 { margin: 0; }
.cash-summary-panel p { margin: 4px 0 0; }

.cash-difference-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.cash-difference-list div {
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    border: 1px solid rgba(255,59,48,.24);
    border-radius: 16px;
    background: rgba(255,59,48,.08);
}

.cash-difference-list strong { color: var(--danger); }
.cash-difference-list span { color: var(--muted); font-size: 14px; }

.cash-confirm-total {
    margin: 14px 0;
    padding: 13px 14px;
    border: 1px solid rgba(34,197,94,.28);
    border-radius: 16px;
    background: rgba(34,197,94,.11);
    color: var(--success);
    font-weight: 800;
}

.cash-difference-question {
    font-weight: 900;
    color: var(--heading);
}

.public-card {
    width: min(580px, 100%);
    display: grid;
    gap: 18px;
    padding: 26px;
}

.public-card > header strong {
    display: block;
    font-size: 30px;
}

.public-card > header span {
    color: var(--muted);
    font-weight: 750;
}

.public-menu-shell {
    width: min(1240px, 100%);
    display: grid;
    gap: 18px;
}

.public-menu-head {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 26px;
}

.public-menu-banner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .22;
    filter: saturate(1.05) contrast(1.06);
}

.public-menu-head::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.18), rgba(15,23,42,.56));
    pointer-events: none;
}

.public-menu-head > div {
    position: relative;
    z-index: 2;
}

.public-menu-logo {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 10px;
    background: #fff;
}

.public-menu-head h1 {
    margin: 0;
    font-size: 36px;
    font-weight: 900;
}

.public-menu-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(340px, 1fr);
    gap: 22px;
    align-items: start;
}

.public-menu-list,
.public-cart {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.public-menu-tabs {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 8px;
    background: linear-gradient(180deg, var(--surface-solid), rgba(255,255,255,0));
    scrollbar-width: thin;
}

.public-menu-tabs::-webkit-scrollbar {
    height: 0;
}

.public-menu-tabs button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 999px;
    border-color: var(--line-strong) !important;
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    white-space: nowrap;
}

.public-menu-tabs button.active {
    border-color: var(--menu-accent) !important;
    background: var(--menu-accent) !important;
    color: #fff !important;
}

.public-menu-panel {
    display: none;
}

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

.public-menu-panel h2 {
    margin: 0;
    color: var(--heading);
    font-size: 22px;
    font-weight: 900;
}

.public-products {
    display: grid;
    gap: 10px;
}

.public-product {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
}

.public-product.disabled { opacity: .58; }

.public-product em {
    display: block;
    margin-top: 4px;
    color: var(--menu-accent);
    font-style: normal;
    font-weight: 900;
}

.public-product-form {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
}

.public-product-form button { grid-column: 1 / -1; }

.public-cart {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.public-side-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.66);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 14px 34px rgba(15,23,42,.11);
    backdrop-filter: blur(14px) saturate(125%);
}

html[data-theme="dark"] .public-side-card {
    border-color: rgba(255,255,255,.1);
    background: rgba(15,23,42,.9);
}

.public-side-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.public-side-card h2 {
    margin: 0;
    color: var(--heading);
    font-size: 19px;
    font-weight: 900;
}

.public-side-eyebrow {
    color: var(--menu-accent);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.public-side-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.public-customer-box {
    display: grid;
    gap: 12px;
}

.public-customer-summary {
    display: grid;
    gap: 3px;
}

.public-customer-summary strong {
    color: var(--heading);
}

.public-customer-summary span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.public-customer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}

.public-customer-actions > *,
.public-customer-actions button,
.public-customer-actions .button {
    width: 100%;
}

.public-account-grid {
    display: grid;
    gap: 12px;
}

.public-customer-form h3 {
    margin: 0;
    color: var(--heading);
    font-size: 16px;
    font-weight: 900;
}

.public-google-button {
    width: 100%;
    justify-content: center;
}

.public-cart-close,
.public-cart-fab,
.public-cart-backdrop {
    display: none;
}

.public-cart-line {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
}

.public-cart-line em {
    color: var(--heading);
    font-style: normal;
    font-weight: 900;
}

.public-cart-line input[name="notes"] {
    grid-column: 1 / -1;
}

.public-cart-line-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 36px minmax(54px, 70px) 36px minmax(76px, .8fr) minmax(48px, .5fr);
    gap: 7px;
    align-items: center;
}

.public-cart-line-actions button,
.public-cart-line-actions input {
    min-height: 36px;
    padding: 7px 9px;
}

.public-delivery-fields {
    display: grid;
    gap: 12px;
}

.public-delivery-fields.is-hidden {
    display: none;
}

.public-checkout {
    gap: 14px;
}

.public-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1100;
    display: grid;
    gap: 2px;
    width: min(440px, calc(100vw - 28px));
    padding: 13px 16px;
    border: 1px solid rgba(34,197,94,.34);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 42px rgba(15,23,42,.18);
    color: var(--text);
    transform: translateX(-50%);
    animation: publicToastIn .28s ease both;
    backdrop-filter: blur(12px);
}

.public-toast::before {
    content: "OK";
    position: absolute;
    left: 14px;
    top: 14px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}

.public-toast strong,
.public-toast span {
    margin-left: 38px;
}

.public-toast.error {
    border-color: rgba(239,68,68,.34);
}

.public-toast.error::before {
    content: "!";
    background: linear-gradient(135deg, #ef4444, #f97316);
}

@keyframes publicToastIn {
    from { opacity: 0; transform: translate(-50%, -12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.public-cart-line-actions .danger {
    color: var(--danger);
}

.public-orders-head,
.public-orders-list,
.public-order-detail {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

.public-orders-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 20px;
}

.public-orders-head h1 {
    margin: 0;
    color: var(--heading);
    font-size: 28px;
    font-weight: 900;
}

.public-orders-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.public-orders-list,
.public-order-detail {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.public-order-card {
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
    color: inherit;
    text-decoration: none;
}

.public-order-card.active {
    border-color: var(--menu-accent, var(--primary));
    box-shadow: 0 0 0 3px rgba(15,139,141,.12);
}

.public-order-card strong,
.public-order-card em {
    color: var(--heading);
    font-style: normal;
}

.public-order-status,
.public-order-timeline,
.public-order-items,
.public-order-total {
    display: grid;
    gap: 10px;
}

.public-order-status {
    padding: 13px;
    border-radius: 14px;
    background: rgba(34,197,94,.12);
    color: var(--success);
}

.public-order-timeline {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.public-order-timeline span {
    padding: 10px;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.public-order-timeline span.done {
    background: rgba(34,197,94,.14);
    color: var(--success);
}

.public-order-items > div,
.public-order-total {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
}

.public-order-items > div {
    display: grid;
    gap: 4px;
}

.public-order-total {
    grid-template-columns: 1fr auto;
    font-weight: 800;
}

.public-orders-shell {
    width: min(1240px, 100%);
}

.public-orders-head {
    align-items: center;
    background: rgba(255,255,255,.94);
}

.public-orders-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: end;
}

.public-orders-layout {
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
    gap: 18px;
}

.public-orders-list {
    align-content: start;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.public-orders-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--heading);
}

.public-orders-list-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.public-order-card {
    position: relative;
    gap: 2px;
    padding: 11px 12px 11px 16px;
    border-radius: 13px;
}

.public-order-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--status-color, var(--menu-accent, #14b8a6));
}

.public-order-card.active {
    background: rgba(20,184,166,.08);
}

.public-order-card.status-confirmado,
.public-order-hero.status-confirmado,
.public-order-timeline .status-confirmado { --status-color: #3b82f6; }
.public-order-card.status-em_preparo,
.public-order-hero.status-em_preparo,
.public-order-timeline .status-em_preparo { --status-color: #f97316; }
.public-order-card.status-pronto,
.public-order-hero.status-pronto,
.public-order-timeline .status-pronto { --status-color: #8b5cf6; }
.public-order-card.status-saiu_para_entrega,
.public-order-hero.status-saiu_para_entrega,
.public-order-timeline .status-saiu_para_entrega { --status-color: #0ea5e9; }
.public-order-card.status-entregue,
.public-order-hero.status-entregue,
.public-order-timeline .status-entregue { --status-color: #22c55e; }
.public-order-card.status-cancelado,
.public-order-card.status-recusado,
.public-order-hero.status-cancelado,
.public-order-hero.status-recusado { --status-color: #ef4444; }

.public-order-detail {
    align-content: start;
    background: rgba(255,255,255,.94);
}

.public-order-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--status-color, #14b8a6) 18%, transparent), rgba(255,255,255,.88));
    border: 1px solid color-mix(in srgb, var(--status-color, #14b8a6) 34%, transparent);
}

.public-order-hero h2 {
    margin: 2px 0 4px;
    color: var(--heading);
    font-size: 26px;
    font-weight: 900;
}

.public-order-hero p {
    margin: 0;
    color: var(--text);
    font-weight: 750;
}

.public-order-hero > strong {
    color: var(--heading);
    font-size: 24px;
    white-space: nowrap;
}

.public-order-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.public-order-meta span {
    display: grid;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-solid);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.public-order-meta strong {
    color: var(--heading);
}

.public-order-timeline {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
}

.public-order-timeline span {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
}

.public-order-timeline i {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-style: normal;
    font-size: 10px;
    font-weight: 900;
}

.public-order-timeline span.done,
.public-order-timeline span.current {
    border-color: color-mix(in srgb, var(--status-color, #14b8a6) 40%, transparent);
    color: var(--heading);
}

.public-order-timeline span.done i,
.public-order-timeline span.current i {
    background: var(--status-color, #14b8a6);
    color: #fff;
}

.public-order-timeline span.current {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #14b8a6) 16%, transparent);
}

.public-order-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
    gap: 12px;
}

.public-order-items,
.public-order-total {
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-solid);
}

.public-order-items {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.public-order-items h3,
.public-order-total h3 {
    margin: 0;
    color: var(--heading);
    font-size: 16px;
    font-weight: 900;
}

.public-order-items > div {
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.public-order-items > div:last-child {
    border-bottom: 0;
}

.public-order-items small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.public-order-total {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
}

.public-order-total h3 {
    grid-column: 1 / -1;
}

.public-order-total strong:last-child {
    color: var(--success);
    font-size: 20px;
}

.public-order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.public-cart-total {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(34,197,94,.12);
    color: var(--success);
    font-weight: 900;
}

.instagram-thread {
    display: grid;
    gap: 10px;
}

.instagram-message {
    max-width: min(680px, 100%);
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-solid);
}

.instagram-message.outbound {
    justify-self: end;
    background: rgba(34,197,94,.11);
    border-color: rgba(34,197,94,.28);
}

.instagram-message p {
    margin: 4px 0;
    color: var(--text);
}

.reward-form,
.loyalty-search-form {
    display: grid;
    gap: 10px;
}

.reward-form {
    grid-template-columns: minmax(160px, 1fr) 110px;
}

.reward-form textarea,
.reward-form label,
.reward-form button {
    grid-column: 1 / -1;
}

.loyalty-search-form {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.loyalty-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    gap: 18px;
    align-items: start;
}

.loyalty-balance-card,
.loyalty-public-balance {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid rgba(34,197,94,.28);
    border-radius: 18px;
    background: rgba(34,197,94,.11);
    color: var(--success);
}

.loyalty-balance-card strong,
.loyalty-public-balance strong {
    font-size: 34px;
    line-height: 1;
}

.loyalty-statement,
.loyalty-public-rewards {
    display: grid;
    gap: 10px;
}

.loyalty-statement div,
.loyalty-public-rewards div {
    display: grid;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.loyalty-statement .gain strong { color: var(--success); }
.loyalty-statement .redeem strong { color: var(--danger); }
.loyalty-statement span { color: var(--muted); font-size: 13px; }

.loyalty-public-rule {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
}

.loyalty-public-rewards h2,
.loyalty-statement h2 {
    margin: 0;
    font-size: 20px;
}

.loyalty-public-rewards span {
    color: var(--orange);
    font-weight: 900;
}

.report-tabs { display: grid; gap: 18px; }

.skeleton-row td {
    padding: 14px 16px;
}

.skeleton-bar {
    height: 14px;
    width: 100%;
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(148,163,184,.18), rgba(148,163,184,.34), rgba(148,163,184,.18));
    background-size: 220% 100%;
    animation: skeleton 1.1s ease infinite;
}

@keyframes skeleton {
    to { background-position: -220% 0; }
}

@media (max-width: 1180px) {
    .metrics { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .setup-empty-cards { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .public-menu-layout,
    .public-orders-layout,
    .public-order-content-grid,
    .public-order-meta,
    .public-product {
        grid-template-columns: 1fr;
    }

    .public-cart {
        position: fixed;
        inset: auto 0 0;
        z-index: 80;
        max-height: 88vh;
        overflow-y: auto;
        padding: 14px;
        transform: translateY(110%);
        transition: transform .22s ease;
        border-radius: 22px 22px 0 0;
        background: var(--surface-solid);
        box-shadow: 0 -18px 42px rgba(15,23,42,.24);
    }

    .public-menu-shell.public-cart-open .public-cart {
        transform: translateY(0);
    }

    .public-cart-close {
        display: grid;
        justify-self: end;
        width: 40px;
        height: 40px;
        place-items: center;
        border-radius: 999px;
    }

    .public-cart-fab {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 16px;
        z-index: 75;
        display: grid;
        place-items: center;
        min-height: 52px;
        border-radius: 999px;
        box-shadow: 0 16px 34px rgba(15,23,42,.22);
    }

    .public-cart-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        border: 0;
        background: rgba(15,23,42,.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .public-menu-shell.public-cart-open .public-cart-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .public-orders-list {
        max-height: none;
        overflow: visible;
    }

    .public-order-timeline {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .public-order-timeline span {
        min-width: 118px;
    }
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    color: var(--orange);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.delivery-nav-link {
    padding-right: 58px !important;
}

.delivery-sidebar-badge {
    position: absolute;
    right: 12px;
    min-width: 26px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--orange), var(--red));
    box-shadow: 0 10px 24px rgba(255,59,48,.26);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.delivery-icon-alert {
    position: absolute;
    top: 7px;
    right: 9px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(255,59,48,.15);
    animation: deliveryPulse 1.4s ease-in-out infinite;
}

body.sidebar-collapsed .delivery-nav-link {
    padding-right: 10px !important;
}

body.sidebar-collapsed .delivery-sidebar-badge {
    top: 5px;
    right: 9px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    font-size: 11px;
}

body.sidebar-collapsed .delivery-icon-alert {
    top: 7px;
    right: 22px;
}

.delivery-top-alert,
.delivery-new-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(255,59,48,.24);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 12px 28px rgba(255,59,48,.2);
    font-size: 13px;
    font-weight: 900;
}

.delivery-top-alert:hover,
.delivery-new-pill:hover {
    color: #fff;
    transform: translateY(-1px);
}

.delivery-top-alert strong {
    color: inherit;
}

@keyframes deliveryPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: .65; }
}

.dashboard-toast {
    position: fixed;
    top: calc(var(--topbar-height) + 34px);
    right: 24px;
    z-index: 90;
    width: min(380px, calc(100vw - 32px));
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(34,197,94,.24);
    border-radius: 18px;
    color: var(--success);
    background: rgba(240,253,244,.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(145%);
    animation: toastIn .24s ease both;
}

html[data-theme="dark"] .dashboard-toast {
    background: rgba(20,83,45,.94);
    color: #dcfce7;
}

.dashboard-toast.error {
    color: var(--danger);
    border-color: rgba(255,59,48,.24);
    background: rgba(255,241,242,.96);
}

html[data-theme="dark"] .dashboard-toast.error {
    background: rgba(127,29,29,.94);
    color: #fee2e2;
}

.dashboard-toast strong,
.dashboard-toast span {
    display: block;
}

.dashboard-toast strong {
    color: inherit;
    font-size: 14px;
    font-weight: 950;
}

.dashboard-toast span {
    margin-top: 2px;
    color: inherit;
    font-size: 13px;
    font-weight: 750;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.delivery-orders-head {
    align-items: center;
}

.delivery-orders-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.delivery-queue-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.delivery-queue-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    display: grid;
    align-content: end;
    gap: 7px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.delivery-queue-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .12;
    background: linear-gradient(135deg, currentColor, transparent 68%);
}

.delivery-queue-card > * {
    position: relative;
    z-index: 1;
}

.delivery-queue-card > svg {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    opacity: .44;
}

.delivery-queue-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.delivery-queue-card strong {
    color: var(--heading);
    font-size: 38px;
    line-height: 1;
    font-weight: 950;
}

.delivery-filter-bar label {
    min-width: min(260px, 100%);
}

.delivery-status-badge,
.delivery-type-chip {
    --status-color: #14b8a6;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--status-color) 30%, transparent);
    color: color-mix(in srgb, var(--status-color) 72%, var(--heading));
    background: color-mix(in srgb, var(--status-color) 12%, transparent);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.delivery-status-badge.status-novo { --status-color: #14b8a6; }
.delivery-status-badge.status-confirmado { --status-color: #2563eb; }
.delivery-status-badge.status-em_preparo { --status-color: #f97316; }
.delivery-status-badge.status-pronto { --status-color: #7c3aed; }
.delivery-status-badge.status-saiu_para_entrega { --status-color: #0ea5e9; }
.delivery-status-badge.status-entregue { --status-color: #22c55e; }
.delivery-status-badge.status-cancelado,
.delivery-status-badge.status-recusado { --status-color: #ef4444; }

.delivery-type-chip.delivery { --status-color: #0ea5e9; }
.delivery-type-chip.pickup { --status-color: #7c3aed; }

.delivery-order-row.status-novo td {
    background: rgba(20,184,166,.055);
}

.delivery-order-row.status-novo td:first-child {
    box-shadow: inset 4px 0 0 #14b8a6;
}

.delivery-detail-header {
    --status-color: #14b8a6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 22px;
    border: 1px solid color-mix(in srgb, var(--status-color) 22%, rgba(255,255,255,.62));
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--status-color) 14%, transparent), rgba(255,255,255,.9)),
        var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

html[data-theme="dark"] .delivery-detail-header {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--status-color) 18%, transparent), rgba(15,23,42,.78)),
        var(--surface);
}

.delivery-detail-header.status-novo { --status-color: #14b8a6; }
.delivery-detail-header.status-confirmado { --status-color: #2563eb; }
.delivery-detail-header.status-em_preparo { --status-color: #f97316; }
.delivery-detail-header.status-pronto { --status-color: #7c3aed; }
.delivery-detail-header.status-saiu_para_entrega { --status-color: #0ea5e9; }
.delivery-detail-header.status-entregue { --status-color: #22c55e; }
.delivery-detail-header.status-cancelado,
.delivery-detail-header.status-recusado { --status-color: #ef4444; }

.delivery-detail-title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 950;
}

.delivery-header-tags,
.delivery-card-actions,
.delivery-negative-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.delivery-header-tags {
    margin-top: 10px;
}

.delivery-header-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
}

.delivery-header-summary span {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--muted);
    background: rgba(255,255,255,.58);
    font-size: 12px;
    font-weight: 850;
}

html[data-theme="dark"] .delivery-header-summary span {
    background: rgba(255,255,255,.06);
}

.delivery-header-summary strong {
    color: var(--heading);
    font-size: 16px;
    font-weight: 950;
}

.delivery-status-timeline {
    --status-color: #14b8a6;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.delivery-status-timeline.status-novo { --status-color: #14b8a6; }
.delivery-status-timeline.status-confirmado { --status-color: #2563eb; }
.delivery-status-timeline.status-em_preparo { --status-color: #f97316; }
.delivery-status-timeline.status-pronto { --status-color: #7c3aed; }
.delivery-status-timeline.status-saiu_para_entrega { --status-color: #0ea5e9; }
.delivery-status-timeline.status-entregue { --status-color: #22c55e; }
.delivery-status-timeline.status-cancelado,
.delivery-status-timeline.status-recusado { --status-color: #ef4444; }

.delivery-status-timeline span,
.delivery-status-ended {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
    min-height: 82px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: var(--surface-soft);
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.delivery-status-timeline span > svg,
.delivery-status-ended > svg {
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-solid);
}

.delivery-status-timeline span.done,
.delivery-status-timeline span.current {
    color: var(--heading);
    border-color: color-mix(in srgb, var(--status-color) 34%, transparent);
    background: color-mix(in srgb, var(--status-color) 10%, var(--surface-solid));
}

.delivery-status-timeline span.done > svg,
.delivery-status-timeline span.current > svg,
.delivery-status-ended > svg {
    color: #fff;
    background: var(--status-color);
}

.delivery-status-timeline span.current {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 16%, transparent);
}

.delivery-status-ended {
    color: var(--heading);
    border-color: color-mix(in srgb, var(--status-color) 34%, transparent);
}

.delivery-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .78fr);
    gap: 16px;
    align-items: start;
}

.delivery-detail-side {
    position: sticky;
    top: calc(var(--topbar-height) + 42px);
    display: grid;
    gap: 12px;
}

.delivery-card {
    padding: 16px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(135%);
}

html[data-theme="dark"] .delivery-card,
html[data-theme="dark"] .delivery-status-timeline,
html[data-theme="dark"] .delivery-queue-card {
    border-color: rgba(255,255,255,.09);
}

.delivery-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.delivery-card > header > svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 13px;
    color: var(--orange);
    background: rgba(255,107,53,.11);
}

.delivery-card h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 950;
}

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

.delivery-info-grid .span-2 {
    grid-column: 1 / -1;
}

.delivery-info-grid span,
.delivery-notes-list span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 850;
}

.delivery-info-grid strong,
.delivery-notes-list strong {
    color: var(--heading);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
    word-break: break-word;
}

.delivery-card-actions {
    margin-top: 14px;
}

.delivery-action-form,
.delivery-negative-actions form {
    margin: 0;
}

.delivery-action-form button,
.delivery-negative-actions button {
    width: 100%;
}

.delivery-primary-action {
    width: 100%;
    min-height: 52px !important;
    font-size: 15px !important;
}

.delivery-negative-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

.delivery-danger-action {
    color: var(--danger) !important;
}

.delivery-complete-note {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid rgba(34,197,94,.22);
    border-radius: 16px;
    color: var(--success);
    background: rgba(34,197,94,.08);
    text-align: center;
}

.delivery-complete-note strong {
    color: inherit;
    font-weight: 950;
}

.delivery-complete-note span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.delivery-money-lines,
.delivery-notes-list {
    display: grid;
    gap: 9px;
}

.delivery-money-lines span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: 850;
}

.delivery-money-lines span:last-child {
    border-bottom: 0;
}

.delivery-money-lines strong {
    color: var(--heading);
    font-weight: 950;
}

.delivery-money-lines .total {
    margin-top: 3px;
    padding: 14px;
    border: 0;
    border-radius: 16px;
    color: var(--heading);
    background: linear-gradient(135deg, rgba(255,107,53,.13), rgba(37,99,235,.08));
}

.delivery-money-lines .total strong {
    font-size: 22px;
}

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

.order-items-scroll {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.order-items-scroll .delivery-items-table {
    margin: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
    backdrop-filter: none;
}

.order-items-scroll .delivery-items-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-solid);
}

.delivery-items-table td,
.delivery-items-table th {
    white-space: nowrap;
}

.delivery-items-table .delivery-item-name,
.delivery-items-table .delivery-item-note {
    min-width: 180px;
    max-width: 320px;
    white-space: normal;
}

.delivery-note-toggle-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.delivery-note-toggle {
    min-height: 38px !important;
    padding: 8px 11px !important;
}

.delivery-order-note {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255,107,53,.22);
    border-radius: 14px;
    background: rgba(255,107,53,.08);
}

.delivery-order-note[hidden] {
    display: none;
}

.delivery-order-note strong {
    color: var(--heading);
    font-size: 13px;
    font-weight: 950;
}

.delivery-order-note p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

@media (max-width: 960px) {
    .app-layout {
        display: block;
    }

    .main-wrapper {
        width: 100%;
    }

    .dashboard-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 300px) !important;
        height: 100vh;
        max-height: 100vh;
        flex-basis: auto !important;
        border-right: 1px solid rgba(255,255,255,.56);
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
        transform: translateX(-105%);
        z-index: 60;
    }

    .sidebar-brand {
        min-height: var(--topbar-height) !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        padding: 16px 18px !important;
    }

    .brand-copy,
    .nav-link-main span,
    .nav-section a span,
    .nav-section-title .nav-label {
        opacity: 1 !important;
        width: auto !important;
    }

    body.sidebar-collapsed .nav-link-main,
    body.sidebar-collapsed .nav-section a,
    body.sidebar-collapsed .nav-section-title {
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }

    body.sidebar-collapsed .nav-section-title::after {
        display: block;
    }

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

    .sidebar-collapse-toggle { display: none; }

    .mobile-menu-toggle {
        display: grid;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        border: 0;
        background: rgba(15,23,42,.42);
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1 !important;
        pointer-events: auto;
    }

    .dashboard-topbar {
        position: sticky;
        top: 0;
        margin: 0;
        min-height: 72px;
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }

    .dashboard-topbar .topbar-actions {
        flex-direction: row;
        align-items: center;
    }

    .dashboard-main {
        padding: 18px 12px 28px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 8px;
    }

    .page-head,
    .assistant-dashboard-card,
    .topbar-actions,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero {
        min-height: 260px;
    }

    .kitchen-actions { width: 100%; }
    .kitchen-actions .button,
    .kitchen-actions button { width: 100%; }

    .metrics,
    .setup-empty-cards,
    .delivery-queue-metrics,
    .delivery-detail-layout,
    .delivery-detail-header,
    .form-grid,
    .split,
    .assistant-layout,
    .sale-cart-layout,
    .loyalty-layout,
    .public-menu-layout,
    .public-orders-layout,
    .public-product,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .delivery-detail-side {
        position: static;
    }

    .delivery-header-summary,
    .delivery-info-grid {
        grid-template-columns: 1fr;
    }

    .delivery-info-grid .span-2 {
        grid-column: auto;
    }

    .delivery-status-timeline {
        grid-template-columns: repeat(5, minmax(132px, 1fr));
        overflow-x: auto;
    }

    .order-items-scroll {
        max-height: 240px;
    }

    .delivery-orders-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .public-cart,
    .sale-checkout-panel {
        position: static;
    }

    .public-cart {
        position: fixed;
        inset: auto 0 0;
        z-index: 80;
        max-height: 88vh;
        overflow-y: auto;
        padding: 14px;
        transform: translateY(110%);
        transition: transform .22s ease;
        border-radius: 22px 22px 0 0;
        background: var(--surface-solid);
        box-shadow: 0 -18px 42px rgba(15,23,42,.24);
    }

    .public-menu-shell.public-cart-open .public-cart {
        transform: translateY(0);
    }

    .public-cart-close {
        display: grid;
        justify-self: end;
        width: 40px;
        height: 40px;
        place-items: center;
        border-radius: 999px;
    }

    .public-cart-fab {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 16px;
        z-index: 75;
        display: grid;
        place-items: center;
        min-height: 52px;
        border-radius: 999px;
        box-shadow: 0 16px 34px rgba(15,23,42,.22);
    }

    .public-cart-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: block;
        border: 0;
        background: rgba(15,23,42,.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .public-menu-shell.public-cart-open .public-cart-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .span-2 { grid-column: span 1; }
    .toolbar, .inline-form { display: grid; }

    .new-table-form,
    .setup-panel-head,
    .setup-progress-label,
    .setup-next-step,
    .checkout-customer-row,
    .assistant-form,
    .product-modal-filters,
    .product-picker-actions,
    .reward-form,
    .loyalty-search-form {
        grid-template-columns: 1fr;
    }

    .public-orders-head,
    .public-customer-actions {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .tablet-head,
    .tablet-order-summary,
    .kitchen-item {
        grid-template-columns: 1fr;
    }

    .tablet-order-summary button {
        grid-row: auto;
        min-width: 0;
        width: 100%;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .cart-line,
    .payment-line {
        grid-template-columns: 1fr;
    }

    .cart-line-actions {
        justify-items: start;
    }

    .cart-line-actions form {
        grid-template-columns: minmax(90px, 120px) auto;
        justify-items: start;
    }
}

@media (max-width: 560px) {
    .metrics,
    .setup-empty-cards { grid-template-columns: 1fr; }
    .page-head,
    .dashboard-hero,
    .panel,
    .delivery-card,
    .delivery-detail-header,
    .delivery-status-timeline,
    .form-grid,
    .toolbar,
    .sale-cart-panel,
    .sale-checkout-panel {
        border-radius: 18px;
        padding: 18px;
    }

    .delivery-negative-actions {
        grid-template-columns: 1fr;
    }

    .delivery-detail-title h1 {
        font-size: 27px;
    }

    .delivery-header-tags,
    .delivery-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .delivery-header-tags > *,
    .delivery-card-actions > *,
    .delivery-orders-head-actions > * {
        width: 100%;
    }

    .delivery-top-alert span {
        display: none;
    }

    .dashboard-toast {
        right: 16px;
        top: 84px;
    }

    .dashboard-topbar {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding: 12px;
    }

    .dashboard-topbar strong {
        font-size: 18px;
    }

    .topbar-actions {
        width: auto;
        justify-content: flex-end;
        gap: 8px;
    }

    .topbar-actions > span {
        display: none;
    }

    .login-panel {
        padding: 24px;
        border-radius: 22px;
    }

    .auth-logo {
        width: clamp(180px, 76%, 261px);
        max-width: calc(100% - 12px);
        margin-bottom: 6px;
    }
}
