/**
 * Sistema de Repertórios Musicais - Estilos Globais
 * Apple Design System - Dark Mode
 * Versão: 2.0.0
 * Data: 27/11/2025
 */

/* ========================================
   VARIÁVEIS CSS (Apple Design System)
   ======================================== */
:root {
  --apple-bg: #000000;
  --apple-surface: #1c1c1e;
  --apple-surface-secondary: #2c2c2e;
  --apple-surface-tertiary: #3a3a3c;
  --apple-text: #ffffff;
  --apple-text-secondary: #a1a1a6;
  --apple-text-tertiary: #8e8e93;
  --apple-accent: #007aff;
  --apple-accent-hover: #0056cc;
  --apple-success: #30d158;
  --apple-warning: #ff9f0a;
  --apple-danger: #ff453a;
  --apple-radius: 12px;
  --apple-radius-lg: 16px;
  --sidebar-width: 280px;
}

/* ========================================
   RESET E BASE
   ======================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--apple-bg);
  color: var(--apple-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--apple-surface);
  border-right: 1px solid var(--apple-surface-secondary);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--apple-surface-secondary);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--apple-text);
  text-decoration: none;
  min-height: 40px;
}

.sidebar-logo:hover {
  color: var(--apple-accent);
}

.sidebar-logo img {
  max-height: 40px;
  object-fit: contain;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--apple-surface-secondary);
}

/* ========================================
   CONTEÚDO PRINCIPAL
   ======================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.main-header {
  background: rgba(28, 28, 30, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apple-surface-secondary);
  padding: 20px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.header-subtitle {
  color: var(--apple-text-secondary);
  margin-top: 4px;
  font-size: 15px;
}

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

.main-body {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ========================================
   BARRA DE PESQUISA
   ======================================== */
.content-search {
  padding: 20px 32px 0 32px;
  max-width: 500px;
}

.content-search .search-wrapper {
  position: relative;
}

.content-search .search-input {
  width: 100%;
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-surface-tertiary);
  border-radius: var(--apple-radius);
  color: var(--apple-text);
  padding: 12px 16px 12px 44px;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.content-search .search-input:focus {
  outline: none;
  border-color: var(--apple-accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
  background: var(--apple-surface-tertiary);
}

.content-search .search-input::placeholder {
  color: var(--apple-text-tertiary);
}

.content-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--apple-text-tertiary);
  font-size: 16px;
  pointer-events: none;
}

/* ========================================
   BOTÕES (Apple Style)
   ======================================== */
.apple-btn {
  border-radius: var(--apple-radius);
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  gap: 8px;
}

.apple-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.apple-btn:hover::after {
  opacity: 1;
}

.apple-btn-primary {
  background: linear-gradient(135deg, var(--apple-accent), #0066d6);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.apple-btn-primary:hover {
  background: linear-gradient(135deg, var(--apple-accent-hover), #0052a3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

.apple-btn-secondary {
  background: linear-gradient(135deg, var(--apple-surface-secondary), var(--apple-surface-tertiary));
  color: var(--apple-text);
  border: 1px solid var(--apple-surface-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.apple-btn-secondary:hover {
  background: linear-gradient(135deg, var(--apple-surface-tertiary), #4a4a4c);
  color: var(--apple-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.apple-btn-success {
  background: linear-gradient(135deg, var(--apple-success), #28a745);
  color: white;
  box-shadow: 0 4px 16px rgba(48, 209, 88, 0.3);
}

.apple-btn-success:hover {
  background: linear-gradient(135deg, #28a745, #1e8537);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(48, 209, 88, 0.4);
}

.apple-btn-danger {
  background: linear-gradient(135deg, var(--apple-danger), #e5413a);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 69, 58, 0.3);
}

.apple-btn-danger:hover {
  background: linear-gradient(135deg, #e5413a, #d93025);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 69, 58, 0.4);
}

.apple-btn:focus-visible {
  outline: 2px solid var(--apple-accent);
  outline-offset: 2px;
}

.apple-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.apple-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  border-radius: var(--apple-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  background: var(--apple-surface-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--apple-text);
}

.card p {
  color: var(--apple-text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.card-header-content h3 {
  margin: 0 0 8px 0;
}

.card-header-content p {
  margin: 0;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--apple-text);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-surface-tertiary);
  border-radius: var(--apple-radius);
  color: var(--apple-text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--apple-accent);
  background: var(--apple-surface-tertiary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-control::placeholder {
  color: var(--apple-text-tertiary);
}

.form-text {
  font-size: 12px;
  color: var(--apple-text-secondary);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--apple-surface-tertiary);
  border-radius: 6px;
  background: var(--apple-surface-secondary);
  cursor: pointer;
  position: relative;
}

.form-check-input:checked {
  background: var(--apple-accent);
  border-color: var(--apple-accent);
}

.form-check-input:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.form-check-label {
  color: var(--apple-text);
  font-size: 14px;
  cursor: pointer;
}

/* ========================================
   ALERTAS
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--apple-radius);
  margin-bottom: 24px;
  border: none;
  font-weight: 500;
}

.alert-success {
  background: rgba(48, 209, 88, 0.15);
  color: var(--apple-success);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.alert-danger {
  background: rgba(255, 69, 58, 0.15);
  color: var(--apple-danger);
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.alert-warning {
  background: rgba(255, 159, 10, 0.15);
  color: var(--apple-warning);
  border: 1px solid rgba(255, 159, 10, 0.3);
}

/* ========================================
   TABELAS
   ======================================== */
.table-container {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  border-radius: var(--apple-radius-lg);
  overflow: visible; /* Alterado para permitir dropdowns */
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--apple-surface-secondary);
  color: var(--apple-text);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-surface-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-surface-secondary);
  color: var(--apple-text);
  font-size: 14px;
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover {
  background: var(--apple-surface-secondary);
}

/* ========================================
   UTILITÁRIOS
   ======================================== */
.d-flex {
  display: flex;
}

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

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

.gap-3 {
  gap: 24px;
}

.mb-4 {
  margin-bottom: 24px;
}

.mb-0 {
  margin-bottom: 0;
}

.text-muted {
  color: var(--apple-text-secondary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--apple-text-secondary);
  font-size: 14px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--apple-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

/* ========================================
   INDICADORES DE STATUS
   ======================================== */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-online,
.status-connected {
  background: rgba(48, 209, 88, 0.2);
  color: var(--apple-success);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.status-offline,
.status-disconnected {
  background: rgba(255, 69, 58, 0.2);
  color: var(--apple-danger);
  border: 1px solid rgba(255, 69, 58, 0.3);
}

/* ========================================
   MENU MOBILE
   ======================================== */
.mobile-menu-btn {
  display: none;
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-surface-tertiary);
  border-radius: 8px;
  color: var(--apple-text);
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--apple-surface-tertiary);
  color: var(--apple-accent);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

/* ========================================
   STATS E MÉTRICAS
   ======================================== */
.stats-container {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  border-radius: var(--apple-radius);
  padding: 20px;
  flex: 1;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--apple-accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--apple-text-secondary);
  font-weight: 500;
}

/* ========================================
   PÁGINA DE SHOWS (REPERTÓRIOS)
   ======================================== */

/* Grid de Repertórios */
.repertorio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
  align-items: stretch;
}

/* Cards de Repertório */
.repertorio-card {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  border-radius: var(--apple-radius-lg);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
  overflow: visible; /* Alterado de hidden para visible para permitir dropdown */
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  backdrop-filter: blur(10px);
  animation: slideInUp 0.6s ease-out;
}

.repertorio-card:hover {
  background: var(--apple-surface-secondary);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
  border-color: var(--apple-surface-tertiary);
}

.repertorio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--apple-accent), var(--apple-accent-hover));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.repertorio-card:hover::before {
  opacity: 1;
}

.repertorio-card:nth-child(1) { animation-delay: 0.1s; }
.repertorio-card:nth-child(2) { animation-delay: 0.2s; }
.repertorio-card:nth-child(3) { animation-delay: 0.3s; }
.repertorio-card:nth-child(4) { animation-delay: 0.4s; }
.repertorio-card:nth-child(5) { animation-delay: 0.5s; }
.repertorio-card:nth-child(6) { animation-delay: 0.6s; }

.repertorio-header {
  flex: 1;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.repertorio-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--apple-text);
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden; /* Mantém overflow para truncar texto */
}

.repertorio-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.repertorio-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--apple-text-secondary);
  line-height: 1.4;
}

.repertorio-meta-icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.repertorio-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  border-top: 1px solid var(--apple-surface-secondary);
}

.repertorio-actions .apple-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  position: relative !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.repertorio-actions .apple-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

/* Visualização em Lista */
.view-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.view-toggle-btn {
  background: var(--apple-surface-secondary);
  border: 1px solid var(--apple-surface-tertiary);
  border-radius: 8px;
  color: var(--apple-text-secondary);
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle-btn.active {
  background: var(--apple-accent);
  border-color: var(--apple-accent);
  color: white;
}

.view-toggle-btn:hover:not(.active) {
  background: var(--apple-surface-tertiary);
  color: var(--apple-text);
}

/* Filtros */
.filters-container {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  color: var(--apple-text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.filter-btn:hover {
  background: var(--apple-surface-secondary);
  color: var(--apple-text);
  border-color: var(--apple-surface-tertiary);
}

.filter-btn.active {
  background: var(--apple-accent);
  color: white;
  border-color: var(--apple-accent);
}

.filter-btn .count {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}

.filter-btn.active .count {
  background: rgba(255,255,255,0.3);
}

/* Tabela de Repertórios */
.repertorio-table-container {
  background: var(--apple-surface);
  border: 1px solid var(--apple-surface-secondary);
  border-radius: var(--apple-radius-lg);
  overflow: visible; /* Alterado para permitir dropdowns */
  animation: slideInUp 0.6s ease-out;
}

.repertorio-table {
  width: 100%;
  border-collapse: collapse;
}

.repertorio-table th {
  background: var(--apple-surface-secondary);
  color: var(--apple-text);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-surface-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.repertorio-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-surface-secondary);
  color: var(--apple-text);
  font-size: 14px;
  vertical-align: middle;
}

.repertorio-table tr:last-child td {
  border-bottom: none;
}

.repertorio-table tr:hover {
  background: var(--apple-surface-secondary);
}

.table-title {
  font-weight: 600;
  color: var(--apple-text);
  margin-bottom: 4px;
}

.table-meta {
  font-size: 12px;
  color: var(--apple-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-date {
  color: var(--apple-text);
  font-weight: 500;
}

.table-location {
  color: var(--apple-text-secondary);
  font-size: 13px;
}

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

.table-actions .apple-btn {
  padding: 8px;
  min-width: 32px;
  width: 32px;
  height: 32px;
  justify-content: center;
}

.table-actions .apple-btn i {
  margin: 0;
}

.table-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
}

.status-upcoming {
  background: rgba(48, 209, 88, 0.1);
  color: var(--apple-success);
}

.status-past {
  background: rgba(142, 142, 147, 0.1);
  color: var(--apple-text-tertiary);
}

.status-canceled {
  background: rgba(255, 69, 58, 0.1);
  color: var(--apple-danger);
}

.status-today {
  background: rgba(0, 122, 255, 0.1);
  color: var(--apple-accent);
}

/* Dropdown de Status */
.status-dropdown-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1; /* Garante contexto de empilhamento */
}

.status-dropdown {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  background: var(--apple-surface) !important;
  border: 1px solid var(--apple-surface-secondary) !important;
  border-radius: var(--apple-radius-lg) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  padding: 8px !important;
  min-width: 180px !important;
  z-index: 10000 !important; /* Aumentado para ficar acima de tudo */
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) !important;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s !important;
  pointer-events: none;
}

.status-dropdown.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--apple-text);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--apple-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
}

.status-option:hover {
  background: var(--apple-surface-secondary);
}

.status-option.active {
  background: var(--apple-accent);
  color: white;
}

.status-option.active:hover {
  background: color-mix(in srgb, var(--apple-accent) 85%, black);
}

/* Estado Vazio */
.empty-state {
  text-align: center;
  padding: 80px 32px;
  color: var(--apple-text-secondary);
}

.empty-state-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--apple-text);
  margin-bottom: 12px;
}

.empty-state-subtitle {
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* Toast notifications */
.custom-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 16px 24px;
  border-radius: var(--apple-radius);
  color: white;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInUp 0.3s ease-out;
  pointer-events: auto;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

/* Tablets e Telas Médias (1024px e abaixo) */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .repertorio-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* Smartphones e Telas Pequenas (768px e abaixo) */
@media (max-width: 768px) {
  /* Layout Principal */
  .main-body {
    padding: 16px;
  }

  .main-header {
    padding: 16px;
    position: sticky;
    top: 0;
    background: var(--apple-surface);
    z-index: 100;
  }

  .header-content {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .header-title {
    font-size: 24px;
  }

  .header-actions {
    flex-direction: row;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .view-toggle {
    order: 1;
  }

  .apple-btn-primary {
    order: 2;
    flex: 1;
  }

  /* Pesquisa */
  .content-search {
    padding: 12px 16px;
  }

  .search-input {
    font-size: 16px; /* Evita zoom no iOS */
  }

  /* Estatísticas */
  .stats-container {
    flex-direction: column;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-number {
    font-size: 32px;
  }

  /* Filtros */
  .filters-container {
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filters-container::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
  }

  /* Grid de Shows */
  .repertorio-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .repertorio-card {
    height: auto;
    min-height: 200px;
  }

  .repertorio-meta {
    flex-direction: column;
    gap: 8px;
  }

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

  .apple-btn {
    padding: 10px 12px;
  }

  /* Tabela */
  .repertorio-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .repertorio-table {
    min-width: 800px;
  }

  .table-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .table-actions .apple-btn {
    padding: 8px;
  }

  /* Sidebar no Mobile */
  .sidebar {
    width: 280px;
  }

  .sidebar-footer {
    padding: 16px;
  }

  /* Dropdowns */
  .status-dropdown {
    right: auto;
    left: 0;
    min-width: 160px;
  }

  /* Formulários */
  .form-card {
    padding: 20px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .row {
    flex-direction: column;
  }

  .col-md-6,
  .col-md-4,
  .col-md-8 {
    width: 100%;
    max-width: 100%;
  }
}

/* Smartphones Pequenos (480px e abaixo) */
@media (max-width: 480px) {
  .header-title {
    font-size: 20px;
  }

  .header-actions {
    flex-direction: column;
    gap: 8px;
  }

  .view-toggle {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .apple-btn-primary {
    order: 1;
    width: 100%;
  }

  .stat-number {
    font-size: 28px;
  }

  .stat-label {
    font-size: 12px;
  }

  .filter-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .filter-btn .count {
    display: none;
  }

  .repertorio-card {
    min-height: 180px;
  }

  .repertorio-title {
    font-size: 18px;
  }

  .repertorio-meta-item {
    font-size: 12px;
  }

  .repertorio-actions {
    gap: 6px;
  }

  .apple-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Formulários em telas muito pequenas */
  .form-card {
    padding: 16px;
  }

  .form-control {
    font-size: 16px; /* Evita zoom no iOS */
    padding: 12px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 20px;
    width: 100%;
  }

  /* Sidebar */
  .sidebar {
    width: 100%;
    max-width: 280px;
  }

  /* Empty State */
  .empty-state {
    padding: 40px 20px;
  }

  .empty-state-icon i {
    width: 48px;
    height: 48px;
  }

  .empty-state-title {
    font-size: 20px;
  }
}

/* Landscape em Smartphones */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    height: 100vh;
    overflow-y: auto;
  }

  .main-header {
    padding: 12px 16px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-number {
    font-size: 24px;
  }
}

/* Touch Targets - Melhora usabilidade em dispositivos touch */
@media (hover: none) and (pointer: coarse) {
  .apple-btn,
  .filter-btn,
  .nav-item,
  button,
  a {
    min-height: 44px; /* Tamanho mínimo recomendado pela Apple */
  }

  .table-actions .apple-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Dark Mode Nativo do Sistema */
@media (prefers-color-scheme: dark) {
  /* Já estamos em dark mode, mas podemos ajustar */
  :root {
    color-scheme: dark;
  }
}

/* ========================================
   ANIMAÇÕES
   ======================================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
