/* Calendar views. Events vs ticket dates (onsale/presale) are visually distinct;
   pending = dashed outline, tracked = star + amber edge. */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .5rem 0; }
.cal-nav { display: flex; gap: .3rem; }
.cal-title { margin: 0; font-size: 1.15rem; min-width: 10rem; }
.cal-toolbar .filter { margin-left: auto; }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: 0; margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { display: inline-block; width: 1.4rem; height: .9rem; border-radius: 3px; border: 1px solid var(--border); }
.swatch.kind-event { background: var(--event-bg); border-color: var(--event-border); }
.swatch.kind-event.dec-pending { background: transparent; border: 2px dashed var(--event-border); }
.swatch.kind-onsale { background: var(--onsale-bg); border-color: var(--onsale-border); }
.swatch.kind-presale { background: var(--presale-bg); border-color: var(--presale-border); }
.swatch.is-tracked { background: var(--event-bg); border-left: 4px solid var(--tracked); }

/* items */
.cal-item {
  display: flex; align-items: baseline; gap: .3rem; min-width: 0;
  padding: .12rem .4rem; border-radius: 4px; text-decoration: none; font-size: .8rem; line-height: 1.35;
  background: var(--event-bg); color: var(--event-fg); border: 1px solid var(--event-border);
}
.cal-item:hover { filter: brightness(.96); text-decoration: underline; }
.cal-item .cal-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.kind-onsale { background: var(--onsale-bg); color: var(--onsale-fg); border-color: var(--onsale-border); }
.cal-item.kind-presale { background: var(--presale-bg); color: var(--presale-fg); border-color: var(--presale-border); }
.cal-item.dec-pending { background: transparent; border-style: dashed; border-width: 2px; color: var(--text); }
.cal-item.is-tracked { border-left: 4px solid var(--tracked); }
.cal-item.st-cancelled .cal-title-text { text-decoration: line-through; }
.cal-kind { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.cal-time { font-weight: 650; white-space: nowrap; }
.cal-loc { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-pending .cal-loc { color: var(--muted); }

.agenda-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.agenda-items .cal-item { font-size: .92rem; padding: .4rem .6rem; flex-wrap: wrap; }
.agenda-items .cal-item .cal-title-text { white-space: normal; font-weight: 600; }

/* day panel */
.day-panel { border-top: 4px solid var(--accent); }
.day-panel-head { display: flex; justify-content: space-between; align-items: center; }
.day-panel-head h2 { outline: none; margin: 0 0 .5rem; }

/* year view */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.mini-month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .7rem; }
.mini-month h3 { font-size: .95rem; margin-bottom: .3rem; }
.mini-month h3 a { color: var(--text); text-decoration: none; }
.mini-month h3 a:hover { text-decoration: underline; }
.mini-table { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.mini-table th { font-size: .68rem; color: var(--muted); font-weight: 600; text-align: center; }
.mini-table td { padding: 0; text-align: center; }
.day-btn {
  width: 100%; aspect-ratio: 1; min-height: 1.8rem; border: 1px solid transparent; border-radius: 4px;
  background: transparent; font-size: .75rem; cursor: pointer; position: relative; padding: 0; color: var(--text);
}
.day-btn:hover { border-color: var(--accent); }
.day-btn.heat-1 { background: var(--heat-1); }
.day-btn.heat-2 { background: var(--heat-2); }
.day-btn.heat-3 { background: var(--heat-3); color: #fff; }
.day-btn.heat-4 { background: var(--heat-4); color: #fff; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .day-btn.heat-3 { color: #fff; }
  .day-btn.heat-4 { color: #160b2e; }
}
.day-btn.has-onsale::after {
  content: ""; position: absolute; right: 2px; top: 2px; width: .4rem; height: .4rem;
  border-radius: 50%; background: var(--onsale-border); box-shadow: 0 0 0 1px var(--surface);
}
.day-btn.is-today { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.day-btn.is-selected { box-shadow: 0 0 0 2px var(--text); }

/* month view */
.month-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.month-head, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head div { padding: .4rem; font-size: .78rem; font-weight: 650; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); }
.month-cell { min-height: 7rem; padding: .25rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.month-cell:nth-child(7) { border-right: 0; }
.month-cell.out { background: var(--surface-2); }
.month-cell.out .day-num { color: var(--muted); }
.month-cell.is-today .day-num { background: var(--accent); color: var(--accent-text); }
.month-cell.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }
.day-num {
  align-self: flex-start; border: 0; background: transparent; cursor: pointer;
  font-size: .8rem; font-weight: 650; border-radius: 999px; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem;
  display: inline-flex; align-items: center; gap: .25rem;
}
.day-num:hover { background: var(--surface-2); }
.dot-count { display: none; font-size: .68rem; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 0 .3rem; }
.chips { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.more-btn { border: 0; background: none; color: var(--accent); font-size: .75rem; cursor: pointer; text-align: left; padding: .1rem .2rem; }

@media (max-width: 700px) {
  .month-cell { min-height: 3.2rem; align-items: center; }
  .month-cell .chips { display: none; }
  .month-cell.has-items .dot-count { display: inline-block; }
  .day-num { flex-direction: column; height: auto; gap: 0; padding: .15rem .3rem; }
  .cal-toolbar .filter { margin-left: 0; width: 100%; }
}

/* week view */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.week-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; min-height: 10rem; min-width: 0; }
.week-day.is-today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.week-day h3 { font-size: .85rem; }
.week-day .agenda-items .cal-item { font-size: .8rem; padding: .3rem .4rem; }
@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
}

/* list view */
.agenda { display: flex; flex-direction: column; gap: 1rem; }
.agenda-day h3 { position: sticky; top: 6.5rem; background: var(--bg); padding: .3rem 0; z-index: 1; }
.agenda-day.is-today h3 { color: var(--accent); }
.agenda-day.is-past { opacity: .75; }
