:root {
  --bg-color: #0b0c10;
  --card-bg: #14171f;
  --card-border: #232733;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--card-border);
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--primary);
  margin-right: 2px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.live-badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.festival-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-size: 0.75rem;
}

.sector-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 0.75rem;
}

.badge-checked {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.hero {
  padding: 1.5rem 0 1rem;
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
  border-bottom: 1px solid var(--card-border);
}

.hero-content {
  max-width: 1000px;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.tagline {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 0.35rem;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.hero-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.stat-pill {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-pill b {
  color: var(--primary);
  font-family: 'Space Grotesk', sans-serif;
  margin-left: 2px;
}

.events-section {
  padding: 1.25rem 0 4rem;
  flex: 1;
}

/* Search Panel Compact */
.search-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.search-input-group {
  display: flex;
  align-items: center;
  position: relative;
  gap: 0.5rem;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.6;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: #0e1117;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.6rem 2.5rem 0.6rem 2.4rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--primary);
}

.btn-clear {
  position: absolute;
  right: 5.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}

.btn-clear:hover {
  color: #fff;
}

.btn-search {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-search:hover {
  background: var(--primary-hover);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}

.filter-item {
  min-width: 0;
  width: 100%;
}

.filter-item select {
  background: #0e1117;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.filter-item select:focus {
  border-color: var(--primary);
}

/* Abas de Navegação (Todos / Próximos / Realizados) */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #181d28;
  color: #fff;
  border-color: rgba(245, 158, 11, 0.4);
}

.tab-btn.active {
  background: #1c2230;
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.tab-btn.tab-upcoming-btn.active {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-family: 'Space Grotesk', sans-serif;
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #000;
  font-weight: 700;
}

.tab-btn.tab-upcoming-btn.active .tab-badge {
  background: #10b981;
  color: #000;
  font-weight: 700;
}

.stat-pill.stat-upcoming {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
}

.stat-pill.stat-upcoming b {
  color: #34d399;
}

.stat-pill.stat-past b {
  color: #f59e0b;
}

/* Diferenciação de Linhas: Futuros vs Passados */
.show-row.row-upcoming {
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.03);
}

.show-row.row-upcoming:hover {
  background: rgba(16, 185, 129, 0.07);
  border-color: #10b981;
}

.date-tag.date-upcoming {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.incoming-dot {
  color: #10b981;
  font-size: 0.65rem;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.badge-status-upcoming {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.events-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* DENSE TABLE & ROWS */
.dense-table {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.show-row {
  display: grid;
  grid-template-columns: 95px minmax(170px, 1.2fr) minmax(180px, 1.3fr) minmax(140px, 1fr) 110px 65px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.show-row:hover {
  background: #181d28;
  border-color: rgba(245, 158, 11, 0.35);
}

.date-tag {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 3px 6px;
  border-radius: 5px;
  text-align: center;
  white-space: nowrap;
}

.artist-col {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-name {
  color: #fff;
}

.venue-col {
  font-size: 0.8rem;
  color: #d1d5db;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-col small {
  color: var(--text-muted);
}

.highlight-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-col {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tour-pill {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.fest-pill {
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.sector-pill {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.actions-col {
  display: flex;
  justify-content: flex-end;
}

.events-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.event-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  gap: 1.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
}

.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  min-width: 85px;
  height: 85px;
  padding: 0.4rem;
}

.date-day {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
}

.date-month {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.date-year {
  font-size: 0.75rem;
  color: #6b7280;
}

.event-details {
  flex: 1;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.event-location-tag {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.event-artist {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.event-tour {
  font-size: 0.95rem;
  color: #d1d5db;
  margin-bottom: 0.35rem;
}

.event-tour strong {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-auth {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auth:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-auth.logged-in {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-action {
  background: #1f242e;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #2a313d;
}

.btn-edit:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-delete:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-large {
  max-width: 650px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  color: #fff;
}

.close-modal {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal:hover {
  color: #fff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  background: #0e1117;
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
}

.modal-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-secondary {
  background: #232733;
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary:hover {
  background: #323846;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.event-notes {
  color: #9ca3af;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px dashed var(--card-border);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  text-align: center;
}

.footer {
  border-top: 1px solid var(--card-border);
  padding: 2rem 0;
  background: #08090c;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 768px) {
  .search-panel {
    padding: 0.75rem;
  }
  .search-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input {
    padding-right: 2.5rem;
  }
  .btn-clear {
    right: 0.75rem;
    top: 0.55rem;
  }
  .btn-search {
    width: 100%;
  }
  .filters-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .show-row {
    grid-template-columns: 85px 1fr auto;
    grid-template-areas:
      "date artist actions"
      "venue venue venue"
      "highlight sector sector";
    padding: 8px 10px;
    gap: 6px;
  }
  .date-tag { grid-area: date; }
  .artist-col { grid-area: artist; }
  .venue-col { grid-area: venue; }
  .highlight-col { grid-area: highlight; }
  .sector-col { grid-area: sector; text-align: right; }
  .actions-col { grid-area: actions; }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.3rem;
  }
  .filters-row {
    grid-template-columns: 1fr;
  }
  .stat-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}
