/* ============================================================
   AURA MUSIC — DARK PREMIUM DESIGN
   CSS Único e Limpo - Baseado no Modelo
   ============================================================ */

:root {
  /* Dark Theme Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: linear-gradient(145deg, rgba(26, 26, 36, 0.8), rgba(18, 18, 26, 0.6));
  --bg-card-hover: linear-gradient(145deg, rgba(32, 32, 45, 0.9), rgba(22, 22, 32, 0.7));
  
  /* Accent Colors */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --accent-glow: rgba(99, 102, 241, 0.4);
  
  /* Status Colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --error: #ef4444;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.65);
  --text-tertiary: rgba(248, 250, 252, 0.40);
  
  /* Border */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px var(--accent-glow);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== BACKGROUND EFFECTS ==================== */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 30px) scale(1.02); }
}

.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
}

/* ==================== LAYOUT ==================== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

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

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

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
}

.logo-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0.25) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(25px);
  animation: logoGlowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logoGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

.logo-image {
  position: relative;
  width: 150px;
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.35));
  transition: transform 0.3s ease;
}

.logo:hover .logo-image {
  transform: scale(1.03);
}

/* Mantém estilos antigos caso precise */
.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--text-tertiary);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 28px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 12px;
  margin-bottom: 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::before {
  opacity: 0.08;
}

.nav-link.is-active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.12);
}

.nav-link.is-active::before {
  opacity: 0.15;
}

.nav-link i {
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.nav-link span {
  position: relative;
  z-index: 1;
}

.nav-badge {
  margin-left: auto;
  padding: 4px 10px;
  background: var(--accent-gradient);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.user-card:hover {
  background: rgba(99, 102, 241, 0.1);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 28px 36px;
}

.main-fullwidth {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== HEADER ==================== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.welcome-section h1 {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.welcome-section h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-section p {
  color: var(--text-secondary);
  font-size: 15px;
}

.header-actions {
  display: flex;
  gap: 14px;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==================== KPI CARDS ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

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

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

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-icon.is-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.kpi-icon.is-green {
  background: var(--success-soft);
  color: var(--success);
}

.kpi-icon.is-orange {
  background: var(--warning-soft);
  color: var(--warning);
}

.kpi-icon.is-blue {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.kpi-trend.is-up { color: var(--success); }
.kpi-trend.is-down { color: var(--error); }

.kpi-value {
  font-family: 'Sora', sans-serif;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.kpi-progress {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.kpi-progress-fill.is-purple { background: var(--accent-gradient); }
.kpi-progress-fill.is-green { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-progress-fill.is-orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ==================== MAIN GRID ==================== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
}

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

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

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

.card-link {
  color: var(--accent-primary);
  font-size: 14px;
  text-decoration: none;
}

.card-link:hover {
  color: var(--accent-secondary);
}

/* ==================== SEARCH BAR ==================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 18px;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

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

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ==================== TABLE ==================== */
.songs-table {
  padding: 0 24px 24px;
}

.table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px 100px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.song-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px 100px;
  padding: 16px 0;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.song-row:last-child {
  border-bottom: none;
}

.song-row:hover {
  background: rgba(99, 102, 241, 0.05);
  margin: 0 -24px;
  padding: 16px 24px;
  border-radius: 12px;
}

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

.song-cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  position: relative;
  overflow: hidden;
}

.song-cover.gradient-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.song-cover.gradient-2 { background: linear-gradient(135deg, #10b981, #34d399); }
.song-cover.gradient-3 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.song-cover.gradient-4 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.song-cover.gradient-5 { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.song-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 100%);
}

.song-details h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.song-details span {
  font-size: 13px;
  color: var(--text-tertiary);
}

.song-author {
  font-size: 14px;
  color: var(--text-secondary);
}

.song-date {
  font-size: 14px;
  color: var(--text-tertiary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

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

.btn-action {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-action:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.table-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-tertiary);
}

.table-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* ==================== PAGINATION ==================== */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.table-count {
  font-size: 14px;
  color: var(--text-tertiary);
}

.pagination {
  display: flex;
  gap: 8px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.page-btn:hover:not(.is-disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==================== SIDEBAR WIDGETS ==================== */
.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Quick Add Card */
.quick-add-card {
  background: var(--accent-gradient);
  border-radius: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.quick-add-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.quick-add-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  color: white;
}

.quick-add-card p {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 20px;
  position: relative;
  color: white;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: white;
  border-radius: 12px;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
}

.btn-white:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* Authors Card */
.authors-card .card-header {
  padding: 20px 24px;
}

.authors-list {
  padding: 0 24px 24px;
}

.author-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.author-item:last-child {
  border-bottom: none;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.author-avatar.gradient-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.author-avatar.gradient-2 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.author-avatar.gradient-3 { background: linear-gradient(135deg, #10b981, #34d399); }

.author-info {
  flex: 1;
}

.author-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.author-songs {
  font-size: 12px;
  color: var(--text-tertiary);
}

.author-count {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Chart Card */
.chart-card .card-header {
  padding: 20px 24px;
}

.chart-container {
  padding: 20px 24px 24px;
  height: 200px;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(26, 26, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.toast-icon.success { background: var(--success-soft); color: var(--success); }
.toast-icon.error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.toast-icon.info { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

.toast-content { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: var(--text-secondary); }

.toast-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.3);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
  .main-grid {
    grid-template-columns: 1fr 340px;
  }
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .quick-add-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
  }
  
  .header-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar-widgets {
    grid-template-columns: 1fr;
  }
  
  .table-header,
  .song-row {
    grid-template-columns: 1fr 80px 80px;
  }
  
  .song-author,
  .song-date {
    display: none;
  }
}

/* ==================== USER LOGOUT BUTTON ==================== */
.user-logout {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-tertiary);
  font-size: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translateX(120%);
  opacity: 0;
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.toast-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.toast-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.toast-icon.info {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}


/* ============================================================
   MOBILE OPTIMIZATION — AURA MUSIC PREMIUM
   ============================================================ */

/* ==================== MOBILE HEADER ==================== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-btn:active {
  transform: scale(0.95);
  background: rgba(99, 102, 241, 0.2);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-logo {
  display: flex;
  align-items: center;
}

.mobile-logo img {
  height: 36px;
  width: auto;
}

.mobile-logout {
  width: 44px;
  height: 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all 0.2s ease;
}

.mobile-logout:active {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* ==================== MOBILE OVERLAY ==================== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ==================== SIDEBAR MOBILE ==================== */
.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.sidebar-close:active {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* ==================== MOBILE BOTTOM NAVIGATION ==================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 8px 8px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 4px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.bottom-nav-item i {
  font-size: 24px;
  transition: all 0.2s ease;
}

.bottom-nav-item span {
  white-space: nowrap;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

.bottom-nav-item.is-active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.bottom-nav-item.is-active i {
  transform: scale(1.1);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Tablet & Mobile - Below 1024px */
@media (max-width: 1024px) {
  /* Show mobile elements */
  .mobile-header {
    display: flex;
  }
  
  .mobile-bottom-nav {
    display: grid;
  }
  
  .sidebar-close {
    display: flex;
  }
  
  /* Hide desktop sidebar */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 300px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
  }
  
  .sidebar.is-open {
    transform: translateX(0);
  }
  
  /* Adjust main content */
  .main-content {
    margin-left: 0;
    padding: 80px 16px 90px;
    width: 100%;
  }
  
  /* Header adjustments */
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .header-actions .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }
  
  /* Welcome section */
  .welcome-section h1 {
    font-size: 24px;
  }
  
  .welcome-section p {
    font-size: 14px;
  }
  
  /* KPI Grid - 2 columns on tablet */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .kpi-card {
    padding: 16px;
  }
  
  .kpi-value {
    font-size: 22px;
  }
  
  /* Cards */
  .card {
    border-radius: 16px;
  }
  
  .card-header {
    padding: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  /* Songs Grid */
  .songs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Authors Grid */
  .authors-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Users Grid */
  .users-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Tables - horizontal scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Modals */
  .modal-box,
  .modal-container {
    width: 95%;
    max-width: none;
    margin: 16px;
    max-height: 85vh;
  }
  
  .modal-content,
  .modal-body {
    padding: 16px;
  }
  
  .modal-head,
  .modal-header {
    padding: 16px;
  }
  
  .modal-foot,
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .modal-footer .btn,
  .modal-foot .btn {
    flex: 1;
    min-width: 120px;
  }
  
  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
  }
  
  /* Toasts */
  #toast-container {
    left: 16px;
    right: 16px;
    bottom: 90px;
  }
  
  .toast {
    width: 100%;
  }
}

/* Mobile - Below 768px */
@media (max-width: 768px) {
  /* KPI Grid - 2 columns smaller */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .kpi-card {
    padding: 14px;
  }
  
  .kpi-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .kpi-value {
    font-size: 18px;
  }
  
  .kpi-label {
    font-size: 12px;
  }
  
  .kpi-trend {
    font-size: 11px;
  }
  
  /* Header */
  .main-header {
    gap: 12px;
  }
  
  .welcome-section h1 {
    font-size: 22px;
  }
  
  /* Buttons */
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .btn-sm {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .header-actions .btn {
    padding: 12px 16px;
  }
  
  /* Cards */
  .card-title {
    font-size: 15px;
  }
  
  /* Song cards mobile */
  .song-card {
    padding: 14px;
  }
  
  .song-main {
    gap: 12px;
  }
  
  .song-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  
  .song-title {
    font-size: 14px;
  }
  
  .song-author {
    font-size: 12px;
  }
  
  .song-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .song-actions {
    gap: 6px;
  }
  
  .action-btn {
    width: 34px;
    height: 34px;
  }
  
  /* Author cards mobile */
  .author-card {
    padding: 14px;
  }
  
  .author-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  
  .author-name {
    font-size: 15px;
  }
  
  /* User cards mobile */
  .user-card-horizontal {
    padding: 14px;
  }
  
  .user-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  
  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .stat-card {
    padding: 14px;
  }
  
  .stat-value {
    font-size: 22px;
  }
  
  /* Search */
  .search-wrapper {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
  }
  
  /* Filters */
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }
  
  .filter-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Empty states */
  .empty-state {
    padding: 40px 20px;
  }
  
  .empty-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }
  
  .empty-title {
    font-size: 18px;
  }
  
  /* Badges & Tags */
  .badge,
  .tag,
  .status-badge {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* Small Mobile - Below 480px */
@media (max-width: 480px) {
  .main-content {
    padding: 72px 12px 85px;
  }
  
  /* Header */
  .welcome-section h1 {
    font-size: 20px;
  }
  
  .welcome-section p {
    font-size: 13px;
  }
  
  /* KPIs - still 2 columns but tighter */
  .kpi-grid {
    gap: 8px;
  }
  
  .kpi-card {
    padding: 12px;
  }
  
  .kpi-header {
    margin-bottom: 8px;
  }
  
  .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
  
  .kpi-value {
    font-size: 16px;
  }
  
  .kpi-label {
    font-size: 11px;
  }
  
  .kpi-trend {
    display: none;
  }
  
  /* Header actions - stack */
  .header-actions {
    flex-direction: column;
  }
  
  .header-actions .btn {
    width: 100%;
  }
  
  /* Cards tighter */
  .card-header {
    padding: 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  /* Song card compact */
  .song-card {
    padding: 12px;
  }
  
  .song-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .song-title {
    font-size: 13px;
  }
  
  .song-author {
    font-size: 11px;
  }
  
  .song-meta {
    margin-top: 10px;
  }
  
  .meta-item {
    font-size: 11px;
  }
  
  /* Stats 2x2 */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .stat-value {
    font-size: 18px;
  }
  
  .stat-label {
    font-size: 11px;
  }
  
  /* Bottom nav tighter */
  .mobile-bottom-nav {
    height: 68px;
    padding: 6px 4px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .bottom-nav-item {
    font-size: 10px;
    padding: 6px 2px;
  }
  
  .bottom-nav-item i {
    font-size: 22px;
  }
  
  /* Modal full screen on small devices */
  .modal-box,
  .modal-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  
  .modal-content,
  .modal-body {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  
  /* Form elements */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Status selector */
  .status-opts,
  .status-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .so-card,
  .status-card .card-inner {
    padding: 12px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
  }
  
  .so-card i,
  .status-card .card-inner i {
    font-size: 20px;
  }
}

/* ==================== TOUCH OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
  }
  
  .nav-link {
    min-height: 48px;
  }
  
  .action-btn,
  .act-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  /* Remove hover states for touch */
  .btn:hover,
  .card:hover,
  .song-card:hover,
  .author-card:hover,
  .nav-link:hover {
    transform: none;
  }
  
  /* Active states for touch feedback */
  .btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
  
  .card:active,
  .song-card:active,
  .author-card:active {
    transform: scale(0.99);
  }
  
  .nav-link:active {
    background: rgba(99, 102, 241, 0.15);
  }
}

/* ==================== SAFE AREAS (iPhone X+) ==================== */
@supports (padding: max(0px)) {
  .mobile-header {
    padding-top: max(0px, env(safe-area-inset-top));
    height: calc(64px + env(safe-area-inset-top));
  }
  
  .main-content {
    padding-bottom: max(90px, calc(72px + env(safe-area-inset-bottom) + 16px));
  }
  
  .mobile-bottom-nav {
    padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom)));
    height: calc(72px + env(safe-area-inset-bottom));
  }
  
  .sidebar {
    padding-top: env(safe-area-inset-top);
  }
}

/* ==================== LANDSCAPE MOBILE ==================== */
@media (max-width: 900px) and (orientation: landscape) {
  .mobile-header {
    height: 56px;
  }
  
  .main-content {
    padding-top: 72px;
    padding-bottom: 70px;
  }
  
  .mobile-bottom-nav {
    height: 60px;
    padding: 6px 16px 8px;
  }
  
  .bottom-nav-item {
    flex-direction: row;
    gap: 8px;
  }
  
  .bottom-nav-item i {
    font-size: 20px;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .songs-grid,
  .authors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .mobile-header,
  .mobile-bottom-nav,
  .sidebar,
  .mobile-overlay {
    display: none !important;
  }
  
  .main-content {
    margin: 0;
    padding: 20px;
  }
  
  .bg-effects {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .bg-gradient-orb {
    animation: none;
  }
  
  .logo-glow {
    animation: none;
  }
}

/* ==================== DARK MODE REFINEMENTS ==================== */
@media (prefers-color-scheme: dark) {
  /* Already dark theme, but ensure consistency */
  :root {
    color-scheme: dark;
  }
}

/* =============================================================================
   CSS DOS CONTRATOS - NEW v2
   ============================================================================= */

/* Upload Hint */
.upload-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

/* Contracts New Info (para nova obra) */
.contracts-new-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
}

.contracts-new-info i {
  font-size: 20px;
  color: var(--accent-primary);
}

.contracts-new-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Contracts Upload Zone */
.contracts-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-tertiary);
  margin-bottom: 12px;
}

.contracts-upload-zone:hover,
.contracts-upload-zone.is-dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.contracts-upload-zone .upload-icon {
  font-size: 28px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.contracts-upload-zone .upload-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.contracts-upload-zone .upload-formats {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Contracts Existing List */
.contracts-existing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contract-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.contract-item:hover {
  border-color: var(--accent-primary);
}

.contract-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contract-icon.is-pdf {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.contract-icon.is-doc {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.contract-info {
  flex: 1;
  min-width: 0;
}

.contract-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

.contract-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Tab Badge */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  margin-left: 6px;
}

/* Contracts List (song-view) */
.contracts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Contract Card */
.contract-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s;
}

.contract-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.contract-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.contract-card-icon.is-pdf {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.contract-card-icon.is-doc {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.contract-card-info {
  flex: 1;
  min-width: 0;
}

.contract-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contract-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.contract-card-meta i {
  font-size: 14px;
}

.contract-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Empty Contracts */
.empty-contracts {
  text-align: center;
  padding: 48px 24px;
}

.empty-contracts i {
  font-size: 56px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  display: block;
}

.empty-contracts p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 20px;
}

/* Modal Contract Upload */
.modal-contract {
  max-width: 500px;
  width: 95%;
}

/* Contract Upload Dropzone (modal) */
.contract-upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-tertiary);
}

.contract-upload-dropzone:hover,
.contract-upload-dropzone.is-dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.contract-upload-dropzone .upload-icon {
  font-size: 48px;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.contract-upload-dropzone .upload-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.contract-upload-dropzone .upload-formats {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Contract Files Preview */
.contract-files-preview {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.contract-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
}

.contract-file-item .file-icon {
  font-size: 24px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contract-file-item .file-info {
  flex: 1;
  min-width: 0;
}

.contract-file-item .file-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-file-item .file-size {
  font-size: 11px;
  color: var(--text-tertiary);
}

.contract-file-item .btn-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: all 0.2s;
  flex-shrink: 0;
}

.contract-file-item .btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Btn Icon SM */
.btn-icon-sm {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-icon-sm:hover {
  background: var(--accent-primary);
  color: white;
}

.btn-icon-sm.is-danger:hover {
  background: var(--error);
  color: white;
}

/* Spinner animation */
.ph-spin {
  animation: spin 1s linear infinite;
}

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

/* =============================================
   RESPONSIVE - MOBILE
   ============================================= */

@media (max-width: 768px) {
  /* Contract Card Mobile */
  .contract-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  
  .contract-card-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
    position: absolute;
  }
  
  .contract-card {
    position: relative;
    padding-left: 66px;
  }
  
  .contract-card-icon {
    position: absolute;
    left: 14px;
    top: 14px;
  }
  
  .contract-card-info {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .contract-card-name {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .contract-card-meta {
    gap: 8px;
  }
  
  .contract-card-meta span {
    font-size: 11px;
  }
  
  .contract-card-actions {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-left: -52px;
    padding-left: 52px;
  }
  
  .contract-card-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  /* Esconder texto do botão no mobile */
  .btn-text-desktop {
    display: none;
  }
  
  /* Contract Upload Zone Mobile */
  .contract-upload-dropzone {
    padding: 30px 16px;
  }
  
  .contract-upload-dropzone .upload-icon {
    font-size: 36px;
  }
  
  .contract-upload-dropzone .upload-text {
    font-size: 14px;
  }
  
  /* Tab Badge Mobile */
  .tab-badge {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 4px;
  }
  
  /* Empty Contracts Mobile */
  .empty-contracts {
    padding: 32px 16px;
  }
  
  .empty-contracts i {
    font-size: 44px;
  }
  
  .empty-contracts p {
    font-size: 14px;
  }
  
  /* Modal Contract Mobile */
  .modal-contract {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  
  .modal-contract .modal-body {
    max-height: calc(90vh - 140px);
    overflow-y: auto;
  }
  
  /* Contract File Item Mobile */
  .contract-file-item {
    padding: 10px 12px;
  }
  
  .contract-file-item .file-icon {
    font-size: 20px;
  }
  
  .contract-file-item .file-name {
    font-size: 12px;
  }
  
  /* Contract Item (form) Mobile */
  .contract-item {
    padding: 8px 10px;
  }
  
  .contract-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .contract-name {
    font-size: 12px;
  }
  
  .contract-meta {
    font-size: 10px;
  }
  
  /* Contracts Upload Zone (form) Mobile */
  .contracts-upload-zone {
    padding: 16px;
  }
  
  .contracts-upload-zone .upload-icon {
    font-size: 24px;
  }
  
  .contracts-upload-zone .upload-text {
    font-size: 12px;
  }
  
  .contracts-upload-zone .upload-formats {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .contract-card-meta {
    flex-direction: column;
    gap: 4px;
  }
  
  .contract-card-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .contract-card-actions .btn {
    width: 100%;
  }
}

/* =============================================================================
   CSS DO MODAL DE CONTRATOS - 
   ============================================================================= */

/* Modal Overlay - ESSENCIAL */
#uploadContractModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#uploadContractModal.is-open {
  display: flex;
}

/* Modal Container */
#uploadContractModal .modal,
.modal-contract {
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
#uploadContractModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

#uploadContractModal .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

#uploadContractModal .modal-title i {
  font-size: 22px;
  color: var(--accent-primary);
}

#uploadContractModal .modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#uploadContractModal .modal-close:hover {
  background: var(--error);
  color: white;
}

/* Modal Body */
#uploadContractModal .modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

#uploadContractModal .modal-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

/* Modal Footer */
#uploadContractModal .modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Contract Upload Dropzone */
#uploadContractModal .contract-upload-dropzone,
#contractDropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-tertiary);
}

#uploadContractModal .contract-upload-dropzone:hover,
#contractDropzone:hover,
#contractDropzone.is-dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

#uploadContractModal .upload-icon,
#contractDropzone .upload-icon {
  font-size: 48px;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

#uploadContractModal .upload-text,
#contractDropzone .upload-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

#uploadContractModal .upload-formats,
#contractDropzone .upload-formats {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Contract Files Preview */
#contractFilesPreview {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.contract-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
}

.contract-file-item .file-icon {
  font-size: 24px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contract-file-item .file-info {
  flex: 1;
  min-width: 0;
}

.contract-file-item .file-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-file-item .file-size {
  font-size: 11px;
  color: var(--text-tertiary);
}

.contract-file-item .btn-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: all 0.2s;
  flex-shrink: 0;
}

.contract-file-item .btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Spinner */
.ph-spin {
  animation: spin 1s linear infinite;
}

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

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

@media (max-width: 768px) {
  #uploadContractModal {
    padding: 0;
    align-items: flex-end;
  }
  
  #uploadContractModal .modal,
  .modal-contract {
    max-width: none;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    animation: modalSlideUp 0.3s ease;
  }
  
  @keyframes modalSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  #uploadContractModal .modal-header {
    padding: 16px 20px;
  }
  
  #uploadContractModal .modal-body {
    padding: 20px;
    max-height: calc(85vh - 140px);
  }
  
  #uploadContractModal .modal-footer {
    padding: 16px 20px;
    flex-direction: column;
  }
  
  #uploadContractModal .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
  
  #uploadContractModal .contract-upload-dropzone,
  #contractDropzone {
    padding: 30px 16px;
  }
  
  #uploadContractModal .upload-icon,
  #contractDropzone .upload-icon {
    font-size: 36px;
  }
}

/* =============================================================================
   CORREÇÕES MOBILE -
   1. Autocomplete de autores corrigido
   2. Esconder botão hamburguer no mobile
   ============================================================================= */

/* =============================================
   1. ESCONDER BOTÃO HAMBURGUER NO MOBILE
   ============================================= */

@media (max-width: 768px) {
  /* Esconder botão de menu hamburguer */
  .mobile-menu-toggle,
  .menu-toggle,
  .hamburger,
  .btn-menu,
  .sidebar-toggle,
  .nav-toggle,
  [class*="menu-btn"],
  [class*="hamburger"],
  .header-left .btn-icon,
  header .btn-icon:first-child,
  .topbar-left > button:first-child,
  .mobile-header > button:first-of-type {
    display: none !important;
  }
  
  /* Se o botão for o primeiro filho do header mobile */
  .mobile-header > *:first-child:has(i.ph-list),
  .topbar > *:first-child:has(i.ph-list),
  button:has(> i.ph-list) {
    display: none !important;
  }
}


/* =============================================
   2. AUTOCOMPLETE DE AUTORES - MOBILE
   ============================================= */

@media (max-width: 768px) {
  /* Container de autor - layout em bloco no mobile */
  .author-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
  }
  
  /* Avatar - posição absoluta no topo esquerdo */
  .author-row > .author-avatar,
  .author-row .author-avatar {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    font-size: 14px;
    flex-shrink: 0;
  }
  
  /* Container dos inputs */
  .author-row .author-inputs {
    width: 100%;
    padding-left: 52px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  /* Wrapper do autocomplete */
  .author-row .autocomplete-wrapper {
    width: 100%;
    position: relative;
  }
  
  /* Input de nome do autor */
  .author-row .author-name-input {
    width: 100%;
    font-size: 14px;
    padding: 12px 14px 12px 40px;
    border-radius: 10px;
  }
  
  /* Ícone de busca */
  .author-row .autocomplete-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-tertiary);
  }
  
  /* Input de pseudônimo */
  .author-row .author-pseudo-input {
    width: 100%;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-top: 0;
  }
  
  /* Linha inferior: Porcentagem + Botão excluir */
  .author-row .author-share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 52px;
    margin-top: 4px;
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: 100%;
  }
  
  .author-row .share-input {
    width: 70px;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 8px;
    text-align: center;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
  }
  
  .author-row .share-symbol {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
  }
  
  /* Botão de remover - ao lado da porcentagem */
  .author-row .btn-remove-author {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #ef4444;
  }
  
  .author-row .btn-remove-author:hover,
  .author-row .btn-remove-author:active {
    background: #ef4444;
    color: white;
  }
  
  /* =============================================
     DROPDOWN AUTOCOMPLETE - MOBILE
     ============================================= */
  
  .autocomplete-dropdown {
    position: fixed !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 60vh !important;
    z-index: 99999 !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid var(--border) !important;
    background: var(--bg-secondary) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Posicionar no meio da tela no mobile */
  .autocomplete-dropdown.is-open {
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  
  /* Item do autocomplete */
  .autocomplete-dropdown .autocomplete-item {
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border-bottom: 1px solid var(--border);
    min-height: 60px;
  }
  
  .autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
  }
  
  .autocomplete-dropdown .autocomplete-item:active {
    background: rgba(99, 102, 241, 0.1);
  }
  
  /* Avatar no dropdown */
  .autocomplete-dropdown .author-avatar,
  .autocomplete-dropdown .autocomplete-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
    flex-shrink: 0;
    border-radius: 12px;
    position: static !important;
  }
  
  /* Info do autor no dropdown */
  .autocomplete-dropdown .autocomplete-info,
  .autocomplete-dropdown .author-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .autocomplete-dropdown .autocomplete-name,
  .autocomplete-dropdown .author-name {
    font-size: 15px !important;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .autocomplete-dropdown .autocomplete-pseudo,
  .autocomplete-dropdown .author-pseudo {
    font-size: 13px !important;
    color: var(--text-tertiary);
  }
  
  /* Badge de exclusivo */
  .autocomplete-dropdown .badge-exclusive,
  .autocomplete-dropdown [class*="exclusive"] {
    font-size: 10px !important;
    padding: 3px 8px !important;
    border-radius: 6px;
    white-space: nowrap;
  }
  
  /* Item de criar novo autor */
  .autocomplete-dropdown .autocomplete-item.create-new,
  .autocomplete-dropdown .create-new {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 500;
    justify-content: center;
    text-align: center;
    border-top: 2px solid var(--accent-primary);
  }
  
  .autocomplete-dropdown .create-new i {
    font-size: 20px;
  }
  
  /* Overlay atrás do dropdown */
  .autocomplete-dropdown.is-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

/* =============================================
   CORREÇÕES ADICIONAIS MOBILE
   ============================================= */

@media (max-width: 480px) {
  /* Author row ainda mais compacto */
  .author-row {
    padding: 12px;
  }
  
  .author-row > .author-avatar,
  .author-row .author-avatar {
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  
  .author-row .author-inputs {
    padding-left: 46px;
  }
  
  .author-row .author-share {
    padding-left: 46px;
  }
  
  .author-row .share-input {
    width: 60px;
    font-size: 14px;
    padding: 8px 6px;
  }
  
  .author-row .btn-remove-author {
    width: 36px;
    height: 36px;
  }
  
  /* Dropdown mais alto em telas pequenas */
  .autocomplete-dropdown {
    max-height: 70vh !important;
  }
  
  .autocomplete-dropdown .autocomplete-item {
    padding: 12px 14px !important;
    min-height: 54px;
  }
}


/* =============================================
   GARANTIR QUE SIDEBAR NÃO ABRE NO MOBILE
   ============================================= */

@media (max-width: 768px) {
  /* Sidebar escondida completamente */
  .sidebar.is-open,
  .sidebar.open,
  .sidebar.active,
  .nav-sidebar.is-open {
    transform: translateX(-100%) !important;
    visibility: hidden !important;
  }
  
  /* Remover overlay do sidebar */
  .sidebar-overlay,
  .nav-overlay,
  .menu-overlay {
    display: none !important;
  }
  
  /* Body não deve travar */
  body.sidebar-open,
  body.menu-open,
  body.nav-open {
    overflow: auto !important;
    position: static !important;
  }
}
