/* css/schedule.css
   Pillar 3 schedule page — skeleton layout (basic). Cell-level styling +
   sticky headers + status colors ship in PR-A4b_ui_render together with
   the renderMatrix DOM build.
   Plan: docs/plans/2026-05-06-korolev-schedule-plan.md §11 task A4.5. */

:root {
  --slot-completed-bg: #d8e8d0;
  --slot-cancelled-bg: #efeae5;
  --slot-no-show-bg: #fde2dc;
  --slot-replaced-bg: #f4e8cc;
  --slot-replaced-fg: #8a6d2c;
}

body { background: var(--color-bg); font-family: 'Inter', sans-serif; margin: 0; }

.page-header { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: #fff; border-bottom: 1px solid var(--color-border); }
.page-header h1 { font-size: 20px; margin: 0; }
.page-header .header-right { display: flex; align-items: center; gap: 16px; }
.page-header .user-name { font-size: 14px; color: var(--color-text-muted); }
.page-header a { color: var(--color-primary); text-decoration: none; font-size: 14px; }

.page-content { max-width: 1200px; margin: 24px auto; padding: 0 24px; }

.schedule-view-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.schedule-view-tab { background: transparent; border: 0; padding: 10px 16px; font-size: 14px; cursor: pointer;
  color: var(--color-text-muted); border-bottom: 2px solid transparent; font-family: inherit; }
.schedule-view-tab:hover { color: var(--color-primary); }
.schedule-view-tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

.schedule-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.schedule-controls input[type="month"] { padding: 8px 12px; border: 1px solid var(--color-border);
  border-radius: 6px; font-size: 14px; font-family: inherit; }
.schedule-page-indicator { font-size: 13px; color: var(--color-text-muted); }

.schedule-state { padding: 24px; background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); text-align: center; color: var(--color-text-muted); }
.schedule-state-error { color: var(--color-danger); }
.schedule-state-loading::before { content: ''; display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%;
  margin-right: 8px; vertical-align: middle; animation: schedule-spin 1s linear infinite; }
@keyframes schedule-spin { to { transform: rotate(360deg); } }

.schedule-matrix { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 16px; overflow-x: auto; min-height: 80px; }

/* === Schedule grid (cell-level styles, A4b_ui_render R.3) === */
.schedule-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.schedule-grid thead th {
  position: sticky;
  top: 0;
  background: var(--color-primary-light, #e8f0e0);
  padding: 8px 6px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  z-index: 1;
}

.schedule-grid th.schedule-grid-corner,
.schedule-grid th.schedule-user-name {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  text-align: left;
  padding: 6px 12px;
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
}

.schedule-grid th.schedule-grid-corner {
  z-index: 3;
  background: var(--color-primary-light, #e8f0e0);
}

.schedule-grid td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  min-width: 80px;
}

.schedule-grid tbody tr:hover {
  background: rgba(45, 80, 22, 0.04);
}

.slot {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

.slot-planned   { background: #f0eee9; color: var(--color-text-muted); }
.slot-confirmed { background: var(--color-primary-light, #e8f0e0); color: var(--color-primary); }
.slot-active    { background: var(--color-primary); color: #fff; font-weight: 600; }
.slot-completed { background: var(--slot-completed-bg); color: var(--color-primary); }
.slot-cancelled { background: var(--slot-cancelled-bg); color: var(--color-text-muted); text-decoration: line-through; }
.slot-no_show   { background: var(--slot-no-show-bg); color: var(--color-danger); font-weight: 600; }
.slot-replaced  { background: var(--slot-replaced-bg); color: var(--slot-replaced-fg); }
