/* ═══════════════════════════════════════════
   SCHEDULE CALENDAR (Gantt-style)
═══════════════════════════════════════════ */
.sched-page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  align-items: stretch;
}
.sched-cal {
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sched-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.sched-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
}
.sched-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.sched-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
  font-size: 13px;
}
.sched-nav-btn:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.sched-range {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.sched-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.sched-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sched-day-cell {
  padding: 12px 14px;
  text-align: center;
  border-right: 1px solid var(--border-lo);
}
.sched-day-cell:last-child {
  border-right: none;
}
.sched-day-cell.today {
  background: var(--brass-soft);
}
.sched-dow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 2px;
}
.sched-day-cell.today .sched-dow {
  color: var(--brass);
}
.sched-day-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
}
.sched-day-cell.today .sched-day-num {
  color: var(--brass);
}

.sched-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 12px 0;
}
.sched-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 0;
}
.sched-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  pointer-events: none;
}
.sched-grid-line {
  border-right: 1px solid var(--border-lo);
}
.sched-grid-line:last-child {
  border-right: none;
}
.sched-grid-line.today-col {
  background: var(--brass-soft);
  opacity: 0.35;
}

.sched-bar-wrap {
  position: relative;
  min-width: 0;
}

.sched-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border-left: 3px solid;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition:
    box-shadow 0.12s,
    transform 0.12s;
  text-decoration: none;
  color: inherit;
  min-height: 38px;
  margin: 2px 6px;
  animation: risein 0.3s ease both;
}
.sched-bar:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.sched-bar-body {
  flex: 1;
  min-width: 0;
}
.sched-bar-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-bar-detail {
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-bar-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sched-blocked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  margin: 2px 6px;
  min-height: 32px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(154, 171, 184, 0.12) 4px,
    rgba(154, 171, 184, 0.12) 8px
  );
  border: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-3);
}
.sched-blocked-label {
  font-weight: 500;
}

.sched-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-lo);
  background: var(--surface-lo);
  flex-shrink: 0;
}
.sched-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
}
.sched-legend-link {
  text-decoration: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition:
    background 0.12s,
    opacity 0.12s;
  opacity: 0.65;
}
.sched-legend-link:hover {
  background: var(--surface-hi);
  opacity: 1;
}
.sched-legend-active {
  opacity: 1;
  background: var(--surface-hi);
  box-shadow: 0 0 0 1px var(--border);
}
.sched-legend-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.sched-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-3);
  font-size: 13px;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════
   SALES CALENDAR — Week View (viewport-filling)
═══════════════════════════════════════════ */
.sc-week-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sc-week-header {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sc-week-corner {
  background: var(--surface-lo);
  border-right: 1px solid var(--border-lo);
}
.sc-week-day-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-right: 1px solid var(--border-lo);
}
.sc-week-day-cell:last-child {
  border-right: none;
}
.sc-week-day-cell.today {
  background: var(--brass-soft);
}
.sc-week-day-cell .sched-dow {
  margin-bottom: 0;
}
.sc-week-day-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
}
.sc-week-day-cell.today .sc-week-day-num {
  color: var(--brass);
}
.sc-week-body {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
.sc-week-header {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}
.sc-week-grid {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
}
/* Legacy class kept for the old flat grid layout */
.sales-time-grid {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
}
.sales-time-corner {
  background: var(--surface-lo);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-lo);
}
.sales-time-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  text-align: right;
  padding: 6px 6px 0 4px;
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  white-space: nowrap;
  line-height: 1;
}
.sales-time-cell {
  position: relative;
  padding: 3px 4px;
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  overflow-y: auto;
}
.sales-time-cell:last-child {
  border-right: none;
}
.sales-time-cell.today-col {
  background: var(--brass-soft);
  opacity: 1;
}

.sales-blocked-hour {
  margin-bottom: 3px;
  padding: 4px 6px;
  border-radius: 3px;
  border: 1px dashed var(--border);
  background: repeating-linear-gradient(
    -45deg,
    rgba(154, 171, 184, 0.1),
    rgba(154, 171, 184, 0.1) 4px,
    rgba(154, 171, 184, 0.18) 4px,
    rgba(154, 171, 184, 0.18) 8px
  );
  color: var(--text-2);
}

.sales-blocked-hour.continuation {
  padding: 3px 6px;
}

.sales-blocked-hour-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}

.sales-blocked-hour-detail {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.2;
}

.sales-appt {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 3px;
  border-left: 3px solid;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.12s;
  cursor: pointer;
  margin-bottom: 3px;
  line-height: 1.25;
}
.sales-appt:hover {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}
.sales-appt-inactive {
  opacity: 0.45;
}
.sales-appt-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sales-appt-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sales-appt-detail {
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sales-appt-status {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* Schedule sidebar (dashboard) */
.sched-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sched-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.sched-dt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  flex-shrink: 0;
}
.sched-day {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1;
}
.sched-dow {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.sched-card {
  flex: 1;
  background: var(--surface-hi);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  border-left: 3px solid;
}
.sched-job {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}
.sched-addr {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}
.sched-crew {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}

/* View toggle */
.sched-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.sched-view-btn {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-2);
  background: var(--surface);
  transition: all 0.12s;
  border-right: 1px solid var(--border);
}
.sched-view-btn:last-child {
  border-right: none;
}
.sched-view-btn:hover {
  background: var(--surface-hi);
  color: var(--text-1);
}
.sched-view-btn.active {
  background: var(--surface-hi);
  color: var(--text-1);
  font-weight: 600;
}

/* ═══ Sales Calendar — Viewport-filling Month Grid ═══ */
.sc-month-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sc-month-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sc-month-dow {
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-align: center;
}
.sc-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  min-height: 0;
}
.sc-month-day {
  position: relative;
  padding: 4px 5px;
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sc-month-day:nth-child(7n) {
  border-right: none;
}
.sc-month-day.outside {
  opacity: 0.35;
}
.sc-month-day.today {
  background: var(--brass-soft);
}
.sc-month-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
  flex-shrink: 0;
}
.sc-month-day-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1;
}
.sc-month-day.today .sc-month-day-num {
  color: var(--brass);
}
.sc-month-overflow {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  background: var(--surface-hi);
  padding: 1px 4px;
  border-radius: 3px;
}
.sc-month-bars {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sc-month-bar {
  display: flex;
  flex-direction: column;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.sc-month-bar-dead {
  background: transparent !important;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 400;
  font-style: italic;
}
.sc-month-bar-inactive {
  opacity: 0.5;
}
.sc-month-status-tag {
  margin-left: 4px;
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.sc-bar-name {
  text-overflow: ellipsis;
  overflow: hidden;
}
.sc-bar-addr {
  font-size: 8.5px;
  font-weight: 400;
  opacity: 0.75;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 1.2;
}
.sales-appt-addr {
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Monthly calendar — week-row layout with spanning bars (job schedule) */
.sched-month-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sched-month-wrapper > .sched-days {
  flex-shrink: 0;
}
.sched-month-week {
  flex: 1;
  min-height: var(--week-min-h, 80px);
  border-bottom: 1px solid var(--border);
}
.sched-month-week:last-child {
  border-bottom: none;
}
.sched-month-cell {
  padding: 8px 10px 6px;
  border-right: 1px solid var(--border-lo);
  border-bottom: 1px solid var(--border-lo);
  transition: background 0.12s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  align-self: stretch;
}
.sched-month-cell:nth-child(7n) {
  border-right: none;
}
.sched-month-cell:hover {
  background: var(--surface-hi);
}
.sched-month-cell.outside {
  opacity: 0.4;
}
.sched-month-cell.outside:hover {
  opacity: 0.6;
}
.sched-month-cell.today {
  background: var(--brass-soft);
}
.sched-month-cell.has-blocked {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(154, 171, 184, 0.08) 4px,
    rgba(154, 171, 184, 0.08) 8px
  );
}
.sched-month-cell.today.has-blocked {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 4px,
      rgba(154, 171, 184, 0.08) 4px,
      rgba(154, 171, 184, 0.08) 8px
    ),
    var(--brass-soft);
}
.sched-month-day-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1;
}
.sched-month-cell.today .sched-month-day-num {
  color: var(--brass);
}
.sched-month-blocked {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Spanning bar grid within each week row */
.sched-month-week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
  padding: 2px 0 6px;
}
.sched-month-bar-wrap {
  position: relative;
  min-width: 0;
  z-index: 2;
}
.sched-month-blocked-bar {
  z-index: 2;
}
.sched-month-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 0;
  border-left: 3px solid;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition:
    box-shadow 0.12s,
    transform 0.12s;
  text-decoration: none;
  color: inherit;
  height: 24px;
  margin: 0 1px;
  animation: risein 0.3s ease both;
}
.sched-month-bar.bar-start {
  border-radius: 3px 0 0 3px;
  margin-left: 4px;
}
.sched-month-bar.bar-end {
  border-radius: 0 3px 3px 0;
  margin-right: 4px;
}
.sched-month-bar.bar-start.bar-end {
  border-radius: 3px;
  margin-left: 4px;
  margin-right: 4px;
}
.sched-month-bar:hover {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.sched-month-bar-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Blocked date bars in month week rows */
.sched-month-blocked-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  margin: 0 4px;
  height: 24px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(154, 171, 184, 0.12) 4px,
    rgba(154, 171, 184, 0.12) 8px
  );
  border: 1px dashed var(--border);
  border-radius: 3px;
  font-size: 10px;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════
   SCHEDULE JOB POPOVER (click-to-schedule)
═══════════════════════════════════════════ */
.sj-popover {
  position: fixed;
  z-index: 9999;
  width: 290px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: sv-fadein 0.12s ease;
}

/* ═══════════════════════════════════════════
   SCHEDULE VISIT POPOVER (click-to-book)
═══════════════════════════════════════════ */
.sv-clickable {
  cursor: pointer;
}
.sv-clickable:hover::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 300;
  color: var(--text-3);
  opacity: 0.4;
  pointer-events: none;
}
/* Hide "+" when cell has appointments or popover open */
.sv-clickable:has(.sales-appt):hover::after,
.sv-clickable:has(.sv-popover):hover::after {
  content: none;
}

.sv-popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  width: 280px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  animation: sv-fadein 0.12s ease;
}
@keyframes sv-fadein {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sv-popover-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
}

.sv-job-results {
  display: none;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--surface);
}
.sv-job-result {
  padding: 7px 10px;
  font-size: 11.5px;
  color: var(--text-1);
  cursor: pointer;
  border-bottom: 1px solid var(--border-lo);
  transition: background 0.08s;
}
.sv-job-result:last-child {
  border-bottom: none;
}
.sv-job-result:hover {
  background: var(--surface-hi);
}
.sv-no-results {
  color: var(--text-3);
  font-style: italic;
  cursor: default;
}
.sv-no-results:hover {
  background: transparent;
}

.sv-job-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--surface-hi);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--text-1);
}
.sv-job-chip span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sv-job-chip-clear {
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
}
.sv-job-chip-clear:hover {
  color: var(--brass);
}
.sv-job-selected {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   DAY POPOVER (month view hover)
═══════════════════════════════════════════ */
.sched-month-cell {
  position: relative;
}

.sc-day-popover {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  margin-top: 2px;
  animation: sc-pop-in 0.12s ease;
}
.sc-day-popover.visible {
  display: block;
}
@keyframes sc-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sc-day-popover-header {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
}

.sc-day-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.sc-day-popover-appt {
  display: block;
  padding: 6px 8px;
  border-left: 3px solid;
  border-radius: 3px;
  background: var(--surface-hi);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.1s;
}
.sc-day-popover-appt:hover {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}
.sc-day-popover-appt.dead {
  opacity: 0.5;
}
.sc-day-popover-appt.dead .sc-day-popover-name {
  text-decoration: line-through;
}

.sc-day-popover-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  margin-bottom: 1px;
}

.sc-day-popover-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-day-popover-detail {
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sc-day-popover-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-3);
}

.sc-day-popover-stage {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-lo);
  border: 1px solid var(--border-lo);
}

.sc-day-popover-blocked-list {
  margin-bottom: 8px;
}
.sc-day-popover-blocked-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: 2px;
  border-radius: 3px;
  font-size: 10px;
  color: var(--text-3);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(154, 171, 184, 0.08) 3px,
    rgba(154, 171, 184, 0.08) 6px
  );
  border: 1px dashed var(--border-lo);
}
.sc-day-popover-blocked-who {
  font-weight: 500;
  color: var(--text-2);
}
.sc-day-popover-blocked-reason {
  color: var(--text-3);
}

.sc-day-popover-empty {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: 8px;
}

.sc-day-popover-link {
  display: block;
  font-size: 11px;
  color: var(--brass);
  text-decoration: none;
  padding-top: 6px;
  border-top: 1px solid var(--border-lo);
  transition: color 0.1s;
}
.sc-day-popover-link:hover {
  color: var(--text-1);
}

/* ═══════════════════════════════════════════
   BAR POPOVER (week view hover)
═══════════════════════════════════════════ */
.sc-bar-popover {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 280px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: sc-pop-in 0.12s ease;
}
.sc-bar-popover.visible {
  display: block;
}

.sc-bar-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-lo);
}

.sc-bar-popover-job-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}

.sc-bar-popover-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 11.5px;
  line-height: 1.4;
}

.sc-bar-popover-label {
  flex-shrink: 0;
  width: 72px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding-top: 1px;
}

.sc-bar-popover-value {
  flex: 1;
  min-width: 0;
  color: var(--text-1);
  word-break: break-word;
}

.sc-bar-popover-crew {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sc-bar-popover-duration {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-left: 4px;
}

.sc-bar-popover-link {
  display: block;
  font-size: 11px;
  color: var(--brass);
  text-decoration: none;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border-lo);
  transition: color 0.1s;
}
.sc-bar-popover-link:hover {
  color: var(--text-1);
}

/* Sidebar panels: remove rounding only on schedule page (not dashboard) */
.sched-sidebar .panel {
  border-radius: 0;
  border-left: none;
  border-right: none;
}
.sched-sidebar .panel:first-child {
  border-top: none;
}

@media (max-width: 1024px) {
  .sched-page-layout {
    grid-template-columns: 1fr;
  }
  .sched-month-grid .sched-month-cell {
    min-height: 100px;
  }
}

@media (max-width: 768px) {
  .sales-time-grid {
    overflow-x: auto;
    min-width: 600px;
  }
  .sched-cal {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sched-days {
    min-width: 600px;
  }
  .sched-body {
    min-width: 600px;
  }
  .sched-page-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .sched-legend {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
  }
  .sched-bar {
    font-size: 11px;
  }
  .sched-nav-btn {
    padding: 4px 8px;
  }
  .sched-month-grid {
    min-width: 600px;
    overflow-x: auto;
  }
  .sched-month-grid .sched-month-cell {
    min-height: 60px;
    padding: 6px;
  }
  .sched-month-wrapper {
    min-width: 600px;
    overflow-x: auto;
  }
  .sched-month-week-days {
    min-width: 600px;
  }
  .sched-month-week-bars {
    min-width: 600px;
  }
  .sched-month-week-days .sched-month-cell {
    min-height: 30px;
    padding: 4px 6px;
  }
  .sched-month-day-num {
    font-size: 13px;
  }
  .sv-popover {
    width: 260px;
    padding: 12px;
  }
  .sj-popover {
    width: 260px;
    padding: 12px;
  }
  .sc-day-popover {
    width: 240px;
    padding: 10px 12px;
  }
  .sc-bar-popover {
    width: 260px;
    padding: 10px 12px;
  }
}
