/* Agenda (public/modules/home.js) — week-by-week show timeline. Tokens only; see docs/BRAND.md. */

.ag-tabs .tabs { margin-bottom: 16px; }
.ag-count-bad { background: var(--bad-wash); color: var(--bad); font-weight: 600; }

/* ───── Controls ───── */
.ag-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ag-nav, .ag-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-step { width: 36px; padding: 0; justify-content: center; color: var(--graphite); }
.ag-range { font-size: 20px; font-weight: 700; margin-left: 8px; font-variant-numeric: tabular-nums; }
.ag-filters select { height: 36px; }
.ag-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r-ctl); background: var(--paper); padding: 2px; }
.ag-seg-btn { border: 0; background: none; font: inherit; font-weight: 600; color: var(--steel); height: 30px; padding: 0 12px; border-radius: 4px; cursor: pointer; }
.ag-seg-btn:hover { color: var(--graphite); }
.ag-seg-btn.on { background: var(--teal-wash); color: var(--teal-dark); }
.ag-glyph { display: block; flex-shrink: 0; }

/* ───── Layout: timeline + side rail ───── */
.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.ag-timeline { min-width: 0; transition: opacity .15s; }
.ag-timeline.is-loading { opacity: .55; }
.ag-side { position: sticky; top: 76px; }
.ag-side-card .card-body { padding-top: 0; }

/* ───── Week sections ───── */
.ag-week { margin-bottom: 22px; }
.ag-week-head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.ag-week-head h2 { font-size: 20px; }
.ag-week.is-now .ag-week-head { border-bottom-color: var(--graphite); }
.ag-week-count { margin-left: auto; font-size: 13px; }
.ag-week-empty { color: var(--steel); font-size: 13px; padding: 4px 2px 2px; }
.ag-list { display: flex; flex-direction: column; gap: 8px; }
.ag-empty { padding: 40px 24px; }

/* ───── Show card ───── */
.ag-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main status" "mini mini" "tags tags";
  gap: 10px 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 12px 16px 12px 20px; cursor: pointer; }
.ag-card:hover { border-color: #C3CAD2; }
.ag-card:focus-within { border-color: var(--graphite); }
.ag-card-main { grid-area: main; min-width: 0; }
.ag-card-status { grid-area: status; }
.ag-card-id { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ag-card-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--graphite); line-height: 1.2; }
.ag-card-name:hover { color: var(--teal); text-decoration: none; }
.ag-card-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; font-size: 13px; color: var(--graphite); }
.ag-k { color: var(--steel); font-size: 12px; margin-right: 4px; }

/* out → show → in mini-timeline */
.ag-mini { grid-area: mini; position: relative; padding-top: 2px; }
.ag-mini-rule { position: absolute; left: 5px; right: 5px; top: 7px; height: 2px; background: var(--rule); border-radius: 2px; }
.ag-mini-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tape, var(--steel)); border-radius: 2px; }
.ag-mini-today { position: absolute; top: -5px; width: 2px; height: 12px; background: var(--graphite); transform: translateX(-1px); }
.ag-mini-stops { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; position: relative; }
.ag-mini-stops li { display: flex; flex-direction: column; align-items: flex-start; gap: 0; font-size: 13px; min-width: 0; }
.ag-mini-txt { white-space: nowrap; }
.ag-mini-stops li:nth-child(2):not(:last-child) { align-items: center; text-align: center; }
.ag-mini-stops li:last-child:not(:first-child) { align-items: flex-end; text-align: right; }
.ag-mini-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--steel); margin-bottom: 5px; }
.ag-mini-stops li.is-past .ag-mini-dot { background: var(--graphite); border-color: var(--graphite); }
.ag-stop-show .ag-mini-dot { border-color: var(--tape, var(--steel)); }
.ag-mini-date { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 14px; color: var(--graphite); white-space: nowrap; }

/* related document tags */
.ag-tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--rule-soft); }
.ag-tag { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 10px; border: 1px solid var(--rule); border-radius: var(--r-ctl); color: var(--graphite); font-size: 13px; background: var(--paper); }
.ag-tag:hover { border-color: var(--teal); text-decoration: none; }
.ag-tag-kind { font-size: 12px; font-weight: 600; color: var(--steel); }
.ag-tag-num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.ag-tag-amt { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--graphite); }

/* documents with no show listed */
.ag-doc { display: grid; grid-template-columns: 84px minmax(0, 1.6fr) minmax(0, 1fr) 110px auto; gap: 12px; align-items: center; min-height: 44px;
  padding: 6px 14px 6px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-panel); color: var(--graphite); font-size: 13px; }
.ag-doc:hover { border-color: #C3CAD2; text-decoration: none; }
.ag-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-doc-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-doc-when { font-family: var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-doc-when.is-bad { color: var(--bad); font-weight: 700; }
.ag-doc-status { justify-self: end; }

/* ───── Side rail ───── */
.ag-side-counts, .ag-side-todos { list-style: none; margin: 0; padding: 0; }
.ag-side-counts li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); color: var(--steel); }
.ag-side-counts li:last-child { border-bottom: 0; }
.ag-side-counts li small { display: block; font-size: 12px; }
.ag-side-counts li.is-bad { color: var(--graphite); }
.ag-side-n { font-size: 22px; font-weight: 700; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; color: var(--steel); }
.ag-side-counts li.is-bad .ag-side-n { color: var(--bad); }
.ag-side-ok { margin: 0; color: var(--ok); }
.ag-side-todos li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13px; }
.ag-side-todos li:last-child { border-bottom: 0; }
.ag-side-subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-side-due { white-space: nowrap; font-size: 12px; }
.ag-side-due.is-bad { color: var(--bad); font-weight: 600; }
.ag-side-more { margin: 6px 0 0; font-size: 12px; }

/* ───── Month ───── */
.ag-month-note { font-size: 13px; }
.ag-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden; }
.ag-cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--steel); border-bottom: 1px solid var(--rule); }
.ag-cal-day { min-height: 112px; padding: 6px 0 8px; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); min-width: 0; }
.ag-cal-day:nth-child(7n) { border-right: 0; }
.ag-cal-day.is-other { background: #F7F8FA; }
.ag-cal-day.is-other .ag-cal-num { color: #A3ACB6; }
.ag-cal-num { font-family: var(--font-display); font-size: 14px; font-weight: 700; padding: 0 10px 4px; font-variant-numeric: tabular-nums; }
.ag-cal-day.is-today .ag-cal-num { color: var(--teal-dark); }
.ag-cal-day.is-today { box-shadow: inset 0 3px 0 var(--teal); }
.ag-cal-ev { display: block; height: 22px; line-height: 22px; margin: 3px 0; padding: 0 8px; font-size: 12px; color: var(--graphite); background: var(--concrete);
  box-shadow: inset 0 -3px 0 var(--tape, var(--steel)); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none !important; }
.ag-cal-ev.is-first { margin-left: 6px; border-radius: 4px 0 0 4px; }
.ag-cal-ev.is-last { margin-right: 6px; border-radius: 0 4px 4px 0; }
.ag-cal-ev.is-first.is-last { border-radius: 4px; }
.ag-cal-ev:hover { background: var(--rule); }
.ag-cal-more { font-size: 12px; color: var(--steel); padding: 0 10px; }
.ag-month-empty { margin-top: 12px; }

/* ───── Shortcuts ───── */
.ag-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ag-link { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); color: var(--graphite); text-decoration: none !important; }
.ag-link:hover { border-color: var(--teal); }
.ag-link-ico { width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--concrete); color: var(--graphite); display: grid; place-items: center; flex-shrink: 0; }
.ag-link strong { display: block; }
.ag-link small { color: var(--steel); font-size: 13px; }

/* ───── To-dos ───── */
.ag-todo-add { display: flex; gap: 8px; max-width: 820px; margin-bottom: 14px; flex-wrap: wrap; }
.ag-todo-add input[name="subject"] { flex: 1; min-width: 220px; height: 36px; }
.ag-todo-add input[type="date"] { height: 36px; }
.ag-todo { list-style: none; margin: 0; padding: 0; max-width: 820px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-panel); }
.ag-todo li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 14px; border-bottom: 1px solid var(--rule-soft); transition: opacity .3s; flex-wrap: wrap; }
.ag-todo li:last-child { border-bottom: 0; }
.ag-todo li label { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; flex: 1; }
.ag-todo input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); }
.ag-todo li.is-done { opacity: .35; text-decoration: line-through; }
.ag-todo-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--steel); white-space: nowrap; }
.ag-todo li.is-late .ag-todo-due { color: var(--bad); font-weight: 600; }

/* ───── Overdue ───── */
.ag-od .card-head .muted { font-size: 13px; }
.ag-od .tape-name, .ag-for .tape-name { font-weight: 400; }
.ag-od-ok { margin: 0; color: var(--steel); }
.ag-late { color: var(--bad); font-weight: 600; white-space: nowrap; }
.ag-for { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .ag-layout { grid-template-columns: 1fr; }
  .ag-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .ag-side .card { margin: 0; }
}
@media (max-width: 820px) {
  .ag-side { grid-template-columns: 1fr; }
  .ag-doc { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .ag-doc-client, .ag-doc-when { display: none; }
  .ag-cal-day { min-height: 84px; }
  .ag-cal-ev .tape-num { display: none; }
}
