:root {
  --bg: #0f1220;
  --card: #1a1f36;
  --accent: #1db954;
  --accent-2: #ff5f6d;
  --text: #f4f4f6;
  --muted: #9aa0b4;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, #1a1f36 0%, #0f1220 60%);
  color: var(--text);
  min-height: 100vh;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px 80px; }

h1, h2, h3 { font-weight: 700; }

.hero { text-align: center; padding: 40px 16px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.hero p { color: var(--muted); }

.grid-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #06210f;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: transform .1s ease;
}
.btn:active { transform: scale(0.97); }
.btn.secondary { background: #2a3050; color: var(--text); }
.btn.danger { background: var(--accent-2); color: #2a0508; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

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

input[type=text], input[type=password], input[type=number], select {
  background: #0f1220;
  border: 1px solid #2a3050;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
  flex: 1;
  min-width: 200px;
}

input[type=text]:focus, input[type=password]:focus, input[type=number]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder { color: var(--muted); }

/* Evita que Chrome/Edge pinten el fondo de blanco al autorrellenar */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px #0f1220 inset;
  transition: background-color 9999s ease-in-out 0s;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #2a3050; font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; }
td input[type=number] { width: 80px; background: #0f1220; color: var(--text); border: 1px solid #2a3050; border-radius: 6px; padding: 6px; }

.now-playing { text-align: center; padding: 20px; }
.now-playing img { width: 160px; height: 160px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.now-playing .song-name { font-size: 1.6rem; margin-top: 12px; }
.now-playing .song-artist { color: var(--muted); font-size: 1.1rem; }

.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #2a3050;
}
.history-list img { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }
.history-list .idx { color: var(--muted); width: 28px; text-align: right; flex-shrink: 0; }
.history-list .meta strong { display: block; }
.history-list .meta span { color: var(--muted); font-size: 0.9rem; }

.counter { color: var(--muted); text-align: center; margin-bottom: 16px; }

.big-mode .history-list .meta strong { font-size: 2.2rem; }
.big-mode .history-list .meta span { font-size: 1.4rem; }
.big-mode .history-list img { width: 70px; height: 70px; }
.big-mode .counter { font-size: 1.4rem; }

.toggle-row { text-align: center; margin-bottom: 16px; }

.status-ok { color: var(--accent); }
.status-bad { color: var(--accent-2); }

.qr-box { text-align: center; }
.qr-box img { background: white; padding: 10px; border-radius: 12px; }

.footer-note { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 40px; }

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-screen .hero { padding-bottom: 8px; }
.login-screen .card { max-width: 360px; margin: 0 auto; }
.login-screen form .row { gap: 14px; }
.login-screen .footer-note { margin-top: 32px; }
