:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #ca8a04;
  --warning-light: #fef9c3;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #fff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* ==================== Toast ==================== */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}
.toast {
  padding: 10px 20px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.toast.error {
  background: var(--danger);
}
.toast.success {
  background: var(--success);
}

/* ==================== Page ==================== */
.page {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.page.active {
  display: flex;
}
.hidden {
  display: none !important;
}

/* ========== Login Page ========== */
#login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-box {
  background: #fff;
  padding: 40px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.login-subtitle {
  color: var(--text-2);
  font-size: 13px;
  margin: 0 0 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form .input-row {
  display: flex;
  gap: 10px;
}

.login-form .input-row input {
  flex: 1;
  min-width: 0;
  letter-spacing: 4px;
  text-align: center;
  font-size: 16px;
}

.login-form .input-row button {
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: 13px;
  white-space: nowrap;
  min-width: 90px;
}

.login-form input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-form input:disabled {
  background: #f9fafb;
  color: var(--text-2);
}

.login-form button#login-btn {
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
}

.login-tip {
  font-size: 12px;
  color: var(--text-2);
  margin: 4px 0 0;
  min-height: 18px;
  line-height: 1.4;
}

.login-tip.error {
  color: var(--danger);
}

.login-tip.success {
  color: var(--success);
}
.page {
  display: none;
}

.page.active {
  display: flex;
}

#login-page {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#sessions-page,
#session-page,
#history-page,
#history-detail-page,
#admin-page {
  flex-direction: column;
}
/* ==================== Header ==================== */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 16px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-info img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.user-info span {
  font-size: 13px;
  font-weight: 500;
}
.back-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--text-2);
  border-radius: var(--radius);
}
.back-btn:hover {
  background: var(--bg);
}
.text-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.text-btn:hover {
  text-decoration: underline;
}
#admin-btn {
  display: none;
}

/* ==================== Status Badge ==================== */
.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-badge.draft {
  background: var(--bg);
  color: var(--text-3);
}
.status-badge.collecting {
  background: var(--primary-light);
  color: var(--primary);
}
.status-badge.reviewing {
  background: var(--warning-light);
  color: var(--warning);
}
.status-badge.voting {
  background: var(--success-light);
  color: var(--success);
}
.status-badge.finished {
  background: var(--bg);
  color: var(--text-3);
}

/* ==================== Button ==================== */
button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
button:hover {
  background: var(--bg);
}
button.primary {
  background: var(--primary);
  color: #fff;
  border: none;
}
button.primary:hover {
  background: var(--primary-hover);
}
button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
}
button.danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
button.danger:hover {
  background: #b91c1c;
}
button.full-width {
  width: 100%;
}

header button {
  padding: 6px 14px;
  font-size: 13px;
}

/* ==================== Main ==================== */
main {
  flex: 1;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}

/* ==================== Timer ==================== */
#timer-bar {
  text-align: center;
  padding: 12px;
  background: var(--warning-light);
  color: #92400e;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 600;
}
#timer-bar:empty {
  display: none;
}

/* ==================== Card ==================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-body {
  padding: 18px;
}
.header-info {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-2);
}

.danger-card {
  border-color: var(--danger-light);
}
.danger-card .card-header {
  background: var(--danger-light);
  color: var(--danger);
}

/* ==================== Empty ==================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-2);
}
.empty-state p {
  margin-bottom: 16px;
}

/* ==================== Input ==================== */
.input-row {
  display: flex;
  gap: 10px;
}
.input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.input-row input:focus {
  outline: none;
  border-color: var(--primary);
}
input.full-width {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
input.small {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

/* ==================== Submit Form ==================== */
.submit-form {
  padding: 18px;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.field-row label {
  width: 50px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.field-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field-row input:focus {
  outline: none;
  border-color: var(--primary);
}
#submit-fields button {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

/* ==================== Preview ==================== */
#preview-box {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}
.preview-card {
  display: flex;
  gap: 16px;
}
.preview-card .cover {
  width: 180px;
  flex-shrink: 0;
}
.preview-card .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.preview-card .info {
  flex: 1;
}
.preview-card .title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
}
.preview-card .meta {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 10px;
}
.preview-card .tags {
  display: flex;
  gap: 8px;
}
.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag.ok {
  background: var(--success-light);
  color: var(--success);
}
.tag.error {
  background: var(--danger-light);
  color: var(--danger);
}

#my-submission-status {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--success-light);
  color: var(--success);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
#my-submission-status:empty {
  display: none;
}

/* ==================== Song List ==================== */
#submissions-list {
  display: flex;
  flex-direction: column;
}
.song-item {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.song-item:last-child {
  border-bottom: none;
}
.song-item:hover {
  background: var(--bg);
}
.song-item.mine {
  background: var(--primary-light);
}
.song-item .cover {
  width: 110px;
  flex-shrink: 0;
}
.song-item .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.song-item .info {
  flex: 1;
  min-width: 0;
}
.song-item .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.song-item .author {
  color: var(--text-2);
  font-size: 13px;
}
.song-item .submitter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.song-item .submitter img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* ==================== Vote Grid ==================== */
#vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.vote-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  position: relative;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.vote-card:hover {
  border-color: var(--text-3);
  transform: translateY(-2px);
}
.vote-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.vote-card.voted {
  opacity: 0.6;
  cursor: default;
}
.vote-card.voted.selected {
  opacity: 1;
}
.vote-card .cover {
  position: relative;
}
.vote-card .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.vote-card .play-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.vote-card:hover .play-btn {
  opacity: 1;
}
.vote-card .mine-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--warning);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.vote-card .check-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.vote-card .body {
  padding: 14px;
}
.vote-card .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.vote-card .author {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.vote-card .stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vote-card .vote-count {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.vote-card .vote-label {
  font-size: 11px;
  color: var(--text-3);
}

/* Admin Panel in Vote Card */
.admin-panel {
  padding: 12px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.live-score {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.penalty {
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
}
.voters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.voter-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-size: 11px;
  cursor: help;
}
.voter-tag.penalized {
  background: var(--danger-light);
  color: var(--danger);
}
.no-voters {
  font-size: 11px;
  color: var(--text-3);
}

/* Vote Actions */
.vote-actions {
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.vote-actions button {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
}

/* ==================== Result ==================== */
#result-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.result-winner {
  display: flex;
  gap: 18px;
  padding: 18px;
  background: var(--warning-light);
  border-radius: var(--radius);
}
.result-winner .cover {
  width: 180px;
  flex-shrink: 0;
}
.result-winner .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.result-winner .info {
  flex: 1;
}
.result-winner .rank {
  font-size: 12px;
  color: var(--warning);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.result-winner .title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.result-winner .title a {
  color: inherit;
  text-decoration: none;
}
.result-winner .title a:hover {
  text-decoration: underline;
}
.result-winner .author {
  color: var(--text-2);
  margin-bottom: 10px;
}
.result-winner .submitter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.result-winner .submitter img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.result-winner .score-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.result-winner .score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--warning);
}
.result-winner .score-label {
  color: var(--text-2);
}

.result-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center;
}
.result-item .rank {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  font-size: 15px;
}
.result-item .cover {
  width: 100px;
  flex-shrink: 0;
}
.result-item .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.result-item .info {
  flex: 1;
  min-width: 0;
}
.result-item .title {
  font-weight: 600;
}
.result-item .title a {
  color: inherit;
  text-decoration: none;
}
.result-item .author {
  font-size: 13px;
  color: var(--text-2);
}
.result-item .submitter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}
.result-item .submitter img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.result-item .score {
  text-align: right;
  flex-shrink: 0;
}
.result-item .score-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.result-item .score-label {
  font-size: 11px;
  color: var(--text-3);
}

/* Result Details */
.result-details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
}
.detail-item .label {
  color: var(--text-2);
}
.detail-item .value {
  font-weight: 600;
}
.voter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
}
.voter-row .left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voter-row img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.voter-row .weight {
  font-weight: 600;
  color: var(--primary);
}

/* ==================== Session List ==================== */
#active-sessions-list,
#finished-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.session-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.session-card.finished {
  opacity: 0.7;
}
.session-card.finished:hover {
  opacity: 1;
}
.session-info .session-name {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
}
.session-info .session-stats {
  font-size: 13px;
  color: var(--text-2);
}
.session-status {
  text-align: right;
}
.session-status .remaining {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 6px;
}

/* ==================== History ==================== */
#history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.history-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 18px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.history-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.history-card .cover {
  width: 140px;
  flex-shrink: 0;
}
.history-card .cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.history-card .info {
  flex: 1;
  min-width: 0;
}
.history-card .session-name {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
}
.history-card .title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-card .author {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.history-card .stats {
  font-size: 12px;
  color: var(--text-3);
}
.history-card .score {
  font-size: 24px;
  font-weight: 700;
  color: var(--warning);
  flex-shrink: 0;
  align-self: center;
}

/* ==================== Admin ==================== */
.admin-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-main {
  min-width: 0;
}

#admin-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.admin-session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.admin-session-item:hover {
  background: #e5e7eb;
}
.admin-session-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
}
.admin-session-item .name {
  font-weight: 500;
}
.admin-session-item .status {
  font-size: 12px;
  color: var(--text-2);
}

#admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-box {
  text-align: center;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.stat-box .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.stat-box .label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

/* Step List */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.step-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.step-item.done {
  opacity: 0.5;
}
.step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.step-content {
  flex: 1;
}
.step-title {
  font-weight: 600;
  margin-bottom: 10px;
}
.step-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 10px;
}

/* Pending */
#pending-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pending-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius);
  align-items: flex-start;
  border: 1px solid var(--border);
}
.pending-cover {
  width: 100px;
  flex-shrink: 0;
}
.pending-cover img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
}
.pending-info {
  flex: 1;
  min-width: 0;
}
.pending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pending-row label {
  width: 40px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.pending-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}
.pending-meta {
  font-size: 12px;
  color: var(--text-3);
}
.pending-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pending-actions button {
  padding: 8px 14px;
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== Responsive ==================== */
@media (max-width: 800px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    order: 2;
  }
  .admin-main {
    order: 1;
  }
}

@media (max-width: 600px) {
  main {
    padding: 16px;
  }
  .login-box {
    width: 90%;
    padding: 28px;
  }
  .preview-card {
    flex-direction: column;
  }
  .preview-card .cover {
    width: 100%;
  }
  .song-item {
    flex-direction: column;
  }
  .song-item .cover {
    width: 100%;
  }
  #vote-grid {
    grid-template-columns: 1fr;
  }
  .result-winner {
    flex-direction: column;
  }
  .result-winner .cover {
    width: 100%;
  }
  .result-item {
    flex-wrap: wrap;
  }
  .result-item .score {
    width: 100%;
    text-align: left;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .history-card {
    flex-direction: column;
  }
  .history-card .cover {
    width: 100%;
  }
  .session-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .session-status {
    text-align: left;
  }
  #admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.mt-xs {
  margin-top: 4px;
}
.mt-sm {
  margin-top: 8px;
}
.mt-md {
  margin-top: 12px;
}
.mt-lg {
  margin-top: 24px;
}
.mb-xs {
  margin-bottom: 4px;
}
.mb-sm {
  margin-bottom: 8px;
}
.mb-md {
  margin-bottom: 12px;
}
.mb-lg {
  margin-bottom: 24px;
}
.full-width {
  width: 100%;
}
.text-muted {
  color: var(--text-3);
}
.text-sm {
  font-size: 13px;
}
/* Step disabled state */
.step-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.step-item.disabled .step-num {
  background: var(--text-3);
}

.step-item.done {
  opacity: 0.5;
}

.step-item.done .step-num {
  background: var(--success);
}

.step-item button:disabled,
.step-item input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  z-index: 9999;
  animation: toast-in 0.3s ease;
}

.toast-success {
  background: #10b981;
}
.toast-error {
  background: #ef4444;
}
.toast-info {
  background: #3b82f6;
}

.toast.fade-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
