/* ============================================================
   ระบบอบรมออนไลน์ - Design System (Light Theme)
   Font: Sarabun (Thai) from Google Fonts
   ============================================================ */

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

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  /* Colors */
  --primary: #3B82F6;
  --primary-light: #EFF6FF;
  --primary-dark: #1D4ED8;
  --primary-hover: #2563EB;

  --secondary: #10B981;
  --secondary-light: #ECFDF5;
  --secondary-dark: #059669;

  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #06B6D4;
  --info-light: #ECFEFF;
  --purple: #8B5CF6;
  --purple-light: #F5F3FF;

  /* Neutrals */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;

  /* Text */
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-white: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --nav-height: 64px;
  --sidebar-width: 260px;

  /* Transitions */
  --transition: all 0.2s ease;
  --transition-slow: all 0.35s ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: 'Sarabun', sans-serif; }
input, select, textarea { font-family: 'Sarabun', sans-serif; }
ul { list-style: none; }

/* ============================================================
   Typography
   ============================================================ */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.3; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.1rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ============================================================
   Layout
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.w-full { width: 100%; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card-body { padding: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); color: white; box-shadow: 0 4px 12px rgba(59,130,246,0.35); }

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: var(--secondary-dark); color: white; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-loading {
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-control:hover { border-color: var(--border-dark); }
.form-control::placeholder { color: var(--text-muted); }

.form-control.error { border-color: var(--danger); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 5px; }

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

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--secondary-light); color: var(--secondary-dark); }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-danger { background: var(--danger-light); color: #B91C1C; }
.badge-info { background: var(--info-light); color: #0E7490; }
.badge-purple { background: var(--purple-light); color: #6D28D9; }
.badge-neutral { background: var(--surface-2); color: var(--text-secondary); }

/* ============================================================
   Navigation - Top Bar
   ============================================================ */
.navbar {
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

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

.navbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.navbar-link:hover,
.navbar-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
}
.user-avatar:hover { border-color: var(--primary); }

/* ============================================================
   Sidebar Layout (Admin)
   ============================================================ */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-height));
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section { padding: 0 12px; margin-bottom: 8px; }
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-link .icon { font-size: 18px; width: 22px; text-align: center; }

.main-content {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
  min-width: 0;
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }

/* ============================================================
   Stats / KPI Cards
   ============================================================ */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}

.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: var(--secondary-light); }
.stat-icon.yellow { background: var(--warning-light); }
.stat-icon.purple { background: var(--purple-light); }
.stat-icon.red { background: var(--danger-light); }

.stat-value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 5px; font-weight: 500; }
.stat-change {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   Table
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

thead tr {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   Alerts / Toast
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.alert-success { background: var(--secondary-light); color: var(--secondary-dark); border-color: #A7F3D0; }
.alert-error { background: var(--danger-light); color: #B91C1C; border-color: #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border-color: #BFDBFE; }

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  border-left: 4px solid transparent;
  pointer-events: all;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left-color: var(--secondary); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary); }
.toast.warning { border-left-color: var(--warning); }

/* ============================================================
   Progress
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ============================================================
   Kanban Board
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}

.kanban-col {
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kanban-col-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  color: var(--text-secondary);
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kanban-card.dragging { opacity: 0.5; box-shadow: var(--shadow-md); }

.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; flex-wrap: wrap; }

.kanban-drop-zone {
  min-height: 60px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  transition: var(--transition);
}
.kanban-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Kanban column colors */
.kanban-col.enrolled .kanban-col-header { border-top: 3px solid var(--text-muted); }
.kanban-col.in-progress .kanban-col-header { border-top: 3px solid var(--primary); }
.kanban-col.waiting-exam .kanban-col-header { border-top: 3px solid var(--warning); }
.kanban-col.passed .kanban-col-header { border-top: 3px solid var(--secondary); }
.kanban-col.failed .kanban-col-header { border-top: 3px solid var(--danger); }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 50%, #FFF7ED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 36px 36px 24px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  border-bottom: 1px solid var(--border);
}

.auth-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow);
}

.auth-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-subtitle { color: var(--text-secondary); font-size: 14px; }
.auth-body { padding: 28px 36px 36px; }

/* ============================================================
   Course Cards
   ============================================================ */
.course-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-slow);
}

.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.course-thumbnail {
  height: 160px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  position: relative;
}

.course-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.course-body { padding: 18px; }
.course-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); line-height: 1.4; }
.course-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.course-meta-item { display: flex; align-items: center; gap: 4px; }
.course-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); }

/* ============================================================
   Video Player Area
   ============================================================ */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #0F172A;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* ============================================================
   PDF Viewer
   ============================================================ */
.pdf-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f0f0f0;
}

.pdf-toolbar {
  background: var(--surface-2);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pdf-embed { width: 100%; height: 600px; border: none; }

/* ============================================================
   Exam
   ============================================================ */
.exam-timer {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.timer-value { font-size: 2.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-label { font-size: 13px; opacity: 0.85; }

.question-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.question-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.question-text { font-size: 1rem; font-weight: 600; margin-bottom: 18px; line-height: 1.5; }

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
  font-size: 14px;
}

.option-item:hover { border-color: var(--primary); background: var(--primary-light); }
.option-item.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.option-item.correct { border-color: var(--secondary); background: var(--secondary-light); }
.option-item.wrong { border-color: var(--danger); background: var(--danger-light); }

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  transition: var(--transition);
}

.option-item.selected .option-letter { background: var(--primary); color: white; border-color: var(--primary); }
.option-item.correct .option-letter { background: var(--secondary); color: white; border-color: var(--secondary); }
.option-item.wrong .option-letter { background: var(--danger); color: white; border-color: var(--danger); }

/* ============================================================
   Certificate
   ============================================================ */
.certificate {
  background: linear-gradient(135deg, #FFFEF5 0%, #FFF9E6 50%, #FFFEF5 100%);
  border: 8px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-lg);
  padding: 50px 60px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg), inset 0 0 0 4px #F5D77A, 0 0 0 8px #E6A817;
  max-width: 780px;
  margin: 0 auto;
}

.certificate::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px solid #E6C76A;
  border-radius: var(--radius);
  pointer-events: none;
}

.cert-logo { margin-bottom: 20px; }
.cert-title { font-size: 2rem; font-weight: 800; color: #7C5800; margin-bottom: 8px; letter-spacing: 0.05em; }
.cert-subtitle { font-size: 1rem; color: #9B7120; margin-bottom: 28px; }
.cert-presented { font-size: 14px; color: #666; margin-bottom: 12px; }
.cert-name { font-size: 2.2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 16px; font-style: italic; }
.cert-course { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cert-score { font-size: 1rem; color: var(--secondary-dark); font-weight: 600; margin-bottom: 28px; }
.cert-signatures { display: flex; justify-content: space-around; margin-top: 32px; }
.cert-sig { text-align: center; }
.cert-sig-line { width: 140px; height: 1px; background: #aaa; margin: 8px auto 4px; }
.cert-sig-name { font-size: 14px; font-weight: 600; }
.cert-sig-title { font-size: 12px; color: #888; }
.cert-number { font-size: 12px; color: #999; margin-top: 20px; }
.cert-date { font-size: 13px; color: #777; margin-top: 6px; }

/* ============================================================
   Landing Page
   ============================================================ */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 60%, #FFF7ED 100%);
  display: flex;
  flex-direction: column;
}

.hero-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.hero-content { max-width: 640px; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title { font-size: 3rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px; color: var(--text); }
.hero-title span { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 60px; }
.feature-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature-title { font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================================
   Steps / Timeline
   ============================================================ */
.steps { display: flex; gap: 0; }
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.step::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step:last-child::after { display: none; }
.step.done::after { background: var(--secondary); }

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.step.done .step-circle { background: var(--secondary); border-color: var(--secondary); color: white; }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-light); }

.step-label { font-size: 12px; margin-top: 8px; color: var(--text-secondary); font-weight: 500; }
.step.done .step-label,
.step.active .step-label { color: var(--text); font-weight: 600; }

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; }

/* ============================================================
   Dropdown
   ============================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 150;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: var(--transition);
}
.dropdown-menu.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  transition: var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item.danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   Checkbox & Radio
   ============================================================ */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; gap: 0; }
.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer {
  from { background-position: -400px 0; }
  to { background-position: 400px 0; }
}

.fade-in { animation: fadeIn 0.3s ease; }
.fade-in-up { animation: fadeInUp 0.4s ease; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #E8EDF2 50%, var(--surface-2) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.hidden { display: none !important; }
.visible { display: block !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .kanban-board { flex-direction: column; }
  .kanban-col { max-width: 100%; min-width: unset; }
  .certificate { padding: 30px 20px; }
  h1 { font-size: 1.5rem; }
}

@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .certificate { box-shadow: none; }
}
