/* ================================================================
   calendar.css — schedule month grid + day agenda
   ================================================================ */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-lg); flex-wrap: wrap; }
.cal-title { font-family: var(--heading-font); font-size: 1.25rem; color: var(--dark); }

.calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.cal-dow { background: var(--panel-alt); padding: .4rem .25rem; text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.cal-cell { background: var(--panel); min-height: 100px; padding: .35rem; display: flex; flex-direction: column; gap: .2rem; }
.cal-cell.other-month { background: var(--bg); }
.cal-cell.today .cal-date { background: var(--accent); color: #fff; border-radius: 50%; }
.cal-date { font-size: .78rem; color: var(--muted); width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-event {
  font-size: .72rem; padding: .15rem .35rem; border-radius: var(--r-sm);
  background: var(--info-bg); color: var(--info); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid var(--info); line-height: 1.3;
}
.cal-event.emergency { background: var(--danger-bg); color: var(--emergency); border-left-color: var(--emergency); }
.cal-event.urgent { background: var(--warning-bg); color: var(--warning); border-left-color: var(--warning); }
.cal-event.paid { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.cal-event:hover { text-decoration: none; filter: brightness(.97); }

.agenda { display: flex; flex-direction: column; gap: .5rem; }
.agenda-item { display: flex; gap: var(--sp-md); padding: var(--sp-md); background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); }
.agenda-time { font-weight: 600; color: var(--primary); min-width: 80px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.agenda-body { min-width: 0; flex: 1; }
.agenda-title { font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-meta { font-size: .8rem; color: var(--muted); margin-top: .1rem; }

/* Tablet: smaller cells */
@media (max-width: 1024px) {
  .cal-cell { min-height: 80px; }
}

/* Mobile: dots instead of event labels */
@media (max-width: 640px) {
  .cal-cell { min-height: 54px; padding: .2rem; }
  .cal-date { font-size: .72rem; width: 20px; height: 20px; }
  .cal-event { display: none; }
  .cal-cell .ev-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; margin: 1px; }
  .cal-dow { font-size: .65rem; padding: .3rem .1rem; }
  .cal-toolbar { gap: var(--sp-sm); }
  .cal-title { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 42px; }
}
