/**
 * src/public/css/sales-reps-hours.css — the hours editor (js/sales-reps-hours.js), Calendly's weekly hours and
 * date-specific hours in our styling. Round 5, BUILD.md §11.
 *
 * Everything is under .srh so nothing outside the editor moves; colours are the design tokens only. It mounts in the
 * owner's Hours sheet (P9a) and the rep's My settings (P9b), so it lays out on its OWN width (a container query),
 * never the window's: one column of day rows on a phone or in a narrow sheet, the times beside the day when there is
 * room. Every control is at least 44px tall; text is at least 13px.
 */

.srh { container-type: inline-size; container-name: srh; display: flex; flex-direction: column; gap: 22px; color: var(--text); font-size: 14px; }
.srh * { box-sizing: border-box; }
.srh p { margin: 0; }
.srh h3 { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }
.srh-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.srh-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.srh-grow { flex: 1 1 220px; min-width: 0; }
.srh-sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.srh-empty, .srh-hint { color: var(--text-3); font-size: 13px; }
.srh-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.srh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.srh-link { border: 0; background: none; padding: 0; color: var(--accent-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* The time zone picker beside the heading. */
.srh-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.srh-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.srh-zone { flex: 0 1 260px; }
.srh-zone .select, .srh-dateinput { width: 100%; min-height: 44px; }

/* ── weekly hours: one row a day ── */
.srh-days { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg, 14px); background: var(--surface); }
.srh-day { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; padding: 12px 14px; border-top: 1px solid var(--border-soft); }
.srh-day:first-child { border-top: 0; }
.srh-dayname {
  min-height: 44px; min-width: 52px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-softer);
  color: var(--accent-deep); font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
}
.srh-off .srh-dayname { border-color: var(--border); background: var(--surface-2); color: var(--text-3); }
.srh-dayname.srh-static { cursor: default; display: inline-flex; align-items: center; justify-content: center; }
.srh-dayname:focus-visible, .srh-icon:focus-visible, .srh-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.srh-ranges { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.srh-unavail { color: var(--text-3); font-size: 13.5px; line-height: 44px; }
.srh-text { font-size: 13.5px; line-height: 1.5; padding-top: 11px; }
.srh-text .srh-unavail { line-height: inherit; }
.srh-range { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.srh-pair { display: flex; align-items: center; gap: 6px; min-width: 0; }
.srh .srh-time { min-height: 44px; flex: 1 1 0; min-width: 0; max-width: 140px; padding: 10px 6px 10px 10px; }
.srh-to { color: var(--text-3); font-size: 13px; flex: 0 0 auto; }
.srh-bad .srh-time { border-color: var(--danger); }
.srh-err { color: var(--danger); font-size: 12.5px; }
.srh-good { color: var(--good); font-size: 13px; }
.srh-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--text-3); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.srh-icon:hover { background: var(--surface-2); color: var(--text); }
.srh-dayacts { display: flex; align-items: center; gap: 2px; }
.srh-add { color: var(--accent-deep); font-size: 22px; }
.srh-copy {
  min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: var(--accent-deep); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.srh-copy:hover, .srh-copy[aria-expanded="true"] { background: var(--accent-softer); }

/* "Copy times to" and the date editor: our own panel, drawn in place (never a browser dialog). */
.srh-panel {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--accent-soft); background: var(--accent-softer);
}
.srh-panel-title { font-size: 13.5px; font-weight: 600; }
.srh-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.srh-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 13.5px; cursor: pointer; }
.srh-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.srh-panel .btn-sm, .srh .btn-sm { min-height: 40px; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.srh-dateedit .srh-field { max-width: 260px; }

/* ── date-specific hours ── */
.srh-dates { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg, 14px); background: var(--surface); }
.srh-date { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border-soft); }
.srh-date:first-child { border-top: 0; }
.srh-datename { font-weight: 600; font-size: 14px; }
.srh-date .srh-text { padding-top: 2px; color: var(--text-2); }

/* The save button, on its own line at the end. */
.srh-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.srh-foot .btn { min-height: 44px; }

/* Wider than a phone: the copy panel's days in four columns. */
@container srh (min-width: 560px) {
  .srh-checks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .srh-day { padding: 12px 18px; }
}
/* Narrow (a phone, a small sheet): the day and its + and Copy on one line, its times across the full width under
   them, so "12:00 pm" is never cut short. */
@container srh (max-width: 440px) {
  .srh-day { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .srh-dayname { grid-column: 1; grid-row: 1; justify-self: start; }
  .srh-dayacts { grid-column: 2; grid-row: 1; }
  .srh-ranges { grid-column: 1 / -1; }
  .srh-off .srh-ranges { grid-column: 1; grid-row: 1; padding-left: 64px; }
  .srh .srh-time { max-width: none; }
  .srh-date { flex-wrap: wrap; }
  .srh-date .srh-row { flex-wrap: nowrap; }
  /* Read only: nothing to tap, so the times stay beside the day. */
  .srh-readonly .srh-day { grid-template-columns: 52px minmax(0, 1fr); }
  .srh-readonly .srh-ranges, .srh-readonly .srh-off .srh-ranges { grid-column: 2; grid-row: 1; padding-left: 0; }
}
