/* Yasa — rehearsal callboard
 * Design: cool daylight studio, graphite ink, velvet accent spent only where
 * it counts. Color elsewhere carries one meaning: attendance (green in,
 * amber partial, red out). Ledger rows, not card grids.
 */
:root {
  --paper: #F4F6F8;
  --panel: #FFFFFF;
  --hair: #E2E6EB;
  --hair2: #D4D9E0;
  --ink: #171B1F;
  --slate: #5B6570;
  --muted: #8B95A1;
  --velvet: #7A2E4D;
  --velvet-dark: #5E233C;
  --velvet-tint: #F3E4EA;
  --in-bg: #DFF0E1;    --in-ink: #1F6B3A;   --in-line: #BFE0C6;
  --part-bg: #FBEFD2;  --part-ink: #8A6410; --part-line: #ECD9A8;
  --out-bg: #FAE1DE;   --out-ink: #B03A2E;  --out-line: #F0C4BE;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 14.5px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, select {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--hair2); border-radius: 6px; padding: 7px 10px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--velvet); outline-offset: 1px;
}
time, .num { font-variant-numeric: tabular-nums; }

/* sign in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 336px; }
.login-card .word { font: 600 34px/1.1 var(--display); letter-spacing: -.02em; }
.login-card .word span { color: var(--velvet); }
.login-sub { color: var(--slate); margin: 6px 0 26px; }
.setup-row { margin-bottom: 18px; }
.setup-row input { text-align: center; font-size: 15px; }
.pin-boxes { display: flex; gap: 6px; justify-content: center; margin-bottom: 20px; }
.pin-box {
  width: 30px; height: 44px; border: 1px solid var(--hair2); border-radius: 6px;
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  font: 600 19px/1 var(--display);
}
.pin-box.filled { border-color: var(--velvet); background: var(--velvet-tint); }
.pin-box.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; }
.key {
  height: 50px; border-radius: 6px; background: var(--panel); border: 1px solid var(--hair);
  font: 500 17px/1 var(--body); transition: background .12s;
}
.key:hover { background: var(--velvet-tint); }
.key.wide { grid-column: span 2; }
.login-error { color: var(--out-ink); min-height: 20px; margin-top: 14px; font-size: 13.5px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 204px; flex: none; padding: 20px 12px 16px; display: flex; flex-direction: column;
  border-right: 1px solid var(--hair); position: sticky; top: 0; height: 100vh;
}
.brand { font: 600 21px/1 var(--display); letter-spacing: -.02em; padding: 2px 10px 18px; }
.brand em { font-style: normal; color: var(--velvet); }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--slate); width: 100%; text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--velvet-tint); color: var(--ink); }
.nav-item.active { color: var(--velvet); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 6px; }
.me-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.me-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.me-role { color: var(--muted); font-size: 12px; }
.signout { color: var(--muted); font-size: 12.5px; text-align: left; }
.signout:hover { color: var(--velvet); }

.main { flex: 1; min-width: 0; padding: 28px 36px 70px; max-width: 1120px; }
.view-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h1 { font: 600 24px/1.15 var(--display); letter-spacing: -.02em; margin: 0; }
.view-head .sub { color: var(--muted); font-size: 13.5px; }
.spacer { flex: 1; }
.back { color: var(--muted); font-size: 13px; }
.back:hover { color: var(--velvet); }

.btn {
  background: var(--velvet); color: #fff; border-radius: 6px; padding: 7px 14px;
  font-weight: 500; font-size: 14px;
}
.btn:hover { background: var(--velvet-dark); }
.btn.quiet { background: var(--panel); color: var(--ink); border: 1px solid var(--hair2); }
.btn.quiet:hover { border-color: var(--velvet); color: var(--velvet); background: var(--panel); }
.btn.stop { background: var(--out-bg); color: var(--out-ink); }
.pill {
  display: inline-flex; border-radius: 999px; padding: 1px 9px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill.full { background: var(--in-bg); color: var(--in-ink); }
.pill.partial { background: var(--part-bg); color: var(--part-ink); }
.pill.none { background: var(--out-bg); color: var(--out-ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* calendar */
.weekhead, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekhead { margin-bottom: 4px; }
.weekhead div { text-align: center; color: var(--muted); font-size: 12px; font-weight: 500; padding: 2px 0; }
.grid > * { animation: rise .3s both; animation-delay: calc(var(--i) * 7ms); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .grid > * { animation: none; } }
.cell {
  position: relative; min-height: 116px; border: 1px solid var(--hair); border-radius: var(--radius);
  background: var(--panel); padding: 8px 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cell:hover { border-color: var(--hair2); }
.cell.blank { background: transparent; border-color: transparent; cursor: default; }
.cell.noevent { background: transparent; }
.cell.noevent .date { color: var(--muted); font-weight: 500; }
.date {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 500 12.5px var(--body); font-variant-numeric: tabular-nums;
}
.cell.today .date { background: var(--velvet); color: #fff; font-weight: 600; }
.ev-title {
  font-weight: 500; font-size: 13.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ev-time { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cellbtn {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 5px;
  background: var(--panel); border: 1px solid var(--hair2); color: var(--slate);
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.cellbtn:hover { border-color: var(--velvet); color: var(--velvet); background: var(--velvet-tint); }
.cellbtn svg { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.chip {
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.chip.full { background: var(--in-bg); color: var(--in-ink); border-color: var(--in-line); }
.chip.partial { background: var(--part-bg); color: var(--part-ink); border-color: var(--part-line); }
.chip.none { background: var(--out-bg); color: var(--out-ink); border-color: var(--out-line); }
.chip:hover { filter: brightness(.97); }
.chip .n { opacity: .7; font-weight: 400; }

/* day ledger */
.callhead {
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px; display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
}
.callhead h2 { font: 600 18px/1.2 var(--display); margin: 0; }
.callhead .when { color: var(--slate); font-size: 14px; font-variant-numeric: tabular-nums; }
.ledgerhead { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ledgerhead select { width: auto; min-width: 170px; }
.section { font-size: 13px; font-weight: 600; color: var(--slate); margin: 22px 0 4px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 9px 2px;
  border-bottom: 1px solid var(--hair); background: transparent;
}
.row:last-child { border-bottom: none; }
.row .who { font-weight: 500; min-width: 140px; display: flex; align-items: center; gap: 9px; }
.row .why { color: var(--slate); font-size: 13px; flex: 1; }
.row .why b { color: var(--out-ink); font-weight: 500; }
.row .why i { color: var(--muted); }
.strip { flex: none; width: 180px; height: 10px; border-radius: 3px; overflow: hidden;
  display: flex; background: var(--in-bg); border: 1px solid var(--in-line); }
.strip i { display: block; height: 100%; background: var(--out-ink); opacity: .85; }
.empty-note { color: var(--muted); padding: 26px 0; text-align: center; }
.empty-note .word { font: 600 17px var(--display); color: var(--ink); display: block; margin-bottom: 4px; }

/* people + groups */
.card { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 6px 18px; margin-bottom: 16px; }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.line:last-child { border-bottom: none; }
.line .name { font-weight: 500; flex: 1; cursor: pointer; }
.line .name:hover { color: var(--velvet); }
.line .meta { color: var(--muted); font-size: 12.5px; }
.tag { font-size: 11.5px; color: var(--slate); border: 1px solid var(--hair2); border-radius: 999px; padding: 0 8px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.formgrid .full-width { grid-column: 1 / -1; }
label.fld { display: block; font-size: 12.5px; color: var(--slate); margin-bottom: 4px; }
.conflict { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.conflict:last-child { border-bottom: none; }
.conflict .desc b { font-weight: 500; }
.conflict .desc i { color: var(--muted); font-style: normal; font-size: 13px; }
.conflict .x { color: var(--muted); margin-left: auto; padding: 2px 8px; border-radius: 5px; }
.conflict .x:hover { color: var(--out-ink); background: var(--out-bg); }
.checkline { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.checkline:last-child { border-bottom: none; }
.checkline input { width: auto; }

/* modal */
.veil {
  position: fixed; inset: 0; background: rgba(23,27,31,.4); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px;
}
.modal {
  background: var(--panel); border-radius: 10px; box-shadow: 0 12px 40px rgba(23,27,31,.18);
  width: 440px; max-width: 100%; max-height: 82vh; overflow: auto; padding: 20px 22px;
}
.modal h2 { font: 600 18px var(--display); letter-spacing: -.01em; margin: 0 0 16px; }
.modal .fldrow { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.modal .actions .spacer { flex: 1; }
.err { color: var(--out-ink); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* mobile */
.mobilebar { display: none; }
@media (max-width: 880px) {
  .sidebar { display: none; }
  .main { padding: 18px 12px 96px; }
  .mobilebar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--panel); border-top: 1px solid var(--hair);
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  }
  .mobilebar .nav-item { flex-direction: column; gap: 2px; align-items: center; font-size: 11px; flex: 1; padding: 5px; width: auto; }
  .strip { display: none; }
  .cell { min-height: 88px; }
  .chips { display: none; }
  .formgrid { grid-template-columns: 1fr; }
}
