/* ============================================================
   JOBWAY AI - Main Stylesheet
   Hệ thống AI hỗ trợ hướng nghiệp, học nghề và kết nối việc làm
   ============================================================ */

/* ---- Variables ---- */
:root {
  --primary: #0052CC;
  --primary-dark: #003399;
  --primary-light: #4C9AFF;
  --secondary: #00B8D9;
  --accent: #36B37E;
  --accent2: #FF5630;
  --accent3: #FF8B00;
  --purple: #6554C0;
  --dark: #091E42;
  --gray-900: #172B4D;
  --gray-700: #344563;
  --gray-500: #5E6C84;
  --gray-300: #C1C7D0;
  --gray-100: #F4F5F7;
  --white: #FFFFFF;

  --gradient-primary: linear-gradient(135deg, #0052CC 0%, #00B8D9 100%);
  --gradient-accent: linear-gradient(135deg, #36B37E 0%, #00B8D9 100%);
  --gradient-dark: linear-gradient(135deg, #091E42 0%, #0052CC 100%);
  --gradient-warm: linear-gradient(135deg, #FF8B00 0%, #FF5630 100%);
  --gradient-purple: linear-gradient(135deg, #6554C0 0%, #0052CC 100%);

  --shadow-sm: 0 1px 3px rgba(9,30,66,0.1);
  --shadow-md: 0 4px 16px rgba(9,30,66,0.12);
  --shadow-lg: 0 8px 32px rgba(9,30,66,0.15);
  --shadow-xl: 0 20px 60px rgba(9,30,66,0.2);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Inter', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Chuẩn hóa mobile: luôn khít bề ngang màn hình, không tràn ngang gây thu/phóng */
html, body { max-width: 100%; overflow-x: hidden; }
/* Khung ảnh hero (xã/phường, AI, bài viết...) → full chiều ngang trên điện thoại */
@media (max-width: 768px) {
  .hero-side-img { flex: 0 0 100% !important; max-width: 100% !important; min-width: 0 !important; }
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; outline: none; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--dark); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p { color: var(--gray-700); }

/* ---- Layout ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.container-lg { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-lg { padding: 120px 0; }

.section-header { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,82,204,0.08); color: var(--primary);
  padding: 6px 16px; border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.5px;
  margin-bottom: 16px; text-transform: uppercase;
}
.section-title { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 16px; }
.section-title span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section-subtitle { color: var(--gray-500); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.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-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(90deg,#5C3A1E,#7A4F28);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.navbar-inner {
  display: flex; align-items: center; height: 72px; gap: 20px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 1.5rem; color: var(--dark);
}
.navbar-brand .logo-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
}
.navbar-brand .brand-name { color: var(--primary); }
.navbar-brand .brand-suffix { color: var(--secondary); font-size: 0.75rem; font-weight: 600; margin-left: 2px; }

.navbar-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-weight: 500; color: rgba(255,255,255,0.86); font-size: 0.88rem;
  transition: var(--transition); white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.14); }
.nav-link i { font-size: 0.8rem; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: white; border-radius: var(--radius); box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0,0,0,0.06); padding: 8px;
  min-width: 200px; opacity: 0; visibility: hidden;
  transition: var(--transition); z-index: 999;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; color: var(--gray-700);
  font-size: 0.9rem; transition: var(--transition);
}
.dropdown-item:hover { background: var(--gray-100); color: var(--primary); }
.dropdown-item i { width: 20px; color: var(--primary); }

.navbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.pwa-menu-item { display: none; }   /* chỉ hiện trong menu điện thoại */
.navbar-menu-btn { display: none; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; cursor: pointer;
}

/* ============================================================
   HERO SLIDESHOW
   ============================================================ */
.hero-slider {
  position: relative; margin-top: 72px;
  width: 100%;
  overflow: hidden;
  background: #eef1f5;
  aspect-ratio: 23 / 10;      /* khung cố định — không nhảy theo kích cỡ ảnh */
}
@media (max-width: 768px) {
  .hero-slider { margin-top: 60px; aspect-ratio: 16 / 11; }
}
.slide {
  display: none;
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.slide.active { display: block; }
.slide-bg {
  width: 100%;
  height: auto;
  display: block;
  background: none !important;
}
.slide-bg-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.slide-overlay {
  display: none;
}
.slide-content {
  position: relative; z-index: 2; color: white;
  max-width: 680px; padding: 0 24px;
}
.slide-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 16px; border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 600; color: #7DF9FF;
  margin-bottom: 20px; letter-spacing: 0.5px;
}
.slide-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15;
  color: white; margin-bottom: 16px;
}
.slide-title span { color: #7DF9FF; }
.slide-description {
  font-size: 1.1rem; color: rgba(255,255,255,0.85);
  margin-bottom: 32px; max-width: 520px; line-height: 1.7;
}
.slide-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* Slider controls */
.slider-controls {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 10;
}
.slider-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.6); cursor: pointer;
  transition: var(--transition); border: 1px solid rgba(0,0,0,0.2);
}
.slider-dot.active { background: var(--primary); width: 28px; border-radius: 4px; border-color: var(--primary); }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.12); color: var(--dark);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); font-size: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.slider-arrow:hover { background: white; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.slider-arrow.prev { left: 16px; }
.slider-arrow.next { right: 16px; }

/* Slide stats overlay */
.slide-stats {
  position: absolute; bottom: 40px; right: 60px; z-index: 10;
  display: flex; gap: 24px;
}
.slide-stat {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 16px 24px; border-radius: var(--radius);
  text-align: center; color: white;
}
.slide-stat .stat-value { font-size: 1.75rem; font-weight: 800; color: #7DF9FF; }
.slide-stat .stat-label { font-size: 0.8rem; opacity: 0.8; margin-top: 2px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; border: 2px solid transparent;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-primary); color: white;
  box-shadow: 0 4px 15px rgba(0,82,204,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,82,204,0.45); color: white; }
.btn-outline {
  background: transparent; color: white;
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; color: white; }
.btn-white {
  background: white; color: var(--primary);
  box-shadow: var(--shadow-md);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-accent {
  background: var(--gradient-accent); color: white;
  box-shadow: 0 4px 15px rgba(54,179,126,0.35);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(54,179,126,0.45); color: white; }
.btn-sm { padding: 8px 20px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--accent2); color: white; }
.btn-danger:hover { background: #E04020; color: white; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

/* Course Card */
.course-card { cursor: pointer; }
.course-card .card-thumbnail {
  position: relative; height: 200px; overflow: hidden;
}
.course-card .card-thumbnail img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.course-card:hover .card-thumbnail img { transform: scale(1.08); }
.course-card .card-badge {
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 6px;
}
.course-card .free-badge {
  background: var(--accent); color: white;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
}
.course-card .card-body { padding: 20px; }
.course-card .card-category {
  font-size: 0.8rem; color: var(--primary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.course-card .card-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card .card-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.8rem; color: var(--gray-500); margin-bottom: 12px;
}
.course-card .card-meta span { display: flex; align-items: center; gap: 4px; }
.course-card .card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--gray-100);
}

/* Thẻ đối tác: kích cỡ bằng nhau, tên dài ngắt xuống 2 dòng */
.partner-card { width: 190px; min-height: 190px; justify-content: center; }
.partner-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30,64,124,0.16) !important; }
.partner-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.3em;
}
@media (max-width: 600px) {
  .partner-card { min-height: 168px; }
}

/* Thẻ đối tác trên điện thoại: 2 cột đều nhau, chữ tự xuống hàng vừa thẻ */
@media (max-width: 600px) {
  .partners-wrap { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px !important; }
  .partners-wrap .partner-card { min-width: 0 !important; width: auto !important; padding: 14px 8px !important; }
  .partners-wrap .partner-name { font-size: 0.8rem !important; line-height: 1.2; word-break: break-word; overflow-wrap: anywhere; }
}

/* Thẻ khóa học GỌN trên điện thoại: icon bên trái, thông tin bên phải */
@media (max-width: 700px) {
  .course-card { display: flex; flex-wrap: wrap; align-items: stretch; }
  .course-card .card-thumbnail {
    flex: 0 0 108px; width: 108px; height: auto; min-height: 108px; align-self: stretch;
  }
  .course-card .card-thumbnail > div { font-size: 1.9rem !important; }
  .course-card .card-badge { top: 8px; left: 8px; }
  .course-card .card-body { flex: 1; min-width: 0; padding: 12px 14px; }
  .course-card .card-category { font-size: 0.72rem; margin-bottom: 4px; }
  .course-card .card-title { font-size: 0.95rem; margin-bottom: 6px; -webkit-line-clamp: 2; }
  .course-card .card-body > div { margin-bottom: 6px !important; }
  .course-card .card-meta { gap: 12px; margin-bottom: 0; font-size: 0.76rem; }
  .course-card .card-footer { flex-basis: 100%; order: 3; padding: 10px 14px; }
}

/* Job Card */
.job-card { cursor: pointer; }
.job-card .card-body { padding: 20px; }
.job-card .company-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.job-card .company-logo {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100); object-fit: contain; padding: 4px;
  background: var(--gray-100);
}
.job-card .job-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: var(--dark); }
.job-card .company-name { font-size: 0.85rem; color: var(--gray-500); }
.job-card .job-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.job-card .salary { font-weight: 700; color: var(--accent); font-size: 0.95rem; }
.job-card .urgent-badge {
  background: rgba(255,86,48,0.1); color: var(--accent2);
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
}

/* Product Card */
.product-card { cursor: pointer; }
.product-card .card-thumbnail {
  position: relative; height: 220px; overflow: hidden; background: var(--gray-100);
}
.product-card .card-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .card-thumbnail img { transform: scale(1.06); }
.product-card .ocop-badge {
  position: absolute; top: 12px; right: 12px;
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: white; padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; gap: 4px;
}
.product-card .card-body { padding: 16px; }
.product-card .product-name { font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.product-card .product-price { color: var(--accent2); font-weight: 800; font-size: 1.1rem; }
.product-card .original-price { color: var(--gray-300); text-decoration: line-through; font-size: 0.85rem; }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.3px;
}
.badge-primary { background: rgba(0,82,204,0.1); color: var(--primary); }
.badge-success { background: rgba(54,179,126,0.1); color: #1a7a4a; }
.badge-warning { background: rgba(255,139,0,0.1); color: #B05B00; }
.badge-danger { background: rgba(255,86,48,0.1); color: var(--accent2); }
.badge-secondary { background: var(--gray-100); color: var(--gray-700); }
.badge-info { background: rgba(0,184,217,0.1); color: #006080; }
.badge-purple { background: rgba(101,84,192,0.1); color: var(--purple); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 0.8rem; color: var(--gray-700);
  background: var(--gray-100); border: 1px solid var(--gray-300);
  transition: var(--transition);
}
.tag:hover { background: rgba(0,82,204,0.08); color: var(--primary); border-color: var(--primary-light); }
.tag i { font-size: 0.7rem; }

/* ============================================================
   STATS SECTION
   ============================================================ */
.stats-section {
  background: var(--gradient-dark);
  padding: 60px 0;
  position: relative; overflow: hidden;
}
.stats-section::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.stat-card {
  text-align: center; padding: 32px 20px;
  border-radius: var(--radius); position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.stat-icon {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 1.4rem; color: white;
}
.stat-value {
  font-size: 2.5rem; font-weight: 800; color: white;
  line-height: 1; margin-bottom: 6px;
}
.stat-label { color: rgba(255,255,255,0.65); font-size: 0.9rem; }
@media (max-width: 768px) {
  .stats-section .grid-4 { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .stat-card { padding: 14px 8px; border-radius: 12px; }
  .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; margin: 0 auto 8px; }
  .stat-value { font-size: 1.5rem; margin-bottom: 2px; }
  .stat-label { font-size: 0.72rem; }
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.category-card {
  background: white; border-radius: var(--radius);
  padding: 24px 16px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.06);
  transition: var(--transition); cursor: pointer;
}
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.category-icon {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 1.4rem; color: white;
}
.category-name { font-weight: 700; font-size: 0.9rem; color: var(--dark); margin-bottom: 4px; }
.category-count { font-size: 0.8rem; color: var(--gray-500); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--gray-700); }
.form-label .required { color: var(--accent2); margin-left: 3px; }
.form-control {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300); font-size: 0.95rem;
  transition: var(--transition); color: var(--dark);
  background: white;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,82,204,0.1); }
.form-control::placeholder { color: var(--gray-300); }
.input-group { position: relative; }
.input-group .form-control { padding-left: 44px; }
.input-group .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-500); font-size: 0.9rem;
}
.input-group .input-suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--gray-500);
}
.form-error { color: var(--accent2); font-size: 0.82rem; margin-top: 4px; }
.form-hint { color: var(--gray-500); font-size: 0.82rem; margin-top: 4px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 0.9rem; position: relative;
}
.alert-success { background: #E3FCEF; color: #006644; border-left: 4px solid #36B37E; }
.alert-error, .alert-danger { background: #FFEBE6; color: #BF2600; border-left: 4px solid #FF5630; }
.alert-warning { background: #FFFAE6; color: #8B5000; border-left: 4px solid #FF8B00; }
.alert-info { background: #E6FCFF; color: #006080; border-left: 4px solid #00B8D9; }
.alert-close {
  position: absolute; right: 12px; top: 12px;
  background: none; border: none; cursor: pointer;
  opacity: 0.5; font-size: 0.85rem;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  display: flex; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-xl); overflow: hidden;
  border: 2px solid transparent;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar input {
  flex: 1; padding: 16px 20px; border: none; font-size: 1rem;
  background: transparent; color: var(--dark);
}
.search-bar select {
  padding: 16px; border: none; border-right: 1px solid var(--gray-100);
  background: var(--gray-100); color: var(--gray-700); cursor: pointer;
  font-size: 0.9rem;
}
.search-bar .btn { border-radius: 0; padding: 16px 28px; }

/* ============================================================
   SIDEBAR FILTERS
   ============================================================ */
.sidebar-filter { background: white; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.06); }
.filter-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100); }
.filter-group { margin-bottom: 20px; }
.filter-group-title { font-size: 0.85rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.filter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; cursor: pointer;
}
.filter-checkbox { display: flex; align-items: center; gap: 10px; }
.filter-checkbox input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.filter-count { font-size: 0.78rem; color: var(--gray-500); background: var(--gray-100); padding: 2px 8px; border-radius: var(--radius-full); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress { background: var(--gray-100); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width 0.8s ease;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs { border-bottom: 2px solid var(--gray-100); margin-bottom: 32px; display: flex; gap: 0; }
.tab {
  padding: 12px 24px; font-weight: 600; font-size: 0.9rem;
  color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition); display: flex; align-items: center; gap: 8px;
}
.tab.active { color: var(--primary); border-color: var(--primary); }
.tab:hover { color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9,30,66,0.7);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: white; border-radius: var(--radius-lg); width: 100%;
  max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl); transform: translateY(20px); transition: var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.25rem; font-weight: 700; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-100); border: none; cursor: pointer; font-size: 1rem; color: var(--gray-700); display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 0 28px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--dark); color: rgba(255,255,255,0.75); padding: 80px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1.1fr; gap: 44px; margin-bottom: 60px; }
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; max-width: 320px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); color: white; }
.footer-heading { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 20px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.9rem; transition: var(--transition); display: flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--secondary); padding-left: 4px; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: 0.9rem; }
.footer-contact-item i { color: var(--secondary); margin-top: 2px; width: 16px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 32px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.85rem; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.footer-bottom-links a:hover { color: white; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; background: var(--gray-100); }
.cm-split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
.admin-mobile-toggle { display: none; }
@media (max-width: 992px) {
  .cm-split { grid-template-columns: 1fr; }
  .admin-mobile-toggle { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 1200;
    width: 44px; height: 44px; border-radius: 10px; border: 0; cursor: pointer;
    background: var(--primary); color: #fff; align-items: center; justify-content: center; font-size: 1.1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.2); }
  .admin-sidebar { z-index: 1150; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .admin-header { padding-left: 64px; }
}
.admin-sidebar {
  width: 260px; background: var(--dark); position: fixed;
  top: 0; left: 0; height: 100vh; z-index: 200;
  display: flex; flex-direction: column; overflow-y: auto;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px; color: white;
}
.sidebar-logo .logo-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.sidebar-logo .logo-text { font-weight: 800; font-size: 1.1rem; color: white; }
.sidebar-logo .logo-sub { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-section-title { font-size: 0.7rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 1px; padding: 12px 20px 6px; font-weight: 700; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: rgba(255,255,255,0.65);
  font-size: 0.9rem; transition: var(--transition); position: relative;
}
.sidebar-link:hover { color: white; background: rgba(255,255,255,0.06); }
.sidebar-link.active { color: white; background: rgba(0,82,204,0.3); }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary-light); border-radius: 0 3px 3px 0; }
.sidebar-link .badge { margin-left: auto; font-size: 0.7rem; }
.sidebar-link i { width: 20px; text-align: center; font-size: 0.95rem; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; color: white; }
.sidebar-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.sidebar-user-name { font-size: 0.875rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.admin-main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-header {
  background: white; border-bottom: 1px solid var(--gray-100);
  padding: 16px 32px; position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.admin-header-title { font-size: 1.15rem; font-weight: 700; }
.admin-content { padding: 32px; flex: 1; }

/* Admin Dashboard Cards */
.dashboard-card {
  background: white; border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 20px;
  transition: var(--transition);
}
.dashboard-card:hover { box-shadow: var(--shadow-md); }
.dashboard-card-icon {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: white; flex-shrink: 0;
}
.dashboard-card-value { font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1; }
.dashboard-card-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }
.dashboard-card-trend { font-size: 0.8rem; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.trend-up { color: var(--accent); }
.trend-down { color: var(--accent2); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex;
  background: var(--gray-100);
}
.auth-visual {
  width: 50%; background: var(--gradient-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 48px; position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(0,82,204,0.4) 0%, transparent 70%);
}
.auth-form-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth-form-card {
  background: white; border-radius: var(--radius-lg);
  padding: 32px 40px; box-shadow: var(--shadow-xl); width: 100%; max-width: 480px;
}
.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { color: var(--gray-500); margin-bottom: 22px; }

/* ============================================================
   CERTIFICATE  — Landscape, Vietnamese formal style
   ============================================================ */
.certificate-wrapper {
  background: linear-gradient(160deg,#fffef8 0%,#fdf8e4 55%,#fffdf5 100%);
  border: 5px solid #1a2a6c;
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  overflow: hidden;
  font-family: 'Be Vietnam Pro', sans-serif;
  /* Force landscape ratio ~A4 */
  aspect-ratio: 1.414 / 1;
  display: flex;
  flex-direction: column;
}
/* No inner border */
.certificate-wrapper::before {
  content: none;
}
/* Watermark */
.certificate-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212,175,55,.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.cert-top-stripe,
.cert-bottom-stripe { background: #1a2a6c; height: 6px; width: 100%; flex-shrink: 0; }

.cert-body {
  flex: 1;
  padding: 18px 36px 14px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ── Header ─────────────────────────────────── */
.cert-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}
.cert-logo-box {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg,#1a2a6c,#2684FF);
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #D4AF37;
  flex-shrink: 0;
  color: white; font-size: 1.3rem;
}
.cert-org-block { text-align: left; line-height: 1.4; }
.cert-org-name  { font-size: .95rem; font-weight: 900; color: #1a2a6c; letter-spacing: .2px; }
.cert-org-sub   { font-size: .68rem; color: #6b7280; }

/* ── Divider ─────────────────────────────────── */
.cert-gold-line {
  height: 2px;
  background: linear-gradient(to right, transparent, #D4AF37 20%, #D4AF37 80%, transparent);
  margin: 5px 0;
}

/* ── Middle block ───────────────────────────── */
.cert-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* Titles */
.cert-main-title {
  font-size: 2rem; font-weight: 900; color: #C0001A;
  letter-spacing: 5px; text-align: center;
  line-height: 1; margin-bottom: 2px;
}
.cert-en-title {
  font-size: .85rem; font-weight: 700; color: #D4AF37;
  letter-spacing: 4px; text-align: center; margin-bottom: 3px;
}
.cert-certify-label {
  font-size: .75rem; color: #6b7280; text-align: center;
  font-style: italic; margin-bottom: 5px;
}

/* Recipient name */
.cert-name {
  font-size: 1.65rem; font-weight: 900; color: #0d1b2a;
  text-align: center; letter-spacing: 3px;
  text-transform: uppercase; margin: 4px 0 8px;
}

/* Two-column info row */
.cert-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 24px;
  font-size: .75rem;
  color: #374151;
  margin-bottom: 6px;
  padding: 0 12px;
}
.cert-info-row b { color: #0d1b2a; }

/* Completion */
.cert-completion-vn {
  font-size: .82rem; font-weight: 800; color: #0d1b2a;
  text-align: center; text-transform: uppercase;
  letter-spacing: 1.2px; margin-bottom: 1px;
}
.cert-completion-en {
  font-size: .7rem; font-weight: 600; color: #374151;
  text-align: center; font-style: italic; margin-bottom: 4px;
}
.cert-course-name {
  font-size: .92rem; font-weight: 800; color: #1a2a6c;
  text-align: center;
}

/* ── Bottom section ──────────────────────────── */
.cert-bottom-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
  gap: 12px;
}

/* Left: ref numbers */
.cert-refs { font-size: .65rem; color: #6b7280; font-style: italic; line-height: 1.7; }
.cert-refs b { color: #374151; font-style: normal; }

/* Right: signature block */
.cert-sign-block { text-align: center; min-width: 160px; }
.cert-sign-place  { font-size: .7rem; color: #6b7280; font-style: italic; margin-bottom: 2px; }
.cert-sign-title  { font-size: .78rem; font-weight: 900; color: #0d1b2a; letter-spacing: 1px; margin-bottom: 0; }
.cert-sign-img    { height: 92px; max-width: 200px; object-fit: contain; display: block; margin: 2px auto; }
/* Signature + overlapping stamp */
.cert-sign-sig-row {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}
.cert-sign-stamp  {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid #C0001A;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.75);
  position: absolute;
  right: -20px;
  bottom: 40px;
}
.cert-sign-stamp span { font-size: .4rem; font-weight: 700; color: #C0001A; line-height: 1.5; text-align: center; }
.cert-sign-name   { font-size: .72rem; font-weight: 700; color: #0d1b2a; border-top: 1px solid #d1d5db; padding-top: 3px; margin-top: 2px; }

/* validity badge */
.cert-valid-badge { font-size: .65rem; }

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-container { max-width: 800px; margin: 0 auto; }
.quiz-header {
  background: var(--gradient-primary); color: white;
  padding: 32px; border-radius: var(--radius) var(--radius) 0 0; text-align: center;
}
.quiz-timer {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 1.5rem; font-weight: 800; margin-top: 12px;
}
.quiz-timer.warning { color: #FF8B00; }
.quiz-timer.danger { color: #FF5630; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.quiz-progress-bar {
  height: 6px; background: rgba(255,255,255,0.2); border-radius: 0;
}
.quiz-question { background: white; padding: 32px; border-bottom: 1px solid var(--gray-100); }
.question-number { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }
.question-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 24px; }
.answer-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm); cursor: pointer;
  margin-bottom: 10px; transition: var(--transition);
}
.answer-option:hover { border-color: var(--primary-light); background: rgba(0,82,204,0.04); }
.answer-option.selected { border-color: var(--primary); background: rgba(0,82,204,0.06); }
.answer-option.correct { border-color: var(--accent); background: rgba(54,179,126,0.06); }
.answer-option.wrong { border-color: var(--accent2); background: rgba(255,86,48,0.06); }
.answer-radio {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--gray-300); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.answer-option.selected .answer-radio { border-color: var(--primary); background: var(--primary); }
.answer-option.selected .answer-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: white; }

/* ============================================================
   STAR RATING
   ============================================================ */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating .fa-star { color: #F59E0B; font-size: 0.85rem; }
.star-rating .fa-star-half-alt { color: #F59E0B; font-size: 0.85rem; }
.star-rating .far.fa-star { color: var(--gray-300); font-size: 0.85rem; }
.rating-value { font-weight: 700; color: var(--dark); font-size: 0.85rem; margin-left: 4px; }
.rating-count { color: var(--gray-500); font-size: 0.8rem; margin-left: 2px; }

/* ============================================================
   RESPONSIVE — Mobile First
   ============================================================ */

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
  .footer-grid > *:last-child { grid-column: 1 / -1; }
}

@media (max-width: 992px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .slide-stats { display: none; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .auth-visual { display: none; }
}

@media (max-width: 768px) {
  .navbar { height: 60px; }
  .navbar-inner { height: 60px; gap: 8px; }
  /* Nút Đăng nhập/Đăng ký trên điện thoại: chỉ hiện icon, ẩn chữ */
  .navbar-actions { gap: 8px; }
  .navbar-actions .btn { padding: 9px 12px !important; font-size: 1.05rem; line-height: 1; }
  .navbar-actions .btn i { display: inline-block; margin: 0; }
  .navbar-actions .btn .btn-label { display: none; }
  .navbar-brand .brand-name { font-size: 1.15rem; }
  .navbar-brand > div > div { display: none; }
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: #fff; padding: 12px 14px; z-index: 1090;
    overflow-y: auto; gap: 2px;
  }
  /* Mọi mục canh trái, chiếm trọn chiều ngang */
  .navbar-nav.open > .nav-link,
  .navbar-nav.open > .nav-item.dropdown { width: 100%; }
  .navbar-nav.open .nav-link,
  .navbar-nav.open .dropdown-item {
    justify-content: flex-start; text-align: left; width: 100%;
  }
  /* Menu CHA (cấp 1): màu nâu, đậm hơn */
  .navbar-nav.open > .nav-link,
  .navbar-nav.open > .nav-item.dropdown > .nav-link {
    color: #6B4423; font-weight: 700; font-size: 0.98rem;
    padding: 13px 12px; border-radius: 10px; letter-spacing: .1px;
  }
  .navbar-nav.open > .nav-link i:first-child,
  .navbar-nav.open > .nav-item.dropdown > .nav-link i:first-child { color: #8A5A2B; width: 22px; text-align: center; }
  .navbar-nav.open .nav-link:hover, .navbar-nav.open .nav-link.active { background: rgba(122,79,40,.08); }
  /* Đường kẻ mảnh ngăn các nhóm cha */
  .navbar-nav.open > .nav-item.dropdown + .nav-link,
  .navbar-nav.open > .nav-link + .nav-item.dropdown,
  .navbar-nav.open > .nav-item.dropdown + .nav-item.dropdown { border-top: 1px solid var(--gray-100); margin-top: 2px; padding-top: 2px; }
  /* Submenu mở sẵn (accordion) — lệch nhẹ so với lề */
  .navbar-nav.open .nav-item.dropdown { flex-direction: column; align-items: stretch; }
  .navbar-nav.open .dropdown-menu {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; background: transparent; padding: 2px 0 8px 14px; min-width: 0;
    display: flex; flex-direction: column; border: 0; border-left: 2px solid var(--gray-100); margin: 0 0 4px 14px;
  }
  .navbar-nav.open .dropdown-menu .dropdown-item {
    color: var(--gray-600); padding: 10px 12px; font-size: 0.9rem; border-radius: 8px; font-weight: 500;
  }
  .navbar-nav.open .dropdown-menu .dropdown-item i:first-child { color: var(--primary); width: 20px; text-align: center; }
  .navbar-nav.open .dropdown-menu .dropdown-item:hover { background: rgba(0,82,204,.06); color: var(--primary); }
  .navbar-nav.open .nav-item.dropdown > .nav-link .fa-chevron-down { display: none; }
  .navbar-nav.open .pwa-menu-item { display: flex; color: #0052CC; font-weight: 700; }
  .navbar-menu-btn { display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; color: #fff; background: rgba(255,255,255,0.14); border: 0; order: -1; }
  .navbar-brand { order: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  /* Footer gọn trên điện thoại: chỉ 2 cột "Về chúng tôi" và "Thông tin liên hệ" */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 18px !important; }
  .footer-grid > *:nth-child(1), .footer-grid > *:nth-child(2), .footer-grid > *:nth-child(3) { display: none !important; }
  .footer-grid > *:last-child { grid-column: auto !important; }
  .footer-app { display: none !important; }
  .footer-bottom { display: none !important; }
  .footer-heading { margin-bottom: 12px; }
  .section { padding: 48px 0; }
  .section-header { margin-bottom: 32px; }
  .container { padding: 0 16px; }
  .card:hover { transform: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .footer { padding: 40px 0 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }
  .auth-page { flex-direction: column; }
  .auth-form-area { padding: 20px 16px; }
  .auth-form-card { padding: 24px 18px; }
  .ai-chat-btn { bottom: calc(120px + env(safe-area-inset-bottom)); right: 14px; width: 44px; height: 44px; font-size: 1.1rem; z-index: 998; }
  .back-to-top { bottom: calc(122px + env(safe-area-inset-bottom)); right: 66px; width: 40px; height: 40px; font-size: 0.9rem; z-index: 998; }
  .ai-chat-popup { right: 10px; left: 10px; width: auto; max-width: none; top: 68px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 998; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .btn-lg { padding: 13px 18px; font-size: 0.92rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .section-title { font-size: 1.45rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }
  .navbar-brand .logo-icon { width: 36px; height: 36px; font-size: 1rem; }
}

/* ══════════════════════════════════════════════
   AI ADVISOR — MOBILE TABS
══════════════════════════════════════════════ */
.ai-tabs { display: none; }
@media (max-width: 768px) {
  .ai-tabs {
    display: flex; gap: 8px; margin-bottom: 20px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 5px;
  }
  .ai-tab {
    flex: 1; padding: 10px 12px; border: 0; border-radius: 8px;
    background: transparent; color: rgba(255,255,255,0.7);
    font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  }
  .ai-tab.active { background: var(--gradient-primary); color: #fff; }
  .ai-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
  .ai-panel { display: none; }
  .ai-panel.active { display: block; }
}

/* ══════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION (App-style)
══════════════════════════════════════════════ */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 997;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.09);
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
    height: auto;
    min-height: 64px;
    box-sizing: content-box;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
  }
  .mob-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    color: var(--gray-500);
    font-size: 0.6rem; font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
    padding: 6px 2px;
    border: none; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-nav-item i { font-size: 1.2rem; transition: transform 0.2s ease; }
  .mob-nav-item.active { color: var(--primary); }
  .mob-nav-item.active i { transform: translateY(-2px); }
  .mob-nav-item.active::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }
  .mob-nav-item.mob-nav-ai { color: var(--gray-500); }
  .mob-ai-circle {
    width: 46px; height: 46px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: white;
    box-shadow: 0 4px 14px rgba(54,179,126,0.4);
    margin-top: -14px; margin-bottom: 2px;
    border: 3px solid white;
    transition: transform 0.2s ease;
  }
  .mob-nav-item.mob-nav-ai:active .mob-ai-circle { transform: scale(0.92); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.animate-up { animation: fadeInUp 0.6s ease forwards; }
.animate-left { animation: fadeInLeft 0.6s ease forwards; }
.animate-scale { animation: scaleIn 0.5s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--accent2); }
.text-muted { color: var(--gray-500); }
.text-white { color: white; }
.text-dark { color: var(--dark); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fs-sm { font-size: 0.875rem; }
.fs-lg { font-size: 1.1rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.pt-0 { padding-top: 0; }
.d-none { display: none; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.shadow { box-shadow: var(--shadow-md); }
.bg-light { background: var(--gray-100); }
.bg-white { background: white; }
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 24px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* Loading Spinner */
.spinner {
  width: 40px; height: 40px; border: 4px solid var(--gray-100);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}

/* Pagination */
.pagination-nav { display: flex; justify-content: center; margin-top: 48px; }
.pagination { display: flex; gap: 6px; }
.pagination li { list-style: none; }
.pagination li a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100); font-weight: 600; font-size: 0.9rem;
  color: var(--gray-700); transition: var(--transition);
}
.pagination li a:hover, .pagination li.active a { background: var(--primary); color: white; border-color: var(--primary); }

/* Back to top */
.back-to-top {
  position: fixed; bottom: 32px; right: 100px; z-index: 500;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; visibility: hidden; transition: var(--transition);
  border: none;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-4px); }

/* AI Chat Widget */
.ai-chat-btn {
  position: fixed; bottom: 32px; right: 32px; z-index: 500;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient-accent); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); cursor: pointer; font-size: 1.3rem;
  border: none; transition: var(--transition);
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ai-chat-popup {
  position: fixed; top: 84px; bottom: 24px; right: 32px; z-index: 500;
  width: 380px; max-width: calc(100vw - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: var(--transition); border: 1px solid rgba(0,0,0,0.06);
}
.ai-chat-popup.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ai-chat-header {
  background: var(--gradient-primary); color: white;
  padding: 16px 20px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; align-items: center; gap: 12px;
}
.ai-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.ai-messages { padding: 16px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ai-message { display: flex; gap: 8px; align-items: flex-start; }
.ai-message.user { flex-direction: row-reverse; }
.ai-bubble {
  background: var(--gray-100); padding: 10px 14px; border-radius: var(--radius);
  max-width: 80%; font-size: 0.875rem; line-height: 1.5;
}
.ai-message.user .ai-bubble { background: var(--primary); color: white; }
.ai-input { padding: 12px; border-top: 1px solid var(--gray-100); display: flex; gap: 8px; }
.ai-input input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--gray-100); border-radius: var(--radius-full); font-size: 0.875rem; }

/* ══════════════════════════════════════════════
   FIX: nút tròn nổi phải nằm TRÊN thanh nav mobile
   (đặt cuối file để thắng thứ tự nguồn CSS)
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Ẩn nút chatbot nổi trên mobile (đã dùng nút AI giữa footer) */
  .ai-chat-btn {
    display: none !important;
  }
  .back-to-top {
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    right: 12px !important;
    z-index: 998 !important;
  }
  /* Nút AI giữa footer: dùng ảnh chatbot.png */
  .mob-ai-circle {
    overflow: hidden !important;
    padding: 0 !important;
  }
  .mob-ai-circle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
  }
  .ai-chat-popup {
    top: 68px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    right: 0 !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
    z-index: 998 !important;
  }
}

/* ══════════════════════════════════════════════
   TRANG TIN TỨC — gọn gàng trên mobile
══════════════════════════════════════════════ */
.news-cat-select { display: none; }

@media (max-width: 768px) {
  /* Danh mục: dropdown thay cho hàng nút */
  .news-cat-select {
    display: block;
    width: 100%;
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 12px;
  }
  .news-cat-chips { display: none !important; }

  /* Tin nổi bật: 1 cột, ảnh gọn, ẩn cột phụ + newsletter */
  .news-featured {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin-bottom: 26px !important;
  }
  .news-side { display: none !important; }
  .news-main-cover { height: 210px !important; padding: 18px !important; }
  .news-main-cover h2 { font-size: 1.12rem !important; line-height: 1.4 !important; }

  /* Các tin còn lại: danh sách chỉ tiêu đề */
  .news-grid {
    display: block !important;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  }
  .news-card {
    border: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.07) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    margin: 0 !important;
  }
  .news-card:last-child { border-bottom: 0 !important; }
  .news-card:active { background: var(--gray-100) !important; }
  .news-card-img { display: none !important; }
  .news-card-body {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
    padding: 13px 15px !important;
  }
  .news-card-dot { display: block !important; }
  .news-card-title {
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
    margin-bottom: 3px !important;
  }
  .news-card-excerpt { display: none !important; }
  .news-card-author { display: none !important; }
  .news-card-views { display: none !important; }
  .news-card-meta { justify-content: flex-start !important; margin-top: 2px; }
  .news-card-chev { display: block !important; }
}

/* ══════════════════════════════════════════════
   FOOTER — 3 nút tải app
   Desktop: cùng một hàng · Mobile: xếp dọc
══════════════════════════════════════════════ */
.footer-app-btns { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 768px) {
  .footer-app-btns { flex-direction: column; }
}
@media (min-width: 769px) {
  .footer-app-btns { flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
  .footer-app-btns > a { flex: 1 1 0; min-width: 0; padding: 8px 10px !important; gap: 8px !important; }
}

/* ══════════════════════════════════════════════
   TRANG DOANH NGHIỆP — thẻ loại DN: 2 thẻ/hàng trên mobile
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ent-types-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .ent-types-grid .card { padding: 18px 10px !important; }
  .ent-types-grid .card > div:first-child { width: 52px !important; height: 52px !important; font-size: 1.2rem !important; margin-bottom: 12px !important; }
  .ent-types-grid .card > div:nth-child(2) { font-size: 1.35rem !important; }
  .ent-types-grid .card h3 { font-size: 0.9rem !important; }
  .ent-types-grid .card p { font-size: 0.72rem !important; }
}

/* ══════════════════════════════════════════════
   CHI TIẾT VIỆC LÀM — 2 tab trên mobile
══════════════════════════════════════════════ */
.jd-tabs { display: none; }

@media (max-width: 768px) {
  .jd-tabs {
    display: flex; gap: 8px; margin-bottom: 16px;
    position: sticky; top: 64px; z-index: 60;
    background: var(--gray-100); padding: 8px 0;
  }
  .jd-tab {
    flex: 1; padding: 11px 8px;
    border: 1.5px solid var(--gray-300); background: #fff;
    border-radius: 10px; font-weight: 700; font-size: 0.9rem;
    color: var(--gray-600); cursor: pointer;
  }
  .jd-tab.active { background: var(--gradient-primary); color: #fff; border-color: transparent; }

  .jd-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .jd-aside { position: static !important; }

  /* Tab "Thông tin" (mặc định): ẩn phần "Đề nghị" */
  .jd-offer { display: none !important; }
  /* Tab "Đề nghị" */
  .jd-show-offer .jd-info-part { display: none !important; }
  .jd-show-offer .jd-offer { display: block !important; }

  /* Việc làm liên quan: mỗi việc 1 dòng, chỉ tiêu đề */
  .jd-related {
    display: block !important;
    background: #fff; border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px; overflow: hidden;
  }
  .jd-related-item {
    display: block !important; padding: 13px 15px !important;
    border-radius: 0 !important; box-shadow: none !important;
    border: 0 !important; border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    margin: 0 !important;
  }
  .jd-related-item:last-child { border-bottom: 0 !important; }
  .jd-related-item:active { background: var(--gray-100) !important; }
  .jd-r-title {
    margin-bottom: 0 !important; font-size: 0.9rem !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .jd-r-company, .jd-r-salary { display: none !important; }
}

/* ══════════════════════════════════════════════
   ĐĂNG NHẬP / ĐĂNG KÝ — nén gọn vừa 1 màn hình mobile
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { height: 100%; }
  .auth-page { min-height: 100vh; min-height: 100dvh; height: 100dvh; overflow: hidden; }
  .auth-form-area { padding: 10px 12px !important; align-items: center !important; overflow-y: auto; }
  .auth-form-card { padding: 16px !important; }
  .auth-page .form-group { margin-bottom: 12px !important; }
  .auth-page .form-control { padding-top: 10px !important; padding-bottom: 10px !important; font-size: 0.92rem; }
  .auth-title { font-size: 1.35rem !important; margin-bottom: 2px !important; }
  .auth-subtitle { font-size: 0.86rem !important; margin-bottom: 12px !important; }
  .auth-page .btn-lg { padding: 12px 18px !important; }
  .auth-mlogo { margin-bottom: 10px !important; }
  .auth-mlogo img { height: 30px !important; }
  .auth-remember { margin-bottom: 12px !important; }
  .auth-divider { margin: 10px 0 !important; }
  .auth-social { margin-bottom: 10px !important; }
  .auth-social button { padding: 9px !important; }
}
