/* Hub Student Consultant Schedule — scoped styles.
 *
 * Every selector is prefixed .hub-cs-* (or scoped under .hub-cs) so this file
 * cannot reach anything the rest of the Hub owns. Tokens come from styles.css;
 * shared furniture (.hub-section, .hub-card, .hub-chip, .hub-btn, .hub-select,
 * .hub-status-banner) is reused rather than restyled.
 *
 * No @import, no remote url(), no inline styles: the live CSP is style-src 'self'.
 */

.hub-cs { color: var(--text); }
.hub-cs > * + * { margin-top: var(--s4); }

/* --- semesters ------------------------------------------------------------ */
.hub-cs-terms-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.hub-cs-chips, .hub-cs-views { display: flex; flex-wrap: wrap; gap: var(--s2); }
.hub-cs-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; }
.hub-cs-chip-name { font-weight: 600; }
.hub-cs-chip-status { font-size: 11px; color: var(--text3); }
.hub-cs-chip.is-on .hub-cs-chip-status { color: inherit; opacity: .85; }

/* --- the shift form -------------------------------------------------------- */
.hub-cs-form-grid {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: var(--s3);
}
.hub-cs-field { display: grid; gap: 4px; min-width: 0; }
.hub-cs-field-wide { grid-column: span 2; }
.hub-cs-field .hub-select, .hub-cs-field .hub-input { width: 100%; }
.hub-cs-form-error { color: var(--danger); font-size: 13px; margin: 0 0 var(--s2); }
.hub-cs-danger { color: var(--danger); border-color: var(--danger-br); }

/* --- the weekly grid ------------------------------------------------------- */
.hub-cs-week {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.hub-cs-day {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: var(--s3); display: grid; gap: var(--s2); align-content: start;
}
.hub-cs-day-name { margin: 0; font-size: 14px; font-weight: 700; }
.hub-cs-day-hours { margin: 0; font-size: 12px; color: var(--text3); }
.hub-cs-block { border-top: 1px solid var(--line-2); padding-top: var(--s2); display: grid; gap: 6px; }
.hub-cs-block-head { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12.5px; }
.hub-cs-block-time { font-weight: 600; }
.hub-cs-block-count { color: var(--text3); }
.hub-cs-block.is-empty .hub-cs-block-count { color: var(--warn); }
.hub-cs-shifts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hub-cs-shift {
  width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
  padding: 5px 8px; border: 1px solid var(--ok-br); border-radius: var(--r-sm);
  background: var(--ok-bg); color: var(--text); font: inherit; font-size: 12.5px;
  text-align: left; cursor: pointer;
}
.hub-cs-shift:hover, .hub-cs-shift:focus-visible { border-color: var(--accent); }
.hub-cs-shift.is-editing { outline: 2px solid var(--accent); outline-offset: 1px; }
.hub-cs-shift.is-inactive { background: var(--surface2); border-color: var(--border2); }
.hub-cs-shift-name { font-weight: 600; }
.hub-cs-shift-time, .hub-cs-shift-note { color: var(--text2); }
.hub-cs-flag {
  font-size: 11px; color: var(--warn); background: var(--warn-bg);
  border-radius: var(--r-pill); padding: 0 6px;
}
.hub-cs-add { justify-self: start; }

.hub-cs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hub-cs-table th, .hub-cs-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.hub-cs-table thead th { color: var(--text2); font-weight: 600; }
.hub-cs-table tbody th { font-weight: 500; }
.hub-cs-table td { font-variant-numeric: tabular-nums; }

.hub-cs-submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.hub-cs-submit .hub-hint { margin: 0; }

/* --- the calendar ---------------------------------------------------------- */
.hub-cs-cal-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4); }
.hub-cs-cal-tools .hub-cs-field { min-width: 200px; }
.hub-cs-legend { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s3); font-size: 12.5px; color: var(--text2); }
.hub-cs-legend li { display: inline-flex; align-items: center; gap: 6px; }
.hub-cs-key { width: 12px; height: 12px; border-radius: 3px; border: 1px solid transparent; }
.hub-cs-key.is-shift  { background: var(--ok-bg);   border-color: var(--ok-br); }
.hub-cs-key.is-event  { background: var(--info-bg); border-color: var(--info-br); }
.hub-cs-key.is-closed { background: var(--warn-bg); border-color: var(--warn-br); }

.hub-cs-month { break-inside: avoid; }
.hub-cs-month-name {
  margin: 0 0 var(--s2); padding: 6px 10px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--navy); color: #fff; font-size: 14px;
}
/* Six columns will not fit a phone; the calendar scrolls inside this box and
   the page itself never scrolls sideways. */
.hub-cs-cal-scroll { overflow-x: auto; }
.hub-cs-cal { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.hub-cs-cal th {
  font-size: 12px; font-weight: 600; color: var(--text2); text-align: left;
  padding: 4px 6px; border-bottom: 1px solid var(--line);
}
.hub-cs-cal th abbr { text-decoration: none; }
.hub-cs-cal-day { border: 1px solid var(--line-2); vertical-align: top; padding: 0; height: 96px; background: var(--surface); }
.hub-cs-cal-day.is-pad { background: var(--canvas); }
.hub-cs-cal-day.is-out { background: var(--surface2); }
.hub-cs-cal-day.is-out .hub-cs-cal-num { color: var(--text3); }
.hub-cs-cal-day.is-closed { background: var(--warn-bg); }
.hub-cs-cal-day.is-selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.hub-cs-cal-day.is-today .hub-cs-cal-num { background: var(--navy); color: #fff; border-radius: var(--r-pill); padding: 0 6px; }
.hub-cs-cal-btn {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  width: 100%; height: 100%; min-height: 96px; padding: 4px 5px;
  border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.hub-cs-cal-btn:hover { background: rgba(13, 148, 136, .05); }
.hub-cs-cal-num { font-size: 12px; font-weight: 700; align-self: flex-start; }
.hub-cs-cal-shift, .hub-cs-cal-event, .hub-cs-cal-closed, .hub-cs-cal-more {
  display: block; font-size: 11px; line-height: 1.35; border-radius: 3px; padding: 1px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-cs-cal-shift  { background: var(--ok-bg); }
.hub-cs-cal-event  { background: var(--info-bg); color: #1e3a8a; font-weight: 600; }
.hub-cs-cal-closed { color: #92400e; font-weight: 600; }
.hub-cs-cal-more   { color: var(--text2); }

.hub-cs-detail { margin-top: var(--s2); }
.hub-cs-detail:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-cs-detail-h { margin: var(--s2) 0 4px; font-size: 13px; }
.hub-cs-detail-list { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }

@media (max-width: 640px) {
  .hub-cs-field-wide { grid-column: auto; }
}

@media print {
  .hub-cs-terms, .hub-cs-views, .hub-cs-cal-tools .hub-cs-field, .hub-cs-cal-tools .hub-btn,
  .hub-cs .hub-status-banner, .hub-cs-detail { display: none !important; }
  .hub-cs-cal-scroll { overflow: visible; }
  .hub-cs-cal { min-width: 0; }
  .hub-cs-cal-shift, .hub-cs-cal-event { white-space: normal; }
  .hub-cs-month { page-break-inside: avoid; }
}

/* The tab's full name is longer than the sidebar is wide. It wraps to two lines
   rather than being cut off with an ellipsis. Scoped to this one label. */
.ht-nav-label.hub-cs-nav-label { white-space: normal; overflow: visible; line-height: 1.25; }
