/* FPS-Media — Run of Show
   Broadcast control-room aesthetic, cool neutral dark theme */

:root {
  /* surfaces */
  --bg-0: oklch(0.18 0.005 250);   /* page */
  --bg-1: oklch(0.21 0.006 250);   /* panel */
  --bg-2: oklch(0.245 0.007 250);  /* card */
  --bg-3: oklch(0.285 0.008 250);  /* raised */
  --bg-4: oklch(0.33 0.009 250);   /* hover */
  --line: oklch(0.32 0.008 250);
  --line-2: oklch(0.38 0.01 250);

  /* text */
  --fg-0: oklch(0.97 0.005 250);
  --fg-1: oklch(0.85 0.006 250);
  --fg-2: oklch(0.68 0.008 250);
  --fg-3: oklch(0.55 0.008 250);

  /* accents */
  --amber: oklch(0.78 0.16 70);
  --amber-bg: oklch(0.42 0.12 70 / 0.18);
  --red: oklch(0.68 0.21 25);
  --red-bg: oklch(0.42 0.16 25 / 0.22);
  --green: oklch(0.74 0.16 150);
  --green-bg: oklch(0.42 0.11 150 / 0.18);
  --blue: oklch(0.72 0.14 240);
  --blue-bg: oklch(0.42 0.1 240 / 0.18);
  --violet: oklch(0.72 0.16 295);
  --violet-bg: oklch(0.42 0.12 295 / 0.18);

  /* prio */
  --p-high: var(--red);
  --p-high-bg: var(--red-bg);
  --p-med: var(--amber);
  --p-med-bg: var(--amber-bg);
  --p-low: var(--blue);
  --p-low-bg: var(--blue-bg);

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 0 0 1px oklch(0 0 0 / 0.2);

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============ layout ============ */
.app {
  display: grid;
  grid-template-columns: 224px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "logo topbar"
    "side main";
  height: 100vh;
}

.logo-corner {
  grid-area: logo;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  background: var(--bg-1);
}
.logo-mark {
  width: 26px; height: 26px;
  border-radius: 5px;
  background:
    linear-gradient(135deg, var(--amber) 0%, var(--red) 100%);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: oklch(0.18 0.005 250);
  letter-spacing: -0.5px;
}
.logo-text {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fg-0);
}
.logo-text small {
  display: block;
  color: var(--fg-3);
  font-weight: 400;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar {
  grid-area: topbar;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

.sidebar {
  grid-area: side;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main {
  grid-area: main;
  overflow: auto;
  background: var(--bg-0);
}

/* ============ topbar ============ */
.tb-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tb-clock .live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.35; }
}
.tb-clock .time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: 0.04em;
}
.tb-clock .date {
  font-size: 11px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tb-countdown {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tb-countdown.urgent {
  border-color: var(--amber);
  background: var(--amber-bg);
}
.tb-countdown.live {
  border-color: var(--red);
  background: var(--red-bg);
}
.tb-cd-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 14px;
  border-right: 1px solid var(--line);
}
.tb-cd-label .k {
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--fg-3);
  text-transform: uppercase;
}
.tb-cd-label .v {
  font-size: 13px;
  color: var(--fg-0);
  font-weight: 500;
}
.tb-cd-time {
  padding: 4px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 130px;
}
.tb-cd-time .num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: 0.02em;
  line-height: 1;
}
.tb-cd-time .sub {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: var(--fg-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}
.tb-countdown.urgent .tb-cd-time .num { color: var(--amber); }
.tb-countdown.live .tb-cd-time .num { color: var(--red); }

.tb-event-toggle {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 12px;
  color: var(--fg-1);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-event-toggle .ev-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* ============ sidebar nav ============ */
.nav-section {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  padding: 10px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--fg-1);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
.nav-item:hover {
  background: var(--bg-2);
  color: var(--fg-0);
}
.nav-item.active {
  background: var(--bg-3);
  color: var(--fg-0);
}
.nav-item .ico {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  color: var(--fg-2);
}
.nav-item.active .ico { color: var(--amber); }
.nav-item .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 999px;
}
.nav-item.active .count { background: var(--bg-1); }
.nav-item .conflict-pill {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  background: var(--red-bg);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--red);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}
.event-badge {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 4px 0;
}
.event-badge .ev-name {
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.event-badge .ev-meta {
  color: var(--fg-3);
  font-size: 10px;
  margin-top: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ main panels ============ */
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 5;
}
.page-head h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-0);
  margin: 0;
  letter-spacing: -0.01em;
}
.page-head .sub {
  color: var(--fg-3);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.page-head .spacer { flex: 1; }
.page-body {
  padding: 20px 24px;
}

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-2); }
.btn.primary {
  background: var(--amber);
  color: oklch(0.18 0.005 250);
  border-color: var(--amber);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger {
  background: var(--bg-2);
  color: var(--red);
  border-color: var(--red);
}
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost {
  background: transparent;
}
.btn .ico { width: 12px; height: 12px; }
.btn.icon {
  width: 28px; height: 28px;
  padding: 0;
  justify-content: center;
}

/* ============ dashboard ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-0);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.panel-head .sub {
  font-size: 11px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  margin-left: auto;
}

/* live ticker */
.ticker {
  position: relative;
  padding: 0;
}
.ticker-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  border-bottom: 1px solid var(--line);
}
.ticker-row:last-child { border-bottom: 0; }
.ticker-time {
  padding: 12px 12px;
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  color: var(--fg-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ticker-time .hr { color: var(--fg-0); font-size: 13px; font-weight: 500; }
.ticker-time .tag {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}
.ticker-row.now .ticker-time .tag { color: var(--red); }
.ticker-row.now .ticker-time .hr { color: var(--red); }
.ticker-row.now {
  background: linear-gradient(90deg, var(--red-bg) 0%, transparent 60%);
}
.ticker-row.past .ticker-time .hr { color: var(--fg-3); }
.ticker-row.past .ticker-cell .ev-card { opacity: 0.55; }

.ticker-cell {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 56px;
}
.ticker-cell.empty {
  color: var(--fg-3);
  font-style: italic;
  font-size: 11px;
  padding-top: 18px;
}

/* event card (in ticker / lists) */
.ev-card {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.12s;
  cursor: pointer;
}
.ev-card:hover { border-color: var(--line-2); background: var(--bg-3); }
.ev-card.has-conflict { border-color: var(--red); box-shadow: 0 0 0 1px var(--red-bg); }
.ev-card .prio-bar { background: var(--blue); }
.ev-card.p-high .prio-bar { background: var(--red); }
.ev-card.p-med  .prio-bar { background: var(--amber); }
.ev-card.p-low  .prio-bar { background: var(--blue); }
.ev-card .ev-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ev-card .ev-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ev-card .ev-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: -0.005em;
}
.ev-card .ev-sub {
  font-size: 11px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ev-card .ev-sub b {
  color: var(--fg-1);
  font-weight: 500;
}
.ev-card .ev-meta {
  padding: 8px 12px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-2);
  min-width: 78px;
  text-align: right;
}
.ev-card .ev-meta .room {
  color: var(--fg-0);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: 11px;
}

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--fg-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.prio-high { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.chip.prio-med  { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.chip.prio-low  { background: var(--blue-bg); color: var(--blue); border-color: var(--blue); }
.chip.roll-a    { background: var(--violet-bg); color: var(--violet); border-color: var(--violet); }
.chip.roll-b    { background: var(--bg-3); color: var(--fg-2); }
.chip.live      { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.chip.warn      { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.chip.ok        { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.chip.sm { font-size: 9.5px; padding: 0 6px; }

/* ============ countdown card ============ */
.next-event {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.next-event .label {
  font-size: 10px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.next-event .name {
  font-size: 22px;
  font-weight: 600;
  color: var(--fg-0);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.next-event .when {
  font-family: var(--font-mono);
  color: var(--fg-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.cd-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
}
.cd-cell .num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--fg-0);
  line-height: 1;
}
.cd-cell .unit {
  font-size: 9px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}
.cd-grid.urgent .cd-cell .num { color: var(--amber); }
.cd-grid.live .cd-cell .num { color: var(--red); }

.next-crew {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crew-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.crew-row .avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-0);
}

/* ============ conflicts panel ============ */
.conflict-list { padding: 0; }
.conflict-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.conflict-item:last-child { border-bottom: 0; }
.conflict-item .who {
  font-size: 12px;
  color: var(--fg-0);
  font-weight: 500;
}
.conflict-item .vs {
  font-size: 11px;
  color: var(--fg-2);
  font-family: var(--font-mono);
}
.conflict-item .vs b { color: var(--red); }

/* ============ week view ============ */
.week-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(140px, 1fr));
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.wk-corner {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.wk-day {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.wk-day:last-child { border-right: 0; }
.wk-day.today { background: var(--bg-2); }
.wk-day .dow {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}
.wk-day.today .dow { color: var(--amber); }
.wk-day .dnum {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-0);
  margin-top: 2px;
}
.wk-hour {
  padding: 8px 6px 0;
  text-align: right;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
}
.wk-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
  padding: 3px;
  position: relative;
}
.wk-cell:last-child { border-right: 0; }
.wk-cell.today-col { background: oklch(0.22 0.006 250); }
.wk-event {
  background: var(--bg-3);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 2px;
  font-size: 10.5px;
  color: var(--fg-0);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-event.p-high { border-left-color: var(--red); background: oklch(0.27 0.04 25 / 0.6); }
.wk-event.p-med  { border-left-color: var(--amber); background: oklch(0.27 0.03 70 / 0.6); }
.wk-event.p-low  { border-left-color: var(--blue); }
.wk-event:hover { background: var(--bg-4); }
.wk-event .t {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-2);
  margin-right: 5px;
}
.wk-event.has-conflict {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

/* ============ day view ============ */
.day-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.day-nav {
  display: flex;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.day-nav button {
  background: transparent;
  border: 0;
  color: var(--fg-1);
  padding: 6px 12px;
  font-size: 12px;
  border-right: 1px solid var(--line);
}
.day-nav button:last-child { border-right: 0; }
.day-nav button:hover { background: var(--bg-3); color: var(--fg-0); }
.day-title {
  font-size: 14px;
  color: var(--fg-0);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 0 12px;
}

.day-grid {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 60px 1fr;
}
.day-rooms-header {
  display: grid;
  border-bottom: 1px solid var(--line);
}
.day-room-head {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-1);
}
.day-room-head:last-child { border-right: 0; }
.day-room-head .room-meta {
  font-size: 9.5px;
  color: var(--fg-3);
  margin-top: 2px;
  letter-spacing: 0.06em;
}
.day-hours-col { border-right: 1px solid var(--line); }
.day-hour-label {
  height: 60px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  text-align: right;
}
.day-content {
  position: relative;
  display: grid;
}
.day-room-col {
  border-right: 1px solid var(--line);
  position: relative;
}
.day-room-col:last-child { border-right: 0; }
.day-hour-line {
  height: 60px;
  border-bottom: 1px solid var(--line);
}
.day-room-col .hour-rule {
  position: absolute;
  left: 0; right: 0;
  border-bottom: 1px dashed oklch(0.28 0.006 250);
}
.day-now-line {
  position: absolute;
  left: 60px;
  right: 0;
  height: 0;
  border-top: 2px solid var(--red);
  z-index: 4;
  pointer-events: none;
}
.day-now-line::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.day-now-line .now-label {
  position: absolute;
  left: -56px;
  top: -8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  font-weight: 600;
  background: var(--bg-0);
  padding: 0 4px;
}

.day-event {
  position: absolute;
  left: 4px;
  right: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 6px 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.day-event.p-high { border-left-color: var(--red); background: oklch(0.27 0.04 25 / 0.55); }
.day-event.p-med  { border-left-color: var(--amber); background: oklch(0.27 0.03 70 / 0.55); }
.day-event.p-low  { border-left-color: var(--blue); }
.day-event:hover { background: var(--bg-4); }
.day-event.has-conflict { box-shadow: inset 0 0 0 1px var(--red); }
.day-event .de-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-2);
  letter-spacing: 0.04em;
}
.day-event .de-title {
  font-size: 12px;
  color: var(--fg-0);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-event .de-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

/* ============ people view ============ */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.person-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.person-card.has-conflict {
  border-color: var(--red);
}
.person-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-0);
  flex-shrink: 0;
}
.person-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-0);
}
.person-roles {
  font-size: 10.5px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.person-card .person-actions { margin-left: auto; }
.person-load {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.load-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.load-row .lr-time {
  font-family: var(--font-mono);
  color: var(--fg-2);
}
.load-row .lr-name {
  color: var(--fg-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.load-empty {
  font-size: 11px;
  color: var(--fg-3);
  font-style: italic;
}

/* ============ equipment view ============ */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.equip-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.equip-card.status-in {
  border-left: 3px solid var(--green);
}
.equip-card.status-out {
  border-left: 3px solid var(--amber);
}
.equip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-0);
}
.equip-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.equip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--fg-2);
}
.equip-row b { color: var(--fg-0); font-weight: 500; }

/* ============ events list ============ */
.events-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--fg-0);
  padding: 7px 0;
  font-size: 13px;
  outline: none;
}
.events-table {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.et-head, .et-row {
  display: grid;
  grid-template-columns: 90px 90px 1fr 80px 1fr 80px 32px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.et-head {
  background: var(--bg-2);
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}
.et-row { font-size: 12.5px; }
.et-row:last-child { border-bottom: 0; }
.et-row:hover { background: var(--bg-2); cursor: pointer; }
.et-row .et-time {
  font-family: var(--font-mono);
  color: var(--fg-0);
}
.et-row .et-name {
  color: var(--fg-0);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.et-row .et-room {
  font-family: var(--font-mono);
  color: var(--fg-2);
  letter-spacing: 0.04em;
}
.et-row .et-crew {
  display: flex;
  gap: -4px;
  align-items: center;
}
.et-row .et-crew .avatar {
  width: 20px; height: 20px;
  font-size: 9px;
  margin-right: -4px;
  border: 2px solid var(--bg-1);
}

/* ============ modal (editor) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.1 0.005 250 / 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 30px;
}
.modal {
  width: min(720px, 100%);
  max-height: 90vh;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.5);
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.modal-head .x {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--fg-2);
  font-size: 18px;
  padding: 4px 8px;
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}
.modal-foot .spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}
.field input, .field select, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--fg-0);
  font-size: 13px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--amber);
}
.field textarea { resize: vertical; min-height: 64px; }
.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
}
.field-row .field { min-width: 0; }

.segmented {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.segmented button {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
  border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button.active {
  background: var(--bg-3);
  color: var(--fg-0);
}
.segmented.prio button.active[data-v="high"] { background: var(--red-bg); color: var(--red); }
.segmented.prio button.active[data-v="med"]  { background: var(--amber-bg); color: var(--amber); }
.segmented.prio button.active[data-v="low"]  { background: var(--blue-bg); color: var(--blue); }

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 40px;
}
.chip-picker .pick {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--fg-1);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-picker .pick.on {
  background: var(--bg-4);
  border-color: var(--line-2);
  color: var(--fg-0);
}
.chip-picker .pick:hover { border-color: var(--line-2); }
.chip-picker .pick .x { color: var(--fg-3); }

/* misc */
.divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-3);
}
.empty-state .big {
  font-size: 14px;
  color: var(--fg-1);
  margin-bottom: 4px;
}

/* ============ login screen ============ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, oklch(0.26 0.006 250 / 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(0.26 0.006 250 / 0.4) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.login-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, oklch(0.42 0.12 70 / 0.18) 0%, transparent 60%);
  filter: blur(40px);
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 30px 80px oklch(0 0 0 / 0.5), 0 0 0 1px oklch(0 0 0 / 0.2);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-card.shake {
  animation: shake 0.4s ease-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.login-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 12px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-3);
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.quick-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px;
  text-align: left;
  color: var(--fg-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.12s;
}
.quick-tile:hover {
  border-color: var(--line-2);
  background: var(--bg-3);
  transform: translateY(-1px);
}
.qt-head { display: flex; align-items: center; gap: 6px; }
.qt-dot { width: 7px; height: 7px; border-radius: 50%; }
.qt-role {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-2);
}
.qt-name { font-size: 12px; color: var(--fg-0); font-weight: 500; }
.qt-cred {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}
.qt-desc {
  font-size: 10px;
  color: var(--fg-3);
  line-height: 1.35;
  margin-top: 2px;
}
.login-foot {
  font-size: 10.5px;
  color: var(--fg-3);
  text-align: center;
  line-height: 1.5;
}

/* ============ user menu ============ */
.user-menu { position: relative; }
.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 10px 4px 4px;
  color: var(--fg-0);
}
.user-trigger:hover { background: var(--bg-3); border-color: var(--line-2); }
.ut-text { text-align: left; line-height: 1.1; }
.ut-name { font-size: 12px; font-weight: 500; }
.ut-role {
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px oklch(0 0 0 / 0.4);
  padding: 12px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ud-head { display: flex; align-items: center; gap: 10px; }
.ud-role-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.ud-role-desc {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.4;
}
.ud-item {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--fg-1);
  font-size: 12px;
}
.ud-item:hover { background: var(--bg-3); color: var(--fg-0); }
.ud-item.danger { color: var(--red); }
.ud-item.danger:hover { background: var(--red-bg); }

/* ============ users view ============ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.user-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.uc-head { display: flex; align-items: center; gap: 10px; }
.uc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 11.5px;
  border-top: 1px solid var(--line);
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.role-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  text-align: left;
  color: var(--fg-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.12s;
}
.role-tile:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.role-tile:hover:not(:disabled) {
  background: var(--bg-3);
  border-color: var(--line-2);
}
.role-tile.on {
  background: var(--bg-3);
  border-color: var(--badge);
  box-shadow: inset 0 0 0 1px var(--badge);
}
.role-tile .rt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--badge);
}
.role-tile .rt-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-0);
}
.role-tile.on .rt-label { color: var(--badge); }
.role-tile .rt-desc {
  font-size: 10px;
  color: var(--fg-3);
  line-height: 1.35;
}

/* ============ read-only modal ============ */
.modal.is-ro input,
.modal.is-ro select,
.modal.is-ro textarea {
  pointer-events: none;
  opacity: 0.75;
  background: var(--bg-3);
}
.modal.is-ro .chip-picker .pick,
.modal.is-ro .segmented button {
  pointer-events: none;
  opacity: 0.75;
}
.modal.is-ro .field label::after {
  content: "";
}

/* ============ read-only banner ============ */
.readonly-banner {
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* hide create buttons + edit affordances for viewers */
.is-viewer .btn.primary[data-edit] { display: none; }
.is-viewer .btn.icon.ghost[data-edit] { display: none; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

/* selection */
::selection { background: var(--amber); color: oklch(0.18 0.005 250); }
