/* ====================================================
   LABEL CHECK APP - Enhanced Visual Design
   ===================================================
   ✓ Better depth & shadows
   ✓ Visual hierarchy
   ✓ Modern backgrounds
   ✓ Better spacing
   ===================================================== */

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

:root {
  --primary: #2563eb;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --secondary: #8b5cf6;
  --secondary-50: #faf5ff;
  --secondary-600: #8b5cf6;
  --secondary-700: #7c3aed;

  --success: #10b981;
  --success-50: #ecfdf5;
  --success-600: #059669;

  --warning: #f59e0b;
  --warning-50: #fffbeb;
  --warning-600: #d97706;

  --danger: #ef4444;
  --danger-50: #fef2f2;
  --danger-600: #dc2626;

  --info: #06b6d4;
  --info-50: #ecf0ff;
  --info-600: #0891b2;

  --teal: #0d9488;
  --teal-50: #f0fdfa;
  --teal-600: #0d9488;

  --gray-0: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-150: #ede9f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --border: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --border: #374151;
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #f9fafb 0%, #ede9f6 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

p { margin-bottom: 0.75rem; color: var(--text-secondary); }
small { font-size: 12px; color: var(--text-tertiary); }

/* ========== HEADER ========== */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.app-header .logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; color: var(--primary); text-decoration: none; }
.app-header .logo svg { width: 28px; height: 28px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #eff6ff, #f0fdfa); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; border: 2px solid var(--primary-50); }

/* ========== CONTAINER ========== */
.container { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }
.container-md { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 32px 24px; }

/* ========== CARDS ========== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-base);
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 5px 10px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-200);
  transform: translateY(-2px);
}

.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%); display: flex; align-items: center; justify-content: space-between; }
.card-header h2, .card-header h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text-primary); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--gray-50); display: flex; gap: 12px; justify-content: flex-end; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4); transform: translateY(-1px); }

.btn-success { background: linear-gradient(135deg, var(--success) 0%, #059669 100%); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.btn-success:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35); }

.btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-danger:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35); }

.btn-outline { background: var(--gray-50); color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--gray-100); border-color: var(--gray-300); color: var(--text-primary); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* Filter buttons */
.filter-btn {
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition-base);
  font-weight: 500;
}

.filter-btn:hover:not(:disabled) {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.filter-btn.active:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.form-label .required { color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--gray-50);
  transition: all var(--transition-fast);
  outline: none;
  font-family: var(--font-family);
}

.form-control::placeholder { color: var(--text-tertiary); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); background: var(--bg-primary); }

/* ========== TABLES ========== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-primary); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.data-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-bottom: 2px solid var(--border);
}

table.data-table tbody td {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  background: var(--bg-primary);
}

table.data-table tbody tr:hover td { background: rgba(37, 99, 235, 0.05); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gray { background: var(--gray-100); color: var(--gray-700); }
.badge-blue { background: var(--primary-50); color: var(--primary-700); }
.badge-yellow { background: var(--warning-50); color: var(--warning-600); }
.badge-green { background: var(--success-50); color: var(--success-600); }
.badge-red { background: var(--danger-50); color: var(--danger-600); }
.badge-teal { background: var(--teal-50); color: var(--teal-600); }

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 200ms ease-in-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== DIFF VIEW ========== */
.diff-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.diff-col { overflow: hidden; }
.diff-col-header { padding: 12px 16px; font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); }
.diff-col:first-child { border-right: 1px solid var(--border); }
.diff-col:first-child .diff-col-header { background: var(--danger-50); color: var(--danger-600); }
.diff-col:last-child .diff-col-header { background: var(--success-50); color: var(--success-600); }
.diff-content { padding: 16px; line-height: 1.8; font-family: 'Consolas', monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 600px; overflow-y: auto; background: var(--bg-primary); }
.diff-removed { background: rgba(239, 68, 68, 0.2); color: var(--danger); padding: 0 3px; border-radius: 2px; }
.diff-added { background: rgba(16, 185, 129, 0.2); color: var(--success); padding: 0 3px; border-radius: 2px; }

/* ========== LOGIN PAGE ========== */
#loginScreen {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#loginScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.4) 0%, transparent 50%);
  pointer-events: none;
}

.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1200px;
  width: 100%;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  min-height: 600px;
}

.login-brand {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: white;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-brand h2 { font-size: 28px; line-height: 1.3; margin-bottom: 16px; color: white; }
.login-brand .lead { font-size: 14px; color: rgba(255, 255, 255, 0.9); line-height: 1.7; margin-bottom: 32px; }

.login-form-panel {
  background: var(--bg-primary);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card { width: 100%; }
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: var(--primary); font-size: 24px; }
.login-logo h1 { font-size: 24px; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--text-tertiary); margin: 0; }

/* ========== DASHBOARD STATS ========== */
#statsRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-primary);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.metric::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.15) 100%);
  pointer-events: none;
}

.metric:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-200);
  transform: translateY(-3px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric.stat-yellow .metric-icon { background: linear-gradient(135deg, var(--warning-50), #fef3c7); color: var(--warning-600); }
.metric.stat-blue .metric-icon { background: linear-gradient(135deg, var(--info-50), #cffafe); color: var(--info-600); }
.metric.stat-teal .metric-icon { background: linear-gradient(135deg, var(--teal-50), #ccfbf1); color: var(--teal-600); }

/* ========== CHECKS GRID ========== */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.checks-grid .card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.checks-grid .card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 1;
  pointer-events: none;
}

.checks-grid .card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
  border-color: var(--primary-200);
}

.checks-grid .card:hover::after {
  opacity: 0.03;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-state.hidden {
  display: none;
}

/* ========== TEXT UTILITIES ========== */
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-tertiary); }
.text-center { text-align: center; }

.hidden { display: none !important; }

/* ========== FLEX UTILITIES ========== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-form-panel {
    padding: 40px 32px;
  }

  #statsRow {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .checks-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }

  .app-header {
    padding: 0 16px;
    height: 56px;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }

  .card-body {
    padding: 16px;
  }

  .login-form-panel {
    padding: 32px 20px;
  }

  #statsRow {
    grid-template-columns: repeat(2, 1fr);
  }

  .checks-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .container {
    padding: 16px 12px;
  }

  .app-header {
    padding: 0 12px;
    height: 50px;
  }

  h1 { font-size: 20px; }
  h2 { font-size: 18px; }

  .card-body {
    padding: 12px;
  }

  #statsRow {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 20px;
  }
}

/* ========== CHECK CARD (DASHBOARD) ========== */
.check-card {
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

/* Vạch nhấn mảnh phía trên (màu theo thương hiệu) — hiện rõ khi hover */
.check-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.check-card:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  border-color: var(--primary-200);
  transform: translateY(-3px);
}

.check-card:hover::before { opacity: 1; }

.cc-top {
  padding: 18px 18px 14px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  flex: 1;
}

.cc-select {
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.cc-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

.cc-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.35;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.cc-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  word-break: break-word;
}

/* Dòng thông tin phụ (người làm / người duyệt) */
.cc-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.cc-meta b { color: var(--text-primary); font-weight: 700; }
.cc-meta-ok {
  color: var(--success-600);
  background: var(--success-50);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-flex;
  margin-top: 6px;
}
.cc-meta-ok b { color: var(--success-600); }

.cc-divider { display: none; }

.cc-foot {
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fbfcfe;
}

.cc-foot > div:first-child {
  flex: 0 0 auto;
}

.cc-foot > div:first-child > div:first-child {
  font-size: 9.5px !important;
  color: var(--gray-400) !important;
}

.cc-pct {
  font-size: 19px;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cc-foot > div:last-child {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Nút trong thẻ gọn gàng hơn */
.cc-foot .btn-sm {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
}

/* ========== STEPS INDICATOR (check.html) ========== */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  gap: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 2;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  transition: all var(--transition-base);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.step.active .step-num {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50), 0 4px 10px rgba(37, 99, 235, 0.3);
  transform: scale(1.08);
}

.step.done .step-num {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border-color: var(--success);
}

.step-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  max-width: 110px;
  line-height: 1.35;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

.step-line {
  flex: 0 0 auto;
  width: 60px;
  height: 2px;
  background: var(--border);
  margin-top: 20px;
  transition: background var(--transition-base);
}

@media (max-width: 640px) {
  .step-line {
    width: 24px;
  }

  .step-label {
    font-size: 10.5px;
    max-width: 80px;
  }
}

/* ========== STATS GRID (check.html results) ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats-grid .stat-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-base);
  border-left: 4px solid var(--gray-300);
}

.stats-grid .stat-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.stats-grid .stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.stats-grid .stat-card .stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.stats-grid .stat-card.added {
  border-left-color: var(--success);
}
.stats-grid .stat-card.added .stat-value {
  color: var(--success-600);
}

.stats-grid .stat-card.removed {
  border-left-color: var(--danger);
}
.stats-grid .stat-card.removed .stat-value {
  color: var(--danger-600);
}

.stats-grid .stat-card.image-diff {
  border-left-color: var(--warning);
}
.stats-grid .stat-card.image-diff .stat-value {
  color: var(--warning-600);
}

.stats-grid .stat-card.pages {
  border-left-color: var(--info);
}
.stats-grid .stat-card.pages .stat-value {
  color: var(--info-600);
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== ALERTS ========== */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-info {
  background: var(--info-50);
  border-color: var(--info);
  color: #0e6a80;
}

.alert-success {
  background: var(--success-50);
  border-color: var(--success);
  color: var(--success-600);
}

.alert-warning {
  background: var(--warning-50);
  border-color: var(--warning);
  color: var(--warning-600);
}

.alert-danger {
  background: var(--danger-50);
  border-color: var(--danger);
  color: var(--danger-600);
}

/* ========== SIDE BY SIDE (image compare) ========== */
.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.canvas-panel {
  background: var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 10px;
}

.canvas-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.canvas-panel .diff-col-header {
  margin: -10px -10px 10px -10px;
  width: calc(100% + 20px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.canvas-panel-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.compare-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.compare-mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  padding: 3px;
  border-radius: var(--radius-lg);
}

.compare-mode-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.compare-mode-btn.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .side-by-side {
    grid-template-columns: 1fr;
  }
}

/* ========== SPINNER ========== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== PROGRESS BAR ========== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: var(--radius-lg);
  transition: width var(--transition-base);
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), #059669); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #d97706); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #dc2626); }

/* ========== UPLOAD ZONE ========== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--gray-50);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 4px var(--primary-50);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  color: var(--gray-400);
  margin: 0 auto 10px;
  display: flex;
  justify-content: center;
}

.upload-text {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.upload-zone.has-file {
  border-color: var(--success);
  background: var(--success-50);
}

.upload-zone.has-file .upload-icon { color: var(--success); }
.upload-zone.has-file .upload-text { color: var(--success-600); font-weight: 600; }

/* ========== FORM ROW ========== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .form-row-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .form-row,
  .form-row-3 { grid-template-columns: 1fr; }
}

/* ========== IMAGE COMPARE WRAPPER ========== */
.image-compare-wrapper {}

.diff-col-header.old,
.diff-col-header.new {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.diff-col-header.old { color: var(--danger-600); background: var(--danger-50); }
.diff-col-header.new { color: var(--success-600); background: var(--success-50); }

/* ========== DIFF STAT BAR ========== */
.diff-canvas-wrapper {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 12px;
}

.diff-canvas-wrapper canvas {
  max-width: 100%;
  border-radius: var(--radius);
}

.diff-stat-bar {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
}

/* ========== OVERLAY COMPARE ========== */
.overlay-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.overlay-wrapper canvas {
  max-width: 100%;
  display: block;
}

.overlay-top {
  transition: opacity 80ms linear;
}

.overlay-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 0 4px;
}

.overlay-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.overlay-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ========== SWIPE COMPARE ========== */
.swipe-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: ew-resize;
  user-select: none;
}

.swipe-wrapper canvas {
  max-width: 100%;
  display: block;
}

.swipe-old-layer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
}

.swipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
  z-index: 5;
}

.swipe-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
}

.swipe-tag {
  position: absolute;
  top: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  z-index: 4;
}

.swipe-tag-old { left: 10px; background: var(--danger); }
.swipe-tag-new { right: 10px; background: var(--success); }

/* ========== BLINK COMPARE ========== */
.blink-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
  padding: 10px;
}

.blink-wrapper canvas {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.blink-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: var(--gray-700);
}

.blink-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.blink-speed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.blink-speed input[type="range"] {
  accent-color: var(--primary);
}

/* ========== DISPATCH TABLE ========== */
.dispatch-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.dispatch-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
  background: var(--gray-50);
  border-bottom: 2px solid var(--border);
}

.dispatch-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.dispatch-table tr:last-child td { border-bottom: none; }

/* ========== SEND PANEL & LINK BOX ========== */
.send-panel {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.send-panel h3 {
  font-size: 14px;
  margin-bottom: 12px;
}

.link-box {
  display: flex;
  gap: 8px;
}

.link-box input[type="text"] {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  background: var(--bg-primary);
  color: var(--text-secondary);
}

/* ========== CORRECTIONS TABLE ========== */
.corr-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--bg-primary);
}

/* ========== PROCESSING OVERLAY ========== */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.processing-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  max-width: 380px;
  width: 90%;
}

.processing-card .spinner {
  width: 32px;
  height: 32px;
  border-width: 4px;
  margin: 0 auto 16px;
}

.processing-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.processing-card p {
  font-size: 12.5px;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.progress-step {
  font-size: 12.5px;
  color: var(--text-tertiary);
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--gray-50);
  transition: all var(--transition-base);
}

.progress-step.active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.progress-step.done {
  background: var(--success-50);
  color: var(--success-600);
}

/* ========== LOGIN BRAND PANEL EXTRAS ========== */
.login-brand-inner {
  position: relative;
  z-index: 2;
}

.login-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.lb-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.login-feats {
  list-style: none;
}

.login-feats li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.login-feats .ck {
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.login-btn {
  width: 100%;
}

.login-error {
  color: var(--danger-600);
  font-size: 12.5px;
  margin-bottom: 16px;
  padding: 9px 12px;
  background: var(--danger-50);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  text-align: center;
  min-height: 0;
}

.login-error:empty {
  display: none;
}

/* ========== REVIEW PAGE (customer-facing) ========== */
.review-header {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  padding: 36px 24px;
  text-align: center;
}

.review-header h1 {
  color: white;
  font-size: 24px;
  margin-bottom: 6px;
}

.review-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  margin: 0;
}

/* ========== APPROVAL ACTIONS ========== */
.approval-actions {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.btn-approve,
.btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
}

.btn-approve {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-approve:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-reject {
  background: var(--bg-primary);
  color: var(--danger-600);
  border: 1.5px solid var(--danger);
}

.btn-reject:hover:not(:disabled) {
  background: var(--danger-50);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.btn-approve:disabled,
.btn-reject:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== VERIFY PAGE ========== */
.verify-container {
  max-width: 480px;
  margin: 60px auto;
  padding: 0 20px;
}

.verify-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 32px;
  text-align: center;
}

.verify-approved-banner {
  background: linear-gradient(135deg, var(--success-50), #d1fae5);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  color: var(--success-600);
  font-weight: 600;
}

.verify-info {
  text-align: left;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-tertiary); font-weight: 500; }
.info-row .value { color: var(--text-primary); font-weight: 600; }

.check-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success-50), #d1fae5);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

/* ========== MISC ========== */
.w-full { width: 100%; }

/* ========== BTN TEAL ========== */
.btn-teal {
  background: linear-gradient(135deg, var(--teal) 0%, #0d9488 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-teal:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.4);
  transform: translateY(-1px);
}
