/* Operations workspace. Deliberately isolated from the storefront theme. */
@layer rituals-palette {
  html body.admin-ops {
    color-scheme:light; --ops-bg:#f3f5f7; --ops-paper:#fff; --ops-ink:#212732;
    --ops-muted:#505865; --ops-line:#d8dde3; --ops-accent:#881e2d;
    --ink:var(--ops-ink); --muted:var(--ops-muted); --line:var(--ops-line);
    background:var(--ops-bg)!important; color:var(--ops-ink)!important;
  }
  html body.admin-ops [hidden]{display:none!important}
  html body.admin-ops .order-header {
    background:var(--ops-paper)!important; color:var(--ops-ink)!important; border-bottom:1px solid var(--ops-line)!important;
    display:flex!important; align-items:center; justify-content:space-between; gap:.5rem!important;
    padding:.45rem clamp(.75rem,4vw,2.4rem)!important; min-height:56px; box-shadow:none!important;
  }
  html body.admin-ops .order-header nav{display:flex;align-items:center;justify-content:end;flex-wrap:wrap;gap:.12rem .65rem}
  html body.admin-ops .order-header .wordmark{font-size:clamp(1.65rem,5vw,2.35rem)!important;color:var(--ops-ink)!important}
  html body.admin-ops .order-header .header-label{background:transparent!important;color:var(--ops-muted)!important;border:0!important;padding:0!important}
  html body.admin-ops .admin-main{max-width:83rem;margin-inline:auto;padding:clamp(.65rem,2.8vw,1.8rem) clamp(.65rem,3vw,2rem) 2rem!important;min-width:0}
  html body.admin-ops :is(.admin-login,.admin-overview,.ordering-control,.inventory-panel,.my-mojo-admin,.ops-card,
    .admin-order,.table-admin-order,.table-qr-card,.wallet-admin-panel,.mf-admin,.admin-order-popup,dialog) {
    background:var(--ops-paper)!important;color:var(--ops-ink)!important;border-color:var(--ops-line)!important;box-shadow:none!important;
  }
  html body.admin-ops .admin-login{max-width:39rem;padding:clamp(1rem,4vw,2rem);border-radius:1rem}
  html body.admin-ops :is(.order-header nav button,#admin-demo,.text-button,.close-dialog,.admin-popup-close) {
    background:transparent!important;color:var(--ops-accent)!important;-webkit-text-fill-color:currentColor!important;
    box-shadow:none!important;border-color:transparent!important;min-height:44px;
  }
  html body.admin-ops :is(.text-button,#admin-demo):hover{text-decoration:underline}
  html body.admin-ops .button:not(.outline){background:var(--ops-accent)!important;color:white!important;border-color:var(--ops-accent)!important;border-radius:.65rem!important}
  html body.admin-ops .button.outline,.ops-link.outline{background:#fff!important;color:var(--ops-ink)!important;border:1px solid var(--ops-line)!important;border-radius:.65rem!important}
  html body.admin-ops :is(button,a,input,select):focus-visible{outline:2px solid var(--ops-accent);outline-offset:2px}
  html body.admin-ops :is(button,input,select){min-height:44px;max-width:100%}
  html body.admin-ops button:disabled{opacity:.55;cursor:not-allowed}
  html body.admin-ops #admin-tabs {
    top:var(--admin-header-height,56px); grid-template-columns:repeat(6,minmax(0,1fr));
    background:var(--ops-paper)!important;border:1px solid var(--ops-line)!important;box-shadow:none!important;
    gap:.3rem; padding:.3rem; border-radius:.8rem;margin-block:0 1rem;
  }
  html body.admin-ops #admin-tabs [role=tab] {
    min-height:46px;padding:.35rem .25rem;font-size:clamp(.78rem,1.6vw,.95rem)!important;
    background:#fff!important;color:var(--ops-ink)!important;border:1px solid transparent!important;box-shadow:none!important;
    border-radius:.55rem!important;white-space:normal!important;text-align:center;line-height:1.16;
  }
  html body.admin-ops #admin-tabs [role=tab][aria-selected=true]{
    background:#edf0f3!important;border-color:#bec6d0!important;box-shadow:inset 0 -2px 0 var(--ops-accent)!important;
    color:var(--ops-accent)!important;font-weight:700!important;
  }
  html body.admin-ops .admin-tab-count{background:#e8ebee!important;color:var(--ops-ink)!important;border-radius:20px!important;display:inline-grid;place-items:center;min-width:1.45rem;padding:.1rem .24rem}
  html body.admin-ops .admin-tab-panel{scroll-margin-top:calc(var(--admin-header-height,56px) + var(--admin-tabs-height,56px) + .75rem);}
  html body.admin-ops :is(.admin-overview,.ordering-control) button:not(.button){background:#f7f8fa!important;color:var(--ops-ink)!important;border:1px solid var(--ops-line)!important;border-radius:.65rem!important}
  html body.admin-ops :is(.section-title,.table-admin-title,.wallet-admin-title,.admin-actions,.admin-pagination,.ops-buttons) {display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;min-width:0}
  html body.admin-ops :is(.section-title,.admin-overview,.ordering-control,.ops-card,.ops-panel-heading) h2 {font:750 clamp(1.2rem,4vw,1.8rem)/1.22 'DM Sans',Arial,sans-serif!important;letter-spacing:normal!important;margin-block:0 .4rem;text-transform:none!important}
  html body.admin-ops :is(.admin-overview-tile,.admin-stats .stat,.inventory-card,.ops-results>div) {
    min-width:0;background:#f7f8fa!important;color:var(--ops-ink)!important;border:1px solid var(--ops-line)!important;border-radius:.75rem;
  }
  html body.admin-ops :is(.admin-order-total,#admin-detail-total,.table-order-total,.inventory-card,.ops-results) {font-variant-numeric:tabular-nums;}
  html body.admin-ops .admin-order {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.45fr) minmax(0,1fr);gap:.8rem;}
  html body.admin-ops .admin-order > div{min-width:0;overflow-wrap:anywhere;grid-column:auto}
  html body.admin-ops .admin-order > div:last-child strong{display:block}
  html body.admin-ops .inventory-panel{padding:clamp(.65rem,3vw,1.25rem);max-width:100%}
  html body.admin-ops .inventory-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,19rem),1fr));gap:.75rem}
  html body.admin-ops .inventory-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
  html body.admin-ops .inventory-fields .stock-toggle {grid-column:1/-1}
  html body.admin-ops .inventory-fields label {min-width:0;overflow-wrap:anywhere;}
  html body.admin-ops .inventory-fields input:not([type=checkbox]){width:100%;min-width:0;}
  html body.admin-ops :is(.wallet-admin-panel,.table-admin-panel){min-width:0;overflow-wrap:anywhere;}
  html body.admin-ops .ops-card{border:1px solid var(--ops-line);border-radius:1rem;padding:clamp(.9rem,4vw,1.6rem)}
  html body.admin-ops .ops-fields,html body.admin-ops .ops-results{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin:.75rem 0;}
  html body.admin-ops .ops-fields label{display:grid;gap:.25rem;min-width:0;}
  html body.admin-ops .ops-fields input{min-width:0;width:100%;padding:.55rem;border:1px solid var(--ops-line);border-radius:.5rem;background:white;}
  html body.admin-ops .ops-results>div{padding:.75rem;}
  html body.admin-ops .ops-results dd{margin:.25rem 0 0;font-weight:750;font-size:1.1rem;}
  html body.admin-ops .ops-link{display:inline-flex;align-items:center;min-height:44px;max-width:100%;white-space:normal!important;}
  @media(max-width:820px){
    html body.admin-ops #admin-tabs{grid-template-columns:repeat(3,minmax(0,1fr));}
    html body.admin-ops .admin-order{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
    html body.admin-ops .admin-order > div:last-child{grid-column:1/-1;}
    html body.admin-ops :is(.ops-fields,.ops-results){grid-template-columns:repeat(2,minmax(0,1fr));}
  }
  @media(max-width:520px){
    html body.admin-ops .admin-order{grid-template-columns:minmax(0,1fr);padding:.8rem;}
    html body.admin-ops .admin-order > div:last-child{border-top:1px solid var(--ops-line);padding-top:.55rem;}
    html body.admin-ops :is(.inventory-tools,.admin-filters){display:grid;grid-template-columns:minmax(0,1fr);gap:.55rem;}
    html body.admin-ops #admin-tabs [role=tab]{min-height:46px;gap:.2rem;}
    html body.admin-ops .admin-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
    html body.admin-ops .order-header nav > a:first-child{display:none;}
  }
}
