* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f5f7; color: #222;
}
.admin-nav {
  background: #1a1a2e; color: #fff; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}
.nav-title { font-weight: 700; }
.nav-links a { color: #cfd2e0; text-decoration: none; margin-left: 18px; font-size: 14px; }
.nav-links a:hover { color: #fff; }
.admin-main { max-width: 960px; margin: 0 auto; padding: 30px 20px 60px; }
h1 { margin-top: 36px; font-size: 22px; }
h1:first-child { margin-top: 0; }
.hint { color: #666; font-size: 14px; margin-top: 4px; }

.upload-form, .new-playlist-form {
  background: #fff; border: 1px solid #e2e4ea; border-radius: 10px;
  padding: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: 16px 0;
}
.upload-form button, .new-playlist-form button {
  background: #e63946; color: #fff; border: none; padding: 10px 16px;
  border-radius: 6px; cursor: pointer; font-weight: 600;
}
.new-playlist-form input[type="text"], .new-playlist-form input[type="date"] {
  padding: 8px; border-radius: 6px; border: 1px solid #ccc;
}

.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 30px;
}
.media-card {
  background: #fff; border: 1px solid #e2e4ea; border-radius: 10px;
  overflow: hidden;
}
.media-card img, .media-card video {
  width: 100%; height: 120px; object-fit: cover; display: block; background: #000;
}
.media-name {
  font-size: 12px; padding: 6px 8px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: #444;
}
.media-actions {
  display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid #eee;
}
.media-actions form { margin: 0; }
.media-actions button {
  background: #eee; border: none; border-radius: 4px; padding: 4px 8px; cursor: pointer;
}
.media-actions button.danger { background: #ffe0e0; }
.empty { color: #999; font-style: italic; }

.playlist-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.playlist-table th, .playlist-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.playlist-table a { color: #1a1a2e; font-weight: 600; text-decoration: none; }
.playlist-table form { margin: 0; }
.playlist-table button { background: #eee; border: none; border-radius: 5px; padding: 6px 10px; cursor: pointer; }
.playlist-table button.danger { background: #ffe0e0; }
.badge { background: #eee; color: #555; padding: 3px 8px; border-radius: 20px; font-size: 12px; }
.badge.live { background: #d4f5dd; color: #1b7a3d; font-weight: 700; }
.badge.off { background: #f0f0f0; color: #999; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #1a1a2e; }
.login-box {
  background: #fff; padding: 32px; border-radius: 12px; width: 300px;
  display: flex; flex-direction: column; gap: 10px;
}
.login-box h1 { margin: 0 0 10px; font-size: 20px; text-align: center; }
.login-box input { padding: 10px; border-radius: 6px; border: 1px solid #ccc; }
.login-box button {
  background: #e63946; color: #fff; border: none; padding: 10px; border-radius: 6px;
  cursor: pointer; font-weight: 600; margin-top: 6px;
}
.back-link { text-align: center; font-size: 13px; color: #888; text-decoration: none; margin-top: 6px; }

.settings-card {
  background: #fff; border: 1px solid #e2e4ea; border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
.settings-card h2 { margin-top: 0; font-size: 16px; }
.settings-card form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin-top: 12px; }
.settings-card label { font-size: 13px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.settings-card input { padding: 9px; border-radius: 6px; border: 1px solid #ccc; }
.settings-card button {
  background: #1a1a2e; color: #fff; border: none; padding: 10px; border-radius: 6px;
  cursor: pointer; font-weight: 600;
}
.success-msg { color: #1b7a3d; background: #d4f5dd; padding: 10px 14px; border-radius: 8px; }
.error-msg { color: #b3261e; background: #fbe4e2; padding: 10px 14px; border-radius: 8px; }
