/* ============================================================
   Cannes Control Room — Edgy Riviera luxury
   Sharp corners · hard accents · editorial type
   Navy ink · Cannes brass-gold · warm sand
   ============================================================ */

:root {
  color-scheme: light;

  /* Surfaces & ink */
  --bg: #f4efe4;
  --bg-2: #ece3d0;
  --surface: #fffdf8;
  --surface-alt: #f1e9d8;
  --ink: #131f30;
  --ink-soft: #2b3d52;
  --muted: #6a7686;
  --line: #ddd2bb;
  --line-strong: #c2b291;

  /* Brand accents */
  --gold: #a9791f;
  --gold-bright: #cf9f3d;
  --gold-soft: #f3e4bf;
  --champagne: #efe2c4;
  --sea: #1b6580;
  --sea-deep: #103f51;

  /* Status — warmed Riviera palette */
  --green: #2c7349;
  --green-soft: #d6ecda;
  --blue: #1c597f;
  --blue-soft: #d3e4f1;
  --amber: #8f6310;
  --amber-soft: #f4e5bf;
  --red: #ab4234;
  --red-soft: #f4d8d1;
  --teal: #136a71;
  --teal-soft: #d2eaea;

  /* Shadows — crisp, with hard offset "pop" on interaction */
  --shadow: 0 6px 0 -3px rgba(19, 31, 48, 0.06), 0 14px 26px -20px rgba(19, 31, 48, 0.5);
  --pop-ink: 7px 7px 0 var(--ink);
  --pop-gold: 7px 7px 0 var(--gold-bright);

  --serif: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--sea);
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px 22px 64px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 28px 26px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--pop-ink);
}

.topbar::before {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  height: 6px;
  background: var(--gold-bright);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 50px;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ink);
}

h2 {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-actions,
.view-tabs,
.toolbar,
.section-head,
.day-tabs,
.people-actions,
.chip-row,
.card-actions,
.code-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions {
  position: relative;
  z-index: 1;
  align-items: flex-end;
}

/* ---------- Buttons & controls ---------- */
.button,
.tab,
.icon-button,
.person-chip,
.attendance-chip,
.mark-button {
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.button.secondary {
  background: var(--surface);
}

.button.ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.button:hover,
.tab:hover,
.icon-button:hover,
.person-chip:hover,
.attendance-chip:hover,
.mark-button:hover {
  background: var(--ink);
  color: #f6e7c3;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--gold-bright);
}

.button.ghost:hover {
  border-color: var(--ink);
}

.button:active,
.tab:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.button:focus-visible,
.tab:focus-visible,
.icon-button:focus-visible,
.person-chip:focus-visible,
.attendance-chip:focus-visible,
.mark-button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.person-switch {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.person-switch span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.person-switch select {
  min-height: 40px;
  height: 40px;
  padding: 9px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#importFile {
  display: none;
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  position: relative;
  min-height: 100px;
  padding: 18px 18px 16px 22px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  background: var(--gold-bright);
}

.stat:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop-ink);
}

.stat span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stat strong {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

/* ---------- View tabs ---------- */
.view-tabs {
  gap: 0;
  margin: 6px 0 22px;
  padding: 0;
  border-bottom: 2px solid var(--ink);
}

.tab {
  border: 2px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
  margin-bottom: -2px;
  transform: none;
}

.tab:hover {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: transparent;
  transform: none;
  box-shadow: inset 0 -4px 0 var(--gold-bright);
}

.tab.is-active {
  background: var(--ink);
  color: #fdf6e6;
  border-color: var(--ink);
  box-shadow: none;
}

.tab.is-active:hover {
  background: var(--ink);
  color: #fdf6e6;
  box-shadow: none;
}

/* ---------- Toolbar / filters ---------- */
.toolbar {
  align-items: end;
  padding: 18px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 170px;
}

.search-field {
  flex: 1 1 320px;
}

.field span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover,
select:hover,
input:focus,
select:focus {
  border-color: var(--ink);
}

/* ---------- Views ---------- */
.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: rise 220ms ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  justify-content: space-between;
  margin: 24px 0 14px;
}

.section-head h2 {
  position: relative;
  padding-left: 16px;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: var(--gold-bright);
}

.count-pill {
  min-height: 32px;
  padding: 7px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #f6e7c3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Board / event grid ---------- */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

/* ---------- Today ---------- */
.today-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.today-stat,
.note-card,
.today-card,
.today-access-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.today-stat {
  position: relative;
  min-height: 86px;
  padding: 16px 16px 16px 20px;
  overflow: hidden;
}

.today-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--sea);
}

.today-stat span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.today-stat strong {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.today-main,
.today-side,
.today-list,
.today-notes {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.today-section {
  display: grid;
  gap: 14px;
}

.today-section-head,
.timeline-section-head,
.brand-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.today-section-head h4,
.timeline-section-head h3 {
  margin: 0;
}

.today-section-head h4 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.today-section-head span,
.timeline-section-head span,
.brand-day-head span {
  min-height: 26px;
  padding: 5px 11px;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.today-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.today-card:hover,
.today-access-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop-ink);
}

.today-access-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.today-card.going,
.today-access-card.going {
  box-shadow: inset 6px 0 0 var(--green), var(--shadow);
}

.today-card.going:hover,
.today-access-card.going:hover {
  box-shadow: inset 6px 0 0 var(--green), var(--pop-ink);
}

.today-card.maybe,
.today-access-card.maybe {
  box-shadow: inset 6px 0 0 var(--amber), var(--shadow);
}

.today-card.maybe:hover,
.today-access-card.maybe:hover {
  box-shadow: inset 6px 0 0 var(--amber), var(--pop-ink);
}

.today-time {
  display: grid;
  gap: 10px;
  align-content: start;
}

.today-time strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.today-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.quick-lines {
  display: grid;
  gap: 8px;
}

.quick-lines div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.quick-lines b {
  color: var(--ink);
}

.note-card {
  padding: 16px;
  min-width: 0;
}

.note-card h4 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.note-card p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ---------- Cards (brand, event, timeline, code, conflict, person) ---------- */
.brand-card,
.event-card,
.timeline-row,
.code-item,
.conflict-item,
.person-row {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.event-card {
  display: grid;
  gap: 14px;
  min-height: 300px;
  padding: 20px;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.event-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--pop-ink);
}

.brand-list {
  display: grid;
  gap: 16px;
}

.brand-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.brand-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.brand-header .eyebrow {
  color: var(--sea);
}

.brand-header h2 {
  font-size: 24px;
  text-transform: uppercase;
}

.brand-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 6px;
}

.brand-status-grid span,
.priority-tag,
.source-tag,
.accepted-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.accepted-tag {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.priority-tag {
  color: var(--ink);
  background: var(--gold-bright);
  border-color: var(--gold);
}

.brand-events,
.source-items {
  display: grid;
  gap: 10px;
}

.brand-timeline {
  display: grid;
  gap: 16px;
}

.brand-day {
  display: grid;
  gap: 10px;
}

.brand-day-head {
  padding: 10px 14px;
  border: 0;
  border-left: 6px solid var(--gold-bright);
  border-radius: 0;
  background: var(--surface-alt);
}

.brand-day-head h3 {
  font-family: var(--serif);
  font-weight: 700;
  text-transform: uppercase;
}

.brand-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  transition: border-color 120ms ease, transform 120ms ease;
}

.brand-event:hover {
  border-color: var(--ink);
  transform: translateX(2px);
}

.brand-event.is-accepted {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: inset 5px 0 0 var(--green);
}

.brand-event-main,
.brand-event-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.brand-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.brand-title-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.brand-time {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 0;
  background: var(--ink);
  color: #f6e7c3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand-meta,
.brand-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  line-height: 1.45;
}

.source-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
}

.source-item span,
.source-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- Event card internals ---------- */
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-top h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status.confirmed { color: #fff; background: var(--green); }
.status.pending { color: var(--ink); background: var(--gold-bright); }
.status.waitlisted { color: #fff; background: var(--blue); }
.status.scouted { color: #fff; background: var(--teal); }
.status.declined { color: #fff; background: var(--red); }

.meta-line,
.note-line {
  display: flex;
  gap: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.meta-line b {
  color: var(--ink);
  font-weight: 800;
}

.card-body {
  display: grid;
  gap: 8px;
}

.chip-row {
  min-height: 40px;
}

.map-actions,
.marking-buttons,
.source-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-link {
  min-height: 36px;
  padding: 7px 13px;
  text-decoration: none;
}

.marking-control {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface-alt);
}

.marking-control > span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mark-button {
  min-height: 36px;
  padding: 7px 13px;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 800;
}

.mark-button.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #f6e7c3;
}

.attendance-chip {
  min-width: 92px;
  justify-content: center;
  padding: 8px 11px;
  color: var(--ink-soft);
  background: var(--surface);
}

.attendance-chip.going {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.attendance-chip.maybe {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold-bright);
}

.attendance-chip.notgoing {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.card-actions {
  align-self: end;
  justify-content: space-between;
}

.small-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 5px 11px;
  border-radius: 0;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  gap: 14px;
}

.timeline-section {
  display: grid;
  gap: 14px;
}

.timeline-section + .timeline-section {
  margin-top: 16px;
}

.timeline-section-head h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
}

.day-tabs {
  gap: 8px;
}

.day-tabs .tab {
  min-height: 38px;
  padding: 7px 14px;
  border: 1.5px solid var(--ink);
  margin-bottom: 0;
  background: var(--surface);
}

.day-tabs .tab.is-active {
  border-color: var(--ink);
}

.timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
  padding: 16px 18px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.timeline-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gold-bright);
}

.timeline-row:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop-ink);
}

.time-cell {
  display: grid;
  gap: 4px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.time-cell strong {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

.time-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-attendees {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.avatar.going {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.avatar.maybe {
  background: var(--gold-bright);
  color: var(--ink);
  border-color: var(--gold);
}

/* ---------- People ---------- */
.people-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.people-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.person-row {
  padding: 16px;
}

.person-row input {
  margin-top: 8px;
}

.person-row .person-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.matrix-wrap {
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.people-matrix {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.people-matrix th,
.people-matrix td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.people-matrix th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ink);
  color: #f6e7c3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.people-matrix tr:last-child td {
  border-bottom: 0;
}

.people-matrix tbody tr:hover td {
  background: var(--surface-alt);
}

.event-title-cell {
  min-width: 260px;
  font-weight: 800;
}

/* ---------- Sheet ---------- */
.sheet-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.sheet-key {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-key::before {
  content: "";
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border: 1px solid rgba(19, 31, 48, 0.2);
  border-radius: 0;
  background: var(--surface-alt);
}

.sheet-key.accepted::before { background: #6cbf8e; }
.sheet-key.must::before { background: #9fdcae; }
.sheet-key.important::before { background: #c6e8c0; }
.sheet-key.scouted::before { background: #9fd2d2; }
.sheet-key.pending::before { background: var(--gold-bright); }
.sheet-key.waitlisted::before { background: #9cc2e0; }
.sheet-key.declined::before { background: #e0a79c; }

.sheet-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.4;
}

.sheet-table th,
.sheet-table td {
  min-width: 132px;
  max-width: 260px;
  padding: 9px 11px;
  border-right: 1px solid #e0d6c2;
  border-bottom: 1px solid #e0d6c2;
  background: var(--surface);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.sheet-table thead th {
  position: sticky;
  z-index: 4;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.sheet-letters th {
  top: 0;
  min-height: 30px;
  padding: 6px 8px;
  background: var(--ink);
  color: #f6e7c3;
  text-align: center;
  letter-spacing: 0.1em;
}

.sheet-head th {
  top: 31px;
  background: var(--surface-alt);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-table .sheet-row-number {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 46px;
  width: 46px;
  max-width: 46px;
  background: var(--surface-alt);
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.sheet-table thead .sheet-row-number {
  z-index: 7;
}

.sheet-table .sheet-event-column {
  position: sticky;
  left: 46px;
  z-index: 3;
  min-width: 320px;
  max-width: 380px;
  box-shadow: inset -2px 0 var(--ink);
}

.sheet-table thead .sheet-event-column {
  z-index: 6;
}

.sheet-date-column { min-width: 164px; }
.sheet-time-column { min-width: 150px; }

.sheet-wide-column {
  min-width: 260px;
  max-width: 360px;
}

.sheet-person-column {
  min-width: 106px;
  max-width: 120px;
  text-align: center;
}

.sheet-actions-column { min-width: 136px; }

.sheet-data-row.sheet-row-accepted td,
.sheet-data-row.sheet-row-accepted th { background: #e6f5ea; }
.sheet-data-row.sheet-row-must td,
.sheet-data-row.sheet-row-must th { background: #edf9ec; }
.sheet-data-row.sheet-row-important td,
.sheet-data-row.sheet-row-important th { background: #f4faed; }
.sheet-data-row.sheet-row-scouted td,
.sheet-data-row.sheet-row-scouted th { background: #e9f5f5; }
.sheet-data-row.sheet-row-pending td,
.sheet-data-row.sheet-row-pending th { background: #fcf2dd; }
.sheet-data-row.sheet-row-waitlisted td,
.sheet-data-row.sheet-row-waitlisted th { background: #e9f2fa; }
.sheet-data-row.sheet-row-declined td,
.sheet-data-row.sheet-row-declined th { background: #fceeea; }

.sheet-data-row:hover td,
.sheet-data-row:hover th {
  background: var(--gold-soft);
}

.sheet-title-button,
.sheet-detail-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font-weight: 900;
}

.sheet-title-button {
  display: block;
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.sheet-title-button:hover {
  color: var(--gold);
}

.sheet-event-column span,
.sheet-muted {
  color: var(--muted);
}

.sheet-priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 0;
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-priority.must {
  background: var(--green);
  color: #fff;
}

.sheet-priority.important {
  background: #c6e8c0;
  color: #2c5a37;
}

.sheet-map-cell,
.sheet-actions {
  display: grid;
  gap: 5px;
}

.sheet-map-cell a,
.sheet-actions a,
.sheet-detail-button {
  color: var(--sea);
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sheet-attendance {
  width: 100%;
  min-width: 84px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 0;
  font-size: 11px;
}

.sheet-empty-cell {
  min-height: 60px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

/* ---------- Passes & codes ---------- */
.code-list,
.conflict-list {
  display: grid;
  gap: 16px;
}

.code-item,
.conflict-item {
  padding: 20px;
}

.code-item h3,
.conflict-item h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
}

.pass-gallery,
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.pass-card,
.code-box {
  padding: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
}

.pass-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.pass-card.is-text-only {
  border-style: dashed;
}

.pass-image-link {
  display: block;
  width: min(100%, 320px);
  margin: 0 auto;
  padding: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fff;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.pass-image-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pop-gold);
}

.pass-image-link.is-full-pass {
  width: min(100%, 380px);
}

.pass-image {
  display: block;
  width: 100%;
  height: auto;
}

.pass-body {
  display: grid;
  gap: 8px;
}

.pass-label,
.code-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pass-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pass-value,
.code-value {
  margin: 6px 0 10px;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.pass-value {
  margin: 0;
}

/* ---------- Speakers ---------- */
.speaker-list {
  display: grid;
  gap: 8px;
}

.speaker-row {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
}

.speaker-row span,
.source-links a {
  color: var(--muted);
}

.source-links a {
  font-weight: 800;
}

/* ---------- Conflicts ---------- */
.conflict-group {
  display: grid;
  gap: 8px;
}

.conflict-pair {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 0;
  border-left: 6px solid var(--red);
  background: var(--red-soft);
  color: #6b271f;
}

/* ---------- Empty state ---------- */
.empty-state {
  padding: 30px;
  border: 2px dashed var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Dialog ---------- */
.event-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--pop-ink);
  background: var(--surface);
}

.event-dialog::backdrop {
  background: rgba(19, 31, 48, 0.6);
}

.event-dialog form {
  padding: 24px;
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dialog-top h2 {
  font-size: 26px;
  text-transform: uppercase;
}

.dialog-section {
  padding: 16px 0;
  border-top: 1.5px solid var(--line);
}

.dialog-section h3 {
  margin-bottom: 8px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px;
  border-radius: 0;
  border: 2px solid var(--gold-bright);
  background: var(--ink);
  color: #f6e7c3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: var(--pop-gold);
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gold-bright);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .today-summary { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .today-layout { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 1fr; }
  .brand-header,
  .brand-event { grid-template-columns: 1fr; }
  .timeline-attendees { justify-content: flex-start; }
  .people-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .app-shell { padding: 14px; }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px;
  }

  h1 { font-size: 38px; }

  .stats-grid { grid-template-columns: 1fr; }
  .today-summary { grid-template-columns: 1fr; }
  .today-card { grid-template-columns: 1fr; }
  .today-access-card { padding: 14px; }
  .quick-lines div { grid-template-columns: 1fr; }
  .event-grid { grid-template-columns: 1fr; }

  .view-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .toolbar { align-items: stretch; }
  .field { min-width: 100%; }

  .button,
  .tab { flex: 1 1 auto; }

  .card-top { flex-direction: column; }

  .brand-day-head,
  .today-section-head,
  .timeline-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-title-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .sheet-wrap { max-height: 68vh; }

  .sheet-table th,
  .sheet-table td {
    min-width: 118px;
    max-width: 240px;
    padding: 7px 8px;
  }

  .sheet-table .sheet-row-number {
    min-width: 38px;
    width: 38px;
    max-width: 38px;
  }

  .sheet-table .sheet-event-column {
    position: static;
    min-width: 240px;
    max-width: 280px;
    box-shadow: none;
  }

  .pass-gallery,
  .code-grid { grid-template-columns: 1fr; }
}
