/* Paleta exclusiva do painel; não altera o cardápio público nem dados das lojas. */
html[data-admin-palette] {
  color-scheme: light;
  --theme-primary: #ea1d2c; --theme-primary-hover: #c81825;
  --theme-secondary: #ea1d2c; --theme-secondary-hover: #c81825;
  --theme-on-primary: #fff; --theme-background: #f7f7f8;
  --theme-surface: #fff; --theme-surface-soft: #f3f4f5;
  --theme-text: #242424; --theme-text-secondary: #6b6b73; --theme-border: #e5e5e9;
  --color-primary: #ea1d2c !important; --color-primary-hover: #c81825;
  --color-secondary: #ea1d2c !important; --color-dark: #f7f7f8 !important;
  --color-card: #fff; --color-surface: #f3f4f5; --color-card-border: #e5e5e9;
  --color-text-main: #242424; --color-text-muted: #6b6b73;
  --shadow-card: 0 2px 10px rgba(25,25,25,.04); --shadow-glow: none;
}
html[data-admin-palette], html[data-admin-palette] body,
html[data-admin-palette] #admin-login-screen { background-color: #f7f7f8 !important; color: #242424; }
html[data-admin-palette] :is(.text-white,.text-gray-100,.text-gray-200,.text-gray-300) { color: var(--theme-text); }
html[data-admin-palette] :is(.text-gray-400,.text-gray-500) { color: var(--theme-text-secondary); }
html[data-admin-palette] :is(.text-brand-yellow,.text-brand-red) { color: #ea1d2c; }
html[data-admin-palette] :is(.btn-primary,.btn-whatsapp) { color: #fff; box-shadow: none; background: #ea1d2c; border-color: #ea1d2c; }
html[data-admin-palette] :is(.btn-primary,.btn-whatsapp):hover { background: #c81825; }
html[data-admin-palette] :is(.btn-primary,.btn-whatsapp) * { color: inherit; }
html[data-admin-palette] .btn-secondary { background: #fff; color: #ea1d2c; border: 1px solid #ea1d2c; box-shadow: none; }
html[data-admin-palette] .admin-menu-shell { background: #fff; }
html[data-admin-palette] .admin-grouped-nav .admin-nav-tab[aria-pressed="true"] { background: #fff0f1; color: #d71927; border-color: #ffd6da; }
html[data-admin-palette] .admin-category-block { box-shadow: 0 2px 8px rgba(25,25,25,.03); }
html[data-admin-palette] .admin-category-block-header { background: #fafafa; }
html[data-admin-palette] .admin-category-main-actions > button { background: #ea1d2c; color: #fff; }
html[data-admin-palette] .admin-category-block :is(.admin-promo-label) { background: #fff0f1; color: #d71927; border: 1px solid #ffd6da; box-shadow: none; }
html[data-admin-palette] :is(.text-green-300,.text-green-400,.text-emerald-300,.text-emerald-400) { color: #15803d; }
html[data-admin-palette] :is(.text-red-300,.text-red-400) { color: #c62026; }
html[data-admin-palette] :is(.text-amber-300,.text-amber-400,.text-orange-300,.text-orange-400,.text-yellow-400) { color: #a65c00; }
html[data-admin-palette] :is(.text-blue-300,.text-blue-400) { color: #1d4ed8; }
html[data-admin-palette] :is(.text-purple-300,.text-purple-400,.text-indigo-300,.text-indigo-400) { color: #7e22ce; }
html[data-admin-palette] :is(.bg-green-600,.bg-emerald-600,.bg-purple-600,.bg-indigo-600,.bg-orange-600,.bg-blue-600,.bg-red-600) { color: #fff; }
html[data-admin-palette] :is(.bg-green-600,.bg-emerald-600,.bg-purple-600,.bg-indigo-600,.bg-orange-600,.bg-blue-600,.bg-red-600) * { color: inherit; }
html[data-admin-palette] .order-needs-attention { border-color: #ef9a9f; }
html[data-admin-palette] .order-elapsed-alert { color: #c62026; }
html[data-admin-palette] .modal-content { background: #fff; border-color: #e5e5e9; }
html[data-admin-palette] .shadow-xl { box-shadow: 0 3px 14px rgba(0,0,0,.05); }

/* O tema escuro usa a mesma hierarquia e o mesmo vermelho do tema claro. */
html[data-admin-palette="dark-red"] {
  color-scheme: dark;
  --theme-background: #121214; --theme-surface: #1c1c20; --theme-surface-soft: #25252b;
  --theme-text: #f5f5f7; --theme-text-secondary: #a8a8b2; --theme-border: #35353e;
  --color-dark: #121214 !important; --color-card: #1c1c20; --color-surface: #25252b;
  --color-card-border: #35353e; --color-text-main: #f5f5f7; --color-text-muted: #a8a8b2;
}
html[data-admin-palette], html[data-admin-palette] body,
html[data-admin-palette] #admin-login-screen { background-color: var(--theme-background) !important; color: var(--theme-text); }
html[data-admin-palette] :is(.admin-menu-shell,.modal-content) { background: var(--theme-surface); border-color: var(--theme-border); }
html[data-admin-palette] .admin-category-block-header { background: var(--theme-surface-soft); }
html[data-admin-palette] .btn-secondary { background: var(--theme-surface); }
html[data-admin-palette="dark-red"] .admin-grouped-nav .admin-nav-tab[aria-pressed="true"] { background: #3b2026; color: #ff7d86; border-color: #72333c; }
html[data-admin-palette="dark-red"] .admin-category-block .admin-promo-label { background: #48222a; color: #ff8992; border-color: #71323d; }
html[data-admin-palette="dark-red"] :is(.text-brand-yellow,.text-brand-red) { color: #ff7d86; }
html[data-admin-palette="dark-red"] :is(.text-green-300,.text-green-400,.text-emerald-300,.text-emerald-400) { color: #4ade80; }
html[data-admin-palette="dark-red"] :is(.text-red-300,.text-red-400) { color: #f87171; }
html[data-admin-palette="dark-red"] :is(.text-amber-300,.text-amber-400,.text-orange-300,.text-orange-400,.text-yellow-400) { color: #fbbf24; }
html[data-admin-palette="dark-red"] :is(.text-blue-300,.text-blue-400) { color: #60a5fa; }
html[data-admin-palette="dark-red"] :is(.text-purple-300,.text-purple-400,.text-indigo-300,.text-indigo-400) { color: #c084fc; }
/* Detalhes dos pedidos acompanham integralmente a paleta escolhida. */
html[data-admin-palette] .order-drawer-panel {
  background: var(--theme-background);
  color: var(--theme-text);
  border-left: 1px solid var(--theme-border);
  box-shadow: -8px 0 28px rgba(0,0,0,.12);
  height: 100dvh;
}
html[data-admin-palette] #order-details-drawer > :first-child,
html[data-admin-palette] #order-details-drawer > :last-child { background: var(--theme-surface); }
html[data-admin-palette] #order-details-drawer > .overflow-y-auto { min-height: 0; overscroll-behavior: contain; }
html[data-admin-palette] #drawer-order-items .order-item-option-name { color: var(--theme-text); }
html[data-admin-palette] #drawer-order-items .order-item-option-label { color: var(--theme-text-secondary); }
html[data-admin-palette] #drawer-order-items .order-item-option-price { color: var(--theme-primary); }
html[data-admin-palette="dark-red"] #drawer-order-items .order-item-option-price { color: #ff8992; }
html[data-admin-palette="light-red"] #btn-drawer-whatsapp { background: #eaf8ef; color: #166534; border-color: #b9e5c7; }
html[data-admin-palette="light-red"] #btn-drawer-route { background: #edf3ff; color: #1d4ed8; border-color: #cbdcfb; }
html[data-admin-palette="light-red"] #btn-drawer-driver { background: #f3edff; color: #7e22ce; border-color: #dfcdf6; }
html[data-admin-palette="light-red"] #drawer-obs-text { color: #854d0e; }
html[data-admin-palette="light-red"] #btn-drawer-primary-action { background: #ea1d2c; color: #fff; opacity: 1; }
html[data-admin-palette="light-red"] #btn-drawer-primary-action.bg-green-900\/60 { background: #eaf8ef; color: #166534; border-color: #b9e5c7; }
html[data-admin-palette="light-red"] #btn-drawer-primary-action.bg-red-950\/60 { background: #fff0f1; color: #b91c1c; border-color: #fecaca; }
html[data-admin-palette] #btn-drawer-primary-action * { color: inherit; }
.cost-box { padding:20px; border:1px solid var(--theme-border);border-radius:16px;background:var(--theme-surface);display:grid;gap:14px;color:var(--theme-text); }
.cost-box h3 {font-size:17px;font-weight:800;}
.cost-box p {font-size:12px;color:var(--theme-text-secondary);line-height:1.6;}
.cost-box label {display:grid;gap:6px;font-size:12px;font-weight:600;}
.cost-box input,.cost-box select {min-height:42px; padding:9px 12px;background:var(--theme-surface-soft);color:var(--theme-text);border:1px solid var(--theme-border);border-radius:9px;max-width:100%;}
.cost-box button {padding:9px 12px;border-radius:9px;font-size:12px;font-weight:700;}
.cost-box .btn-primary,.cost-box .btn-secondary {justify-self:start;}
.cost-fields {display:flex;align-items:end;flex-wrap:wrap;gap:12px;}
.cost-fields label {flex:1;min-width:150px;}
.cost-table {width:100%;text-align:left;font-size:13px;}
.cost-table th,.cost-table td {padding:12px;border-bottom:1px solid var(--theme-border);}
.cost-table th {color:var(--theme-text-secondary);font-size:11px;}
.cost-table button {color:var(--theme-primary);}
.cost-summary {display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0;}
.cost-summary>div {padding:16px;border:1px solid var(--theme-border);border-radius:12px;font-size:12px;}
.cost-summary strong {display:block;font-size:20px;margin-top:8px;}
.cost-fields input,.cost-fields select {width:100%;min-width:0;}
.cost-fields label {flex-basis:160px;min-width:140px;}
@media (max-width:600px) {.cost-box{padding:14px;}.cost-fields label{flex-basis:100%;}.cost-table th,.cost-table td{padding:9px;}}

.cost-pane[hidden] {display:none !important;}
.cost-box [hidden] { display: none !important; }
.cost-margin-caption {display:block;font-size:10px;margin-top:5px;line-height:1.4;}
.cost-margin-negative {color:#b91c1c;}
.cost-margin-low {color:#92400e;}
.cost-margin-positive {color:#166534;}
.cost-margin-unknown {color:var(--theme-text-secondary);}
html[data-admin-palette="dark-red"] .cost-margin-negative {color:#fca5a5;}
html[data-admin-palette="dark-red"] .cost-margin-low {color:#fcd34d;}
html[data-admin-palette="dark-red"] .cost-margin-positive {color:#86efac;}
html[data-admin-palette] #btn-toggle-auto-accept[aria-pressed="true"] {background:#15803d!important;border-color:#15803d!important;color:#fff!important;box-shadow:none;}
html[data-admin-palette] #btn-toggle-auto-accept[aria-pressed="true"] * {color:#fff!important;}
html[data-admin-palette] #btn-toggle-auto-accept[aria-pressed="true"] #auto-accept-indicator {background:#fff;}
html[data-admin-palette] #btn-toggle-auto-accept:disabled {opacity:.7;cursor:wait;}

#report-costs nav[hidden] {display:none !important;}
.cash-register { padding:20px; border:1px solid var(--admin-border,#d9dce3); border-radius:16px; background:var(--admin-surface,#fff); color:var(--admin-text,#202124); }
.cash-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;}
.cash-register p {font-size:13px;margin:8px 0;color:inherit;}
.cash-register button {padding:10px 18px;border-radius:10px;background:#ea1d2c;color:white;font-weight:700;}
.cash-register button:disabled {opacity:.5;}
.cash-register form {margin:16px 0;padding:16px;border:1px solid #d9dce3;border-radius:12px;}
.cash-register form[hidden] {display:none!important;}
.cash-register input {display:block;padding:10px;margin-top:8px;border:1px solid #a1a1aa;border-radius:8px;color:inherit;background:transparent;max-width:100%;}
.cash-register details {margin-top:12px;} .cash-register summary {cursor:pointer;}
html[data-admin-palette="dark-red"] .cash-register {background:#1c1c20;color:#f4f4f5;}
.pontomenu-admin-brand {flex-shrink:0;}
.pontomenu-admin-brand h1 {margin:0;line-height:1;}
.pontomenu-admin-brand img {display:block;width:210px;height:70px;object-fit:contain;border-radius:10px;}
.pontomenu-admin-brand > span {display:block;margin-top:3px;}
@media(max-width:640px) {.pontomenu-admin-brand img {width:174px;height:58px;}}
.order-search-compact {display:flex;align-items:center;gap:8px;white-space:nowrap;}
.order-search-compact input {width:100px;padding:9px 10px;border:1px solid var(--theme-border,#d9dce3);border-radius:10px;background:var(--theme-card,#fff);color:var(--theme-text,#242424);font-size:16px;}
.cash-icon-button {position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:42px;border:1px solid #d9dce3;border-radius:10px;color:#ea1d2c;background:#fff;cursor:pointer;}
.cash-status-dot {position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:#9ca3af;}
.cash-status-dot.is-open {background:#16a34a;}
.cash-dialog {width:min(560px,calc(100vw - 32px));max-height:85vh;padding:0;border:1px solid #d9dce3;border-radius:18px;background:#fff;color:#242424;}
.cash-dialog::backdrop {background:rgba(0,0,0,.5);}
.cash-dialog-content {position:relative;padding:28px;}
.cash-dialog h2 {font-size:22px;font-weight:800;margin-bottom:20px;}
.cash-dialog p {margin:12px 0;font-size:14px;}
.cash-dialog button:not(.cash-dialog-close) {padding:10px 16px;border-radius:10px;background:#ea1d2c;color:#fff;font-weight:700;}
.cash-dialog .cash-dialog-close {position:absolute;right:14px;top:10px;font-size:28px;background:transparent;color:inherit;padding:0 8px;}
.cash-dialog form {margin-top:18px;}
.cash-dialog form[hidden] {display:none;}
.cash-dialog input {display:block;width:100%;padding:10px;margin:8px 0 16px;border:1px solid #a1a1aa;border-radius:8px;background:transparent;color:inherit;}
html[data-admin-palette="dark-red"] :is(.cash-dialog,.cash-icon-button,.order-search-compact input) {background:#1c1c20;color:#f4f4f5;border-color:#3f3f46;}
@media(max-width:640px) {.order-search-compact {font-size:12px;}.order-search-compact input {width:90px;}}
.assistant-settings-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.assistant-settings-columns {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start;}
.assistant-settings-columns > * {min-width:0;}
.assistant-settings-columns input {max-width:100%;}
@media(max-width:1100px){.assistant-settings-columns {grid-template-columns:minmax(0,1fr);}}
