/*! ພັດທະນາໂດຍ ບໍລິສັດຮ່ວມພັດທະນາ Atphosting24 ຈຳກັດ ແລະ ICOM */
:root {
    --ui-bg: #f3f8f6; --ui-surface: #fff; --ui-raised: #f5f9f7; --ui-hover: #eaf4ee;
    --ui-text: #123b37; --ui-muted: #637774; --ui-line: #dce8e2; --ui-accent: #006b5b;
    --ui-hero: #dff2e8; --ui-hero-end: #eff8f2; --ui-primary: #006b5b; --ui-on-primary: #fff;
    --ui-warning: #fff3dc; --ui-warning-text: #815d1a; --ui-error: #fff0ec; --ui-error-text: #a64a3f;
    color-scheme: light;
}
html[data-theme="dark"] {
    --ui-bg: #101c23; --ui-surface: #182830; --ui-raised: #20343d; --ui-hover: #29434b;
    --ui-text: #e6f2ed; --ui-muted: #a4bcb5; --ui-line: #344b53; --ui-accent: #8bd7b8;
    --ui-hero: #1c3f3a; --ui-hero-end: #183039; --ui-primary: #86d9b7; --ui-on-primary: #102c23;
    --ui-warning: #403426; --ui-warning-text: #f2d395; --ui-error: #472e32; --ui-error-text: #ffb5aa;
    color-scheme: dark;
}
html[data-theme="warm"] {
    --ui-bg: #f5eee2; --ui-surface: #fffbf3; --ui-raised: #f4eadb; --ui-hover: #eee2cd;
    --ui-text: #433b2f; --ui-muted: #786a57; --ui-line: #ded0bb; --ui-accent: #776044;
    --ui-hero: #eadcc5; --ui-hero-end: #f6ecdb; --ui-primary: #706044; --ui-on-primary: #fffaf0;
    --ui-warning: #f7e9c9; --ui-warning-text: #785a1f; --ui-error: #f7e3dd; --ui-error-text: #9c4437;
}
html[data-theme] {
    --bg: var(--ui-bg); --surface: var(--ui-surface); --text: var(--ui-text); --ink: var(--ui-text);
    --muted: var(--ui-muted); --line: var(--ui-line); --primary: var(--ui-accent); --primary-dark: var(--ui-accent);
    --mint: var(--ui-hover); --mint-soft: var(--ui-raised); --cream: var(--ui-bg); --green: var(--ui-accent);
    background: var(--ui-bg); color: var(--ui-text);
}
html[lang="zh"] { --font: 'Inter','PingFang SC','Microsoft YaHei','Noto Sans CJK SC',var(--font-lao),'Noto Sans Lao',sans-serif; font-family: var(--font); }
html[lang="vi"] { --font: 'Inter','Segoe UI',Arial,var(--font-lao),'Noto Sans Lao',sans-serif; font-family: var(--font); }
html[lang="th"] { --font: 'Inter','Noto Sans Thai','Leelawadee UI',Tahoma,var(--font-lao),sans-serif; font-family: var(--font); }
html[lang="ru"] { --font: 'Inter','Segoe UI',Arial,var(--font-lao,'Noto Sans Lao'),'Noto Sans Lao',sans-serif; font-family: var(--font); }
html[lang="zh"] body, html[lang="vi"] body, html[lang="th"] body, html[lang="ru"] body { font-family: var(--font); }
@media (min-width: 721px) {
    html[lang="ru"] icom-staff-app .hero-copy { max-width: 48%; }
    html[lang="ru"] icom-staff-app .hero-copy h2 { font-size: clamp(28px, 2.6vw, 40px); }
}
.display-preferences { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; vertical-align: middle; }
.preference-control {
    position: relative; display: inline-flex; justify-content: center; align-items: center; gap: 6px;
    min-height: 44px; min-width: 44px; padding: 0 10px; margin: 0;
    color: var(--ui-text); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 14px;
    box-shadow: 0 2px 5px #123b3705; cursor: pointer;
}
.preference-control:hover { background: var(--ui-hover); border-color: var(--ui-accent); }
.preference-control:focus-within { outline: 3px solid #8dbfaa; outline-offset: 3px; }
.preference-control svg { width: 18px; height: 18px; flex-shrink: 0; }
.preference-control [data-preference-code] { min-width: 20px; font-size: 12px; font-weight: 650; line-height: 1; }
.preference-control [data-preference-icon] { display: flex; }
.preference-control select {
    position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; padding: 0;
    cursor: pointer; font-size: 16px; color: var(--ui-text); background: var(--ui-surface);
}
.preference-control select option { color: var(--ui-text); background: var(--ui-surface); }
.login-locale .display-preferences, .login-locale[data-display-preferences] { margin-left: auto; }
.login-locale .preference-control span { color: inherit; }
html[data-theme] body { background: var(--ui-bg); color: var(--ui-text); }
html[data-theme] :is(.sidebar,.workspace>.topbar,icom-guest-app>.topbar,.panel,.metrics,.stat-card,.cart-panel,.order-card,.kitchen-ticket,.product-card,.queue-row,.calendar-day,.dish,.basket,.tracking,.modal,.login-form-side,.login-page,.report-counts,.pwa-install-panel) { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-line); }
html[data-theme] :is(.hero,.login-story,.platform-hero,.platform-login .login-story) { background: linear-gradient(120deg,var(--ui-hero),var(--ui-hero-end)); border-color: var(--ui-line); }
html[data-theme] :is(.hero-copy p,.hero p,.login-story p,.platform-hero p,.platform-eyebrow,.platform-login-feature small,.platform-login-feature strong,.eyebrow,.hero-chips,.login-intro,.login-copyright,.login-security,.platform-help,.platform-event p,.platform-event small,.section-top p,.dish p,.footer,.footer a,.receipt-summary-title,.report-subtitle,.currency-help) { color: var(--ui-muted); }
html[data-theme] :is(.brand,.nav-link,.platform-login-feature,.page-title,.panel-head h2,.dish h3,.basket h2,.tracking h1,.metric strong,.metric label,.product-name,.platform-detail-hero h2,.login-form h2) { color: var(--ui-text); }
html[data-theme] :is(.nav-link:hover,.queue-row:hover,tbody tr:hover,.icon-btn:hover,.category:hover,.category-tab:hover) { background: var(--ui-hover); }
html[data-theme] :is(.nav-link.active,.mobile-app-nav>.active,.avatar,.menu-toggle,.platform-count,.track-status,.table-note,.table-banner,.table-banner.menu-only,.track-icon,.draft-banner,.notice,.alert,.platform-password-hint,.platform-detail-hero,.guest-saved-quote,.guest-review-saved) { background: var(--ui-hover); color: var(--ui-accent); border-color: var(--ui-line); }
html[data-theme] :is(.nav-link.active svg,.nav-link svg,.icon-btn,.text-link,.platform-name-button,.btn-ghost,.remove-item,.password-toggle,.login-locale button,.platform-hero-symbol,.track-icon) { color: var(--ui-accent); }
html[data-theme] :is(.field input,.field select,.field textarea,.form-field input,.form-field select,.form-field textarea,input.input,select.input,textarea.input,.search-input,.search-field input,.settings-form textarea,.branch-selector select,icom-guest-app input,icom-guest-app textarea,icom-guest-app select) { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-line); }
html[data-theme] :is(input,textarea)::placeholder { color: var(--ui-muted); opacity: .85; }
html[data-theme] :is(.search,.category,.category-tab,.category-chip,.btn-secondary,.secondary,.language,.pos-layout .tab,.quantity button,.quantity-control button,.table-badge,.modal-close,.close-modal,.report-presets .btn,.pwa-reopen,.pwa-later) { color: var(--ui-accent); background: var(--ui-raised); border-color: var(--ui-line); }
html[data-theme] .search input { background: transparent; }
html[data-theme] :is(.btn-primary,.category.active,.category-tab.active,.category-chip.active,.pos-layout .tab.active,.submit,.pwa-action,.report-tab.active,.mobile-cart-shortcut,.guest-mobile-nav>.guest-cart-link,.bag-count) { background: var(--ui-primary); color: var(--ui-on-primary); border-color: transparent; }
html[data-theme] :is(.btn-primary:hover,.submit:hover,.pwa-action:hover) { filter: brightness(.94); }
html[data-theme] :is(.add,.product-plus) { background: var(--ui-hover); color: var(--ui-accent); }
html[data-theme] :is(.mobile-app-nav,.developer-credit,.pwa-install-entry) { background: var(--ui-surface); border-color: var(--ui-line); color: var(--ui-muted); }
html[data-theme] .mobile-app-nav>:is(a,button) { color: var(--ui-muted); }
html[data-theme] .mobile-app-nav>.active { color: var(--ui-accent); }
html[data-theme] .guest-mobile-nav>.guest-cart-link { color: var(--ui-on-primary); }
html[data-theme] :is(.pwa-install-heading p,.pwa-guide-note,.pwa-install-status,.pwa-close) { color: var(--ui-muted); }
html[data-theme] .pwa-install-guide { border-color: var(--ui-line); }
html[data-theme] :is(th,.report-ledger-table th,.calendar-day>header,.kitchen-column,.customer-metrics>div,.reservation-event,.reservation-event.inactive,.report-tab,.report-tab span,.track-link,.platform-branch-row,.currency-row,.lao-font-preview,.table-qr-preview,.kitchen-cancellation-current,.kitchen-cancellation-form input[readonly],.kitchen-cancellation-form textarea[readonly]) { background: var(--ui-raised); color: var(--ui-text); border-color: var(--ui-line); }
html[data-theme] :is(.platform-hero-symbol,.product-placeholder,.product-image,.product-image.tint-1,.product-image.tint-2,.product-image.tint-3,icom-guest-app .dish-image) { background: var(--ui-raised); color: var(--ui-accent); }
html[data-theme] .product-image .dish-photo, html[data-theme] icom-guest-app .dish-photo { background-color: transparent; }
html[data-theme] :is(.status-no_show,.status-pending,.status-queued,.status-open,.status-confirmed,.platform-status-expiring,.subscription-notice,.ticket-note,.report-limit-note,.draft-banner.offline,.guest-saved-quote.changed,.kitchen-cancellation-stock.keeps-stock,.kitchen-cancellation-retry,.kitchen-cancellation-stock-label.keeps-stock) { background: var(--ui-warning); color: var(--ui-warning-text); border-color: var(--ui-line); }
html[data-theme] :is(.btn-danger,.error-message,.alert-error,.form-error,.error,.report-load-error,.settings-form .form-error,.status-cancelled,.status-unpaid,.status-out_of_stock,.status-inactive,.platform-status-expired,.platform-status-suspended,.kitchen-cancellation-mark,.kitchen-cancellation-event,.kitchen-cancel-line.btn) { background: var(--ui-error); color: var(--ui-error-text); border-color: var(--ui-line); }
html[data-theme="dark"] :is(.badge:not([class*="status-"]),.status-ready,.status-paid,.status-completed,.status-available,.status-active,.kitchen-cancellation-stock.returns-stock,.kitchen-cancellation-stock-label.returns-stock) { background: #23463d; color: #a9e2c7; }
html[data-theme="dark"] :is(.status-preparing,.status-in_progress,.status-served) { background: #263d53; color: #b6d6f6; }
html[data-theme="dark"] .table-tile { background: #21463c; color: #b2e5ce; border-color: #396454; }
html[data-theme="dark"] .table-tile.occupied { background: #49372f; color: #edbb9f; border-color: #715446; }
html[data-theme="dark"] .table-tile.reserved { background: #403b26; color: #e8d399; border-color: #655c3b; }
html[data-theme="dark"] .table-tile.unavailable { background: #29383e; color: #afbcc0; border-color: #44545b; }
html[data-theme="dark"] :is(.modal-backdrop,.modal-overlay,.mobile-overlay) { background: #050d16ac; }
html[data-theme="dark"] .platform-login-feature svg { background: #203c36; }
html[data-theme="dark"] :is(.angular-toast,#toast,#platform-toast,icom-guest-app .toast) { background: #d8f2e5; color: #12372b; }
html[data-theme="dark"] :is(.angular-toast.error,#toast.error,#platform-toast.error) { background: #ffd7cf; color: #722f2b; }
html[data-theme="dark"] .dish-visual { background: #ffffff0c; color: #9ac4b2; }
html[data-theme="dark"] icom-guest-app :is(.hero-art,.dish-photo) { mix-blend-mode: normal; }
html[data-theme="dark"] .reports-view .report-bars { background-image: repeating-linear-gradient(to top,transparent 0,transparent 48px,#344b53 49px,transparent 50px); }
html[data-theme="dark"] :is(.panel,.modal,.dish,.cart-panel,.order-card,.preference-control) { box-shadow: 0 8px 24px #0000000e; }
html[data-theme="warm"] :is(.hero,.login-story,.platform-hero) { box-shadow: inset 0 1px 0 #ffffff80; }
@media(max-width:480px) {
    .display-preferences { gap: 6px; }
    .preference-control { border-radius: 12px; padding: 0 8px; }
    .preference-control svg { width: 17px; height: 17px; }
    icom-guest-app .topbar .top-actions { gap: 9px; }
    icom-guest-app .topbar { gap: 10px; }
    icom-guest-app .hero { display: block; padding-bottom: 145px; }
    icom-guest-app .hero-art { width: 190px; height: 175px; bottom: -25px; right: -10px; }
    .login-locale { right: 20px; }
}
@media(max-width:360px) {
    .preference-language>svg { display: none; }
    .preference-language { min-width: 48px; }
    .branch-selector select { min-width: 105px; }
    icom-guest-app .topbar .brand { gap: 6px; }
    icom-guest-app .topbar .brand strong { font-size: 18px; }
    icom-guest-app .topbar .brand small { font-size: 8px; }
    icom-guest-app .topbar .bag-link { gap: 3px; }
    icom-guest-app .topbar .bag-link>svg { display: none; }
}
@media print {
    .display-preferences { display: none !important; }
    html[data-theme] { --ui-bg:#fff;--ui-surface:#fff;--ui-raised:#f4f4f4;--ui-hover:#eee;--ui-text:#111;--ui-muted:#444;--ui-line:#ddd;--ui-accent:#111;--ui-hero:#fff;--ui-hero-end:#fff;--ui-primary:#111;--ui-on-primary:#fff;color-scheme:light; }
}
/* Keep secondary text and dense workflows readable in each palette. */
html[data-theme] :is(td,.field>span,.field label,.form-field label,.legend,.table-legend,.lao-font-detail,.basket-empty strong,.cart-line-controls,.totals,.table-banner p,.event-time,.kitchen-cancellation-reason) { color: var(--ui-text); }
html[data-theme] :is(td,th,.report-ledger-scroll) { border-color: var(--ui-line); }
html[data-theme] :is(.metric-label,.metric>span:first-child,.section-heading time,.section-heading .date,.report-metric>small,.report-bar-label,.audit-details dt,.payment-method-totals small,.lao-font-caption) { color: var(--ui-muted); }
html[data-theme] :is(.report-section-heading>.icon,.report-payment-row .icon,.search-field svg) { color: var(--ui-accent); }
html[data-theme] .media-picker { background: var(--ui-raised); border-color: var(--ui-line); }
html[data-theme] .media-preview:not(:has(img:not([hidden]))) { background: var(--ui-surface); border-color: var(--ui-line); }
html[data-theme] .media-preview>span { color: var(--ui-muted); }
html[data-theme] :is(.media-error,.media-remove,.kitchen-cancellation-history>h3,.kitchen-cancellation-amount) { color: var(--ui-error-text); }
html[data-theme] :is(.receipt,.receipt td) { color: #111; }
html[data-theme] .report-tab.active { background: var(--ui-primary); color: var(--ui-on-primary); }
html[data-theme] .report-tab.active span { background: #ffffff24; color: inherit; }

html[data-theme] .report-metric-primary { background: var(--ui-hover); color: var(--ui-text); }
