/* Modern Enterprise Light Mode - Sư đoàn 302 Quiz System (Phong cách CĐĐH) */
:root {
  --bg-primary: #f8fafc; /* Slate 50 - Crisp, clean military command background */
  --bg-secondary: #ffffff; /* Pure White */
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  
  --text-primary: #0f172a; /* Slate 900 - High contrast */
  --text-secondary: #334155; /* Slate 700 - AAA high contrast */
  --text-muted: #475569; /* Slate 600 - WCAG AAA compliant >= 7.0:1 */
  
  /* Tactical Military Design Tokens */
  --surface-canvas: #f8fafc;
  --surface-card: #ffffff;
  --border-hairline: #e2e8f0;
  --military-navy: #1e3a8a;
  --military-navy-hover: #172554;
  --military-olive: #15803d;
  --military-crimson: #b91c1c;
  --military-amber: #d97706;
  --military-slate: #475569;

  --accent-blue: #1d4ed8; /* Navy Blue 700 */
  --accent-blue-light: #eff6ff; /* Blue 50 */
  --accent-blue-border: #bfdbfe; /* Blue 200 */
  --accent-navy: #1e3a8a;
  --header-bg: #0f172a; /* Deep Tactical Slate Command Header */
  
  --danger: #b91c1c; /* Red 700 - Tactical Crimson */
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --success: #15803d; /* Green 700 - Military Olive */
  --success-light: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #9a3412; /* Amber/Rust 800 - High contrast WCAG AA */
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #9a3412;

  --border-color: #e2e8f0; /* Slate 200 */
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

html {
  font-size: 13.5px;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.35px;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  margin: 0;
}

/* Định vị viền sáng thông minh khi thao tác bằng bàn phím (Phím Tab) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="radio"]:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Chân trang chữ mờ toàn hệ thống */
.app-global-footer {
  text-align: center;
  padding: 1.25rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.55;
  letter-spacing: 0.4px;
  user-select: none;
  font-weight: 500;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Header & Navigation Bar (Phong cách Chỉ huy Quân sự) */
.military-nav {
  background: var(--header-bg);
  border-bottom: 1px solid #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.emblem-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.emblem-icon {
  width: 42px;
  height: 42px;
  background: #ffffff;
  color: #1e3a8a;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 700;
  font-size: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: #bfdbfe;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Containers */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* Cards (Phong cách Chỉ huy Tinh gọn) */
.military-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.military-card:hover {
  border-color: #cbd5e1;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

/* Badges (Dạng thẻ chữ nhật quân sự đĩnh đạc) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.status-badge-blue {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.status-badge-green {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.status-badge-amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #9a3412;
}

.status-badge-red {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
}

/* Buttons (Nút bấm phẳng dứt khoát chuẩn chỉ huy) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.btn-primary {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
}
.btn-primary:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}
.btn-danger:hover {
  background: #991b1b;
  border-color: #991b1b;
}

.btn-gold {
  background: #9a3412;
  border-color: #9a3412;
  color: #ffffff;
}
.btn-gold:hover {
  background: #7c2d12;
  border-color: #7c2d12;
}

.btn-success {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
}
.btn-success:hover {
  background: #166534;
  border-color: #166534;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.2rem;
}
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Progress Bar (Chuẩn ARIA W3C) */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Exam Layout */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

/* Question Box */
.question-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.question-num-tag {
  background: var(--accent-blue-light);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.question-text {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1.75rem;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.option-item.selected {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.option-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.option-key {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-item.selected .option-key {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.option-label {
  font-size: 1.02rem;
  color: var(--text-primary);
  line-height: 1.55;
  margin-top: 4px;
}

/* Palette */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 1rem;
}

.palette-btn {
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  border-color: var(--accent-blue);
  background: #f8fafc;
}

.palette-btn.active {
  border: 2px solid var(--accent-blue) !important;
  color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.palette-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

.palette-btn.answered {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.palette-btn.flagged {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

/* Timer Box */
.timer-display {
  font-size: 2.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  text-align: center;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.timer-warning {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-light);
  animation: timerBlink 1s infinite;
}

@keyframes timerBlink {
  50% { opacity: 0.5; }
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: #ffffff;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.75rem 1.35rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Candidate Grid */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.candidate-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.2s ease;
}

.candidate-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.candidate-card.border-danger {
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.2);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.75rem 0;
  border: 1px solid #e2e8f0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.3s;
}

/* Modal Overlay & Violation Banner */
.violation-banner {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.violation-content {
  background: #ffffff;
  border: 2px solid var(--danger);
  padding: 2.5rem;
  border-radius: 16px;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.9rem 1.6rem;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: none;
  font-weight: 500;
}

/* Admin Sidebar Layout (Kế thừa CĐĐH Sư đoàn 302) */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 1px 0 6px rgba(0, 0, 0, 0.03);
  z-index: 110;
  flex-shrink: 0;
  transition: width 0.25s ease;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.sidebar-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.sidebar-header {
  padding: 16px 12px 14px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-brand {
  position: relative;
  overflow: hidden;
  padding: 16px 12px 14px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-brand::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  background-image: url('/assets/Logo_f302.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.10;
  pointer-events: none;
}

.sidebar-emblem {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  object-fit: contain;
}

.sidebar-system-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: 0.3px;
}

.sidebar-unit-badge {
  display: inline-block;
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #047857;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  margin-top: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 4px;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 10px 4px;
}

.sidebar-item {
  position: relative;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin: 2px 4px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
}

.sidebar-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.sidebar-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.sidebar-item.active::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: #2563eb;
}

.sidebar-item-icon {
  font-size: 1rem;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Sidebar Collapsed State (Chuẩn thu gọn 72px) */
.admin-sidebar.collapsed {
  width: 72px;
}

.admin-sidebar.collapsed .sidebar-toggle-btn {
  position: relative;
  top: auto;
  right: auto;
  margin: 0 auto 10px;
}

.admin-sidebar.collapsed .sidebar-system-title,
.admin-sidebar.collapsed .sidebar-unit-badge,
.admin-sidebar.collapsed .sidebar-section-title,
.admin-sidebar.collapsed .sidebar-item span:not(.sidebar-item-icon),
.admin-sidebar.collapsed .sidebar-footer div:first-child,
.admin-sidebar.collapsed .sidebar-footer span {
  display: none !important;
}

.admin-sidebar.collapsed .sidebar-brand {
  padding: 14px 6px 12px;
}

.admin-sidebar.collapsed .sidebar-brand::before {
  display: none;
}

.admin-sidebar.collapsed .sidebar-emblem {
  width: 38px;
  height: 38px;
  margin: 0 auto 6px;
}

.admin-sidebar.collapsed .sidebar-nav {
  padding: 10px 4px;
}

.admin-sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 12px 0;
  margin: 4px 4px;
  gap: 0;
}

.admin-sidebar.collapsed .sidebar-item-icon {
  margin: 0;
  font-size: 1.25rem;
}

.admin-sidebar.collapsed .sidebar-footer {
  padding: 12px 6px;
  text-align: center;
}

.admin-sidebar.collapsed .sidebar-footer button {
  padding: 6px;
  font-size: 0;
  width: 100%;
}

.admin-sidebar.collapsed .sidebar-footer button::before {
  content: "Thoát";
  font-size: 0.75rem;
}

@media (max-width: 1024px) {
  .admin-sidebar:not(.collapsed) {
    width: 230px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 72px;
  }
  .admin-sidebar .sidebar-toggle-btn {
    display: none;
  }
  .admin-sidebar .sidebar-system-title,
  .admin-sidebar .sidebar-unit-badge,
  .admin-sidebar .sidebar-section-title,
  .admin-sidebar .sidebar-item span:not(.sidebar-item-icon),
  .admin-sidebar .sidebar-footer div:first-child,
  .admin-sidebar .sidebar-footer span {
    display: none !important;
  }
  .admin-sidebar .sidebar-brand {
    padding: 14px 6px 12px;
  }
  .admin-sidebar .sidebar-brand::before {
    display: none;
  }
  .admin-sidebar .sidebar-emblem {
    width: 38px;
    height: 38px;
    margin: 0 auto 6px;
  }
  .admin-sidebar .sidebar-nav {
    padding: 10px 4px;
  }
  .admin-sidebar .sidebar-item {
    justify-content: center;
    padding: 12px 0;
    margin: 4px 4px;
    gap: 0;
  }
  .admin-sidebar .sidebar-footer {
    padding: 12px 6px;
    text-align: center;
  }
  .admin-sidebar .sidebar-footer button {
    padding: 6px;
    font-size: 0;
    width: 100%;
  }
  .admin-sidebar .sidebar-footer button::before {
    content: "";
    font-size: 1rem;
  }
  .admin-main {
    padding: 1rem 1rem;
  }
}

.admin-main {
  flex: 1;
  padding: 1.25rem 1.6rem;
  overflow-y: auto;
  max-height: 100vh;
  background: var(--bg-primary);
}

/* Modal form popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 620px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid #cbd5e1;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem 1.75rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   LỚP TIỆN ÍCH DÙNG CHUNG (GOM NHÓM INLINE STYLES THỦ CÔNG)
   ========================================================================== */

/* 1. Tiện ích Bố cục & Lưới (Layout & Grid Utilities) */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.flex-between-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.flex-center-gap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flex-end-gap {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* 2. Tiện ích Chữ & Tiêu đề (Typography Utilities) */
.card-title-lg {
  font-size: 1.25rem; font-weight: 700; letter-spacing: 0.3px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-title-md {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0;
}

.text-muted-sm {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

/* 3. Tiện ích Nút bấm (Button Modifiers) */
.btn-sm {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.75rem;
}

/* 4. Tiện ích Bảng dữ liệu (Table Utilities) */
.data-table-clean {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table-clean th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 9px 12px;
}

.data-table-clean td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.empty-state-cell {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* 5. Thẻ Huy hiệu Trạng thái (Status Badges) */
.badge-military {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-military.success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-military.danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-military.warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-military.info {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
}

/* 6. Khung Thống kê Điểm & Kết quả thi (Stat & Result Cards) */
.stat-box {
  background: #f8fafc;
  padding: 1.25rem 2.25rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.stat-box-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.stat-box-value {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-box-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.result-detail-box {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: left;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.8;
  margin-bottom: 1.75rem;
  border: 1px solid #e2e8f0;
}

/* 7. Tiện ích Khoảng cách (Spacing Utilities) */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ==========================================================================
   8. Phân Hệ Cập Nhật Hệ Thống & Quản Lý Sao Lưu (System Update & Backup)
   ========================================================================== */
.update-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.update-dropzone:hover, .update-dropzone.dragover {
  border-color: var(--accent-blue);
  background: #eff6ff;
}

.update-dropzone-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
}

.update-log-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.5;
  margin-top: 1rem;
}

.backup-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.15s ease;
}

.backup-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}



