:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-alt: #eef4f3;
  --field: #fbfcfc;
  --ink: #172026;
  --muted: #66737c;
  --line: #d8e0e3;
  --teal: #217c76;
  --teal-dark: #155a56;
  --amber: #b7791f;
  --rose: #b42318;
  --blue: #315f99;
  --green: #2f7d32;
  --shadow: 0 18px 40px rgba(23, 32, 38, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101314;
  --surface: #181d1f;
  --surface-alt: #222a2c;
  --field: #121719;
  --ink: #eef3f2;
  --muted: #9aa8ad;
  --line: #313b3f;
  --teal: #53aaa1;
  --teal-dark: #8ed0c9;
  --amber: #e4b15f;
  --rose: #ff8a7d;
  --blue: #8db8f1;
  --green: #8ccf8f;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  background: #172026;
  color: #f8fbfb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #24464a;
  color: #ffe2a8;
  font-size: 28px;
  line-height: 1;
}

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

.brand p {
  color: #a6b4ba;
}

.brand h1,
.topbar h2,
.panel h3,
.song-card h4 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.2;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a,
.tab-button {
  min-height: 42px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d5dee2;
  text-align: left;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a.active,
.tab-button:hover,
.tab-button.active {
  background: #243238;
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-note span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #ffe2a8;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-note p {
  margin: 0;
  color: #cbd6da;
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px) auto auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.topbar h2 {
  max-width: 720px;
  font-size: 34px;
  line-height: 1.12;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-tile {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-tile strong {
  display: block;
  margin-bottom: 5px;
  font-size: 28px;
  line-height: 1;
}

.summary-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.manage-toggle.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.events-grid {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.72fr);
}

.refs-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.55fr);
}

.side-stack {
  display: grid;
  gap: 24px;
}

.storage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.storage-strip a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.storage-strip a::after {
  content: "↗";
  color: var(--muted);
  font-weight: 700;
}

.compact-gap {
  margin-top: 4px;
  margin-bottom: 8px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  animation: dashboardRise 360ms ease both;
}

.admin-hub-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 150px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--blue) 14%, transparent), transparent 38%),
    var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.admin-hub-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 32px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.35;
}

.admin-hub-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.13);
}

.admin-hub-card .tab-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--surface-alt);
  color: var(--blue);
}

.admin-hub-card strong {
  font-size: 18px;
}

.admin-hub-card small {
  max-width: 26ch;
  color: var(--muted);
  line-height: 1.4;
}

.admin-modal-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.compact-head {
  align-items: center;
}

.admin-modal-preview {
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel h3 {
  font-size: 22px;
  line-height: 1.2;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  align-self: end;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented-control button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 32, 38, 0.14);
}

label,
.search-field,
.select-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span,
.search-field span,
.select-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-width: 0;
  padding: 12px;
  resize: vertical;
}

select[multiple] {
  min-height: 112px;
  padding: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(33, 124, 118, 0.16);
}

.search-field {
  width: min(300px, 100%);
}

.select-field {
  width: 150px;
}

.song-list,
.event-list {
  display: grid;
  gap: 12px;
}

.compact-list {
  gap: 8px;
}

.event-row,
.song-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.calendar-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.calendar-head strong {
  min-width: 180px;
  text-align: center;
  font-size: 18px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-cell {
  height: 126px;
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.calendar-cell.empty-cell {
  background: transparent;
  border-style: dashed;
  opacity: 0.4;
}

.calendar-day {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calendar-day em {
  display: none;
  font-style: normal;
}

.calendar-events {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow: hidden;
}

.calendar-event-chip {
  display: grid;
  gap: 2px;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 5px 6px;
  background: var(--surface-alt);
  overflow: hidden;
}

.calendar-event-chip strong,
.calendar-event-chip em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-chip strong {
  font-size: 12px;
}

.calendar-event-chip em,
.calendar-more {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.chip-color-1 {
  border-left-color: var(--amber);
}

.chip-color-2 {
  border-left-color: var(--blue);
}

.chip-color-3 {
  border-left-color: var(--green);
}

.event-row {
  cursor: pointer;
}

.event-row:hover {
  border-color: #b8c8cc;
  background: var(--field);
}

.song-row {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: pointer;
}

.date-badge {
  width: 52px;
  min-height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--teal-dark);
}

.date-badge strong,
.date-badge span {
  display: block;
  line-height: 1;
}

.date-badge strong {
  font-size: 20px;
}

.date-badge span {
  font-size: 12px;
  font-weight: 800;
}

.row-main {
  min-width: 0;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-title h4,
.event-row p,
.song-row p {
  margin: 0;
}

.row-title h4 {
  font-size: 17px;
}

.event-row p,
.song-row p,
.row-stats {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.song-row:hover {
  border-color: #b8c8cc;
  background: var(--field);
}

.row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-stats span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  white-space: nowrap;
}

.song-card,
.event-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.song-main,
.event-main {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
}

.song-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.song-card h4,
.event-card h4 {
  font-size: 18px;
  line-height: 1.25;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-ready {
  background: #e6f3e8;
  color: var(--green);
}

.status-review {
  background: #e8f0fb;
  color: var(--blue);
}

.status-needs_files {
  background: #fff3d9;
  color: var(--amber);
}

.status-draft {
  background: #eef1f2;
  color: #4a5961;
}

.event-status-planning {
  background: #fff3d9;
  color: var(--amber);
}

.event-status-preparing {
  background: #e8f0fb;
  color: var(--blue);
}

.event-status-ready,
.event-status-done {
  background: #e6f3e8;
  color: var(--green);
}

.event-status-canceled {
  background: #fff0ef;
  color: var(--rose);
}

:root[data-theme="dark"] .status-ready,
:root[data-theme="dark"] .status-review,
:root[data-theme="dark"] .status-needs_files,
:root[data-theme="dark"] .status-draft,
:root[data-theme="dark"] .event-status-planning,
:root[data-theme="dark"] .event-status-preparing,
:root[data-theme="dark"] .event-status-ready,
:root[data-theme="dark"] .event-status-done,
:root[data-theme="dark"] .event-status-canceled {
  background: var(--surface-alt);
}

.song-meta,
.song-comment,
.event-meta,
.event-comment {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.song-comment,
.event-comment {
  color: var(--ink);
}

.event-songs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.event-block > strong {
  font-size: 13px;
}

.song-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-alt);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.muted-chip {
  color: var(--muted);
}

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

.schedule-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.schedule-time {
  color: var(--teal-dark);
  font-weight: 900;
}

.schedule-row strong,
.schedule-row span {
  display: block;
}

.schedule-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.icon-danger {
  width: 30px;
  height: 30px;
  border: 1px solid #ffd5d1;
  border-radius: 8px;
  background: #fff5f3;
  color: var(--rose);
  font-size: 20px;
  line-height: 1;
}

.mini-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.request-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.request-row.is-editable {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px 30px;
  flex-wrap: initial;
}

.request-row.is-editable .row-drag-handle {
  align-self: center;
}

.request-row > span {
  flex: 1;
  min-width: 180px;
  color: var(--ink);
  font-size: 14px;
}

.request-song-link {
  min-height: 26px;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
}

.request-stage-card {
  width: 100%;
  flex: 1;
  display: grid;
  gap: 3px;
  justify-items: start;
  text-align: left;
}

.request-row.is-editable .request-stage-card {
  min-width: 0;
}

@media (max-width: 520px) {
  .request-row.is-editable {
    grid-template-columns: 20px minmax(0, 1fr) 30px 30px;
    padding: 7px;
  }
}

.request-stage-card strong {
  color: var(--ink);
  font-size: 14px;
}

.request-stage-card span {
  color: var(--muted);
  font-size: 12px;
}

.request-approval-toggle {
  display: inline-grid;
  grid-template-columns: 20px auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--surface-alt);
  font-weight: 800;
}

.request-approval-toggle input {
  width: 18px;
  min-height: 18px;
}

.song-request-materials {
  margin-top: 16px;
}

.acknowledgement-control {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: center;
}

.acknowledgement-control input {
  width: 18px;
  min-height: 18px;
}

.media-stage-group {
  display: grid;
  gap: 6px;
  align-content: start;
}

.media-stage-group > strong {
  font-size: 13px;
}

.media-stage-group label span {
  display: grid;
  gap: 2px;
}

.media-stage-group label strong {
  font-size: 13px;
  font-weight: 650;
}

.media-stage-group label small {
  color: var(--muted);
  font-size: 11px;
}

.media-stage-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-stage-grid > p {
  grid-column: 1 / -1;
}

.schedule-assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-assignment-grid .check-grid {
  max-height: 220px;
  overflow-y: auto;
  align-content: start;
}

@media (max-width: 680px) {
  .schedule-assignment-grid {
    grid-template-columns: 1fr;
  }
}

.event-checklist-sheet,
.checklist-overview,
.checklist-overview-groups {
  display: grid;
  gap: 12px;
}

.checklist-role-block,
.checklist-event-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.checklist-role-block {
  padding: 14px;
}

.checklist-role-head,
.checklist-event-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.checklist-role-head h4,
.checklist-overview-groups h4 {
  margin: 0;
}

.checklist-role-head span,
.checklist-event-head small,
.checklist-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.checklist-role-head progress {
  width: min(180px, 38%);
  height: 8px;
}

.checklist-items {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.checklist-item {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}

.checklist-item:first-child { border-top: 0; }

.checklist-item > label {
  grid-template-columns: 20px 1fr;
  flex: 1;
  align-items: center;
}

.checklist-item input {
  width: 18px;
  min-height: 18px;
}

.checklist-item.is-complete strong {
  color: var(--muted);
  text-decoration: line-through;
}

.checklist-item-actions {
  display: flex;
  gap: 4px;
}

.checklist-event-head {
  width: 100%;
  min-height: 58px;
  border: 0;
  padding: 12px 14px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}

.checklist-event-head span { min-width: 0; }
.checklist-event-head b { flex: 0 0 auto; }

.checklist-overview-groups {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 14px;
}

.calendar-feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-alt);
}

.push-panel h4 {
  margin: 0;
}

.request-approved {
  border-color: #cfe6d2;
  background: #f6fbf7;
}

.request-rejected {
  border-color: #ffd5d1;
  background: #fff8f7;
}

:root[data-theme="dark"] .request-approved,
:root[data-theme="dark"] .request-rejected {
  background: var(--surface-alt);
}

.tiny-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--teal);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

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

.song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.song-actions select {
  width: 150px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.link-row a {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.materials-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.material-item strong {
  font-size: 13px;
}

.material-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.material-item a {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.material-item .icon-download,
.icon-download {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  text-decoration: none;
}

.material-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.event-media-sheet {
  display: grid;
  gap: 14px;
}

.media-stage-section {
  display: grid;
  gap: 10px;
}

.media-stage-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}

.media-stage-head span,
.media-stage-title span {
  color: var(--muted);
  font-size: 12px;
}

.media-stage-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.media-stage-title {
  display: grid;
  gap: 2px;
}

.media-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.media-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.media-card-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.media-card-main strong,
.media-card-main span {
  display: block;
}

.media-card-main strong {
  overflow-wrap: anywhere;
}

.media-card-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.media-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.media-usage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-usage-chip {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.media-usage-chip.all {
  border-color: rgba(20, 184, 166, 0.35);
  color: var(--teal-dark);
}

.media-count {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  margin-top: 6px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  padding: 4px 7px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.schedule-table .media-count span,
.schedule-table .media-count small {
  display: block;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.schedule-table .media-count small {
  max-width: 220px;
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.preset-grid button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 800;
}

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

.song-form,
.event-form,
.schedule-form,
.quick-form,
.admin-form {
  display: grid;
  gap: 14px;
}

.refs-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.refs-columns h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.mini-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mini-head h4 {
  margin: 0;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.mini-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.mini-action-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-action-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.danger-mini {
  border-color: #ffd5d1;
  background: #fff5f3;
  color: var(--rose);
}

:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .danger-mini,
:root[data-theme="dark"] .icon-danger {
  border-color: #5e3733;
  background: #261918;
}

.is-muted {
  opacity: 0.55;
}

.toggle-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 11px 0 0;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.toggle-row span {
  color: var(--ink);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.check-grid legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-grid label {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
}

.check-grid input {
  width: 18px;
  min-height: 18px;
}

.user-admin-card {
  display: grid;
  gap: 16px;
}

.user-admin-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06)), var(--surface);
}

.user-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.user-admin-hero h3,
.section-copy h4 {
  margin: 0;
}

.user-admin-hero p,
.section-copy p {
  margin: 4px 0 0;
  color: var(--muted);
}

.user-admin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.user-admin-badges > span:not(.status-pill) {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.user-card-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.user-card-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
}

.user-card-tabs button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
}

.user-card-panel {
  display: none;
}

.user-card-panel.active {
  display: block;
}

.user-card-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.section-copy {
  max-width: 720px;
}

.access-matrix {
  display: grid;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.access-row {
  min-width: 760px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.access-row:last-child {
  border-bottom: 0;
}

.access-head {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-row label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--ink);
  font-size: 13px;
}

.access-row input {
  width: 16px;
  min-height: 16px;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-summary-grid > div,
.user-history-placeholder {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.user-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.user-summary-grid strong {
  font-weight: 650;
}

.user-history-placeholder p {
  margin: 6px 0 0;
  color: var(--muted);
}

.user-status-active {
  background: #e6f3e8;
  color: var(--green);
}

.user-status-pending {
  background: #fff3d9;
  color: var(--amber);
}

.user-status-blocked {
  background: #fff0ef;
  color: var(--rose);
}

.user-status-archived {
  background: #eef1f2;
  color: #4a5961;
}

.registration-success {
  display: grid;
  gap: 16px;
}

.registration-success-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.08);
}

.registration-success h3,
.registration-success h4,
.registration-success p {
  margin: 0;
}

.registration-success-head p,
.install-guide p,
.install-steps span {
  color: var(--muted);
}

.install-guide {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.install-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.install-steps div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.install-steps strong,
.install-steps span {
  display: block;
}

.registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 720px) {
  .user-admin-hero {
    align-items: flex-start;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }

  .user-card-section {
    padding: 12px;
  }

  .access-row {
    min-width: 680px;
  }

  .install-steps {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.form-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.icon-only {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 18px;
}

.tiny-button.icon-only,
.icon-danger.icon-only {
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 15px;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.danger-button {
  border-color: #ffd5d1;
  background: #fff5f3;
  color: var(--rose);
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.small-empty {
  min-height: 120px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 22, 27, 0.48);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 38, 0.25);
  overflow: hidden;
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 22px;
}

.modal-body {
  overflow: auto;
  padding: 20px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.favicon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.favicon-preview img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.password-toggle:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.event-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 18px;
}

.song-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
  gap: 18px;
}

.song-detail-grid p {
  margin: 0 0 8px;
}

.song-structure-view {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.song-structure-part {
  position: relative;
  display: inline-grid;
  gap: 3px;
  min-width: 0;
  max-width: 180px;
  padding: 8px 11px 8px 28px;
  border: 1px solid color-mix(in srgb, var(--part-color) 30%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--part-color) 13%, transparent), transparent),
    var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.song-structure-part::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--part-color);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--part-color) 16%, transparent);
}

.song-structure-part span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
}

.song-structure-part p,
.song-structure-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.song-structure-editor,
.song-structure-list {
  display: grid;
  gap: 10px;
}

.song-structure-edit-row {
  display: grid;
  grid-template-columns: auto minmax(130px, 0.7fr) 88px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-alt);
}

.multi-search-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.multi-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.multi-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}

.multi-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.multi-results {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.multi-results.is-open {
  display: grid;
  gap: 6px;
}

.multi-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.multi-results small {
  color: var(--muted);
}

.song-picker {
  display: grid;
  gap: 12px;
}

.schedule-stage-link {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-stage-link.has-details {
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 54%),
    transparent;
}

.stage-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-height: 0;
}

.schedule-stage-link em {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.stage-details-form,
.stage-detail-card {
  display: grid;
  gap: 12px;
}

.stage-detail-sections {
  gap: 14px;
}

.stage-detail-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.stage-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-detail-meta span {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
}

.stage-detail-card h3,
.stage-detail-card h4 {
  margin: 0;
}

.stage-detail-card pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.5;
}

.song-picker-results {
  max-height: min(48vh, 460px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.song-picker-row {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.song-picker-row:hover {
  border-color: #9fb7bd;
  background: var(--field);
}

.song-picker-row strong,
.song-picker-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-picker-row span {
  color: var(--muted);
  font-size: 12px;
}

.split-actions {
  justify-content: space-between;
}

.song-text-preview {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-family: inherit;
  white-space: pre-wrap;
}

.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 10px;
}

.detail-side h4 {
  margin: 0;
  font-size: 14px;
}

.event-side-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.event-group-list {
  max-height: 150px;
  overflow-y: auto;
}

.event-song-approvals {
  min-height: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 13px;
}

.assignment-chip strong {
  color: var(--muted);
}

.person-link {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.muted-inline {
  color: var(--muted);
}

.person-card {
  display: grid;
  gap: 12px;
}

.person-card p {
  margin: 0;
}

.contact-missing {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.request-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
}

.chip-icon-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--rose);
  font-weight: 900;
}

.day-event-switcher {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.day-event-switcher button {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.day-event-switcher button.active {
  border-color: var(--teal);
  background: var(--surface-alt);
}

.day-event-switcher span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sheet-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.sheet-tabs button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.sheet-table-wrap {
  display: grid;
  gap: 10px;
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

.two-col-sheet {
  min-width: 520px;
}

.wide-sheet {
  min-width: 1080px;
}

.sheet-table th,
.sheet-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.sheet-table th {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
}

.schedule-set-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-set-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.schedule-set-list button {
  min-width: 116px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.schedule-set-list button.active {
  border-color: var(--teal);
  background: var(--field);
}

.schedule-set-list span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-set-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

.schedule-wrap {
  display: grid;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.schedule-column-toggles {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.schedule-column-toggles button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.schedule-column-toggles button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.schedule-column-toggles button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.schedule-table th,
.schedule-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.schedule-table th {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
}

.table-actions {
  width: 126px;
  white-space: nowrap;
}

.table-actions button + button {
  margin-left: 6px;
}

.schedule-head-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.column-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.column-tools button {
  min-width: 24px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.drag-hint,
.row-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-height: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface-alt);
  color: var(--muted);
  cursor: grab;
  font-size: 12px;
  font-weight: 800;
  touch-action: none;
  user-select: none;
}

.schedule-table .drag-hint,
.schedule-table .row-drag-handle {
  display: inline-flex;
  margin-top: 0;
  color: var(--muted);
}

.schedule-add-row {
  display: flex;
  justify-content: center;
}

.schedule-empty {
  gap: 10px;
}

[draggable="true"] {
  cursor: grab;
}

.is-dragging {
  opacity: 0.45;
}

.is-drop-target {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  background: var(--surface-alt);
}

.schedule-table strong,
.schedule-table span {
  display: block;
}

.schedule-table span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stage-end-time {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.schedule-total {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-alt);
}

.schedule-total span {
  color: var(--muted);
  font-size: 12px;
}

.team-value,
.team-schedule-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.team-schedule-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--field);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.team-schedule-badge.all {
  color: var(--teal-dark);
}

.login-alt-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.login-alt-actions .ghost-button {
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.column-toggle-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.column-toggle-strip button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.column-toggle-strip button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.directions-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  max-height: min(68vh, 760px);
}

.directions-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.directions-table th,
.directions-table td {
  width: 180px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  background: var(--surface);
}

.directions-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-alt);
  text-align: left;
}

.directions-table .sticky-col {
  left: 0;
  z-index: 3;
  width: 210px;
  min-width: 210px;
}

.direction-event-link {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.direction-event-link span {
  color: var(--muted);
  font-size: 12px;
}

.direction-event-link strong {
  display: -webkit-box;
  overflow: hidden;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.direction-cell-value {
  display: flex;
  min-height: 34px;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 13px;
}

.direction-cell-edit {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
  cursor: pointer;
}

.directions-mobile-list {
  display: none;
}

.direction-edit-context {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.direction-edit-context span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .topbar,
  .content-grid,
  .events-grid,
  .refs-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .storage-strip {
    max-width: 680px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .summary-grid,
  .storage-strip,
  .form-grid,
  .preset-grid,
  .refs-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-row,
  .song-row,
  .event-detail-grid,
  .song-detail-grid {
    grid-template-columns: 1fr;
  }

  .song-structure-edit-row {
    grid-template-columns: auto minmax(0, 1fr) 74px auto;
  }

  .song-structure-edit-row label:last-of-type {
    grid-column: 2 / -1;
  }

  .date-badge {
    width: 100%;
    min-height: 42px;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 6px;
    padding: 0 10px;
  }

  .panel-head,
  .song-main,
  .event-main,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .song-actions {
    justify-content: stretch;
  }

  .search-field,
  .select-field,
  .song-actions select {
    width: 100%;
  }

  .event-view-switch {
    width: 100%;
  }

  .event-view-switch button {
    width: 100%;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 4px;
  }

  .calendar-cell {
    min-height: 78px;
    height: 78px;
    padding: 5px;
    gap: 4px;
  }

  .calendar-event-chip {
    padding: 3px 4px;
  }

  .calendar-event-chip em {
    display: none;
  }

  .directions-wrap {
    display: none;
  }

  .directions-mobile-list {
    display: grid;
    gap: 12px;
  }

  .direction-mobile-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
  }

  .direction-mobile-event {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
  }

  .direction-mobile-event strong,
  .direction-mobile-event small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .direction-mobile-event small,
  .direction-mobile-event em {
    color: var(--muted);
    font-size: 12px;
  }

  .direction-mobile-event em {
    max-width: 120px;
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--surface-alt);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: normal;
  }

  .direction-mobile-roles {
    display: grid;
  }

  .direction-mobile-role {
    display: grid;
    grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 48px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
  }

  .direction-mobile-role:last-child {
    border-bottom: 0;
  }

  .direction-mobile-role > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
  }

  .direction-mobile-role > div {
    min-width: 0;
    font-size: 13px;
  }

  .direction-empty-value {
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
   }

  .direction-mobile-role .assignment-chip,
  .direction-mobile-role .song-chip {
    max-width: 100%;
  }

  .direction-mobile-role .person-link {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .direction-mobile-role .direction-cell-edit {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 520px) {
  .nav-list,
  .summary-grid,
  .storage-strip,
  .form-grid,
  .preset-grid,
  .refs-columns {
    grid-template-columns: 1fr;
  }

  .material-item {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 18px;
  }

  .panel {
    padding: 16px;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-day em {
    display: inline;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(32px, 1fr));
  }

  .calendar-cell {
    min-height: 70px;
    height: 70px;
    border-radius: 6px;
  }

  .calendar-cell.empty-cell {
    display: block;
  }

  .direction-mobile-event {
    grid-template-columns: 1fr;
  }

  .direction-mobile-event em {
    max-width: 100%;
    width: fit-content;
  }

  .direction-mobile-role {
    grid-template-columns: minmax(72px, 0.3fr) minmax(0, 1fr) auto;
    padding: 8px;
  }
}

/* Modern Worship design system layer */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --field: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --teal: #14b8a6;
  --teal-dark: #0f766e;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --green: #22c55e;
  --amber: #f59e0b;
  --rose: #ef4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --field: #0f172a;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #263244;
  --teal: #2dd4bf;
  --teal-dark: #5eead4;
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.16);
  --green: #4ade80;
  --amber: #fbbf24;
  --rose: #f87171;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.28), 0 18px 38px rgba(0, 0, 0, 0.22);
  --focus: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 32rem),
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent 24rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea,
a {
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.login-screen {
  padding: 32px 18px;
}

.login-card {
  width: min(448px, 100%);
  gap: 18px;
  padding: 34px;
  border-color: rgba(226, 232, 240, 0.92);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .login-card {
  border-color: var(--line);
}

.login-card .eyebrow,
.login-card h1 {
  text-align: center;
}

.login-card h1 {
  font-size: 30px;
  line-height: 1.12;
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 24px 18px;
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #f8fafc;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .sidebar {
  background: #080f1d;
}

.brand {
  padding: 8px 8px 4px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(20, 184, 166, 0.24);
}

.nav-list {
  gap: 6px;
}

.tab-button {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: #cbd5e1;
  font-weight: 800;
}

.tab-button::before {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 14px;
}

.tab-button[data-tab="events"]::before { content: "◷"; }
.tab-button[data-tab="directions"]::before { content: "▦"; }
.tab-button[data-tab="songs"]::before { content: "♪"; }
.tab-button[data-tab="checklists"]::before { content: "✓"; }
.tab-button[data-tab="admin"]::before { content: "⚙"; }

.tab-button:hover,
.tab-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tab-button.active::before {
  background: #ffffff;
  color: var(--blue);
}

.sidebar-note {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.workspace {
  padding: 32px;
}

.topbar {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px) auto auto auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.topbar h2 {
  font-size: 38px;
  letter-spacing: 0;
}

.summary-tile,
.panel,
.event-row,
.song-row,
.song-card,
.event-card,
.mini-item,
.checklist-event-card {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-tile {
  min-height: 78px;
  padding: 13px 14px;
}

.summary-tile strong {
  color: var(--ink);
}

.panel {
  padding: 24px;
}

.panel-head {
  align-items: center;
  margin-bottom: 20px;
}

.panel h3 {
  font-size: 24px;
}

.eyebrow,
.brand p,
label span,
.search-field span,
.select-field span {
  color: var(--muted);
  letter-spacing: 0;
}

.toolbar {
  align-items: end;
}

.primary-button,
.ghost-button,
.danger-button,
.theme-toggle,
.icon-button,
.tiny-button,
.icon-danger {
  border-radius: var(--radius-md);
  font-weight: 850;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.primary-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  transform: translateY(-1px);
}

.ghost-button,
.theme-toggle,
.icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ghost-button:hover,
.theme-toggle:hover,
.icon-button:hover {
  border-color: rgba(37, 99, 235, 0.36);
  background: var(--blue-soft);
  color: var(--blue);
}

.danger-button,
.danger-mini,
.icon-danger {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.08);
  color: var(--rose);
}

.theme-toggle {
  min-height: 42px;
  box-shadow: none;
}

.manage-toggle.active {
  border-color: var(--teal);
  background: rgba(20, 184, 166, 0.12);
  color: var(--teal-dark);
}

input,
select,
textarea {
  min-height: 44px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.password-field {
  display: grid;
  align-items: center;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0;
}

.password-toggle::before {
  content: "";
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px / 720px;
}

.password-toggle::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle.is-visible::after {
  width: 9px;
  height: 2px;
  border-radius: 2px;
  transform: rotate(-35deg);
}

.storage-strip a {
  border-radius: var(--radius-md);
  color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.storage-strip a:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: var(--blue-soft);
}

.segmented-control {
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.segmented-control button {
  border-radius: var(--radius-sm);
}

.segmented-control button.active {
  color: var(--blue);
  box-shadow: var(--shadow);
}

.event-row,
.song-row {
  padding: 14px;
}

.event-row:hover,
.song-row:hover,
.mini-item:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #ffffff;
  transform: translateY(-1px);
}

:root[data-theme="dark"] .event-row:hover,
:root[data-theme="dark"] .song-row:hover,
:root[data-theme="dark"] .mini-item:hover {
  background: var(--surface-alt);
}

.date-badge {
  background: var(--blue-soft);
  color: var(--blue);
}

.row-stats span,
.status-pill,
.team-schedule-badge,
.calendar-event-chip em,
.calendar-more {
  border-radius: 999px;
}

.status-ready,
.event-status-ready,
.event-status-done {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.status-review,
.event-status-preparing {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
}

.status-needs_files,
.event-status-planning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.status-draft {
  background: var(--surface-alt);
  color: var(--muted);
}

.event-status-canceled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--rose);
}

:root[data-theme="dark"] .status-ready,
:root[data-theme="dark"] .event-status-ready,
:root[data-theme="dark"] .event-status-done {
  color: var(--green);
}

:root[data-theme="dark"] .status-needs_files,
:root[data-theme="dark"] .event-status-planning {
  color: var(--amber);
}

.calendar-panel {
  gap: 12px;
}

.calendar-cell {
  height: 118px;
  min-height: 118px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.calendar-cell:not(.empty-cell):hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: var(--shadow);
}

.calendar-event-chip {
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.calendar-event-chip strong {
  line-height: 1.25;
}

.modal-layer {
  animation: fadeIn 160ms ease;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(8px);
}

.modal-card {
  border-radius: var(--radius-md);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
  animation: modalIn 180ms ease;
}

.modal-head {
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

.sheet-tabs,
.schedule-set-tabs {
  gap: 8px;
}

.sheet-tabs button,
.schedule-set-tabs button {
  border-radius: var(--radius-md);
}

.sheet-table-wrap,
.directions-table-wrap {
  border-radius: var(--radius-md);
}

.empty-state {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
}

:root[data-theme="dark"] .empty-state {
  background: rgba(255, 255, 255, 0.03);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .summary-grid {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 820px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: auto;
    gap: 14px;
    padding: 12px;
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    min-width: max-content;
    min-height: 40px;
    padding: 0 10px;
  }

  .tab-button::before {
    width: 24px;
    height: 24px;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 30px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 18px;
  }

  .modal-layer {
    align-items: end;
    padding: 10px;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 24px;
  }

  .login-card h1 {
    font-size: 25px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) repeat(3, 42px);
  }

  .theme-toggle:not(.icon-only) {
    width: 42px;
    min-width: 42px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .theme-toggle:not(.icon-only)::before {
    content: "◐";
    color: var(--ink);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    gap: 14px;
  }

  .toolbar {
    width: 100%;
  }

  .calendar-cell {
    min-height: 74px;
    height: 74px;
    padding: 5px;
  }

  .calendar-event-chip strong {
    font-size: 11px;
  }

  .modal-head,
  .modal-body {
    padding: 18px;
  }
}

/* Multitracks-inspired application shell */
:root {
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 48px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.045);
}

body {
  font-family: Inter, Manrope, "SF Pro Display", "Segoe UI", Arial, sans-serif;
}

.login-card,
.panel,
.summary-tile,
.event-row,
.song-row,
.mini-item,
.modal-card,
.dashboard-hero,
.dashboard-next-card,
.dashboard-event-card,
.dashboard-task-row,
.dashboard-metric {
  border-radius: var(--radius-md);
}

.tab-button::before {
  content: none;
  display: none;
}

.tab-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: currentColor;
}

.tab-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.tab-icon[data-icon="home"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="calendar"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="music"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="users"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="folder"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="message"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="image"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E");
}

.tab-icon[data-icon="settings"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.72l.15-.1a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.tab-button.active .tab-icon {
  background: #ffffff;
  color: var(--blue);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(20, 184, 166, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
  animation: dashboardRise 420ms ease both;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  top: -90px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 64%);
  animation: dashboardGlow 5.5s ease-in-out infinite alternate;
  pointer-events: none;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h3 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.dashboard-next-card {
  display: grid;
  gap: 10px;
  align-content: center;
  padding: 22px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  animation: dashboardSlideIn 480ms ease 80ms both;
}

:root[data-theme="dark"] .dashboard-next-card {
  background: rgba(30, 41, 59, 0.72);
}

.dashboard-next-card span,
.dashboard-next-card p,
.dashboard-event-card small,
.dashboard-task-row small,
.dashboard-metric span {
  color: var(--muted);
}

.dashboard-next-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 24px;
}

.dashboard-push-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: -8px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-push-card > div:first-child {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.dashboard-push-card strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 650;
}

.dashboard-push-card p {
  margin: 0;
  color: var(--muted);
}

.dashboard-push-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dashboard-message-card {
  margin: -8px 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.assistant-card {
  display: grid;
  gap: 14px;
  margin: -8px 0 24px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 9%, transparent), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  animation: dashboardRise 380ms ease 120ms both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.assistant-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.11);
}

.assistant-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.assistant-head h3 {
  margin: 2px 0 0;
  font-size: 20px;
}

.assistant-head::after {
  content: "";
  width: 11px;
  height: 11px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 32%, transparent);
  animation: assistantPulse 2.4s ease-out infinite;
}

.assistant-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.assistant-thread {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.assistant-message {
  width: fit-content;
  max-width: min(760px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--ink);
  line-height: 1.45;
  animation: assistantMessageIn 180ms ease both;
}

.assistant-message > span {
  display: block;
}

.stage-details-collapsible {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.stage-details-collapsible summary {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.stage-details-collapsible summary::-webkit-details-marker {
  display: none;
}

.stage-details-collapsible summary span {
  font-weight: 650;
}

.stage-details-collapsible summary small {
  color: var(--muted);
}

.stage-details-collapsible[open] {
  padding-bottom: 14px;
}

.stage-details-collapsible[open] label {
  margin: 0 14px;
}

.assistant-user {
  justify-self: end;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.assistant-warning {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

.assistant-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.assistant-message-actions .ghost-button {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-actions .ghost-button {
  padding: 8px 11px;
}

.assistant-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.assistant-input input {
  min-width: 0;
}

@keyframes assistantPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 30%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

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

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

@keyframes dashboardSlideIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dashboardGlow {
  from {
    transform: translate3d(0, 0, 0) scale(0.95);
    opacity: 0.65;
  }
  to {
    transform: translate3d(-20px, 22px, 0) scale(1.08);
    opacity: 1;
  }
}

.support-request-list {
  display: grid;
  gap: 10px;
}

.support-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.support-request-card strong,
.support-request-card small {
  display: block;
}

.support-request-card small {
  margin-top: 3px;
  color: var(--muted);
}

.support-request-card p {
  margin: 10px 0 0;
  white-space: pre-wrap;
}

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

.dashboard-message-inbox,
.dashboard-message-form {
  min-width: 0;
}

.dashboard-message-form {
  display: grid;
  gap: 12px;
}

.message-recipient-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.message-recipient-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-recipient-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
}

.message-recipient-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.message-recipient-results {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.message-recipient-results.is-open {
  display: grid;
  gap: 6px;
}

.message-recipient-results label,
.message-recipient-results button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.message-recipient-results button {
  grid-template-columns: minmax(0, 1fr);
}

.message-recipient-results label span,
.message-recipient-results button span {
  display: grid;
  min-width: 0;
}

.message-recipient-results small {
  color: var(--muted);
}

.message-role-picker {
  margin-top: 2px;
}

.message-list {
  display: grid;
  gap: 10px;
}

.message-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.message-note span,
.message-note small,
.form-status {
  color: var(--muted);
}

.message-note strong,
.message-note p {
  display: block;
  margin: 2px 0;
}

.message-note p {
  white-space: pre-wrap;
}

.checklist-template-library {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.checklist-template-list {
  display: grid;
  gap: 10px;
}

.checklist-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.checklist-template-card strong,
.checklist-template-card small {
  display: block;
}

.checklist-template-card small {
  color: var(--muted);
}

.instructions-panel {
  display: grid;
  gap: 18px;
}

.instruction-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.instruction-tab-item {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.instruction-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.instruction-tabs button.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.instruction-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.instruction-card > button {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.instruction-card span,
.instruction-card small,
.instruction-description,
.instruction-step p {
  color: var(--muted);
}

.instruction-card strong {
  font-size: 18px;
}

.instruction-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.instruction-detail {
  display: grid;
  gap: 18px;
}

.instruction-steps {
  display: grid;
  gap: 12px;
}

.instruction-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.instruction-step-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.instruction-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.compact-actions {
  align-items: center;
}

.dashboard-wide {
  grid-column: 1 / -1;
}

.dashboard-event-list,
.dashboard-task-list {
  display: grid;
  gap: 10px;
}

.dashboard-event-card,
.dashboard-task-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.dashboard-event-card:hover,
.dashboard-task-row:hover {
  border-color: rgba(37, 99, 235, 0.32);
  background: var(--blue-soft);
}

.dashboard-event-card strong,
.dashboard-task-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-event-card em {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.status-dot,
.task-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.event-dot-ready,
.event-dot-done {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13);
}

.event-dot-planning,
.task-warning {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.event-dot-canceled {
  background: var(--rose);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.13);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-metric {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: dashboardRise 360ms ease both;
}

.dashboard-metric:nth-child(2) {
  animation-delay: 60ms;
}

.dashboard-metric:nth-child(3) {
  animation-delay: 120ms;
}

.dashboard-metric:nth-child(4) {
  animation-delay: 180ms;
}

.dashboard-metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 32px;
  line-height: 1;
}

button:active,
.dashboard-event-card:active,
.dashboard-task-row:active {
  transform: translateY(1px);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .dashboard-hero,
  .dashboard-grid,
  .dashboard-message-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    border-radius: 0 0 24px 24px;
  }

  .dashboard-hero {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .dashboard-hero {
    padding: 18px;
  }

  .dashboard-event-card,
  .dashboard-task-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dashboard-push-card {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-push-actions {
    justify-content: stretch;
  }

  .dashboard-push-actions button {
    flex: 1;
  }

  .assistant-card {
    padding: 14px;
  }

  .assistant-input {
    grid-template-columns: 1fr;
  }

  .assistant-input button {
    width: 100%;
  }

  .assistant-actions .ghost-button {
    flex: 1 1 auto;
  }

  .support-request-card {
    grid-template-columns: 1fr;
  }

  .dashboard-message-card {
    padding: 14px;
  }

  .compact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-event-card em {
    grid-column: 2;
    width: fit-content;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

/* Typography and password control refinement */
body {
  font-family: Manrope, Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
.row-title h4,
.brand h1,
.dashboard-next-card strong,
.dashboard-event-card strong,
.dashboard-task-row strong,
.dashboard-metric strong,
.summary-tile strong {
  font-weight: 650;
}

.eyebrow,
.brand p,
label span,
.search-field span,
.select-field span,
.primary-button,
.ghost-button,
.danger-button,
.theme-toggle,
.tab-button,
.status-pill,
.row-stats span,
.dashboard-event-card em,
.segmented-control button {
  font-weight: 600;
}

.password-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.password-toggle::after {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.password-toggle.is-visible::after {
  transform: translate(-50%, -50%) rotate(-35deg);
}

/* Motion polish: small, consistent UI feedback across the app. */
.tab-panel.active {
  animation: appFadeUp 220ms ease both;
}

.panel,
.calendar-panel,
.dashboard-push-card,
.dashboard-message-card,
.event-row,
.song-row,
.mini-item,
.checklist-card,
.instruction-card,
.media-card,
.direction-mobile-card,
.support-request-card {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.panel:hover,
.calendar-panel:hover {
  border-color: color-mix(in srgb, var(--blue) 18%, var(--line));
}

.event-row,
.song-row,
.mini-item,
.dashboard-event-card,
.dashboard-task-row,
.checklist-card,
.instruction-card,
.media-card,
.direction-mobile-card {
  animation: appFadeUp 220ms ease both;
}

.event-row:hover,
.song-row:hover,
.mini-item:hover,
.checklist-card:hover,
.instruction-card:hover,
.media-card:hover,
.direction-mobile-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.primary-button,
.ghost-button,
.danger-button,
.tiny-button,
.icon-button,
.theme-toggle,
.tab-button,
.segmented-control button,
.sheet-tabs button,
.schedule-set-list button,
.calendar-day,
.calendar-event-pill {
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.tiny-button:hover,
.icon-button:hover,
.theme-toggle:hover,
.segmented-control button:hover,
.sheet-tabs button:hover,
.schedule-set-list button:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.ghost-button:active,
.danger-button:active,
.tiny-button:active,
.icon-button:active,
.theme-toggle:active,
.tab-button:active,
.calendar-day:active {
  transform: translateY(1px) scale(0.99);
}

.modal-layer:not(.is-hidden) .modal-backdrop {
  animation: appBackdropIn 180ms ease both;
}

.modal-layer:not(.is-hidden) .modal-card {
  animation: appModalIn 210ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.assistant-message {
  animation: appMessageIn 190ms ease both;
}

.assistant-actions .ghost-button,
.assistant-message-actions .ghost-button {
  animation: appChipIn 180ms ease both;
}

.calendar-event-pill:hover,
.schedule-stage-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

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

@keyframes appModalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
