/* Admin MU Bất Tử */
:root {
  --bg-dark: #0f1219;
  --bg-card: #1a1f2e;
  --red-main: #c41e3a;
  --red-dark: #8b1528;
  --gold: #d4af37;
  --text: #e8e8e8;
  --text-muted: #909090;
  --border: rgba(255,255,255,0.08);
  --font: 'Be Vietnam Pro', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg-dark); color: var(--text); min-height: 100vh; }

/* ========== Login ========== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(196, 30, 58, 0.15) 0%, transparent 60%),
              var(--bg-dark);
  z-index: 0;
}
.login-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-box h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--gold);
}
.login-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.admin-form .form-group {
  margin-bottom: 16px;
}
.admin-form label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}
.admin-form input[type="text"],
.admin-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(40, 45, 60, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}
.admin-form input::placeholder {
  color: var(--text-muted);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox-label input { width: auto; }
.login-msg { margin-bottom: 12px; font-size: 0.9rem; min-height: 1.2em; }
.login-msg.err { color: #eb4d4b; }
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--red-main);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-submit:hover {
  background: #d42a48;
}
.back-home {
  margin-top: 20px;
  text-align: center;
}
.back-home a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-home a:hover { color: var(--gold); }

/* ========== Dashboard ========== */
.dashboard-page { display: flex; flex-direction: column; min-height: 100vh; }

.admin-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Season selector floating button (admin) - sát mép phải */
.admin-season-floating {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
}
.admin-season-toggle {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: linear-gradient(180deg, #1976ff, #0052cc);
  color: #fff;
  padding: 10px 6px;
  border-radius: 6px 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
}
.admin-season-panel {
  background: rgba(15, 18, 25, 0.98);
  border-radius: 8px;
  padding: 10px 12px;
  margin-right: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transform: translateX(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  min-width: 160px;
}
.admin-season-floating:hover .admin-season-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.admin-season-title {
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  color: #fff;
  font-weight: 600;
}
.admin-season-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-season-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.admin-season-item span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.admin-season-item strong {
  color: var(--gold);
}
.admin-season-item.current {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
}
.admin-season-add {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}
.admin-season-add:hover {
  color: #e8c547;
  text-decoration: underline;
}
.admin-logo {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-user { font-size: 0.9rem; color: var(--text-muted); }
.btn-logout {
  color: var(--red-main);
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-logout:hover { text-decoration: underline; }

.admin-layout {
  display: flex;
  flex: 1;
}
.admin-sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}
.admin-nav a {
  display: block;
  padding: 12px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.admin-nav a.admin-nav-sub {
  padding-left: 40px;
  font-size: 0.9rem;
  opacity: 0.9;
}
.admin-nav a.admin-nav-sub.active {
  opacity: 1;
}
.admin-nav a.active {
  color: var(--gold);
  border-left: 3px solid var(--red-main);
  padding-left: 21px;
}

.admin-main {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
}
.admin-main h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--text);
}
.admin-main h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-section {
  margin-bottom: 32px;
}

/* Trang form riêng (Thêm / Sửa bài viết) - khung giữa */
.admin-form-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 32px 48px;
}
.admin-form-frame {
  width: 100%;
  max-width: 1380px;
  min-height: 620px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  overflow: hidden;
}
.admin-form-frame-inner {
  padding: 32px 40px 40px;
}
.admin-form-block-wrap {
  margin-bottom: 24px;
}
.admin-form-frame-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--text);
}
.admin-form-frame-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.4;
}
.news-form-fields .form-group {
  margin-bottom: 18px;
}
.news-form-fields .form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.admin-input,
.admin-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(40, 45, 60, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.admin-textarea {
  min-height: 80px;
  resize: vertical;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-actions .btn-cancel {
  background: var(--text-muted);
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
}
.form-actions .btn-cancel:hover {
  background: #a0a0a0;
}
.btn-cancel-link {
  display: inline-block;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-cancel-link:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.05);
}
.upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-wrap .admin-input {
  flex: 1;
  min-width: 200px;
}
.btn-upload {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--red-main);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-upload:hover {
  background: var(--red-dark);
}
.ge-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ge-time-row .ge-time-input {
  flex: 1;
  max-width: 120px;
}
.btn-remove-time {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: #aaa;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-remove-time:hover {
  color: #fff;
  background: var(--red-main);
  border-color: var(--red-main);
}
.admin-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.admin-alert-success {
  background: rgba(106, 176, 76, 0.2);
  border: 1px solid #6ab04c;
  color: #8ade6a;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.action-btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--red-main);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.action-btn:hover {
  background: #d42a48;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  background: rgba(0,0,0,0.2);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a {
  color: var(--gold);
  text-decoration: none;
  margin-right: 8px;
}
.admin-table a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 12px; }
  .admin-nav a { padding: 8px 12px; }
  .admin-nav a.active { border-left: none; border-bottom: 2px solid var(--red-main); padding-left: 12px; }
}
