/* ============================================================
   TNUT - HỆ THỐNG XÉT TUYỂN ĐẠI HỌC
   CSS Chuyên nghiệp - Dark Sidebar Layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --sidebar-width: 220px;
  --sidebar-bg: #0e326c;
  --sidebar-hover: #243447;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-heading: #64748b;
  --header-bg: #ffffff;
  --header-height: 50px;
  --content-bg: #f0f4f8;
  --card-bg: #ffffff;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --text-dark: #0f172a;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --tbl-head: #f8fafc;
  --tbl-head-text: #475569;
  --tbl-row-alt: #ffffff;
  --tbl-row-hover: #f1f5f9;
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--content-bg);
  color: var(--text-dark);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-logo, .stat-value, .s-value {
  font-family: 'Outfit', sans-serif;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar-bg);
  height: 60px;
  padding: 0 24px;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand .brand-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 20px;
  height: 100%;
}

.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-link {
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover, .nav-item-dropdown:hover .nav-link {
  color: white;
  background: var(--sidebar-hover);
}

.dropdown-menu {
  position: absolute;
  top: 60px;
  left: 0;
  background: white;
  list-style: none;
  width: 240px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1010;
  padding: 8px 0;
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
}

.dropdown-menu .nav-item:hover {
  background: var(--tbl-row-hover);
  color: var(--primary);
}

.dropdown-menu .nav-item.active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.dropdown-menu .nav-icon {
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.dropdown-menu .nav-item:hover .nav-icon,
.dropdown-menu .nav-item.active .nav-icon {
  color: var(--primary);
}

/* User info */
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-user .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white; font-weight: 600;
}
.nav-user .user-name {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 500;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-wrapper {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

/* Top header bar */
.top-header {
  background: var(--header-bg);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  gap: 12px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.header-stat {
  flex: 1;
  padding: 0 16px;
  border-right: 1px solid var(--border);
}
.header-stat:first-child { padding-left: 0; }
.header-stat:last-child { border-right: none; }
.header-stat .stat-label { font-size: 10px; color: var(--text-light); font-weight: 500; margin-bottom: 1px; }
.header-stat .stat-value { font-size: 16px; font-weight: 700; color: var(--text-dark); }

/* Page content */
.page-content {
  padding: 20px;
  flex: 1;
}

/* Page title */
.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.page-title h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-dark);
}
.page-title .title-icon {
  width: 22px; height: 22px;
  color: var(--primary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafbfc;
}
.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}
.card-body { padding: 16px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead tr {
  background: var(--tbl-head);
  color: var(--tbl-head-text);
}
.data-table thead th {
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  border: none;
  letter-spacing: 0.2px;
}
.data-table thead th:first-child { border-radius: 0; }
.data-table thead th:last-child { border-radius: 0; }
.data-table thead th.text-center { text-align: center !important; }
.data-table thead th.text-right { text-align: right !important; }
.data-table thead th.text-left { text-align: left !important; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all 0.15s ease;
}
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: var(--tbl-row-hover); }
.data-table tbody td {
  padding: 8px 12px;
  vertical-align: middle;
  color: var(--text-dark);
}
.data-table tbody tr:last-child { border-bottom: none; }

/* Clickable row */
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.selected { background: #dbeafe !important; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-primary { background: #dbeafe; color: var(--primary); }
.badge-orange  { background: var(--orange-light);  color: var(--orange); }

/* Text colors */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-orange  { color: var(--orange); }
.text-muted   { color: var(--text-light); }
.text-bold    { font-weight: 700; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary { background: linear-gradient(to right, #4f46e5, #3b82f6); color: white; box-shadow: 0 2px 4px rgba(59,130,246,0.25); }
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(59,130,246,0.3); }
.btn-success { background: linear-gradient(to right, #059669, #10b981); color: white; box-shadow: 0 2px 4px rgba(16,185,129,0.25); }
.btn-success:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(16,185,129,0.3); }
.btn-warning { background: var(--warning); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-orange  { background: var(--orange); color: white; }
.btn-secondary { background: #64748b; color: white; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-lg { padding: 9px 20px; font-size: 14px; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  white-space: nowrap;
}
.form-control {
  padding: 6px 10px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text-dark);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }
.form-control-sm { padding: 4px 8px; font-size: 12px; }

input.form-control[type="text"],
input.form-control[type="number"],
input.form-control[type="email"] {
  min-width: 80px;
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 22px; height: 22px; color: white; }
.stat-card-icon.blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-card-icon.green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stat-card-icon.orange { background: linear-gradient(135deg, #ea580c, #f97316); }
.stat-card-icon.purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.stat-card-info .stat-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 2px;
}
.stat-card-info .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

/* Dashboard Summary Row (THPT / Học bạ / V-SAT) */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.summary-card {
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  color: white;
}
.summary-card.blue  { background: linear-gradient(135deg, #4f46e5, #3b82f6); box-shadow: 0 10px 15px -3px rgba(59,130,246,0.3); }
.summary-card.green { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 10px 15px -3px rgba(16,185,129,0.3); }
.summary-card.orange { background: linear-gradient(135deg, #ea580c, #f97316); box-shadow: 0 10px 15px -3px rgba(249,115,22,0.3); }
.summary-card .s-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}
.summary-card .s-value span { font-size: 14px; font-weight: 400; opacity: 0.8; }
.summary-card .s-label { font-size: 12px; opacity: 0.85; margin-top: 4px; }

/* ============================================================
   ALERTS & NOTIFICATIONS
   ============================================================ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #67e8f9; }

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: #eff6ff;
}
.upload-area svg { width: 40px; height: 40px; color: var(--text-light); margin-bottom: 10px; }
.upload-area .upload-text { font-size: 13px; color: var(--text-mid); }
.upload-area .upload-hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.upload-area input[type="file"] { display: none; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  transition: width 0.4s ease;
}
.progress-bar.success { background: linear-gradient(90deg, var(--success), #4ade80); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.open .modal-box { transform: scale(1); }

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 14px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 18px; line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--border); color: var(--text-dark); }
.modal-body { padding: 18px; }
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   INLINE FORM (Mon hoc / To hop style)
   ============================================================ */
.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.inline-form .field-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-form .field-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mid);
  white-space: nowrap;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(37,99,235,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.p-0 { padding: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 11.5px; }
.text-xs { font-size: 10.5px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-100 { width: 100%; }
.d-none { display: none; }
.d-flex { display: flex; }

/* Two column grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Table action buttons */
.tbl-actions { display: flex; gap: 4px; }

/* No data */
.no-data {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.no-data svg { width: 48px; height: 48px; margin-bottom: 12px; }
.no-data p { font-size: 13px; }

/* Scrollable table container */
.table-scroll { max-height: 420px; overflow-y: auto; }
.table-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.table-scroll::-webkit-scrollbar-track { background: var(--border); }
.table-scroll::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

/* Sticky thead */
.table-scroll .data-table thead { position: sticky; top: 0; z-index: 5; }

/* Percent text color */
.pct-green { color: #16a34a; font-weight: 700; }
.pct-red   { color: #dc2626; font-weight: 700; }

/* Number right-align */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Highlight row */
tr.highlight-row td { background: #fef9c3 !important; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 12.5px;
  max-width: 320px;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* ============================================================
   IMPORT - PROGRESS BAR & UI
   ============================================================ */

/* Info box trong trang import */
.import-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.6;
}
.import-info-box code {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* Progress area */
.import-progress-area {
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
  border: 1px solid #c7d7fe;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}

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

.progress-label {
  font-size: 13px;
  font-weight: 500;
  color: #1e40af;
}

.progress-pct {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  min-width: 54px;
  text-align: right;
}

.progress-track {
  background: #e0e7ff;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #3b82f6, #06b6d4);
  background-size: 200% 100%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: progressShimmer 2s linear infinite;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

.progress-bar-fill.done {
  background: linear-gradient(90deg, #059669, #10b981);
  animation: none;
}

.progress-bar-fill.error {
  background: linear-gradient(90deg, #dc2626, #ef4444);
  animation: none;
}

@keyframes progressShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Steps indicator */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: space-between;
}

.progress-steps .step {
  font-size: 11px;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-weight: 500;
}

.progress-steps .step.active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 0 0 2px #bfdbfe;
  animation: stepPulse 1.2s ease-in-out infinite;
}

.progress-steps .step.done {
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.progress-steps .step.error {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 600;
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 2px #bfdbfe; }
  50% { box-shadow: 0 0 0 4px #93c5fd; }
}

/* Result cards sau khi import */
.import-result {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.import-result-card {
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  transition: transform 0.2s;
  animation: resultCardIn 0.4s ease both;
}

.import-result-card:nth-child(1) { animation-delay: 0.05s; }
.import-result-card:nth-child(2) { animation-delay: 0.1s; }
.import-result-card:nth-child(3) { animation-delay: 0.15s; }
.import-result-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes resultCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.import-result-card:hover { transform: translateY(-2px); }

.import-result-card .rc-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
}

.import-result-card .rc-label {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 500;
}

.import-result-card.rc-total  { border-color: #c7d2fe; background: #eef2ff; }
.import-result-card.rc-total  .rc-value { color: #4338ca; }
.import-result-card.rc-new    { border-color: #a7f3d0; background: #ecfdf5; }
.import-result-card.rc-new    .rc-value { color: #065f46; }
.import-result-card.rc-update { border-color: #fed7aa; background: #fff7ed; }
.import-result-card.rc-update .rc-value { color: #c2410c; }
.import-result-card.rc-err    { border-color: #fca5a5; background: #fef2f2; }
.import-result-card.rc-err    .rc-value { color: #b91c1c; }

/* Error detail list */
.import-err-list {
  max-height: 160px;
  overflow-y: auto;
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.7;
}
.import-err-list::-webkit-scrollbar { width: 4px; }
.import-err-list::-webkit-scrollbar-thumb { background: #fca5a5; border-radius: 2px; }

/* Upload area khi đã có file */
.upload-area.has-file {
  border-color: var(--primary);
  background: #eff6ff;
}
.upload-area.has-file .upload-text {
  color: var(--primary);
  font-weight: 600;
}

/* Grid 4 columns */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .import-result { grid-template-columns: repeat(2, 1fr); }
  .progress-steps .step { font-size: 10px; padding: 3px 6px; }
}

@media (max-width: 768px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .import-result { grid-template-columns: 1fr 1fr; }
  .progress-steps { flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
}

/* ============================================================
   IMPORT - TOGGLE CLEAR & NOTE BOX
   ============================================================ */

/* Note box (thông báo đặc biệt về cách import) */
.import-note-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.6;
}

/* Toggle switch cho clear-before */
.clear-before-wrap {
  background: linear-gradient(135deg, #fef2f2, #fff5f5);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.clear-before-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.clear-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #991b1b;
  line-height: 1.3;
}

.clear-desc {
  display: block;
  font-size: 11px;
  color: #b45309;
  margin-top: 2px;
}

/* Toggle switch component */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch[aria-checked="true"] {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
}

.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(20px);
}


