@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #090d1a;
  --bg-soft: #111827;
  --bg-elev: #151d33;
  --card: rgba(20, 28, 48, 0.72);
  --card-solid: #151d33;
  --line: rgba(148, 163, 199, 0.14);
  --line-strong: rgba(148, 163, 199, 0.24);
  --text: #f3f6ff;
  --muted: #94a0bf;
  --accent: #f5c451;
  --accent-2: #ffdd8a;
  --accent-soft: rgba(245, 196, 81, 0.14);
  --accent-glow: rgba(245, 196, 81, 0.22);
  --danger: #ff8f8f;
  --danger-soft: rgba(255, 143, 143, 0.12);
  --ok: #7ddba3;
  --ok-soft: rgba(125, 219, 163, 0.12);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 180ms cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.no-scroll { overflow: hidden; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(700px 420px at 85% 0%, rgba(245, 196, 81, 0.12), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(56, 189, 248, 0.08), transparent 55%),
    linear-gradient(180deg, #0c1224 0%, var(--bg) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.topbar, .wrap { position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: rgba(9, 13, 26, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(148, 163, 199, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #dbe4ff;
  min-width: 0;
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(245,196,81,0.22), rgba(245,196,81,0.08));
  color: var(--accent);
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 12px rgba(245,196,81,0.12);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,0.08); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-right,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.menu-btn { display: grid; place-items: center; }

/* Perfil / acceso */
.profile-wrap { position: relative; }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.profile-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }
.profile-btn:active { transform: scale(0.98); }
.profile-btn.signed-in {
  border-color: rgba(245, 196, 81, 0.26);
  background: linear-gradient(180deg, rgba(245, 196, 81, 0.13), rgba(245, 196, 81, 0.05));
}
.profile-btn.role-musico.signed-in {
  border-color: rgba(96, 165, 250, 0.3);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.14), rgba(96, 165, 250, 0.05));
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.26), rgba(99, 102, 241, 0.26));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.profile-btn.signed-in .profile-avatar {
  background: linear-gradient(135deg, #ffd76a, #e39a23);
  color: #241800;
}
.profile-btn.role-musico.signed-in .profile-avatar {
  background: linear-gradient(135deg, #93c5fd, #3b82f6);
  color: #071a33;
}

.profile-label {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(260px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(148, 163, 199, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, #151f36 0%, #0e1526 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: pop-in 180ms cubic-bezier(.2, .8, .2, 1);
}
.profile-menu-email {
  margin: 0;
  color: #eaf0ff;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.profile-menu-role {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.profile-menu-role.role-admin { color: var(--accent); }
.profile-menu-role.role-musico { color: #a9d3ff; }
.profile-menu-sep {
  height: 1px;
  margin: 12px 0 6px;
  background: rgba(148, 163, 199, 0.12);
}
.profile-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #dce5ff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.profile-menu-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.profile-menu-item.danger { color: #ffb5b5; }
.profile-menu-item.danger:hover { background: rgba(255, 143, 143, 0.08); }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(245, 196, 81, 0.22);
  border-radius: 999px;
  background: rgba(245, 196, 81, 0.14);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.role-badge.role-musico {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(96, 165, 250, 0.13);
  color: #a9d3ff;
}

.role-hint {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.11), rgba(96, 165, 250, 0.04));
  color: #b9d8ff;
  font-size: 13px;
  line-height: 1.6;
}

.hamburger {
  display: grid;
  gap: 4px;
  width: 18px;
}
.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}
.menu-btn[aria-expanded="true"] .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Sidebar / drawer */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 8, 18, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 180ms ease;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #111a2e 0%, #0b1120 100%);
  border-right: 1px solid rgba(148, 163, 199, 0.14);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(-104%);
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 199, 0.1);
}
.sidebar-head .brand { font-size: 14px; }

.sidebar-nav {
  display: grid;
  gap: 6px;
  padding: 16px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #c7d2ea;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-link.active {
  background: rgba(245, 196, 81, 0.12);
  border-color: rgba(245, 196, 81, 0.16);
  color: var(--accent-2);
}

.sidebar-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
}
.sidebar-link.active .sidebar-ico {
  background: rgba(245, 196, 81, 0.14);
  color: var(--accent);
}

.sidebar-count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 8px;
  background: rgba(245, 196, 81, 0.14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sidebar-sep {
  height: 1px;
  margin: 4px 0 16px;
  background: rgba(148, 163, 199, 0.1);
}

.sidebar-add {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(245, 196, 81, 0.25);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(245, 196, 81, 0.16), rgba(245, 196, 81, 0.07));
  color: #ffe3a0;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter var(--transition), border-color var(--transition), transform var(--transition);
}
.sidebar-add:hover { filter: brightness(1.08); border-color: rgba(245, 196, 81, 0.4); }
.sidebar-add:active { transform: scale(0.99); }

.sidebar-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: rgba(245, 196, 81, 0.18);
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.sidebar-hint {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 199, 0.1);
}
.sidebar-account-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.demo-role-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px;
  border: 1px dashed rgba(148, 163, 199, 0.22);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.demo-role-switch .mini-btn { flex: 1; height: 32px; }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px calc(48px + env(safe-area-inset-bottom));
}
.wrap.narrow { max-width: 600px; }

.hero {
  padding: 8px 0 28px;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245,196,81,0.1);
  border: 1px solid rgba(245,196,81,0.18);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,196,81,0.15);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 30%, #c7d2ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 500;
  max-width: 40ch;
}

/* Public song list */
.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.song-list li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.song-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), rgba(245,196,81,0.3));
  opacity: 0.9;
}
.song-list li:hover {
  transform: translateY(-1px);
  border-color: rgba(245,196,81,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.24), 0 0 0 1px rgba(245,196,81,0.06);
}

.song-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245,196,81,0.2), rgba(245,196,81,0.06));
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.song-title {
  flex: 1;
  min-width: 0;
  font-size: clamp(18px, 4.8vw, 23px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  color: #f7f9ff;
}

.day-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 199, 0.12);
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.day-note::before {
  content: "Nota: ";
  color: var(--accent-2);
  font-weight: 700;
}

.empty, .notice {
  padding: 22px 20px;
  border: 1px dashed rgba(148, 163, 199, 0.2);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  background: rgba(255,255,255,0.015);
}

.notice {
  margin-bottom: 18px;
  border-style: solid;
  border-color: rgba(245, 196, 81, 0.25);
  background: linear-gradient(180deg, rgba(245,196,81,0.12), rgba(245,196,81,0.05));
  color: #ffe3a0;
  font-size: 14px;
  font-weight: 500;
}
.notice.error {
  border-color: rgba(255, 143, 143, 0.3);
  background: linear-gradient(180deg, rgba(255,143,143,0.12), rgba(255,143,143,0.04));
  color: #ffb5b5;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(148,163,199,0.1);
  color: var(--muted);
  font-size: 13px;
}
.footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.link-btn {
  border: 0;
  background: none;
  color: var(--accent-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
.link-btn:hover { color: #fff; }

/* Cards / admin */
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
}
.card + .card { margin-top: 18px; }

.card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f7f9ff;
}

.card .hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

label {
  display: block;
  margin: 18px 0 7px;
  color: #b8c4de;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(148,163,199,0.16);
  border-radius: 13px;
  background: rgba(9, 13, 26, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input::placeholder, textarea::placeholder { color: #6f7d9c; }
input:hover, textarea:hover, select:hover { border-color: rgba(148,163,199,0.28); }
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(245,196,81,0.55);
  box-shadow: 0 0 0 4px rgba(245,196,81,0.12);
  background: rgba(9, 13, 26, 0.65);
}

input:disabled, textarea:disabled, select:disabled {
  opacity: 0.75;
  color: #c7d2ea;
  background: rgba(255, 255, 255, 0.025);
  cursor: default;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffd76a 0%, #efb82e 100%);
  color: #1e1600;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245,196,81,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.btn:hover { filter: brightness(1.03); box-shadow: 0 10px 24px rgba(245,196,81,0.32), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn[disabled] { opacity: 0.55; cursor: wait; filter: saturate(0.5); }

.btn.secondary {
  background: rgba(255,255,255,0.04);
  border-color: rgba(148,163,199,0.16);
  color: var(--text);
  box-shadow: none;
}
.btn.secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(148,163,199,0.28); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.status {
  margin: 14px 0 0;
  min-height: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin: -2px 0 22px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(9, 13, 26, 0.5);
  border: 1px solid rgba(148,163,199,0.1);
}
.tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.tab:hover { color: #dce5ff; }
.tab.active {
  background: rgba(245,196,81,0.14);
  color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
  color: #aab7d4;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgba(245,196,81,0.14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.selected-list, .library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.sel-row, .lib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,199,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  transition: border-color var(--transition), background var(--transition);
}
.sel-row:hover, .lib-row:hover {
  border-color: rgba(148,163,199,0.22);
  background: rgba(255,255,255,0.04);
}

.song-num.small {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  font-size: 13px;
}

.sel-title, .lib-info {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  color: #eaf0ff;
}
.lib-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib-title { flex: 1; min-width: 0; }

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245,196,81,0.12);
  border: 1px solid rgba(245,196,81,0.14);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge.tag {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.17);
  color: #a9d3ff;
  font-weight: 600;
}

.row-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* Usuarios y roles */
.users-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.user-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 199, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color var(--transition), background var(--transition);
}
.user-row:hover {
  border-color: rgba(148, 163, 199, 0.22);
  background: rgba(255, 255, 255, 0.04);
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.22), rgba(99, 102, 241, 0.18));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.user-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.user-name {
  overflow: hidden;
  color: #eaf0ff;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-email {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-select {
  width: auto;
  min-width: 138px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}
.user-form { margin-bottom: 4px; }

/* Solo lectura para músicos */
body[data-role="musico"] .admin-only { display: none !important; }
body[data-role="musico"] .sel-title,
body[data-role="musico"] .lib-title { color: #dfe8ff; }

.mini-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(148,163,199,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: #dce5ff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.mini-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); border-color: rgba(148,163,199,0.26); }
.mini-btn:active:not(:disabled) { transform: scale(0.96); }
.mini-btn:disabled { opacity: 0.35; cursor: default; }
.mini-btn.ghost { color: var(--muted); }
.mini-btn.ghost:hover:not(:disabled) { color: var(--danger); border-color: rgba(255,143,143,0.25); background: rgba(255,143,143,0.06); }

.row-empty {
  padding: 20px;
  border: 1px dashed rgba(148,163,199,0.2);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  background: rgba(255,255,255,0.01);
}

.add-row { display: grid; gap: 10px; }
.add-row .btn { width: 100%; }

/* QR */
.qr-box {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.qr-box img {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.qr-meta { flex: 1; min-width: 180px; }
.qr-meta code {
  display: block;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(9,13,26,0.45);
  border: 1px solid rgba(148,163,199,0.1);
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Add-song dialog */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(4, 8, 18, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 180ms ease;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 199, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, #151f36 0%, #0e1526 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: pop-in 220ms cubic-bezier(.2, .8, .2, 1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-card .actions { margin-top: 18px; }
.modal-card .hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.modal-card .hint:last-child { margin: 12px 0 0; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Small screens */
@media (max-width: 420px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .card { padding: 20px; border-radius: 18px; }
  .song-list li { padding: 14px 14px 14px 16px; gap: 12px; }
  .song-num { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; border-radius: 12px; }
  .sel-row, .lib-row { gap: 8px; padding: 10px; }
  .topbar { padding-left: 16px; padding-right: 16px; }
  .profile-label { max-width: 64px; }
  .lib-row { flex-wrap: wrap; }
  .lib-row .lib-info { flex-basis: calc(100% - 46px); }
  .lib-row .row-actions { width: 100%; justify-content: flex-end; }
  .user-row { grid-template-columns: 38px minmax(0, 1fr); }
  .user-row .role-select,
  .user-row .role-badge { grid-column: 2; justify-self: start; }
  .role-select { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

::selection { background: rgba(245,196,81,0.28); color: #fff; }
