/* ARKHIVE — Calendar / schedule styles. Reuses brand.css tokens. */

/* ============ PUBLIC read-only calendar (Main) ============ */
.cal { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 940px) { .cal { grid-template-columns: 1fr; } }

.cal-cal { border: 1px solid rgba(28,28,30,0.12); border-radius: var(--radius); background: #fff; overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(28,28,30,0.1); }
.cal-mtitle { display: flex; align-items: baseline; gap: 10px; }
.cal-mtitle .y { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; color: var(--stone); }
.cal-mtitle .m { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.cal-mcount { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 3px 8px; margin-left: 4px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-navbtn { width: 36px; height: 36px; border: 1px solid rgba(28,28,30,0.18); background: #fff; border-radius: var(--radius); cursor: pointer; font-size: 18px; color: var(--ink); display: flex; align-items: center; justify-content: center; transition: all .14s; }
.cal-navbtn:hover { border-color: var(--ink); }
.cal-today { height: 36px; padding: 0 14px; border: 1px solid rgba(28,28,30,0.18); background: #fff; border-radius: var(--radius); cursor: pointer; font-family: var(--font-body); font-weight: 700; font-size: 12px; color: var(--ink); transition: all .14s; }
.cal-today:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wdrow { border-bottom: 1px solid rgba(28,28,30,0.08); background: var(--off); }
.cal-wd { padding: 9px 0; text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--stone); }
.cal-wd.sun { color: var(--red); }
.cal-day { min-width: 0; min-height: 96px; border-right: 1px solid rgba(28,28,30,0.06); border-bottom: 1px solid rgba(28,28,30,0.06); padding: 7px 7px 6px; position: relative; display: flex; flex-direction: column; gap: 4px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.empty { background: repeating-linear-gradient(-45deg, rgba(28,28,30,0.018) 0 6px, transparent 6px 12px); }
.cal-day.has { cursor: pointer; }
.cal-day.has:hover { background: var(--off); }
.cal-day.past { background: rgba(28,28,30,0.015); }
.cal-day.past .cal-dnum { color: rgba(28,28,30,0.32); }
.cal-day.sel { background: var(--off); box-shadow: inset 0 0 0 2px var(--ink); }
.cal-dnum { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.cal-dnum.sun { color: var(--red); }
.cal-day.today .cal-dnum { background: var(--red); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 5px; background: var(--ink); color: #fff; border-radius: 3px; padding: 2px 6px; min-width: 0; max-width: 100%; }
.cal-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); flex: none; }
.cal-chip .t { font-family: var(--font-body); font-weight: 600; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; color: var(--stone); padding-left: 2px; }

/* side upcoming list */
.cal-side { border: 1px solid rgba(28,28,30,0.12); border-radius: var(--radius); background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.cal-sidehead { padding: 16px 18px 14px; border-bottom: 1px solid rgba(28,28,30,0.1); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-sidehead .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.cal-clear { border: 0; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--red); white-space: nowrap; }
.cal-list { display: flex; flex-direction: column; max-height: 470px; overflow-y: auto; }
.cal-up { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid rgba(28,28,30,0.06); align-items: center; }
.cal-up:last-child { border-bottom: 0; }
.cal-update { flex: none; width: 50px; text-align: center; }
.cal-update .d { font-family: var(--font-display); font-weight: 900; font-size: 26px; line-height: 0.9; display: block; }
.cal-update .mo { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; color: var(--stone); }
.cal-upbody { min-width: 0; }
.cal-upbody .nm { font-weight: 700; font-size: 14px; line-height: 1.25; }
.cal-upbody .ca { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--stone); margin-top: 4px; }
.cal-empty { padding: 28px 18px; text-align: center; font-size: 12.5px; color: var(--stone); }
.cal-note { padding: 12px 18px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--stone); background: var(--off); border-top: 1px solid rgba(28,28,30,0.07); }

@media (max-width: 540px) {
  .cal-day { min-height: 72px; }
  .cal-chip .t { font-size: 9px; }
}

/* ============ ADMIN schedule manager ============ */
.cadm-intro { display: flex; gap: 12px; align-items: flex-start; background: var(--off); border: 1px solid rgba(28,28,30,0.1); border-left: 2px solid var(--red); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.cadm-intro .tx { font-size: 13px; line-height: 1.6; color: var(--stone); }
.cadm-intro .tx b { color: var(--ink); }

.cadm-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cadm-stats { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--stone); }
.cadm-stats span { white-space: nowrap; }
.cadm-stats b { font-family: var(--font-display); font-size: 17px; color: var(--ink); margin-right: 5px; }

.cadm-table { border: 1px solid rgba(28,28,30,0.12); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cadm-rowhead, .cadm-row { display: grid; grid-template-columns: 116px minmax(150px,1fr) 120px 96px 38px; gap: 10px; align-items: center; padding: 11px 16px; }
.cadm-rowhead { background: var(--off); border-bottom: 1px solid rgba(28,28,30,0.1); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }
.cadm-row { border-bottom: 1px solid rgba(28,28,30,0.07); }
.cadm-row:last-child { border-bottom: 0; }
.cadm-row.hidden { background: rgba(28,28,30,0.02); }
.cadm-row.hidden .cadm-in { opacity: 0.55; }
.cadm-in { width: 100%; height: 38px; border: 1px solid rgba(28,28,30,0.16); border-radius: var(--radius); padding: 0 11px; font-family: var(--font-body); font-size: 14px; color: var(--ink); background: #fff; outline: none; transition: border-color .14s; }
.cadm-in:focus { border-color: var(--ink); }
.cadm-in.date { font-family: var(--font-mono); font-size: 12.5px; }
select.cadm-in { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--stone) 50%), linear-gradient(135deg, var(--stone) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* publish toggle */
.cadm-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.cadm-sw { width: 38px; height: 22px; border-radius: 999px; background: rgba(28,28,30,0.2); position: relative; transition: background .16s; flex: none; }
.cadm-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .16s; }
.cadm-toggle.on .cadm-sw { background: var(--tg-line); }
.cadm-toggle.on .cadm-sw::after { transform: translateX(16px); }
.cadm-toggle .tl { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; color: var(--stone); width: 42px; }
.cadm-toggle.on .tl { color: var(--tg-head); }
.cadm-del { width: 34px; height: 34px; border: 1px solid rgba(28,28,30,0.14); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--stone); display: flex; align-items: center; justify-content: center; transition: all .14s; }
.cadm-del:hover { border-color: var(--tr-line); color: var(--tr-line); background: var(--tr-fill); }

.cadm-add { margin-top: 14px; }
.cadm-split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1040px) { .cadm-split { grid-template-columns: 1fr; } }
.cadm-prevhead { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); margin: 2px 0 12px; }
/* preview calendar must stack (month over list) — its viewport breakpoint can't see the narrow admin column */
.cadm-prev .cal { grid-template-columns: 1fr; gap: 16px; }
.cadm-prev .cal-side { position: static; }
.cadm-prev .cal-list { max-height: 320px; }
@media (max-width: 720px) {
  .cadm-rowhead { display: none; }
  .cadm-row { grid-template-columns: 1fr 1fr; gap: 9px; }
}
