:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3f8;
  --text: #111827;
  --muted: #5f6f7a;
  --line: #d5e0e8;
  --accent: #1e88ff;
  --accent-strong: #0b4f9c;
  --accent-soft: #e8f3ff;
  --success: #1f9d55;
  --success-soft: #e8f7ef;
  --action-gig: var(--accent);
  --action-rehearsal: #87919b;
  --action-blackout: #6f7370;
  --warn: #d79a00;
  --danger: #c2414b;
  --gig: var(--accent);
  --rehearsal: #8b5cf6;
  --blackout: #6f7370;
  --button-muted: #ffffff;
  --button-muted-hover: #eef6ff;
  --button-muted-border: #c7d5e0;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --surface: #16222c;
  --surface-muted: #1d2b36;
  --text: #f6f7f2;
  --muted: #aeb8bb;
  --line: #2d3a42;
  --accent: #ffc857;
  --accent-strong: #ffb627;
  --accent-soft: #2f2b1d;
  --success: #6fd08c;
  --success-soft: #183625;
  --action-gig: var(--warn);
  --action-rehearsal: #7c848c;
  --action-blackout: #7c848c;
  --warn: #ffb627;
  --danger: #ff8b7f;
  --gig: var(--accent);
  --rehearsal: #b88cff;
  --blackout: #7c848c;
  --button-muted: #253542;
  --button-muted-hover: #304252;
  --button-muted-border: #2d3a42;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background:
    linear-gradient(135deg, rgba(30, 136, 255, 0.08), transparent 28rem),
    radial-gradient(circle at top right, rgba(142, 202, 230, 0.16), transparent 24rem),
    var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.08), transparent 28rem),
    radial-gradient(circle at top right, rgba(142, 202, 230, 0.12), transparent 24rem),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  margin: 0 auto;
  max-width: 1320px;
  padding: 18px 16px 28px;
}

.topbar,
.panel-heading,
.section-heading,
.drawer-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.topbar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 0.8fr) minmax(440px, 1.5fr) auto;
  margin-bottom: 14px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  display: block;
  flex: 0 0 auto;
  height: 54px;
  object-fit: contain;
  width: 174px;
}

.brand-meta {
  min-width: 0;
}

.sr-only {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.gear-button {
  flex: 0 0 auto;
}

.topbar h1,
.panel h2,
.section-heading h2,
.drawer-heading h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 2rem;
  line-height: 1;
}

.demo-banner {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 8px;
  color: var(--text);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.demo-banner div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.demo-banner strong {
  font-size: 0.88rem;
}

.demo-banner span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.active-band-name {
  color: var(--muted);
  font-weight: 800;
  margin: 6px 0 0;
}

.header-metrics {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1px;
  grid-template-columns: auto repeat(3, minmax(92px, 1fr));
  overflow: hidden;
}

.metric-toggle {
  align-items: center;
  background: var(--surface-strong);
  border-right: 1px solid var(--line);
  padding: 8px;
}

.header-metric {
  background: var(--surface);
  display: grid;
  min-height: 58px;
  padding: 9px 12px;
}

.header-metric span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.header-metric strong {
  align-self: end;
  font-size: 1.35rem;
  line-height: 1.1;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.quick-action-gig,
.quick-action-rehearsal,
.quick-action-blackout {
  align-items: center;
  border-radius: 7px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 46px;
  min-width: 104px;
  padding: 0 18px;
  white-space: nowrap;
}

.quick-action-gig {
  background: var(--action-gig);
}

.quick-action-rehearsal {
  background: var(--action-rehearsal);
}

.quick-action-blackout {
  background: var(--action-blackout);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.quick-actions,
.detail-actions,
.member-tabs,
.segmented-control,
.toolbar,
.form-actions,
.availability-summary {
  display: flex;
  gap: 8px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.quick-actions button,
.tabs button,
.member-tabs button,
.segmented-control button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
}

.icon-button {
  background: var(--button-muted);
  border: 1px solid var(--button-muted-border);
  color: var(--text);
  min-height: 46px;
  width: 46px;
}

.icon-button.active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon {
  background: currentColor;
  display: block;
  height: 22px;
  width: 22px;
}

.gear-icon {
  background: currentColor;
  display: block;
  height: 20px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a8.2 8.2 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A8.2 8.2 0 0 0 7 6L4.6 5 2.6 8.5l2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a8.2 8.2 0 0 0 2.6 1.5L10 22h4l.4-2.5A8.2 8.2 0 0 0 17 18l2.4 1 2-3.5-2-1.5ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a8.2 8.2 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A8.2 8.2 0 0 0 7 6L4.6 5 2.6 8.5l2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a8.2 8.2 0 0 0 2.6 1.5L10 22h4l.4-2.5A8.2 8.2 0 0 0 17 18l2.4 1 2-3.5-2-1.5ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 20px;
}

.theme-icon-sun {
  display: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v4h-2V1Zm0 18h2v4h-2v-4ZM3.5 4.9 4.9 3.5l2.8 2.8-1.4 1.4-2.8-2.8Zm12.8 12.8 1.4-1.4 2.8 2.8-1.4 1.4-2.8-2.8ZM1 11h4v2H1v-2Zm18 0h4v2h-4v-2ZM3.5 19.1l2.8-2.8 1.4 1.4-2.8 2.8-1.4-1.4ZM16.3 6.3l2.8-2.8 1.4 1.4-2.8 2.8-1.4-1.4ZM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v4h-2V1Zm0 18h2v4h-2v-4ZM3.5 4.9 4.9 3.5l2.8 2.8-1.4 1.4-2.8-2.8Zm12.8 12.8 1.4-1.4 2.8 2.8-1.4 1.4-2.8-2.8ZM1 11h4v2H1v-2Zm18 0h4v2h-4v-2ZM3.5 19.1l2.8-2.8 1.4 1.4-2.8 2.8-1.4-1.4ZM16.3 6.3l2.8-2.8 1.4 1.4-2.8 2.8-1.4-1.4ZM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-icon-moon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.5 14.6A8.3 8.3 0 0 1 9.4 3.5a9.2 9.2 0 1 0 11.1 11.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.5 14.6A8.3 8.3 0 0 1 9.4 3.5a9.2 9.2 0 1 0 11.1 11.1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.primary-button {
  background: var(--accent);
  color: #111827;
  padding: 0 16px;
}

:root:not([data-theme="dark"]) .primary-button {
  color: #ffffff;
}

.secondary-button {
  background: var(--button-muted);
  border: 1px solid var(--button-muted-border);
  color: var(--text);
  padding: 0 16px;
  white-space: nowrap;
}

.toggle-control {
  align-items: center;
  background: var(--button-muted);
  border: 1px solid var(--button-muted-border);
  border-radius: 7px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.toggle-control input {
  accent-color: var(--accent);
  height: 16px;
  margin: 0;
  width: 16px;
}

.danger-button {
  background: rgba(179, 38, 30, 0.14);
  color: var(--danger);
  padding: 0 12px;
}

.text-button {
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  margin-bottom: 12px;
}

.panel,
.metric-strip,
.workbench-shell,
.detail-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.priority-panel {
  min-height: 118px;
}

.quick-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

body[data-active-view="availability"] .quick-actions {
  display: none;
}

.quick-actions button {
  border: 0;
}

.metric-strip {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.metric {
  background: var(--surface);
  display: grid;
  min-height: 118px;
  padding: 16px;
}

.metric span,
.metric .metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.metric strong {
  align-self: end;
  font-size: 1.8rem;
}

.workbench-shell {
  overflow: hidden;
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 620px;
}

.workbench-layout.detail-hidden {
  grid-template-columns: 1fr;
}

.workbench {
  min-width: 0;
}

.detail-pane {
  border-bottom: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  padding: 16px;
}

.detail-pane.empty > * {
  display: none;
}

.tabs {
  background: var(--surface-muted);
  display: flex;
  gap: 1px;
  overflow-x: auto;
  padding: 4px;
}

.tabs button,
.segmented-control button,
.member-tabs button {
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
  padding: 0 14px;
}

.tabs button.active,
.segmented-control button.active,
.member-tabs button.active {
  background: var(--surface);
  color: var(--text);
}

.segmented-control,
.member-tabs {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 4px;
}

.view,
.calendar-mode {
  display: none;
}

.view.active,
.calendar-mode.active {
  display: block;
}

.view {
  padding: 16px;
}

.event-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.event-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--row-color, var(--accent));
  border-radius: 7px;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.event-row.selected {
  outline: 2px solid var(--accent);
}

.event-row .date {
  color: var(--muted);
  font-weight: 800;
}

.event-row h3 {
  font-size: 1rem;
  margin: 0 0 3px;
}

.event-row p {
  color: var(--muted);
  margin: 0;
}

.calendar-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.calendar-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 6px;
}

.calendar-legend .legend-heading {
  color: var(--text);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.calendar-grid-title,
.availability-grid-title {
  font-size: 1rem;
  margin: 12px 0 0;
}

.calendar-grid-title {
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 900;
}

.month-grid,
.member-month-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  margin-top: 14px;
  overflow-x: auto;
}

.month-day,
.month-weekday {
  background: var(--surface-muted);
  min-height: 104px;
  min-width: 92px;
  padding: 8px;
}

.month-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  position: relative;
}

.month-day.today .day-number {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

:root:not([data-theme="dark"]) .month-day.today .day-number {
  color: #ffffff;
}

.month-weekday {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 32px;
  text-transform: uppercase;
}

.day-number {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.day-chip {
  align-items: center;
  border-radius: 6px;
  display: flex;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 5px;
  overflow: hidden;
  padding: 5px 6px;
  text-align: left;
  text-overflow: ellipsis;
}

.day-chip.gig {
  background: var(--event-color, var(--gig));
  color: #111827;
}

.day-chip.rehearsal {
  background: var(--rehearsal);
  color: #ffffff;
}

:root:not([data-theme="dark"]) .day-chip.gig {
  color: #ffffff;
}

.day-chip.blackout {
  background: var(--blackout);
  color: white;
}

.event-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tentative-icon {
  align-items: center;
  background: var(--warn);
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  height: 17px;
  justify-content: center;
  line-height: 1;
  width: 17px;
}

.tentative-icon.legend-icon {
  margin-right: 0;
}

.tentative-icon-dark {
  background: #111827;
  color: #ffffff;
}

.member-calendar {
  margin-top: 12px;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  gap: 5px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.status-pill.confirmed {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-pill.tentative {
  background: rgba(215, 154, 0, 0.18);
  color: var(--warn);
}

.status-pill.archived {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-pill.complete {
  background: var(--surface-muted);
  color: var(--muted);
}

.table-wrap,
.availability-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.ledger-filter {
  grid-template-columns: minmax(170px, auto) minmax(140px, 1fr) minmax(140px, 1fr);
}

.ledger-filter .toggle-control {
  justify-content: flex-start;
}

.ledger-filter input:disabled {
  opacity: 0.55;
}

.availability-wrap {
  overflow-x: hidden;
}

table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.ledger-table {
  min-width: 1000px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 10px 6px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  position: relative;
  text-transform: uppercase;
}

.column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -4px;
  top: 0;
  width: 8px;
  z-index: 1;
}

.column-resizer::after {
  background: var(--line);
  bottom: 8px;
  content: "";
  position: absolute;
  right: 3px;
  top: 8px;
  width: 1px;
}

.column-resizer:hover::after {
  background: var(--accent);
  width: 2px;
}

.ledger-row {
  cursor: pointer;
}

.ledger-row:hover,
.ledger-row:focus {
  background: var(--surface-muted);
  outline: none;
}

.ledger-row.selected {
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

.availability-grid {
  display: grid;
  background: var(--line);
  min-width: 0;
  width: 100%;
}

.grid-cell {
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  font-size: 0.68rem;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 0 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.grid-cell {
  background: var(--bg);
  color: var(--muted);
  cursor: cell;
}

.grid-cell.header,
.grid-cell.member {
  background: var(--surface-muted);
  color: var(--muted);
}

.grid-cell.member {
  font-size: 0.82rem;
  justify-content: flex-start;
  padding-left: 8px;
}

.date-header {
  flex-direction: column;
  gap: 1px;
  height: 44px;
  line-height: 1;
}


.date-header.today {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--text);
}

.date-header.today span {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

:root:not([data-theme="dark"]) .date-header.today span {
  color: #ffffff;
}

.availability-cell.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  position: relative;
}
.date-header small {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.sticky-cell {
  left: 0;
  position: sticky;
  z-index: 2;
}

.grid-cell.gig {
  background: var(--gig);
  color: #111827;
}

:root:not([data-theme="dark"]) .grid-cell.gig {
  color: #ffffff;
}

.grid-cell.rehearsal {
  background: var(--rehearsal);
  color: #ffffff;
}

.grid-cell.blackout {
  background: var(--blackout);
  color: white;
}

.grid-cell.blackout.conflict {
  box-shadow: inset 0 0 0 2px var(--danger);
  color: #ffffff;
  font-weight: 950;
}

.grid-cell.tentative-blackout {
  background: repeating-linear-gradient(
    135deg,
    var(--blackout),
    var(--blackout) 5px,
    rgba(255, 255, 255, 0.18) 5px,
    rgba(255, 255, 255, 0.18) 9px
  );
}

.grid-cell.drag-add {
  background: rgba(255, 200, 87, 0.42);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--text);
}

.grid-cell.drag-remove {
  background: rgba(255, 122, 122, 0.42);
  box-shadow: inset 0 0 0 2px var(--danger);
  color: var(--text);
}

.grid-cell.drag-tentative {
  background: repeating-linear-gradient(
    135deg,
    var(--blackout),
    var(--blackout) 5px,
    rgba(255, 255, 255, 0.18) 5px,
    rgba(255, 255, 255, 0.18) 9px
  );
  box-shadow: inset 0 0 0 2px var(--accent);
  color: #ffffff;
}

.grid-cell.note {
  background: rgba(142, 202, 230, 0.24);
  color: var(--text);
}

.availability-cell.blackout + .availability-cell.blackout {
  border-left-color: rgba(255, 255, 255, 0.2);
}

.availability-summary {
  flex-wrap: wrap;
  margin-top: 12px;
}

.availability-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.availability-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 6px;
}

.legend-swatch {
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-block;
  height: 14px;
  width: 18px;
}

.legend-swatch.gig {
  background: var(--gig);
}

.legend-swatch.rehearsal {
  background: var(--rehearsal);
}

.legend-swatch.blackout {
  background: var(--blackout);
}

.legend-swatch.open {
  background: var(--bg);
}

.range-pill {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 6px;
  padding: 6px 9px;
}

.range-pill strong {
  color: var(--text);
}

.archive-note {
  background: var(--surface-muted);
  border-radius: 7px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 14px;
  padding: 14px;
}

.setup-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.setup-panel {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 14px;
}

.setup-panel h3 {
  margin: 0 0 12px;
}

.band-switcher {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.band-switcher label,
.settings-field {
  display: grid;
  gap: 6px;
}

.band-switcher span,
.settings-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.role-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 38px;
  padding: 9px 12px;
}

.settings-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 10px 0 0;
}

.setup-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.setup-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  min-height: 40px;
  padding: 8px;
}

.setup-list.compact .setup-item,
.setup-item.option-item,
.setup-item.member-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.theme-choice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.theme-choice-button {
  align-items: center;
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
}

.theme-choice-button.active {
  background: var(--surface-muted);
  color: var(--text);
}

.theme-choice .theme-icon {
  display: block;
}

.setup-item input {
  min-width: 0;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-block;
  height: 18px;
  width: 18px;
}

.detail-date {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 6px 0 0;
}

.detail-actions {
  align-items: flex-end;
  flex-direction: column;
}

.detail-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  margin: 14px 0;
}

.detail-list div {
  background: var(--surface-muted);
  border-radius: 7px;
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

dd {
  margin: 3px 0 0;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.detail-form span,
.inline-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  line-height: 1.2;
  min-height: 42px;
  padding: 10px;
  width: 100%;
}

select {
  appearance: auto;
  padding-block: 0;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

textarea[readonly] {
  cursor: default;
}

.detail-form,
.inline-form {
  display: grid;
  gap: 10px;
}

.detail-form label,
.inline-form label:not(.toggle-control) {
  display: grid;
  gap: 6px;
}

.member-checklist-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 10px;
}

.member-checklist-field legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 4px;
}

.member-checklist {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
}

.member-check {
  align-items: center;
  background: var(--button-muted);
  border: 1px solid var(--button-muted-border);
  border-radius: 7px;
  display: flex !important;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
}

.member-check input {
  accent-color: var(--accent);
  flex: 0 0 16px;
  height: 16px;
  margin: 0;
  width: 16px;
}

.inline-form {
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 12px;
}

.inline-form button {
  min-width: max-content;
}

.form-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.more-details {
  margin-top: 12px;
}

.more-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.more-details .detail-form label {
  margin-top: 8px;
}

.custom-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 12px;
}

.custom-fields div {
  background: var(--surface-muted);
  border-radius: 7px;
  min-width: 0;
  padding: 10px;
}

.custom-fields span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.custom-fields strong {
  display: block;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(260px, 1fr) auto;
  }

  .header-metrics {
    grid-column: 1 / -1;
    grid-template-columns: auto repeat(3, minmax(150px, 1fr));
  }

  .header-actions {
    justify-content: flex-end;
  }

  .workbench-layout {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-inline: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .brand-logo {
    border-radius: 6px;
    height: 44px;
    width: 142px;
  }

  .header-metrics {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .metric-toggle {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    justify-content: flex-start;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .demo-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tabs button {
    min-width: max-content;
  }

  .workbench-layout {
    min-height: 0;
  }

  .workbench,
  .detail-pane {
    padding: 12px;
  }

  .month-grid {
    grid-template-columns: repeat(7, minmax(74px, 1fr));
    overflow-x: auto;
  }

  .month-day {
    min-height: 86px;
  }

  .ledger-filter {
    grid-template-columns: 1fr;
  }

  .ledger-table {
    min-width: 920px;
  }

  .availability-wrap,
  .table-wrap {
    overflow-x: auto;
  }

  .availability-grid {
    min-width: 1040px;
  }

  .metric {
    min-height: 88px;
    padding: 12px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

  .section-heading,
  .drawer-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .event-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .event-row .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .detail-actions {
    align-items: flex-start;
    flex-direction: row;
  }

  .toolbar,
  .inline-form,
  .setup-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .setup-grid {
    display: grid;
  }
}

