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

/* ── Tabs (Schedule / Tasks / Firm cases) ─────────────────── */
.cal-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}
.cal-tab {
  background: none;
  border: none;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
}
.cal-tab:hover { color: var(--ink); }
.cal-tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.cal-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.cal-pane.hidden { display: none; }

.cal-grid {
  display: grid;
  grid-template-columns: 1fr 18rem;
  gap: 1.25rem;
  flex: 1;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-month-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; min-width: 12rem; text-align: center; }
.cal-nav-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0.4rem 0.6rem;
  cursor: pointer; transition: all var(--t); color: var(--mid);
}
.cal-nav-btn:hover { border-color: var(--ink); color: var(--ink); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  text-align: center; margin-bottom: 0.35rem;
}
.cal-weekday { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.35rem; }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 0.15rem; }
.cal-day {
  padding: 0.3rem;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t);
  position: relative;
  min-height: 5rem;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cal-day:hover { background: var(--border-2); }
.cal-day.today .cal-day-num { background: var(--gold); color: var(--white); border-radius: 50%; width: 1.5rem; height: 1.5rem; display: flex; align-items: center; justify-content: center; }
.cal-day.other-month .cal-day-num { color: var(--muted); opacity: 0.4; }
.cal-day.weekend .cal-day-num { color: var(--muted); }
.cal-day-num { font-size: 0.8125rem; font-weight: 500; margin-bottom: 0.2rem; }
.cal-day.holiday { background: var(--danger-bg); }
.cal-day.holiday .cal-day-num { color: var(--danger); }

/* ── Inline event snippets (Google Calendar style) ──────────── */
.cal-ev {
  font-size: 0.6rem;
  line-height: 1.3;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
  cursor: pointer;
}
.cal-ev-time { font-weight: 600; }
.cal-ev-court    { background: #c0392b; }
.cal-ev-meeting  { background: #2980b9; }
.cal-ev-deadline { background: #B5651D; }
.cal-ev-other    { background: var(--gold); color: var(--ink); }
.cal-ev-more {
  font-size: 0.6rem;
  color: var(--muted);
  padding: 0 0.3rem;
  font-weight: 500;
}


/* ── Schedule tasks rail ────────────────────────────────────── */
.schedule-task-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.schedule-task-row:hover { background: var(--surface); }
.schedule-task-row + .schedule-task-row {
  border-top: 1px solid var(--border);
}
.schedule-task-check {
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: all var(--t);
}
.schedule-task-row:hover .schedule-task-check {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-bg);
}
.schedule-task-main { flex: 1; min-width: 0; }
.schedule-task-title {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.35;
}
.schedule-task-sub {
  font-size: 0.7rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
