/* Role screens: login, user block, owner overview, dispatch queue, production floor, admin. */
[hidden] { display: none !important; }

/* ---------- login / change password ---------- */
.auth { min-height: 100vh; display: grid; place-items: start center; padding: 12vh var(--space-md) var(--space-2xl); }
.auth-box { width: min(380px, 100%); display: grid; gap: var(--space-lg); }
.auth-box .brand { padding: 0; }
.auth-form { display: grid; gap: var(--space-md); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: var(--space-lg); }
.auth-form .sub { color: var(--ink-2); font-size: var(--text-sm); }
.auth-form .hint { font-size: var(--text-xs); color: var(--ink-3); }
.auth-form input { min-height: 44px; }
.auth-alt { margin-top: calc(-1 * var(--space-xs)); }

/* ---------- user block in the sidebar ---------- */
.who { display: grid; gap: 0; padding: var(--space-sm) var(--space-xs) 0; border-top: 1px solid var(--rule); font-size: var(--text-sm); }
.who-name { font-weight: 700; color: var(--ink); }
.who-role { font-size: var(--text-xs); color: var(--ink-3); }
.who-acts { display: flex; flex-wrap: wrap; gap: 0; margin: var(--space-2xs) 0 0 -8px; }
.who-acts .btn { font-size: var(--text-xs); }

/* ---------- big touch targets (tablet, phone) ---------- */
.btn.big { min-height: 48px; padding: 12px 20px; font-size: var(--text-md); justify-content: center; }
.btn.wide { width: 100%; }
input.big, select.big { min-height: 48px; font-size: var(--text-lg); }
.seg.big { display: flex; }
.seg.big label { flex: 1; min-height: 44px; display: grid; place-items: center; font-size: var(--text-md); }

/* ---------- owner overview ---------- */
.ov-lead { display: flex; gap: var(--space-md); align-items: baseline; margin-bottom: var(--space-md); max-width: 60ch; color: var(--ink-2); }
.ov-lead b { font-family: var(--font-display); font-size: 3.5rem; line-height: 1; }
.ov-lead .short-big { color: var(--bad); }
.ov-lead .ok-big { color: var(--ok); }
.od-figs .od-note { grid-column: 1 / -1; }
.od-figs .od-note b { font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
.od-figs div > span:last-child:not(:first-child) { font-size: var(--text-xs); color: var(--ink-2); }

/* ---------- dispatch queue (phone first) ---------- */
.dq-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); align-items: end; max-width: 34rem; }
.dq-bar .field { gap: 2px; }
.dq-bar .label { font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); }
.dq-bar input, .dq-bar select { min-height: 44px; width: 100%; }
.dq-when { grid-column: 1 / -1; }
.dq-when button { flex: 1; min-height: 44px; font-size: var(--text-md); }
.dq-collect input { min-height: 44px; }
.dq-zone { margin-top: var(--space-lg); }
.dq-zone > h2 { margin-bottom: var(--space-xs); display: flex; gap: var(--space-xs); align-items: baseline; }
.dq-zone > h2 .muted { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; }
.dq-orders { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
.dq-order {
  font: inherit; color: inherit; text-align: left; width: 100%; min-height: 48px; cursor: pointer;
  display: grid; gap: 2px; padding: var(--space-sm) var(--space-md);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
}
.dq-order:hover { border-color: var(--ink-3); }
.dq-order[aria-expanded="true"] { border-color: var(--brand); background: var(--paper-2); }
.dq-scan { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: var(--space-xs); }
.dq-top { display: flex; justify-content: space-between; gap: var(--space-sm); }
.dq-party { font-weight: 600; }
.dq-items { display: grid; gap: 0; font-size: var(--text-sm); }
.dq-contact { margin: var(--space-xs) 0 0; font-size: var(--text-sm); }
.dq-contact a { font-weight: 600; }
.dq-host .dispatch { margin-top: var(--space-xs); padding: var(--space-md); }
.dq-host .dispatch input, .dq-host .dispatch select { min-height: 44px; }
.dq-host .dispatch .btn { min-height: 44px; }

/* ---------- production floor (phone): search, short list, inline record form ---------- */
.pf-search { position: sticky; top: var(--floor-hdr, 56px); z-index: 20; background: var(--paper); padding: var(--space-xs) 0; }
.pf-list { list-style: none; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); }
.pf-list .empty { padding: var(--space-md); }
.pf-item + .pf-item { border-top: 1px solid var(--rule-soft); }
.pf-row {
  font: inherit; color: inherit; width: 100%; min-height: 56px; padding: var(--space-xs) var(--space-md); text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); align-items: center;
  background: transparent; border: 0; cursor: pointer; scroll-margin-top: calc(var(--floor-hdr, 56px) + 72px);
}
.pf-row:hover { background: var(--paper); }
.pf-row[aria-expanded="true"], .pf-item.done .pf-row { background: var(--paper-3); }
.pf-name .pname { font-size: var(--text-md); }
.pf-name .pname .name-hi { font-size: var(--text-lg); }
.pf-avail { display: grid; justify-items: end; text-align: right; }
.pf-avail .n { font-family: var(--font-display); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.pf-sub { display: block; font-size: var(--text-xs); }
.pf-avail .short-by { font-size: var(--text-xs); font-weight: 700; }
.short-by { color: var(--bad); }
.pf-host:empty { display: none; }
.pf-form { display: grid; gap: var(--space-md); padding: var(--space-md); background: var(--paper-2); border-top: 1px solid var(--rule-soft); }
.pf-form .label { font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); }
.pf-more { margin: var(--space-sm) 0 0; font-size: var(--text-sm); }

/* ---------- admin ---------- */
.otp { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-size: var(--text-lg); font-weight: 600;
  letter-spacing: 0.08em; padding: var(--space-xs) var(--space-sm); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius); user-select: all; }
td input.num { width: 7rem; }
#pm-table td input.num { width: 4.5rem; } /* plan master: seven weekday boxes in a row */
#r-filter { max-width: 24rem; }

@media (max-width: 860px) {
  /* One row: brand and user. The menu and the theme switcher are in the menu dialog (issue 561, nav-phone.css). */
  .sidebar { flex-wrap: wrap; row-gap: var(--space-2xs); overflow: visible; }
  .who { order: 2; margin-left: auto; border-top: 0; padding: 0; display: flex; gap: var(--space-xs); align-items: center; }
  .who-name, .who-role { font-size: var(--text-xs); white-space: nowrap; }
  .who-acts { margin: 0; flex-wrap: nowrap; }
  .who-acts #who-pw { display: none; }
  .app.nav-open .who-acts #who-pw { display: inline-flex; } /* the menu dialog has room: office roles change the password here */
  /* Dispatch panel on a phone: the Send now column must fit without a side scroll. */
  .dq-host .ledger td .pname { min-width: 0; }
  .dq-host .ledger th, .dq-host .ledger td { padding: 8px 6px; }
  .dq-host .ledger input.num { width: 4.5rem; }
}

/* Admin form: select and input share one height. */
#u-form input, #u-form select { height: 40px; }
.od-figs + .hint { margin-top: var(--space-sm); }
.dq-tabs { display: flex; gap: var(--space-2xs); margin-bottom: var(--space-sm); }
.dq-tabs a { flex: 1; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-weight: 600; text-decoration: none; }
.dq-tabs a[aria-current="page"] { background: var(--paper-3); color: var(--ink); border-color: var(--brand); }
.tc-order { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-sm) var(--space-md); }

/* ---------- language toggle and Hindi names ---------- */
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.lang-toggle { font-size: var(--text-sm); white-space: nowrap; }
.lang-toggle .on { font-weight: 800; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pname.hi { display: inline-grid; gap: 0; }
.pname .name-hi { font-weight: 600; color: var(--ink); }
.pname .name-en { font-size: var(--text-xs); color: var(--ink-3); }
html[lang="hi"] body { line-height: 1.6; } /* Devanagari matras need more room above and below. */
/* Sent list: long Hindi item names wrap to a full row on a phone, not into a thin column. */
.log li.dq-sent { flex-wrap: wrap; }
.log li.dq-sent .dq-sent-items { flex: 1 1 12rem; text-align: right; }
.log li.dq-sent .dq-sent-when { flex: 1 0 100%; }

/* Owner: show or hide items on the website (#75) */
.wi-list { list-style: none; margin: 0; padding: 0; }
.wi-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--rule); }
.wi-row[hidden] { display: none; }
.wi-label { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.wi-label input { width: 22px; height: 22px; }

/* ---------- floor shell (production, dispatch): one compact header row, no nav row, no season strip ---------- */
.app.floor { --floor-hdr: 56px; }
.app.floor .sidebar .foot { display: none; } /* issue 561: floor roles keep the menu */
.app.floor .sidebar { min-height: var(--floor-hdr); }
.app.floor .who-acts .btn, .who-menu summary { min-height: 44px; }
.who-menu { position: relative; }
.who-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; min-width: 44px; font-size: var(--text-lg); font-weight: 800; color: var(--ink-2); }
.who-menu summary::-webkit-details-marker { display: none; }
.who-pop {
  position: absolute; right: 0; top: 100%; z-index: 40; min-width: 13rem; display: grid; gap: var(--space-2xs);
  padding: var(--space-sm); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
}
.who-menu .who-name, .who-menu .who-role { white-space: normal; font-size: var(--text-sm); }
.app.floor .who-acts #who-pw { display: inline-flex; }
@media (max-width: 860px) {
  .app.floor .who-name, .app.floor .who-role { display: none; }
  .app.floor .who-menu .who-name, .app.floor .who-menu .who-role { display: block; }
  .app.floor main { padding-top: var(--space-xs); }
  .app.floor .page-head { margin-bottom: var(--space-xs); }
}
.wi-photo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-basis: 100%; }
.wi-row:has(.wi-photo) { flex-wrap: wrap; }
.wi-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.wi-up { cursor: pointer; }
.wi-up:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
/* Special orders: each row stacks its parts so the checklist never lies over the next row on a phone. */
.log.sp-list > li { flex-direction: column; align-items: stretch; justify-content: flex-start; }
.sp-list .sp-host { width: 100%; }
