/* Domaselo admin — Schedule (WP4; SPEC § 8.1). Prefix .sc- only, tokens only (§ 1.4). Role colours arrive as
   style="--c:#RRGGBB" (App.color); washes are color-mix() of --c. The demo's look: 56 px rows, 46 px tiles,
   9 px radii, the spring on press, the tile-in pop. */

/* ---------- header ---------- */
.sc-hdr { padding-right: 16px; }
.pane.split .sc-hdr { padding-right: 30px; }
.sc-hdr .title-block { flex: 0 1 auto; max-width: 190px; }
.sc-chips { display: flex; gap: 6px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.sc-chips .fchip { max-width: 150px; flex: 0 1 auto; }
.sc-mode-btn { padding: 0 14px 0 16px; }
.sc-req-pill .badge { position: relative; z-index: 1; }
.sc-more { position: relative; }
.sc-more .badge.dot { position: absolute; top: 7px; right: 7px; z-index: 2; box-shadow: 0 0 0 2px var(--bar-solid); }
.sc-pub.sc-hot { box-shadow: inset 0 0.5px 0 color-mix(in srgb, white 35%, transparent), 0 4px 16px color-mix(in srgb, var(--accent) 38%, transparent); }

/* ---------- the scroller (no top padding: the 76 px spacer keeps sticky offsets exact) ---------- */
.sc-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.sc-pad { height: 76px; }
.sc-empty .empty { padding: 28px 24px 24px; }

/* ---------- week grid ---------- */
.sc-grid { --team: 200px; display: grid; grid-template-columns: var(--team) repeat(7, minmax(0, 1fr)); min-width: 100%; }
.pane.narrow .sc-grid, .pane.narrow .sc-day { --team: 150px; }
.sc-grid > div { min-width: 0; }
.sc-hc {
  position: sticky; top: 76px; z-index: 2; height: 48px; padding: 9px 12px 0; background: var(--bg);
  box-shadow: inset 0 -1px 0 var(--line);
}
.sc-hc.col { box-shadow: inset 0 -1px 0 var(--line), inset 1px 0 0 var(--line2); }
.sc-hc.team { padding-left: 16px; }
.sc-t1 { font-size: 14px; color: var(--label-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-t1 b { color: var(--label); font-weight: 600; }
.sc-hc.team .sc-t1 { color: var(--label); font-weight: 600; }
.sc-t2 { font-size: 11px; color: var(--label-2); margin-top: 3px; }
.sc-t2.hot { color: var(--orange); font-weight: 600; }
.sc-hc.today .sc-t1 b { color: var(--accent-text); }
.sc-hc.chg .sc-t1, .sc-hc.chg .sc-t1 b { color: var(--accent-text); }
.sc-hc.chg { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }

.sc-job {
  grid-column: 1 / -1; height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  font-size: 12px; font-weight: 700; background: var(--line2); box-shadow: inset 0 -1px 0 var(--line);
}
.sc-job-nm { white-space: nowrap; }
.sc-job-sub { color: var(--label-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-job.open .sc-job-nm { color: var(--label); }

.sc-pc {
  min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; min-width: 0;
  box-shadow: inset 0 -1px 0 var(--line2); transition: background 300ms ease;
}
.sc-pc-tx { min-width: 0; flex: 1; }
.sc-nm { font-size: 13px; font-weight: 600; }
.sc-hr { font-size: 11px; color: var(--label-2); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.sc-ot {
  flex: none; height: 16px; padding: 0 5px; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  display: inline-grid; place-items: center; color: var(--orange); background: color-mix(in srgb, var(--orange) 18%, transparent);
}
.sc-av-open { color: var(--c, var(--label-2)); background: color-mix(in srgb, var(--c, var(--gray)) 16%, transparent); }
.sc-av-open svg { width: 12px; height: 12px; }

.sc-cell {
  position: relative; min-height: 56px; padding: 5px 4px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: inset 0 -1px 0 var(--line2), inset 1px 0 0 var(--line2); transition: background 300ms ease;
}
.sc-cell.chg, .sc-pc.chg { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.sc-cell.past { background: color-mix(in srgb, var(--fill-subtle) 50%, transparent); }
.sc-cell.past.chg { background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* the "+" that adds a shift: fills an empty cell, a small corner button otherwise */
.sc-add {
  position: absolute; right: 4px; bottom: 3px; width: 20px; height: 20px; border-radius: 6px; z-index: 1;
  display: grid; place-items: center; color: var(--label-2); opacity: 0;
  background: var(--fill); transition: opacity 160ms ease, transform 380ms var(--spring);
}
.sc-add svg { width: 11px; height: 11px; }
.sc-add.fill { inset: 5px 4px; width: auto; height: auto; border-radius: 9px; background: none; box-shadow: inset 0 0 0 1px var(--line); }
.sc-add.fill svg { width: 15px; height: 15px; }
.sc-cell:hover .sc-add, .sc-add:focus-visible { opacity: 1; }
.sc-add:hover { color: var(--label); }
.sc-add:active { transform: scale(0.94); }

/* ---------- tiles ---------- */
.sc-tile {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: stretch; width: 100%; min-width: 0;
  height: 46px; border-radius: 9px; padding: 6px 9px; text-align: left; overflow: hidden; flex: none;
  --wash: 20%; background: color-mix(in srgb, var(--c, var(--gray)) var(--wash), transparent);
  transition: transform 420ms var(--spring), box-shadow 240ms ease, background 240ms ease, opacity 200ms ease;
}
.sc-tile:hover { transform: translateY(-1px); }
.sc-tile:active { transform: scale(0.96); }
.sc-tm { font-size: 13px; font-weight: 600; white-space: nowrap; }
.sc-hh { font-size: 11px; font-weight: 500; margin-top: 2px; white-space: nowrap; color: var(--c, var(--label-2)); }
.sc-tile.sel { --wash: 36%; box-shadow: inset 0 0 0 1.5px var(--c, var(--gray)); }
.sc-tile.edited { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sc-tile.open { --wash: 9%; box-shadow: inset 0 0 0 1px var(--edge); }
.sc-tile.open .sc-hh { color: var(--label-2); }
.sc-tile.open.edited { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sc-tile.open.sel { box-shadow: inset 0 0 0 1.5px var(--c, var(--gray)); }
.sc-tile.draft, .sc-bar.draft {
  background:
    repeating-linear-gradient(135deg, var(--stripe) 0 6px, transparent 6px 12px),
    color-mix(in srgb, var(--c, var(--gray)) 16%, transparent);
}
.sc-tile.draft.sel { box-shadow: inset 0 0 0 1.5px var(--c, var(--gray)); }
.sc-tile.past, .sc-bar.past { opacity: 0.7; }
.sc-tile.past:hover { transform: none; }
.sc-tile.pending, .sc-bar.pending { opacity: 0.6; }
.sc-tile.new { animation: scTileIn 560ms var(--spring-pop) both; }
@keyframes scTileIn { from { opacity: 0; transform: scale(0.8); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.sc-tag {
  position: absolute; top: 4px; right: 4px; height: 15px; padding: 0 4px; border-radius: 4px;
  font-size: 10px; line-height: 13px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--label-2); border: 1px dashed var(--label-2); background: var(--bg);
}
.sc-loc {
  position: absolute; right: 5px; bottom: 5px; width: 14px; height: 14px; border-radius: 7px;
  display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--label-2); background: var(--fill);
}
.sc-tile.draft .sc-loc { bottom: 5px; }
.pane.cmp .sc-tag, .pane.narrow .sc-tag { display: none; }
.pane.cmp .sc-loc { display: none; }
.pane.cmp .sc-tile { padding: 5px 6px; }

/* time off */
.sc-off {
  display: grid; place-items: center; text-align: center; color: var(--label-2);
  background: var(--fill-subtle); box-shadow: inset 0 0 0 1px var(--line);
}
.sc-off .sc-tm { font-size: 11px; font-weight: 500; }
.sc-off.req { background: transparent; box-shadow: none; outline: 1px dashed var(--label-3); outline-offset: -1px; }

/* ---------- day timeline (4 AM – 12 AM) ---------- */
.sc-day { --team: 200px; display: grid; grid-template-columns: var(--team) minmax(0, 1fr); }
.sc-day > div { min-width: 0; }
.sc-ticks { position: sticky; padding: 0; }
.sc-tick { position: absolute; top: 18px; font-size: 12px; color: var(--label-2); translate: -50% 0; white-space: nowrap; }
.sc-tick.first { translate: 2px 0; }
.sc-tick.last { translate: calc(-100% - 4px) 0; }
.sc-track {
  position: relative; overflow: hidden; box-shadow: inset 0 -1px 0 var(--line2); cursor: copy;
  background-image: linear-gradient(to right, var(--line2) 1px, transparent 1px);
  background-size: calc(100% / 20) 100%;
}
.sc-track.past { cursor: default; }
.sc-barw { position: absolute; height: 40px; min-width: 0; }
.sc-bar {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; text-align: left;
  border-radius: 10px; padding: 5px 10px; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c, var(--gray)) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--gray)) 50%, transparent);
  transition: transform 420ms var(--spring), box-shadow 240ms ease;
}
.sc-bar:active { transform: scale(0.97); }
.sc-bar .sc-tm { font-size: 13px; }
.sc-bar.edited { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sc-bar.sel { background: color-mix(in srgb, var(--c, var(--gray)) 36%, transparent); box-shadow: inset 0 0 0 1.5px var(--c, var(--gray)); }
.sc-bar.open { box-shadow: inset 0 0 0 1px var(--edge); background: color-mix(in srgb, var(--c, var(--gray)) 10%, transparent); }
.sc-bar.sc-off { align-items: center; color: var(--label-2); }
.sc-now { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -0.5px; background: var(--accent); pointer-events: none; z-index: 1; }
.sc-ticks .sc-now { top: auto; bottom: 0; height: 10px; }
.sc-ticks .sc-now::after { content: ""; position: absolute; left: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 4px; background: var(--accent); }

/* ---------- month ---------- */
.sc-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 16px; gap: 8px; }
.sc-dh { font-size: 12px; color: var(--label-2); font-weight: 600; padding: 4px 6px; }
.sc-mc {
  height: 104px; border-radius: 14px; padding: 10px; min-width: 0; text-align: left; display: flex; flex-direction: column;
  background: var(--fill-subtle); box-shadow: inset 0 0 0 1px var(--line2);
  transition: background 200ms, transform 420ms var(--spring);
}
.sc-mc:hover { background: var(--fill); }
.sc-mc:active { transform: scale(0.97); }
.sc-mc.dim { opacity: 0.4; }
.sc-mc.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sc-mc.today .sc-dn { color: var(--accent-text); }
.sc-mc.loading .sc-dots, .sc-mc.loading .sc-ds { visibility: hidden; }
.sc-dn { font-size: 15px; font-weight: 600; }
.sc-dots { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.sc-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--c, var(--gray)); }
.sc-ds { margin-top: auto; font-size: 12px; color: var(--label-2); }
.pane.narrow .sc-mc { height: 86px; padding: 8px; }

/* ---------- the shift editor and the small pops ---------- */
.sc-ed, .sc-as, .sc-det, .sc-reqpop { display: flex; flex-direction: column; }
.sc-ed-title { margin: 0; font-size: 15px; font-weight: 700; }
.sc-ed-meta { color: var(--label-2); font-size: 12px; margin-top: 2px; }
.sc-ed-status { display: inline-flex; align-self: flex-start; margin-top: 8px; height: 22px; padding: 0 8px; border-radius: 11px; align-items: center; font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill); }
.sc-ed-status.draft { color: var(--label); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.sc-f { margin-top: 10px; gap: 4px; }
.sc-f .field-label { font-size: 12px; }
.sc-f .field-input { min-height: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.sc-f textarea.field-input { height: auto; min-height: 52px; padding: 7px 10px; line-height: 18px; }
.sc-f-hot .field-input { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sc-ed-row { display: flex; gap: 8px; align-items: flex-end; }
.sc-ed-row > .field { flex: 1; }
.sc-ed-len { flex: none; height: 34px; min-width: 38px; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.sc-ed-len.bad { color: var(--red); }
.sc-ed-rep { margin-top: 12px; }
.sc-ed-rep .field-label { font-size: 12px; }
.sc-ed-rep .chips { margin-top: 6px; }
.sc-ed-rep .chip.self { opacity: 1; }
.sc-ed-hint { font-size: 12px; color: var(--label-2); margin-top: 6px; }
.sc-ed-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 13px; line-height: 17px; color: var(--orange); }
.sc-ed-warn:empty { display: none; }
.sc-ed-warn svg { width: 15px; height: 15px; margin-top: 1px; }
.sc-ed-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.sc-ed-tile { height: 52px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--label); }
.sc-ed-tile svg { width: 16px; height: 16px; position: relative; z-index: 1; }
.sc-ed-tile span { position: relative; z-index: 1; white-space: nowrap; }
.sc-ed-tile.danger { color: var(--red); }
.sc-ed-tile:disabled { opacity: 0.4; }
.sc-ed-acts { display: flex; gap: 8px; margin-top: 14px; }
.sc-ed-acts .btn { flex: 1; min-width: 0; }

.sc-as-hint { font-size: 13px; color: var(--label-2); margin-top: 8px; }
.sc-as-list { margin-top: 8px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sc-as-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; text-align: left; transition: background 160ms; }
.sc-as-row:hover { background: var(--hover); }
.sc-as-row.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sc-as-row .ck { width: 14px; height: 14px; color: var(--accent-text); flex: none; }
.sc-as-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-as-nm { font-size: 14px; font-weight: 600; }
.sc-as-sub { font-size: 12px; color: var(--label-2); display: flex; align-items: center; gap: 4px; }
.sc-as-row.warn .sc-as-sub { color: var(--orange); }
.sc-as-w { width: 12px; height: 12px; }

.sc-det-chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.sc-chip { height: 22px; padding: 0 8px; border-radius: 11px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill); }
.sc-chip.st-draft { color: var(--label); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.sc-chip.st-edited { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sc-chip.st-published { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.sc-det-rows { margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.sc-det-row { display: flex; gap: 12px; font-size: 13px; }
.sc-det-row dt { flex: none; width: 82px; color: var(--label-2); }
.sc-det-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- requests (cards, sheet) ---------- */
.sheet.sc-req-sheet { width: 440px; }
.sc-rq-sub { text-align: center; font-size: 13px; color: var(--label-2); margin: -4px 0 12px; }
.sc-rq-seg { width: 100%; margin-bottom: 12px; }
.sc-rq-seg button { flex: 1; }
.sc-rq .empty { padding: 40px 16px; }
.sc-rq-list { display: flex; flex-direction: column; border-radius: 16px; background: var(--card); overflow: hidden; }
.sc-req { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; min-height: 64px; }
.sc-rq-list .sc-req + .sc-req { box-shadow: inset 0 1px 0 var(--sep); }
.sc-reqpop .sc-req { padding: 12px 0 0; }
.sc-req-body { flex: 1; min-width: 0; }
.sc-req-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sc-req-nm { font-size: 15px; font-weight: 600; }
.sc-kind {
  flex: none; height: 20px; padding: 0 7px 0 5px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--kc); background: color-mix(in srgb, var(--kc) 18%, transparent);
}
.sc-kind svg { width: 12px; height: 12px; }
.sc-kind.k-off { --kc: var(--orange); }
.sc-kind.k-trade { --kc: var(--blue); }
.sc-kind.k-cover { --kc: var(--purple); }
.sc-req-line { font-size: 13px; margin-top: 3px; }
.sc-req-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; line-height: 16px; }
.sc-req-acts { display: flex; gap: 8px; flex: none; align-self: center; }
.sc-deny { background: var(--fill); }
.sc-approve { background: var(--green); color: var(--on-accent); }
.sc-pill { flex: none; align-self: center; height: 22px; padding: 0 9px; border-radius: 11px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; }
.sc-pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.sc-pill.no { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.sc-pill.wait { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }

/* ---------- light theme: role text a shade darker, washes a touch lighter (§ 1.4) ---------- */
:root[data-theme="light"] .sc-hh { color: color-mix(in srgb, var(--c, var(--gray)) 78%, black); }
:root[data-theme="light"] .sc-tile { --wash: 16%; }
:root[data-theme="light"] .sc-tile.sel { --wash: 30%; }
:root[data-theme="light"] .sc-tile.open { --wash: 7%; }
:root[data-theme="light"] .sc-tile.open .sc-hh { color: var(--label-2); }
:root[data-theme="light"] .sc-bar:not(.draft):not(.sel):not(.open):not(.sc-off) { background: color-mix(in srgb, var(--c, var(--gray)) 18%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .sc-tile.new { animation: none; }
  .sc-tile:hover { transform: none; }
}
