/* ═══════════════════════════════════════════════════════════
   StudioHub — Styles Dark Theme ("The Living Soundstage")
   APENAS CORES, VARIÁVEIS & SOMBRAS · SEM REGRAS ESTRUTURAIS
   ═══════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
  --bg: #0c0d10;
  --bg-raised: #13151b;
  --bg-surface: #1a1d24;
  --bg-hover: #222631;
  --text: #ffffff;
  --text-secondary: #f1f5f9;
  --muted: #cbd5e1;
  --muted-bright: #e2e8f0;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --orange: #ff521a;
  --orange-hover: #ff6838;
  --orange-dim: rgba(255, 82, 26, 0.18);
  --soft-orange: rgba(255, 82, 26, 0.10);
  --amber: #f59e0b;
  --yellow: #f59e0b;
  --yellow-dim: rgba(245, 158, 11, 0.15);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, 0.18);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.18);
  --blue: #38bdf8;
  --blue-dim: rgba(56, 189, 248, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
}

.brand {
  color: #fff;
}

.brand-icon {
  background: linear-gradient(135deg, var(--orange), #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.workspace {
  background: var(--glass);
}

.nav-item:hover {
  background: var(--bg-hover);
}

.mini-day.chosen {
  color: #000;
}

@media (min-width: 961px) {
  body[data-mode="admin"] main,
  body[data-mode="public"] main {
    max-width: calc(100vw - 220px);
  }
}

.topbar {
  border-bottom: 1px solid var(--line) !important;
  background: rgba(9, 9, 11, 0.92) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

.topbar-mobile-brand {
  color: #fff;
}

.topbar-user-pill {
  background: var(--glass);
}

.topbar-btn-login {
  color: #000 !important;
}

.topbar-role-badge.super {
  background: rgba(245, 158, 11, 0.15);
}

.topbar-role-badge.super:hover {
  color: #000;
}

.topbar-role-badge.studio {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid #fbbf24;
  color: #fbbf24;
}

.topbar-role-badge.studio:hover {
  background: #fbbf24;
  color: #000;
}

.studio-mobile-tab:hover {
  background: var(--bg-hover);
}

.studio-mobile-tab.active {
  border-color: rgba(245, 158, 11, 0.3);
}

.page-heading-control select {
  background: var(--bg-surface);
}

.primary {
  box-shadow: 0 4px 14px rgba(255, 82, 26, 0.35);
}

.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(255, 82, 26, 0.45);
}

.stats article {
  transition: border-color var(--transition-fast);
}

.calendar-toolbar-pill {
  background: var(--glass);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.calendar-toolbar-pill--room {
  border-color: rgba(245, 158, 11, 0.3);
}

.calendar-toolbar-pill--band {
  border-color: rgba(167, 139, 250, 0.35);
}

.toolbar-pill-select {
  color: #fff !important;
}

.toolbar-pill-select option {
  background: var(--bg-surface);
  color: #fff;
}

.calendar-current-room {
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.calendar-current-room .room-pill-name {
  color: #fff;
}

.view-switch button {
  padding: 8px 4px;
}

.view-switch .selected {
  background: var(--bg-hover);
  color: #fff;
}

#calendar-container {
  scrollbar-color: #27272a transparent;
}

.day-header.current strong {
  color: #000;
}

.slot.today-column {
  background: rgba(245, 158, 11, 0.02);
}

.slot::after {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  opacity: 0.35;
}

/* Camada de fundo de 1h / agrupada (tema escuro) */
.slot-bg-free {
  background: var(--green-dim);
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
  border-left-color: var(--green) !important;
}

.slot-bg-conflict {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.32);
  border-left-color: #f59e0b !important;
}

.slot-bg-unavailable {
  background: repeating-linear-gradient(-45deg, transparent, transparent 6px, var(--line) 6px, var(--line) 7px);
  border-color: var(--line);
  opacity: 0.35;
}

.slot-bg-badge {
  color: #f59e0b;
}

.slot-bg-badge strong {
  color: #fbbf24;
}

.slot-bg-badge-free {
  color: #34d399 !important;
}

.slot-bg-badge-free strong {
  color: #6ee7b7 !important;
}

/* Seletor de 30 minutos (tema escuro) */
.slot-free:hover {
  background: color-mix(in srgb, var(--green) 30%, transparent);
  border-color: color-mix(in srgb, var(--green) 65%, transparent);
  color: var(--green);
}

.slot-free.in-conflict:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.75);
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.slot-free.slot-selected {
  background: color-mix(in srgb, var(--green) 48%, transparent) !important;
  border-color: color-mix(in srgb, var(--green) 85%, transparent) !important;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.35) !important;
  color: #fff !important;
}

.slot-free.in-conflict.slot-selected {
  background: rgba(245, 158, 11, 0.45) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
  color: #fff !important;
}

.current-time-dot {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
}

.current-time-line {
  background: #f87171;
}

.event {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.event:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

dialog {
  background: var(--bg-surface) !important;
  border: 1px solid var(--line-strong) !important;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.empty strong {
  color: var(--text-secondary);
}

.close:hover {
  background: var(--bg-hover);
}

.availability.conflict {
  color: #ef4444;
}

.option-card input:before {
  background: var(--muted);
  transition: left var(--transition-fast), background var(--transition-fast);
}

.secondary:hover {
  background: var(--bg-hover);
}

.danger {
  color: #ef4444;
}

#form-error {
  color: #ef4444;
}

#toast {
  background: var(--bg-surface);
  color: var(--text);
}

.sh-theme-toggle {
  background: var(--glass);
  border: 1px solid var(--line);
}

.own-event strong {
  color: #e0f2fe !important;
}

.own-tag {
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.other-band-event strong {
  color: #e9d5ff !important;
}

.other-band-tag {
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.slot-unavailable {
  background: var(--bg);
}

.legend .unavailable {
  background: #3f3f46;
}

.event-delete {
  background: rgba(0, 0, 0, 0.6);
  color: #ef4444;
}

.event-delete:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #f87171;
}

.occupied-event {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  border-left: 3px solid #ef4444 !important;
  color: #f87171 !important;
  cursor: not-allowed;
}

.occupied-event strong {
  color: #fca5a5 !important;
}

.legend .occupied {
  background: #ef4444;
}

.legend .conflict {
  background: #f59e0b;
}

#delete-error {
  color: #ef4444;
}

.sh-eq-tag-remove:hover {
  color: #ef4444;
}

.public-eq-pill {
  background: var(--glass);
}

.terms-card-alert {
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.terms-badge {
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.studio-contact-item .contact-icon {
  background: var(--glass);
}

.studio-contact-item.contact--whatsapp .contact-icon {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}

.studio-contact-item.contact--instagram .contact-icon {
  background: rgba(225, 48, 108, 0.15);
}

.studio-contact-item.contact--website .contact-icon {
  background: rgba(52, 211, 153, 0.15);
}

#booking-form input:disabled, #booking-form select:disabled, #booking-form textarea:disabled {
  color: var(--muted) !important;
  background: var(--bg) !important;
}

.topbar-back-link {
  background: var(--glass) !important;
}

#btn-admin-mobile-logout {
  background: var(--glass) !important;
}

#btn-admin-mobile-logout:hover {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.studio-mobile-tabs, .studio-admin-mobile-tabs {
  background: rgba(9, 9, 11, 0.95) !important;
  backdrop-filter: blur(16px) !important;
}

.studio-mobile-tab.active, .studio-admin-mobile-tab.active {
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Formulários e Inputs no Tema Escuro */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: var(--text) !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] select option,
[data-theme="dark"] select option {
  background: var(--bg-surface) !important;
  color: var(--text) !important;
}
