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

:root {
  --bg: #0f1422;
  --surface: #1a1f33;
  --border: #2a2e3e;
  --gold: #c9a84c;
  --text: #e0e0e0;
  --muted: #888;
  --error: #e84a4a;
  --success: #4ade80;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.gold { color: var(--gold); }
.muted { color: var(--muted); font-size: 0.9rem; }
.error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 12px;
  min-height: 20px;
}
.hidden { display: none !important; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
}
.login-card h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
  text-align: center;
}
.login-card > p {
  text-align: center;
  margin-bottom: 28px;
}

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 1.5rem; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar {
  margin-bottom: 16px;
}
.search-bar input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ── Lista de canciones ─────────────────────────────────────────────────── */
.songs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color 0.15s;
}
.song-item:hover { border-color: var(--gold); }
.song-info { flex: 1; min-width: 0; }
.song-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-file {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-actions {
  display: flex;
  gap: 6px;
}
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-ghost, .btn-icon {
  cursor: pointer;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 500;
  transition: opacity 0.15s, background 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--gold);
}
.btn-icon {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.85rem;
}
.btn-icon:hover { color: var(--gold); }
.btn-icon.danger:hover { color: var(--error); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 16px; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"] {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
input:focus {
  outline: none;
  border-color: var(--gold);
}
input[type="file"] {
  padding: 8px;
  cursor: pointer;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
}
.modal-content h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--gold);
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  max-width: 90%;
}
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { flex-direction: column; align-items: stretch; }
  .header-actions { justify-content: space-between; }
  .song-item { flex-wrap: wrap; }
  .song-actions { width: 100%; justify-content: flex-end; }
}
