:root {
    /* Modern Vietnamese Coffee House Tokens */
    --color-espresso: #4E342E;
    --color-primary: #795548;
    --color-primary-hover: #5D4037;
    --color-primary-soft: #F2E9E4;
    --color-background: #F8F7F4;
    --color-surface: #FFFFFF;
    --color-surface-subtle: #F2EFEB;
    --color-accent: #D7B899;
    --color-secondary: #52606D;
    --color-secondary-hover: #3D4A56;
    --color-secondary-soft: #EEF1F3;
    --color-success: #2E7D32;
    --color-success-soft: #EAF5EB;
    --color-warning: #A66308;
    --color-warning-soft: #FFF6E7;
    --color-danger: #B32635;
    --color-danger-soft: #FCEDEF;
    --color-text: #253041;
    --color-muted: #64748B;
    --color-border: #E3DED8;
    --color-border-light: #EEEAE5;

    /* Spacing System (bội số 4/8px) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;

    /* Shadows rất nhẹ (chỉ dùng phân lớp) */
    --shadow-xs: 0 1px 2px rgba(46, 35, 31, 0.04);
    --shadow-sm: 0 3px 10px rgba(46, 35, 31, 0.06);
    --shadow-md: 0 8px 22px rgba(46, 35, 31, 0.08);
    --shadow-lg: 0 18px 44px rgba(46, 35, 31, 0.14);

    /* Bootstrap Overrides */
    --bs-body-font-family: Inter, "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-bg: var(--color-background);
    --bs-body-color: var(--color-text);
    --bs-primary: var(--color-primary);
    --bs-primary-rgb: 121, 85, 72;
    --bs-secondary: var(--color-secondary);
    --bs-secondary-rgb: 82, 96, 109;
    --bs-success: var(--color-success);
    --bs-success-rgb: 46, 125, 50;
    --bs-warning: var(--color-warning);
    --bs-warning-rgb: 166, 99, 8;
    --bs-danger: var(--color-danger);
    --bs-danger-rgb: 179, 38, 53;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-family: var(--bs-body-font-family); font-size: 14px; line-height: 1.5; color: var(--color-text); background-color: var(--color-background); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
code { color: #6D4C41; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.icon-sheet { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 1100; padding: 12px 16px; background: var(--color-surface); color: var(--color-primary); border-radius: var(--radius-sm); font-weight: 600; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 8px; }
.pos-page { height: 100vh; height: 100dvh; overflow: hidden; background: var(--color-background); }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.app-frame { min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pos-page .app-shell, .pos-page .app-frame { height: 100vh; height: 100dvh; min-height: 0; }
.app-sidebar { position: sticky; top: 0; z-index: 940; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px 16px; overflow-y: auto; background: #F0ECE7; border-right: 1px solid var(--color-border); }
.sidebar-brand-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-espresso); font-size: 22px; font-weight: 750; letter-spacing: -.8px; line-height: 1; white-space: nowrap; }
.brand:hover { color: var(--color-espresso); }
.brand-accent { color: var(--color-primary); }
.brand small { display: block; font-size: 10px; letter-spacing: 1.4px; font-weight: 650; color: var(--color-muted); margin-top: 5px; }
.sidebar-close.icon-button, .sidebar-toggle.icon-button { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; }
.sidebar-label { margin: 18px 12px 6px; color: #867A74; font-size: 10px; line-height: 1.4; font-weight: 750; letter-spacing: 1.25px; text-transform: uppercase; }
.sidebar-label:first-child { margin-top: 0; }
.sidebar-primary-link { min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--color-espresso); background: rgba(255, 255, 255, .56); border: 1px solid rgba(78, 52, 46, .08); text-decoration: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.sidebar-primary-link:hover { color: var(--color-espresso); background: #fff; }
.sidebar-primary-link.active { color: #fff; background: var(--color-espresso); border-color: var(--color-espresso); }
.sidebar-primary-link .icon { width: 20px; height: 20px; }
.sidebar-primary-link .module-chevron { width: 15px; height: 15px; margin-left: auto; transition: transform .15s ease; }
.sidebar-module[open] > summary .module-chevron { transform: rotate(90deg); }
.sidebar-module > summary { list-style: none; }
.sidebar-module > summary::-webkit-details-marker { display: none; }
.sidebar-management-module > summary { font-size: 16px; font-weight: 750; }
.sidebar-submenu, .sidebar-sales-categories { margin: 6px 0 0 18px; padding: 4px 0 4px 12px; border-left: 1px solid rgba(78, 52, 46, .16); }
.sidebar-submenu { display: grid; gap: 2px; }
.sidebar-submenu .sidebar-link { min-height: 45px; padding: 12px 15px; font-size: 16px; }
.sidebar-submenu .sidebar-link.active { color: var(--color-primary); background: #fff; box-shadow: none; }
.sidebar-category-title { margin: 2px 8px 6px; color: #867A74; font-size: 10px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-link { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #665C57; text-decoration: none; font-size: 13px; font-weight: 600; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.sidebar-link .icon { width: 19px; height: 19px; }
.sidebar-link:hover { color: var(--color-espresso); background: rgba(255, 255, 255, .65); }
.sidebar-link:active { transform: translateY(1px); }
.sidebar-link.active { color: #fff; background: var(--color-espresso); box-shadow: var(--shadow-sm); }
.sidebar-account { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(78, 52, 46, .12); }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; color: var(--color-espresso); text-decoration: none; border-radius: var(--radius-md); }
.sidebar-user:hover { color: var(--color-espresso); background: rgba(255, 255, 255, .65); }
.sidebar-user > span:last-child, .account-link > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong, .sidebar-user small, .account-link strong, .account-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { max-width: 145px; font-size: 12px; }
.sidebar-user small { color: var(--color-muted); font-size: 11px; }
.user-avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--color-border); border-radius: 50%; color: var(--color-primary); background: var(--color-surface); }
.user-avatar .icon { width: 18px; height: 18px; }
.sidebar-logout { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 8px 12px; border: 0; border-radius: var(--radius-md); color: var(--color-muted); background: transparent; font-size: 12px; font-weight: 600; text-align: left; }
.sidebar-logout:hover { color: var(--color-danger); background: var(--color-danger-soft); }
.sidebar-logout .icon { width: 18px; height: 18px; }
.app-sidebar-backdrop { display: none; }
.app-header { position: relative; z-index: 900; display: flex; flex-shrink: 0; align-items: center; gap: 16px; padding: 12px 22px; min-height: 72px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--color-border); }
.pos-page .app-header { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.header-context { min-width: 170px; display: flex; flex-direction: column; }
.header-context span { color: var(--color-muted); font-size: 11px; }
.header-context strong { color: var(--color-espresso); font-size: 15px; font-weight: 700; }
.header-toolbar { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.account-link { flex: 0 0 auto; margin-left: auto; text-decoration: none; color: var(--color-espresso); display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: var(--radius-md); min-width: 0; transition: background-color 0.15s ease; }
.account-link:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.account-link strong { max-width: 135px; font-size: 12px; }
.account-link small { color: var(--color-muted); font-size: 11px; }
/* Auth Layout */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-background); }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 16px; }
.auth-header { display: flex; justify-content: center; padding: 24px 0 12px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 460px; margin: 0 auto; padding: 12px 0; }
.auth-footer { text-align: center; padding: 16px 0; font-size: 12px; color: var(--color-muted); }
.auth-card { width: 100%; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 36px 32px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--color-primary); }
.auth-card-brand { text-align: center; margin-bottom: 24px; }
.auth-badge { display: inline-block; padding: 4px 12px; background: var(--color-primary-soft); color: var(--color-primary); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; border-radius: var(--radius-pill); margin-bottom: 12px; }
.auth-card-title { font-size: 22px; font-weight: 750; color: var(--color-espresso); margin: 0 0 6px; letter-spacing: -.3px; }
.auth-card-desc { font-size: 13px; color: var(--color-muted); margin: 0; line-height: 1.5; }
.auth-form { margin-top: 18px; }
.auth-form .form-label { font-size: 13px; font-weight: 600; color: var(--color-espresso); margin-bottom: 6px; }
.auth-form .form-control { min-height: 44px; font-size: 14px; border-radius: var(--radius-md); border-color: var(--color-border); }
.auth-form .form-control:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(121, 85, 72, 0.14); }
.password-input-group { position: relative; display: flex; align-items: center; }
.password-input-group .form-control { padding-right: 46px; }
.btn-password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--color-muted); cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.btn-password-toggle:hover { color: var(--color-espresso); background-color: var(--color-surface-subtle); }
.btn-password-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.btn-password-toggle .icon { width: 18px; height: 18px; }
.auth-submit-btn { min-height: 46px; font-size: 14px; font-weight: 650; box-shadow: var(--shadow-sm); }
.auth-footer-help { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--color-border-light); text-align: center; font-size: 12px; color: var(--color-muted); }
.header-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; max-width: 400px; background: var(--color-surface-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 14px; color: var(--color-muted); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.header-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(121, 85, 72, 0.14); background: var(--color-surface); }
.header-search input { width: 100%; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--color-text); font-size: 13px; }
.header-search input::placeholder { color: #A0968F; }
.header-actions, .utility-actions { display: flex; align-items: center; gap: 10px; }
.header-actions { margin-left: auto; }
.utility-actions { gap: 4px; border-right: 1px solid var(--color-border); padding-right: 8px; }
.clear-link { background: none; border: none; color: var(--color-muted); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; padding: 8px 6px; white-space: nowrap; }
.clear-link:hover { color: var(--color-danger); }
.clear-link:disabled { opacity: .45; }
.icon-button { border: 1px solid transparent; background: transparent; color: var(--color-muted); width: 40px; height: 40px; display: inline-flex; justify-content: center; align-items: center; border-radius: var(--radius-md); transition: background-color 0.15s ease, color 0.15s ease; }
.icon-button:hover { background: var(--color-surface-subtle); color: var(--color-espresso); }
.icon-button:active { background: var(--color-border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; min-height: 42px; border-radius: var(--radius-md); padding: 10px 16px; white-space: nowrap; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; border: 1px solid transparent; }
.btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--color-primary); --bs-btn-border-color: var(--color-primary); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--color-primary-hover); --bs-btn-hover-border-color: var(--color-primary-hover); --bs-btn-active-bg: var(--color-espresso); --bs-btn-active-border-color: var(--color-espresso); --bs-btn-disabled-bg: #D9CEC9; --bs-btn-disabled-border-color: #D9CEC9; --bs-btn-disabled-color: #786B65; }
.btn-outline-secondary { --bs-btn-color: var(--color-secondary); --bs-btn-bg: var(--color-surface); --bs-btn-border-color: var(--color-border); --bs-btn-hover-bg: var(--color-surface-subtle); --bs-btn-hover-color: var(--color-secondary); --bs-btn-hover-border-color: var(--color-secondary); --bs-btn-active-bg: var(--color-secondary-soft); --bs-btn-active-color: var(--color-secondary); }
.btn-danger { --bs-btn-color: #fff; --bs-btn-bg: var(--color-danger); --bs-btn-border-color: var(--color-danger); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #961B28; --bs-btn-hover-border-color: #961B28; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.add-product > span { font-size: 20px; line-height: 1; font-weight: 400; }
.notification-menu { padding: 20px; width: min(300px, calc(100vw - 32px)); box-shadow: 0 8px 30px #24334a14; border-color: var(--color-border); }
.notification-menu p { margin: 12px 0; }
.notification-menu small { color: var(--color-muted); }
.app-main { padding: 0 20px 20px; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.pos-page .app-main { padding-top: 16px; }
h1 { margin: 0; font-size: 14px; font-weight: 650; }
.demo-badge { color: var(--color-warning); background: var(--color-warning-soft); border: 1px solid rgba(161, 92, 22, 0.2); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pos-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); gap: 16px; min-height: 0; flex: 1; }
.surface { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); min-width: 0; box-shadow: var(--shadow-xs); }
h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.3px; color: var(--color-espresso); }
.eyebrow, .management-eyebrow { display: block; font-size: 11px; letter-spacing: 1.4px; color: var(--color-primary); font-weight: 700; text-transform: uppercase; margin-bottom: 6px; }
.category-list { display: flex; flex-direction: column; gap: 3px; padding: 0; }
.category-button { border: 0; background: transparent; border-radius: var(--radius-md); width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--color-muted); text-align: left; font-size: 12px; font-weight: 550; transition: background-color .15s, color .15s; }
.pos-page .category-button { min-height: 42px; padding: 10px 12px; font-size: 14px; }
.pos-page .category-button .category-count { font-size: 13px; }
.category-button .category-label { flex: 1; }
.category-button .category-count { color: var(--color-muted); font-size: 12px; }
.category-button .icon { width: 16px; height: 16px; }
.category-button:hover { background: rgba(255, 255, 255, .68); color: var(--color-espresso); }
.category-button.active { background: #fff; color: var(--color-primary); font-weight: 700; box-shadow: var(--shadow-xs); }
.category-button.active .category-count { color: var(--color-primary); }
.category-button:active { transform: translateY(1px); }
.sidebar-bottom { margin-top: auto; padding: 24px 18px 20px; color: var(--color-muted); }
.sidebar-bottom .icon { margin-bottom: 10px; width: 24px; height: 24px; color: var(--color-primary); }
.sidebar-bottom strong { font-size: 12px; font-weight: 600; color: var(--color-espresso); }
.sidebar-bottom p { font-size: 12px; color: var(--color-muted); margin: 4px 0 0; }
.menu-panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.order-controls { padding: 16px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(140px, 1fr); gap: 14px 18px; }
.field-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--color-espresso); }
.segmented { display: flex; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 3px; gap: 3px; min-height: 42px; background: var(--color-surface-subtle); }
.segmented button { display: flex; justify-content: center; align-items: center; flex: 1; gap: 6px; border: 1px solid transparent; background: transparent; color: var(--color-muted); border-radius: var(--radius-sm); padding: 7px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background-color .15s, color .15s; }
.segmented button .icon { width: 16px; height: 16px; }
.segmented button:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-primary); }
.segmented button.active { color: var(--color-primary); border-color: var(--color-border); background: var(--color-surface); font-weight: 700; box-shadow: var(--shadow-xs); }
.note-field { grid-column: 1 / -1; }
.form-control, .form-select { min-height: 42px; border: 1px solid var(--color-border); border-radius: var(--radius-md); font-size: 14px; color: var(--color-text); background-color: var(--color-surface); padding: 8px 12px; }
.form-control::placeholder { color: #A0968F; }
.form-control:focus, .form-select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(121, 85, 72, 0.14); outline: none; }
.menu-heading { padding: 18px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-heading > div { display: flex; align-items: baseline; gap: 10px; }
.menu-heading h2 { font-size: 18px; }
#product-count { color: var(--color-muted); font-size: 12px; }
.menu-tip { display: flex; gap: 6px; align-items: center; color: var(--color-muted); font-size: 12px; }
.menu-tip .icon { width: 14px; height: 14px; }
.product-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 8px 2px; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-content: start; }
.product-card { min-width: 0; text-align: left; display: flex; flex-direction: column; position: relative; background: var(--color-surface); padding: 8px; border: 2px solid transparent; border-radius: var(--radius-lg); transition: border-color .15s, box-shadow .15s, transform .15s; box-shadow: 0 0 0 1px var(--color-border); }
.product-card:hover { border-color: rgba(121, 85, 72, 0.45); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.product-card:active { transform: scale(.98); }
.product-card.selected { border-color: var(--color-primary); box-shadow: none; }
.product-image { position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface-subtle); }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.product-card:hover img { transform: scale(1.03); }
.selected-mark { display: none; position: absolute; right: 7px; top: 7px; border: 2px solid white; background: var(--color-primary); color: white; border-radius: 50%; width: 23px; height: 23px; align-items: center; justify-content: center; }
.selected .selected-mark { display: flex; }
.selected-mark .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.product-info { display: flex; flex-direction: column; flex: 1; padding: 10px 2px 4px; position: relative; }
.product-name { font-size: 13px; line-height: 1.45; font-weight: 650; color: var(--color-espresso); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; margin-bottom: 8px; }
.product-prices { display: flex; flex-direction: column; margin-top: auto; gap: 2px; padding-right: 26px; }
.product-prices del { font-size: 12px; color: var(--color-muted); min-height: 16px; }
.product-prices strong { font-size: 14px; font-weight: 750; color: var(--color-primary); }
.product-add { position: absolute; right: 1px; bottom: 5px; width: 26px; height: 26px; background: var(--color-primary-soft); color: var(--color-primary); border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 18px; font-weight: 600; }
.selected .product-add { color: white; background: var(--color-primary); }
.menu-footnote { display: flex; justify-content: space-between; padding-top: 10px; color: var(--color-muted); font-size: 12px; gap: 10px; }
.cart-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 20px 18px 16px; border-bottom: 1px solid var(--color-border); }
.cart-heading h2 { display: flex; gap: 8px; align-items: center; font-size: 18px; }
#cart-count { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; font-size: 12px; font-weight: 700; border-radius: var(--radius-sm); color: var(--color-primary); background: var(--color-primary-soft); }
.cart-heading p { font-size: 12px; color: var(--color-muted); margin: 4px 0 0; }
.order-meta { text-align: right; }
.order-meta strong { color: var(--color-secondary); font-size: 13px; font-weight: 700; }
.order-meta time { display: block; margin-top: 4px; color: var(--color-muted); font-size: 12px; }
.cart-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 4px; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
@keyframes cart-item-add {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes total-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}
.total-pulsing { animation: total-pulse 180ms ease-out; display: inline-block; }
.cart-item { padding: 12px 10px; border-radius: var(--radius-md); background: var(--color-surface-subtle); border: 1px solid var(--color-border-light); display: flex; gap: 10px; margin-bottom: 10px; animation: cart-item-add 180ms ease-out; }
.cart-thumbnail { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-detail { flex: 1; min-width: 0; }
.cart-item h3 { margin: 0 0 4px; font-size: 13px; font-weight: 650; color: var(--color-espresso); line-height: 1.4; overflow-wrap: anywhere; }
.cart-unit-price { color: var(--color-muted); font-size: 12px; }
.quantity-control { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.quantity-control button { border: none; background: var(--color-primary); color: white; border-radius: 50%; height: 26px; width: 26px; font-size: 18px; line-height: 1; cursor: pointer; }
.quantity-control button:hover:not(:disabled) { background: var(--color-primary-hover); }
.quantity-control button:disabled { opacity: .35; cursor: not-allowed; }
.quantity { font-size: 13px; font-weight: 600; min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-item-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.remove-item { width: 28px; height: 28px; }
.remove-item .icon { width: 16px; height: 16px; }
.line-total { font-size: 13px; font-weight: 700; color: var(--color-espresso); white-space: nowrap; margin-bottom: 4px; }
.cart-bottom { flex-shrink: 0; padding: 16px 18px; border-top: 1px solid var(--color-border); }
.pos-page .cart-bottom { padding: 20px 22px; }
.order-summary { margin: 0; }
.order-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 13px; margin-bottom: 10px; }
.order-summary dt { color: var(--color-muted); font-weight: 500; }
.order-summary dd { margin: 0; font-weight: 600; text-align: right; color: var(--color-espresso); }
#discount-amount { color: var(--color-success); font-weight: 700; }
.order-summary .total-row { border-top: 1px dashed var(--color-border); padding-top: 14px; margin-top: 14px; margin-bottom: 18px; }
.total-row dt { color: var(--color-espresso); font-size: 16px; font-weight: 700; }
.total-row dd { font-size: 22px; font-weight: 750; color: var(--color-primary); letter-spacing: -.5px; }
.pos-page .total-row dd { font-size: 26px; }
.payment-field legend { float: none; width: auto; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--color-espresso); }
.payment-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-option { position: relative; cursor: pointer; }
.payment-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.payment-option > span { border: 1px solid var(--color-border); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; font-size: 12px; font-weight: 600; color: var(--color-muted); transition: background-color .15s, color .15s, border-color .15s; white-space: nowrap; }
.pos-page .payment-option > span { min-height: 78px; justify-content: center; font-size: 13px; }
.payment-option input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.payment-option input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.payment-option:hover span { border-color: var(--color-primary); color: var(--color-espresso); }
.payment-option.disabled { cursor: not-allowed; }
.payment-option.disabled > span { opacity: .55; }
.payment-option.disabled:hover span { border-color: var(--color-border); color: var(--color-muted); }
.not-integrated { display: block; font-size: 11px; color: var(--color-muted); font-weight: 500; }
.segmented button:disabled { opacity: .5; }
.segmented button:disabled:hover { background: transparent; }
.checkout-button { width: 100%; min-height: 48px; margin-top: 16px; font-size: 14px; font-weight: 700; background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: background-color .15s ease, border-color .15s ease; }
.pos-page .checkout-button { min-height: 56px; font-size: 16px; }
.checkout-button .icon { margin-left: auto; width: 16px; }
.checkout-button:hover:not(:disabled) { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.checkout-button:disabled { background: #D9CEC9; border-color: #D9CEC9; color: #786B65; box-shadow: none; cursor: not-allowed; }
.preview-note { color: var(--color-muted); font-size: 12px; text-align: center; margin: 8px 0 0; }
.empty-state, .error-state { padding: 48px 20px; text-align: center; color: var(--color-muted); }
.empty-state > .icon, .error-state > .icon { width: 44px; height: 44px; margin-bottom: 16px; color: var(--color-primary); opacity: 0.85; }
.empty-state h3, .error-state h3 { color: var(--color-espresso); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state p, .error-state p { font-size: 13px; line-height: 1.5; color: var(--color-muted); margin-bottom: 16px; }
.modal-content { border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.file-picker { display: flex; align-items: center; gap: 12px; border: 1px solid var(--color-border); padding: 8px; border-radius: var(--radius-md); margin-bottom: 8px; }
.file-picker input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.file-picker span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; color: var(--color-muted); }
.modal-header, .modal-footer { padding: 18px 24px; border-color: var(--color-border-light); background: var(--color-surface); }
.modal-header .modal-title { font-size: 18px; font-weight: 700; color: var(--color-espresso); }
.modal-body { padding: 24px; color: var(--color-text); }
.form-preview-note { padding: 12px 14px; background: var(--color-primary-soft); color: var(--color-espresso); font-size: 13px; border-radius: var(--radius-md); border-left: 3px solid var(--color-primary); line-height: 1.6; }
.form-label { font-size: 12px; font-weight: 600; color: var(--color-espresso); margin-bottom: 6px; }
.calculator-result { display: block; margin-top: 18px; color: var(--color-secondary); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.receipt-content { font-size: 13px; }
.receipt-brand { font-size: 26px; font-weight: 750; text-align: center; color: var(--color-espresso); }
.receipt-brand span { color: var(--color-primary); }
.receipt-watermark { color: var(--color-primary); text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; margin: 10px 0 16px; }
.receipt-line { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px dashed var(--color-border); padding: 10px 0; }
#receipt-summary { margin-top: 20px; }
#receipt-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.receipt-disclaimer { font-size: 12px; color: var(--color-muted); text-align: center; }
.pos-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--color-espresso); color: white; border-radius: var(--radius-md); max-width: calc(100vw - 32px); padding: 0; box-shadow: var(--shadow-lg); z-index: 1090; font-size: 13px; font-weight: 500; pointer-events: none; }
.pos-toast:not(:empty) { padding: 12px 20px; }
.product-card:disabled { opacity: .55; cursor: not-allowed; }
#tax-percent { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: white; color: var(--color-text); font-size: 12px; padding: 2px 6px; }
#tax-percent:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
#receipt-modal .receipt-content { width: 80mm; max-width: 100%; margin: 0 auto; }
.receipt-line span { min-width: 0; overflow-wrap: anywhere; }
.receipt-line strong { flex-shrink: 0; }
#receipt-meta { overflow-wrap: anywhere; font-size: 12px; color: var(--color-muted); }
.mobile-cart-link { display: none; }
.error-panel { margin: 40px auto; padding: 32px; width: min(600px, 100%); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.error-panel h1 { font-size: 24px; font-weight: 700; color: var(--color-espresso); margin-bottom: 16px; }
.alert { border-radius: var(--radius-md); padding: 14px 18px; font-size: 13px; line-height: 1.5; border-width: 1px; border-style: solid; margin-bottom: 16px; }
.alert-success { background-color: var(--color-success-soft); border-color: rgba(47, 118, 87, 0.25); color: var(--color-success); }
.alert-warning { background-color: var(--color-warning-soft); border-color: rgba(161, 92, 22, 0.25); color: var(--color-warning); }
.alert-danger { background-color: var(--color-danger-soft); border-color: rgba(180, 35, 50, 0.25); color: var(--color-danger); }
.alert-info { background-color: var(--color-secondary-soft); border-color: rgba(41, 74, 109, 0.25); color: var(--color-secondary); }
.skeleton { background: linear-gradient(90deg, #EDE9E4 25%, #F7F4F1 50%, #EDE9E4 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 8px; display: flex; flex-direction: column; }
.skeleton-image { aspect-ratio: 1; width: 100%; border-radius: var(--radius-md); }
.skeleton-info { padding: 10px 2px 4px; }
.skeleton-text { border-radius: var(--radius-sm); }
.management-page { background: var(--color-background); min-height: 100dvh; }
.management-page .app-main { display: block; padding: 0 20px 40px; }
.management-page .sidebar-nav > .sidebar-primary-link { min-height: 42px; padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.management-page .sidebar-nav > .sidebar-primary-link .icon { width: 18px; height: 18px; }
.management-shell { max-width: 1440px; margin: 0 auto; padding: 24px 0 40px; }
.management-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.management-heading h1 { font-size: clamp(24px, 2.2vw, 32px); font-weight: 750; color: var(--color-espresso); letter-spacing: -.6px; margin: 0; }
.management-heading p:last-child { margin: 6px 0 0; color: var(--color-muted); font-size: 14px; }
.management-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.management-stats > div { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 8px; box-shadow: var(--shadow-xs); }
.management-stats span { color: var(--color-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.management-stats strong { font-size: 26px; color: var(--color-espresso); font-weight: 750; }
.management-filters { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px; display: grid; grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 20px; box-shadow: var(--shadow-xs); }
.management-filters label { display: block; font-weight: 600; font-size: 12px; color: var(--color-espresso); margin-bottom: 6px; }
.management-table-wrap, .management-card, .management-form, .product-detail { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.management-card { padding: 24px; margin-bottom: 24px; }
.management-preview-img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: var(--color-surface-subtle); }
.tab-pane.fade { transition: opacity 150ms linear; }
.management-table-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--color-border-light); }
.management-table-top h2 { font-size: 17px; font-weight: 700; color: var(--color-espresso); }
.management-table-top span { color: var(--color-muted); font-size: 13px; }
.management-table { margin: 0; }
.management-table th { color: var(--color-espresso); font-size: 12px; font-weight: 700; background: var(--color-surface-subtle); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.management-table td { padding: 12px 16px; border-color: var(--color-border-light); font-size: 14px; vertical-align: middle; }
.management-table td strong { display: block; max-width: 260px; line-height: 1.35; color: var(--color-espresso); }
.management-table code { color: var(--color-muted); font-size: 12px; background: var(--color-surface-subtle); padding: 2px 6px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-light); overflow-wrap: anywhere; }
.management-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-md); background: var(--color-surface-subtle); border: 1px solid var(--color-border-light); }
.price-cell { color: var(--color-primary); font-weight: 700; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; border-radius: var(--radius-pill); padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.3; }
.status-pill.available { background: var(--color-success-soft); color: var(--color-success); border: 1px solid rgba(47, 118, 87, 0.2); }
.status-pill.stopped { background: var(--color-surface-subtle); color: var(--color-muted); border: 1px solid var(--color-border); }
.row-actions { display: flex; gap: 12px; white-space: nowrap; }
.row-actions a { color: var(--color-primary); font-weight: 600; font-size: 13px; text-decoration: none; }
.row-actions a:hover { color: var(--color-primary-hover); text-decoration: underline; }
.row-actions a.delete-action { color: var(--color-danger); }
.row-actions a.delete-action:hover { color: #961B28; }
.management-empty { text-align: center; padding: 56px 20px; }
.management-empty h3 { font-size: 18px; font-weight: 700; color: var(--color-espresso); margin-bottom: 8px; }
.management-empty p { color: var(--color-muted); font-size: 14px; margin-bottom: 16px; }
.management-pages { display: flex; justify-content: center; gap: 8px; padding: 20px; }
.management-pages a { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--radius-md); text-decoration: none; border: 1px solid var(--color-border); color: var(--color-espresso); font-size: 13px; font-weight: 600; background: var(--color-surface); transition: background-color 0.15s ease, border-color 0.15s ease; }
.management-pages a:hover { background: var(--color-surface-subtle); border-color: var(--color-primary); color: var(--color-primary); }
.management-pages a.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.form-shell { max-width: 830px; }
.management-form { padding: 24px; }
.management-dialog { border-radius: var(--radius-xl); border: 1px solid var(--color-border); }
.management-dialog .modal-title { font-size: 20px; font-weight: 750; color: var(--color-espresso); }
.management-dialog .management-form { padding: 0; border: 0; box-shadow: none; }
.management-dialog .modal-body { max-height: min(68vh, 680px); overflow-y: auto; padding: 20px 24px; }
.management-dialog .modal-footer { border-top: 1px solid var(--color-border-light); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .form-label { font-weight: 600; font-size: 12px; color: var(--color-espresso); }
.form-grid .form-label span { color: var(--color-danger); }
.field-error { display: block; color: var(--color-danger); font-size: 12px; margin-top: 4px; }
.image-preview { margin-top: 16px; }
.image-preview img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-md); background: var(--color-surface-subtle); border: 1px solid var(--color-border); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.product-detail { padding: 24px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.5fr); gap: 30px; }
.product-detail > img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-lg); background: var(--color-surface-subtle); border: 1px solid var(--color-border); }
.product-detail dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-content: start; gap: 15px; margin: 0; }
.product-detail dt { color: var(--color-muted); font-weight: 600; font-size: 13px; }
.product-detail dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--color-espresso); }
/* KPI cards & Nav Pills */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; justify-content: space-between; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-muted); margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 750; color: var(--color-espresso); line-height: 1.2; margin-bottom: 6px; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--color-muted); }
.kpi-meta { font-size: 12px; color: var(--color-muted); line-height: 1.4; }
.nav-pills .nav-link { color: var(--color-muted); border-radius: var(--radius-md); font-weight: 600; font-size: 13px; padding: 9px 16px; border: 1px solid var(--color-border); background: var(--color-surface); transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.nav-pills .nav-link:hover { color: var(--color-espresso); background: var(--color-surface-subtle); border-color: var(--color-border); }
.nav-pills .nav-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); font-weight: 700; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nav-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; } .nav-pills .nav-item { flex-shrink: 0; } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .management-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .management-filters .btn { justify-self: start; } .account-link strong { max-width: 100px; } }
@media (max-width: 600px) { .management-page .app-main { padding: 0 14px 30px; } .management-shell { padding-top: 16px; } .management-heading { align-items: flex-start; flex-direction: column; } .management-stats { gap: 10px; } .management-stats > div { padding: 14px; display: block; } .management-stats span { display: block; font-size: 12px; min-height: 24px; } .management-stats strong { font-size: 22px; } .management-filters { grid-template-columns: 1fr; } .management-filters .btn { width: 100%; } .management-table thead { display: none; } .management-table tbody { display: grid; gap: 12px; padding: 12px; } .management-table tr { display: grid; grid-template-columns: 70px 1fr; gap: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 12px; background: var(--color-surface); } .management-table td { border: 0; padding: 0; text-align: left !important; } .management-table td:first-child { grid-row: span 3; } .management-table td:nth-child(4), .management-table td:nth-child(5), .management-table td:nth-child(6), .management-table td:nth-child(7) { grid-column: 1 / -1; } .management-table td:nth-child(4)::before, .management-table td:nth-child(5)::before, .management-table td:nth-child(6)::before { content: attr(data-label) ': '; color: var(--color-muted); font-size: 12px; } .management-table td:nth-child(7) { border-top: 1px solid var(--color-border-light); padding-top: 10px; } .form-grid, .product-detail { grid-template-columns: 1fr; } .form-grid .full { grid-column: auto; } .product-detail dl { grid-template-columns: 110px 1fr; } .account-link { display: none; } }
@media (min-width: 768px) {
    .pos-page .pos-workspace {
        grid-template-columns: minmax(0, 1.45fr) minmax(360px, 420px);
        height: 100%;
        min-height: 0;
    }
    .pos-page .cart-panel {
        margin: -80px -20px -20px 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 920;
        border-top: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 1px solid var(--color-border);
        border-radius: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .pos-page .cart-heading {
        min-height: 64px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        border-bottom: 1px solid var(--color-border);
        background: #fff;
    }
    .pos-page .cart-scroll {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        padding: 8px 12px;
        scrollbar-width: thin;
    }
    .pos-page .cart-bottom {
        flex-shrink: 0;
        margin-top: auto;
        padding: 8px 14px 12px;
        border-top: 1px solid var(--color-border);
        background: var(--color-surface);
    }
}
@media (max-width: 1440px) { .app-header { gap: 12px; padding: 12px 18px; } .header-search { max-width: 360px; } .pos-workspace { grid-template-columns: minmax(0, 1fr) minmax(360px, 400px); gap: 12px; } .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .order-controls { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 10px; } .note-field { grid-column: auto; } .menu-tip { display: none; } .cart-bottom { padding: 14px; } }
@media (max-width: 1180px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .app-sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(288px, calc(100vw - 48px)); box-shadow: var(--shadow-lg); transition: transform .2s ease; }
    .sidebar-close.icon-button, .sidebar-toggle.icon-button { display: inline-flex; }
    .sidebar-open { overflow: hidden; }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-open .app-sidebar-backdrop { position: fixed; inset: 0; z-index: 930; display: block; border: 0; background: rgba(37, 48, 65, .38); }
}
@media (max-width: 1050px) { .pos-workspace { grid-template-columns: minmax(0, 1fr) 340px; } .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .menu-footnote span { display: none; } }
@media (max-width: 767.98px) { .pos-page { height: auto; min-height: 100dvh; overflow: visible; } .pos-page .app-shell, .pos-page .app-frame { height: auto; min-height: 100dvh; } .app-header { position: sticky; top: 0; flex-wrap: wrap; min-height: 62px; padding: 10px 12px; gap: 8px; } .header-context, .pos-page .header-context { min-width: 0; flex: 1; display: flex; } .header-context span { display: none; } .header-context strong { font-size: 14px; } .account-link { display: none; } .header-toolbar { flex: 0 0 100%; flex-wrap: wrap; gap: 8px; } .header-search { flex: 0 0 100%; max-width: none; order: 1; } .header-actions { width: 100%; order: 2; justify-content: flex-start; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .header-actions::-webkit-scrollbar { display: none; } .header-actions > * { flex: 0 0 auto; } .utility-actions { border: 0; padding: 0; } .app-main { padding: 12px 12px 90px; } .demo-badge { font-size: 12px; } .pos-workspace { display: flex; flex-direction: column; gap: 16px; } .order-controls { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); padding: 14px; } .order-type-field, .note-field, .discount-field { grid-column: 1 / -1; } .segmented button { padding: 10px 6px; font-size: 12px; } .product-scroll { overflow: visible; padding: 2px; } .product-grid { gap: 12px; } .product-name { font-size: 13px; min-height: 38px; } .product-prices strong { font-size: 14px; } .product-info { padding: 10px 2px 4px; } .product-prices del { font-size: 12px; } .cart-panel { scroll-margin-top: 12px; } .cart-scroll { max-height: 380px; min-height: 140px; } .cart-heading { padding: 16px; } .cart-bottom { padding: 16px; } .mobile-cart-link { display: flex; position: fixed; z-index: 1020; bottom: 12px; left: 12px; right: 12px; background: var(--color-espresso); color: white; text-decoration: none; padding: 14px 18px; border-radius: var(--radius-lg); align-items: center; gap: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; } .sidebar-open .mobile-cart-link { display: none; } .mobile-cart-link strong { margin-left: auto; color: #fff; } .pos-toast { bottom: 80px; } }
@media (min-width: 768px) and (max-height: 850px) {
    .cart-heading { padding: 14px; flex-shrink: 0; }
    .cart-bottom { padding: 12px 14px; }
    .order-summary > div { margin-bottom: 8px; }
    .order-summary .total-row { padding-top: 12px; margin: 12px 0 14px; }
    .payment-option > span { padding: 9px 2px; gap: 6px; }
    .checkout-button { margin-top: 12px; min-height: 44px; }
    .preview-note { margin-top: 6px; }
}
@media (min-width: 768px) and (max-height: 650px) {
    .pos-page { height: auto; overflow: auto; }
    .pos-workspace { min-height: 650px; }
    .product-scroll { max-height: 500px; }
    .cart-scroll { max-height: 300px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { body { height: auto !important; overflow: visible !important; background: white; } .app-shell, .app-frame { display: block; min-height: 0; } .app-sidebar, .app-sidebar-backdrop, .app-header, .app-main > :not(#receipt-modal), .modal-backdrop { display: none !important; } #receipt-modal { display: block !important; position: static; opacity: 1 !important; overflow: visible; } #receipt-modal .modal-dialog { transform: none; width: 80mm; max-width: 100%; margin: 0 auto; height: auto; } #receipt-modal .modal-content, #receipt-modal .modal-body { max-height: none; overflow: visible; } #receipt-modal .modal-header, #receipt-modal .modal-footer { display: none; } .app-main { padding: 0; display: block; } .receipt-watermark { color: black; } }
@media print {
    @page { size: 80mm 297mm; margin: 3mm; }
    #receipt-modal { padding: 0 !important; }
    #receipt-modal .modal-dialog { width: 74mm; }
    #receipt-modal .modal-content { border-radius: 0; }
    #receipt-modal .receipt-content { padding: 3mm; color: black; }
    .receipt-line, #receipt-summary > div { break-inside: avoid; }
    #receipt-summary .total-row dd { font-size: 18px; }
}
@media (max-width: 767.98px) { .management-table td { background: transparent !important; box-shadow: none !important; } }


/* =========================================
   POS LAYOUT - REFINED VERSION
   ========================================= */

/* 1. Phân chia không gian sản phẩm và giỏ hàng */
.pos-page .pos-workspace {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr);
    gap: 14px;
    min-height: 0;
}

/* Khu vực sản phẩm */
.pos-page .menu-panel {
    min-width: 0;
    min-height: 0;
}

.pos-page .product-scroll {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 2px 5px 8px 2px;
}

.pos-page .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

/* 2. Giỏ hàng */
.pos-page .cart-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pos-page .cart-heading {
    flex-shrink: 0;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--color-border);
}

.pos-page .cart-heading h2 {
    font-size: 15px;
    margin: 0;
}

.pos-page .order-meta strong {
    font-size: 12px;
}

.pos-page .order-meta time {
    font-size: 11px;
    margin-top: 2px;
}

.pos-page .cart-scroll {
    flex: 1 1 0;
    min-height: 120px;
    max-height: none;
    overflow-y: auto;
    padding: 8px 12px;
    scrollbar-width: thin;
}

.vip-member-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 750;
    background: #FFF8E1;
    color: #8D4004;
    border: 1px solid #FFE082;
    width: 100%;
    min-height: 34px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Ẩn khối loại đơn hàng trong Kiosk (vì đã chọn ở ngoài màn hình chính) */
.pos-page.kiosk-pos-mode .order-type-field,
.kiosk-pos-mode .order-type-field {
    display: none !important;
}

.pos-page .cart-bottom .note-field.full-width {
    grid-column: 1 / -1 !important;
    width: 100%;
}

/* Thu gọn từng món trong giỏ */
.pos-page .cart-item {
    padding: 6px 8px;
    gap: 8px;
    margin-bottom: 6px;
}

.pos-page .cart-thumbnail {
    width: 36px;
    height: 36px;
}

.pos-page .cart-item h3 {
    font-size: 12px;
    margin: 0 0 2px;
}

.pos-page .cart-unit-price {
    font-size: 11px;
}

.pos-page .quantity-control {
    gap: 6px;
    margin-top: 4px;
}

.pos-page .quantity-control button {
    height: 22px;
    width: 22px;
    font-size: 14px;
}

.pos-page .line-total {
    font-size: 12px;
}

/* 3. Khu vực thông tin đơn hàng */
.pos-page .cart-bottom {
    flex-shrink: 0;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

/* Sắp xếp lại khu vực thông tin đơn hàng cực gọn */
.pos-page .cart-bottom .order-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.92fr);
    gap: 8px;
    padding: 0 0 6px;
    margin: 0 0 6px;
    border-bottom: 1px solid var(--color-border);
}

.pos-page .cart-bottom .order-type-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.pos-page .cart-bottom .discount-field {
    grid-column: 1;
    min-width: 0;
}

.pos-page .cart-bottom .note-field {
    grid-column: 2;
    min-width: 0;
}

/* Ba nút loại đơn hàng */
.pos-page .cart-bottom .segmented {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 4px;
    min-height: 32px;
}

.pos-page .cart-bottom .segmented button {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 6px;
    gap: 4px;
    justify-content: center;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
}

.pos-page .cart-bottom .segmented button .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Thu gọn nhãn và ô nhập */
.pos-page .cart-bottom .field-label {
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
}

.pos-page .cart-bottom .discount-field .form-select,
.pos-page .cart-bottom .note-field .form-control {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
}

/* 4. Bảng tổng tiền */
.pos-page .order-summary > div {
    margin-bottom: 3px;
    font-size: 11.5px;
}

.pos-page .order-summary .total-row {
    padding-top: 6px;
    margin-top: 6px;
    margin-bottom: 6px;
    border-top: 1px dashed var(--color-border);
}

.pos-page .total-row dt {
    font-size: 14px;
    font-weight: 700;
}

.pos-page .total-row dd {
    font-size: 20px;
    font-weight: 850;
    color: var(--color-primary);
}

/* 5. Phương thức thanh toán gọn nằm ngang */
.pos-page .payment-field legend {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
}

.pos-page .payment-options {
    gap: 6px;
}

.pos-page .payment-option > span {
    min-height: 36px;
    padding: 4px 8px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.pos-page .payment-option > span .icon {
    width: 14px;
    height: 14px;
}

.pos-page .not-integrated {
    display: none;
}

/* 6. Nút ghi nhận đơn luôn nổi bật */
.pos-page .checkout-button {
    min-height: 42px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 25px;
}

.pos-page .preview-note {
    margin-top: 3px;
    font-size: 10.5px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* Màn hình laptop vừa */
@media (max-width: 1440px) and (min-width: 768px) {
    .pos-page .pos-workspace {
        grid-template-columns: minmax(0, 1.3fr) minmax(320px, 380px);
        gap: 12px;
    }

    .pos-page .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Màn hình nhỏ hơn */
@media (max-width: 1050px) and (min-width: 768px) {
    .pos-page .pos-workspace {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .pos-page .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-page .cart-bottom .order-controls {
        grid-template-columns: 1fr;
    }

    .pos-page .cart-bottom .note-field {
        grid-column: auto;
    }
}

/* Điện thoại */
@media (max-width: 767.98px) {
    .pos-page .pos-workspace {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .pos-page .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .pos-page .cart-scroll {
        max-height: 380px;
        min-height: 140px;
    }

    .pos-page .cart-bottom .order-controls {
        grid-template-columns: 1fr;
    }

    .pos-page .cart-bottom .order-type-field,
    .pos-page .cart-bottom .discount-field,
    .pos-page .cart-bottom .note-field {
        grid-column: auto;
    }

    .pos-page .payment-option > span {
        min-height: 65px;
    }
}

/* Nút sửa / thêm món cho đơn vừa ghi nhận */
#edit-last-order {
    font-weight: 600;
    gap: 6px;
}
