/* ---------------------------------------------------------------------------
   Phone layout (screens up to 640px wide). Loaded after styles.css in
   index.html so these rules win over the desktop ones.
   Also holds the styles of the Bookings "list per day" view
   (js/pages/bookings.js): phones see that list, bigger screens the week grid.
--------------------------------------------------------------------------- */
.week-agenda { display: none; }
.agenda-day { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.agenda-day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: #fafafb; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 14px; }
.agenda-day.today .agenda-day-head { color: var(--red); background: #fdeaec; }
.agenda-add { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; color: var(--text); cursor: pointer; flex: none; }
.agenda-item { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border); border-left: 4px solid var(--border); cursor: pointer; }
.agenda-item:last-child { border-bottom: none; }
.agenda-item:active { background: var(--muted-bg); }
.agenda-item.tone-blue { border-left-color: var(--blue); }
.agenda-item.tone-amber { border-left-color: var(--amber); }
.agenda-item.tone-green { border-left-color: var(--green); }
.agenda-time { flex: none; width: 66px; font-weight: 800; font-size: 13px; }
.agenda-time small { display: block; font-weight: 400; color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.agenda-main { min-width: 0; flex: 1; }
.agenda-name { font-weight: 700; font-size: 15px; }
.agenda-service { font-size: 13.5px; margin-top: 1px; }
.agenda-meta { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.agenda-done { color: var(--green); font-weight: 700; }
.agenda-empty { padding: 10px 12px; font-size: 13px; color: var(--text-dim); }

/* Bookings week grid (all screen sizes): every column header gets the same
   height, so the hours column on the left lines up with the day columns.
   The day headers have two lines ("Mon" / "9/11") while the empty corner
   above the hours had none, which put the hours about half an hour out of
   line with the bookings. */
.week-head { height: 58px; overflow: hidden; }

@media (max-width: 640px) {
  /* Top bar: bigger menu button, title on one line, compact "+ New job" */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar > div:not(.topbar-actions) { flex: 1; min-width: 0; }
  .mobile-menu-btn { width: 40px; height: 40px; flex: none; font-size: 22px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 10px; }
  .topbar-date { font-size: 11px; }
  .topbar-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { gap: 8px; flex: none; }
  #newJobBtn { padding: 9px 11px; font-size: 13px; white-space: nowrap; }

  .content { padding: 14px 12px 80px; }
  .page-title { font-size: 21px !important; }
  .page-head-row { margin-bottom: 14px; }

  /* Live workshop counters: two per row and compact, so "Today's bookings"
     shows up without scrolling through four full-width cards first. */
  .grid-4:has(> .card > .stat-value) { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-4:has(> .card > .stat-value) > .card { padding: 12px; }
  .grid-4:has(> .card > .stat-value) .stat-icon-box { width: 30px; height: 30px; font-size: 14px; margin-bottom: 6px; border-radius: 8px; }
  .grid-4:has(> .card > .stat-value) .stat-label { font-size: 12px; margin-bottom: 2px; }
  .grid-4:has(> .card > .stat-value) .stat-value { font-size: 22px; }
  .grid-4:has(> .card > .stat-value) .stat-hint { font-size: 11px; }

  /* 16px text in fields: below that the iPhone zooms the page in on every tap */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px; }

  .modal { padding: 18px; max-height: 92vh; }
  .modal-actions { flex-wrap: wrap; }
  .toast { left: 12px; right: 12px; bottom: 16px; }

  /* Bookings: a list per day instead of the 7-column week grid */
  .week-grid { display: none; }
  .week-agenda { display: block; }
  .week-toolbar { gap: 8px; }
}
