/* Rosie Dough — owner dashboard */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --pink: #d95d84;
  --pink-deep: #b83e66;
  --blush: #fbeef2;
  --blush-2: #f3d9e1;
  --ink: #362a30;
  --muted: #8a7580;
  --card: #fff;
  --bg: #faf6f8;
  --green: #3f9d6e;
  --amber: #d99a3d;
  --red: #c94f5e;
  --logo-accent: #d95d84;
}
body { margin: 0; font-family: 'Nunito', -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; width: 100%; }
img { max-width: 100%; }
h1, h2, h3 { font-family: 'Nunito', sans-serif; font-weight: 800; }

.btn { border: none; padding: 10px 20px; border-radius: 999px; font-weight: 800; text-decoration: none; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-deep); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--blush-2); }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink-deep); }
.btn-small { padding: 6px 14px; font-size: 0.82rem; }

/* login */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--blush) 0%, var(--bg) 70%); padding: 20px; }
.login-card { background: #fff; border: 1px solid var(--blush-2); border-radius: 24px; padding: 44px 40px;
  width: 100%; max-width: 400px; text-align: center; box-shadow: 0 20px 60px rgba(184, 62, 102, 0.12); }
.login-card .logo-svg { height: 80px; margin: 0 auto 6px; color: var(--ink); }
.login-card h1 { margin: 8px 0 4px; font-size: 1.4rem; }
.login-card p { color: var(--muted); font-size: 0.92rem; margin-top: 0; }
.login-card input { padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--blush-2); margin: 14px 0; }
.login-card input:focus { outline: 2px solid var(--pink); border-color: transparent; }
.login-card .btn { width: 100%; padding: 12px; }

/* layout */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--blush-2);
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side-logo .logo-svg { height: 64px; margin: 0 auto 18px; display: block; color: var(--ink); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 8px; background: none; border: none; text-align: left;
  padding: 11px 14px; border-radius: 12px; font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.nav-item:hover { background: var(--blush); }
.nav-item.active { background: var(--pink); color: #fff; }
.pill { margin-left: auto; background: var(--blush-2); color: var(--ink); border-radius: 999px;
  font-size: 0.72rem; padding: 2px 8px; font-weight: 800; }
.pill:empty { display: none; }
.pill-alert:not(:empty) { background: var(--red); color: #fff; }
.nav-item.active .pill { background: rgba(255,255,255,0.25); color: #fff; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; padding-top: 14px; border-top: 1px solid var(--blush-2); }
.sidebar-foot a { color: var(--pink-deep); text-decoration: none; font-weight: 700; padding: 6px 14px; }
.sidebar-foot button { background: none; border: none; color: var(--muted); text-align: left; padding: 6px 14px; }

#main { flex: 1; padding: 34px 40px 80px; max-width: 1080px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font-size: 1.7rem; }
.view-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }

/* overview */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 30px; }
.stat-card { background: var(--card); border: 1px solid var(--blush-2); border-radius: 18px; padding: 20px 22px; }
.stat-card .stat-num { font-size: 2.1rem; font-weight: 800; color: var(--pink-deep); line-height: 1; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--muted); font-weight: 700; margin-top: 6px; }
.panel { background: var(--card); border: 1px solid var(--blush-2); border-radius: 18px; padding: 24px; margin-bottom: 22px; }
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; }

/* tables / lists */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--blush-2); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--blush); vertical-align: middle; }
.table tr:hover td { background: #fdf7fa; }

.cookie-thumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--blush); display: block; }
.status-chip { display: inline-block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; }
.status-current { background: #e3f5ec; color: var(--green); }
.status-past { background: #fdf1dd; color: var(--amber); }
.status-future { background: #e9e4f9; color: #6d55c3; }
.status-archived { background: #eee; color: #777; }
.status-new { background: #fde3ea; color: var(--pink-deep); }
.status-confirmed { background: #e9e4f9; color: #6d55c3; }
.status-ready { background: #def0fa; color: #2c7fb0; }
.status-picked-up { background: #e3f5ec; color: var(--green); }
.status-cancelled { background: #eee; color: #888; }
.pay-paid { background: #e3f5ec; color: var(--green); }
.pay-claimed { background: #fdf1dd; color: var(--amber); }
.pay-unpaid { background: #fbe3e6; color: var(--red); }
.pay-refunded { background: #ece9f3; color: #5b4f7a; }
a.msg-chip { color: inherit; text-decoration: none; }
a.msg-chip:hover { text-decoration: underline; }
.stock-toggle, .pub-toggle { font-size: 0.78rem; font-weight: 800; border-radius: 999px; padding: 5px 12px; border: 1.5px solid transparent; }
.stock-in { background: #e3f5ec; color: var(--green); }
.stock-out { background: #fbe3e6; color: var(--red); }
.pub-on { background: #e3f5ec; color: var(--green); }
.pub-off { background: #f2ecef; color: var(--muted); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-btn { background: #fff; border: 1.5px solid var(--blush-2); border-radius: 999px; padding: 7px 16px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* messages & ideas */
.msg-card { background: var(--card); border: 1px solid var(--blush-2); border-radius: 18px; padding: 20px 24px; margin-bottom: 14px; }
.msg-card.unread { border-left: 5px solid var(--pink); }
.msg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.msg-head strong { font-size: 1.02rem; }
.msg-meta { font-size: 0.8rem; color: var(--muted); }
.msg-details { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.msg-chip { background: var(--blush); border-radius: 999px; padding: 4px 12px; font-size: 0.78rem; font-weight: 700; }
.msg-body { font-size: 0.94rem; line-height: 1.55; margin: 10px 0 14px; }
.msg-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.msg-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.msg-photo { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--blush-2); background: var(--blush); display: grid; place-items: center; font-size: 1.6rem; text-decoration: none; }
.msg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-photo.missing { opacity: 0.5; cursor: default; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 0.8rem; font-weight: 800; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea { padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--blush-2); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--pink); border-color: transparent; }
.field textarea { resize: vertical; }
.hint { font-size: 0.78rem; color: var(--muted); }

.logo-live { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-live img { width: 130px; height: 130px; object-fit: contain; background: var(--blush);
  border-radius: 16px; padding: 10px; flex-shrink: 0; }
.logo-live > div { flex: 1; min-width: 240px; }
.logo-live .hint { margin: 6px 0 12px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 42px; padding: 2px; border-radius: 10px;
  border: 1.5px solid var(--blush-2); background: #fff; flex-shrink: 0; cursor: pointer; }
.logo-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.logo-option { border: 2px solid var(--blush-2); border-radius: 16px; padding: 18px; text-align: center; cursor: pointer; background: #fff; }
.logo-option:hover { border-color: var(--pink); }
.logo-option.selected { border-color: var(--pink); background: var(--blush); }
.logo-option .logo-svg { height: 64px; margin: 0 auto 8px; color: var(--ink); }
.logo-option span { font-size: 0.8rem; font-weight: 800; color: var(--muted); }

/* reports */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; min-height: 200px; padding-top: 8px; overflow-x: auto; }
.bar-col { flex: 1; min-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
  border-radius: 7px 7px 2px 2px; }
.bar-val { font-size: 0.68rem; font-weight: 800; color: var(--muted); }
.bar-label { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.hbar-name { width: 190px; font-size: 0.88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; background: var(--blush); border-radius: 999px; height: 14px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--pink-deep)); border-radius: 999px; }
.hbar-num { width: 110px; text-align: right; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }

/* photo cropper */
.crop-card { max-width: 470px; text-align: center; z-index: 140; }
.crop-card h2 { margin-bottom: 4px; }
.crop-card .hint { margin: 0 auto 16px; max-width: 400px; }
#crop-modal { z-index: 130; }
#crop-stage { display: flex; justify-content: center; }
#crop-canvas { border-radius: 14px; background: #2a1f26; cursor: grab; touch-action: none;
  display: block; max-width: 100%; }
#crop-canvas.dragging { cursor: grabbing; }
.crop-controls { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; justify-content: center; }
.crop-zoom-label { font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.crop-controls input[type=range] { flex: 1; max-width: 190px; accent-color: var(--pink); }
.crop-step { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--blush-2);
  background: #fff; font-size: 1.1rem; line-height: 1; color: var(--ink); flex-shrink: 0; }
.crop-step:hover { border-color: var(--pink); color: var(--pink-deep); }
.crop-card .modal-actions { justify-content: center; }

/* confirmation dialog */
.confirm-card { max-width: 420px; text-align: center; }
.confirm-card h2 { font-size: 1.2rem; }
.confirm-card p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.confirm-card .modal-actions { justify-content: center; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b03a49; }

/* modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 110;
  background: rgba(40, 20, 30, 0.5); padding: 20px; }
.modal.open { display: flex; }
.modal-card { background: #fff; border-radius: 22px; max-width: 620px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 30px; position: relative; }
.modal-card h2 { margin-top: 0; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 1.2rem; opacity: 0.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.img-row { display: flex; align-items: center; gap: 16px; }
.upload-label { display: inline-block; }

/* toast */
#rd-toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 999px; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 300; }
#rd-toast.show { opacity: 1; transform: translate(-50%, 0); }
#rd-toast.error { background: var(--red); }

.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Holiday pre-orders + pickup reminders (Oct 12 review) */
.chip-holiday { background: #fdecd9; color: #a4561c; }
.holiday-summary { border-color: #f6d6b5; }
.holiday-sum-row { padding: 12px 0; border-top: 1px solid var(--blush); display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
.holiday-sum-row:first-of-type { border-top: none; padding-top: 0; }
.holiday-sum-row span { color: var(--muted); font-size: 0.85rem; }
.holiday-sum-row p { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.88rem; }
.reminder-outbox h2 .pill { margin-left: 6px; vertical-align: middle; }
.reminder-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--blush); }
.check-stack { display: grid; gap: 8px; margin: 4px 0 14px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 700; margin-top: 12px; cursor: pointer; }
.check-stack .check-row { margin-top: 0; }
.check-row input, .holiday-table input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--pink); }
.table-scroll { overflow-x: auto; }
#main { min-width: 0; } /* lets wide tables scroll inside their panel instead of widening the page */
.holiday-table td { padding: 8px 6px; }
.holiday-table tr:hover td { background: none; }
.holiday-table input:not([type=checkbox]) { padding: 7px 8px; border-radius: 9px; border: 1.5px solid var(--blush-2); background: #fff; min-width: 118px; }
.holiday-table td.hint { font-size: 0.78rem; }
.holiday-table input.emoji-input { min-width: 0; width: 3.4em; text-align: center; font-size: 1.15rem; padding: 4px; }
#add-holiday-btn { margin-top: 10px; }

/* Hours & pickup rows (issues #1, #2 — replaced the free-text boxes) */
.panel h3.sub-head { margin: 18px 0 8px; font-size: 0.98rem; }
.panel h2 + h3.sub-head { margin-top: 0; }
.hours-table input[data-f="day"], .hours-table input[data-f="label"] { min-width: 150px; }
.hours-table input[data-f="hours"] { min-width: 210px; width: 100%; }
.hours-table td:last-child { width: 1%; }
#add-hours-btn, #add-holiday-hours-btn { margin-top: 10px; }
#settings-form input:invalid, #settings-form textarea:invalid { border-color: #d9534f; }

/* Discounts (review Oct 12) */
.discount-table select { padding: 7px 8px; border-radius: 9px; border: 1.5px solid var(--blush-2); background: #fff; font: inherit; }
.discount-table input[data-f="name"] { min-width: 200px; }
.discount-table input[type=number] { min-width: 0; width: 5.5em; }
.discount-table select[data-f="scope"] { min-width: 190px; }
.discount-table select[data-f="kind"] { min-width: 76px; }
.amount-pair { display: flex; gap: 6px; align-items: center; }
.amount-pair select { flex: none; width: auto; }
.amount-pair input { flex: 1; min-width: 0; }
#add-discount-btn { margin-top: 10px; }

/* Pickup reminders cadence (review Oct 12, part 2) */
.reminder-steps { display: grid; gap: 8px; margin: 12px 0 10px; }
.reminder-step { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; font-weight: 600; }
.reminder-step input, .reminder-step select { padding: 7px 8px; border-radius: 9px; border: 1.5px solid var(--blush-2); background: #fff; font: inherit; }
.reminder-step input { width: 3.8em; }
.reminder-step .reminder-remove { padding: 6px 11px; line-height: 1; }
.reminder-step select { width: auto; }
.reminder-step span { color: var(--muted); }
.order-money { margin-top: 6px; font-size: 0.88rem; }
.discount-line { color: #2f7a52; font-weight: 600; }
.discount-card { max-width: 520px; }
.discount-preview { margin: 14px 0 6px; padding: 10px 14px; border-radius: 12px; background: #eef7f1; color: #24543b; font-size: 0.95rem; }

/* settings tabs — every tab's panels stay on the page, the others are just hidden */
.panel[hidden], .settings-save[hidden] { display: none; }
.settings-tabs { margin-bottom: 22px; }
.settings-save { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--blush-2); border-radius: 18px;
  box-shadow: 0 8px 28px rgba(54, 42, 48, 0.12); }
.settings-save .hint { margin: 0; }
.cost-table input { width: 120px; }
#save-costs-btn { margin-top: 14px; }
.cost-hint { margin: 0; min-height: 1.2em; }
.profit-grid { margin-bottom: 6px; }

/* Create order (Orders → Create order, or from a customer) */
.order-card { max-width: 720px; }
.label-note { font-weight: 600; color: var(--muted); opacity: 0.85; margin-left: 4px; }
.order-section { margin: 22px 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pink-deep); }
.order-section:first-of-type { margin-top: 4px; }
.order-lines { display: grid; gap: 8px; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) 5.5em auto; gap: 8px; align-items: center; }
.order-line-custom { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 5.5em minmax(0, 1.3fr) auto; }
.order-line input, .order-line select { width: 100%; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--blush-2);
  background: #fff; font: inherit; font-size: 0.92rem; }
.order-line input:focus, .order-line select:focus { outline: 2px solid var(--pink); border-color: transparent; }
.line-remove { background: none; border: 1.5px solid var(--blush-2); border-radius: 10px; padding: 8px 11px; line-height: 1; color: var(--muted); }
.line-remove:hover { border-color: var(--pink); color: var(--pink-deep); }
.order-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.order-how { display: flex; gap: 18px; flex-wrap: wrap; }
.order-how label, .order-paid label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.order-how input, .order-paid input { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--pink); }
.order-paid { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 10px; }
.discount-preview.is-error { background: #fdecef; color: var(--pink-deep); }
.order-done { text-align: center; padding: 10px 0 0; }
.order-done-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 6px; }
.order-done .modal-actions { justify-content: center; flex-wrap: wrap; }
.order-done-link { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--blush); word-break: break-all; user-select: all; }

/* Customers (light CRM built from orders) */
.customer-search { margin-bottom: 16px; }
.customer-search input { width: 100%; max-width: 460px; padding: 11px 16px; border-radius: 999px; border: 1.5px solid var(--blush-2);
  background: #fff; font: inherit; }
.customer-search input:focus { outline: 2px solid var(--pink); border-color: transparent; }
.customer-card { padding: 16px 22px; }
.customer-card.open { border-color: var(--pink); }
.customer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; width: 100%;
  padding: 0; background: none; border: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.customer-name { font-size: 1.02rem; font-weight: 800; }
.customer-stats { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.customer-card .msg-details { margin-bottom: 0; }
.customer-orders { display: grid; gap: 6px; margin: 14px 0; }
.customer-order { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 12px;
  border-radius: 12px; background: var(--blush); font-size: 0.88rem; }
.customer-order-num { flex: 0 0 11em; font-weight: 800; white-space: nowrap; }
.customer-order-items { flex: 1 1 12em; min-width: 0; }
/* drops to its own line, still on the right, when the items need the room */
.customer-order-total { margin-left: auto; font-weight: 700; white-space: nowrap; }
.customer-card .field { margin-bottom: 12px; }
.customer-card textarea { width: 100%; }

/* Self-serve cart (review Oct 12, part 2) — built for her phone at the cart: big steppers, one card per cookie */
.cart-layout { display: grid; gap: 0 22px; align-items: start; }
@media (min-width: 1100px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .cart-summary-panel { position: sticky; top: 20px; }
}
.cart-day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cart-day-head h2 { margin: 0; }
.cart-saved { margin-left: auto; font-size: 0.8rem; font-weight: 800; color: var(--green); }
.cart-saved[data-state="saving"] { color: var(--muted); }
.cart-saved[data-state="error"] { color: var(--red); }
.cart-lines { display: grid; gap: 12px; margin: 14px 0; }
.cart-line { border: 1px solid var(--blush-2); border-radius: 16px; padding: 14px 16px; background: #fff; }
.cart-line-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cart-line-head strong { font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.cart-price { display: flex; align-items: center; gap: 2px; font-weight: 800; color: var(--muted); flex: none; }
.cart-price input { width: 5.2em; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--blush-2); text-align: right; }
.cart-counts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.cart-step > span, .cart-sold > span { display: block; font-size: 0.72rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.cart-step-row { display: flex; align-items: center; gap: 6px; }
.cart-step .crop-step { width: 40px; height: 40px; font-size: 1.3rem; }
.cart-step input { width: 3.6em; padding: 8px 4px; border-radius: 10px; border: 1.5px solid var(--blush-2); text-align: center; font-weight: 800; font-size: 1rem; }
.cart-step input::placeholder { color: #c9b8c0; }
.cart-step input:focus, .cart-price input:focus, .cart-money-input input:focus { outline: 2px solid var(--pink); border-color: transparent; }
.cart-sold { min-width: 3.5em; padding-bottom: 8px; }
.cart-sold strong { font-size: 1.35rem; color: var(--pink-deep); }
.cart-sold .cart-neg { color: var(--red); }
.cart-add { max-width: 360px; }
.cart-date { max-width: 220px; }
.cart-pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cart-money-input { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--muted); }
.cart-money-input input { padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--blush-2); background: #fff; font-size: 1rem; }
.cart-verdict { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 4px; font-size: 0.88rem; line-height: 1.45; }
.cart-verdict strong { font-size: 1rem; }
.cart-v-ok { background: #e3f5ec; color: #2d7a54; }
.cart-v-warn { background: #fdf1dd; color: #93621a; }
.cart-v-bad { background: #fbe3e6; color: #a63a48; }
.cart-v-wait { background: #f2ecef; color: var(--muted); }
.cart-sum { margin: 0; display: grid; gap: 0; }
.cart-sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--blush); }
.cart-sum div:last-child { border-bottom: none; }
.cart-sum dt { font-size: 0.86rem; color: var(--muted); font-weight: 700; }
.cart-sum dd { margin: 0; font-weight: 800; text-align: right; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.cart-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-color: #f6d6b5; background: #fffaf3; }
.cart-table td, .cart-table th { white-space: nowrap; }
.cart-hist-list { display: grid; gap: 8px; }
.cart-hist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; width: 100%; text-align: left; background: #fff;
  border: 1.5px solid var(--blush-2); border-radius: 14px; padding: 10px 14px; color: var(--ink); }
.cart-hist:hover, .cart-hist.active { border-color: var(--pink); }
.cart-hist.active { background: var(--blush); }
.cart-hist-date { font-weight: 800; min-width: 8.5em; }
.cart-hist-num { font-size: 0.88rem; font-weight: 700; color: var(--muted); min-width: 4.5em; }
.cart-how summary { font-weight: 800; cursor: pointer; }
.cart-how p { font-size: 0.9rem; line-height: 1.5; }
.cart-how .hint { font-size: 0.78rem; }
.cart-tol { max-width: 200px; margin: 12px 0; }
/* paid-after-cancel warning (Orders + Overview) */
.alert-panel { border-color: #f1b8c0; background: #fff6f7; }
/* Reports: cart beside orders */
.hbar-fill.hbar-cart, .bar-cart { background: linear-gradient(180deg, #efb562 0%, var(--amber) 100%); }
.bar-stack { width: 100%; max-width: 40px; display: flex; flex-direction: column; }
.bar-stack > .bar { max-width: none; border-radius: 0 0 2px 2px; }
.bar-stack > .bar:first-child { border-radius: 7px 7px 2px 2px; }
.bar-stack > .bar-cart:first-child { border-radius: 7px 7px 0 0; }
.chart-legend { display: flex; gap: 16px; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: -6px 0 6px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.lg-orders { background: var(--pink); }
.lg-cart { background: var(--amber); }
@media (max-width: 640px) {
  .cart-line { padding: 12px; }
  /* two across (Put out | Restocked, then Left | Sold) so a cookie card stays short */
  .cart-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
  .cart-step-row { gap: 5px; }
  .cart-step .crop-step { width: 36px; height: 36px; }
  .cart-step input { width: 3em; }
  .cart-hist-date { min-width: 0; flex: 1 1 100%; }
}

/* phones / small tablets: ☰ menu bar + slide-out sidebar (hidden on desktop) */
.mobile-bar, .nav-backdrop { display: none; }
#main { min-width: 0; }

@media (max-width: 860px) {
  #app { flex-direction: column; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 90;
    background: #fff; border-bottom: 1px solid var(--blush-2); padding: 10px 14px; }
  .menu-btn { position: relative; flex-shrink: 0; width: 44px; height: 44px; background: none; border: 1.5px solid var(--blush-2);
    border-radius: 12px; font-size: 1.3rem; line-height: 1; color: var(--ink); }
  .menu-btn .pill { position: absolute; top: -7px; right: -7px; margin: 0; }
  .mobile-title { font-weight: 800; font-size: 1.05rem; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; width: min(280px, 82vw); height: auto; overflow-y: auto;
    transform: translateX(-100%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.25s ease;
    box-shadow: 10px 0 34px rgba(54, 42, 48, 0.2); }
  .side-logo .logo-svg { height: 52px; margin-bottom: 12px; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 95; background: rgba(54, 42, 48, 0.38);
    opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  #main { padding: 22px 18px 60px; max-width: none; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
  /* Cookies table becomes one card per cookie: photo, name, Edit on top; the rest wraps underneath */
  .cookie-table, .cookie-table tbody { display: block; }
  .cookie-table thead { display: none; }
  .cookie-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--blush); }
  .cookie-table td { padding: 0; border: none; }
  .cookie-table tr:hover td { background: none; }
  .cookie-table .c-thumb { order: -3; }
  .cookie-table .c-name { order: -2; flex: 1 1 calc(100% - 180px); min-width: 0; }
  .cookie-table .c-edit { order: -1; }
  .cookie-table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; }
}

@media (max-width: 640px) {
  #main { padding: 18px 14px 50px; }
  .view-head h1 { font-size: 1.45rem; }
  .panel { padding: 18px 16px; overflow-x: auto; }
  .modal-card { padding: 20px; }
  .hbar-row { flex-wrap: wrap; gap: 4px 10px; }
  .hbar-name { width: 100%; }
  .hbar-num { width: auto; }
  /* a custom item wraps: name on its own row, then price / qty / cost / ✕ */
  .order-line-custom { grid-template-columns: minmax(0, 1fr) 4.5em minmax(0, 1fr) auto; }
  .order-line-custom [data-l="name"] { grid-column: 1 / -1; }
  .order-paid { padding-bottom: 0; }
  .customer-card { padding: 14px 16px; }
  .customer-order { display: grid; grid-template-columns: minmax(0, 1fr); }
  .customer-order-total { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, body.nav-open .sidebar, .nav-backdrop { transition: none; }
}
