/* Slotwise-specific layout: week calendar, slot picker, booking blocks and the
   engine notes. Shared tokens and components live in arvion.css. */

.main { padding-top: 20px; }

/* ---------- week view ---------------------------------------------------- */
.week-toolbar { margin-bottom: 12px; gap: 8px; }

.week-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
  align-items: start;
}
.week-card { overflow: hidden; min-width: 0; }
.week-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.week-side .card { padding: 16px; }

.week-head {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.wd-spacer { border-right: 1px solid var(--line); }
.wd-head {
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  border-left: 1px solid var(--line);
  transition: background 0.15s;
}
.wd-head:hover { background: rgba(255, 255, 255, 0.03); }
.wd-head.active { background: rgba(245, 194, 107, 0.18); box-shadow: inset 0 -2px 0 var(--gold); }
.wd-head .dow { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wd-head .dnum { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-2); line-height: 1.25; }
.wd-head.active .dnum { color: var(--gold); }
.wd-head.today .dnum { color: var(--gold); }

.week-body {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
}
.week-times { position: relative; height: var(--week-height, 572px); border-right: 1px solid var(--line); }
.week-times span {
  position: absolute; right: 8px; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 9.5px; color: var(--muted);
}
.week-col {
  position: relative;
  height: var(--week-height, 572px);
  border-left: 1px solid var(--line);
  min-width: 0;
  cursor: pointer;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    var(--line) 43px,
    var(--line) 44px
  );
}
.week-col.active { background-color: rgba(245, 194, 107, 0.035); }
.week-col.active::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.avail-band {
  position: absolute; left: 3px; right: 3px;
  background: rgba(245, 194, 107, 0.07);
  border-radius: 4px; pointer-events: none;
}
.booking-block {
  position: absolute; left: 4px; right: 4px; z-index: 2;
  border-radius: 6px; padding: 3px 5px; overflow: hidden;
  font-size: 9.5px; line-height: 1.25; font-weight: 600;
  color: #0d1220; cursor: pointer;
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.18);
}
.booking-block:hover { filter: brightness(1.08); }
.booking-block .b-time { font-family: var(--font-mono); font-size: 8.5px; opacity: 0.8; display: block; }
.booking-block .b-title { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.booking-block .b-who { display: block; font-weight: 500; opacity: 0.78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-block.gold { background: linear-gradient(180deg, #ffd98f, #f5c26b); }
.booking-block.blue { background: linear-gradient(180deg, #9dc0ff, #6f9dff); color: #06122b; }
.booking-block.green { background: linear-gradient(180deg, #9bf0d0, #34d399); color: #05271d; }
.booking-block.purple { background: linear-gradient(180deg, #d3c4ff, #a78bfa); color: #170b3a; }
.now-line { position: absolute; left: 0; right: 0; z-index: 3; border-top: 2px solid var(--red); pointer-events: none; }
.now-line::before {
  content: ""; position: absolute; left: -3px; top: -5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--red);
}
.week-loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- slot picker -------------------------------------------------- */
.slot-panel { max-height: 224px; overflow: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 2px; }
.slot-group { display: flex; flex-direction: column; gap: 3px; }
.slot-group .slot-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); font-weight: 600; }
.slot-staff { display: flex; flex-wrap: wrap; gap: 5px; }
.slot-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03);
  color: var(--text-2); border-radius: 8px; padding: 4px 7px;
  font: 500 10.5px/1.2 var(--font-sans); cursor: pointer;
}
.slot-chip:hover { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold); }
.slot-chip .dot-person { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.slot-chip b { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; }
.slot-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }

.week-stats { display: flex; flex-direction: column; gap: 6px; }
.week-stat { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 1px 0; }
.week-stat b { color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.week-stat .spacer { flex: 1; }
.week-stat .unit { font-size: 10.5px; }

.policy-row { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.policy-row:last-child { border-bottom: 0; }
.policy-row .fee { margin-left: auto; font-family: var(--mono, monospace); font-size: 11px; color: var(--gold); }
.policy-row .window { color: var(--text-2); }

/* ---------- bookings view ------------------------------------------------ */
.booking-when { display: flex; flex-direction: column; gap: 2px; }
.booking-when .day { color: var(--text); font-size: 12.5px; font-weight: 600; }
.booking-when .time { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.booking-customer { display: flex; flex-direction: column; gap: 2px; }
.booking-customer .name { color: var(--text); font-size: 12.5px; font-weight: 600; }
.booking-customer .company { color: var(--muted); font-size: 11px; }
.booking-price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- engine notes ------------------------------------------------- */
.engine-steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.engine-steps li { padding: 3px 0; }
.engine-steps code, .engine-note code {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; font-size: 11.5px; color: var(--gold);
}
.overnight-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.overnight-slots span {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px;
}
.overnight-slots span.crosses { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.engine-note { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- settings ----------------------------------------------------- */
.rota-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.rota-row:last-child { border-bottom: 0; }
.rota-row .who { width: 90px; flex: none; color: var(--text); font-weight: 600; }
.rota-row .days { color: var(--muted); line-height: 1.6; }
.blackout-row { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blackout-row:last-child { border-bottom: 0; }
.blackout-row .reason { color: var(--text); font-weight: 600; }
.blackout-row .when { color: var(--muted); margin-left: auto; font-size: 11.5px; }

.action-row { display: flex; gap: 5px; justify-content: flex-end; }

/* ---------- responsive --------------------------------------------------- */
@media (max-width: 1180px) {
  .week-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .booking-block { font-size: 8.5px; }
}
@media (max-width: 980px) {
  .week-layout { grid-template-columns: 1fr; }
  .week-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .week-side { grid-template-columns: 1fr; }
  .week-head, .week-body { grid-template-columns: 40px repeat(7, minmax(64px, 1fr)); }
  .week-card { overflow-x: auto; }
  .week-grid-inner { min-width: 720px; }
}
