/* Global application header: one three-zone layout shared by every route. */
body.app-redesign .app-header-wrapper { position: relative; z-index: 20; border-color: var(--color-border); border-bottom: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-background) 94%, transparent); box-shadow: none; backdrop-filter: none; }
/* Eleva el encabezado como contexto para que el desplegable cubra el buscador. */
body.account-filters-open.app-redesign .app-header-wrapper { z-index: 1100; }
/* Eleva el contexto que contiene backdrop y menú por encima del contenido POS. */
body.nav-menu-open.app-redesign .app-header-wrapper { z-index: 1100; }
body.app-redesign .top-bar {
  display: grid;
  grid-template-columns: minmax(13.5rem, 1fr) minmax(15rem, 1.15fr) auto;
  grid-template-areas: "brand context actions";
  align-items: center;
  gap: .85rem;
  min-width: 0;
  padding: .5rem 1rem;
  background: transparent;
}

body.app-redesign .brand-section,
body.app-redesign .app-header-context,
body.app-redesign .top-actions,
body.app-redesign .header-global-tools {
  min-width: 0;
}

body.app-redesign .brand-section { display: flex; align-items: center; gap: .65rem; }
body.app-redesign .brand-logo-emblem { width: 2.65rem; height: 2.65rem; flex: 0 0 2.65rem; }
body.app-redesign .brand-info { min-width: 0; }
body.app-redesign .brand-heading-row { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; }
body.app-redesign .brand-section { grid-area: brand; }
body.app-redesign .brand-logo-svg { width: 38px; height: 38px; }
body.app-redesign .brand-heading-row { gap: .35rem .55rem; }
body.app-redesign .brand-title { display: block; max-width: 100%; font-size: clamp(.95rem, 1.2vw, 1.15rem); line-height: 1.15; white-space: nowrap; }
body.app-redesign .brand-slogan { display: block; padding: 0; border: 0; background: none; color: var(--color-text-muted); font-size: .65rem; line-height: 1.2; white-space: nowrap; }
body.app-redesign .shift-badge-row { display: flex; align-items: center; gap: .4rem; margin-top: .25rem; min-width: 0; }
body.app-redesign .shift-badge { min-height: 1.5rem; padding: .12rem .45rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-secondary); font-size: .7rem; font-weight: 700; }
body.app-redesign .brand-sub-sep { display: none; }
body.app-redesign .sync-dot-tiny { margin-left: .1rem; }
body.app-redesign .sync-status-label { color: var(--color-text-muted); font-size: .7rem; white-space: nowrap; }

body.app-redesign .app-header-context {
  grid-area: context;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 1.9rem;
  margin: 0;
  padding: 0;
}
body.app-redesign .app-header-context-copy { min-width: 0; }
body.app-redesign .app-header-title { margin: 0; color: var(--color-text-primary); font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 850; line-height: 1.2; letter-spacing: -.02em; }
body.app-redesign .app-header-subtitle { margin: .15rem 0 0; color: var(--color-text-muted); font-size: .78rem; line-height: 1.3; }
body.app-redesign .app-header-pos-controls { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: .45rem; min-width: 0; }
body.app-redesign .app-header-pos-controls[hidden] { display: none !important; }
body.app-redesign #openAccountsSummaryIndicator {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  min-width: 0;
  min-height: 1.9rem;
  padding: .25rem .42rem;
  border: 1px solid var(--color-border, #d8e0e7);
  border-radius: 9px;
  background: var(--color-surface-raised, #f8fafc);
  color: var(--color-text-secondary, #536371);
  font-size: .64rem;
  line-height: 1.15;
  white-space: nowrap;
}
body.app-redesign #openAccountsSummaryIndicator .indicator-dot,
body.app-redesign #openAccountsSummaryIndicator .indicator-divider { display: none; }
body.app-redesign #openAccountsSummaryIndicator .summary-pill-item { display: inline-flex; gap: .22rem; align-items: baseline; }
body.app-redesign #openAccountsSummaryIndicator { border: 0; background: transparent; cursor: default; }
@media (min-width: 521px) and (max-width: 1040px) {
  body.app-redesign .account-filters-popover { left: auto; right: 0; }
}

body.app-redesign .top-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
body.app-redesign .header-global-tools { display: flex; align-items: center; gap: .45rem; }
body.app-redesign .auth-user-profile-trigger { min-height: 2.75rem; padding: .25rem .5rem; border-radius: var(--radius-md); }
body.app-redesign .top-shift-widget.sales-history-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: .2rem .58rem;
  border: 1px solid var(--color-border, #d8e0e7);
  border-radius: 9px;
  background: var(--color-surface-raised, #f8fafc);
  cursor: pointer;
}
body.app-redesign .top-shift-widget .widget-pod { display: grid; gap: .08rem; padding: 0; }
body.app-redesign .top-shift-widget .pod-lbl { color: var(--color-text-muted); font-size: .53rem; font-weight: 750; line-height: 1; letter-spacing: .06em; }
body.app-redesign .top-shift-widget .pod-val { color: var(--color-accent); font-size: .86rem; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; }
body.app-redesign .top-shift-widget .btn-recent-orders { min-width: 1.45rem; width: 1.45rem; height: 1.45rem; margin-left: .3rem; padding: 0; border-radius: 6px; color: var(--color-text-muted, #71808c); font-size: .82rem; }
body.app-redesign .pos-accounts-heading-row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; min-width:0; }
body.app-redesign .pos-accounts-heading-row .pos-desktop-zone-title { min-width:0; margin:0; }
body.app-redesign .pos-actions-bar { display:flex; flex:0 0 auto; align-items:center; justify-content:flex-end; gap:.4rem; min-width:0; }
body.app-redesign .pos-actions-bar .header-orders-trigger { min-height:2.25rem; }
body.app-redesign .pos-actions-bar .btn-new-account-inline { min-height:2.25rem !important; height:2.25rem !important; }
body.app-redesign[data-active-tab="pos"] #tab-pos .pos-accounts-heading-row .pos-desktop-zone-title { margin:0; }
@media (min-width: 768px) {
  body.app-redesign[data-active-tab="pos"] #tab-pos .pos-accounts-heading-row {
    box-sizing:border-box; flex:0 0 42px; align-items:center; min-height:42px; height:42px;
    margin:0 0 12px; padding:0 0 8px; border-bottom:1px solid var(--color-border);
  }
}
body.app-redesign .pos-recent-orders-link {
  display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; gap:.4rem;
  min-width:44px; min-height:44px; margin:-.35rem -.45rem -.35rem 0; padding:.45rem;
  border:0; border-radius:8px; background:transparent; box-shadow:none;
  color:var(--color-text-muted,#71808c); font:inherit; font-size:.76rem; font-weight:700;
  line-height:1.2; text-align:right; cursor:pointer; -webkit-tap-highlight-color:transparent;
}
body.app-redesign .pos-recent-orders-link svg { width:1rem; height:1rem; flex:0 0 1rem; }
body.app-redesign .pos-recent-orders-link:hover { color:var(--color-accent,#d59a38); background:color-mix(in srgb,var(--color-accent,#d59a38) 8%,transparent); }
body.app-redesign .pos-recent-orders-link:focus-visible { color:var(--color-accent,#d59a38); outline:2px solid var(--color-focus,#d59a38); outline-offset:2px; }
body.app-redesign .pos-recent-orders-link[aria-expanded="true"] { color:var(--color-accent,#d59a38); }
body.app-redesign .pos-recent-orders-link[hidden] { display:none !important; }
body.app-redesign .pos-recent-orders-chevron { width:.75rem !important; height:.75rem !important; flex-basis:.75rem !important; transition:transform .16s ease; }
body.app-redesign .pos-recent-orders-link[aria-expanded="true"] .pos-recent-orders-chevron { transform:rotate(180deg); }
body.app-redesign #tab-pos .recent-orders-panel {
  display:flex; flex:0 0 auto; flex-direction:column; width:100%; min-width:0; min-height:0;
  margin:0 0 .2rem; overflow:hidden; border:1px solid var(--color-border,#35404a);
  border-radius:10px; background:var(--color-surface,#20262c); color:var(--color-text-primary,#f7f3ec);
}
body.app-redesign #tab-pos .recent-orders-panel[hidden] { display:none !important; }
body.app-redesign #tab-pos .recent-orders-panel-header {
  display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:.5rem;
  min-width:0; padding:.55rem .65rem; border-bottom:1px solid var(--color-border,#35404a);
}
body.app-redesign #tab-pos .recent-orders-panel-header h3 { margin:0; font-size:.74rem; font-weight:800; }
body.app-redesign #tab-pos .recent-orders-panel-header p { margin:.12rem 0 0; color:var(--color-text-muted,#8f9ba5); font-size:.61rem; }
body.app-redesign #tab-pos .recent-orders-panel-collapse {
  display:grid; flex:0 0 36px; place-items:center; width:36px; min-width:36px; height:36px;
  padding:0; border:0; border-radius:7px; background:transparent; color:var(--color-text-muted,#8f9ba5);
  font:inherit; font-size:1.1rem; cursor:pointer;
}
body.app-redesign #tab-pos .recent-orders-panel-collapse:hover,
body.app-redesign #tab-pos .recent-orders-panel-collapse:focus-visible { color:var(--color-accent,#d59a38); outline:2px solid var(--color-focus,#d59a38); outline-offset:1px; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-content {
  display:flex; flex:0 1 auto; flex-direction:column; gap:0; max-height:min(34vh,260px); min-height:0;
  padding:0 .65rem; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;
}
body.app-redesign #tab-pos .recent-orders-panel .recent-order-row {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.5rem;
  min-width:0; padding:.55rem 0; border:0; border-bottom:1px solid color-mix(in srgb,var(--color-border,#35404a) 75%,transparent);
  border-radius:0; background:transparent;
}
body.app-redesign #tab-pos .recent-orders-panel .recent-order-main { min-width:0; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-heading { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem .35rem; min-width:0; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-heading strong { min-width:0; overflow-wrap:anywhere; font-size:.68rem; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-status,
body.app-redesign #tab-pos .recent-orders-panel .recent-order-mode { display:inline-flex; align-items:center; min-height:18px; padding:.08rem .32rem; border-radius:999px; background:color-mix(in srgb,var(--color-accent,#d59a38) 12%,transparent); color:var(--color-accent,#d59a38); font-size:.55rem; font-weight:750; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-mode { background:color-mix(in srgb,var(--color-text-muted,#8f9ba5) 12%,transparent); color:var(--color-text-secondary,#cbd5dc); }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-items { display:-webkit-box; margin-top:.18rem; overflow:hidden; color:var(--color-text-muted,#8f9ba5); font-size:.61rem; line-height:1.3; overflow-wrap:anywhere; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-meta { display:flex; align-items:center; flex-wrap:wrap; gap:.2rem .55rem; margin-top:.22rem; color:var(--color-text-muted,#8f9ba5); font-size:.58rem; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-meta strong { margin-left:auto; color:var(--color-text-primary,#f3b65d); font-size:.68rem; white-space:nowrap; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-restore { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; gap:.2rem; min-width:76px; min-height:42px; padding:.35rem .45rem; border:0; border-radius:7px; background:transparent; color:var(--color-accent,#d59a38); font-size:.65rem; white-space:nowrap; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-restore:hover,
body.app-redesign #tab-pos .recent-orders-panel .recent-order-restore:focus-visible { background:color-mix(in srgb,var(--color-accent,#d59a38) 10%,transparent); outline:2px solid var(--color-focus,#d59a38); outline-offset:1px; }
body.app-redesign #tab-pos .recent-orders-panel .recent-order-error { margin:.25rem 0 0; color:#ffab98; font-size:.61rem; line-height:1.3; overflow-wrap:anywhere; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-empty { justify-items:start; padding:1rem .1rem; text-align:left; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-empty-icon { display:none; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-pagination { flex:0 0 auto; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:.3rem; padding:.4rem .65rem; border-top:1px solid var(--color-border,#35404a); }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-page-btn { min-width:0; min-height:38px; padding:.3rem; font-size:.58rem; white-space:normal; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-page-label { font-size:.59rem; }
body.app-redesign #tab-pos .recent-orders-panel .recent-orders-footer { display:flex; flex:0 0 auto; padding:.2rem .65rem .55rem; }
body.app-redesign #tab-pos .recent-orders-panel .btn-recent-history { min-height:36px; padding:.3rem .45rem; border:0; background:transparent; color:var(--color-accent,#d59a38); font-size:.64rem; text-align:left; }
body.app-redesign #tab-pos .recent-orders-panel .btn-recent-history:hover,
body.app-redesign #tab-pos .recent-orders-panel .btn-recent-history:focus-visible { text-decoration:underline; outline:2px solid var(--color-focus,#d59a38); outline-offset:1px; }
body:not(.dark-mode).app-redesign #tab-pos .recent-orders-panel { background:var(--color-surface,#fff); }
body:not(.dark-mode).app-redesign #tab-pos .recent-orders-panel .recent-order-heading strong { color:var(--color-text-primary,#17202a); }
body:not(.dark-mode).app-redesign #tab-pos .recent-orders-panel .recent-order-mode { color:var(--color-text-secondary,#536371); }
body:not(.dark-mode).app-redesign #tab-pos .recent-orders-panel .recent-order-meta strong { color:#8a4d06; }
@media (max-width:520px) {
  body.app-redesign #tab-pos .recent-orders-panel .recent-order-row { grid-template-columns:minmax(0,1fr) auto; }
  body.app-redesign #tab-pos .recent-orders-panel .recent-orders-pagination { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
}
body.app-redesign .header-orders-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-width: 0;
  min-height: 2.25rem;
  padding: .28rem .62rem;
  border: 1px solid var(--color-border, #d8e0e7);
  border-radius: 9px;
  background: var(--color-surface-raised, #f8fafc);
  color: var(--color-text-primary, #344451);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
body.app-redesign .header-orders-trigger .header-orders-list { width: 1rem; height: 1rem; }
body.app-redesign .header-orders-trigger.has-pending-attention { border-color: #d88b7f; color: #a93629; }
body.app-redesign #headerPrimaryAction[hidden] { display: none !important; }
body.orders-popover-open.app-redesign .pos-actions-bar { z-index: 1100; }
body.app-redesign .pos-actions-bar .header-orders-popover { top: calc(100% + .5rem) !important; }
/* Open orders popover uses the viewport-wide header as its positioning anchor.
   The trigger itself can sit well inside the viewport, so anchoring a 580px
   panel to that narrow control can push the panel past the left edge. */
body.app-redesign.orders-popover-open .pos-actions-bar { position: static !important; }
body.app-redesign.orders-popover-open .header-orders-popover {
  position: absolute !important;
  top: calc(100% + .5rem) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  left: auto !important;
  width: min(580px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box;
}
body.app-redesign .header-orders-popover .service-status-filters[hidden],
body.app-redesign .header-orders-popover .service-refresh-btn[hidden] { display: none !important; }
body.app-redesign .header-orders-popover .service-empty {
  display: flex;
  justify-content: center;
  min-height: 3.3rem;
  padding: .75rem;
}
body.app-redesign .header-orders-popover .service-empty strong { font-size: .76rem; }

/* El control de pedidos vive en el flujo del POS, encima de las cuentas. */
body.app-redesign #tab-pos .pos-orders-disclosure {
  position: relative; inset: auto; z-index: auto; display: grid; gap: .6rem;
  width: 100%; max-width: none; max-height: none; margin: 0 0 1.5rem; padding: .7rem;
  overflow: visible; box-sizing: border-box; container: orders-disclosure / inline-size;
}
body.app-redesign #tab-pos .pos-orders-disclosure[hidden] { display: none !important; }
body.app-redesign #tab-pos .pos-orders-disclosure .header-orders-popover-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0;
}
body.app-redesign #tab-pos .pos-orders-disclosure .header-orders-popover-head > div { min-width: 0; }
body.app-redesign #tab-pos .pos-orders-disclosure .header-orders-popover-head strong { color: var(--color-text-primary, #f7f3ec); font-size: .88rem; }
body.app-redesign #tab-pos .pos-orders-disclosure .service-refresh-btn {
  flex: 0 0 auto; width: auto; min-width: 0; min-height: 2.75rem; padding: .4rem .7rem; border: 1px solid var(--color-border, #35404a);
  border-radius: 8px; background: var(--color-surface-raised, #20262c); color: var(--color-text-secondary, #aeb9c2);
  box-shadow: none; font: inherit; font-size: .72rem; font-weight: 750; line-height: 1.2; white-space: nowrap; cursor: pointer;
}
body.app-redesign #tab-pos .pos-orders-disclosure .service-refresh-btn:hover,
body.app-redesign #tab-pos .pos-orders-disclosure .service-refresh-btn:focus-visible { border-color: var(--color-accent, #df5b47); color: var(--color-text-primary, #f7f3ec); }
body.app-redesign #tab-pos .pos-orders-disclosure .account-filters-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(2.75rem, auto);
  gap: .4rem; min-width: 0;
}
body.app-redesign #tab-pos .pos-orders-disclosure .account-filter-btn {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); min-width: 0; min-height: 2.75rem;
  align-items: center; justify-content: initial; gap: 6px; padding: .4rem .5rem; white-space: normal;
  text-align: left; line-height: 1.2; overflow: visible;
}
body.app-redesign #tab-pos .pos-orders-disclosure .account-filter-btn strong {
  width: max-content; min-width: 1.45rem; min-height: 1.45rem; padding: 0 .3rem; box-sizing: border-box;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
body.app-redesign #tab-pos .pos-orders-disclosure .account-filter-btn span {
  min-width: 0; overflow: visible; white-space: normal; overflow-wrap: break-word; text-overflow: clip;
}
body.app-redesign #tab-pos .pos-orders-disclosure .account-filter-btn:last-child { grid-column: auto; }
body.app-redesign #tab-pos .account-chip-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
body.app-redesign #tab-pos .account-chip-actions button {
  min-height: 1.8rem; padding: .25rem .5rem; border: 1px solid var(--color-border); border-radius: 7px;
  background: var(--color-surface-raised); color: var(--color-text-secondary); font-size: .65rem; font-weight: 750;
}
body.app-redesign #tab-pos .account-chip-actions button:last-child:not(:first-child) { color: var(--color-accent); }
body.app-redesign #headerPrimaryAction.btn-new-account-inline {
  min-height: 2.25rem !important;
  height: 2.25rem !important;
  padding: .3rem .7rem !important;
  font-size: .7rem !important;
}

@media (max-width: 1040px) {
  body.app-redesign .top-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "context context"; }
  body.app-redesign .app-header-context { grid-column: auto; grid-row: auto; justify-content: flex-start; }
  body.app-redesign .top-actions { grid-column: auto; grid-row: auto; }
}

@media (max-width: 720px) {
  body.app-redesign .top-bar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "context" "actions"; gap: .45rem; padding: .5rem .7rem; }
  body.app-redesign .app-header-context { grid-column: auto; grid-row: auto; justify-content: space-between; }
  body.app-redesign .top-actions { grid-column: auto; grid-row: auto; justify-content: space-between; }
  body.app-redesign .header-global-tools { flex: 1 1 auto; justify-content: flex-start; }
  body.app-redesign .brand-section { gap: .45rem; }
  body.app-redesign .brand-logo-emblem { width: 2.25rem; height: 2.25rem; flex-basis: 2.25rem; }
  body.app-redesign .brand-title { font-size: .88rem; }
  body.app-redesign .brand-slogan { font-size: .56rem; }
  body.app-redesign .shift-badge-row { flex-wrap: wrap; gap: .2rem .3rem; margin-top: .18rem; }
  body.app-redesign .shift-badge { min-height: 1.35rem; padding: .08rem .35rem; font-size: .64rem; }
  body.app-redesign .sync-status-label { font-size: .64rem; }
  body.app-redesign #authUserControl { display: none !important; }
  body.app-redesign .auth-user-profile-trigger { min-height: 2.35rem; padding: .15rem; }
  body.app-redesign .auth-user-name, body.app-redesign .auth-user-role { display: none; }
  body.app-redesign .app-header-context { align-items: flex-start; flex-wrap: wrap; gap: .45rem .65rem; }
  body.app-redesign .app-header-title { font-size: 1rem; }
  body.app-redesign .app-header-pos-controls { max-width: 100%; flex-wrap: wrap; }
  body.app-redesign .pos-actions-bar .btn-new-account-inline { min-height: 2.25rem !important; height: 2.25rem !important; padding-inline: .5rem; font-size: .75rem; }
  body.app-redesign .top-shift-widget.sales-history-toggle { min-height: 2rem; }
  body.app-redesign .header-orders-trigger { min-height: 2rem; padding-inline: .48rem; }
  body.app-redesign .pos-actions-bar #headerPrimaryAction.btn-new-account-inline { min-height: 2rem !important; height: 2rem !important; }
}

@media (max-width: 440px) {
  body.app-redesign .brand-title { font-size: .92rem; }
  body.app-redesign .brand-slogan { display: none; }
  body.app-redesign .app-header-title { font-size: .74rem; }
  body.app-redesign #openAccountsSummaryIndicator { gap: .2rem; padding-inline: .3rem; font-size: .56rem; }
  body.app-redesign .btn-recent-orders { min-width: 1.25rem; }
  body.app-redesign .header-orders-trigger { gap: .25rem; font-size: .65rem; }
  body.app-redesign .top-shift-widget .pod-val { font-size: .78rem; }
}

/* Gastos keeps the shift context but leaves the POS-only order actions out. */
body.app-redesign .mobile-orders-controls[hidden],
body.app-redesign #headerPrimaryAction[hidden] { display: none !important; }
body.app-redesign .sales-history-toggle--expenses .btn-recent-orders { display: none !important; }
body.app-redesign .sales-history-toggle--expenses { cursor: default; }
@media (max-width: 720px) {
  body.app-redesign .sales-history-toggle--expenses { flex: 0 1 auto; min-width: 0; padding-inline: .5rem; }
  body.app-redesign .sales-history-toggle--expenses .widget-pod { gap: .12rem; }
  body.app-redesign .sales-history-toggle--expenses .pod-lbl { font-size: .5rem; }
  body.app-redesign .sales-history-toggle--expenses .pod-val { font-size: .78rem; white-space: nowrap; }
  body.app-redesign #appHeaderContext[data-context-tab="expenses"] { justify-content: flex-start; }
}
.pos-employee-attending { position: relative; min-width: 0; max-width: 100%; }
.pos-employee-attending > span { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .35rem; max-width: 100%; min-width: 0; padding: .42rem .62rem; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-main); background: var(--bg-card); font-size: .75rem; line-height: 1.25; overflow-wrap: anywhere; }
.pos-employee-attending > span strong { min-width: 0; color: var(--accent-coral, #fb7185); overflow-wrap: anywhere; }
@media (max-width: 600px) { .pos-employee-attending { max-width: 100%; } .pos-employee-attending > span { padding: .38rem .5rem; font-size: .68rem; } }

/* Keep the POS title, actor and account indicators readable at tablet widths. */
@media (min-width: 601px) and (max-width: 1099px) {
  body.app-redesign .top-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "context context"; row-gap: .45rem; }
  body.app-redesign .app-header-context { justify-content: flex-start; flex-wrap: wrap; }
  body.app-redesign .app-header-context-copy { flex: 0 1 auto; }
  body.app-redesign .app-header-pos-controls { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; }
  body.app-redesign .pos-employee-attending { flex: 0 1 auto; }
  body.app-redesign #openAccountsSummaryIndicator { max-width: 100%; white-space: normal; }
}
@media (min-width: 1100px) and (max-width: 1299px) {
  body.app-redesign .top-bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "context context"; row-gap: .45rem; }
  body.app-redesign .app-header-context { justify-content: flex-start; flex-wrap: wrap; }
  body.app-redesign .app-header-context-copy { flex: 1 1 100%; }
  body.app-redesign .app-header-pos-controls { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; }
  body.app-redesign #openAccountsSummaryIndicator { max-width: 100%; white-space: normal; }
}
@media (min-width: 1300px) {
  body.app-redesign:has(#tab-pos.active) .app-header-context { flex-wrap: wrap; justify-content: center; }
  body.app-redesign:has(#tab-pos.active) .app-header-context-copy { flex: 1 1 100%; text-align: center; }
  body.app-redesign:has(#tab-pos.active) .app-header-pos-controls { flex: 1 1 100%; flex-wrap: wrap; justify-content: center; }
  body.app-redesign:has(#tab-pos.active) .pos-employee-attending { max-width: 100%; }
  body.app-redesign:has(#tab-pos.active) #openAccountsSummaryIndicator { max-width: 100%; white-space: normal; }
}
@media (max-width: 600px) {
  body.app-redesign .app-header-context { align-items: flex-start; flex-direction: column; gap: .35rem; }
  body.app-redesign .app-header-context-copy, body.app-redesign .app-header-pos-controls { width: 100%; }
  body.app-redesign .app-header-pos-controls { flex-wrap: wrap; justify-content: flex-start; }
  body.app-redesign .app-header-title { white-space: normal; overflow-wrap: anywhere; }
}

@media (min-width: 1100px) {
  body.app-redesign[data-active-tab="pos"] #tab-pos .pos-unified-search { z-index: 50; }
  body.app-redesign[data-active-tab="pos"] #tab-pos .pos-unified-search-results { z-index: 120; }
}

/* Center the account context on its own full-width row, independent of the
   brand on the left and daily-sales/profile controls on the right. */
body.app-redesign .top-bar {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand . actions" "context context context";
  row-gap: .45rem;
}
body.app-redesign .app-header-context {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  text-align: center;
}
body.app-redesign .app-header-context-copy {
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  text-align: center;
}
body.app-redesign .app-header-title { text-align: center; }
body.app-redesign .app-header-pos-controls {
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
body.app-redesign #openAccountsSummaryIndicator {
  max-width: 100%;
  justify-content: center;
  white-space: normal;
}

/* Give today's sales its own readable card and let large totals contract at
   smaller widths without forcing the header off-screen. */
body.app-redesign .top-shift-widget.sales-history-toggle {
  box-sizing: border-box;
  min-width: min(11.5rem, 100%);
  min-height: 3.35rem;
  padding: .42rem .82rem;
}
body.app-redesign .top-shift-widget .widget-pod { min-width: 0; gap: .2rem; }
body.app-redesign .top-shift-widget .pod-lbl {
  color: var(--color-text-secondary, #536371);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .015em;
}
body.app-redesign .top-shift-widget .pod-val {
  max-width: 100%;
  color: var(--color-accent);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  body.app-redesign .top-bar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "context" "actions";
  }
  body.app-redesign .app-header-context { align-items: center; }
  body.app-redesign .app-header-pos-controls { justify-content: center; }
  body.app-redesign .top-actions { min-width: 0; }
  body.app-redesign .header-global-tools { min-width: 0; }
  body.app-redesign .top-shift-widget.sales-history-toggle { min-width: min(11.5rem, 100%); }
}
@media (max-width: 440px) {
  body.app-redesign .app-header-title { font-size: 1rem; }
  body.app-redesign .top-shift-widget .pod-val { font-size: clamp(.96rem, 4.2vw, 1.15rem); }
}
