/* =====================================================
   Sticker Factory Careers
   Adapted from template_lp design system
   Tokens: primary #e42327 / tertiary #ffce07 / bg #fff8f7
   Fonts: Epilogue (headings) + Montserrat (body)
   ===================================================== */

:root {
  --primary: #e42327;
  --primary-dark: #b91c1f;
  --tertiary: #ffce07;
  --secondary: #000000;
  --success: #00b201;
  --background: #fff8f7;
  --surface: #fff8f7;
  --surface-container: #ffe9e6;
  --surface-container-low: #fff0ee;
  --surface-container-highest: #fcdbd7;
  --surface-container-lowest: #ffffff;
  --on-surface: #000000;
  --on-surface-variant: #5d3f3c;
  --outline: #926f6b;
  --outline-variant: #e7bdb8;
  --border-muted: #e5e7eb;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -2px rgba(0, 0, 0, .04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);
  --radius: .5rem;
  --radius-lg: .75rem;
  --container: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--background);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Epilogue', sans-serif; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 1024px) { .container { padding: 0 24px; } }

/* ===== Scroll progress ===== */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--tertiary));
  width: 0%; z-index: 9999; transition: width .1s ease;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius); font-weight: 600;
  font-size: 15px; transition: all .2s ease; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-xl); transform: translateY(-1px); }
.btn-primary:active { transform: scale(.97); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--surface-container); color: var(--on-surface); }
.btn-ghost:hover { background: var(--surface-container-highest); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ===== Badge / chip ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 9999px;
  background: var(--surface-container); color: var(--on-surface);
  font-size: 13px; font-weight: 600;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-tertiary { background: var(--tertiary); color: var(--secondary); }
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 9999px;
  background: var(--surface-container); color: var(--on-surface);
  border: 1px solid var(--border-muted); font-size: 13px;
}
.dot-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ===== Section / heading ===== */
.section { padding: 80px 0; }
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-surface-variant);
}
.section-title {
  font-family: 'Epilogue', sans-serif; font-weight: 700;
  font-size: 32px; line-height: 1.25; color: var(--on-surface);
}
@media (min-width: 1024px) {
  .section-title { font-size: 40px; }
}
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .section-title { margin-top: 8px; }
.section-head p { color: var(--on-surface-variant); margin-top: 12px; max-width: 640px; margin-left: auto; margin-right: auto; }

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.divider { height: 1px; background: var(--border-muted); width: 100%; }
.pattern-dots {
  background-image: radial-gradient(circle, var(--outline) 1px, transparent 1px);
  background-size: 24px 24px; opacity: .08;
}

/* ===== Navigation ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255, 248, 247, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: var(--border-muted); box-shadow: 0 4px 18px -10px rgba(0,0,0,.2); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Epilogue', sans-serif; font-weight: 700; font-size: 20px; color: var(--primary); }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--primary); color: #fff; border-radius: 8px; font-weight: 800;
  box-shadow: var(--shadow);
}
.brand-logo { height: 40px; width: auto; display: block; flex-shrink: 0; }
.brand-text { white-space: nowrap; line-height: 1; }
.brand-logo-footer { height: 44px; }
@media (max-width: 480px) {
  .brand-text { display: none; }
  .brand-logo { height: 36px; }
}
.nav-links { display: none; align-items: center; gap: 32px; }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 14px; color: var(--on-surface-variant); font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; }
.nav-toggle:hover { background: var(--surface-container); }
@media (min-width: 1024px) { .nav-toggle { display: none; } }
.mobile-menu {
  display: none; padding: 12px 0 16px;
  border-top: 1px solid var(--border-muted);
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--on-surface-variant); font-weight: 500; }
.mobile-menu a:hover { background: var(--surface-container); color: var(--primary); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; padding: 140px 0 80px;
  background: var(--background);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--outline) 1px, transparent 1px);
  background-size: 24px 24px; opacity: .07; pointer-events: none;
}
.hero-blur {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .25;
}
.hero-blur.b1 { width: 420px; height: 420px; background: var(--primary); top: -100px; right: -80px; }
.hero-blur.b2 { width: 360px; height: 360px; background: var(--tertiary); bottom: -120px; left: -80px; }
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center;
}
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.hero h1 {
  font-size: 36px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700;
}
@media (min-width: 1024px) { .hero h1 { font-size: 56px; } }
.hero p.lead {
  font-size: 17px; color: var(--on-surface-variant); margin: 20px 0 28px; max-width: 560px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .num { font-family: 'Epilogue', sans-serif; font-weight: 700; font-size: 28px; color: var(--primary); }
.hero-stats .lbl { font-size: 13px; color: var(--on-surface-variant); }

/* Hero illustration */
.hero-art {
  position: relative; aspect-ratio: 1; max-width: 480px; margin: 0 auto;
}
.hero-art .float {
  position: absolute; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-xl); display: grid; place-items: center;
  font-size: 56px; animation: float 6s ease-in-out infinite;
}
.hero-art .center {
  inset: 12% 12%; border-radius: 32px;
  background: linear-gradient(135deg, var(--surface-container), var(--surface-container-highest));
  font-size: 96px;
}
.hero-art .f1 { width: 110px; height: 110px; top: 0; left: 0; animation-delay: 0s; background: #fff0f5; }
.hero-art .f2 { width: 96px; height: 96px; top: 8%; right: 0; animation-delay: 1s; background: #fffbe6; }
.hero-art .f3 { width: 100px; height: 100px; bottom: 8%; left: 4%; animation-delay: 2s; background: #f0f9ff; }
.hero-art .f4 { width: 110px; height: 110px; bottom: 0; right: 4%; animation-delay: 3s; background: #f0fff4; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-16px) rotate(3deg); }
}

/* ===== Job filters & list ===== */
.job-toolbar {
  display: flex; flex-direction: column; gap: 14px; align-items: stretch;
  margin-bottom: 32px;
}
@media (min-width: 768px) { .job-toolbar { flex-direction: row; align-items: center; justify-content: space-between; } }
.job-search {
  flex: 1; max-width: 360px; position: relative;
}
.job-search input {
  width: 100%; padding: 12px 14px 12px 42px; border-radius: 9999px;
  border: 1px solid var(--border-muted); background: #fff;
  font-size: 14px; outline: none; transition: border-color .2s;
}
.job-search input:focus { border-color: var(--primary); }
.job-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--outline); }
.job-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 9999px; background: #fff;
  border: 1px solid var(--border-muted); color: var(--on-surface-variant);
  font-size: 13px; font-weight: 600; transition: all .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.job-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .job-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .job-grid { grid-template-columns: repeat(3, 1fr); } }

.job-card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-muted); box-shadow: var(--shadow);
  transition: all .25s ease; display: flex; flex-direction: column;
  cursor: pointer;
}
.job-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--outline-variant); }
/* Banner 4:3 ngang (rộng > cao) - "3:4 ngang" theo yêu cầu */
.job-banner {
  aspect-ratio: 4 / 3; width: 100%; position: relative; overflow: hidden;
  line-height: 0;
}
.job-banner svg,
.job-banner img { width: 100%; height: 100%; display: block; }
.job-banner .b-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,.5); color: #fff; padding: 4px 10px; border-radius: 9999px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.job-banner .b-hot {
  position: absolute; top: 12px; right: 12px;
  background: var(--tertiary); color: var(--secondary);
  padding: 4px 10px; border-radius: 9999px; font-size: 11px; font-weight: 800;
}
.job-banner .b-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; pointer-events: none; text-align: center;
}
.job-banner .b-icon {
  display: block;
  font-size: 56px; line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}
.job-banner .b-title {
  font-size: 16px; line-height: 1.3; font-weight: 600; color: #fff;
  margin: 0; max-width: 80%; opacity: .95; text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.job-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.job-body h3 { font-size: 18px; line-height: 1.3; margin-bottom: 8px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--on-surface-variant); font-size: 13px; margin-bottom: 12px; }
.job-meta span { display: inline-flex; align-items: center; gap: 4px; }
.job-desc { color: var(--on-surface-variant); font-size: 14px; flex: 1; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--border-muted); }
.job-salary { font-family: 'Epilogue', sans-serif; font-weight: 700; color: var(--primary); }
.job-empty {
  text-align: center; padding: 60px 20px; color: var(--on-surface-variant);
  background: #fff; border-radius: var(--radius-lg); border: 1px dashed var(--border-muted);
}

/* ===== Job modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 0; overflow-y: auto;
}
.modal.open { display: flex; }
.modal.modal--top { align-items: flex-start; padding-top: 40px; }
.modal.modal--top .result-card { margin: 0 auto; }
.modal-card {
  background: #fff; border-radius: var(--radius-lg); width: 100%;
  max-width: 720px; margin: 20px 0; overflow: hidden;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-banner { width: 100%; aspect-ratio: 4 / 3; max-height: 380px; overflow: hidden; position: relative; background: linear-gradient(135deg, #e42327, #ffce07); line-height: 0; }
.modal-banner svg { width: 100%; height: 100%; display: block; }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  background: rgba(255,255,255,.95); border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; line-height: 1; box-shadow: var(--shadow); z-index: 2;
}
.modal-body { padding: 28px; }
.modal-body h2 { font-size: 26px; margin-bottom: 8px; }
.modal-body .meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 20px; }
.modal-body h4 {
  font-family: 'Epilogue', sans-serif; font-size: 16px; margin: 20px 0 10px;
  display: flex; align-items: center; gap: 8px; color: var(--secondary);
}
.modal-body h4::before {
  content: ""; width: 4px; height: 18px; background: var(--primary); border-radius: 2px;
}
.modal-body ul { padding-left: 20px; color: var(--on-surface-variant); }
.modal-body li { margin-bottom: 6px; line-height: 1.55; }
.modal-foot {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-muted);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}

/* === Mobile job-detail modal === */
@media (max-width: 640px) {
  .modal { align-items: stretch; }

  .modal-card {
    margin: 0; border-radius: 0;
    max-height: 100dvh; height: 100dvh;
    display: flex; flex-direction: column;
    animation: slideUp .3s cubic-bezier(.2,.9,.3,1);
  }
  .job-banner .b-icon { font-size: 44px; margin-bottom: 6px; }
  .job-banner .b-title { font-size: 14px; max-width: 90%; }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  .modal-banner {
    aspect-ratio: unset; max-height: none;
    height: 180px; flex-shrink: 0;
  }

  .modal-close {
    width: 48px; height: 48px; font-size: 26px;
    top: 12px; right: 12px;
    min-width: 48px; min-height: 48px;
  }

  .modal-body {
    flex: 1; overflow-y: auto; padding: 20px 16px;
    -webkit-overflow-scrolling: touch;
  }
  .modal-body h2 { font-size: 22px; }
  .modal-body .meta { gap: 8px; }
  .modal-body .meta .tag { font-size: 12px; padding: 4px 10px; }
  .modal-body h4 { font-size: 15px; margin: 16px 0 8px; }
  .modal-body li { font-size: 14px; line-height: 1.5; }
  .modal-body p { font-size: 14px; }

  .modal-foot {
    flex-shrink: 0;
    margin-top: 0; padding: 14px 16px;
    background: #fff; border-top: 1px solid var(--border-muted);
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
    justify-content: center;
    flex-direction: column; gap: 10px;
  }
  .modal-foot .btn-primary { width: 100%; padding: 14px; font-size: 15px; }
}

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 1024px) { .about-grid { grid-template-columns: 1.3fr .9fr; gap: 56px; } }
.about-text p { color: var(--on-surface-variant); margin-bottom: 14px; font-size: 16px; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.value-card { background: #fff; padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-muted); }
.value-card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-container); display: grid; place-items: center; font-size: 22px; margin-bottom: 12px; }
.value-card h4 { font-size: 16px; margin-bottom: 6px; }
.value-card p { font-size: 13px; color: var(--on-surface-variant); margin: 0; }

.about-side { display: grid; gap: 16px; }
.about-card-big {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--surface-container), var(--surface-container-highest));
  display: grid; place-items: center; font-size: 96px;
}
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { background: #fff; padding: 16px; border-radius: 12px; border: 1px solid var(--border-muted); text-align: center; }
.fact .v { font-family: 'Epilogue', sans-serif; font-weight: 700; font-size: 22px; color: var(--primary); }
.fact .l { font-size: 12px; color: var(--on-surface-variant); }

/* ===== Life ===== */
.life-section { background: linear-gradient(180deg, var(--surface-container-low), var(--background)); }
.life-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .life-grid { grid-template-columns: repeat(3, 1fr); } }
.life-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--border-muted); transition: all .25s; }
.life-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.life-card .ic { font-size: 40px; }
.life-card h3 { margin: 12px 0 6px; font-size: 18px; }
.life-card p { color: var(--on-surface-variant); font-size: 14px; }
.life-card.featured { background: linear-gradient(135deg, var(--primary), #ff5151); color: #fff; grid-column: span 1; }
@media (min-width: 768px) { .life-card.featured { grid-column: span 3; padding: 32px; display: flex; align-items: center; gap: 28px; } }
.life-card.featured h3, .life-card.featured p { color: #fff; }
.life-card.featured p { opacity: .92; max-width: 600px; }

.perks { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.perks .p { background: #fff; border: 1px solid var(--border-muted); padding: 8px 16px; border-radius: 9999px; font-size: 13px; font-weight: 500; }

/* ===== Apply ===== */
.apply-section { background: var(--surface-container-low); }
.apply-form-wrap { max-width: 800px; margin: 0 auto; }
.apply-form { background: #fff; padding: 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border-muted); }
.form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border-muted); }
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section-title {
  font-family: 'Epilogue', sans-serif; font-size: 16px; font-weight: 700;
  color: var(--primary); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::before {
  content: ""; width: 4px; height: 20px; background: var(--primary);
  border-radius: 2px; flex: none;
}
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-muted);
  border-radius: var(--radius); font-size: 15px; background: #fff;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(228,35,39,.1);
}
.field input.invalid, .field select.invalid, .file-upload-wrap.invalid .file-upload-label { border-color: #dc2626; background: #fef2f2; }
.field textarea { resize: vertical; min-height: 80px; }
.error { display: block; color: #dc2626; font-size: 12px; margin-top: 5px; min-height: 14px; }
.field-hint { display: block; color: var(--on-surface-variant); font-size: 12px; margin-top: 4px; font-style: italic; }
.email-suggest { color: #ca8a04; font-size: 12.5px; margin-top: 6px; font-style: normal; font-weight: 500; }
.email-suggest button { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0 4px; text-decoration: underline; font-weight: 700; font-family: inherit; font-size: inherit; }
.email-suggest button:hover { color: #b91c1c; }
.photo-scan-state { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 500; }
.photo-scan-state.scanning { color: var(--on-surface-variant); }
.photo-scan-state.ok { color: #16a34a; }
.photo-scan-state.fail { color: #dc2626; }
.photo-scan-spinner { width: 14px; height: 14px; border: 2px solid var(--border-muted); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.file-upload-wrap { position: relative; }
.file-upload-wrap input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.file-upload-label {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border: 2px dashed var(--outline-variant); border-radius: var(--radius);
  background: var(--surface-container-low); cursor: pointer; transition: border-color .2s, background .2s;
}
.file-upload-label:hover { border-color: var(--primary); background: #fff; }
.file-upload-label svg { color: var(--outline); flex-shrink: 0; }
.file-upload-text { font-size: 14px; color: var(--on-surface-variant); }
.file-upload-wrap.has-file .file-upload-label { border-color: var(--success); background: #f0fdf4; }
.file-upload-wrap.has-file .file-upload-label .file-upload-text { color: var(--success); font-weight: 600; }
.file-upload-name { font-size: 13px; color: var(--on-surface-variant); margin-top: 6px; min-height: 18px; }
.btn-loading { display: inline-flex; align-items: center; gap: 6px; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Result modal ===== */
.result-card { background: #fff; border-radius: var(--radius-lg); max-width: 480px; padding: 36px 32px; text-align: center; position: relative; animation: pop .3s cubic-bezier(.2,.9,.3,1.2); }
.result-card.warning-card { max-width: 440px; }
.warning-list { text-align: left; margin: 14px 0 0; padding: 0; list-style: none; }
.warning-list li { padding: 8px 14px; margin-bottom: 6px; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; font-size: 14px; color: #92400e; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.warning-list li::before { content: "⚠"; font-size: 12px; }
@media (max-width: 640px) {
  .result-card { border-radius: var(--radius-lg); margin: 16px; padding: 28px 20px; max-width: calc(100vw - 32px); }
}
.result-icon { font-size: 56px; }
.result-card h3 { font-size: 24px; margin: 12px 0 6px; }
.result-card p { color: var(--on-surface-variant); font-size: 14px; }
.result-code { display: inline-block; margin: 16px 0 8px; padding: 10px 22px; border-radius: 12px; background: var(--surface-container); color: var(--primary); font-weight: 800; letter-spacing: 2px; font-family: 'Epilogue', sans-serif; font-size: 18px; }
.result-meter { height: 10px; border-radius: 9999px; background: var(--surface-container); overflow: hidden; margin: 14px 0 6px; }
.result-meter i { display: block; height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--primary), var(--tertiary)); transition: width 1s ease; width: 0%; }
.result-summary { text-align: left; background: var(--surface-container-low); border: 1px solid var(--border-muted); border-radius: 12px; padding: 14px; margin-top: 16px; font-size: 13px; }
.result-summary div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--on-surface-variant); }
.result-summary strong { color: var(--on-surface); }

/* ===== Footer ===== */
.site-footer {
  background: var(--secondary); color: #fff; padding: 48px 0 24px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; margin-bottom: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h5 { font-size: 14px; margin-bottom: 14px; color: var(--tertiary); letter-spacing: .05em; text-transform: uppercase; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,.75); font-size: 14px; transition: color .2s; }
.site-footer a:hover { color: var(--tertiary); }
.site-footer .brand { color: #fff; }
.site-footer .brand-mark { background: var(--primary); }
.site-footer p { color: rgba(255,255,255,.65); font-size: 14px; margin: 14px 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,.55); }

.footer-contact { list-style: none; }
.footer-contact li { display: flex; align-items: flex-start; gap: 0; margin-bottom: 10px; font-size: 14px; color: rgba(255,255,255,.8); line-height: 1.5; }
.footer-contact-icon { flex-shrink: 0; margin-right: 6px; }
.footer-contact a { font-size: 14px; }
.footer-btn { display: inline-flex !important; margin-top: 4px; font-size: 13px !important; padding: 7px 16px !important; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* =====================================================
   ADMIN PAGE
   ===================================================== */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side {
  background: var(--secondary); color: #fff; padding: 24px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
@media (max-width: 900px) { .admin-side { position: static; height: auto; } }
.admin-side .brand { color: #fff; margin-bottom: 28px; }
.admin-side h6 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.45); margin: 18px 0 8px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500;
  margin-bottom: 4px; transition: all .15s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--primary); }
.admin-back { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 24px; padding: 10px 12px; }
.admin-main { background: var(--surface-container-low); padding: 24px; }
@media (min-width: 1024px) { .admin-main { padding: 36px; } }
.admin-head {
  display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border-muted);
}
@media (min-width: 768px) { .admin-head { flex-direction: row; align-items: center; justify-content: space-between; } }
.admin-head h1 { font-size: 28px; }
.admin-head p { color: var(--on-surface-variant); font-size: 14px; margin-top: 4px; }
.admin-head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-action-group {
  display: inline-flex; gap: 0;
  background: var(--surface-container-lowest);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-action-group .btn-sm {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border-muted);
  background: transparent;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.admin-action-group .btn-sm:last-child { border-right: none; }
.admin-action-group .btn-sm:hover { background: var(--surface-container); }
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 768px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.admin-stat { background: #fff; border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--border-muted); }
.admin-stat .l { font-size: 12px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .05em; }
.admin-stat .v { font-family: 'Epilogue', sans-serif; font-weight: 700; font-size: 28px; color: var(--secondary); margin-top: 4px; }
.admin-stat.primary .v { color: var(--primary); }

.admin-table-wrap { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-muted); overflow: hidden; }
.admin-toolbar { padding: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-muted); }
.admin-toolbar input, .admin-toolbar select {
  padding: 9px 12px; border: 1px solid var(--border-muted); border-radius: var(--radius); font-size: 14px; outline: none;
}
.admin-toolbar input:focus, .admin-toolbar select:focus { border-color: var(--primary); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border-muted); }
.admin-table th { background: var(--surface-container-low); color: var(--on-surface-variant); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-container-low); }
.admin-table .th-img, .admin-table .td-img { width: 90px; }
.admin-table .td-img img,
.admin-table .td-img .ph {
  width: 80px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--surface-container);
  display: grid; place-items: center; font-size: 22px; color: var(--outline); object-fit: cover;
}
.admin-table .td-img svg { width: 100%; height: 100%; display: block; border-radius: 8px; object-fit: cover; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; line-height: 1; transition: transform .15s, filter .15s, background .15s;
}
.icon-btn svg { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.view { background: #f1f5f9; color: #475569; }
.icon-btn.view:hover { background: #e2e8f0; }
.icon-btn.edit { background: #dbeafe; color: #1d4ed8; }
.icon-btn.edit:hover { background: #bfdbfe; }
.icon-btn.mail { background: #ede9fe; color: #6d28d9; }
.icon-btn.mail:hover { background: #ddd6fe; }
.icon-btn.del { background: #fee2e2; color: #b91c1c; }
.icon-btn.del:hover { background: #fecaca; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.empty-row td { padding: 48px; text-align: center; color: var(--on-surface-variant); }

/* Body lock when modal is open */
body.modal-open { overflow: hidden; }

/* Admin form/modal */
.admin-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.admin-modal.open { display: flex; }
.admin-modal-card { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 760px; margin: 30px 0; padding: 28px; animation: pop .25s cubic-bezier(.2,.9,.3,1.2); display: flex; flex-direction: column; max-height: calc(100vh - 60px); overflow-y: auto; }
.admin-modal-card h2 { font-size: 20px; margin-bottom: 14px; flex-shrink: 0; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .admin-form-grid { grid-template-columns: 1fr; } .admin-form-grid .full { grid-column: 1; } }
.admin-form-grid label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.admin-form-grid input, .admin-form-grid select, .admin-form-grid textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-muted); border-radius: var(--radius); font-size: 13px; outline: none;
}
.admin-form-grid input:focus, .admin-form-grid select:focus, .admin-form-grid textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(228,35,39,.1); }
.admin-form-grid textarea { min-height: 70px; resize: vertical; }
.admin-form-grid select { background: #f0f4ff; border-color: #c7d2e8; color: #1a2744; font-weight: 500; }
.admin-form-grid select:focus { background: #fff; border-color: var(--primary); }
.admin-form-grid select option { background: #eef2ff; color: #1a2744; }
.admin-form-grid select option:checked { background: #3b5bdb; color: #fff; }
.admin-form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-muted); }
.admin-form-foot.sticky-foot { position: sticky; bottom: 0; background: #fff; padding: 14px 28px 28px; margin: 0 -28px 0; flex-shrink: 0; z-index: 1; }

/* ===== Modal tabs (lead edit & lead detail) ===== */
.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-muted);
  margin: 0 -28px 18px;
  padding: 0 28px;
  background: #fff;
}
.tab-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Epilogue', sans-serif;
  color: var(--on-surface-variant);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: tabFade .15s ease; }
@keyframes tabFade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.pane-section-title {
  margin: 16px 0 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Epilogue', sans-serif;
}
.pane-section-title:first-child { margin-top: 4px; }

@media (max-width: 700px) {
  .modal-tabs { margin: 0 -20px; padding: 0 20px; }
  .tab-link { padding: 10px 12px; font-size: 13px; }
}

/* Collapsible form sections */
.job-form-section details { border: 1px solid var(--border-muted); border-radius: var(--radius); padding: 0; }
.job-form-section details summary { padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 6px; }
.job-form-section details summary::before { content: "▸"; font-size: 11px; transition: transform .2s; }
.job-form-section details[open] summary::before { transform: rotate(90deg); }
.job-form-section details textarea { display: block; width: 100%; border: none; border-top: 1px solid var(--border-muted); border-radius: 0 0 var(--radius) var(--radius); padding: 8px 12px; font-size: 13px; min-height: 60px; resize: vertical; outline: none; }

/* ===== Config Section ===== */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.config-block { background: #fff; border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: 20px; }
.config-block h3 { font-size: 15px; margin-bottom: 14px; }
.config-list { display: flex; flex-direction: column; min-height: 40px; margin-bottom: 14px; border: 1px solid var(--border-muted); border-radius: var(--radius); overflow: hidden; }
.config-item {
  display: flex; align-items: center;
  background: var(--surface-container-lowest); border-bottom: 1px solid var(--border-muted);
  transition: background .15s, box-shadow .15s;
}
.config-item:last-child { border-bottom: none; }
.config-item.dragging { opacity: .4; background: var(--surface-container); }
.config-item.drop-above { box-shadow: inset 0 2px 0 0 var(--primary); }
.config-item.drop-below { box-shadow: inset 0 -2px 0 0 var(--primary); }
.config-drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; min-height: 40px; cursor: grab;
  color: var(--on-surface-variant); font-size: 16px; user-select: none; flex-shrink: 0;
  opacity: .4; transition: opacity .15s, background .15s;
}
.config-drag-handle:hover { opacity: 1; background: var(--surface-container); }
.config-drag-handle:active { cursor: grabbing; }
.config-item-input {
  flex: 1; padding: 8px 10px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; outline: none; min-width: 0;
  border-radius: var(--radius); margin-right: 4px;
}
.config-item.editing .config-item-input { background: #fff; box-shadow: 0 0 0 2px var(--primary); }
.config-item-delete {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 6px;
  font-size: 16px; color: var(--on-surface-variant); cursor: pointer;
  transition: background .15s, color .15s; margin-right: 4px; flex-shrink: 0;
}
.config-item-delete:hover { background: #fee2e2; color: #dc2626; }
.config-add-row { display: flex; gap: 8px; }
.config-add-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border-muted); border-radius: var(--radius);
  font-size: 13px; outline: none; transition: border-color .2s;
}
.config-add-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(228,35,39,.1); }
.banner-preview { aspect-ratio: 4/3; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-container); position: relative; margin-bottom: 8px; }
.banner-preview svg { width: 100%; height: 100%; }
.banner-hint { font-size: 12px; color: var(--on-surface-variant); }
.confirm-card { max-width: 420px; text-align: center; }
.confirm-card h2 { font-size: 20px; }
.confirm-card p { color: var(--on-surface-variant); margin: 10px 0 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: var(--secondary); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-xl);
  transform: translateY(80px); opacity: 0; transition: all .25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: #dc2626; }

/* =====================================================
   ADMIN LEADS PAGE
   ===================================================== */

/* Lead stats */
.lead-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.lead-stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 18px;
  border: 1px solid var(--border-muted); text-align: center;
}
.lead-stat-num {
  font-family: 'Epilogue', sans-serif; font-weight: 800; font-size: 32px;
  color: var(--secondary);
}
.lead-stat-lbl { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.lead-stat-card.stat-new .lead-stat-num { color: #0891b2; }
.lead-stat-card.stat-wait .lead-stat-num { color: #ca8a04; }
.lead-stat-card.stat-hired .lead-stat-num { color: #16a34a; }
.lead-stat-card.stat-month .lead-stat-num { color: #9333ea; }

/* Lead toolbar */
.lead-toolbar {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
  align-items: stretch;
}
@media (min-width: 768px) { .lead-toolbar { flex-direction: row; align-items: center; } }
.lead-search {
  flex: 1; max-width: 400px; position: relative;
}
.lead-search input {
  width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border-muted);
  border-radius: 9999px; background: #fff; font-size: 14px; outline: none;
}
.lead-search input:focus { border-color: var(--primary); }
.lead-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--outline); }
.lead-filters { display: flex; flex-wrap: wrap; gap: 6px; }

/* Lead chips */
.lead-chip {
  padding: 6px 14px; border-radius: 9999px; background: #fff;
  border: 1px solid var(--border-muted); color: var(--on-surface-variant);
  font-size: 12px; font-weight: 600; transition: all .2s; cursor: pointer;
}
.lead-chip:hover { border-color: var(--primary); color: var(--primary); }
.lead-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-count { background: rgba(255,255,255,.25); padding: 1px 6px; border-radius: 9999px; font-size: 11px; }

/* Lead table */
.lead-table-wrap {
  background: #fff; border-radius: 14px; border: 1px solid var(--border-muted);
  overflow-x: auto; overflow-y: hidden; box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
}
.lead-table { width: 100%; min-width: 1560px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.lead-table th, .lead-table td {
  padding: 20px 16px; text-align: left; font-size: 14px; vertical-align: middle;
  border-bottom: 1px solid #eef0f3;
}
.lead-table th {
  background: #fff8f8; color: #4b5563; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.lead-table tr:last-child td { border-bottom: none; }
.lead-table tr:hover td { background: #fffafa; }
.lead-id { font-family: 'Epilogue', sans-serif; font-weight: 700; font-size: 12px; color: var(--primary); white-space: nowrap; }
.lead-id-cell { display: flex; align-items: center; gap: 4px; }
.lead-invite-ok { font-size: 12px; }
.lead-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-weight: 700; font-size: 15px; line-height: 1.35; white-space: normal;
  word-break: normal; overflow-wrap: normal;
}
.lead-sub { font-size: 12px; color: #6b7280; margin-top: 3px; line-height: 1.4; white-space: normal; }
.lead-salary { font-size: 12px; color: #4b5563; margin-top: 3px; line-height: 1.35; white-space: normal; }
.lead-position {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-weight: 600; font-size: 14px; line-height: 1.45; white-space: normal;
  word-break: normal; overflow-wrap: normal;
}
.lead-status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px; border-radius: 9999px; font-size: 12px; font-weight: 700;
  cursor: pointer; border: none; transition: all .15s; white-space: nowrap; line-height: 1;
}
.lead-status-badge:hover { transform: scale(1.04); }
.lead-contact { color: var(--primary); font-size: 12px; }
.lead-contact:hover { text-decoration: underline; }
.lead-score { font-family: 'Epilogue', sans-serif; font-weight: 800; font-size: 16px; }
.lead-date { font-size: 14px; color: #4b5563; white-space: nowrap; font-weight: 500; }
.lead-empty { text-align: center; padding: 48px 20px; color: var(--on-surface-variant); font-size: 14px; }

/* Admin loading overlay (hiển thị spinner trong section Leads khi đang fetch data) */
.admin-loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 320px;
  background: rgba(255, 255, 255, .75);
  color: var(--on-surface-variant); font-size: 14px;
  pointer-events: none;
}
.admin-loading.is-hidden { display: none; }
.admin-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
#leadsSection { position: relative; }

/* Lead thumbnail in table — ID-photo style 64×80px, vừa cột 80px */
.lead-thumb { width: 64px; height: 80px; max-width: 64px; max-height: 80px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border-muted); cursor: pointer; transition: box-shadow .15s; display: block; }
.lead-thumb:hover { box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.lead-row:hover .lead-thumb { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lead-table .td-img { width: 90px; max-width: 90px; padding: 8px 12px; overflow: hidden; vertical-align: middle; }
.lead-table td { overflow: hidden; }
.lead-table .td-img .ph { width: 64px; height: 80px; border-radius: 6px; overflow: hidden; object-fit: cover; display: grid; place-items: center; background: var(--surface-container); font-size: 20px; color: var(--outline); }

/* Lead table — PV & Offer / Học vấn compact cells */

.lead-pv-card {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: #fff7e6; border: 1px solid #fde68a; border-radius: 8px;
  padding: 8px 12px; min-width: 150px; line-height: 1.3;
}
.lead-pv-weekday { font-size: 13px; font-weight: 700; color: #92400e; white-space: normal; word-break: normal; }
.lead-pv-date { font-size: 13px; font-weight: 600; color: #92400e; white-space: nowrap; }
.lead-pv-empty {
  display: inline-block; background: #f3f4f6; color: #6b7280; border: 1px dashed #d1d5db;
  border-radius: 8px; padding: 8px 12px; min-width: 150px; font-size: 12px; font-weight: 500;
  text-align: center;
}
.lead-offer-row {
  font-size: 13px; color: #4b5563; margin-top: 6px; white-space: normal;
  font-weight: 500;
}
.lead-offer-row.is-empty { color: #9ca3af; font-style: italic; font-weight: 500; }
.lead-edu-major {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;
  font-size: 14px; font-weight: 600; color: #1f2937; line-height: 1.45; white-space: normal;
  word-break: normal;
}
.lead-edu-school {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 13px; color: #6b7280; margin-top: 2px; line-height: 1.45; white-space: normal;
  word-break: normal;
}

/* Photo zoom lightbox */
.lead-photo-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.75); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding: 40px 0; cursor: zoom-out; overflow-y: auto; }
.lead-photo-lightbox.open { display: flex; }
.lead-photo-lightbox img { max-width: min(800px, 90vw); max-height: 90vh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.4); animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
.lead-photo-lightbox-close { position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 22px; border: none; cursor: pointer; transition: background .15s; z-index: 2001; }
.lead-photo-lightbox-close:hover { background: #fff; }

/* CV Viewer lightbox */
.cv-viewer-lightbox { position: fixed; inset: 0; z-index: 2000; background: #1a1a2e; display: none; flex-direction: column; }
.cv-viewer-lightbox.open { display: flex; }
.cv-viewer-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #16213e; color: #fff; flex-shrink: 0; }
.cv-viewer-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.cv-viewer-actions { display: flex; align-items: center; gap: 10px; }
.cv-viewer-btn { padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,.15); color: #fff; font-size: 13px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: background .15s; }
.cv-viewer-btn:hover { background: rgba(255,255,255,.25); }
.cv-viewer-close { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 18px; color: #fff; border: none; cursor: pointer; transition: background .15s; }
.cv-viewer-close:hover { background: rgba(255,255,255,.3); }
.cv-viewer-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
.cv-viewer-body iframe { width: 100%; height: 100%; border: none; min-height: 80vh; }
.cv-viewer-body img { max-width: min(900px, 95vw); max-height: 90vh; object-fit: contain; border-radius: 4px; margin: 16px auto; display: block; }
.cv-viewer-body .cv-fallback { color: rgba(255,255,255,.6); text-align: center; padding: 60px 20px; font-size: 15px; }
.cv-viewer-body .cv-fallback a { color: #60a5fa; text-decoration: underline; }

/* Responsive thumbnail for mobile */
@media (max-width: 768px) {
  .lead-thumb { height: 120px; max-width: 90px; }
  .lead-table .td-img { width: 100px; max-width: 100px; }
  .lead-table .td-img .ph { width: 90px; height: 120px; }
}

/* Lead photo in detail modal */
.lead-detail-photo { width: 120px !important; height: 120px !important; max-width: 120px; max-height: 120px; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; flex-shrink: 0; border: 2px solid var(--border-muted); cursor: pointer; }
.lead-detail-photo img { width: 100% !important; height: 100% !important; max-width: 120px; max-height: 120px; object-fit: cover; display: block; }
.qv-photo-empty { display: grid; place-items: center; background: var(--surface-container); color: var(--on-surface-variant); font-size: 28px; cursor: default; }
.lead-detail-photo:hover { box-shadow: 0 4px 16px rgba(0,0,0,.18); }

/* Pagination */
.lead-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; flex-wrap: wrap; gap: 8px; }
.page-info { font-size: 13px; color: var(--on-surface-variant); }
.page-btns { display: flex; gap: 4px; }
.page-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-muted);
  background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Lead detail modal */
.lead-detail-card {
  background: #fff; border-radius: var(--radius-lg);
  width: calc(100vw - 40px); max-width: none;
  height: calc(100dvh - 40px); max-height: calc(100dvh - 40px);
  margin: 0; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.lead-detail-head {
  padding: 24px 24px 16px; border-bottom: 1px solid var(--border-muted);
  position: relative; flex-shrink: 0; background: #fff; z-index: 2;
}
.lead-detail-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 24px 24px;
}
#leadDetailModal .modal-tabs {
  position: sticky; top: 0; z-index: 4;
  background: #fff;
}
.lead-detail-info h2 { font-size: 24px; margin-bottom: 8px; }
.lead-detail-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lead-quickview { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 12px; font-size: 13px; line-height: 1.5; }
.qv-item { display: flex; gap: 6px; align-items: baseline; min-width: 0; color: var(--on-surface); word-break: break-word; }
.qv-item > span { min-width: 0; overflow-wrap: anywhere; }
.qv-link { color: var(--on-surface); text-decoration: none; transition: color .15s; }
.qv-link:hover { color: var(--primary); }
.qv-cv { color: var(--primary); font-weight: 600; }
.qv-score > span strong { color: var(--primary); font-size: 14px; }
.lead-detail-score { font-size: 13px; color: var(--on-surface-variant); }
.lead-detail-id { font-size: 11px; color: var(--outline); font-family: 'Epilogue', sans-serif; font-weight: 700; }
.lead-detail-grid { padding: 0 24px 24px; }

/* Lead detail nav buttons */
.lead-detail-nav {
  position: absolute; top: 12px; right: 16px;
  display: flex; gap: 6px; z-index: 5;
}
.lead-nav-btn {
  border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: filter .15s, opacity .15s, transform .1s;
}
.lead-nav-btn:disabled { opacity: .4; cursor: not-allowed; }
.lead-nav-btn:not(:disabled):hover { filter: brightness(1.08); }
.lead-nav-btn:not(:disabled):active { transform: scale(.97); }
.lead-nav-back  { background: #334155; color: #fff; }
.lead-nav-next  { background: #2563eb; color: #fff; }
.lead-nav-close { background: #dc2626; color: #fff; }

.lead-detail-section { margin-top: 20px; }
.lead-detail-section h4 {
  font-family: 'Epilogue', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--secondary); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.detail-row {
  display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row > span:first-child { min-width: 120px; color: var(--on-surface-variant); font-weight: 600; flex-shrink: 0; }
.detail-row > span:last-child,
.detail-row > a,
.detail-row > strong { color: var(--on-surface); flex: 1; }
.detail-row > a:hover { color: var(--primary); text-decoration: underline; }
.lead-reason p { background: var(--surface-container-low); padding: 12px; border-radius: 8px; font-size: 14px; color: var(--on-surface-variant); line-height: 1.6; }
.lead-link { color: var(--primary); word-break: break-all; font-size: 12px; }
.lead-detail-foot {
  padding: 16px 24px; border-top: 1px solid var(--border-muted);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  position: sticky; bottom: 0; background: #fff;
}
.lead-detail-dates { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--on-surface-variant); }
.lead-detail-dates strong { color: var(--on-surface); }
.lead-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Test Bank redesign ===== */
.tb-section-heading { display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:4px 0 18px; }
.tb-section-heading h2 { margin:6px 0 0;font-size:22px; }
.tb-eyebrow { display:inline-block;font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--primary);text-transform:uppercase;background:var(--surface-container-low);padding:3px 9px;border-radius:999px; }
.tb-muted { color:var(--on-surface-variant);font-size:13px; }
.tb-group-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px; }
.tb-group-card { display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;align-items:center;gap:8px 16px;padding:18px 20px;background:#fff;border:1px solid var(--border-muted);border-radius:var(--radius-lg);cursor:pointer;text-align:left;font:inherit;transition:transform .15s,box-shadow .15s,border-color .15s; }
.tb-group-card:hover { transform:translateY(-2px);border-color:var(--primary);box-shadow:var(--shadow); }
.tb-group-icon { grid-row:1 / span 2;font-size:30px;line-height:1;background:var(--surface-container-low);width:54px;height:54px;display:grid;place-items:center;border-radius:14px; }
.tb-group-copy strong { display:block;font-family:'Epilogue',sans-serif;font-size:16px; }
.tb-group-copy small { display:block;color:var(--on-surface-variant);font-size:12px;margin-top:2px; }
.tb-group-count { grid-row:1 / span 2;align-self:center;text-align:right;color:var(--on-surface-variant);font-size:12px; }
.tb-group-count b { color:var(--primary);font-size:16px;font-family:'Epilogue',sans-serif;display:block; }
.tb-group-arrow { display:none; }
.tb-workspace-head { display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:6px 0 18px; }
.tb-workspace-head .tb-workspace-title { flex:1;min-width:0; }
.tb-workspace-title h2 { margin:6px 0 0;font-size:22px; }
.tb-question-wrap { padding:0; }
.tb-question-list { display:flex;flex-direction:column;gap:14px;padding:4px 4px 12px; }
.tb-question-card { background:#fff;border:1px solid var(--border-muted);border-radius:var(--radius-lg);padding:18px 20px;display:flex;flex-direction:column;gap:12px; }
.tb-question-head { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.tb-qid { font-family:'Epilogue',sans-serif;font-size:13px;font-weight:700;background:var(--surface-container-low);color:var(--primary);padding:4px 10px;border-radius:999px; }
.tb-section { font-size:12px;color:var(--on-surface-variant);background:var(--surface-container-low);padding:4px 10px;border-radius:999px; }
.tb-card-actions { margin-left:auto;display:flex;gap:6px;flex-wrap:wrap; }
.tb-question-card h3 { font-family:inherit;font-size:15px;font-weight:600;line-height:1.5;color:var(--on-surface); }
.tb-options { display:flex;flex-direction:column;gap:8px; }
.tb-option { display:flex;align-items:flex-start;gap:10px;padding:10px 14px;border:1.5px solid var(--border-muted);border-radius:var(--radius);font-size:14px;line-height:1.5; }
.tb-option.is-correct { border-color:#16a34a;background:#ecfdf5; }
.tb-option .quiz-opt-letter { flex-shrink:0;width:28px;height:28px;border-radius:50%;background:var(--surface-container-low);color:var(--on-surface-variant);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:13px; }
.tb-option.is-correct .quiz-opt-letter { background:#16a34a;color:#fff; }
.tb-option .tb-correct { margin-left:auto;color:#15803d;font-weight:600;font-size:12px; }
.tb-explanation { background:#ecfeff;border-left:3px solid #0ea5e9;border-radius:6px;padding:10px 12px;font-size:13px;color:#075985;display:flex;flex-direction:column;gap:4px; }

/* Test bank edit modal — full-screen like lead-detail */
.tb-edit-card { background:#fff;border-radius:var(--radius-lg);width:calc(100vw - 40px);max-width:none;height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);margin:0;overflow:hidden;position:relative;display:flex;flex-direction:column;animation:pop .25s cubic-bezier(.2,.9,.3,1.2); }
.tb-edit-head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 26px;border-bottom:1px solid var(--border-muted);background:#fff;flex-shrink:0; }
.tb-edit-head h2 { font-size:22px;margin:6px 0 0; }
.tb-edit-meta { color:var(--on-surface-variant);font-size:13px;margin-top:6px; }
.tb-close { width:40px;height:40px;border-radius:50%;border:none;background:var(--surface-container-low);font-size:22px;line-height:1;cursor:pointer;color:var(--on-surface);flex-shrink:0;transition:background .15s; }
.tb-close:hover { background:var(--surface-container); }
.tb-edit-body { flex:1;min-height:0;display:flex;flex-direction:column; }
.tb-edit-fields { padding:22px 26px;display:grid;grid-template-columns:1fr 1fr;gap:14px;overflow-y:auto;flex:1; }
.tb-edit-fields .full { grid-column:1 / -1; }
.tb-edit-fields label { display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:var(--on-surface-variant);text-transform:uppercase;letter-spacing:.05em; }
.tb-field-help { font-size:11px;font-weight:500;color:var(--on-surface-variant);text-transform:none;letter-spacing:0; }
.tb-edit-fields input, .tb-edit-fields select, .tb-edit-fields textarea { width:100%;padding:10px 12px;border:1px solid var(--border-muted);border-radius:var(--radius);font-size:14px;font-family:inherit;outline:none;background:#fff; }
.tb-edit-fields input:focus, .tb-edit-fields select:focus, .tb-edit-fields textarea:focus { border-color:var(--primary);box-shadow:0 0 0 3px rgba(228,35,39,.1); }
.tb-edit-fields textarea { min-height:90px;resize:vertical;line-height:1.55; }
.tb-option-list { display:flex;flex-direction:column;gap:8px; }
.tb-option-edit { display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:10px;padding:8px 10px;background:var(--surface-container-low);border:1.5px solid var(--border-muted);border-radius:var(--radius);transition:border-color .15s,background .15s,opacity .15s; }
.tb-option-edit.is-correct { border-color:#16a34a;background:#ecfdf5; }
.tb-option-edit.dragging { opacity:.45; }
.tb-option-edit.drop-above { box-shadow: inset 0 3px 0 var(--primary); }
.tb-option-edit.drop-below { box-shadow: inset 0 -3px 0 var(--primary); }
.tb-drag-handle {
  cursor: grab; color: var(--on-surface-variant); font-size: 18px; line-height: 1;
  width: 34px; height: 34px; border: none; border-radius: 8px; background: #fff;
  display: grid; place-items: center; user-select: none; touch-action: none;
  box-shadow: inset 0 0 0 1px var(--border-muted);
}
.tb-drag-handle:active { cursor: grabbing; background: var(--surface-container); }
.tb-drag-handle:hover { color: var(--primary); background: var(--surface-container-low); }
.tb-option-edit input {
  background: #fff; border: 1px solid var(--border-muted); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px; font-family: inherit; width: 100%; outline: none;
}
.tb-option-edit input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(228,35,39,.1); }
.tb-option-letter { width:30px;height:30px;border-radius:50%;background:#fff;border:1.5px solid var(--border-muted);display:grid;place-items:center;font-weight:700;font-size:13px;color:var(--on-surface-variant); }
.tb-option-edit.is-correct .tb-option-letter { background:#16a34a;border-color:#16a34a;color:#fff; }
.tb-option-edit input { background:#fff; }
.tb-correct-toggle { width:34px;height:34px;border-radius:50%;border:1.5px solid var(--border-muted);background:#fff;font-size:16px;font-weight:700;color:var(--on-surface-variant);cursor:pointer;transition:all .15s;flex-shrink:0; }
.tb-option-edit.is-correct .tb-correct-toggle { background:#16a34a;border-color:#16a34a;color:#fff; }
.tb-correct-toggle:hover { border-color:var(--primary);color:var(--primary); }
.tb-edit-foot { padding:14px 26px;border-top:1px solid var(--border-muted);display:flex;justify-content:flex-end;gap:10px;background:#fff;flex-shrink:0; }

@media (max-width: 700px) {
  .tb-edit-card { width:100%;height:100dvh;border-radius:0; }
  .tb-edit-fields { grid-template-columns:1fr;padding:16px; }
  .tb-edit-head { padding:16px; }
  .tb-edit-foot { padding:12px 16px;flex-direction:column;align-items:stretch; }
  .tb-edit-foot .btn { width:100%; }
  .tb-group-card { grid-template-columns:auto 1fr; }
  .tb-group-count { grid-column:1 / -1;text-align:left; }
}

/* Status change modal */
.status-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
  max-height: 300px; overflow-y: auto;
}
.status-option {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border: 2px solid transparent; border-radius: 8px; cursor: pointer;
  background: var(--bg, var(--surface-container)); transition: all .15s;
  min-height: 44px; /* mobile-friendly tap target */
}
.status-option input { display: none; }
.status-option span { font-size: 14px; font-weight: 600; color: var(--color, var(--on-surface)); }
.status-option:hover { border-color: var(--color, var(--primary)); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.status-option.selected { border-color: var(--color, var(--primary)); background: color-mix(in srgb, var(--bg, #e0f2fe) 70%, var(--color, var(--primary)) 30%); box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* Mail modal */
.mail-to-info {
  background: var(--surface-container-low); padding: 10px 14px; border-radius: 8px;
  font-size: 13px; color: var(--on-surface-variant); margin-top: 8px;
}
.mail-to-info strong { color: var(--on-surface); }
.mail-template-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mail-template-btns .btn { font-size: 12px; }

/* Action tags */
.action-tag {
  display: inline-block; padding: 3px 10px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
}


/* Admin tab navigation */
.admin-tab-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 24px;
  width: fit-content;
}
.admin-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}
.admin-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Lead detail — lớp cơ sở */
#leadDetailModal { z-index: 1001 !important; }

/* Modal action — nằm trên detail */
#statusModal,
#scheduleModal,
#leadEditModal { z-index: 1100 !important; }

/* Mail — nằm trên các action modal khác */
#mailModal { z-index: 1110 !important; }

/* Login — lớp cao nhất */
#loginModal { z-index: 2000 !important; }

/* Batch action bar */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-variant);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  flex-wrap: wrap;
}
.batch-bar select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
  font-family: inherit;
  font-size: 14px;
}

/* Batch bar */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-variant);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  flex-wrap: wrap;
}
.batch-bar select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
}
.batch-bar .btn { margin-left: auto; }
.batch-count {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}
.batch-status-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.batch-status-options label {
  padding: 10px 14px;
  border: 2px solid var(--border-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s;
}
.batch-status-options input[type="radio"] { display: none; }
.batch-status-options input[type="radio"]:checked + span {
  text-decoration: underline;
  font-weight: 700;
}
.batch-status-options label:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.batch-status-options .bs-moi { background: #e0f2fe; color: #0891b2; }
.batch-status-options .bs-dangtuyen { background: #dcfce7; color: #16a34a; }
.batch-status-options .bs-dadong { background: #f3f4f6; color: #6b7280; }

.batch-status-options .bs-sapdong { background: #fef9c3; color: #ca8a04; }
.batch-status-options .bs-dahethan { background: #fef3c7; color: #92400e; }

/* ===== Job Detail Page ===== */
.jd-page { padding-top: 100px; padding-bottom: 60px; min-height: 80vh; }
.jd-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--on-surface-variant); margin-bottom: 24px; font-weight: 500; }
.jd-back:hover { color: var(--primary); }
.jd-back svg { width: 18px; height: 18px; }
.jd-detail { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) { .jd-detail { grid-template-columns: 2fr 1fr; } }
.jd-main { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-muted); overflow: hidden; }
.jd-banner { width: 100%; aspect-ratio: 16 / 7; overflow: hidden; position: relative; line-height: 0; }
.jd-banner svg, .jd-banner img { width: 100%; height: 100%; display: block; object-fit: cover; }
.jd-content { padding: 28px; }
.jd-content .meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 20px; }
.jd-content h1 { font-size: 26px; line-height: 1.3; margin-bottom: 4px; }
.jd-content .jd-desc { color: var(--on-surface-variant); margin-bottom: 8px; }
.jd-content h4 {
  font-family: 'Epilogue', sans-serif; font-size: 16px; margin: 20px 0 10px;
  display: flex; align-items: center; gap: 8px; color: var(--secondary);
}
.jd-content h4::before {
  content: ""; width: 4px; height: 18px; background: var(--primary); border-radius: 2px;
}
.jd-content ul { padding-left: 20px; color: var(--on-surface-variant); }
.jd-content li { margin-bottom: 6px; line-height: 1.55; }

.jd-sidebar { display: flex; flex-direction: column; gap: 16px; }
.jd-info-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-muted);
  padding: 24px; position: sticky; top: 100px;
}
.jd-info-card h3 { font-size: 18px; margin-bottom: 16px; }
.jd-info-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border-muted); }
.jd-info-row:last-child { border-bottom: none; }
.jd-info-icon { font-size: 20px; flex-shrink: 0; width: 32px; text-align: center; }
.jd-info-label { font-size: 12px; color: var(--on-surface-variant); }
.jd-info-value { font-size: 14px; font-weight: 600; }
.jd-apply-btn { width: 100%; margin-top: 16px; padding: 14px; font-size: 15px; }

.jd-loading { text-align: center; padding: 80px 20px; color: var(--on-surface-variant); }
.jd-not-found { text-align: center; padding: 80px 20px; color: var(--on-surface-variant); }
.jd-not-found h2 { margin-bottom: 12px; }

/* ===== Apply popup ===== */
.apply-popup-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.apply-popup-overlay.open { display: flex; }
.apply-popup {
  background: #fff; border-radius: var(--radius-lg); width: 100%;
  max-width: 640px; margin: 20px auto; overflow: hidden;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.apply-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-muted);
}
.apply-popup-header h3 { font-size: 20px; }
.apply-popup-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-container-low); display: grid; place-items: center;
  font-size: 20px; transition: background .15s;
}
.apply-popup-close:hover { background: var(--surface-container); }
.apply-popup-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
@media (max-width: 640px) {
  .apply-popup-overlay { align-items: flex-end; padding: 0; }
  .apply-popup { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; margin: 0; }
  .apply-popup-body { max-height: calc(92vh - 80px); }
  .lead-detail-photo { width: 140px; height: 140px; }
}

.form-step { display: none; }
.form-step.active { display: block; animation: fadeUp .25s ease; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border-muted); color: var(--on-surface);
  padding: 12px 20px; border-radius: var(--radius); font-weight: 600; cursor: pointer; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.btn-outline:hover { border-color: var(--on-surface-variant); background: var(--surface-container-low); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.batch-status-options .bs-huy { background: #fee2e2; color: #dc2626; }

/* ===== Test result label (used in admin + test page) ===== */
.result-label { display: inline-block; padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.result-label.pass { background: #dcfce7; color: #16a34a; }
.result-label.warn { background: #fef9c3; color: #ca8a04; }
.result-label.fail { background: #fee2e2; color: #dc2626; }

/* ===== Test result item (used in admin modal + test page) ===== */
.result-item { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-muted); padding: 18px 20px; margin-bottom: 12px; }
.result-item.ok { border-left: 4px solid #16a34a; }
.result-item.wrong { border-left: 4px solid #dc2626; }
.result-item.blank { border-left: 4px solid #d1d5db; }
.result-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-item-num { font-weight: 700; font-size: 13px; color: var(--on-surface-variant); }
.result-item-status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.result-item.ok .result-item-status { background: #dcfce7; color: #16a34a; }
.result-item.wrong .result-item-status { background: #fee2e2; color: #dc2626; }
.result-item.blank .result-item-status { background: #f3f4f6; color: #6b7280; }

/* =====================================================
   MOBILE UX (≤ 900px / ≤ 768px / ≤ 480px)
   Mọi rule bên dưới nằm trong @media — KHÔNG ảnh hưởng desktop
   ===================================================== */

/* ----- Sidebar → Hamburger Drawer (≤ 900px) ----- */
.admin-mobile-bar { display: none; }
.admin-drawer-backdrop {
  display: block; position: fixed; inset: 0; z-index: 999;
  background: rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.admin-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .admin-mobile-bar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 100;
    height: 56px; padding: 0 14px;
    background: var(--secondary); color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  }
  .admin-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 9px 8px;
    background: transparent; border: none; cursor: pointer; border-radius: 8px;
    flex-shrink: 0;
  }
  .admin-burger:hover { background: rgba(255, 255, 255, .08); }
  .admin-burger span {
    display: block; width: 24px; height: 2px;
    background: #fff; border-radius: 1px;
    transition: transform .25s ease, opacity .2s ease;
    transform-origin: center;
  }
  .admin-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .admin-burger.open span:nth-child(2) { opacity: 0; }
  .admin-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .admin-mobile-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-mobile-home {
    color: rgba(255, 255, 255, .75);
    padding: 6px 10px; border-radius: 6px;
    font-size: 18px; text-decoration: none; flex-shrink: 0;
  }
  .admin-mobile-home:hover { background: rgba(255, 255, 255, .08); color: #fff; }

  /* Sidebar thành drawer overlay */
  .admin-side {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    z-index: 1000;
    height: 100vh; overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .2);
  }
  .admin-side.open { transform: translateX(0); }

  /* Khoảng trống phía dưới sidebar khi không còn grid 2 cột */
  .admin-shell { grid-template-columns: 1fr; }
}

/* ----- Table → Card view (≤ 768px) ----- */
@media (max-width: 768px) {
  /* Reset table-layout fixed để card co giãn tự nhiên */
  .lead-table.is-cardable { table-layout: auto; min-width: 0; }

  /* Ẩn thead visually nhưng vẫn accessible cho screen reader */
  .admin-table.is-cardable thead,
  .lead-table.is-cardable thead {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }

  .admin-table.is-cardable tbody tr,
  .lead-table.is-cardable tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    margin-bottom: 12px;
    padding: 6px 14px 12px;
  }
  .admin-table.is-cardable tbody tr:last-child,
  .lead-table.is-cardable tbody tr:last-child { margin-bottom: 0; }

  .admin-table.is-cardable td,
  .lead-table.is-cardable td {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
  }
  .admin-table.is-cardable td:last-child,
  .lead-table.is-cardable td:last-child { border-bottom: none; padding-top: 12px; }

  /* Label trái, value phải */
  .admin-table.is-cardable td::before,
  .lead-table.is-cardable td::before {
    content: attr(data-label);
    flex: 0 0 90px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: #6b7280;
    line-height: 1.3;
  }
  .admin-table.is-cardable td > *,
  .lead-table.is-cardable td > * { flex: 1; min-width: 0; }

  /* Cell ảnh (banner/thumb) full-width ở đầu card */
  .admin-table.is-cardable td.td-img,
  .lead-table.is-cardable td.td-img {
    display: block; padding: 0 0 10px;
  }
  .admin-table.is-cardable td.td-img::before,
  .lead-table.is-cardable td.td-img::before { display: none; }
  .admin-table.is-cardable td.td-img img,
  .admin-table.is-cardable td.td-img .ph,
  .lead-table.is-cardable td.td-img img,
  .lead-table.is-cardable td.td-img .ph {
    width: 100%; height: 140px; max-width: none;
    object-fit: cover;
  }
  /* Lead thumbnail: giữ tỉ lệ portrait gốc */
  .lead-table.is-cardable td.td-img img { height: auto; max-height: 240px; aspect-ratio: 4 / 5; }
  /* Bỏ clamp desktop ở mobile */
  .lead-table.is-cardable .lead-name { -webkit-line-clamp: unset; display: block; }
  .lead-table.is-cardable .lead-position { -webkit-line-clamp: unset; display: block; }

  /* Action row ở cuối card — wrap + full-width buttons */
  .admin-table.is-cardable td.admin-actions-cell,
  .lead-table.is-cardable td.admin-actions-cell {
    flex-wrap: wrap; justify-content: flex-end;
    padding-top: 12px; gap: 6px;
  }
  .admin-table.is-cardable td.admin-actions-cell::before,
  .lead-table.is-cardable td.admin-actions-cell::before { flex-basis: 100%; content: ""; height: 0; }

  /* Empty row hiển thị gọn */
  .admin-table.is-cardable .empty-row,
  .lead-table.is-cardable .empty-row {
    display: block; padding: 24px 14px; text-align: center;
    color: var(--on-surface-variant);
  }
  .admin-table.is-cardable .empty-row td,
  .lead-table.is-cardable .empty-row td { display: block; border: none; padding: 0; }
  .admin-table.is-cardable .empty-row td::before,
  .lead-table.is-cardable .empty-row td::before { display: none; }

  /* Toolbar stack dọc */
  .admin-toolbar {
    flex-direction: column; align-items: stretch;
  }
  .admin-toolbar input,
  .admin-toolbar select { width: 100%; }

  /* Batch bar stack dọc */
  .batch-bar {
    flex-direction: column; align-items: stretch;
  }
  .batch-bar select,
  .batch-bar .btn { width: 100%; margin: 0; }
  .batch-bar select { margin-top: 6px; }
  .batch-bar .btn + .btn { margin-top: 6px; }

  /* Touch target lớn hơn */
  .icon-btn {
    padding: 8px 14px; font-size: 13px; min-height: 36px;
  }
  .page-btn {
    width: 40px; height: 40px; font-size: 14px;
  }

  /* Modal full-screen */
  .admin-modal {
    padding: 0; align-items: stretch;
  }
  .admin-modal-card {
    margin: 0; border-radius: 0; max-width: 100%;
    width: 100%; max-height: 100vh; max-height: 100dvh;
    height: 100dvh; padding: 18px 16px;
    animation: slideUp .25s cubic-bezier(.2, .9, .3, 1);
  }
  .admin-modal-card h2 { font-size: 18px; margin-bottom: 12px; }
  .admin-form-foot.sticky-foot {
    margin: 0 -16px; padding: 12px 16px 18px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .08);
    border-top: 1px solid var(--border-muted);
  }

  /* Padding main thu nhỏ cho gọn */
  .admin-main { padding: 16px 14px; }

  /* Lead detail card thu nhỏ padding */
  .lead-detail-card { padding: 14px; }
  .lead-detail-grid { padding: 0 14px 14px; }
  .lead-detail-foot { padding: 12px 14px; flex-direction: column; align-items: stretch; }
  .lead-detail-foot .btn { width: 100%; }

  /* Lead detail modal — restructure thành flex column để foot luôn sticky bottom,
     tránh bộ nút che mất phần "Vị trí ứng tuyển" khi cuộn */
  .lead-detail-card {
    display: flex; flex-direction: column;
    max-height: 100dvh;
    height: 100dvh;
    width: 100%;
    margin: 0; /* bỏ margin 20px 0 từ base — tránh gap trên/dưới viewport */
    max-width: 100%;
    overflow: hidden; /* thay overflow-y: auto — grid sẽ lo việc cuộn */
    border-radius: 0;
    background: var(--surface-container-low); /* nền body chính - tone nhẹ */
  }

  /* Topbar: × icon trái + tiêu đề, nền tương phản nhẹ với body */
  .lead-detail-topbar {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 12px;
    height: 52px; padding: 0 8px 0 4px;
    background: var(--surface-container-low);
    border-bottom: 1px solid var(--border-muted);
    position: relative; z-index: 4;
  }
  .lead-detail-close {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: transparent; border: none;
    border-radius: 50%; cursor: pointer;
    font-size: 24px; line-height: 1; color: var(--on-surface);
    flex-shrink: 0;
    transition: background .15s;
  }
  .lead-detail-close:hover, .lead-detail-close:active {
    background: rgba(0, 0, 0, .06);
  }
  .lead-detail-title {
    font-family: 'Epilogue', sans-serif;
    font-size: 16px; font-weight: 700;
    color: var(--on-surface);
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lead-detail-nav-mobile {
    display: flex; gap: 6px; align-items: center; flex-shrink: 0;
  }
  .lead-detail-nav-mobile .lead-nav-btn {
    width: 36px; height: 36px; padding: 0;
    border-radius: 50%; display: grid; place-items: center;
    font-size: 18px; font-weight: 700;
  }

  /* Head: avatar + name + meta, nền trắng để tương phản với topbar/foot */
  .lead-detail-head {
    flex-shrink: 0;
    padding: 14px 16px 12px;
    background: #fff;
    border-bottom: 1px solid var(--border-muted);
  }
  .lead-detail-head > div { gap: 12px !important; }
  /* Ảnh đại diện thu nhỏ ~100×100 trên mobile (giữ 200×200 desktop) */
  .lead-detail-photo {
    width: 100px !important; height: 100px !important;
    max-width: 100px; max-height: 100px;
  }
  .lead-detail-photo img {
    max-width: 100px; max-height: 100px;
  }
  .lead-detail-info h2 { font-size: 18px; line-height: 1.25; }
  .lead-quickview { grid-template-columns: 1fr; gap: 5px; margin-top: 10px; font-size: 12px; }
  .lead-detail-meta { gap: 8px; font-size: 12px; }
  .lead-detail-score, .lead-detail-id { font-size: 12px; }

  /* Grid body: scrollable, nền trắng */
  .lead-detail-grid {
    flex: 1; min-height: 0; /* quan trọng: cho phép grid co lại và cuộn */
    overflow-y: auto;
    padding: 12px 16px 16px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
  }
  .lead-detail-grid .lead-detail-section { margin-top: 16px; }
  .lead-detail-grid h4 { font-size: 13px; margin-bottom: 8px; }
  .detail-row { padding: 5px 0; font-size: 12px; gap: 8px; }
  .detail-row > span:first-child { min-width: 96px; font-size: 11px; }
  .lead-reason p { padding: 10px; font-size: 13px; }

  /* Foot: float bar 2 hàng — primary (Chuyển trạng thái + Gửi mail),
     secondary (Sửa + Xóa minimal), rồi dates. Nền tương phản nhẹ với body */
  .lead-detail-foot {
    flex-shrink: 0;
    padding: 10px 12px 14px;
    gap: 8px;
    background: var(--surface-container-low);
    border-top: 1px solid var(--border-muted);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .06);
    z-index: 3;
  }
  .lead-detail-actions-primary {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .lead-detail-actions-primary .btn {
    width: 100%; min-height: 44px;
    font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .lead-detail-actions-secondary {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .lead-detail-actions-secondary .btn {
    width: 100%; min-height: 40px;
    font-size: 13px; font-weight: 600;
    background: transparent; border: 1px solid var(--border-muted);
    color: var(--on-surface);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 12px;
  }
  .lead-detail-actions-secondary .btn:active { transform: scale(.97); }
  .lead-detail-dates {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 11px; color: var(--on-surface-variant);
    padding-top: 4px;
    border-top: 1px dashed var(--border-muted);
    margin-top: 2px;
  }
}

/* ----- Extra-tight (≤ 480px) ----- */
@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-head h1 { font-size: 22px; }
  .admin-head p { font-size: 13px; }
  .admin-table.is-cardable td::before,
  .lead-table.is-cardable td::before { flex-basis: 76px; font-size: 10px; }
  /* Brand text trên sidebar ẩn (nếu có trong drawer) — đã có sẵn ở 480 trong site header, áp dụng tương tự */
  .admin-side .brand-text { display: none; }
}

/* =====================================================
   INTERVIEW QUESTIONS PAGE (cau-hoi-phong-van.html)
   ===================================================== */
.position-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.position-card { background: #fff; border: 1px solid var(--border-muted); border-radius: var(--radius-lg); padding: 22px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: 8px; }
.position-card:hover, .position-card:focus { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); border-color: var(--primary); outline: none; }
.position-card .icon { font-size: 30px; line-height: 1; }
.position-card .title { font-weight: 700; font-size: 16px; color: var(--secondary); }
.position-card .desc { font-size: 13px; color: var(--on-surface-variant); flex: 1; }
.position-card .meta { font-size: 12px; color: var(--outline); display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border-muted); }
.position-card .meta .badge { background: var(--primary); color: #fff; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 11px; }

.ivq-section { margin-bottom: 24px; }
.ivq-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: var(--surface-container-low); border-left: 4px solid var(--primary); }
.ivq-section.highlight .ivq-section-head { background: #fff7d6; border-left-color: #d4a017; }
.ivq-section-head h3 { font-size: 15px; font-weight: 700; margin: 0; color: var(--secondary); }
.ivq-section-head .count { margin-left: auto; font-size: 12px; color: var(--on-surface-variant); }
.ivq-q { padding: 10px 14px; background: var(--surface-container-lowest); border: 1px solid var(--border-muted); border-radius: 8px; margin-bottom: 8px; display: flex; gap: 8px; }
.ivq-q .num { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.ivq-q .answer { margin-top: 8px; padding: 8px 12px; background: #fff7d6; border-radius: 6px; font-size: 13px; color: #5b4500; }
.ivq-q .answer strong { color: #b45309; }
.ivq-shared-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: rgba(228,35,39,.1); color: var(--primary); border-radius: 999px; vertical-align: middle; }
.ivq-en-tag { display: inline-block; margin-left: 4px; padding: 2px 8px; font-size: 11px; font-weight: 700; background: #1d4ed8; color: #fff; border-radius: 999px; vertical-align: middle; letter-spacing: .05em; }

.modal-close { position: absolute; top: 14px; right: 14px; background: var(--surface-container); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; color: var(--on-surface-variant); transition: background .15s, color .15s; }
.modal-close:hover { background: var(--primary); color: #fff; }

@media (max-width: 700px) {
  .position-grid { grid-template-columns: 1fr; }
}
