/* Ensure Be Vietnam Pro is explicitly applied everywhere in UI */
html, body, button, input, select, textarea, p, span, a, h1, h2, h3, h4, h5, h6, div, label {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Administrative document paper explicitly uses Times New Roman as mandated by Decree 30 */
.a4-sheet, .a4-sheet * {
  font-family: 'Times New Roman', Times, serif !important;
}

/* ====================================================================
   BÉ AN HCNS - MODERN, PROFESSIONAL & UNISEX-FRIENDLY CSS
   Design System: Indigo Clarity & Executive Soft Minimalism
   ==================================================================== */

:root {
  /* VietNote-inspired Official Design Tokens */
  --brand: #4F46E5;
  --brand-strong: #4338CA;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --primary-glow: rgba(79, 70, 229, 0.25);

  /* Signature Accent Gradient (Indigo → Violet) */
  --accent: linear-gradient(100deg, #4F46E5 0%, #6D28D9 50%, #7C3AED 100%);
  --gradient-vietnote: linear-gradient(100deg, #4F46E5 0%, #6D28D9 50%, #7C3AED 100%);
  --accent-gradient: linear-gradient(100deg, #4F46E5 0%, #6D28D9 50%, #7C3AED 100%);
  --magenta: #6D28D9;
  --blush: #e7e5ec;
  --mist: #f4f3f7;

  --secondary: #8B5CF6;
  --secondary-light: #F3EEFF;
  --accent-peach: #FF8A65;
  --accent-peach-light: #FFF3E0;
  --accent-mint: #10B981;
  --accent-mint-light: #E8F8F2;
  --accent-amber: #F59E0B;
  --accent-amber-light: #FEF3C7;
  --accent-blue: #3B82F6;
  --accent-blue-light: #EFF6FF;

  /* VietNote Ultra-Clean Paper Backgrounds */
  --bg-body: #fbfbfc;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-2: #f5f5f7;
  --bg-soft: #f7f7f9;
  --bg-alt: #f4f3f7;

  /* VietNote Hairline Borders */
  --border-color: #ebeaef;
  --border-strong: #dddbe3;
  --border-light: #f4f3f7;
  --border-focus: #6D28D9;

  /* VietNote Ink Typography */
  --text-title: #17151c;
  --text-main: #2d2a36;
  --text-muted: #5d5a66;
  --text-light: #9a97a3;

  /* Squircle Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* VietNote High-End Elevation */
  --shadow-sm: 0 1px 2px rgba(23, 21, 28, 0.04), 0 4px 14px rgba(23, 21, 28, 0.035);
  --shadow-md: 0 2px 6px rgba(23, 21, 28, 0.04), 0 12px 30px -8px rgba(23, 21, 28, 0.08);
  --shadow-lg: 0 2px 6px rgba(23, 21, 28, 0.04), 0 24px 60px -16px rgba(23, 21, 28, 0.14);
  --shadow-brand: 0 10px 26px -10px rgba(79, 70, 229, 0.55);
  --shadow-hover: 0 12px 32px rgba(79, 70, 229, 0.22);

  /* Font Stacks */
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-serif: 'Times New Roman', Times, serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-title);
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

.wrap {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 16px;
}

/* NAVIGATION BAR */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 252, 0.88);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 0 var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-title);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
}

.brand-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 12px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.brand-icon-wrapper::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  transform: rotate(30deg);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-item a, .nav-item button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.nav-item a:hover, .nav-item button:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-action-btn {
  background: var(--accent-gradient) !important;
  color: white !important;
  box-shadow: var(--shadow-brand);
  padding: 9px 18px !important;
  border-radius: var(--radius-pill);
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.nav-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-main);
}

/* BUTTONS & PILLS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px -8px rgba(79, 70, 229, 0.65);
  transform: translateY(-2px);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--primary-dark);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-purple {
  background: linear-gradient(135deg, #9061F9 0%, #7E3AF2 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(144, 97, 249, 0.25);
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(144, 97, 249, 0.35);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

/* BADGES & CHIPS */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip-pink {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #FFD3E0;
}

.chip-purple {
  background: var(--secondary-light);
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.chip-green {
  background: var(--accent-mint-light);
  color: #047857;
  border: 1px solid #A7F3D0;
}

.chip-amber {
  background: var(--accent-amber-light);
  color: #B45309;
  border: 1px solid #FDE68A;
}

.chip-blue {
  background: var(--accent-blue-light);
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

/* HERO SECTION */
.hero-sec {
  padding: 48px 0 32px;
  background: radial-gradient(circle at 10% 20%, rgba(255, 225, 235, 0.7) 0%, rgba(255, 245, 248, 0.4) 50%, transparent 80%),
              radial-gradient(circle at 90% 80%, rgba(240, 230, 255, 0.6) 0%, transparent 60%);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid #FFCCD9;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(255, 94, 142, 0.12);
  width: fit-content;
}

.hero-title {
  font-size: 2.75rem;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--text-title);
}

.hero-title-highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-stats-row {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-title);
}

.stat-num-pink {
  color: var(--primary);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* MASCOT INTERACTIVE STAGE */
.mascot-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid #FFD8E3;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF7F9 100%);
}

.mascot-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 110, 150, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.mascot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mascot-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mascot-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE1EB 0%, #FF85A2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid white;
  box-shadow: 0 4px 14px var(--primary-glow);
  position: relative;
}

.mascot-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid white;
}

.mascot-name-col {
  display: flex;
  flex-direction: column;
}

.mascot-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mascot-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mascot-dialogue-bubble {
  background: white;
  border: 1.5px solid #FFD0DD;
  border-radius: 18px 18px 18px 4px;
  padding: 16px 20px;
  position: relative;
  box-shadow: 0 4px 14px rgba(255, 94, 142, 0.08);
}

.mascot-quote-text {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--text-main);
  font-style: normal;
}

.mascot-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mascot-action-pill {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.mascot-action-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* WORKSTATION TABS & TOOLS */
.workstation-sec {
  padding: 40px 0 60px;
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.1rem;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.tool-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.tool-card:hover, .tool-card.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF9FA 100%);
}

.tool-card.active::after {
  content: 'ĐANG CHỌN';
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: white;
}

.tool-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.tool-icon-pink {
  background: #FFE8F0;
  color: #FF3D73;
}

.tool-icon-purple {
  background: #EFE9FF;
  color: #7C3AED;
}

.tool-icon-mint {
  background: #E6F8F0;
  color: #059669;
}

.tool-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-title);
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex-grow: 1;
}

.tool-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-main);
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.tool-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-features-list li::before {
  content: '✓';
  color: var(--accent-mint);
  font-weight: bold;
}

/* INTERACTIVE DOCUMENT STUDIO */
.studio-container {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 10px;
}

.studio-top-bar {
  background: #FDF9FA;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.studio-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.studio-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.step-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.step-chip.done {
  background: #E8F8F2;
  border-color: #A7F3D0;
  color: #047857;
}

.studio-main-body {
  padding: 24px 20px;
}

/* DRAG & DROP UPLOAD BOX */
.upload-dropzone {
  border: 2.5px dashed #FFB6CB;
  background: #FFF9FA;
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: #FFF0F4;
  transform: scale(1.005);
}

.upload-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: 0 6px 18px rgba(255, 94, 142, 0.15);
  border: 2px solid #FFE4EC;
}

.upload-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-title);
}

.upload-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 480px;
}

.quick-sample-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.quick-sample-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: white;
  border: 1px solid #FFD3E0;
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-sample-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* AUDIT REPORT & BEFORE/AFTER SPLIT VIEW */
.audit-dashboard {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  transition: all 0.3s ease;
}

@media (min-width: 1025px) and (max-width: 1240px) {
  .audit-dashboard {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

.audit-dashboard.collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
  gap: 0;
}

.audit-dashboard.collapsed .audit-sidebar {
  display: none !important;
}

.audit-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.score-card {
  background: linear-gradient(135deg, #FFF7F9 0%, #FFFFFF 100%);
  border: 1.5px solid #FFD0DD;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.score-number-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-big {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.score-max {
  font-size: 1.2rem;
  color: var(--text-light);
  font-weight: 600;
}

.score-status-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #059669;
  background: #E8F8F2;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.score-bar-bg {
  width: 100%;
  height: 8px;
  background: #F0E6EA;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 10px 0;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B8B 0%, #10B981 100%);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

.findings-panel {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
}

.finding-item {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.2s;
}

.finding-item.fixed {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.finding-item.warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
}

.finding-icon {
  font-size: 16px;
  margin-top: 2px;
}

.finding-content h4 {
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.finding-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* DOCUMENT PREVIEW CONTAINER (A4 PAPER LOOK) */
.preview-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: #FDF7F9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.preview-mode-switch {
  display: flex;
  background: white;
  padding: 2px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.mode-btn {
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* ZOOM CONTROLLER */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.zoom-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-title);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: #FCE7F0;
  color: var(--primary-dark);
}

.zoom-btn.active {
  background: var(--primary);
  color: white;
}

.zoom-level-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0 6px;
  min-width: 38px;
  text-align: center;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.a4-paper-wrapper {
  background: #3e4246;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  box-sizing: border-box;
  width: 100%;
  max-width: 824px;
  margin: 0 auto;
  transition: max-width 0.25s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.18);
}

.a4-paper-wrapper.split-mode-active,
.audit-dashboard.collapsed .a4-paper-wrapper {
  max-width: 100% !important;
}

.a4-sheet {
  background: white;
  width: 794px; /* Standard A4 width @ 96 DPI (210mm) */
  min-height: 1123px; /* Standard A4 height @ 96 DPI (297mm) */
  padding: 25mm 20mm 20mm 30mm; /* Standard ND30 margins */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: var(--font-serif);
  font-size: 13pt;
  line-height: 1.35;
  color: #000;
  position: relative;
  box-sizing: border-box;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

.a4-sheet.split-mode {
  width: 100% !important;
  max-width: 100% !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  zoom: 1 !important;
  transform: none !important;
}

/* MẪU VĂN BẢN SHOWCASE (44 LOẠI) */
.templates-section {
  padding: 50px 0 60px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.filter-pill {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover, .filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tpl-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.tpl-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.tpl-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-title);
}

.tpl-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.tpl-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* OFFICE FUN & MASCOT BANTER */
.office-skits-section {
  padding: 50px 0;
}

.skits-card-container {
  background: white;
  border-radius: var(--radius-xl);
  border: 1.5px solid #FFD3E0;
  padding: 36px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
  align-items: center;
}

.cast-lineup {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cast-member-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: #FFF9FA;
  border: 1px solid #FFE0E9;
  cursor: pointer;
  transition: all 0.2s;
}

.cast-member-pill:hover, .cast-member-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateX(4px);
}

.cast-emoji {
  font-size: 24px;
}

.cast-info h5 {
  font-size: 0.95rem;
  color: var(--text-title);
}

.cast-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.skit-story-box {
  background: linear-gradient(135deg, #FFF9FA 0%, #FBF6FF 100%);
  border: 1.5px solid #FFDEE7;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}

.skit-time-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.skit-speech {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-title);
  margin-bottom: 16px;
  font-weight: 500;
}

/* FAQ ACCORDION */
.faq-section {
  padding: 50px 0 70px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
}

.faq-item:hover {
  border-color: var(--primary);
}

.faq-question {
  padding: 18px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-title);
  user-select: none;
}

.faq-toggle-icon {
  font-size: 20px;
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-item.open .faq-toggle-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 22px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* FOOTER */
.site-footer {
  margin-top: auto;
  background: #1B1E34;
  color: #B5B9D0;
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #9297B6;
  max-width: 340px;
}

.footer-col h4 {
  color: white;
  font-size: 1.02rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #9EA3C2;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #FF7EB3;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: #727797;
  flex-wrap: wrap;
  gap: 12px;
}

/* MODAL & TOAST */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 36, 0.55);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  position: relative;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F3F4F6;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #E5E7EB;
  color: var(--text-title);
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1F2438;
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .tool-cards-grid {
    grid-template-columns: 1fr;
  }
  .audit-dashboard {
    grid-template-columns: 1fr;
  }
  .skits-card-container {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.1rem;
  }
}

/* ==========================================
   AUTH DIALOG & ACCOUNT HUB SYSTEM
   ========================================== */
.auth-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  max-width: 480px;
  width: 90vw;
  background: white;
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.auth-dialog-content {
  padding: 32px;
  position: relative;
}

.auth-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ACCOUNT HERO & TABS */
.ac-hero-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-color);
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.ac-user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ac-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6B8B 0%, #D8436E 100%);
  color: white;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 107, 139, 0.35);
}

.ac-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #F1E5E9;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ac-nav-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ac-nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ac-nav-tab:hover {
  color: var(--text-title);
}

/* 14-DAY ACTIVITY BARS */
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  padding: 10px 0;
  margin-top: 10px;
}

.activity-bar-col {
  flex: 1;
  background: #FFE4EC;
  border-radius: 4px;
  min-height: 8px;
  transition: background 0.2s ease;
  cursor: pointer;
  position: relative;
}

.activity-bar-col.has-activity {
  background: var(--primary);
}

.activity-bar-col:hover {
  filter: brightness(0.9);
}

/* BADGE STYLING */
.badge-item-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.badge-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.badge-item-card.locked {
  filter: grayscale(0.85);
  opacity: 0.65;
  background: #FAFAFA;
}

.badge-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 4px;
  background: #FFF0F4;
}


/* ====================================================================
   5 UX/UI ENHANCEMENTS: ABOVE-THE-FOLD MINI DROPZONE, FOCUS MODE,
   LIVE SEARCH, VISUAL DIFF HIGHLIGHT & SMART AUTOCOMPLETE
   ==================================================================== */

/* 1. HERO MINI-DROPZONE (ABOVE THE FOLD) */
.hero-mini-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #ffffff;
  border: 2px dashed #4F46E5;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}

.hero-mini-dropzone:hover, .hero-mini-dropzone.dragover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.mini-drop-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mini-drop-emoji {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.mini-drop-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-drop-text strong {
  font-size: 0.92rem;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-drop-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 2. LIVE TEMPLATE SEARCH BAR */
.tpl-search-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tpl-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 600px;
}

.tpl-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.tpl-search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.tpl-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.tpl-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #ebeaef;
  color: #5d5a66;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

.tpl-search-count {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
  background: #f7f7f9;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

/* 3. FOCUS MODE (TOÀN MÀN HÌNH CHUYÊN NGHIỆP) */
body.in-focus-mode {
  overflow: hidden !important;
}

.focus-overlay-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #18191d;
  flex-direction: column;
}

.focus-overlay-modal.active {
  display: flex;
}

.focus-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(23, 25, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #2d3038;
  color: #f3f4f6;
  flex-shrink: 0;
  gap: 16px;
}

.focus-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.focus-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.focus-paper-body {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px 80px;
  background: #111215;
}

/* 4. VISUAL DIFF HIGHLIGHT (ANNOTATIONS TRỰC QUAN TRÊN GIẤY A4) */
.diff-highlight-on .diff-tag-error {
  display: inline-block !important;
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #F87171;
  font-size: 9pt;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.diff-highlight-on .diff-tag-fixed {
  display: inline-block !important;
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #34D399;
  font-size: 9pt;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.diff-tag-error, .diff-tag-fixed {
  display: none;
}

/* 5. SMART PRESETS IN SOAN-THAO.HTML */
.smart-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #EEF2FF;
  border-radius: var(--radius-md);
  border: 1px solid #C7D2FE;
}

.smart-preset-chip {
  background: #ffffff;
  border: 1px solid #4F46E5;
  color: #4338CA;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.smart-preset-chip:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* GRAMMARLY VIETNAMESE SPELLING & CAPITALIZATION STYLES */
/* Mặc định trên trang giấy A4: Sạch sẽ 100%, không hiện gạch chân lượn sóng gây hiểu lầm là lỗi */
.grammarly-fix {
  text-decoration: none !important;
  background: transparent !important;
  color: inherit !important;
}

/* Chỉ khi bật chế độ Highlight lỗi (.diff-highlight-on) trên A4 Wrapper */
.diff-highlight-on .grammarly-fix {
  text-decoration: underline wavy #10b981 1.5px !important;
  background: rgba(16, 185, 129, 0.08) !important;
  border-radius: 3px;
  padding: 0 2px;
  position: relative;
  cursor: help;
  transition: all 0.2s ease;
}

.diff-highlight-on .grammarly-fix:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.diff-highlight-on .grammarly-fix.grammarly-cap {
  text-decoration: underline wavy #0284c7 1.5px !important;
  background: rgba(2, 132, 199, 0.08) !important;
}

.diff-highlight-on .grammarly-fix.grammarly-cap:hover {
  background: rgba(2, 132, 199, 0.22) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.grammarly-err {
  text-decoration: underline wavy #ef4444 1.5px !important;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c !important;
  border-radius: 3px;
  padding: 0 2px;
  cursor: help;
}

.grammarly-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
