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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #eaeaea;
  min-height: 100vh;
}

a { color: #e94560; text-decoration: none; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: opacity 0.15s, background 0.15s;
}

button:hover { opacity: 0.85; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"],
textarea {
  background: #0f3460;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #eaeaea;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #e94560;
}

textarea { resize: vertical; }

.card {
  background: #16213e;
  border-radius: 12px;
  padding: 32px;
}

.btn-primary {
  background: #e94560;
  color: #fff;
  padding: 10px 22px;
}

.btn-secondary {
  background: #0f3460;
  color: #eaeaea;
  padding: 8px 16px;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
}

.badge {
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  display: inline-block;
}

.badge-green { background: #1a5c3a; color: #4ecca3; }
.badge-orange { background: #5c3a1a; color: #f5a623; }
.badge-blue { background: #1a3a5c; color: #4ea8e9; }
.badge-red { background: #5c1a1a; color: #e94560; }

.error-msg {
  background: #3d1010;
  border: 1px solid #c0392b;
  border-radius: 6px;
  color: #e87070;
  font-size: 0.88rem;
  margin-top: 12px;
  padding: 10px 14px;
  display: none;
}

.success-msg {
  background: #0d3d24;
  border: 1px solid #27ae60;
  border-radius: 6px;
  color: #70e8a0;
  font-size: 0.88rem;
  margin-top: 12px;
  padding: 10px 14px;
  display: none;
}

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  color: #e94560;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-logo p {
  color: #888;
  font-size: 0.88rem;
  margin-top: 4px;
}

.tab-bar {
  display: flex;
  border-bottom: 2px solid #2a2a4a;
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: -2px;
  padding: 8px 20px;
  border-radius: 0;
}

.tab-btn.active {
  border-bottom-color: #e94560;
  color: #eaeaea;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 6px; }

.dash-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-header {
  background: #16213e;
  border-bottom: 1px solid #2a2a4a;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex-shrink: 0;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-logo {
  color: #e94560;
  font-size: 1.2rem;
  font-weight: 700;
}

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

.user-email { color: #aaa; font-size: 0.88rem; }

.dash-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  background: #16213e;
  border-right: 1px solid #2a2a4a;
  width: 200px;
  flex-shrink: 0;
  padding: 20px 0;
}

.nav-item {
  display: block;
  color: #aaa;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 24px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.nav-item:hover { color: #eaeaea; background: #1a2a4a; }
.nav-item.active { color: #eaeaea; border-left-color: #e94560; background: #1a2a4a; }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.panel { display: none; }
.panel.active { display: block; }

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

.panel-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.song-list, .setlist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song-item, .setlist-item {
  background: #16213e;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.song-title { font-weight: 600; font-size: 0.95rem; }
.song-artist { color: #888; font-size: 0.85rem; margin-top: 2px; }

.import-box { max-width: 600px; }
.import-url-row { display: flex; gap: 10px; margin-bottom: 16px; }
.import-url-row input { flex: 1; }
.import-result { display: none; margin-top: 20px; }
.import-result h3 { font-size: 1rem; margin-bottom: 12px; color: #aaa; }
.import-result .song-meta { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.import-result .song-meta-artist { color: #888; font-size: 0.88rem; margin-bottom: 12px; }
.import-result textarea { height: 300px; font-size: 0.85rem; }

.admin-table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  text-align: left;
  color: #888;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a4a;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a2a3a;
}

tr:last-child td { border-bottom: none; }

.loading { color: #888; font-size: 0.9rem; padding: 20px 0; }

/* ── Bottom nav (mobile only) ── */
.bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  /* Hide sidebar, show bottom nav */
  .sidebar { display: none; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #16213e;
    border-top: 1px solid #2a2a4a;
    height: 56px;
    z-index: 100;
    align-items: stretch;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
  }

  .bottom-nav-item.active { color: #e94560; }
  .bottom-nav-item:hover { color: #eaeaea; }

  /* Main content padding so content isn't hidden behind bottom bar */
  .main-content {
    padding: 16px;
    padding-bottom: 70px;
  }

  /* Header: truncate email */
  .user-email {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dash-header { padding: 0 14px; }
  .import-url-row { flex-direction: column; }

  /* Admin table: hide Created column */
  .hide-mobile { display: none; }
}
