/* ════════════════════════════════════════════════════════════════
   SiteFlow — Deadlines calendar (feature file)
   Uses the tokens and components in sf-v3.css. Everything here is
   prefixed sf-cal- so removing this file removes only this screen.
   ════════════════════════════════════════════════════════════════ */

.tn, .sf-cal-sum b, .sf-cal-row .amt, .sf-cal-dlt .v, .sf-cal-grid .dn { }

/* ── Summary strip ────────────────────────────────────────────── */
.sf-cal-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-cal-sum .sf-stat.over { border-color: var(--dg-t); background: var(--dg-t); }
.sf-cal-sum .sf-stat span { margin-top: 2px; }
@media (min-width: 900px) {
  .sf-cal-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .sf-cal-sum .sf-stat { padding: 14px 16px; }
  .sf-cal-sum .sf-stat b { font-size: 26px; }
}

/* ── Month | List toggle ──────────────────────────────────────── */
.sf-cal-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 3px; gap: 3px; }
.sf-cal-seg.full { display: flex; width: 100%; box-sizing: border-box; }
body.v3 #app .sf-cal-seg button { all: unset; box-sizing: border-box; cursor: pointer; height: 32px; padding: 0 12px; border-radius: 4px; font-size: 14px; font-weight: 700; color: var(--n9); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sf-cal-seg.full button { flex: 1; height: 40px !important; font-size: 15px !important; }
.sf-cal-seg button .ms { font-size: 18px; }
body.v3 #app .sf-cal-seg button.on { background: var(--n9); color: #fff; }

/* Project filter (desktop): compact, unlike the full-width form selects */
body.v3 #app .sf-scr select.sf-cal-proj {
  width: auto; min-width: 200px; max-width: 280px; min-height: 40px; height: 40px;
  padding: 0 40px 0 12px !important; font-size: 14px !important; font-weight: 600; border-width: 1.5px !important;
}

/* ── Phone spacing ────────────────────────────────────────────── */
@media (max-width: 899px) {
  #sf-calendar .sf-filters { padding-top: 12px; }
}

/* ── Month bar (title, Today, prev / next) ────────────────────── */
.sf-cal-mbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line2); }
.sf-cal-mbar b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.sf-cal-mbar .nav { display: flex; align-items: center; gap: 4px; }
body.v3 #app .sf-cal-ib { all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; color: var(--n9); }
body.v3 #app .sf-cal-ib:hover { background: var(--ground); }
.sf-cal-ib .ms { font-size: 22px; }

/* ── Month grid (desktop) ─────────────────────────────────────── */
.sf-cal-month { overflow: hidden; }
.sf-cal-grid .hd, .sf-cal-grid .wkr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sf-cal-grid .hd span { padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--n5); border-bottom: 1px solid var(--line2); }
.sf-cal-grid .wkr + .wkr .cell { border-top: 1px solid var(--line2); }
.sf-cal-grid .cell { min-height: 112px; padding: 6px 6px 8px; border-left: 1px solid var(--line2); display: flex; flex-direction: column; gap: 3px; min-width: 0; box-sizing: border-box; }
.sf-cal-grid .cell:first-child { border-left: none; }
.sf-cal-grid .cell.we { background: #FAFBFC; }
.sf-cal-grid .cell.out { background: var(--ground); }
.sf-cal-grid .cell.out .dn { color: var(--n4); opacity: .7; }
.sf-cal-grid .cell.has { cursor: pointer; }
.sf-cal-grid .cell.has:hover { box-shadow: inset 0 0 0 1px var(--line); }
.sf-cal-grid .cell:focus-visible { outline: 2px solid var(--n9); outline-offset: -2px; }
.sf-cal-grid .dn { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; box-sizing: border-box; border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--n9); margin-bottom: 2px; }
.sf-cal-grid .cell.now { background: #fff; box-shadow: inset 0 0 0 2px var(--or); }
.sf-cal-grid .cell.now .dn { background: var(--or); color: var(--n9); }

/* Event pills */
body.v3 #app .sf-cal-grid .pill { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; height: 22px; line-height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--dr-t); color: var(--n9); }
body.v3 #app .sf-cal-grid .pill.over { background: var(--dg); color: #fff; }
body.v3 #app .sf-cal-grid .pill.today { background: var(--or); color: var(--n9); }
body.v3 #app .sf-cal-grid .pill.soon { background: var(--or-t); color: var(--or-ink); }
body.v3 #app .sf-cal-grid .pill.later { background: var(--dr-t); color: var(--n9); }
body.v3 #app .sf-cal-grid .pill.past { background: transparent; color: var(--n4); box-shadow: inset 0 0 0 1px var(--line); }
body.v3 #app .sf-cal-grid .pill:hover { filter: brightness(.96); }
body.v3 #app .sf-cal-grid .more { all: unset; box-sizing: border-box; cursor: pointer; padding: 0 7px; font-size: 12px; font-weight: 700; color: var(--n5); height: 20px; line-height: 20px; }
body.v3 #app .sf-cal-grid .more:hover { color: var(--n9); text-decoration: underline; }

/* Legend */
.sf-cal-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--line2); font-size: 13px; color: var(--n5); }
.sf-cal-leg span { display: inline-flex; align-items: center; gap: 6px; }
.sf-cal-leg i { width: 10px; height: 10px; border-radius: 100px; background: var(--dr-t); }
.sf-cal-leg i.over { background: var(--dg); } .sf-cal-leg i.soon { background: var(--or); } .sf-cal-leg i.later { background: var(--n5); }
.sf-cal-leg i.past { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }

/* ── Month grid (phone, compact with dots) ────────────────────── */
.sf-cal-phm { margin: 12px 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sf-cal-phm .sf-cal-mbar { padding: 8px 6px 8px 14px; }
.sf-cal-phm .sf-cal-mbar b { font-size: 17px; }
.sf-cal-grid.compact .hd span { padding: 6px 0; text-align: center; font-size: 12px; }
.sf-cal-grid.compact .cell { min-height: 48px; padding: 4px 0 6px; align-items: center; gap: 2px; border-left: none; }
.sf-cal-grid.compact .wkr + .wkr .cell { border-top: 1px solid var(--line2); }
.sf-cal-grid.compact .cell.we { background: #fff; }
.sf-cal-grid.compact .cell.out { background: #fff; }
.sf-cal-grid.compact .cell.now { box-shadow: none; }
.sf-cal-grid.compact .dn { align-self: center; margin: 0; font-size: 14px; min-width: 28px; height: 28px; }
.sf-cal-grid.compact .cell.has:hover { box-shadow: none; }
.sf-cal-grid.compact .cell.has:active { background: var(--ground); }
.sf-cal-grid .dots { display: flex; gap: 3px; height: 6px; }
.sf-cal-grid .dots i { width: 6px; height: 6px; border-radius: 100px; background: var(--n5); }
.sf-cal-grid .dots i.over { background: var(--dg); }
.sf-cal-grid .dots i.today, .sf-cal-grid .dots i.soon { background: var(--or); }
.sf-cal-grid .dots i.past { background: var(--line); }

/* ── Rows ─────────────────────────────────────────────────────── */
.sf-cal-row .amt { font-size: 15px; }
.sf-cal-row.past .t, .sf-cal-dlt.past .t { color: var(--n5); }
.sf-cal-dlt.past .sf-tile, .sf-cal-row.past .sf-tile { background: var(--ground); color: var(--n5); }
.sf-cal-dlt.past .sf-tile i, .sf-cal-row.past .sf-tile i { text-transform: none; letter-spacing: 0; }

/* Desktop list view: day headers inside the card */
.sf-cal-dh { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #FAFBFC; border-bottom: 1px solid var(--line2); font-size: 14px; font-weight: 700; color: var(--n9); }
.sf-cal-dh:not(:first-child) { border-top: 1px solid var(--line); }
.sf-cal-dh span { font-size: 13px; font-weight: 600; color: var(--n5); }
.sf-cal-dh.over { color: var(--dg-ink); background: var(--dg-t); }
.sf-cal-dh.over span { color: var(--dg-ink); }

/* ── Desktop: Next 30 days agenda card ────────────────────────── */
.sf-cal-ag { overflow: hidden; }
.sf-cal-ag .wk { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: #FAFBFC; border-bottom: 1px solid var(--line2); font-size: 13px; font-weight: 700; color: var(--n9); }
.sf-cal-ag .wk span { font-weight: 600; color: var(--n5); }
.sf-cal-ag .wk.over { color: var(--dg-ink); background: var(--dg-t); }
.sf-cal-ag .wk.over span { color: var(--dg-ink); }
body.v3 #app .sf-cal-ag .ar { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 16px; border-bottom: 1px solid var(--line2); }
body.v3 #app .sf-cal-ag .ar:hover { background: #FAFBFC; }
.sf-cal-ag .ar:last-child { border-bottom: none; }
.sf-cal-ag .dt { width: 40px; height: 40px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; background: var(--dr-t); color: var(--n9); }
.sf-cal-ag .dt b { font-size: 16px; font-weight: 800; }
.sf-cal-ag .dt i { font-style: normal; font-size: 11px; font-weight: 600; margin-top: 2px; }
.sf-cal-ag .dt.over { background: var(--dg); color: #fff; }
.sf-cal-ag .dt.today { background: var(--or); color: var(--n9); }
.sf-cal-ag .dt.soon { background: var(--or-t); color: var(--or-ink); }
.sf-cal-ag .tx { min-width: 0; display: flex; flex-direction: column; }
.sf-cal-ag .tx .k { font-size: 12px; font-weight: 700; }
.sf-cal-ag .tx .t { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-cal-ag .tx .j { font-size: 12px; color: var(--n5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-cal-ag .v { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* Desktop layout: give the month grid the wider column */
@media (min-width: 900px) {
  .sf-cal-2col { grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); }
  .sf-cal-help { margin-top: 20px; max-width: 760px; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .sf-cal-2col { grid-template-columns: minmax(0, 1fr); }
  .sf-cal-grid .cell { min-height: 96px; }
}
