/* ============================================================================
   cook/portal.css — portal-only styling.

   Written mobile-first in intent: bigger targets than the customer app, higher
   contrast, and the primary action always a filled button rather than a link.
   A cook uses this standing up, in a kitchen, often one-handed.
   ========================================================================== */

body.portal { background: var(--bg-light); }

.portal-sidebar .brand-logo { margin-bottom: 16px; }
.portal-kitchen {
  background: var(--surface-sunken); border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 16px;
}
.pk-name { font-size: 15px; font-weight: 800; line-height: 1.25; }
.pk-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pk-flag {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  font-size: 11.5px; font-weight: 700; border-radius: var(--radius-pill); padding: 4px 9px;
}
.pk-flag .ic { width: 12px; height: 12px; }
.pk-flag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pk-flag.warn { background: var(--warn-bg); color: var(--warn-fg); }

.portal-header { align-items: center; }
.portal-title h1 { font-size: 20px; font-weight: 700; line-height: 1.2; }
.portal-title p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.portal-body { padding: 22px 24px 96px; max-width: 1080px; }

.portal-section {
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px;
}
.portal-section.urgent { border-color: #E9C46A; background: #FFFDF5; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 16px; font-weight: 700; }
.section-head p { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.portal-empty { font-size: 13.5px; color: var(--text-muted); padding: 6px 0; }
.portal-section .order-card { margin-bottom: 12px; }
.portal-section .order-card:last-of-type { margin-bottom: 0; }
.portal-banner { margin-bottom: 18px; align-items: center; }
.portal-banner .btn-black { margin-left: auto; flex: none; }
.code-inline {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 700;
  background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 4px 9px;
}

/* Cook list — the numbers a cook actually reads off. */
.prep-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.prep-list li {
  display: flex; align-items: center; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--border-color);
}
.prep-list li:last-child { border-bottom: none; }
.prep-qty {
  min-width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--dark-black); color: #FFF; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; flex: none;
}
.prep-name { font-size: 15px; font-weight: 600; }

.portal-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-n { opacity: .6; font-weight: 800; }

/* Menu rows */
.menu-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.menu-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 14px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color);
}
.menu-row:last-child { border-bottom: none; }
.menu-row.is-out { opacity: .55; }
.menu-thumb { width: 56px; height: 56px; border-radius: var(--radius-md); overflow: hidden;
  background: var(--surface-sunken); flex: none; }
.menu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-name { font-size: 14.5px; font-weight: 700; }
.menu-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.menu-allergens { font-size: 11.5px; color: var(--warn-fg); margin-top: 3px; font-weight: 600; }
.menu-allergens.ok { color: var(--ok-fg); }
.menu-price { text-align: right; font-size: 15px; font-weight: 800; }
.menu-price-note { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.menu-actions { display: flex; align-items: center; gap: 6px; }

/* Schedule */
.sched-list { display: flex; flex-direction: column; gap: 8px; }
.sched-day {
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--surface); overflow: hidden;
}
.sched-day.is-closed { background: var(--surface-sunken); }
.sched-day.is-past { opacity: .6; }
.sched-day summary {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 14px;
  align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; min-height: 56px;
}
.sched-day summary::-webkit-details-marker { display: none; }
.sched-date { font-size: 14px; }
.sched-window, .sched-state, .sched-cut { font-size: 12.5px; color: var(--text-muted); }
.sched-state { font-weight: 700; color: var(--text-dark); }
.sched-body { padding: 4px 16px 16px; border-top: 1px solid var(--border-color); }
.sched-items { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 14px; }
.sched-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px; gap: 12px;
  align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border-color);
}
.sched-item:last-child { border-bottom: none; }
.sched-item-name { font-size: 14px; font-weight: 600; }
.sched-item-price { font-size: 13.5px; font-weight: 700; text-align: right; }
.sched-qty input {
  width: 100%; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 700; text-align: center;
  min-height: 44px;
}

/* My page */
.handle-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-sunken); border-radius: var(--radius-md); padding: 12px 14px;
}
.handle-url {
  font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; font-weight: 700;
  flex: 1; min-width: 200px;
}
.upload-box {
  display: flex; align-items: center; gap: 12px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md); padding: 16px; font-size: 13.5px; color: var(--text-muted);
}
.upload-box .btn-black { margin-left: auto; }
.tier-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.tier-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border-color); font-size: 14px;
}
.tier-row:last-child { border-bottom: none; }
.portal-save {
  position: sticky; bottom: 0; background: var(--bg-light);
  padding: 14px 0; display: flex; justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

/* Earnings */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 18px;
}
.stat-icon { color: var(--text-muted); margin-bottom: 10px; }
.stat-value { font-family: var(--font-serif); font-size: 30px; font-weight: 620; line-height: 1; }
.stat-label { font-size: 13px; font-weight: 700; margin-top: 7px; }
.stat-note { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.plan-card {
  border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px;
}
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-name { font-size: 15px; font-weight: 800; }
.plan-line { font-size: 13.5px; line-height: 1.6; margin-top: 9px; }
.plan-line.muted { color: var(--text-muted); }

/* Scanner */
.scan-window {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--dark-black); color: rgba(255,255,255,.6); border-radius: var(--radius-md);
  padding: 34px; margin: 14px 0; font-size: 13px;
}
.scan-window .ic { width: 42px; height: 42px; color: rgba(255,255,255,.85); }
.scan-list { display: flex; flex-direction: column; gap: 8px; }
.scan-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 13px 14px; cursor: pointer; text-align: left; font: inherit; min-height: 56px;
}
.scan-row:hover { border-color: var(--dark-black); }
.scan-code { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: 14px; }
.scan-who { font-size: 13px; color: var(--text-muted); }
.scan-total { font-weight: 800; font-size: 14px; }

@media (max-width: 980px) {
  .portal-tabs { display: flex; }
  .portal-body { padding: 16px 14px 96px; }
  .portal-section { padding: 16px; border-radius: var(--radius-md); }
  .portal-header .header-actions .btn-black span:not(.ic) { display: none; }
  .menu-row { grid-template-columns: 48px minmax(0, 1fr) auto; row-gap: 8px; }
  .menu-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .menu-thumb { width: 48px; height: 48px; }
  .sched-day summary { grid-template-columns: 76px minmax(0, 1fr); row-gap: 4px; }
  .sched-cut { grid-column: 1 / -1; }
  .sched-item { grid-template-columns: minmax(0, 1fr) 64px 80px; gap: 8px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 24px; }
  .portal-title h1 { font-size: 17px; }
  .portal-title p { display: none; }
}

/* ===== FIRST RUN =========================================================
   Every new cook lands here with an empty kitchen and six tabs. Without this
   the portal is a filing cabinet with nothing in it.
   ======================================================================== */

.pk-flag.info { background: var(--info-bg); color: var(--info-fg); }

.setup-banner {
  background: var(--surface); border: 1px solid #BFD8F5;
  border-left: 4px solid var(--info-fg);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px;
}
.setup-head h2 {
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700;
}
.setup-head h2 .ic { width: 17px; height: 17px; color: var(--info-fg); }
.setup-head p { font-size: 13px; color: var(--text-muted); margin-top: 5px; line-height: 1.55; }
.setup-steps { list-style: none; margin: 16px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.setup-steps li {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border-color); font-size: 14px; font-weight: 600;
}
.setup-steps li:last-child { border-bottom: none; }
.setup-steps li.is-done { color: var(--text-muted); font-weight: 500; }
.setup-steps li .btn-black { margin-left: auto; }
.setup-tick {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border-strong); display: grid; place-items: center;
}
.setup-steps li.is-done .setup-tick { background: var(--ok-fg); border-color: var(--ok-fg); }
.setup-steps li.is-done .setup-tick .ic { width: 13px; height: 13px; color: #FFF; }
.setup-foot { font-size: 12.5px; color: var(--text-muted); }


@media (max-width: 980px) {
  /* Portal actions are used one-handed, often with wet hands. Accept and
     Decline are the two that must never be a near-miss. */
  .order-card .order-foot { gap: 8px; }
  .order-card .order-foot .btn-black { min-height: 48px; flex: 1 1 140px; justify-content: center; }
  .order-card .order-foot .total { flex: 1 0 100%; }
  .portal-sidebar { padding-top: calc(20px + env(safe-area-inset-top)); }
  .portal-body { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .portal-tabs { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .sched-qty input { min-height: 48px; font-size: 16px; }  /* 16px stops iOS zooming */
  .field input, .field select, .field textarea { font-size: 16px; }
  .portal-save { bottom: calc(66px + env(safe-area-inset-bottom)); }
}
