/* ============================================
   TIMETUNE — STYLESHEET
   Theme: Dark Music / Record Label Aesthetic
   ============================================ */

:root {
  --bg: #0d0d1a;
  --bg-card: #13132a;
  --bg-elevated: #1a1a35;
  --bg-input: #0f0f22;
  --accent: #e94560;
  --accent-dim: rgba(233, 69, 96, 0.15);
  --accent-hover: #ff5574;
  --gold: #f5a623;
  --gold-dim: rgba(245, 166, 35, 0.15);
  --blue: #0f3460;
  --text: #f0f0f8;
  --text-muted: #7a7a9d;
  --text-dim: #3a3a5c;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(233, 69, 96, 0.3);
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --spotify-green: #1db954;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 4px 24px rgba(233, 69, 96, 0.3);
}

/* BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* NOISE OVERLAY */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.025;
  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");
  background-size: 150px;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* LINKS */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon { width: 28px; height: 28px; }

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e94560, #f5a623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
}

.user-name {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   MAIN
   ============================================ */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  animation: fadeInUp 0.4s ease both;
}

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

.section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 14px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   LOGIN / HERO
   ============================================ */
.section-login {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 80px);
  line-height: 0.95;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #e94560 0%, #f5a623 50%, #e94560 100%);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* SETUP CARD */
.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  text-align: left;
}

.setup-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.setup-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.setup-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.setup-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.setup-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  user-select: none;
}

.help-content {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
}

.help-content ol {
  padding-left: 20px;
}

.help-content li {
  margin-bottom: 6px;
}

.help-content code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--gold);
  word-break: break-all;
}

/* FEATURE GRID */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 32px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

.feature-icon { font-size: 20px; }

/* ============================================
   PLAYLIST SELECTOR
   ============================================ */
.playlist-selector {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.selector-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.playlist-info {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.playlist-cover {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.playlist-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.playlist-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.year-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   CARDS GRID
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  min-height: 200px;
}

/* CARD PREVIEW */
.card-preview-wrapper {
  position: relative;
  cursor: pointer;
}

.card-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
}

.card-preview {
  perspective: 600px;
  width: 100%;
  aspect-ratio: 63 / 89;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-preview-wrapper.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.card-back {
  transform: rotateY(180deg);
}

/* Deselected state */
.card-preview-wrapper.deselected .card-face {
  opacity: 0.35;
  filter: grayscale(0.6);
}

/* FRONT FACE */
.card-front-preview {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  height: 100%;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
}

.card-front-preview .notes-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 12px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 12px
    );
}

.card-qr-container {
  background: white;
  padding: 4px;
  border-radius: 4px;
  width: 80%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin-top: 12px;
}

.card-qr-container canvas,
.card-qr-container img {
  width: 100% !important;
  height: 100% !important;
}

.card-front-logo {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  font-family: var(--font-display);
  position: relative;
  z-index: 1;
}

/* BACK FACE */
.card-back-preview {
  background: #1a1a2e;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.card-decade-bar {
  height: 6px;
  width: 100%;
  flex-shrink: 0;
}

.card-back-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  gap: 4px;
  position: relative;
}

.card-vinyl-bg {
  position: absolute;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #ffffff 0px, #ffffff 0.5px, transparent 0.5px, transparent 2.5px);
  opacity: 0.07;
  pointer-events: none;
}

.card-artist-preview {
  font-size: 9px;
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title-preview {
  font-size: 8px;
  color: #b3b3b3;
  text-align: center;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-year-preview {
  font-size: 22px;
  font-weight: 900;
  color: white;
  font-family: var(--font-display);
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}

.card-back-logo {
  font-size: 7px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  font-family: var(--font-display);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.card-custom-text-wrap {
  position: relative;
  z-index: 10;
  width: 92%;
  margin-top: 4px;
  margin-bottom: 2px;
}

.card-custom-input {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px dashed rgba(233,69,96,0.5);
  border-radius: 5px;
  color: rgba(255,255,255,0.95);
  font-family: var(--font-body);
  font-size: 9px;
  padding: 4px 7px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  cursor: text;
}

.card-custom-input:focus {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(255,255,255,0.15);
}

.card-custom-input::placeholder {
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
.settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.settings-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.setting-group {}

.setting-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Radio Swatches */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.radio-option input { display: none; }

.radio-option.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.radio-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-classic { background: linear-gradient(135deg, #0f0c29, #302b63); border: 1px solid rgba(255,255,255,0.2); }
.swatch-minimal { background: linear-gradient(135deg, #000, #fff); }
.swatch-vintage { background: linear-gradient(135deg, #8B7355, #d4a96a); }
.swatch-neon { background: linear-gradient(135deg, #000, #ff00ff); }

/* Toggle Group */
.toggle-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
}

.checkbox-option input { display: none; }

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-accent);
  border-radius: 4px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.checkbox-option input:checked ~ .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-option input:checked ~ .checkmark::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
  display: block;
}

/* ============================================
   PDF STATS
   ============================================ */
.pdf-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  color: var(--text);
}

.stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ============================================
   PDF ACTIONS
   ============================================ */
.pdf-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* PROGRESS */
.progress-container {
  margin-bottom: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary.btn-full { width: 100%; margin-top: 16px; }

.btn-primary.btn-xl {
  padding: 16px 48px;
  font-size: 16px;
  letter-spacing: 0.3px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.25);
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--spotify-green);
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(29, 185, 84, 0.25);
  margin-bottom: 32px;
}

.btn-spotify:hover {
  background: #1ed760;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(29, 185, 84, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--text-dim); }

.input-sm { width: auto; min-width: 180px; padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.input-xs { width: 90px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.select-wrapper { position: relative; }

.select-field {
  padding: 10px 36px 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s;
  min-width: 200px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.select-field:focus { border-color: var(--accent); }

.select-sm .select-field { min-width: 160px; padding: 6px 32px 6px 12px; font-size: 13px; border-radius: 8px; }

/* ============================================
   LOADING
   ============================================ */
.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  margin: 16px;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.modal .input-field {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  opacity: 0;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-success { border-color: #1db954; color: #1db954; }
.toast.toast-error { border-color: var(--accent); color: var(--accent); }
.toast.toast-info { border-color: var(--gold); color: var(--gold); }

/* ============================================
   UTILITIES
   ============================================ */
.hidden { display: none !important; }

.btn-icon { font-size: 16px; line-height: 1; }

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .main-content { padding: 24px 16px 60px; }

  .hero-title { font-size: 52px; }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-right {
    justify-content: flex-start;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .pdf-stats {
    gap: 16px;
    padding: 16px;
  }

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

  .settings-grid { grid-template-columns: 1fr; }
}
