/* Shared theme layer, loaded after page-specific styles. */
:root{
  --admin-surface:color-mix(in srgb,var(--theme-background) 96%,var(--theme-font) 4%);
  --admin-soft:color-mix(in srgb,var(--theme-background) 90%,var(--theme-primary) 10%);
  --admin-border:color-mix(in srgb,var(--theme-font) 18%,var(--theme-background));
  --admin-muted:color-mix(in srgb,var(--theme-font) 72%,var(--theme-background));
}
html body,.admin-layout,.admin-layout .workspace,.admin-layout .content{background:var(--theme-background)!important;color:var(--theme-font)!important}
.admin-layout .top-header,
.admin-layout :is(.section-card,.stat-card,.dashboard-fold,.checkout-payment,.checkout-product-card,.checkout-dining-toolbar),
body :is(.detail-dialog,.lookup-picker-dialog){background:var(--admin-surface)!important;color:var(--theme-font)!important;border-color:var(--admin-border)!important}
.admin-layout :is(h1,h2,h3,h4,label,td,td strong,.stat-card strong,.card-heading h3,.dashboard-fold>summary){color:var(--theme-font)!important}
.admin-layout :is(.section-intro p,.top-kicker,.cell-note,.stat-card>span,.stat-card small,.notice,.chart-note,.table-pagination,.user-chip small){color:var(--admin-muted)!important}
.admin-layout :is(th,.dashboard-business-tabs,.checkout-quick-payment button,.count-pill){background:var(--admin-soft)!important;color:var(--theme-font)!important;border-color:var(--admin-border)!important}
.admin-layout :is(td,th,.table-pagination,.top-header){border-color:var(--admin-border)!important}
.admin-layout :is(input:not([type=color]):not([type=checkbox]):not([type=radio]),select,textarea,.search-field),
body :is(.detail-dialog,.lookup-picker-dialog) :is(input:not([type=color]):not([type=checkbox]):not([type=radio]),select,textarea){background:var(--theme-background)!important;color:var(--theme-font)!important;border-color:var(--admin-border)!important}
body :is(input,select,textarea){accent-color:var(--theme-button)}
.admin-layout :is(.primary-button,.filter-button,.page-buttons button.active,.dashboard-business-tabs button.active),
body :is(.detail-dialog,.lookup-picker-dialog) .primary-button,
#checkoutPanel .checkout-quick-payment button:first-child{background:var(--theme-button)!important;color:var(--theme-button-text)!important;border-color:var(--theme-button)!important}
.admin-layout :is(.secondary-button,.reset-button,.document-button){background:var(--admin-surface)!important;color:var(--theme-font)!important;border-color:var(--admin-border)!important}
.admin-layout :is(.primary-button,.filter-button):hover{color:var(--theme-button-hover-text)!important}
.admin-layout :is(.eyebrow,.text-button,.invoice-button){color:var(--theme-button)!important}
.admin-layout .user-avatar{background:var(--theme-accent)!important;color:var(--theme-accent-text)!important}
.admin-layout :is(button,input,select,textarea):focus-visible{outline-color:var(--theme-button)!important}
.admin-layout :is(h1,h2,h3,h4,button,input,select,textarea),body :is(.detail-dialog,.lookup-picker-dialog){font-family:var(--theme-font-family,system-ui,sans-serif)!important}
/* Font name, input, and action form one aligned field. */
#styleForm .style-add-font{display:grid;gap:10px;padding:18px;border:1px solid var(--admin-border);border-radius:16px;background:var(--admin-surface)}
#styleForm .style-add-font>label{display:block;font-size:13px;font-weight:700;line-height:1.5}
#styleForm .style-add-font-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:10px;min-width:0}
#styleForm .style-add-font-row input{min-width:0;width:100%;height:46px;min-height:46px;padding:10px 13px;font-size:14px;border-radius:10px}
#styleForm #styleAddFont{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:46px;min-height:46px;margin:0;padding:10px 16px;border:1px solid var(--theme-button);border-radius:10px;font-size:13px;font-weight:700;line-height:1.3;box-shadow:none;white-space:nowrap;cursor:pointer}
#styleForm #styleAddFont>span{font-size:19px;font-weight:400;line-height:1}
#styleForm .style-add-font>small{display:block;margin:0;color:var(--admin-muted);font-size:12px;line-height:1.6}
@media(max-width:560px){#styleForm .style-add-font{padding:14px}#styleForm .style-add-font-row{grid-template-columns:1fr}#styleForm #styleAddFont{width:100%}}
/* Keep the preview beside the entire color and layout control column. */
@media(min-width:1051px){
 html:has(#stylePanel:not([hidden])),body:has(#stylePanel:not([hidden])){overflow-x:clip}
 #stylePanel,#styleForm,#styleForm .style-workspace{overflow:visible}
 #styleForm .style-workspace{align-items:start;position:relative}
 #styleForm .style-live-preview{position:sticky;top:var(--style-preview-top,120px);align-self:start;grid-column:2;grid-row:1;z-index:2;max-height:calc(100dvh - var(--style-preview-top,120px) - 16px);display:flex;flex-direction:column;background:var(--admin-surface);border:1px solid var(--admin-border);border-radius:16px;box-shadow:0 10px 30px #00000014;overflow:hidden}
 #styleForm .style-controls{grid-column:1;grid-row:1}
 #styleForm .style-preview-toolbar{flex:none;padding:16px;gap:12px;flex-wrap:wrap}
 #styleForm .style-live-preview iframe{display:block;flex:1;min-height:0;height:calc(100dvh - var(--style-preview-top,120px) - 140px);border:0;border-radius:0;width:100%}
}
@media(min-width:1051px){#styleForm .style-live-preview{height:calc(100dvh - var(--style-preview-top,120px) - 24px);max-height:none;min-height:360px}#styleForm .style-live-preview iframe{flex:1 1 0;height:0;min-height:0}#styleForm .style-workspace{grid-template-columns:minmax(280px,.7fr) minmax(0,1.3fr)}}
/* Menu groups retain their content height; only the menu area scrolls. */
.admin-layout .sidebar .side-nav{display:grid!important;grid-auto-rows:max-content!important;align-content:start!important;align-items:start;flex:1 1 0;min-height:0;overflow-y:auto!important;overflow-x:hidden;overscroll-behavior:contain}
.admin-layout .sidebar .nav-group{height:auto!important;min-height:max-content!important;grid-auto-rows:max-content!important;align-content:start;align-self:start;flex-shrink:0}
.admin-layout .sidebar .nav-group-label.nav-group-toggle{display:flex!important;align-items:center!important;justify-content:space-between;min-height:58px!important;height:auto!important;padding:12px 14px!important;line-height:1.4;flex-shrink:0}
.admin-layout .sidebar .nav-group-toggle>b{align-self:center;width:32px;height:32px;min-height:32px;flex:0 0 32px}
.admin-layout .sidebar .side-brand,.admin-layout .sidebar .side-label,.admin-layout .sidebar .side-bottom{flex-shrink:0}
@media(max-width:1200px){.admin-layout .sidebar .nav-button{min-height:44px;white-space:normal}.admin-layout .sidebar .side-bottom{padding-top:12px}.admin-layout .sidebar .nav-group-label.nav-group-toggle{font-size:11px}}
/* Soft sales switch and quiet fullscreen action. */
#checkoutPanel .checkout-navigation-bar .checkout-dining-toolbar{background:transparent!important;border-color:transparent!important;box-shadow:none;align-items:center;gap:12px}
#checkoutPanel .checkout-sales-mode-buttons{gap:4px;padding:5px;border:1px solid color-mix(in srgb,var(--theme-primary) 8%,transparent);border-radius:18px;background:color-mix(in srgb,var(--theme-primary) 5%,var(--theme-background));box-shadow:inset 0 1px 2px #00000002}
#checkoutPanel .checkout-sales-mode-buttons>button{gap:8px;min-height:42px;padding:10px 16px;border-radius:13px;color:var(--admin-muted);font-weight:650;line-height:1.3;transition:background-color .25s ease,color .25s ease,box-shadow .25s ease}
#checkoutPanel .checkout-sales-mode-buttons>button[aria-pressed=true]{background:color-mix(in srgb,var(--theme-background) 97%,white);color:var(--theme-button);box-shadow:0 2px 8px #00000008,0 1px 2px #00000004}
#checkoutPanel .checkout-sales-mode-buttons>button>svg{width:19px;height:19px;opacity:.85}
#checkoutPanel .checkout-fullscreen-button.reset-button{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:10px 14px!important;border:1px solid color-mix(in srgb,var(--theme-primary) 10%,transparent)!important;border-radius:14px;background:color-mix(in srgb,var(--theme-primary) 3%,var(--theme-background))!important;color:var(--admin-muted)!important;box-shadow:none;font-size:12px;font-weight:600;line-height:1.3;transition:background-color .25s ease,border-color .25s ease,color .25s ease}
#checkoutPanel .checkout-fullscreen-button>svg{width:17px;height:17px;opacity:.8}
#checkoutPanel .checkout-fullscreen-button[aria-pressed=true]{background:var(--admin-soft)!important;color:var(--theme-button)!important;border-color:color-mix(in srgb,var(--theme-button) 22%,transparent)!important}
@media(hover:hover){#checkoutPanel .checkout-sales-mode-buttons>button:not([aria-pressed=true]):hover,#checkoutPanel .checkout-fullscreen-button.reset-button:hover{background:color-mix(in srgb,var(--theme-primary) 8%,var(--theme-background))!important;color:var(--theme-button)!important}}
@media(min-width:701px) and (max-width:1366px) and (max-height:900px){#checkoutPanel .checkout-sales-mode-buttons{padding:3px;border-radius:14px}#checkoutPanel .checkout-sales-mode-buttons>button{min-height:34px;padding:7px 11px;border-radius:10px;font-size:12px}#checkoutPanel .checkout-fullscreen-button.reset-button{min-height:34px;padding:7px 11px!important;border-radius:11px}}
@media(max-width:700px){#checkoutPanel .checkout-sales-mode-buttons>button{min-height:44px;padding:9px 10px}#checkoutPanel .checkout-fullscreen-button.reset-button{min-height:44px}}
@media(prefers-reduced-motion:reduce){#checkoutPanel .checkout-sales-mode-buttons>button,#checkoutPanel .checkout-fullscreen-button.reset-button{transition:none}}
#productsPanel .etalase-toggle,#productsPanel td:nth-child(8)>.status{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:112px;min-width:112px;height:36px;min-height:36px;margin:0;padding:8px 12px;border:1px solid transparent!important;border-radius:11px;font-family:inherit;font-size:12px;font-weight:700;line-height:1.35;white-space:nowrap;box-shadow:none;vertical-align:middle}
#productsPanel .etalase-toggle.yes,#productsPanel td:nth-child(8)>.status.yes{background:#e8f4ee!important;color:#28704e!important;border-color:#d1e7dc!important}
#productsPanel .etalase-toggle.no,#productsPanel td:nth-child(8)>.status.no{background:var(--admin-soft)!important;color:var(--admin-muted)!important;border-color:var(--admin-border)!important}
@media(pointer:coarse){#productsPanel .etalase-toggle,#productsPanel td:nth-child(8)>.status{height:44px;min-height:44px}}

.product-export-dialog{max-height:calc(100dvh - 32px);overflow:auto}.product-export-dialog p{line-height:1.6}.product-export-dialog small{display:block;color:var(--admin-muted);line-height:1.6}.product-export-scope{display:grid;gap:8px;font-weight:700}.product-export-scope select{width:100%;min-height:44px;border:1px solid var(--admin-border);border-radius:12px;padding:10px;background:var(--admin-surface);color:var(--admin-text);font:inherit}.product-export-dialog .form-actions{display:flex;gap:10px;flex-wrap:wrap}.product-export-dialog .form-actions button{flex:1;min-height:44px}.product-export-dialog [aria-live]{min-height:24px}
