/* Compact owner workflow affordances; keeps the approved Sales OS theme. */
.dashboard-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, .92fr);
  grid-template-areas: "performance performance attention" "funnel ads attention";
  gap: 15px;
  align-items: stretch;
}
.dashboard-operations-grid > .performance-card { grid-area: performance; }
.dashboard-operations-grid > .attention-card { grid-area: attention; }
.dashboard-operations-grid > .funnel-card { grid-area: funnel; }
.dashboard-operations-grid > .ads-summary-card { grid-area: ads; }
.dashboard-operations-grid > .dash-card { min-width: 0; }
.dashboard-operations-grid .funnel-card,
.dashboard-operations-grid .ads-summary-card { padding: 14px 16px; }
.dashboard-operations-grid .funnel-card .card-heading,
.dashboard-operations-grid .ads-summary-card .card-heading { margin-bottom: 8px; }
.dashboard-operations-grid .funnel-track { padding-top: 7px; }
.dashboard-operations-grid .ads-summary-grid { margin-top: 8px; }
.dashboard-operations-grid .ads-summary-grid > div { gap: 5px; padding: 8px; }
.dashboard-operations-grid .card-footnote { margin-top: 8px; }
.attention-card { min-height: 100%; }

.need-batch-list { display: grid; gap: 8px; }
.need-batch-order { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.need-batch-order-head { display: grid; grid-template-columns: auto minmax(150px,1fr) minmax(230px,1.3fr) auto; align-items: center; gap: 9px; padding: 9px 11px; background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.need-batch-order-head > div:nth-child(2) { display: grid; gap: 4px; }
.need-batch-order-head > div:nth-child(2) > span { color: var(--muted); font-size: 10px; }
.need-batch-payment { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; color: var(--muted); font-size: 10px; }
.need-batch-payment > span:not(.badge) { white-space: nowrap; }
.need-batch-order-select, .need-batch-select, .need-batch-item { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.need-batch-order-select input, .need-batch-select input, .need-batch-item input { width: auto; margin: 0; accent-color: var(--blue); }
.need-batch-groups { display: grid; gap: 7px; padding: 8px; }
.need-batch-group { min-width: 0; padding: 8px 9px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.need-batch-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.need-batch-group-head > div { display: grid; gap: 3px; }
.need-batch-group-head > div strong { color: var(--text); font-size: 11px; }
.need-batch-group-head > div span { color: var(--muted); font-size: 9px; }
.need-batch-details { margin-top: 7px; border-top: 1px solid var(--border); }
.need-batch-details > summary { width: fit-content; padding: 7px 2px 2px; color: var(--muted); cursor: pointer; font-size: 9px; }
.need-batch-details[open] > summary { margin-bottom: 5px; color: var(--text); }
.need-batch-items { display: grid; gap: 6px; margin: 9px 0; }
.need-batch-item { min-height: 32px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.need-batch-item strong { color: var(--text); }
.need-batch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.need-batch-actions select { min-width: min(260px,100%); }
.batch-page-title { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.batch-page-title > div { display: grid; gap: 4px; }
.batch-page-title h2, .batch-page-title p { margin: 0; }
.batch-page-title > button { flex: 0 0 auto; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue); text-align: left; }
.link-button:hover { background: none; text-decoration: underline; }
.report-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.report-warning button { min-height: 28px; padding: 4px 8px; }

.item-modal { width: min(600px, calc(100vw - 24px)); }
#shirt-item-modal-error { min-height: 0; margin: 0; }
.item-master-card { margin-top: 16px; }
.item-master-card .factory-cost-form { grid-template-columns: repeat(3,minmax(140px,1fr)); }
.item-master-card .factory-cost-form label { min-width: 0; }

#drawer-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 0; background: #02071199; pointer-events: auto; }
.side-drawer { position: fixed; inset: 0 0 0 auto; z-index: 1; display: flex; flex-direction: column; width: min(720px, 94vw); color: var(--text); background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -20px 0 50px #0005; pointer-events: auto; animation: drawer-in .18s ease-out; }
.side-drawer-head, .side-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--surface-raised); }
.side-drawer-head { border-bottom: 1px solid var(--border); }
.side-drawer-head h2 { margin: 2px 0 4px; overflow-wrap: anywhere; }
.side-drawer-head p { margin: 3px 0; color: var(--muted); font-size: 10px; }
.side-drawer-body { min-height: 0; flex: 1; overflow: auto; padding: 17px 20px 24px; }
.side-drawer-body h3 { margin: 20px 0 9px; }
.side-drawer-foot { justify-content: flex-end; border-top: 1px solid var(--border); }
.drawer-order-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px; }
.drawer-order-state > span:last-child { margin-left: auto; color: var(--muted); font-size: 10px; }
.drawer-financials { margin: 0; }
.drawer-order-items { display: grid; gap: 8px; }
.drawer-order-item { padding: 11px 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; }
.drawer-order-item header { display: flex; justify-content: space-between; gap: 10px; color: var(--text); font-size: 11px; }
.drawer-order-item header span { color: var(--muted); white-space: nowrap; }
.drawer-order-item p, .drawer-order-item small, .drawer-note { display: block; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.drawer-order-item p strong { color: var(--text); }
@keyframes drawer-in { from { transform: translateX(14px); opacity: .75; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 1100px) {
  .dashboard-operations-grid { grid-template-columns: minmax(0,1fr) minmax(280px,.9fr); grid-template-areas: "performance attention" "funnel attention" "ads attention"; }
  .need-batch-order-head { grid-template-columns: auto minmax(145px,1fr) minmax(200px,1.1fr); }
  .need-batch-order-head > strong { grid-column: 2 / -1; }
}
@media (max-width: 850px) {
  .dashboard-operations-grid { grid-template-columns: minmax(0,1fr); grid-template-areas: "performance" "attention" "funnel" "ads"; }
  .need-batch-order-head { grid-template-columns: 1fr; align-items: start; }
  .need-batch-order-head > strong { grid-column: auto; }
  .batch-page-title { align-items: flex-start; flex-wrap: wrap; }
  .item-master-card .factory-cost-form { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .side-drawer { width: 100vw; }
  .side-drawer-head, .side-drawer-foot { padding: 12px 14px; }
  .side-drawer-body { padding: 13px 14px 20px; }
  .batch-page-title { gap: 8px; }
  .need-batch-actions { align-items: stretch; flex-direction: column; }
  .need-batch-actions select, .need-batch-actions button { width: 100%; }
}
