/* Fun Mode theme (Backstage palette) */
.theme-fun {
  --fun-bg: #fff7f0;
  --fun-bg-soft: #f4fbf7;
  --fun-card: #ffffff;
  --fun-card-border: rgba(29, 35, 51, 0.08);
  --fun-ink: #1d2333;
  --fun-ink-muted: #5b677a;
  --fun-accent: #ff7a64;
  --fun-accent-strong: #f15e4c;
  --fun-mint: #78d6ba;
  --fun-navy: #1f2c46;
  --fun-focus: #2d8a88;
  --fun-shadow: 0 16px 30px rgba(31, 41, 51, 0.16);
  --fun-shadow-soft: 0 8px 18px rgba(31, 41, 51, 0.12);
}

body.theme-fun {
  background-color: var(--fun-bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 122, 100, 0.18), transparent 35%),
    radial-gradient(circle at 88% 18%, rgba(120, 214, 186, 0.2), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(45, 138, 136, 0.16), transparent 45%),
    linear-gradient(180deg, var(--fun-bg) 0%, var(--fun-bg-soft) 45%, #ffffff 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--fun-ink);
}

.theme-fun .ts-app-shell {
  background: transparent;
}

.theme-fun .ts-topbar,
.theme-fun .ts-sidebar {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--fun-card-border);
}

.theme-fun .ts-page {
  padding-bottom: 2rem;
}

.theme-fun .ts-page-header {
  border-bottom: 1px dashed rgba(31, 41, 51, 0.12);
  padding-bottom: 1rem;
}

.theme-fun .ts-page-title {
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.theme-fun .ts-page-title::after {
  content: "";
  display: block;
  width: 62px;
  height: 6px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 122, 100, 0.8), rgba(120, 214, 186, 0.7));
}

.theme-fun .ts-page-subtitle {
  color: var(--fun-ink-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.theme-fun .fun-helper-text {
  color: var(--fun-ink-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.theme-fun .btn {
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.18s ease,
    background-color 0.18s ease, color 0.18s ease;
}

.theme-fun .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(31, 41, 51, 0.12);
}

.theme-fun .btn:focus-visible,
.theme-fun :focus-visible {
  outline: 3px solid rgba(45, 138, 136, 0.55);
  outline-offset: 2px;
}

.theme-fun .btn-primary {
  background: var(--fun-accent);
  border-color: var(--fun-accent);
  color: #ffffff;
}

.theme-fun .btn-primary:hover {
  background: var(--fun-accent-strong);
  border-color: var(--fun-accent-strong);
}

.theme-fun .btn-outline {
  border-color: rgba(31, 41, 51, 0.16);
  color: var(--fun-navy);
}

.theme-fun .input,
.theme-fun .select,
.theme-fun .textarea,
.theme-fun .form-control,
.theme-fun .form-select {
  border-radius: 12px;
  border-color: rgba(31, 41, 51, 0.12);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(31, 41, 51, 0.03);
}

.theme-fun .ts-card,
.theme-fun .card,
.theme-fun .fun-card {
  border-radius: 16px;
  border: 1px solid var(--fun-card-border);
  background: var(--fun-card);
  box-shadow: var(--fun-shadow-soft);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-fun .ts-card:hover,
.theme-fun .fun-card:hover {
  border-color: rgba(255, 122, 100, 0.35);
  box-shadow: var(--fun-shadow);
}

.theme-fun .fun-card:hover {
  transform: translateY(-2px);
}

.theme-fun a.fun-card {
  color: inherit;
  text-decoration: none;
}

.theme-fun .fun-card-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.theme-fun .fun-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.theme-fun .fun-card-subtitle {
  color: var(--fun-ink-muted);
  font-size: 0.85rem;
}

.theme-fun .fun-dashboard-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.theme-fun .fun-card-wide {
  grid-column: span 1;
}

@media (min-width: 1024px) {
  .theme-fun .fun-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .theme-fun .fun-card-wide {
    grid-column: span 2;
  }
}

.theme-fun .fun-empty-state {
  align-items: center;
  color: var(--fun-ink-muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: center;
  padding: 1.2rem 0.75rem;
  text-align: center;
}

.theme-fun .fun-empty-state i {
  background: rgba(255, 122, 100, 0.12);
  border-radius: 14px;
  color: var(--fun-accent);
  font-size: 1.1rem;
  padding: 0.6rem;
  animation: fun-float 4s ease-in-out infinite;
}

.theme-fun .fun-empty-title {
  color: var(--fun-ink);
  font-weight: 600;
}

.theme-fun .ts-chip {
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--fun-ink-muted);
  font-weight: 600;
}

.theme-fun .fun-chip {
  background: rgba(120, 214, 186, 0.15);
  border-color: rgba(120, 214, 186, 0.4);
  color: #1b6d58;
}

.theme-fun .fun-status {
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  color: var(--fun-navy);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.02em;
}

.theme-fun .fun-status[data-status="PLANNING"] {
  background: rgba(120, 214, 186, 0.18);
  border-color: rgba(120, 214, 186, 0.5);
  color: #196452;
}

.theme-fun .fun-status[data-status="REHEARSALS"] {
  background: rgba(255, 180, 92, 0.2);
  border-color: rgba(255, 180, 92, 0.55);
  color: #815011;
}

.theme-fun .fun-status[data-status="RUN"] {
  background: rgba(255, 122, 100, 0.2);
  border-color: rgba(255, 122, 100, 0.55);
  color: #7b2d21;
}

.theme-fun .fun-status[data-status="CLOSED"] {
  background: rgba(31, 41, 51, 0.08);
  border-color: rgba(31, 41, 51, 0.2);
  color: #3f4857;
}

.theme-fun .fun-status[data-status="cancelled"] {
  background: rgba(255, 122, 100, 0.18);
  border-color: rgba(255, 122, 100, 0.5);
  color: #7b2d21;
}

.theme-fun .fun-status[data-status="holiday"] {
  background: rgba(120, 214, 186, 0.2);
  border-color: rgba(120, 214, 186, 0.5);
  color: #1b6d58;
}

.theme-fun .fun-status[data-status="scheduled"] {
  background: rgba(45, 138, 136, 0.2);
  border-color: rgba(45, 138, 136, 0.5);
  color: #185759;
}

.theme-fun .fun-status[data-status="called"] {
  background: rgba(255, 122, 100, 0.2);
  border-color: rgba(255, 122, 100, 0.5);
  color: #7b2d21;
}

.theme-fun .fun-status[data-status="completed"] {
  background: rgba(31, 41, 51, 0.1);
  border-color: rgba(31, 41, 51, 0.2);
  color: #3f4857;
}

.theme-fun .fun-status[data-status="personal"] {
  background: rgba(120, 214, 186, 0.18);
  border-color: rgba(120, 214, 186, 0.5);
  color: #1b6d58;
}

.theme-fun .fun-status[data-status="team"] {
  background: rgba(45, 138, 136, 0.18);
  border-color: rgba(45, 138, 136, 0.5);
  color: #185759;
}

.theme-fun .fun-table {
  border-collapse: separate;
  border-spacing: 0 0.75rem;
}

.theme-fun .fun-table thead th {
  border-bottom: none;
  color: var(--fun-ink-muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.theme-fun .fun-table tbody tr {
  background: var(--fun-card);
  box-shadow: var(--fun-shadow-soft);
}

.theme-fun .fun-table tbody tr:hover {
  box-shadow: var(--fun-shadow);
}

.theme-fun .fun-table tbody td {
  border-bottom: 1px solid var(--fun-card-border);
  border-top: 1px solid var(--fun-card-border);
  padding: 0.95rem 1rem;
}

.theme-fun .fun-table tbody td:first-child {
  border-left: 1px solid var(--fun-card-border);
  border-radius: 16px 0 0 16px;
}

.theme-fun .fun-table tbody td:last-child {
  border-radius: 0 16px 16px 0;
  border-right: 1px solid var(--fun-card-border);
}

.theme-fun .modal-box {
  border-radius: 16px;
  border: 1px solid var(--fun-card-border);
  background: var(--fun-card);
  box-shadow: var(--fun-shadow);
}

.theme-fun .notification.alert-success {
  background: rgba(120, 214, 186, 0.2);
  border: 1px solid rgba(120, 214, 186, 0.6);
  border-radius: 12px;
  box-shadow: var(--fun-shadow-soft);
  color: #1b5a4e;
  max-width: 340px;
  width: min(340px, calc(100vw - 2.5rem));
  position: fixed;
  right: 1.25rem;
  top: 1.25rem;
  z-index: 60;
}

.theme-fun .notification.alert-success .delete {
  color: inherit;
}

.theme-fun .fun-rehearsal-page .rehearsal-grid-row {
  background: var(--fun-card);
  border: 1px solid var(--fun-card-border);
  border-radius: 16px;
  box-shadow: var(--fun-shadow-soft);
}

.theme-fun .fun-rehearsal-page .rehearsal-grid {
  row-gap: 0.8rem;
}

.theme-fun .fun-rehearsal-page .rehearsal-grid-header {
  background: transparent;
  border-bottom: 0;
  color: var(--fun-ink-muted);
}

.theme-fun .fun-rehearsal-page .rehearsal-grid-row:hover {
  background: #fff9f3;
}

.theme-fun .fun-rehearsal-page .rehearsal-gap-action {
  border-color: rgba(31, 41, 51, 0.2);
  color: var(--fun-ink-muted);
}

.theme-fun .fun-rehearsal-page .rehearsal-card-header {
  background: linear-gradient(90deg, rgba(255, 122, 100, 0.18), rgba(255, 255, 255, 0));
  border-bottom-color: rgba(31, 41, 51, 0.12);
}

.theme-fun .fun-rehearsal-page .export-menu-list {
  border-radius: 14px;
  border-color: var(--fun-card-border);
  box-shadow: var(--fun-shadow-soft);
}

.theme-fun .fun-rehearsal-page .rehearsal-actions .btn-outline-secondary {
  border-color: rgba(31, 41, 51, 0.16);
}

.theme-fun .fun-society-dashboard .tabs {
  border: 1px solid var(--fun-card-border);
  box-shadow: var(--fun-shadow-soft);
}

.theme-fun .fun-society-dashboard .tab.tab-active {
  background: var(--fun-accent);
  color: #ffffff;
}

.theme-fun .fun-modules-home .card:hover {
  transform: translateY(-2px);
}

.theme-fun .fun-finance-page .table {
  border-collapse: separate;
  border-spacing: 0 0.65rem;
}

.theme-fun .fun-finance-page .table thead th {
  border-bottom: none;
  color: var(--fun-ink-muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.theme-fun .fun-finance-page .table tbody tr {
  background: var(--fun-card);
  box-shadow: var(--fun-shadow-soft);
}

.theme-fun .fun-finance-page .table tbody tr:hover {
  box-shadow: var(--fun-shadow);
}

.theme-fun .fun-finance-page .table tbody td {
  border-bottom: 1px solid var(--fun-card-border);
  border-top: 1px solid var(--fun-card-border);
  padding: 0.8rem 0.9rem;
}

.theme-fun .fun-finance-page .table tbody td:first-child {
  border-left: 1px solid var(--fun-card-border);
  border-radius: 14px 0 0 14px;
}

.theme-fun .fun-finance-page .table tbody td:last-child {
  border-right: 1px solid var(--fun-card-border);
  border-radius: 0 14px 14px 0;
}

@keyframes fun-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-fun .fun-empty-state i {
    animation: none;
  }
  .theme-fun .btn,
  .theme-fun .ts-card,
  .theme-fun .fun-card {
    transition: none;
  }
}
