/* Studio: a work surface, not a marketing dashboard. Loaded after legacy CSS. */
:root {
  --admin-bg:#f3f5f3; --admin-bg-alt:#fff; --admin-surface:#fff;
  --admin-surface-raised:#fff; --admin-surface-soft:#e9eee9;
  --admin-text:#202722; --admin-muted:#59645b; --admin-subtle:#59645b;
  --admin-brand:#397414; --admin-brand-strong:#2e6110; --admin-on-brand:#fff;
  --admin-accent:#805408; --admin-danger:#a62732;
  --admin-3d:#397414; --admin-engineering:#24669a; --admin-service:#9b4f20;
  --admin-line:#d9e0d9; --admin-line-strong:#77877b;
  --admin-glass:#181d19; --studio-shadow:0 16px 48px #101a1420;
  --color-surface:var(--admin-surface); --color-border:var(--admin-line);
  --color-text:var(--admin-text); --color-text-muted:var(--admin-muted); --color-home:var(--admin-brand);
  --glow:transparent; --shadow:var(--studio-shadow);
}
html[data-admin-theme="dark"] {
  --admin-bg:#111612; --admin-bg-alt:#181d19; --admin-surface:#181d19;
  --admin-surface-raised:#222a23; --admin-surface-soft:#222a23;
  --admin-text:#edf3ec; --admin-muted:#a5b2a7; --admin-subtle:#a5b2a7;
  --admin-brand:#9ed957; --admin-brand-strong:#b3e57b; --admin-on-brand:#15220d;
  --admin-accent:#edc073; --admin-danger:#ff9ba5;
  --admin-3d:#9ed957; --admin-engineering:#93c6eb; --admin-service:#f0b78c;
  --admin-line:#354138; --admin-line-strong:#728576; --studio-shadow:0 16px 48px #0005;
}
@media(prefers-color-scheme:dark) {
  html:not([data-admin-theme]) { --admin-bg:#111612; --admin-bg-alt:#181d19; --admin-surface:#181d19; --admin-surface-raised:#222a23; --admin-surface-soft:#222a23; --admin-text:#edf3ec; --admin-muted:#a5b2a7; --admin-brand:#9ed957; --admin-on-brand:#15220d; color-scheme:dark; }
}
html[data-admin-theme] { background:var(--admin-bg); scroll-padding-top:7rem; }
html[data-admin-theme] body { background:var(--admin-bg); color:var(--admin-text); font:400 15px/1.6 var(--admin-font-body); }
body::before,.page-hero::before,.admin-kpi::before,.admin-panel::before,.ticket-card::before,.request-card::before,.product-topbar::before { display:none; }
*,*::before,*::after { box-sizing:border-box; }
[hidden] { display:none!important; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button,a { touch-action:manipulation; }
button { cursor:pointer; }
:is(button,a,input,select,textarea):focus-visible { outline:2px solid var(--admin-brand); outline-offset:3px; }
button:disabled { opacity:.55; cursor:wait; }
html[data-admin-theme] :is(input,select,textarea) { background:var(--admin-surface-raised); color:var(--admin-text); border-color:var(--admin-line-strong); box-shadow:none; color-scheme:inherit; font:400 1rem/1.5 var(--admin-font-body); }
html[data-admin-theme] :is(input,select,textarea):focus { border-color:var(--admin-brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--admin-brand) 15%,transparent); }
html[data-admin-theme] label { font-family:var(--admin-font-body); letter-spacing:normal; text-transform:none; font-size:.875rem; color:var(--admin-muted); }
html[data-admin-theme] .cta,html[data-admin-theme] .fiscal-dialog button.cta { background:var(--admin-brand); color:var(--admin-on-brand); border:1px solid transparent; box-shadow:none; border-radius:8px; font-weight:650; min-height:44px; }
html[data-admin-theme] .cta:hover { background:var(--admin-brand-strong); box-shadow:none; transform:none; }
html[data-admin-theme] :is(.order-button,.ghost,.user-item,.request-tab,.wizard-step,.print-settings-section .button) { background:var(--admin-surface); color:var(--admin-text); border-color:var(--admin-line); box-shadow:none; border-radius:8px; min-height:44px; font-family:var(--admin-font-body); }
html[data-admin-theme] :is(.order-button,.ghost,.user-item,.request-tab,.wizard-step,.print-settings-section .button):hover { background:var(--admin-surface-soft); border-color:var(--admin-line-strong); }
html[data-admin-theme] :is(.request-tab.is-active,.wizard-step.is-active,[data-commercial-filter][aria-pressed="true"]) { background:var(--admin-surface-soft); color:var(--admin-brand); border-color:var(--admin-brand); }
html[data-admin-theme] .order-button.is-danger { color:var(--admin-danger); }
.nav-inner { background:#181d19; border-color:#354138; box-shadow:0 8px 24px #0002; backdrop-filter:none; }
.nav :is(.brand,.admin-nowbar-link,.user-trigger) { color:#edf3ec; }
.nav .admin-nowbar-link.is-active { color:#9ed957; }
.nav .brand { border-color:#354138; }
.nav .user-trigger { background:#222a23; border-color:#728576; width:44px; height:44px; }
.admin-nowbar-indicator { background:#283526; border-color:#47633b; box-shadow:none; transition:transform 180ms ease,opacity 150ms ease; }
.nav-actions { display:flex; align-items:center; gap:8px; border-color:#354138; }
.nav-inner .brand { position:static; transform:none; min-width:0; }
.nav-inner .brand img { display:block; }
.studio-theme-switch { display:flex; gap:2px; padding:2px; border-radius:9px; background:#222a23; }
.studio-theme-switch button { min-height:40px; padding:8px; border:0; border-radius:7px; background:transparent; color:#a5b2a7; font:500 .75rem var(--admin-font-body); }
.studio-theme-switch button[aria-pressed="true"] { background:#354138; color:#edf3ec; }
.studio-theme-switch button:focus-visible { outline-color:#9ed957; }
.studio-skip { position:fixed; top:8px; left:8px; z-index:300; padding:12px; background:var(--admin-surface); color:var(--admin-text); transform:translateY(-150%); }
.studio-skip:focus { transform:none; }
main { padding-top:7rem; }
.page-hero { width:min(76rem,100%); margin:auto; padding:1.5rem 2rem .5rem; }
.page-hero > .tag { display:none; }
.page-hero h1 { margin:0; font:600 clamp(1.6rem,3vw,2.2rem)/1.2 var(--admin-font-display); letter-spacing:-.035em; }
.page-hero p { margin:.65rem 0 0; max-width:52rem; font-size:.95rem; }
.section { padding:1.5rem 2rem 3rem; margin:auto; }
html[data-admin-theme] :is(.admin-kpi,.admin-panel,.form-panel,.filter-bar,.ticket-card,.request-card,.item-entry,.product-topbar,.product-modal-panel,.quote-line-card,.quote-preview-shell,.product-live-preview,.live-product-card,.live-shipping-box,.pricing-summary,.product-auto-note,.saved-quote) { background:var(--admin-surface); border-color:var(--admin-line); box-shadow:none; border-radius:12px; }
.admin-kpi { padding:1.25rem; min-height:8rem; }
.admin-kpi :is(span,small),.finance-grid span,.analytics-list span { font-family:var(--admin-font-body); font-size:.85rem; text-transform:none; letter-spacing:normal; }
.admin-kpi strong,.finance-grid strong,.analytics-list strong { font-family:var(--admin-font-display); font-variant-numeric:tabular-nums; }
.admin-kpi strong { font-size:2rem; }
.admin-panel { padding:1.5rem; }
.finance-grid > div,.analytics-list > div { background:transparent; border:0; border-radius:0; padding:.85rem 0; border-bottom:1px solid var(--admin-line); }
.admin-secondary-section { margin-top:1rem; border-top:1px solid var(--admin-line); padding-top:1rem; }
.admin-secondary-section > summary { min-height:44px; cursor:pointer; color:var(--admin-muted); }
.admin-secondary-section .admin-panel { margin-top:1rem; }
.account-status { background:transparent; border:0; padding:.4rem 0; font:400 .85rem/1.5 var(--admin-font-body); color:var(--admin-muted); }
.tag,.status-chip,.badge,.meta-chip,.item-price { font-family:var(--admin-font-body); letter-spacing:normal; text-transform:none; }
.status-chip { color:var(--admin-text); background:var(--admin-surface-soft); border-color:var(--admin-line); }
.order-launch { margin:0 0 1.5rem; }
.order-launch strong { display:none; }
.order-launch p { margin:0; font-size:.9rem; }
.fiscal-launch { border:0; padding:0; justify-content:flex-start; margin:1rem 0; }
.fiscal-launch > div { display:none; }
.fiscal-launch .user-item { font-size:.85rem; }
.saved-quotes-heading h2 { font-size:1rem; margin:0; color:var(--admin-muted); }
.commercial-toolbar { margin:1.25rem 0 .5rem; gap:1rem; }
.commercial-filters { padding:3px; gap:3px; background:var(--admin-surface-soft); border-radius:9px; }
.commercial-filters .order-button { border:0; background:transparent; min-height:40px; padding:.5rem .8rem; }
html[data-admin-theme] .commercial-filters [aria-pressed="true"] { background:var(--admin-surface); box-shadow:0 1px 4px #0001; border:0; color:var(--admin-text); }
.commercial-toolbar .order-field { font-size:.8rem; flex-basis:18rem; }
.commercial-toolbar input { border-radius:8px; }
#commercialCount { color:var(--admin-muted); font-size:.8rem; margin:.5rem 0 1rem; }
#adminPedidosStatus,#savedQuotesStatus { font-size:.8rem; min-height:0; margin:.3rem 0; color:var(--admin-muted); }
.saved-quotes-list { gap:0; border:1px solid var(--admin-line); border-radius:12px; background:var(--admin-surface); overflow:hidden; }
html[data-admin-theme] .studio-record { background:var(--admin-surface); border:0; border-bottom:1px solid var(--admin-line); border-radius:0; padding:0; overflow:visible; }
.studio-record:last-child { border-bottom:0; }
#adminProductsList,#adminDevList { gap:0; border:1px solid var(--admin-line); border-radius:12px; overflow:hidden; }
.studio-record-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(7rem,.35fr) minmax(6rem,.3fr) auto; align-items:center; gap:1.5rem; padding:1.2rem 1.4rem; }
.studio-record-identity { display:grid; gap:.2rem; min-width:0; }
.studio-record-code,.studio-record-subtitle { font-size:.78rem; color:var(--admin-muted); overflow-wrap:anywhere; }
.studio-record-identity strong { font:600 1rem var(--admin-font-body); overflow-wrap:anywhere; }
.studio-record-state { font-size:.82rem; color:var(--admin-muted); overflow-wrap:anywhere; }
.studio-record-total { text-align:right; font:600 1rem var(--admin-font-body); font-variant-numeric:tabular-nums; white-space:nowrap; }
.studio-open-record { color:var(--admin-brand); background:transparent; border:0; border-radius:8px; padding:.6rem; min-height:44px; font:600 .82rem var(--admin-font-body); }
.studio-open-record:hover { background:var(--admin-surface-soft); }
.studio-record-detail { position:fixed; inset:0 0 0 auto; width:min(40rem,100%); max-width:100%; height:100dvh; max-height:100dvh; margin:0; padding:0; border:0; border-left:1px solid var(--admin-line); border-radius:16px 0 0 16px; background:var(--admin-surface); color:var(--admin-text); overflow:auto; overscroll-behavior:contain; box-shadow:var(--studio-shadow); }
.studio-record-detail::backdrop,.studio-confirm::backdrop { background:#111b1466; }
.studio-detail-head { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.3rem 1.5rem; background:var(--admin-surface); border-bottom:1px solid var(--admin-line); }
.studio-detail-head h2 { margin:0; font:600 1.1rem var(--admin-font-display); overflow-wrap:anywhere; }
.studio-detail-head button { min-height:44px; padding:.65rem; background:var(--admin-surface-soft); color:var(--admin-text); border:0; border-radius:8px; }
.studio-detail-content { padding:1.5rem; }
.studio-detail-content .ticket-meta { font-size:.9rem; margin:.7rem 0; color:var(--admin-muted); }
.studio-detail-content .admin-controls { display:grid; gap:1rem; margin:1rem 0; }
.studio-detail-content :is(input,select,textarea) { width:100%; min-height:44px; }
.studio-detail-content label { display:grid; gap:.5rem; }
.studio-detail-content .commercial-record-actions,.studio-detail-content .saved-quote-actions { border-top:1px solid var(--admin-line); padding-top:1rem; }
.studio-detail-content .saved-quote-number { font-family:var(--admin-font-body); }
.studio-detail-content details { padding:1rem 0; border-top:1px solid var(--admin-line); }
.studio-detail-content summary { min-height:44px; cursor:pointer; }
html[data-admin-theme] :is(.order-dialog,.fiscal-dialog,.product-modal-panel) { background:var(--admin-surface); border-color:var(--admin-line); box-shadow:var(--studio-shadow); border-radius:16px; }
.order-dialog,.fiscal-dialog { overscroll-behavior:contain; }
.order-wizard-head { border-bottom:1px solid var(--admin-line); padding:1.4rem 1.5rem; }
.order-wizard-head h2 { font-size:1.5rem; }
.order-wizard-head .tag { font:500 .8rem var(--admin-font-body); color:var(--admin-muted); }
.order-wizard-head .order-close { border:0; background:var(--admin-surface-soft); }
.order-progress { padding-top:1rem; gap:6px; }
.order-progress span { height:3px; }
.order-wizard-content .order-item { background:transparent; border:0; border-top:1px solid var(--admin-line); border-radius:0; padding:1rem 0; }
.order-wizard-actions { background:var(--admin-surface); }
.order-wizard-content .business-line-card { min-height:10rem; background:var(--admin-bg); border-radius:12px; }
.order-wizard-content .business-line-card[aria-pressed="true"] { background:color-mix(in srgb,var(--admin-brand) 7%,var(--admin-surface)); }
.fiscal-dialog .fiscal-field input { color-scheme:inherit; }
.fiscal-actions { background:var(--admin-surface); }
.fiscal-head .tag { color:var(--admin-muted); }
.product-modal { backdrop-filter:none; background:#111b1480; }
html[data-admin-theme] .product-topbar { border:0; background:transparent; box-shadow:none; padding:0 0 1rem; }
.product-topbar > div:first-child { display:none; }
.product-toolbar-actions { margin-left:auto; }
html[data-admin-theme] .product-toolbar { display:flex; justify-content:flex-end; padding:0; border:0; background:transparent; }
.product-toolbar > div:first-child { display:none; }
html[data-admin-theme] .product-toolbar-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
html[data-admin-theme] :is(#seedProductsButton,#exportProductsButton) { width:auto; flex:0 0 auto; }
.results-head > div { min-width:0; }
.live-product-media,.quote-preview-wrap { background:var(--admin-bg); }
.catalog-visibility-switch { border:0; background:var(--admin-surface-soft); }
.catalog-card-tags { margin:.5rem 0; }
.product-grid,.items-grid { gap:1rem; }
.product-modal-head,.product-modal-foot { background:var(--admin-surface); }
.print-settings-section { border-top:1px solid var(--admin-line); }
.request-tabs { gap:6px; margin:1rem 0; }
.request-tab { padding:.6rem 1rem; }
.request-card-head { margin-bottom:1rem; }
.admin-auth-gate { background:var(--admin-bg); }
.admin-auth-panel { background:var(--admin-surface); border:1px solid var(--admin-line); box-shadow:var(--studio-shadow); }
.admin-auth-kicker,.admin-auth-meta,.admin-auth-status { font-family:var(--admin-font-body); letter-spacing:normal; text-transform:none; }
html[data-admin-theme] .hx-auth-dialog { --hx-bg:var(--admin-surface); --hx-field:var(--admin-surface-raised); --hx-line:var(--admin-line-strong); --hx-text:var(--admin-text); --hx-muted:var(--admin-muted); --hx-green:var(--admin-brand); color-scheme:inherit; }
html[data-admin-theme] .hx-auth-dialog .hx-auth-primary { color:var(--admin-on-brand); }
.user-menu.hx-profile-menu { --profile-surface:var(--admin-surface); --profile-line:var(--admin-line); --profile-text:var(--admin-text); --profile-muted:var(--admin-muted); --profile-accent:var(--admin-brand); }
html[data-admin-theme] .user-content { color:var(--admin-text); background:var(--admin-surface); }
.admin-side-menu { background:var(--admin-surface); color:var(--admin-text); }
.admin-side-menu[aria-hidden="true"] { visibility:hidden; }
.admin-side-head,.admin-side-foot { background:transparent; }
.admin-side-brand small { color:var(--admin-muted); font-family:var(--admin-font-body); letter-spacing:normal; }
.studio-notifications { position:fixed; z-index:200; bottom:2rem; right:2rem; width:min(28rem,calc(100% - 2rem)); display:grid; gap:8px; pointer-events:none; }
.studio-notification { display:flex; align-items:start; gap:1rem; padding:1rem; border:1px solid var(--admin-line-strong); border-radius:12px; background:var(--admin-surface); color:var(--admin-text); box-shadow:var(--studio-shadow); pointer-events:auto; }
.studio-notification span { flex:1; overflow-wrap:anywhere; }
.studio-notification button { background:transparent; color:var(--admin-muted); min-width:44px; min-height:44px; border:0; margin:-.5rem; }
.studio-notification.is-error { border-color:var(--admin-danger); }
.studio-confirm { width:min(28rem,calc(100% - 2rem)); margin:auto; padding:1.5rem; border:1px solid var(--admin-line); border-radius:16px; background:var(--admin-surface); color:var(--admin-text); box-shadow:var(--studio-shadow); }
.studio-confirm h2 { font:600 1.3rem var(--admin-font-display); margin:0 0 .7rem; }
.studio-confirm p { color:var(--admin-muted); }
.studio-confirm-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-top:1.5rem; }
.studio-confirm-actions button { min-height:44px; padding:.7rem 1rem; border:1px solid var(--admin-line); border-radius:8px; color:var(--admin-text); background:var(--admin-surface-soft); }
html[data-admin-theme] .studio-confirm-actions button.cta { background:var(--admin-brand); color:var(--admin-on-brand); border-color:transparent; }
.studio-field-error { display:block; color:var(--admin-danger); font:.85rem/1.5 var(--admin-font-body); }
.studio-record-detail :focus-visible { scroll-margin:6rem 0 2rem; }
footer { border-top:1px solid var(--admin-line); color:var(--admin-muted); background:transparent; }
.footer-inner { padding:1rem 2rem; }
.footer-inner > div:last-child { display:none; }
.footer-inner p { font-size:.8rem; }
.footer-inner { font-family:var(--admin-font-body); }
html[data-admin-theme] .product-modal-head .tag { display:none; }
.page-hero h1,.studio-detail-head h2 { text-wrap:balance; }
@media(max-width:56rem) {
  .admin-menu-toggle { display:none; }
  .nav-inner { flex-wrap:nowrap; }
  .nav-inner .brand { padding-right:0; border:0; }
  .nav-inner .brand img { width:28px; height:28px; }
  .nav-inner .brand span { font-size:.85rem; }
}
@media(max-width:760px) {
  main { padding-top:6rem; }
  .nav { top:max(.65rem,env(safe-area-inset-top)); width:calc(100% - 1.25rem); }
  .nav-inner { padding:.35rem .5rem .35rem .8rem; }
  .brand { font-size:.9rem; padding-right:0; border:0; }
  .brand img { width:28px; height:28px; }
  .nav-actions { margin-left:auto; padding-left:0; border:0; }
  .studio-theme-switch button { padding:6px; min-height:40px; }
  .admin-nowbar-nav { display:none; }
  .admin-mobile-nowbar { background:#181d19; border-color:#354138; grid-template-columns:repeat(4,minmax(0,1fr)); padding-bottom:max(.5rem,env(safe-area-inset-bottom)); }
  .admin-mobile-link { color:#a5b2a7; min-height:48px; }
  .admin-mobile-link.is-active { background:#283526; border-color:transparent; color:#9ed957; }
  .admin-menu-toggle { display:none; }
  .page-hero { padding:1rem 1rem .5rem; }
  .section { padding:1rem 1rem 6.5rem; }
  .studio-record-row { grid-template-columns:minmax(0,1fr) auto; gap:.5rem 1rem; padding:1rem; }
  .studio-record-identity { grid-column:1; }
  .studio-record-total { grid-column:2; grid-row:1; font-size:.95rem; }
  .studio-record-state { grid-column:1; grid-row:2; }
  .studio-open-record { grid-column:2; grid-row:2; }
  .commercial-toolbar { align-items:stretch; }
  .commercial-toolbar .order-field { flex-basis:100%; }
  .commercial-filters { width:100%; }
  .commercial-filters button { flex:1; font-size:.8rem; padding:.5rem; }
  .saved-quotes-heading { flex-direction:row; align-items:center; }
  .saved-quotes-heading button { font-size:.8rem; padding:.6rem; }
  .studio-record-detail { border-radius:0; padding-bottom:env(safe-area-inset-bottom); }
  .studio-detail-head { padding:max(1rem,env(safe-area-inset-top)) 1rem 1rem; }
  .studio-detail-content { padding:1rem; }
  html[data-admin-theme] .order-dialog,html[data-admin-theme] .fiscal-dialog { border-radius:0; }
  .studio-notifications { right:1rem; bottom:6.5rem; }
  .order-wizard-content .business-line-card { min-height:0; }
  .order-launch { flex-direction:row; align-items:center; }
  .order-launch p { max-width:12rem; font-size:.8rem; }
  .order-launch .cta { flex-shrink:0; padding:.7rem; font-size:.85rem; }
  .admin-panel { padding:1rem; }
  .admin-kpi { min-height:7rem; padding:1rem; }
  .admin-kpi strong { font-size:1.6rem; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
