/* ============================================================
   Business calendar (week view)
   ============================================================ */

.cal-main { padding: 24px 0 80px; }

.cal-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.cal-head h1 {
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: var(--font);
  font-weight: 600;
}
.cal-head .greet {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
}
.cal-nav .arrow {
  width: 30px; height: 30px;
  border: 0;
  background: transparent;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
}
.cal-nav .arrow:hover { background: var(--surface-3); }
.cal-nav .label {
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cal-nav .label .mono { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.cal-nav .today-btn {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--dark);
  color: var(--text-on-dark);
  border: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.view-seg { /* segmented control via .seg classes from operator.css */ }

/* ===== CALENDAR GRID ===== */
.cal-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.cal-days-head {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cal-days-head .corner {
  border-right: 1px solid var(--line);
}
.cal-days-head .day {
  padding: 14px 12px 12px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-days-head .day:last-child { border-right: 0; }
.cal-days-head .day.today {
  background: var(--surface);
  position: relative;
}
.cal-days-head .day.today::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--signal);
}
.cal-days-head .day-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cal-days-head .day-name .dn {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}
.cal-days-head .day-name .dd {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.cal-days-head .day.today .dn { color: var(--text); }
.cal-days-head .day.today .dd { color: var(--signal-on); }
.cal-days-head .day.today .day-name .dd {
  position: relative;
  padding: 1px 8px;
  background: var(--signal);
  border-radius: var(--r-sm);
}

.cal-days-head .day-load {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-2);
}
.cal-days-head .day-load.busy { background: var(--busy-soft); color: var(--busy); }
.cal-days-head .day-load.full { background: var(--wait-soft); color: var(--wait); }
.cal-days-head .day-load.light { background: var(--go-soft); color: var(--go); }

/* body — relative for now-line */
.cal-body {
  position: relative;
}

.cal-grid {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
}

.cal-time-col {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.cal-time-row {
  height: 56px;
  border-bottom: 1px solid var(--line);
  position: relative;
  padding-right: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
.cal-time-row span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: -6px;
  background: var(--surface);
  padding: 0 4px;
}
.cal-time-row:first-child span { margin-top: 4px; }

.cal-day-col {
  border-right: 1px solid var(--line);
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 28px,
      var(--line-faint) 28px 29px,
      transparent 29px 55px,
      var(--line) 55px 56px
    );
}
.cal-day-col:last-child { border-right: 0; }
.cal-day-col.today {
  background:
    linear-gradient(rgba(242, 198, 0, 0.03), rgba(242, 198, 0, 0.03)),
    repeating-linear-gradient(
      to bottom,
      transparent 0 28px,
      var(--line-faint) 28px 29px,
      transparent 29px 55px,
      var(--line) 55px 56px
    );
}
.cal-day-col.past { opacity: 0.6; }

.cal-day-content {
  position: relative;
  min-height: calc(56px * 17); /* 07:00 - 23:00 = 16 hours */
}

/* ===== BOOKING CARD on calendar ===== */
.bk-card {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: var(--r-sm);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform 100ms ease, box-shadow 100ms ease;
}
.bk-card:hover { transform: translateX(-1px); box-shadow: var(--sh-2); z-index: 10; }
.bk-card .bk-time {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0.85;
  margin-bottom: 2px;
}
.bk-card .bk-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-card .bk-customer {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* statuses */
.bk-done {
  background: var(--go-soft);
  color: var(--go);
  border-color: rgba(46, 125, 99, 0.25);
}
.bk-progress {
  background: var(--info-soft);
  color: var(--info);
  border-color: rgba(31, 76, 171, 0.25);
}
.bk-scheduled {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--line-strong);
}
.bk-pending {
  background: var(--wait-soft);
  color: var(--wait);
  border-color: rgba(180, 83, 9, 0.25);
}
.bk-new {
  background: var(--signal);
  color: var(--signal-on);
  border-color: var(--signal);
  font-weight: 600;
}
.bk-cancelled {
  background: var(--surface-2);
  color: var(--text-muted);
  border-style: dashed;
  text-decoration: line-through;
}
.bk-dark {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
}

/* now-line overlay */
.cal-now {
  position: absolute;
  left: 64px; right: 0;
  z-index: 6;
  pointer-events: none;
  height: 0;
}
.cal-now-line {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  background: repeating-linear-gradient(to right,
    var(--busy) 0 6px,
    var(--dark) 6px 12px);
}
.cal-now-dot {
  position: absolute;
  left: -5px; top: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--busy);
  border: 2px solid var(--surface);
}
.cal-now-label {
  position: absolute;
  right: 6px; top: -10px;
  background: var(--busy);
  color: white;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 4px;
}

/* ===== SIDEBAR / FILTERS ===== */
.cal-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  font-size: 12px;
}
.cal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-muted);
}
.cal-legend .item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cal-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid transparent;
}
.cal-summary {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
}
.cal-summary .item .v {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-left: 4px;
}

/* post filter chips */
.post-filter {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.post-filter .lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 6px;
}
.post-filter .chip { font-size: 12px; padding: 5px 12px; }
.post-filter .chip.active {
  background: var(--dark);
  color: var(--text-on-dark);
  border-color: var(--dark);
}
.post-filter .chip .swatch {
  width: 8px; height: 8px;
  border-radius: 50%;
}
