/* ── Reset & tokens ──────────────────────────────────────────────────────── */
:root {
  --brand:        #ff3333;
  --brand-dark:   #cc0000;
  --brand-dim:    rgba(255,51,51,.12);
  --brand-yellow: #fdd05c;
  --bg:           #111111;
  --surface:      #1a1a1a;
  --surface-2:    #222222;
  --surface-high: #2a2a2a;
  --border:       rgba(255,255,255,.1);
  --border-2:     rgba(255,255,255,.15);
  --text:         #ffffff;
  --text-2:       #e5e7eb;
  --muted:        #9ca3af;
  --muted-light:  #6b7280;
  --red:          #ef4444;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.4);
  --radius:       10px;
  --radius-sm:    6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar (dark) ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 30px;
  height: 30px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.nav-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.2px;
}

.nav-sub {
  font-weight: 400;
  opacity: .55;
}

.btn-poll {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-poll:hover { background: var(--brand); border-color: var(--brand); }
.btn-poll:disabled { opacity: .5; cursor: not-allowed; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 68px;
  right: 1.5rem;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  animation: slide-in .2s ease;
}
@keyframes slide-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.toast.success { background: #052e16; color: #4ade80; border: 1px solid #166534; }
.toast.error   { background: #450a0a; color: #fca5a5; border: 1px solid #991b1b; }
.toast.info    { background: #0c1a3d; color: #93c5fd; border: 1px solid #1e40af; }

/* ── Main layout ─────────────────────────────────────────────────────────── */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.toolbar-label {
  width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0;
}

.date-group {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.date-field {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.date-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.date-field input[type="date"] {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  color-scheme: dark;
}

.date-sep {
  color: var(--muted-light);
  font-size: 16px;
  line-height: 1;
}

.btn-primary {
  background: var(--brand-yellow);
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn-primary:hover { background: #e6b84d; }

.notify-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.btn-ghost:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }

/* ── Count cards ─────────────────────────────────────────────────────────── */
.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.count-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.count-card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.1rem;
}

.card-icon {
  font-size: 20px;
  line-height: 1;
}

.card-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  flex: 1;
}

.card-total {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-yellow);
  line-height: 1;
  letter-spacing: -1px;
  font-family: "Bebas Neue", "Inter", sans-serif;
}

.card-list {
  list-style: none;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: .75rem;
}

.card-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem 0;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.card-list li:last-child { border-bottom: none; }
.card-list li strong {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  min-width: 2ch;
  text-align: right;
}

/* ── Detailed Breakdown ──────────────────────────────────────────────────── */
.detail-section {
  margin-bottom: 1.25rem;
}

.btn-detail-toggle {
  width: 100%;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

.detail-arrow {
  font-size: 11px;
  line-height: 1;
  transition: transform .15s;
}

.detail-content {
  margin-top: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.detail-group {
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.detail-group:last-child { border-bottom: none; }

.detail-bowl-header {
  font-size: 14px;
  color: var(--text);
  margin-bottom: .25rem;
}
.detail-bowl-header strong {
  font-weight: 800;
  font-size: 16px;
  color: var(--brand-yellow);
  margin-right: 4px;
}

.detail-items {
  font-size: 13px;
  color: var(--text-2);
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.detail-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 0;
}

.detail-count {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  min-width: 2ch;
  text-align: right;
  margin-right: 4px;
}

.detail-mod {
  color: var(--brand-yellow);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .02em;
}

.detail-double {
  color: #c084fc;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
}

.detail-empty {
  font-size: 13px;
  color: var(--muted-light);
  text-align: center;
  padding: .75rem 0;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 3rem 1rem;
  color: var(--muted-light);
  font-size: 14px;
}
.empty-icon { font-size: 28px; }

/* ── Orders section ──────────────────────────────────────────────────────── */
.orders-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: .7rem 1.25rem;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted-light);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
  padding: .75rem 1.25rem;
  font-size: 13.5px;
  color: var(--text-2);
  vertical-align: middle;
}

/* Source badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: .02em;
}
.badge-forkable  { background: rgba(37,99,235,.15); color: #60a5fa; border: 1px solid rgba(37,99,235,.3); }
.badge-foodja    { background: rgba(234,88,12,.15); color: #fb923c; border: 1px solid rgba(234,88,12,.3); }
.badge-relish    { background: rgba(147,51,234,.15); color: #c084fc; border: 1px solid rgba(147,51,234,.3); }
.badge-default   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-estimated { background: rgba(180,71,8,.15); color: #fbbf24; border: 1px solid rgba(180,71,8,.3); font-size: 10px; padding: 2px 6px; }

.btn-detail {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-detail:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modal-in .2s cubic-bezier(.16,1,.3,1);
}
@keyframes modal-in {
  from { transform: scale(.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: none;
  flex-shrink: 0;
}

.settings-tabs {
  display: flex;
  gap: 0;
  padding: 0 1.5rem;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}

.settings-tab {
  background: none;
  border: none;
  padding: .6rem 1.25rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color .15s, border-color .15s;
}

.settings-tab:hover {
  color: var(--text);
}

.settings-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-family: "Bebas Neue", "Inter", sans-serif;
  letter-spacing: .5px;
}

.modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: background .15s;
}
.modal-close:hover { background: var(--surface-high); }

.modal-body {
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-group { }
.modal-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-light);
  margin-bottom: .5rem;
}
.modal-group ul { list-style: none; }
.modal-group li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.modal-group li:last-child { border-bottom: none; }
.modal-group li strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  main { padding: 1.25rem 1rem 3rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .date-group { justify-content: center; }
  .notify-group { justify-content: stretch; }
  .notify-group .btn-ghost { flex: 1; justify-content: center; }
  .counts { grid-template-columns: 1fr; }
}

/* ── PIN screen ──────────────────────────────────────────────────────────── */
.pin-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pin-logo {
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.pin-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  font-family: "Bebas Neue", "Inter", sans-serif;
  letter-spacing: .5px;
}
.pin-title span { font-weight: 400; opacity: .6; }

.pin-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: -4px;
}

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 20px;
  letter-spacing: .4em;
  padding: 10px 16px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s;
}
.pin-input:focus { border-color: var(--brand); }

.pin-btn { width: 100%; justify-content: center; padding: 10px; }

.pin-error {
  font-size: 12.5px;
  color: var(--red);
  text-align: center;
}

/* ── Navbar right ─────────────────────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gmail-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-light);
  flex-shrink: 0;
  transition: background .3s;
}
.dot-green { background: #22c55e; }
.dot-red   { background: var(--red); }

.nav-sync {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}

.btn-settings {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  transition: background .15s;
}
.btn-settings:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  gap: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .75rem 1.25rem;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── Prep count title (above summary + counts) ────────────────────────────── */
.prep-count-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .5px;
  margin-bottom: 1rem;
  font-family: "Bebas Neue", "Inter", sans-serif;
}

/* ── Summary banner ───────────────────────────────────────────────────────── */
.summary-banner {
  background: var(--brand-yellow);
  color: #111;
  border-radius: var(--radius);
  padding: .65rem 1.25rem;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-align: center;
  letter-spacing: -.1px;
}

/* ── Weekly overview (Mon–Sun day cards) ─────────────────────────────────── */
.week-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.week-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.week-nav {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.week-nav:hover { background: var(--brand-dim); border-color: var(--brand); color: var(--brand); }

.week-days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.week-day {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-height: 82px;
  transition: background .15s, border-color .15s;
}

.week-day--today {
  border-color: var(--brand);
  background: var(--brand-dim);
}


.week-day--has-orders {
  cursor: pointer;
  background: var(--surface-high);
}
.week-day--has-orders:hover {
  background: var(--brand-dim);
  border-color: var(--brand);
}

.week-day--selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255,51,51,.25);
}

.wd-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-light);
}

.wd-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.wd-bowls {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-yellow);
  line-height: 1.1;
  letter-spacing: -.5px;
}

.wd-orders {
  font-size: 10.5px;
  color: var(--muted);
}

.wd-empty {
  font-size: 10.5px;
  color: var(--muted-light);
  margin-top: auto;
}

/* ── Integrated calendar card (in dashboard) ─────────────────────────────── */
.cal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-top: .25rem;
}

.cal-title {
  font-size: 15px;
  font-weight: 700;
  min-width: 180px;
  text-align: center;
}

.cal-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: background .15s;
}
.cal-nav:hover { background: var(--surface-2); }

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-light);
  margin-bottom: .5rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.cal-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 64px;
  padding: .4rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  transition: background .15s;
}

.cal-cell--blank {
  background: transparent;
  border-color: transparent;
}

.cal-cell--today {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.cal-cell--has-orders { cursor: pointer; }
.cal-cell--has-orders:hover { background: var(--brand-dim); border-color: var(--brand); }

.cal-cell--selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(255,51,51,.25);
}

.cal-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.cal-badge {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1.45;
  width: 100%;
  word-break: break-word;
  margin-top: 2px;
}
.cal-badge--forkable   { background: rgba(37,99,235,.15); color: #60a5fa; border: 1px solid rgba(37,99,235,.3); }
.cal-badge--foodja     { background: rgba(234,88,12,.15); color: #fb923c; border: 1px solid rgba(234,88,12,.3); }
.cal-badge--relish     { background: rgba(147,51,234,.15); color: #c084fc; border: 1px solid rgba(147,51,234,.3); }
.cal-badge--default    { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.cal-badge--estimated  { background: rgba(180,71,8,.15); color: #fbbf24; border: 1px dashed rgba(180,71,8,.3); font-style: italic; }
.cal-cell--estimated   { border-style: dashed; border-color: var(--muted-light); }

/* ── Upload ───────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface);
}
.upload-zone:hover,
.upload-zone--over {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.upload-label { font-size: 14px; color: var(--text-2); text-align: center; }
.upload-sub   { font-size: 13px; color: var(--muted); }

.upload-browse {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.upload-preview {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.upload-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.upload-meta {
  padding: .75rem 1.25rem;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.upload-section-title {
  padding: .5rem 1.25rem .25rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-light);
}

.upload-list {
  list-style: none;
  padding: 0 1.25rem .5rem;
}
.upload-list li {
  display: flex;
  justify-content: space-between;
  padding: .3rem 0;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.upload-list li:last-child { border-bottom: none; }
.upload-list li strong { font-weight: 700; color: var(--text); }

.upload-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.upload-error {
  padding: .75rem 1.25rem;
  color: var(--red);
  font-size: 13px;
}

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Settings modal ───────────────────────────────────────────────────────── */
.modal-box--wide { max-width: 520px; }

.settings-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: .75rem;
}

.settings-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.settings-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-light);
}

.settings-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s;
}
.settings-input:focus { border-color: var(--brand); }
.settings-input--mono { font-family: monospace; }

/* Style select dropdowns for dark theme */
.settings-input option {
  background: var(--surface-2);
  color: var(--text);
}

.settings-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-light);
  margin: 1rem 0 .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

.settings-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}

/* ── Schedule cards ───────────────────────────────────────────────────────── */
.settings-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: .75rem;
  line-height: 1.5;
}

.sched-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  margin-bottom: .6rem;
  background: var(--surface-2);
}

.sched-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.sched-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: .5rem;
}

.sched-fields {
  display: flex;
  gap: .5rem;
}

.sched-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sched-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Subscriber management ────────────────────────────────────────────────── */
.sub-add-form {
  margin-bottom: 1rem;
}

.sub-add-row {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
}

.sub-input {
  flex: 1;
  min-width: 0;
}

.sub-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: .5rem;
}

.sub-empty {
  color: var(--muted-light);
  font-size: 12.5px;
  text-align: center;
  padding: .75rem 0;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.sub-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  z-index: 1;
}

.sub-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.sub-table tbody tr:hover {
  background: var(--surface-2);
}

.sub-table td {
  padding: 6px 8px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.sub-cell-name {
  font-weight: 600;
  color: var(--text);
}

.sub-cell-toggle {
  text-align: center;
  width: 40px;
}

.sub-cell-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
  cursor: pointer;
}

.sub-cell-actions {
  white-space: nowrap;
  width: 80px;
  text-align: right;
}

.sub-cell-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  line-height: 1;
  border-radius: 4px;
  color: var(--muted-light);
}

.sub-btn-edit:hover { color: var(--brand-yellow); }
.sub-btn-save:hover { color: #22c55e; }
.sub-btn-cancel:hover,
.sub-btn-delete:hover { color: var(--red); background: rgba(239,68,68,.12); }

.sub-edit-input {
  width: 100%;
  min-width: 50px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

.sub-edit-fields {
  display: flex;
  gap: 4px;
}

.sub-editing td {
  background: var(--surface-2);
}

/* ── Subscriber group badge ───────────────────────────────────────────────── */
.sub-group-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(255,51,51,.12);
  color: var(--brand);
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Notification history ────────────────────────────────────────────────── */
.history-controls {
  margin-bottom: 8px;
}
.history-controls select {
  max-width: 140px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12.5px;
}
.history-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.history-badge-sms {
  background: rgba(34,197,94,.15);
  color: #4ade80;
}
.history-badge-email {
  background: rgba(37,99,235,.15);
  color: #60a5fa;
}
.history-status {
  font-size: 13px;
  font-weight: 700;
}
.history-ok {
  color: #4ade80;
}
.history-fail {
  color: var(--red);
}
.history-recipient {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.history-source {
  color: var(--muted);
  font-size: 11px;
}
.history-date {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ── Responsive additions ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tab-bar  { padding: 0 .75rem; }
  .tab-btn  { padding: .65rem .75rem; font-size: 13px; }
  .nav-sync { display: none; }

  /* Weekly overview: tighter on mobile */
  .week-section  { padding: 1rem; }
  .week-days     { gap: 5px; }
  .week-day      { padding: .5rem .25rem; min-height: 68px; gap: 2px; }
  .wd-name       { font-size: 9px; }
  .wd-date       { font-size: 10px; }
  .wd-bowls      { font-size: 13px; }
  .wd-orders,
  .wd-empty      { font-size: 9.5px; }

  /* Calendar: tighter cells, smaller badge text (5-col is already wider than 7-col was) */
  .cal-section   { padding: 1rem; }
  .cal-cell      { min-height: 48px; padding: .3rem .4rem; }
  .cal-day       { font-size: 11px; }
  .cal-badge     { font-size: 9.5px; padding: 1px 4px; }
}
