/* =============================================================
   CALENDAR MODULE STYLES
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────────── */
.cal-wrap {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  border: 1px solid var(--color-border, #e5e7eb);
  overflow: hidden;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.cal-month-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text, #111827);
  min-width: 200px;
  text-align: center;
  margin: 0;
}

.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--color-border, #e5e7eb);
  color: var(--color-text-muted, #6b7280);
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.cal-nav:hover {
  background: var(--color-bg, #f9fafb);
  color: var(--color-text, #111827);
}

.cal-today-btn {
  margin-left: auto;
}

/* ── Grid ────────────────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* Header row */
.cal-hdr {
  padding: 10px 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-bg, #f9fafb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

/* Day cells */
.cal-cell {
  min-height: 90px;
  padding: 8px;
  border-right: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  position: relative;
  vertical-align: top;
  transition: background 0.1s;
}

.cal-cell:nth-child(7n) {
  border-right: none;
}

.cal-cell--empty {
  background: var(--color-bg, #f9fafb);
  min-height: 90px;
}

.cal-cell--weekend {
  background: var(--color-bg, #f9fafb);
}

.cal-cell--weekend .cal-day-num {
  color: var(--color-text-muted, #9ca3af);
}

/* Today */
.cal-cell--today {
  background: #eff6ff;
}

.cal-cell--today .cal-day-num {
  background: var(--color-primary, #2563eb);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Bank holiday */
.cal-cell--bh {
  background: #fffbeb;
}

.cal-cell--bh.cal-cell--today {
  background: linear-gradient(135deg, #eff6ff 50%, #fffbeb 100%);
}

/* Day number */
.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text, #374151);
  margin-bottom: 4px;
}

/* Bank holiday tag */
.cal-bh-tag {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #92400e;
  background: #fde68a;
  border-radius: 4px;
  padding: 2px 5px;
  margin-bottom: 4px;
  line-height: 1.3;
  word-break: break-word;
}

/* Leave chips */
.cal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

.cal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  cursor: default;
}

.cal-chip--more {
  background: var(--color-border, #d1d5db);
  color: var(--color-text, #374151);
  font-size: 0.6rem;
  font-weight: 600;
}

/* ── Legend ──────────────────────────────────────────────────── */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg, #f9fafb);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
}

.cal-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cal-legend-dot--today  { background: #2563eb; border-radius: 50%; }
.cal-legend-dot--bh     { background: #fde68a; border: 1px solid #f59e0b; }
.cal-legend-dot--leave  { background: #2563eb; border-radius: 50%; }
.cal-legend-dot--weekend { background: var(--color-bg, #f3f4f6); border: 1px solid var(--color-border, #e5e7eb); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cal-cell {
    min-height: 64px;
    padding: 4px;
  }

  .cal-bh-tag {
    display: none;
  }

  .cal-month-title {
    font-size: 1rem;
    min-width: 140px;
  }
}

/* Room booking chips on calendar */
.cal-chip--room {
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: inline-block;
}
