/* ==========================================================================
   SafeSchool Vietnam — Layout & Design System from Quan_ly_thoi_gian
   Sleek Obsidian & Glassmorphism + Interactive Smart Watch + Messenger
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap&subset=vietnamese');

:root {
  --font-primary: 'Be Vietnam Pro', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-display: 'Be Vietnam Pro', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-heading: 'Be Vietnam Pro', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-mono: 'Be Vietnam Pro', 'Segoe UI', Consolas, monospace;

  /* Modern Light Theme System (Default): White, Pastel Sky Blue, Mint, Cyan */
  --bg-main: #f4f9ff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.82);
  --bg-elevated: #ffffff;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-highlight: rgba(2, 132, 199, 0.4);

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-secondary: #475569;
  --text-dim: #94a3b8;

  --accent-primary: #0284c7;
  /* Pastel / Sky Blue */
  --accent-secondary: #06b6d4;
  /* Cyan */
  --accent-emerald: #10b981;
  /* Mint */
  --accent-amber: #f59e0b;
  /* Amber */
  --accent-rose: #f43f5e;
  /* Rose */

  /* Compatibility mappings for Messenger & Portals */
  --primary: #0284c7;
  --primary-soft: rgba(2, 132, 199, 0.12);
  --teal: #06b6d4;
  --teal-soft: rgba(6, 182, 212, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.14);

  --gradient-primary: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-dark: linear-gradient(180deg, rgba(2, 132, 199, 0.04) 0%, rgba(255, 255, 255, 0) 100%);

  --shadow-subtle: 0 10px 30px -10px rgba(37, 99, 235, 0.08);
  --shadow-glow: 0 0 40px rgba(2, 132, 199, 0.16);
  --shadow-screen: inset 0 0 20px rgba(15, 23, 42, 0.04);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Explicit */
[data-theme="light"] {
  --bg-main: #f4f9ff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --bg-elevated: #ffffff;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-highlight: rgba(2, 132, 199, 0.35);

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-secondary: #475569;
  --text-dim: #94a3b8;

  --shadow-subtle: 0 10px 25px -5px rgba(37, 99, 235, 0.08);
  --shadow-glow: 0 0 35px rgba(2, 132, 199, 0.14);
}

/* Dark Mode Overrides (when toggled via Theme Switcher) */
[data-theme="dark"] {
  --bg-main: #0a0e17;
  --bg-card: rgba(18, 25, 41, 0.76);
  --bg-card-hover: rgba(28, 38, 62, 0.9);
  --bg-card-glass: rgba(255, 255, 255, 0.04);
  --bg-elevated: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-highlight: rgba(99, 102, 241, 0.45);

  --text-main: #f1f5f9;
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --shadow-subtle: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
  --shadow-screen: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

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

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Background Ambient Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.45;
  transition: opacity var(--transition-smooth);
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #bae6fd 0%, transparent 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  top: 40%;
  left: -200px;
  background: radial-gradient(circle, #a7f3d0 0%, transparent 70%);
}

.glow-3 {
  width: 500px;
  height: 500px;
  bottom: 5%;
  right: -150px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Navigation Bar (EcoLife Header Architecture)
   ========================================================================== */
.nav-bar,
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.72rem 0;
  transition: padding var(--transition-smooth), box-shadow var(--transition-smooth);
}

/* Keep backdrop-filter on ::before so .site-header never creates a containing block for position:fixed #navMenu */
.nav-bar::before,
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.site-header.scrolled,
.nav-bar.scrolled {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  padding: 0.54rem 0;
}

.site-header.scrolled::before,
.nav-bar.scrolled::before {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .nav-bar::before,
[data-theme="light"] .site-header::before {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
}

[data-theme="light"] .site-header.scrolled::before,
[data-theme="light"] .nav-bar.scrolled::before {
  background: rgba(255, 255, 255, 0.96);
}

[data-theme="dark"] .nav-bar,
[data-theme="dark"] .site-header {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-bar::before,
[data-theme="dark"] .site-header::before {
  background: rgba(10, 15, 29, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .site-header.scrolled::before,
[data-theme="dark"] .nav-bar.scrolled::before {
  background: rgba(10, 15, 29, 0.96);
}

.nav-mobile-only,
.nav-drawer-backdrop {
  display: none;
}

#hero-header {
  scroll-margin-top: var(--header-height, 64px);
}

#kien-thuc-bao-luc,
#actions,
section[id] {
  scroll-margin-top: calc(var(--header-height, 64px) + 12px);
}

.nav-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(0.85rem, 1.8vw, 1.6rem);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.55rem, 1vw, 1.1rem);
}

.nav-bar nav[aria-label="Primary Navigation"] {
  min-width: 0;
  flex-shrink: 1;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #10b981, #0284c7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
  filter: none;
  flex-shrink: 0;
}

.brand-logo span.highlight {
  color: var(--primary);
}

[data-theme="dark"] .brand-logo span.highlight {
  color: #38bdf8;
}

/* Center Nav Menu with sliding underline */
.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.2vw, 1.35rem);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.nav-link {
  font-size: clamp(0.84rem, 0.9vw, 0.93rem);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding: 0.4rem 0;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  color: #38bdf8;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-fast);
  border-radius: var(--radius-full);
}

[data-theme="dark"] .nav-link::after {
  background: #38bdf8;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Right Utility Switcher & CTA */
.header-actions,
.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.38rem, 0.6vw, 0.6rem);
  min-width: 0;
  flex-shrink: 1;
}

#loggedInUserBadge.nav-logged-badge,
#loggedInUserBadge {
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: clamp(165px, 18vw, 250px);
  flex-shrink: 1;
}

#loggedInUserName.nav-logged-name,
#loggedInUserName {
  display: block;
  min-width: 0;
  max-width: clamp(110px, 13vw, 180px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 4px 10px;
  border-radius: 999px;
}

#loggedInUserBadge .nav-logged-logout {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 4px 10px;
  font-size: 0.75rem;
}

#mobileLoggedInNameBtn {
  min-width: 0;
  flex: 1;
}

#mobileLoggedInName {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .utility-switcher {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

.utility-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.utility-btn:hover,
.utility-auth-btn {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .utility-btn:hover,
[data-theme="dark"] .utility-auth-btn {
  background: rgba(15, 23, 42, 0.9);
  color: #38bdf8;
}

.btn-header-sos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.32);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-header-sos:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.42);
}

.btn-pulse {
  animation: sosGentlePulse 2.5s infinite;
}

@keyframes sosGentlePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.42);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(244, 63, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
  }
}

.mobile-toggle {
  display: none;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.mobile-toggle:hover {
  background: rgba(148, 163, 184, 0.14);
}

.mobile-toggle-icon {
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  pointer-events: none;
}

.mobile-toggle .icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.mobile-toggle[aria-expanded="true"] .icon-hamburger {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.mobile-toggle[aria-expanded="true"] .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.pill-mini {
  padding: 5px 12px !important;
  font-size: 0.8rem !important;
  height: 32px !important;
  display: inline-flex;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

.pill-mini[style*="display: none"],
.pill-mini[style*="display:none"],
#btnBackToHome[style*="none"] {
  display: none !important;
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-primary);
}

.cta-pill {
  background: var(--gradient-primary);
  color: #ffffff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.cta-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.pill-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-ghost:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.pill-sos {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fb7185;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-sos:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* ==========================================================================
   1. Header / Hero Section (Exact Quan_ly_thoi_gian style)
   ========================================================================== */
#hero-header {
  padding: 5.5rem 2rem 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(56, 189, 248, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(240, 249, 255, 0.94) 85%, #ffffff 100%),
    url('img/Picture14.png') center top / cover no-repeat;
  border-bottom: 1px solid rgba(224, 242, 254, 0.8);
}

[data-theme="dark"] #hero-header {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(99, 102, 241, 0.28), transparent 70%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.95) 85%, #0f172a 100%),
    url('img/Picture14.png') center top / cover no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   KHỐI TRÌNH DIỄN MINH HỌA Ý NGHĨA FLANKING CÂU TRÍCH DẪN HERO
   Tiêu đề chính được tách độc lập 100% bên trên, tuyệt đối không bị chèn ép.
   ========================================================================== */
.hero-showcase-row {
  position: relative;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  z-index: 2;
}

.hero-showcase-row .hero-quote {
  margin: 0;
  flex: 1 1 560px;
  max-width: 680px;
}

.hero-title-character {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.hero-title-character.char-left {
  animation: floatCharLeft 5.5s ease-in-out infinite;
}

.hero-title-character.char-right {
  animation: floatCharRight 5.8s ease-in-out infinite 0.6s;
}

.hero-title-character:hover {
  transform: translateY(-8px) scale(1.04);
}

.hero-title-img {
  width: 215px;
  height: auto;
  max-height: 310px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(15, 23, 42, 0.18));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.hero-title-character:hover .hero-title-img {
  filter: drop-shadow(0 20px 38px rgba(2, 132, 199, 0.32));
}

.hero-title-pill {
  margin-top: -10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
  white-space: nowrap;
}

.hero-title-pill.pill-danger {
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

.hero-title-pill.pill-safe {
  background: rgba(236, 253, 245, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #059669;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pill-danger .pill-dot {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}

.pill-safe .pill-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

[data-theme="dark"] .hero-title-pill.pill-danger {
  background: rgba(30, 15, 20, 0.92);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

[data-theme="dark"] .hero-title-pill.pill-safe {
  background: rgba(6, 30, 24, 0.92);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

@keyframes floatCharLeft {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-9px) rotate(-1.5deg);
  }
}

@keyframes floatCharRight {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-9px) rotate(1.5deg);
  }
}

@media (max-width: 1200px) {
  .hero-showcase-row {
    gap: 1.5rem;
  }

  .hero-title-img {
    width: 185px;
    max-height: 270px;
  }

  .hero-title-pill {
    font-size: 0.74rem;
    padding: 5px 12px;
  }
}

@media (max-width: 960px) {
  .hero-showcase-row {
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .hero-showcase-row .hero-quote {
    order: 1;
    flex: 1 1 100%;
    width: 100%;
    max-width: 660px;
  }

  .hero-title-character.char-left {
    order: 2;
  }

  .hero-title-character.char-right {
    order: 3;
  }

  .hero-title-img {
    width: 155px;
    max-height: 230px;
  }
}

@media (max-width: 540px) {
  .main-title {
    font-size: clamp(1.8rem, 6.2vw, 2.25rem);
    line-height: 1.38;
    padding-top: 0.35em;
    padding-bottom: 0.2em;
    margin-bottom: 1.4rem;
  }

  .hero-showcase-row {
    gap: 0.85rem;
  }

  .hero-title-img {
    width: 120px;
    max-height: 180px;
  }

  .hero-title-pill {
    font-size: 0.68rem;
    padding: 4px 10px;
    margin-top: -6px;
  }
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.36;
  letter-spacing: -0.015em;
  width: 100%;
  max-width: 1140px;
  margin: 0.5rem auto 1.8rem;
  padding: 0.35em 0.12em 0.2em;
  text-align: center;
  position: relative;
  z-index: 2;
  word-break: break-word;
  overflow-wrap: break-word;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #0284c7 55%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] .main-title {
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #0284c7 55%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .main-title {
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 15%, #38bdf8 60%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-quote {
  position: relative;
  max-width: 760px;
  margin: 0 auto 2.25rem;
  padding: 1.65rem 2.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-subtle);
}

.hero-quote .quote-mark {
  font-family: var(--font-display);
  font-size: 3.2rem;
  color: var(--accent-primary);
  opacity: 0.5;
  line-height: 1;
  vertical-align: middle;
}

.quote-text {
  font-size: clamp(1.1rem, 2.2vw, 1.38rem);
  font-weight: 500;
  color: var(--text-main);
  font-style: italic;
  display: inline;
}

/* Centerpiece Secret Mailbox & SOS 111 Buttons in Hero */
.hero-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.6rem;
}

.hero-mailbox-btn {
  margin-bottom: 0;
  padding: 1.1rem 2.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.45);
  cursor: pointer;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition-fast);
}

.hero-mailbox-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 50px rgba(6, 182, 212, 0.65);
}

.hero-sos-btn {
  padding: 0.85rem 2rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f43f5e 0%, #ea580c 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 28px rgba(244, 63, 94, 0.42);
  cursor: pointer;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  transition: all var(--transition-fast);
}

.hero-sos-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 38px rgba(244, 63, 94, 0.65);
}

.hero-sos-badge {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 11px;
  border-radius: 999px;
  font-weight: 600;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 820px;
  margin-bottom: 3rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-top: 0.6rem;
  overflow: hidden;
}

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

.scroll-prompt {
  margin-top: 0.5rem;
}

.scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.scroll-link:hover {
  color: var(--text-main);
}

.chevron-down {
  animation: bounceDown 2s infinite;
}

@keyframes bounceDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(5px);
  }
}

/* ==========================================================================
   Section Base Styles
   ========================================================================== */
.content-section {
  padding: 4.5rem 0;
  position: relative;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.tag-number {
  color: var(--accent-primary);
  font-weight: 700;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--text-main);
}

/* ==========================================================================
   2. Section 1: What We Do (3 Action Cards Grid)
   ========================================================================== */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 1.75rem;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.action-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

.action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.action-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.action-icon {
  font-size: 2rem;
}

.action-headline {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.action-interactive-box {
  margin-top: auto;
  padding: 1.25rem;
  background: var(--bg-card-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.todo-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.todo-title {
  color: var(--text-muted);
}

.todo-counter {
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.todo-add-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.todo-add-form input,
.form-control,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
}

[data-theme="light"] .todo-add-form input,
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.todo-add-form input:focus,
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
}

.todo-add-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform var(--transition-fast);
}

.todo-add-btn:hover {
  transform: scale(1.04);
}

.punctuality-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.punc-icon {
  font-size: 1.5rem;
}

.punctuality-stat strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
}

.punctuality-stat p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.discipline-meter .meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.meter-score {
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  font-weight: 700;
}

.meter-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  width: 95%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: var(--radius-full);
}

.agile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.agile-tag {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.agile-tag:hover {
  transform: translateY(-2px);
  background: rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   3. Section 2: My Plan / Safety Strategy (Keywords Grid)
   ========================================================================== */
.plan-steps-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.plan-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.plan-step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
}

.keywords-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.keyword-item {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.keyword-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.keyword-item .kw-icon {
  font-size: 2rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.kw-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.kw-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.kw-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.kw-action {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-top: 0.25rem;
}

.kw-urgent {
  border-top: 3px solid #ef4444;
}

.kw-urgent:hover {
  border-color: #ef4444;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.kw-urgent .kw-action {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.kw-later {
  border-top: 3px solid #f59e0b;
}

.kw-later:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.kw-later .kw-action {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.kw-plan {
  border-top: 3px solid #6366f1;
}

.kw-plan:hover {
  border-color: #6366f1;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.kw-plan .kw-action {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.kw-timetable {
  border-top: 3px solid #10b981;
}

.kw-timetable:hover {
  border-color: #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.kw-timetable .kw-action {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* ==========================================================================
   4. Section 3: Smart Watch Showcase (Exact Hardware Mockup)
   ========================================================================== */
.watch-showcase-wrapper {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 3.5rem;
  align-items: center;
  margin-top: 2rem;
}

.watch-device-outer {
  position: relative;
  width: 380px;
  margin: 40px auto;
  display: flex;
  justify-content: center;
}

.watch-strap {
  position: absolute;
  width: 170px;
  height: 90px;
  background: linear-gradient(90deg, #1f2937 0%, #374151 50%, #1f2937 100%);
  border-radius: 12px;
  z-index: 1;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.top-strap {
  top: -65px;
}

.bottom-strap {
  bottom: -65px;
}

.watch-crown {
  position: absolute;
  right: -12px;
  top: 90px;
  width: 16px;
  height: 48px;
  background: linear-gradient(180deg, #64748b, #94a3b8, #475569);
  border-radius: 6px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  z-index: 5;
  cursor: pointer;
}

.watch-button {
  position: absolute;
  right: -8px;
  top: 170px;
  width: 12px;
  height: 38px;
  background: linear-gradient(180deg, #475569, #64748b, #334155);
  border-radius: 4px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  z-index: 5;
  cursor: pointer;
}

.watch-case {
  position: relative;
  width: 350px;
  height: 420px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-radius: 56px;
  padding: 18px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.8),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8),
    0 0 0 4px #334155;
  z-index: 3;
}

.watch-screen {
  width: 100%;
  height: 100%;
  background: #000000;
  border-radius: 42px;
  box-shadow: var(--shadow-screen);
  padding: 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.watch-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #64748b;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.watch-net-indicator {
  color: var(--accent-emerald);
  font-weight: 700;
}

.watch-mini-clock {
  font-weight: 600;
  color: #f1f5f9;
}

.watch-battery {
  color: #38bdf8;
}

.watch-nav-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.35rem;
  padding: 0.6rem 0;
  scrollbar-width: none;
}

.watch-nav-tabs::-webkit-scrollbar {
  display: none;
}

.watch-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.watch-nav-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.watch-view {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.watch-view.active {
  display: flex;
}

.analog-face {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  background: radial-gradient(circle, #0f172a 0%, #000000 100%);
  margin-bottom: 0.65rem;
}

.analog-dial {
  width: 100%;
  height: 100%;
  position: relative;
}

.dial-mark {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
}

.mark-12 {
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.mark-3 {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.mark-6 {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.mark-9 {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
}

.hour-hand {
  width: 4px;
  height: 34px;
  background: #ffffff;
  margin-left: -2px;
}

.minute-hand {
  width: 3px;
  height: 46px;
  background: #38bdf8;
  margin-left: -1.5px;
}

.second-hand {
  width: 2px;
  height: 52px;
  background: #f43f5e;
  margin-left: -1px;
}

.center-cap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.digits-row {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
}

.sec-accent {
  color: var(--accent-secondary);
}

.date-row {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

.network-sync-pill {
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.watch-action-btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.watch-action-btn.primary {
  background: var(--gradient-primary);
  color: #fff;
}

.watch-action-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.watch-features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.feature-detail-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.feature-detail-card:hover {
  transform: translateX(6px);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.25);
}

.feature-icon {
  font-size: 1.6rem;
  width: 50px;
  height: 50px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.feature-detail-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.feature-detail-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   Footer Section — Chuẩn Cổng Thông Tin An Toàn Học Đường Quốc Gia
   ========================================================================== */
#main-footer {
  background: linear-gradient(180deg, #0b1120 0%, #070b14 100%);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 2rem 2.25rem;
  position: relative;
  z-index: 1;
  color: #e2e8f0;
}

[data-theme="light"] #main-footer {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  border-top: 1px solid #cbd5e1;
  color: #1e293b;
}

.footer-container {
  max-width: 1220px;
  margin: 0 auto;
}

.footer-hero-quote {
  margin: 0 auto 3rem;
  padding: 1.85rem 2.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .footer-hero-quote {
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
  border: 1px solid #fecdd3;
}

.footer-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-cta-text {
  flex: 1;
  min-width: 280px;
}

.footer-cta-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e11d48;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.28);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.final-quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  margin: 0;
}

.quote-highlight {
  color: var(--accent-rose);
  font-style: italic;
  font-weight: 800;
}

.footer-cta-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Lưới 4 cột chuẩn Footer Sở GD&ĐT Quảng Ninh */
.footer-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.05fr 1.15fr;
  gap: 2.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
  .footer-main-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
}

@media (max-width: 640px) {
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--text-main);
  line-height: 1.2;
}

.footer-tagline {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2563eb;
  margin-top: 2px;
}

.footer-desc {
  font-size: 0.84rem;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0;
}

.footer-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.footer-trust-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin: 0 0 0.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(37, 99, 235, 0.22);
  display: inline-block;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.footer-link-btn {
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: color 0.18s ease, transform 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-link-btn:hover {
  color: #2563eb;
  transform: translateX(4px);
}

.footer-static-item {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: block;
  padding: 0.15rem 0;
}

.footer-hotline-card {
  background: var(--bg-card);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.08);
}

.footer-hotline-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-hotline-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.footer-hotline-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
}

.footer-hotline-number {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: #e11d48;
  text-decoration: none;
}

.footer-hotline-number:hover {
  text-decoration: underline;
}

.footer-emergency-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

.footer-contact-meta {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.footer-contact-meta a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.footer-contact-meta a:hover {
  text-decoration: underline;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: 1.5rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-rights p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.48rem 1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  margin-left: 0.35rem;
}

.back-to-top-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   Messenger, Portals, Modals & Helper Utilities
   ========================================================================== */
.btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 0.5rem 1.1rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.76rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
}

.btn-teal {
  background: var(--accent-secondary);
  color: #fff;
}

.btn-outline {
  background: var(--bg-card-glass);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
}

.btn-warm-coral {
  background: var(--accent-rose);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pending {
  background: var(--amber-soft);
  color: #fbbf24;
}

.status-investigating {
  background: var(--primary-soft);
  color: #818cf8;
}

.status-intervening {
  background: var(--purple-soft);
  color: #c084fc;
}

.status-resolved {
  background: var(--emerald-soft);
  color: #34d399;
}

.chip-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-glass);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--accent-secondary);
  color: var(--text-main);
}

.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.grid-sidebar-main {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-glass);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.quiz-option:hover {
  border-color: var(--accent-primary);
  background: var(--primary-soft);
}

/* Messenger Workspace - Fullscreen 100vw x 100vh */
.messenger-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  z-index: 100;
  background: var(--bg-main);
}

.messenger-shell {
  background: var(--bg-card);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 370px 1fr;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.msg-sidebar {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.msg-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.msg-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.msg-search-box {
  position: relative;
}

.msg-search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-size: 0.82rem;
}

.msg-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
}

.msg-school-finder-popover {
  display: none;
  margin-top: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.msg-school-finder-popover.open {
  display: block;
}

.msg-category-pills {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.msg-cat-pill {
  border: none;
  background: var(--bg-card-glass);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.msg-cat-pill.active {
  background: var(--gradient-primary);
  color: #fff;
}

.msg-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
  color: var(--text-main);
  font-family: inherit;
}

.msg-thread-item:hover {
  background: var(--bg-card-glass);
}

.msg-thread-item.active {
  background: var(--primary-soft);
  border-color: var(--border-highlight);
}

.msg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  position: relative;
  color: #fff;
}

.msg-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-main);
}

.msg-thread-meta {
  flex: 1;
  min-width: 0;
}

.msg-thread-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-thread-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-main-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.msg-chat-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-chat-stream {
  flex: 1;
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.06), transparent 55%),
    radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.05), transparent 55%);
}

.msg-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 82%;
  animation: msgBubblePop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg-bubble-row.incoming {
  align-self: flex-start;
}

.msg-bubble-row.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.chat-bubble,
.chat-msg {
  position: relative;
  max-width: 78%;
  padding: 16px 20px;
  border-radius: 22px;
  font-size: 0.9rem;
  line-height: 1.62;
  word-wrap: break-word;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.12);
  animation: msgBubblePop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg-bubble-row .chat-bubble {
  max-width: 100%;
}

/* Bong bóng tin nhắn của Học sinh / Người gửi (Bên phải - Gradient Messenger) */
.chat-bubble.student,
.chat-bubble.user,
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 55%, #0891b2 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 26px -4px rgba(37, 99, 235, 0.32), 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Bong bóng tin nhắn của Nhà trường / Chuyên gia / AI / Hội nhóm (Bên trái) */
.chat-bubble.school,
.chat-bubble.ai,
.chat-bubble.other,
.chat-msg.ai,
.chat-msg.other {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.88);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .chat-bubble.school,
[data-theme="light"] .chat-bubble.ai,
[data-theme="light"] .chat-bubble.other {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.chat-bubble.typing-bubble {
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: chatTypingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes chatTypingBounce {

  0%,
  80%,
  100% {
    transform: scale(0.4);
    opacity: 0.35;
  }

  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.chat-bubble .bubble-sender-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #38bdf8;
}

[data-theme="light"] .chat-bubble.school .bubble-sender-label,
[data-theme="light"] .chat-bubble.ai .bubble-sender-label,
[data-theme="light"] .chat-bubble.other .bubble-sender-label {
  color: #0284c7;
}

.chat-bubble.student .bubble-sender-label,
.chat-bubble.user .bubble-sender-label {
  color: rgba(255, 255, 255, 0.92);
  justify-content: flex-end;
}

.chat-bubble .bubble-msg-text {
  font-size: 0.92rem;
  line-height: 1.62;
}

.chat-bubble .bubble-status-time {
  font-size: 0.7rem;
  opacity: 0.76;
  margin-top: 8px;
  text-align: right;
}

@keyframes msgBubblePop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-composer {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.msg-attach-pill,
.msg-attachment-pill {
  cursor: pointer;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.85);
  color: #334155;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

[data-theme="dark"] .msg-attach-pill,
[data-theme="dark"] .msg-attachment-pill {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.msg-attach-pill:hover,
.msg-attachment-pill:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.16);
}

[data-theme="dark"] .msg-attach-pill:hover,
[data-theme="dark"] .msg-attachment-pill:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.evidence-preview-box {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--primary-soft);
  border-radius: 12px;
}

.evidence-preview-box.active {
  display: flex;
}

.evidence-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

/* Portals & Modals */
.app-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 2rem 3rem;
  position: relative;
  z-index: 2;
}

.role-context-banner {
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--accent-emerald);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.vietnam-map-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  justify-content: center;
}

.vn-map-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}

.vn-region-path,
.map-school-pin {
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #121929;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-glow);
}

[data-theme="light"] .modal-box {
  background: #ffffff;
}

.gps-mode-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card-glass);
  padding: 4px;
  border-radius: 12px;
}

.gps-mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.gps-mode-tab.active {
  background: var(--gradient-primary);
  color: #fff;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.nearest-school-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-glass);
}

/* ==========================================================================
   MULTI-DEVICE UNIVERSAL GPS GEOLOCATION ENGINE STYLING
   ========================================================================== */
.sos-gps-toolbar {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sos-gps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  font-family: var(--font-primary, inherit);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  white-space: nowrap;
  flex: 1 1 auto;
}

.sos-gps-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.sos-gps-btn:active {
  transform: translateY(0);
}

.sos-gps-btn.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.sos-gps-btn.primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.sos-gps-btn.campus {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.sos-gps-btn.campus:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

.sos-gps-btn.map {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.25);
}

.sos-gps-btn.map:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: #0ea5e9;
}

.sos-gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.sos-gps-badge.gnss {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.sos-gps-badge.network {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.sos-gps-badge.campus {
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.3);
}

.sos-gps-badge.pin {
  background: rgba(236, 72, 153, 0.14);
  color: #db2777;
  border-color: rgba(236, 72, 153, 0.3);
}

.sos-mini-map-wrap {
  margin-top: 6px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  animation: fadeInSosMap 0.2s ease-out;
}

@keyframes fadeInSosMap {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode theme overrides */
[data-theme="dark"] .sos-gps-btn {
  background: var(--bg-card-dark, #1e293b);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

[data-theme="dark"] .sos-gps-btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .sos-gps-btn.campus {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .sos-gps-btn.map {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="dark"] .sos-gps-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .sos-gps-badge.gnss {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .sos-gps-badge.network {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .sos-gps-badge.campus {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .sos-gps-badge.pin {
  background: rgba(244, 114, 182, 0.2);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.4);
}

[data-theme="dark"] .sos-mini-map-wrap {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

@media (max-width: 480px) {
  .sos-gps-toolbar {
    flex-direction: row;
    gap: 4px;
  }

  .sos-gps-btn {
    font-size: 0.7rem;
    padding: 5px 6px;
    flex: 1;
  }
}

.panic-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0a0e17;
  color: #f1f5f9;
  padding: 24px;
  overflow-y: auto;
}

.panic-shell {
  max-width: 980px;
  margin: 0 auto;
}

.panic-topbar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panic-body {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 24px;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-item {
  background: #1e293b;
  border: 1px solid var(--border-highlight);
  color: #fff;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
}

@media (max-width: 1024px),
(hover: none) and (pointer: coarse) {

  #toastContainer,
  .toast-container,
  .toast-item {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

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

  .keywords-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .watch-showcase-wrapper {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .watch-features-list {
    max-width: 600px;
    width: 100%;
  }

  .grid-sidebar-main {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-metrics,
  .keywords-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}


/* ==========================================================================
   5. CỔNG ĐIỀU HÀNH AN TOÀN TRƯỜNG HỌC (TINH GỌN, ĐỒNG BỘ & HIỆN ĐẠI)
   Sử dụng chung Design Tokens, hỗ trợ 100% Theme Sáng / Tối
   ========================================================================== */
#schoolPortalWorkspace {
  min-height: 100vh;
  background: var(--bg-main);
  padding: 24px 28px 60px;
  color: var(--text-main);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  z-index: 5;
}

[data-theme="dark"] #schoolPortalWorkspace {
  background: #0f172a;
  color: #f1f5f9;
}

#schoolPortalWorkspace .sch-exec-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* 1. Executive Hero Banner */
#schoolPortalWorkspace .sch-exec-hero {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px 28px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] #schoolPortalWorkspace .sch-exec-hero {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.sch-hero-emblem {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.sch-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.sch-badge-live {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #059669;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

[data-theme="dark"] .sch-badge-live {
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
}

.sch-badge-safety {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--accent-primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.sch-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.sch-hero-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.sch-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 2;
}

.btn-sch-nav {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sch-nav:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.btn-sch-nav.btn-sch-back-min {
  background: #f59e0b;
  color: #ffffff;
  border: none;
}

.btn-sch-nav.btn-sch-back-min:hover {
  background: #d97706;
  color: #ffffff;
}

.btn-sch-nav.btn-sch-logout {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-sch-nav.btn-sch-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* 2. SubNav Tabs Bar */
#schoolPortalWorkspace .sch-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 20px;
}

[data-theme="dark"] #schoolPortalWorkspace .sch-subnav-bar {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

#schoolPortalWorkspace .sch-subnav-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#schoolPortalWorkspace .sch-subnav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 8px 15px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

#schoolPortalWorkspace .sch-subnav-btn:hover {
  background: rgba(2, 132, 199, 0.08);
  color: var(--accent-primary);
}

#schoolPortalWorkspace .sch-subnav-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.sch-badge-counter {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.sch-subnav-btn:not(.active) .sch-badge-counter {
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent-primary);
}

.sch-subnav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sch-tool {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sch-tool:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* 3. Bento KPI Grid */
#schoolPortalWorkspace .sch-bento-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  #schoolPortalWorkspace .sch-bento-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

#schoolPortalWorkspace .sch-kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

[data-theme="dark"] #schoolPortalWorkspace .sch-kpi-card {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

#schoolPortalWorkspace .sch-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
  border-color: var(--accent-primary);
}

.sch-kpi-info {
  display: flex;
  flex-direction: column;
}

.sch-kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sch-kpi-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 4px;
}

.sch-kpi-sub {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 3px;
}

.sch-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-critical {
  border-left: 4px solid #ef4444 !important;
}

.kpi-urgent {
  border-left: 4px solid #f59e0b !important;
}

.kpi-normal {
  border-left: 4px solid #3b82f6 !important;
}

.kpi-resolved {
  border-left: 4px solid #10b981 !important;
}

.kpi-review {
  border-left: 4px solid #94a3b8 !important;
}

.color-danger {
  color: #dc2626 !important;
}

.color-warning {
  color: #d97706 !important;
}

.color-info {
  color: #2563eb !important;
}

.color-success {
  color: #059669 !important;
}

.color-muted {
  color: var(--text-muted) !important;
}

.icon-danger {
  background: rgba(239, 68, 68, 0.12);
}

.icon-warning {
  background: rgba(245, 158, 11, 0.12);
}

.icon-info {
  background: rgba(37, 99, 235, 0.12);
}

.icon-success {
  background: rgba(16, 185, 129, 0.12);
}

.icon-muted {
  background: rgba(148, 163, 184, 0.14);
}

/* 4. Panoramic Charts Box */
.sch-charts-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-subtle);
}

[data-theme="dark"] .sch-charts-box {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.sch-charts-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
}

.sch-charts-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sch-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.sch-media-hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  color: var(--text-main);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .sch-media-hero-banner {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.sch-media-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-main, #0f172a);
  letter-spacing: -0.3px;
  line-height: 1.35;
}

.sch-media-desc {
  margin: 6px 0 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted, #475569);
  line-height: 1.5;
}

[data-theme="dark"] .sch-media-desc {
  color: #94a3b8;
}

.sch-media-kpi-card {
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--bg-card-hover, #f8fafc);
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sch-media-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus, #94a3b8);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.sch-media-kpi-card.active {
  background: rgba(2, 132, 199, 0.08);
  border: 2px solid var(--accent-primary, #0284c7) !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.16);
}

[data-theme="dark"] .sch-media-kpi-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

[data-theme="dark"] .sch-media-kpi-card.active {
  background: rgba(2, 132, 199, 0.2);
  border-color: #38bdf8 !important;
}

.sch-media-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sch-media-kpi-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

[data-theme="dark"] .sch-media-kpi-name {
  color: #f1f5f9;
}

.sch-media-kpi-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border-subtle, #e2e8f0);
  color: var(--text-muted, #64748b);
  transition: all 0.2s;
}

.sch-media-kpi-card.active .sch-media-kpi-tag {
  background: var(--accent-primary, #0284c7);
  color: #ffffff;
}

.sch-media-kpi-number {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-main, #0f172a);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

[data-theme="dark"] .sch-media-kpi-number {
  color: #ffffff;
}

.sch-media-kpi-card.active .sch-media-kpi-number {
  color: var(--accent-primary, #0284c7);
}

.sch-media-kpi-subtext {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

[data-theme="dark"] .sch-media-kpi-subtext {
  color: #94a3b8;
}

.sch-media-grid-card {
  background: var(--bg-card, #ffffff);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

[data-theme="dark"] .sch-media-grid-card {
  background: rgba(30, 41, 59, 0.7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.sch-sync-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-primary);
}

.btn-sch-toggle-charts {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

/* 5. Filter Section */
#schoolPortalWorkspace .filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 18px;
}

[data-theme="dark"] #schoolPortalWorkspace .filter-section {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

#schoolPortalWorkspace .search-and-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#schoolPortalWorkspace .search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

#schoolPortalWorkspace .search-box input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.84rem;
  outline: none;
  background: var(--bg-main);
  color: var(--text-main);
  transition: border-color var(--transition-fast);
}

[data-theme="dark"] #schoolPortalWorkspace .search-box input {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

#schoolPortalWorkspace .search-box input:focus {
  border-color: var(--accent-primary);
}

#schoolPortalWorkspace .select-filter {
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-main);
  outline: none;
  cursor: pointer;
}

[data-theme="dark"] #schoolPortalWorkspace .select-filter {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.sch-view-mode-group {
  display: inline-flex;
  background: var(--bg-main);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

[data-theme="dark"] .sch-view-mode-group {
  background: rgba(15, 23, 42, 0.6);
}

.sch-view-mode-group button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sch-view-mode-group button.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

#schoolPortalWorkspace .tab-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#schoolPortalWorkspace .tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#schoolPortalWorkspace .tab-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

#schoolPortalWorkspace .tab-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* 6. Report Table */
#schoolPortalWorkspace .table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

[data-theme="dark"] #schoolPortalWorkspace .table-responsive {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

#schoolPortalWorkspace table {
  width: 100%;
  border-collapse: collapse;
}

#schoolPortalWorkspace th {
  padding: 13px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  white-space: nowrap;
}

[data-theme="dark"] #schoolPortalWorkspace th {
  background: rgba(15, 23, 42, 0.6);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#schoolPortalWorkspace td {
  padding: 13px 16px;
  font-size: 0.84rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

[data-theme="dark"] #schoolPortalWorkspace td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

#schoolPortalWorkspace tr:hover td {
  background: rgba(2, 132, 199, 0.03);
}

[data-theme="dark"] #schoolPortalWorkspace tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

#schoolPortalWorkspace tr.row-critical {
  border-left: 4px solid #ef4444;
}

#schoolPortalWorkspace tr.row-urgent {
  border-left: 4px solid #f59e0b;
}

/* Status Badges */
#schoolPortalWorkspace .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

#schoolPortalWorkspace .status-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

#schoolPortalWorkspace .status-urgent {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

#schoolPortalWorkspace .status-normal {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

#schoolPortalWorkspace .status-review {
  background: rgba(148, 163, 184, 0.14);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

#schoolPortalWorkspace .category-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-main);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

[data-theme="dark"] #schoolPortalWorkspace .category-tag {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}

#schoolPortalWorkspace .risk-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

#schoolPortalWorkspace .risk-bar-bg {
  flex: 1;
  min-width: 50px;
  height: 6px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

#schoolPortalWorkspace .risk-bar-fill {
  height: 100%;
  border-radius: 999px;
}

#schoolPortalWorkspace .risk-score-text {
  font-size: 0.76rem;
  font-weight: 800;
}

#schoolPortalWorkspace .btn-view {
  border: none;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#schoolPortalWorkspace .btn-view:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

#schoolPortalWorkspace .empty-msg {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

/* 7. Kanban Board */
#schoolPortalWorkspace .sch-kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  #schoolPortalWorkspace .sch-kanban-board {
    grid-template-columns: 1fr;
  }
}

/* 8. Livechat & Shared Workshop Layout (Cổng Trường học & Cổng Admin Sở GD&ĐT) */
#schoolPortalWorkspace .sch-livechat-layout,
#ministryAdminWorkspace .sch-livechat-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  min-height: 560px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle, var(--shadow-sm));
}

[data-theme="dark"] #schoolPortalWorkspace .sch-livechat-layout,
#ministryAdminWorkspace[data-ministry-theme="dark"] .sch-livechat-layout {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 920px) {

  #schoolPortalWorkspace .sch-livechat-layout,
  #ministryAdminWorkspace .sch-livechat-layout {
    grid-template-columns: 1fr;
  }
}

#schoolPortalWorkspace .sch-livechat-sidebar,
#ministryAdminWorkspace .sch-livechat-sidebar {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-card-subtle, var(--bg-card-hover, rgba(248, 250, 252, 0.8)));
}

#schoolPortalWorkspace .sch-livechat-sidebar-header,
#ministryAdminWorkspace .sch-livechat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

#schoolPortalWorkspace .sch-livechat-sidebar-title,
#ministryAdminWorkspace .sch-livechat-sidebar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, var(--text-main));
}

#schoolPortalWorkspace .sch-livechat-sidebar-desc,
#ministryAdminWorkspace .sch-livechat-sidebar-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

#schoolPortalWorkspace .sch-livechat-main,
#ministryAdminWorkspace .sch-livechat-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  background: var(--bg-card);
}

#schoolPortalWorkspace .sch-livechat-header,
#ministryAdminWorkspace .sch-livechat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card-subtle, var(--bg-card-hover, rgba(248, 250, 252, 0.7)));
}

#schoolPortalWorkspace .sch-livechat-messages-box,
#ministryAdminWorkspace .sch-livechat-messages-box {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  min-height: 360px;
  max-height: 430px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-page, var(--bg-main, #f8fafc));
}

#schoolPortalWorkspace .sch-livechat-footer,
#ministryAdminWorkspace .sch-livechat-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

#schoolPortalWorkspace .sch-quick-reply-btn,
#ministryAdminWorkspace .sch-quick-reply-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-hover, #f8fafc);
  color: var(--text-primary, var(--text-main));
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#schoolPortalWorkspace .sch-quick-reply-btn:hover,
#ministryAdminWorkspace .sch-quick-reply-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

#schoolPortalWorkspace .sch-livechat-input,
#ministryAdminWorkspace .sch-livechat-input {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary, var(--text-main));
  border-radius: 999px;
  font-size: 0.88rem;
  outline: none;
}

@media (max-width: 920px) {

  #schoolPortalWorkspace .sch-livechat-sidebar,
  #ministryAdminWorkspace .sch-livechat-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

/* 8B. Modern Shared Workshop Hub (Admin Sở GD&ĐT & Cổng Trường Học) */
.ws-hub-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-hub-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary, #475569);
}

.ws-hub-stat-pill.is-accent {
  background: rgba(234, 88, 12, 0.1);
  border-color: rgba(234, 88, 12, 0.28);
  color: #ea580c;
}

.ws-hub-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-medium, var(--border-subtle));
  color: var(--text-primary, var(--text-main, #0f172a));
  cursor: pointer;
  transition: all 0.18s ease;
}

.ws-hub-sync-btn:hover {
  border-color: #ea580c;
  color: #ea580c;
  transform: translateY(-1px);
}

.ws-hub-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  height: clamp(560px, 70vh, 740px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.06));
}

.ws-hub-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle, #f8fafc);
}

.ws-hub-sidebar-top {
  padding: 16px 16px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ws-hub-sidebar-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary, var(--text-main, #0f172a));
}

.ws-hub-sidebar-desc {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  margin-top: 3px;
  line-height: 1.4;
}

.ws-hub-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary, var(--text-main, #0f172a));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.ws-hub-icon-btn:hover {
  border-color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

.ws-hub-search-wrap {
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.ws-hub-search-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary, var(--text-main, #0f172a));
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ws-hub-search-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.ws-hub-room-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-room-card {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.18s ease;
  position: relative;
}

.ws-room-card:hover {
  border-color: rgba(234, 88, 12, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.ws-room-card.active {
  border-color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
  box-shadow: inset 3px 0 0 #ea580c, 0 4px 14px rgba(234, 88, 12, 0.1);
}

.ws-room-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ws-room-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary, var(--text-main, #0f172a));
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-room-card.active .ws-room-card-title {
  color: #ea580c;
}

.ws-room-msg-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.14);
  color: #ea580c;
  white-space: nowrap;
  flex-shrink: 0;
}

.ws-room-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
}

.ws-room-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #10b981;
  font-weight: 700;
}

.ws-room-live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.ws-room-card-preview {
  font-size: 0.76rem;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 4px;
  border-top: 1px dashed var(--border-subtle);
}

.ws-hub-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-card);
}

.ws-hub-header {
  padding: 15px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ws-hub-header-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary, var(--text-main, #0f172a));
  line-height: 1.35;
}

.ws-hub-header-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ws-hub-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  background: var(--bg-card-subtle, #f1f5f9);
  color: var(--text-secondary, #475569);
}

.ws-hub-meta-pill.is-public {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-weight: 700;
}

.ws-hub-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-page, var(--bg-main, #f8fafc));
}

.ws-hub-empty {
  margin: auto;
  max-width: 420px;
  text-align: center;
  padding: 32px 24px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium, var(--border-subtle));
  color: var(--text-muted, #64748b);
}

.ws-hub-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.ws-hub-empty-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary, var(--text-main, #0f172a));
  margin-bottom: 6px;
}

.ws-msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.ws-msg-row.is-mine {
  align-items: flex-end;
}

.ws-msg-sender-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  padding: 0 4px;
}

.ws-msg-role-tag {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.14);
  color: var(--text-secondary, #475569);
}

.ws-msg-role-tag.is-ministry {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

.ws-msg-role-tag.is-school {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

.ws-msg-role-tag.is-expert {
  background: rgba(124, 58, 237, 0.14);
  color: #7c3aed;
}

.ws-msg-bubble {
  max-width: 74%;
  padding: 11px 15px;
  border-radius: 16px;
  border-top-left-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--bg-card);
  color: var(--text-primary, var(--text-main, #0f172a));
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  word-break: break-word;
}

.ws-msg-row.is-mine .ws-msg-bubble {
  background: linear-gradient(135deg, #ea580c, #d97706);
  color: #ffffff;
  border: none;
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.24);
}

.ws-hub-quick-chips {
  padding: 10px 18px 8px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ws-quick-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle, #f8fafc);
  color: var(--text-secondary, #334155);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.ws-quick-chip:hover {
  border-color: #ea580c;
  color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}

.ws-hub-composer {
  padding: 12px 18px 16px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-hub-input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-medium, var(--border-subtle));
  background: var(--bg-input, var(--bg-card-subtle, #f8fafc));
  color: var(--text-primary, var(--text-main, #0f172a));
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ws-hub-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.14);
}

.ws-hub-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ea580c, #d97706);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ws-hub-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.34);
}

@media (max-width: 960px) {
  .ws-hub-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 620px;
    max-height: none;
  }

  .ws-hub-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 270px;
  }

  .ws-hub-messages {
    min-height: 300px;
    max-height: 380px;
  }

  .ws-msg-bubble {
    max-width: 88%;
  }
}

/* Modal Chi Tiết Phân Tích AI của Trường */
.sch-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sch-modal-backdrop.show,
.sch-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sch-modal-card {
  background: white;
  color: #1e293b;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 24px;
  position: relative;
}

.sch-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.sch-modal-header h3 {
  margin: 0;
  color: #1e293b;
  font-size: 1.2rem;
}

.btn-close-sch-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.ai-analysis-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 15px;
  margin-bottom: 15px;
  color: #1e293b;
}

.ai-title {
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.keyword-chip {
  background: #fee2e2;
  color: #991b1b;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin: 2px;
}

.recommend-action-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: #1e40af;
  line-height: 1.4;
  margin-top: 10px;
}

.override-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 15px;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.override-form .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.override-form .form-group select,
.override-form .form-group input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: #1e293b;
}

.btn-save-override {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 15px;
  width: 100%;
  transition: background 0.2s;
}

.btn-save-override:hover {
  background: #2563eb;
}

/* ==========================================================================
   6. GIAO DIỆN ĐIỀU HÀNH CỦA BỘ GD&ĐT (Exact QN new/dieu-hanh.html & dieu-hanh.css)
   ========================================================================== */
#ministryAdminWorkspace {
  --bg-app: #f4f6fa;
  --bg-page: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-modal-overlay: rgba(15, 23, 42, 0.55);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --accent-gold: #b8860b;
  --accent-gold-dark: #8c6507;
  --accent-gold-light: #fef3c7;
  --accent-gold-border: rgba(184, 134, 11, 0.35);
  --accent-gold-gradient: linear-gradient(135deg, #d97706 0%, #b8860b 100%);

  --accent-teal: #0d9488;
  --accent-teal-light: #ccfbf1;
  --accent-blue: #0284c7;
  --accent-blue-light: #e0f2fe;
  --accent-indigo: #6366f1;
  --accent-indigo-light: #e0e7ff;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;

  --status-active-bg: #ecfdf5;
  --status-active-text: #059669;
  --status-active-border: #a7f3d0;
  --status-pending-bg: #fffbeb;
  --status-pending-text: #d97706;
  --status-pending-border: #fde68a;
  --status-blocked-bg: #fef2f2;
  --status-blocked-text: #dc2626;
  --status-blocked-border: #fecaca;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 28px -4px rgba(15, 23, 42, 0.09);
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 82px;
  --topbar-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  background-color: var(--bg-app);
  color: var(--text-primary);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 20;
}

#ministryAdminWorkspace[data-ministry-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-page: #0f1523;
  --bg-sidebar: #131b2e;
  --bg-topbar: rgba(19, 27, 46, 0.92);
  --bg-card: #151d33;
  --bg-card-subtle: #1a243d;
  --bg-card-hover: #1f2c4a;
  --bg-input: #101728;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --accent-gold: #e8c547;
  --accent-gold-dark: #e8c547;
  --accent-gold-light: rgba(232, 197, 71, 0.15);
  --accent-gold-border: rgba(232, 197, 71, 0.35);
  --status-active-bg: rgba(46, 196, 182, 0.15);
  --status-active-text: #2ec4b6;
  --status-active-border: rgba(46, 196, 182, 0.4);
  --status-pending-bg: rgba(255, 183, 3, 0.15);
  --status-pending-text: #ffb703;
  --status-pending-border: rgba(255, 183, 3, 0.4);
  --status-blocked-bg: rgba(230, 57, 70, 0.15);
  --status-blocked-text: #ff6b6b;
  --status-blocked-border: rgba(230, 57, 70, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
}

#ministryAdminWorkspace .app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#ministryAdminWorkspace .admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  /* Thanh công cụ bên trái đứng yên tuyệt đối, không cuộn theo nội dung */
  position: relative;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  z-index: 100;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

#ministryAdminWorkspace .sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

#ministryAdminWorkspace .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  cursor: pointer;
}

#ministryAdminWorkspace .brand-emblem {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.15), rgba(217, 119, 6, 0.2));
  border: 1.5px solid var(--accent-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.18);
  flex-shrink: 0;
}

#ministryAdminWorkspace .brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ministryAdminWorkspace .brand-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--accent-gold-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ministryAdminWorkspace .brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

#ministryAdminWorkspace .sidebar-toggle-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

#ministryAdminWorkspace .sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#ministryAdminWorkspace .nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  padding: 14px 12px 6px;
}

#ministryAdminWorkspace .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

#ministryAdminWorkspace .nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

#ministryAdminWorkspace .nav-item.active {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.12), rgba(217, 119, 6, 0.08));
  color: var(--accent-gold-dark);
  font-weight: 600;
  border-color: var(--accent-gold-border);
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.1);
}

#ministryAdminWorkspace .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3.5px;
  background: var(--accent-gold);
  border-radius: 0 4px 4px 0;
}

#ministryAdminWorkspace .nav-icon {
  font-size: 18px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#ministryAdminWorkspace .nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ministryAdminWorkspace .nav-badge {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

#ministryAdminWorkspace .nav-item.active .nav-badge {
  background: var(--accent-gold);
  color: #fff;
  border-color: transparent;
}

#ministryAdminWorkspace .nav-badge.badge-alert {
  background: var(--accent-amber);
  color: #fff;
}

#ministryAdminWorkspace .sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
}

#ministryAdminWorkspace .user-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

#ministryAdminWorkspace .user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border: 1.5px solid var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

#ministryAdminWorkspace .user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

#ministryAdminWorkspace .user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .user-status {
  font-size: 11px;
  color: var(--status-active-text);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

#ministryAdminWorkspace .status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--status-active-text);
}

#ministryAdminWorkspace .btn-sidebar-logout {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
}

#ministryAdminWorkspace .admin-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

#ministryAdminWorkspace .admin-sidebar.collapsed .brand-info,
#ministryAdminWorkspace .admin-sidebar.collapsed .nav-label,
#ministryAdminWorkspace .admin-sidebar.collapsed .nav-badge,
#ministryAdminWorkspace .admin-sidebar.collapsed .nav-group-label,
#ministryAdminWorkspace .admin-sidebar.collapsed .user-details,
#ministryAdminWorkspace .admin-sidebar.collapsed .btn-sidebar-logout {
  display: none;
}

#ministryAdminWorkspace .main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  /* Chỉ vùng nội dung bên phải tự cuộn riêng */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

#ministryAdminWorkspace .sidebar-nav {
  min-height: 0;
  overscroll-behavior: contain;
}

#ministryAdminWorkspace .sidebar-footer {
  flex-shrink: 0;
}

#ministryAdminWorkspace .admin-topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  flex-shrink: 0;
  background: var(--bg-topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 20px;
}

#ministryAdminWorkspace .topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

#ministryAdminWorkspace .breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

#ministryAdminWorkspace .breadcrumb-root {
  color: var(--text-muted);
  font-weight: 500;
}

#ministryAdminWorkspace .breadcrumb-sep {
  color: var(--text-subtle);
}

#ministryAdminWorkspace .breadcrumb-current {
  color: var(--accent-gold-dark);
  font-weight: 700;
}

#ministryAdminWorkspace .topbar-center {
  flex: 1;
  max-width: 440px;
}

#ministryAdminWorkspace .topbar-search {
  position: relative;
  width: 100%;
}

#ministryAdminWorkspace .search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 9px 16px 9px 40px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}

#ministryAdminWorkspace .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-subtle);
}

#ministryAdminWorkspace .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#ministryAdminWorkspace .topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

#ministryAdminWorkspace .btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
}

#ministryAdminWorkspace .btn-topbar-backup {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.12), rgba(217, 119, 6, 0.15));
  border-color: var(--accent-gold-border);
  color: var(--accent-gold-dark);
}

#ministryAdminWorkspace .btn-topbar-site {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

#ministryAdminWorkspace .btn-topbar-logout {
  background: var(--status-blocked-bg);
  border-color: var(--status-blocked-border);
  color: var(--status-blocked-text);
}

#ministryAdminWorkspace .admin-content-container {
  flex: 1;
  padding: 30px 32px 60px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

#ministryAdminWorkspace .tab-pane {
  display: none;
}

#ministryAdminWorkspace .tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#ministryAdminWorkspace .page-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

#ministryAdminWorkspace .page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .page-description {
  font-size: 13.5px;
  color: var(--text-muted);
}

#ministryAdminWorkspace .welcome-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 50%, #fef3c7 100%);
  border: 1px solid var(--accent-gold-border);
  border-radius: var(--radius-lg);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  gap: 20px;
  flex-wrap: wrap;
}

#ministryAdminWorkspace[data-ministry-theme="dark"] .welcome-hero-banner {
  background: linear-gradient(135deg, #151d33 0%, #1a2542 100%);
}

#ministryAdminWorkspace .welcome-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(184, 134, 11, 0.12);
  border: 1px solid var(--accent-gold-border);
  color: var(--accent-gold-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

#ministryAdminWorkspace .welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 6px 0;
}

#ministryAdminWorkspace .welcome-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
}

#ministryAdminWorkspace .welcome-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

#ministryAdminWorkspace .kpi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

#ministryAdminWorkspace .kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

#ministryAdminWorkspace .kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

#ministryAdminWorkspace .kpi-card.gold::before {
  background: var(--accent-gold);
}

#ministryAdminWorkspace .kpi-card.teal::before {
  background: var(--accent-teal);
}

#ministryAdminWorkspace .kpi-card.blue::before {
  background: var(--accent-blue);
}

#ministryAdminWorkspace .kpi-card.indigo::before {
  background: var(--accent-indigo);
}

#ministryAdminWorkspace .kpi-card.rose::before {
  background: var(--accent-rose);
}

#ministryAdminWorkspace .kpi-card.amber::before {
  background: var(--accent-amber);
}

#ministryAdminWorkspace .kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

#ministryAdminWorkspace .kpi-card.gold .kpi-icon-box {
  background: #fef3c7;
  color: var(--accent-gold-dark);
}

#ministryAdminWorkspace .kpi-card.teal .kpi-icon-box {
  background: #ccfbf1;
  color: var(--accent-teal);
}

#ministryAdminWorkspace .kpi-card.blue .kpi-icon-box {
  background: #e0f2fe;
  color: var(--accent-blue);
}

#ministryAdminWorkspace .kpi-card.indigo .kpi-icon-box {
  background: #e0e7ff;
  color: var(--accent-indigo);
}

#ministryAdminWorkspace .kpi-card.rose .kpi-icon-box {
  background: #ffe4e6;
  color: var(--accent-rose);
}

#ministryAdminWorkspace .kpi-card.amber .kpi-icon-box {
  background: #ffedd5;
  color: var(--accent-amber);
}

#ministryAdminWorkspace .kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

#ministryAdminWorkspace .kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

#ministryAdminWorkspace .bento-overview-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
}

#ministryAdminWorkspace .panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

#ministryAdminWorkspace .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

#ministryAdminWorkspace .panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#ministryAdminWorkspace .chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  height: 220px;
  padding: 28px 16px 12px;
  border-bottom: 2px solid var(--border-subtle);
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
}

#ministryAdminWorkspace .chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}

#ministryAdminWorkspace .chart-bar-fill {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(to top, rgba(184, 134, 11, 0.4), var(--accent-gold));
  border-radius: 8px 8px 2px 2px;
  position: relative;
}

#ministryAdminWorkspace .chart-bar-val {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold-dark);
}

#ministryAdminWorkspace .chart-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

#ministryAdminWorkspace .quick-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#ministryAdminWorkspace .action-tile-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

#ministryAdminWorkspace .action-tile-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-gold-border);
  transform: translateY(-2px);
}

#ministryAdminWorkspace .tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#ministryAdminWorkspace .tile-icon.gold {
  background: #fef3c7;
  color: var(--accent-gold-dark);
}

#ministryAdminWorkspace .tile-icon.blue {
  background: #e0f2fe;
  color: var(--accent-blue);
}

#ministryAdminWorkspace .tile-icon.teal {
  background: #ccfbf1;
  color: var(--accent-teal);
}

#ministryAdminWorkspace .tile-icon.indigo {
  background: #e0e7ff;
  color: var(--accent-indigo);
}

#ministryAdminWorkspace .tile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .tile-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}

#ministryAdminWorkspace .timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

#ministryAdminWorkspace .timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

#ministryAdminWorkspace .timeline-time-badge {
  color: var(--accent-gold-dark);
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  background: var(--accent-gold-light);
  padding: 2px 6px;
  border-radius: 4px;
}

#ministryAdminWorkspace .admin-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

#ministryAdminWorkspace .admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

#ministryAdminWorkspace .admin-table th {
  background: var(--bg-card-subtle);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

#ministryAdminWorkspace .admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

#ministryAdminWorkspace .admin-table tr:hover td {
  background: var(--bg-card-hover);
}

#ministryAdminWorkspace .btn-action {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#ministryAdminWorkspace .btn-action.btn-success {
  background: var(--status-active-bg);
  border-color: var(--status-active-border);
  color: var(--status-active-text);
}

#ministryAdminWorkspace .btn-action.btn-danger {
  background: var(--status-blocked-bg);
  border-color: var(--status-blocked-border);
  color: var(--status-blocked-text);
}

#ministryAdminWorkspace .relic-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

#ministryAdminWorkspace .relic-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

#ministryAdminWorkspace .relic-control-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

#ministryAdminWorkspace .relic-control-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .relic-control-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

#ministryAdminWorkspace .relic-control-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
  flex-wrap: wrap;
}

#ministryAdminWorkspace .download-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 60%, #fef3c7 100%);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 38px 30px;
  text-align: center;
}

#ministryAdminWorkspace[data-ministry-theme="dark"] .download-hero-card {
  background: linear-gradient(135deg, #151d33 0%, #1a2542 100%);
}

#ministryAdminWorkspace .download-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

#ministryAdminWorkspace .download-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

#ministryAdminWorkspace .btn-download-all {
  background: var(--accent-gold-gradient);
  border: none;
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

#ministryAdminWorkspace .download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

#ministryAdminWorkspace .download-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#ministryAdminWorkspace .download-item-icon {
  font-size: 36px;
}

#ministryAdminWorkspace .download-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

#ministryAdminWorkspace .download-item-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

#ministryAdminWorkspace .switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

#ministryAdminWorkspace .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#ministryAdminWorkspace .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-medium);
  transition: .3s;
  border-radius: 34px;
}

#ministryAdminWorkspace .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

#ministryAdminWorkspace input:checked+.slider {
  background-color: var(--accent-emerald);
}

#ministryAdminWorkspace input:checked+.slider:before {
  transform: translateX(22px);
}

@media (max-width: 1180px) {
  #ministryAdminWorkspace .panorama-grid-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 1024px) {
  #ministryAdminWorkspace .bento-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   💬 BONG BÓNG BÌNH LUẬN & CHIA SẺ ẨN DANH (COMMENT BUBBLES)
   ============================================================ */
.hero-floating-bubbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 2.2rem;
  max-width: 920px;
}

.floating-bubble-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-size: 0.82rem;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease;
  animation: floatBubbleY 4.5s ease-in-out infinite;
}

.floating-bubble-pill.bubble-float-2 {
  animation-delay: 1.2s;
}

.floating-bubble-pill.bubble-float-3 {
  animation-delay: 2.4s;
}

.floating-bubble-pill:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-secondary);
}

.floating-bubble-pill .bubble-avatar {
  font-size: 1rem;
}

.floating-bubble-pill .bubble-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.floating-bubble-pill .bubble-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.14);
  padding: 2px 8px;
  border-radius: 999px;
}

@keyframes floatBubbleY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.comment-bubbles-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bubble-composer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.bubble-composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.quick-bubble-form {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .quick-bubble-form {
    grid-template-columns: 1fr;
  }
}

.comment-bubbles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  align-items: start;
}

.comment-bubble-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease;
}

.comment-bubble-card:hover {
  transform: translateY(-4px);
}

.main-speech-bubble {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: 24px 24px 24px 6px;
  padding: 20px 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.comment-bubble-card.bubble-variant-1 .main-speech-bubble {
  border-color: rgba(6, 182, 212, 0.35);
}

.comment-bubble-card.bubble-variant-2 .main-speech-bubble {
  border-color: rgba(16, 185, 129, 0.35);
}

.main-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 24px;
  width: 18px;
  height: 18px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-highlight);
  border-bottom: 1px solid var(--border-highlight);
  transform: rotate(45deg);
}

.bubble-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bubble-author-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bubble-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid var(--border-highlight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.bubble-author-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.bubble-time-loc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.bubble-quote-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent-primary);
  opacity: 0.35;
}

.bubble-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bubble-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.bubble-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bubble-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bubble-react-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: scale(1.04);
}

.bubble-comment-count {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sub-bubbles-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
  margin-top: 4px;
}

.sub-comment-bubble {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.sub-comment-bubble.expert-bubble {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.32);
}

.sub-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sub-bubble-author {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.78rem;
}

.expert-verified-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.student-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: var(--accent-primary);
}

.sub-bubble-text {
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.bubble-reply-form {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.bubble-reply-input {
  flex: 1;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
}

.bubble-reply-input:focus {
  border-color: var(--accent-primary);
}

.bubble-reply-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================
   👤 NÚT ĐĂNG NHẬP & MODAL ĐĂNG NHẬP CHÍNH QUY (STANDARD WEB AUTH)
   ============================================================ */
.btn-standard-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-highlight);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-standard-login:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.14);
  transform: translateY(-1px);
}

.cf-auth-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 26px 26px 22px;
  border-radius: 18px;
  border: 1px solid #e0f2fe;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 14px 40px rgba(2, 132, 199, 0.12);
}

.cf-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cf-auth-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cf-auth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.cf-auth-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #bae6fd;
}

.cf-auth-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.15;
  margin: 0 0 4px;
}

.cf-auth-subtitle {
  font-size: 0.96rem;
  color: #64748b;
  margin: 0;
}

.cf-otp-banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.cf-mini-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #a33b00;
  background: #fdf5f0;
  color: #a33b00;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

.cf-mini-btn:hover {
  background: #a33b00;
  color: #ffffff;
}

.cf-field-group {
  margin-bottom: 16px;
}

.cf-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 7px;
}

.cf-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.cf-input {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 16px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.96rem;
  text-align: left;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-input::placeholder {
  color: #94a3b8;
  opacity: 0.9;
}

.cf-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.cf-eye-btn {
  position: absolute;
  right: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.cf-verify-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 315px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fafafa;
  margin: 18px 0 12px;
}

.cf-verify-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cf-check-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cf-verify-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #1e293b;
}

.cf-verify-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.cf-cloud-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cf-cloud-name {
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #0f172a;
}

.cf-cloud-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.56rem;
  color: #475569;
  text-decoration: underline;
  margin-top: 2px;
}

.cf-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.cf-forgot-link {
  border: none;
  background: none;
  color: #0284c7;
  font-family: inherit;
  font-size: 0.94rem;
  cursor: pointer;
  padding: 0;
}

.cf-forgot-link:hover {
  text-decoration: underline;
}

.cf-submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  transition: background 0.2s ease, transform 0.15s ease;
}

.cf-submit-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

.cf-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 22px 0 16px;
}

.cf-bottom-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cf-login-with-label {
  font-size: 0.96rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.cf-switch-account-row {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cf-switch-link {
  border: none;
  background: none;
  color: #a33b00;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.cf-switch-link:hover {
  text-decoration: underline;
}

.cf-google-plus-btn {
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 10px;
  background: #e14938;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(225, 73, 56, 0.3);
  transition: transform 0.15s ease, background 0.2s ease;
}

.cf-google-plus-btn span {
  font-size: 1.05rem;
  margin-left: 1px;
}

.cf-google-plus-btn:hover {
  background: #c93b2b;
  transform: translateY(-2px);
}

/* ============================================================
   🛡️ CHUYÊN ĐỀ TRANG CHỦ: BẠO LỰC HỌC ĐƯỜNG LÀ GÌ?
   (Định nghĩa Nghị định 80/2017/NĐ-CP • 4 Hình thức • 3 Không & 3 Nên)
   ============================================================ */
.home-bullying-guide-section {
  max-width: 1220px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.guide-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-header-center {
  text-align: center;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.guide-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 999px;
  color: #0284c7;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .guide-badge-pill {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.guide-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 10px #0284c7;
  animation: pulseDot 2s infinite ease-in-out;
}

.guide-main-title {
  font-size: 2.35rem;
  font-weight: 850;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.65rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.guide-sub-title {
  font-size: 1.05rem;
  color: var(--text-secondary, #475569);
  line-height: 1.6;
  max-width: 820px;
  margin: 0 auto;
}

/* Card Định nghĩa Nghị định 80 */
.guide-definition-card {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.9));
  border: 1.5px solid rgba(186, 230, 253, 0.85);
  border-radius: 20px;
  padding: 2rem 2.2rem;
  box-shadow: 0 16px 32px -8px rgba(14, 165, 233, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .guide-definition-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 30, 55, 0.85));
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.4);
}

.definition-icon-wrap {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.3);
}

.def-icon {
  font-size: 1.75rem;
}

.definition-content {
  flex: 1;
}

.def-law-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0369a1;
  background: rgba(2, 132, 199, 0.12);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  border-left: 3px solid #0284c7;
}

[data-theme="dark"] .def-law-tag {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.15);
}

.def-quote {
  margin: 0 0 0.85rem;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-primary, #0f172a);
  font-weight: 500;
  font-style: italic;
  border: none;
}

.def-quote strong {
  color: #dc2626;
  font-weight: 750;
  font-style: normal;
}

[data-theme="dark"] .def-quote strong {
  color: #f87171;
}

.def-note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary, #64748b);
}

/* Header 4 hình thức */
.guide-types-header {
  text-align: center;
  margin-top: 0.5rem;
}

.types-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.35rem;
}

.types-sub {
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

/* Grid 4 thẻ hình thức */
.bullying-types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.b-type-card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 1.75rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .b-type-card {
  background: rgba(18, 25, 41, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

.b-type-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px -10px rgba(15, 23, 42, 0.12);
}

.b-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
}

[data-theme="dark"] .b-card-badge {
  background: #1e293b;
  color: #94a3b8;
}

.b-card-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  transition: transform 0.3s ease;
}

.b-type-card:hover .b-card-icon-circle {
  transform: scale(1.1) rotate(4deg);
}

.b-icon {
  font-size: 1.6rem;
}

.b-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.65rem;
  line-height: 1.35;
}

.b-card-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
  margin: 0 0 1rem;
  flex: 1;
}

.b-card-signs {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .b-card-signs {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

.sign-label {
  display: inline;
  font-size: 0.8rem;
  font-weight: 750;
  color: #dc2626;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

[data-theme="dark"] .sign-label {
  color: #f87171;
}

.b-card-signs ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary, #64748b);
}

.b-card-signs li {
  margin-bottom: 0.3rem;
}

.b-card-signs li:last-child {
  margin-bottom: 0;
}

/* Màu sắc nhấn từng thẻ */
.b-type-card.physical {
  border-top: 4px solid #ef4444;
}

.b-type-card.physical .b-card-icon-circle {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.b-type-card.physical .b-card-title {
  color: #dc2626;
}

.b-type-card.verbal {
  border-top: 4px solid #f59e0b;
}

.b-type-card.verbal .b-card-icon-circle {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.b-type-card.verbal .b-card-title {
  color: #d97706;
}

.b-type-card.social {
  border-top: 4px solid #0284c7;
}

.b-type-card.social .b-card-icon-circle {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.b-type-card.social .b-card-title {
  color: #0284c7;
}

.b-type-card.cyber {
  border-top: 4px solid #8b5cf6;
}

.b-type-card.cyber .b-card-icon-circle {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.b-type-card.cyber .b-card-title {
  color: #7c3aed;
}

/* Action Box: 3 Không & 3 Nên */
.guide-action-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 2rem 2.2rem;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-theme="dark"] .guide-action-box {
  background: rgba(18, 25, 41, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5);
}

.action-box-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.action-box-divider {
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(203, 213, 225, 0.8), transparent);
}

[data-theme="dark"] .action-box-divider {
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.action-box-col {
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
}

.action-box-col.danger-side {
  background: rgba(254, 242, 242, 0.65);
  border: 1px solid rgba(254, 202, 202, 0.65);
}

[data-theme="dark"] .action-box-col.danger-side {
  background: rgba(69, 10, 10, 0.25);
  border-color: rgba(239, 68, 68, 0.2);
}

.action-box-col.safe-side {
  background: rgba(240, 253, 244, 0.65);
  border: 1px solid rgba(187, 247, 208, 0.65);
}

[data-theme="dark"] .action-box-col.safe-side {
  background: rgba(6, 78, 59, 0.25);
  border-color: rgba(34, 197, 94, 0.2);
}

.col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.col-head .head-icon {
  font-size: 1.4rem;
}

.col-head h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: 0.3px;
}

.danger-side .col-head h4 {
  color: #b91c1c;
}

[data-theme="dark"] .danger-side .col-head h4 {
  color: #fca5a5;
}

.safe-side .col-head h4 {
  color: #15803d;
}

[data-theme="dark"] .safe-side .col-head h4 {
  color: #86efac;
}

.rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-list li {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary, #0f172a);
}

.danger-side .rule-list strong {
  color: #dc2626;
}

[data-theme="dark"] .danger-side .rule-list strong {
  color: #f87171;
}

.safe-side .rule-list strong {
  color: #16a34a;
}

[data-theme="dark"] .safe-side .rule-list strong {
  color: #4ade80;
}

/* Nút CTA hành động nhanh */
.guide-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(203, 213, 225, 0.7);
}

[data-theme="dark"] .guide-cta-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.guide-cta-btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.22s ease;
  text-decoration: none;
}

.guide-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .bullying-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .home-bullying-guide-section {
    margin: 1rem auto 2.5rem;
    padding: 0 1rem;
  }

  .guide-main-title {
    font-size: 1.85rem;
  }

  .guide-definition-card {
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    gap: 1.2rem;
  }

  .action-box-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .action-box-divider {
    display: none;
  }

  .guide-action-box {
    padding: 1.5rem 1.25rem;
  }

  .guide-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .bullying-types-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   🌻 KHU VỰC 2 CỘT TRANG CHỦ: BÊN TRÁI Ô CHỮ - BÊN PHẢI HÌNH ẢNH
   ============================================================ */
.home-story-section {
  max-width: 1180px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.home-story-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.2rem;
  align-items: center;
}

.home-story-text-box {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(224, 242, 254, 0.9);
  border-radius: 24px;
  padding: 2.6rem 2.4rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

[data-theme="dark"] .home-story-text-box {
  background: rgba(18, 25, 41, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.home-story-text-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 42px -10px rgba(2, 132, 199, 0.12);
}

.story-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: #0284c7;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
}

[data-theme="dark"] .story-badge {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.story-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.7vw, 2.2rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}

.story-paragraph {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.story-paragraph strong {
  color: var(--text-main);
  font-weight: 700;
}

.story-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.6rem;
}

.story-pill {
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--bg-card-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.story-pill:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.home-story-image-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* Khung ảnh nổi 3D nhẹ, bo góc 24px, viền sáng và zoom mượt */
.story-image-frame {
  position: relative;
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #ffffff;
  box-shadow:
    0 24px 48px -12px rgba(2, 132, 199, 0.18),
    0 12px 24px -6px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(2, 132, 199, 0.12),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.45s ease;
  transform: translateZ(0);
}

[data-theme="dark"] .story-image-frame {
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #0f172a;
  box-shadow:
    0 24px 50px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(99, 102, 241, 0.35),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

/* Lớp viền sáng phản chiếu 3D (light sheen layer) */
.story-image-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%, rgba(2, 132, 199, 0.1) 100%);
  opacity: 0.9;
  transition: opacity 0.45s ease;
}

.story-image-frame:hover {
  transform: translateY(-8px) rotateX(1.8deg) scale(1.02);
  box-shadow:
    0 32px 64px -14px rgba(2, 132, 199, 0.26),
    0 16px 32px -8px rgba(15, 23, 42, 0.12),
    0 0 0 2px rgba(6, 182, 212, 0.6);
  border-color: rgba(6, 182, 212, 0.75);
}

[data-theme="dark"] .story-image-frame:hover {
  box-shadow:
    0 32px 64px -14px rgba(0, 0, 0, 0.8),
    0 0 0 2px rgba(56, 189, 248, 0.6);
  border-color: rgba(56, 189, 248, 0.6);
}

.story-photo {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), filter 0.65s ease;
  transform-origin: center center;
}

.story-image-frame:hover .story-photo {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .home-story-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

/* ==========================================================================
   🌸 BỘ SƯU TẬP HỌA TIẾT & MASCOT HỌC ĐƯỜNG SAFESCHOOL VIETNAM
   Tích hợp toàn bộ hình ảnh 3D minh họa (Picture2.png -> Picture14.png)
   ========================================================================== */

/* 1. Hiệu ứng chuyển động bồng bềnh (Keyframe animations) */
@keyframes floatMascot {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-9px) rotate(1deg);
  }
}

@keyframes floatGentle {

  0%,
  100% {
    transform: translateY(0px) rotate(var(--base-rot, 0deg));
  }

  50% {
    transform: translateY(-10px) rotate(calc(var(--base-rot, 0deg) + 3deg));
  }
}

@keyframes flyPlane {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(8px, -14px) rotate(3deg);
  }
}

@keyframes cloudDriftSlow {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(15px);
  }
}

/* 2. Hero Mascot Chào Đón (Picture3.png) */
.hero-mascot-wrapper {
  position: absolute;
  right: max(18px, calc(50% - 630px));
  bottom: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
  pointer-events: none;
  animation: floatMascot 5.5s ease-in-out infinite;
  user-select: none;
}

.hero-mascot-img {
  width: 220px;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 18px 32px rgba(2, 132, 199, 0.22));
}

.hero-mascot-speech {
  margin-top: -14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(2, 132, 199, 0.3);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

[data-theme="dark"] .hero-mascot-speech {
  background: rgba(18, 25, 41, 0.92);
  border-color: rgba(99, 102, 241, 0.4);
  color: #93c5fd;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* 3. Lớp đồ họa nổi Hero: Máy bay, Bút viết, Thước kẻ, Mây (Picture6, 10, 9, 5, 2, 11) */
.hero-deco-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.hero-deco-plane {
  position: absolute;
  top: 56%;
  right: 6%;
  width: 175px;
  height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 8px 16px rgba(2, 132, 199, 0.3));
  animation: flyPlane 6s ease-in-out infinite;
}

.hero-deco-pen {
  --base-rot: -25deg;
  position: absolute;
  top: 53%;
  left: 6%;
  width: 145px;
  height: auto;
  opacity: 0.88;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.12));
  animation: floatGentle 7s ease-in-out infinite;
}

.hero-deco-ruler {
  --base-rot: 15deg;
  position: absolute;
  bottom: 12%;
  left: 6%;
  width: 155px;
  height: auto;
  opacity: 0.90;
  filter: drop-shadow(0 8px 18px rgba(234, 179, 8, 0.25));
  animation: floatGentle 8s ease-in-out infinite 1s;
}

.hero-deco-note {
  --base-rot: -12deg;
  position: absolute;
  top: 40%;
  right: 5%;
  width: 170px;
  height: auto;
  opacity: 0.78;
  filter: drop-shadow(0 6px 14px rgba(2, 132, 199, 0.18));
  animation: floatGentle 6.5s ease-in-out infinite 0.5s;
}

.hero-deco-cloud-left {
  position: absolute;
  left: -35px;
  bottom: 0px;
  width: 150px;
  height: auto;
  opacity: 0.5;
  animation: cloudDriftSlow 12s ease-in-out infinite;
}

.hero-deco-cloud-right {
  position: absolute;
  right: -25px;
  top: 20px;
  width: 175px;
  height: auto;
  opacity: 0.45;
  animation: cloudDriftSlow 14s ease-in-out infinite reverse;
}

[data-theme="dark"] .hero-deco-cloud-left,
[data-theme="dark"] .hero-deco-cloud-right {
  opacity: 0.22;
  filter: brightness(0.7) invert(0.1);
}

/* 4. Section Trường TH&THCS Việt Dân: Mascot Em Học Sinh & Tòa Nhà Học Đường (Picture4, 7, 8) */
.story-bg-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.story-building-left {
  position: absolute;
  left: -30px;
  bottom: -15px;
  height: 360px;
  opacity: 0.15;
  filter: drop-shadow(0 12px 24px rgba(2, 132, 199, 0.12));
  transform: rotate(-2deg);
  transition: opacity 0.3s ease;
}

.story-building-right {
  position: absolute;
  right: -30px;
  bottom: -15px;
  height: 360px;
  opacity: 0.15;
  filter: drop-shadow(0 12px 24px rgba(2, 132, 199, 0.12));
  transform: rotate(2deg);
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .story-building-left,
[data-theme="dark"] .story-building-right {
  opacity: 0.08;
  filter: brightness(0.6);
}

.story-student-companion {
  position: absolute;
  right: -106px;
  bottom: -108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  pointer-events: none;
  animation: floatMascot 5.2s ease-in-out infinite 0.7s;
  user-select: none;
}

.story-companion-img {
  width: -145px;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.22));
}

.story-companion-badge {
  margin-top: -10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 132, 199, 0.3);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  white-space: nowrap;
}

[data-theme="dark"] .story-companion-badge {
  background: rgba(18, 25, 41, 0.95);
  border-color: rgba(99, 102, 241, 0.35);
  color: #93c5fd;
}

/* 5. Hộp Thư Bí Mật & Bản Đồ Số Lưới Perspective (Picture6, Picture13) */
.msg-header-deco-plane {
  width: 24px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.3));
  animation: flyPlane 5s ease-in-out infinite;
  vertical-align: middle;
}

.msg-gps-grid-backdrop {
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 132, 199, 0.05) 100%),
    url('img/Picture13.png') center bottom / cover no-repeat;
  border-radius: 12px;
  margin-bottom: 8px;
  padding-bottom: 2px;
}

/* 6. Cổng Điều Hành An Toàn Cấp Trường & Sở GD&ĐT Thành Phố Quảng Ninh (Picture7, Picture8) */
.sch-hero-building-accent {
  position: absolute;
  right: 24px;
  bottom: -10px;
  pointer-events: none;
  opacity: 0.22;
  height: 135px;
  display: flex;
  align-items: flex-end;
  z-index: 1;
}

.sch-hero-building-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.min-hero-building-accent {
  position: absolute;
  right: 25px;
  bottom: -8px;
  pointer-events: none;
  opacity: 0.2;
  height: 145px;
  display: flex;
  align-items: flex-end;
  z-index: 1;
}

.min-hero-building-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}

/* 7. Footer Chuẩn Quốc Gia (Picture6) */
.footer-plane-deco {
  width: 126px;
  height: auto;
  position: absolute;
  top: -14px;
  right: 38px;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(2, 132, 199, 0.35));
  animation: flyPlane 5s ease-in-out infinite;
}

/* 8. Modal Tra Cứu Hồ Sơ (Picture12) */
.modal-feather-accent {
  position: absolute;
  right: 18px;
  top: 14px;
  pointer-events: none;
  opacity: 0.25;
}

.modal-feather-img {
  width: 36px;
  height: auto;
  transform: rotate(20deg);
  filter: drop-shadow(0 2px 8px rgba(2, 132, 199, 0.3));
}

/* 9. Responsive Rules */
@media (max-width: 1240px) {
  .hero-mascot-wrapper {
    right: 12px;
  }

  .hero-mascot-img {
    width: 170px;
  }
}

@media (max-width: 1024px) {
  .hero-mascot-wrapper {
    display: none;
  }

  .story-building-left,
  .story-building-right {
    display: none;
  }

  .sch-hero-building-accent,
  .min-hero-building-accent {
    display: none;
  }
}

@media (max-width: 860px) {

  .hero-deco-pen,
  .hero-deco-ruler,
  .hero-deco-note {
    display: none;
  }

  .hero-deco-plane {
    width: 44px;
    right: 8%;
    top: 65%;
  }

  .story-student-companion {
    display: none;
  }
}

/* ==========================================================================
   📅 MỐC THỜI GIAN TRONG 1 TUẦN CỦA TRƯỜNG VỀ CÁC VẤN ĐỀ (WEEKLY TIMELINE)
   ========================================================================== */
.school-weekly-timeline-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  margin-top: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.weekly-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}

.weekly-day-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weekly-day-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.1);
}

.weekly-day-card.today {
  background: rgba(37, 99, 235, 0.06);
  border: 1.5px solid #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.weekly-events-timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 14px;
}

.weekly-events-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: linear-gradient(180deg, #2563eb 0%, #10b981 70%, #cbd5e1 100%);
  border-radius: 999px;
}

.weekly-event-item {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.weekly-event-item:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.weekly-event-dot {
  position: absolute;
  left: -21px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.weekly-event-dot.critical {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.weekly-event-dot.resolved {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

@media (max-width: 900px) {
  .weekly-days-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

/* ==========================================================================
   📡 PHÂN HỆ GIÁM SÁT BÁO CÁO TỪNG TRƯỜNG (NGÀY / TUẦN / THÁNG / NĂM)
   ========================================================================== */
.monitor-granularity-tabs {
  display: inline-flex;
  background: rgba(148, 163, 184, 0.12);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
  flex-wrap: wrap;
}

.monitor-granularity-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.monitor-granularity-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.65);
}

.monitor-granularity-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

[data-theme="dark"] .monitor-granularity-tabs {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .monitor-granularity-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.monitor-milestone-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.monitor-milestone-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  border-color: #0284c7;
}

.monitor-milestone-card.critical {
  border-left: 4px solid #ef4444;
}

.monitor-milestone-card.processing {
  border-left: 4px solid #f59e0b;
}

.monitor-milestone-card.resolved {
  border-left: 4px solid #10b981;
}

.milestone-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseMilestone 1.6s infinite;
  vertical-align: middle;
}

@keyframes pulseMilestone {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ==========================================================================
   📡 PHÂN HỆ GIÁM SÁT BÁO CÁO TỪNG TRƯỜNG (NGÀY / TUẦN / THÁNG / NĂM)
   ========================================================================== */
.monitor-granularity-tabs {
  display: inline-flex;
  background: rgba(148, 163, 184, 0.12);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
  flex-wrap: wrap;
}

.monitor-granularity-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.monitor-granularity-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.65);
}

.monitor-granularity-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

[data-theme="dark"] .monitor-granularity-tabs {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .monitor-granularity-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.monitor-milestone-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.monitor-milestone-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  border-color: #0284c7;
}

.monitor-milestone-card.critical {
  border-left: 4px solid #ef4444;
}

.monitor-milestone-card.processing {
  border-left: 4px solid #f59e0b;
}

.monitor-milestone-card.resolved {
  border-left: 4px solid #10b981;
}

.milestone-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseMilestone 1.6s infinite;
  vertical-align: middle;
}

@keyframes pulseMilestone {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}


/* ==========================================================================
   AUTHENTIC FACEBOOK MESSENGER INTERFACE & ALL-DEVICE RESPONSIVE SUITE
   Phần Hộp Thư thiết kế y hệt Messenger & Trang Chủ chống tràn chữ / vỡ layout
   ========================================================================== */

/* 1. Global Anti-Overflow & Text Wrap Rules for All Devices */
html,
body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
a,
button,
blockquote,
div {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 2. Responsive Navigation Bar (Mobile / Tablet / Desktop) */
@media (max-width: 640px) {
  .brand-logo {
    gap: 0.45rem;
  }

  .nav-actions {
    gap: 0.4rem;
    flex-wrap: nowrap;
  }
}

/* 3. Responsive Hero Section (Trang Chủ) */
@media (max-width: 768px) {
  #hero-header {
    padding: 1.5rem 0.75rem 2rem !important;
    overflow: hidden;
  }

  .header-container {
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .header-badge {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
    max-width: 95%;
    margin-bottom: 1rem !important;
  }

  .main-title {
    font-size: clamp(1.45rem, 6.5vw, 2.1rem) !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
    padding: 0.2em 0.1em !important;
  }

  .hero-showcase-row {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-showcase-row .hero-quote {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem 1.1rem !important;
    margin: 0 !important;
  }

  .hero-showcase-row .hero-quote .quote-text {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
  }

  .hero-title-character.char-left {
    order: 2 !important;
  }

  .hero-title-character.char-right {
    order: 3 !important;
  }

  .hero-title-img {
    width: 125px !important;
    max-height: 175px !important;
  }

  .hero-title-pill {
    font-size: 0.68rem !important;
    padding: 3px 9px !important;
  }

  .hero-cta-stack {
    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto 1.8rem !important;
    gap: 0.75rem !important;
  }

  .hero-mailbox-btn,
  .hero-sos-btn {
    width: 100% !important;
    padding: 0.85rem 1.1rem !important;
    font-size: 0.92rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .hero-floating-bubbles {
    width: 100% !important;
    margin-bottom: 1.5rem !important;
    gap: 8px !important;
  }

  .floating-bubble-pill {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    max-width: 95vw !important;
  }

  .hero-metrics {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
  }
}

/* 4. Responsive Story Section & Footer */
@media (max-width: 900px) {
  .home-story-section {
    padding: 0 1rem !important;
    margin-bottom: 2.5rem !important;
  }

  .home-story-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .home-story-text-box {
    padding: 1.5rem 1.15rem !important;
    border-radius: 20px !important;
  }

  .story-heading {
    font-size: clamp(1.2rem, 4.5vw, 1.6rem) !important;
  }

  .story-paragraph {
    font-size: 0.86rem !important;
    line-height: 1.6 !important;
  }

  .story-highlights {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .story-pill {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
  }

  .story-photo {
    border-radius: 16px !important;
    width: 100% !important;
  }
}

@media (max-width: 640px) {
  #main-footer {
    padding: 2rem 0.75rem 1.5rem !important;
  }

  .footer-container {
    padding: 0 !important;
  }

  .footer-hero-quote {
    padding: 1.25rem 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  .final-quote-text {
    font-size: 0.88rem !important;
  }

  .footer-cta-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .footer-cta-actions .cta-pill,
  .footer-cta-actions .pill-sos {
    width: 100% !important;
    justify-content: center !important;
  }

  .footer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* ==========================================================================
   5. AUTHENTIC FACEBOOK MESSENGER LAYOUT & COMPONENT STYLING
   ========================================================================== */

/* Design Tokens for Messenger */
:root {
  --mes-blue: #0084ff;
  --mes-blue-gradient: linear-gradient(135deg, #0084ff 0%, #0099ff 100%);
  --mes-green-online: #31a24c;
  --mes-bg-light: #ffffff;
  --mes-sidebar-light: #ffffff;
  --mes-hover-light: #f2f2f2;
  --mes-active-light: #e7f3ff;
  --mes-bubble-in-light: #f0f2f5;
  --mes-text-dark: #050505;
  --mes-text-muted-light: #65676b;
  --mes-border-light: #e4e6eb;
  --mes-input-light: #f0f2f5;

  --mes-bg-dark: #18191a;
  --mes-sidebar-dark: #18191a;
  --mes-hover-dark: #252525;
  --mes-active-dark: #263951;
  --mes-bubble-in-dark: #303030;
  --mes-text-light: #e4e6eb;
  --mes-text-muted-dark: #b0b3b8;
  --mes-border-dark: #393a3b;
  --mes-input-dark: #3a3b3c;
}

/* Container Fullscreen */
.messenger-container {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999 !important;
  background: var(--mes-bg-light);
  color: var(--mes-text-dark);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  overflow: hidden !important;
}

[data-theme="dark"] .messenger-container {
  background: var(--mes-bg-dark);
  color: var(--mes-text-light);
  color-scheme: dark;
}

.messenger-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: inherit;
}

/* Sidebar Styling */
.msg-sidebar {
  border-right: 1px solid var(--mes-border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mes-sidebar-light);
  overflow: hidden;
}

[data-theme="dark"] .msg-sidebar {
  border-right-color: var(--mes-border-dark);
  background: var(--mes-sidebar-dark);
}

.msg-sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--mes-border-light);
  flex-shrink: 0;
}

[data-theme="dark"] .msg-sidebar-header {
  border-bottom-color: var(--mes-border-dark);
}

.messenger-gradient-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mes-blue-gradient);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.35);
}

.btn-msg-close-round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

[data-theme="dark"] .btn-msg-close-round {
  background: rgba(255, 255, 255, 0.1);
}

.btn-msg-close-round:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.05);
}

/* Messenger Search Box */
.msg-search-box {
  position: relative;
  margin-top: 10px;
}

.msg-search-input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: 20px;
  border: none;
  background: var(--mes-input-light);
  color: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: background 0.2s;
}

[data-theme="dark"] .msg-search-input {
  background: var(--mes-input-dark);
}

.msg-search-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--mes-blue);
}

[data-theme="dark"] .msg-search-input:focus {
  background: #242526;
}

.msg-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.55;
  pointer-events: none;
}

/* Category filter pills */
.msg-category-pills {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--mes-border-light);
}

[data-theme="dark"] .msg-category-pills {
  border-bottom-color: var(--mes-border-dark);
}

.msg-category-pills::-webkit-scrollbar {
  display: none;
}

.msg-cat-pill {
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: var(--mes-input-light);
  color: var(--mes-text-muted-light);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

[data-theme="dark"] .msg-cat-pill {
  background: var(--mes-input-dark);
  color: var(--mes-text-muted-dark);
}

.msg-cat-pill.active {
  background: var(--mes-blue-gradient);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}

/* Thread list items */
.msg-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  color: inherit;
  transition: background 0.15s ease;
  user-select: none;
}

.msg-thread-item:hover {
  background: var(--mes-hover-light);
}

[data-theme="dark"] .msg-thread-item:hover {
  background: var(--mes-hover-dark);
}

.msg-thread-item.active {
  background: var(--mes-active-light) !important;
}

[data-theme="dark"] .msg-thread-item.active {
  background: var(--mes-active-dark) !important;
}

.msg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  position: relative;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.msg-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--mes-green-online);
  border: 2.5px solid #ffffff;
}

[data-theme="dark"] .msg-online-dot {
  border-color: var(--mes-bg-dark);
}

.msg-thread-meta {
  flex: 1;
  min-width: 0;
}

.msg-thread-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.msg-thread-sub {
  font-size: 0.8rem;
  color: var(--mes-text-muted-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .msg-thread-sub {
  color: var(--mes-text-muted-dark);
}

.msg-sidebar-bottom-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--mes-border-light);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

[data-theme="dark"] .msg-sidebar-bottom-bar {
  border-top-color: var(--mes-border-dark);
}

/* ==========================================================================
   Chat Pane & Header
   ========================================================================== */
.msg-main-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

[data-theme="dark"] .msg-main-pane {
  background: var(--mes-bg-dark);
}

.msg-chat-header {
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--mes-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .msg-chat-header {
  border-bottom-color: var(--mes-border-dark);
  background: var(--mes-bg-dark);
}

.msg-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.btn-msg-mobile-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mes-blue);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-msg-mobile-back:hover {
  background: var(--mes-hover-light);
}

[data-theme="dark"] .btn-msg-mobile-back:hover {
  background: var(--mes-hover-dark);
}

.msg-header-text {
  min-width: 0;
  overflow: hidden;
}

.msg-header-name {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-header-sub {
  font-size: 0.78rem;
  color: var(--mes-green-online);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mes-green-online);
  display: inline-block;
}

.msg-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-msg-action-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mes-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-msg-action-circle:hover {
  background: var(--mes-hover-light);
  transform: scale(1.08);
}

[data-theme="dark"] .btn-msg-action-circle:hover {
  background: var(--mes-hover-dark);
}

/* ==========================================================================
   Chat Stream & Messenger Bubbles
   ========================================================================== */
.msg-chat-stream {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

[data-theme="dark"] .msg-chat-stream {
  background: var(--mes-bg-dark);
}

.msg-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 82%;
  animation: msgBubbleSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg-bubble-row.incoming {
  align-self: flex-start;
}

.msg-bubble-row.outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.msg-bubble-row.outgoing .msg-bubble-avatar {
  display: none !important;
}

/* Messenger asymmetric curved bubbles */
.chat-bubble {
  position: relative;
  padding: 10px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-wrap: break-word;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.chat-bubble.school,
.chat-bubble.ai,
.chat-bubble.other {
  background: var(--mes-bubble-in-light);
  color: var(--mes-text-dark);
  border-radius: 18px 18px 18px 4px;
}

[data-theme="dark"] .chat-bubble.school,
[data-theme="dark"] .chat-bubble.ai,
[data-theme="dark"] .chat-bubble.other {
  background: var(--mes-bubble-in-dark);
  color: var(--mes-text-light);
}

.chat-bubble.student,
.chat-bubble.user {
  background: var(--mes-blue-gradient) !important;
  color: #ffffff !important;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}

.bubble-sender-label {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--mes-text-muted-light);
}

[data-theme="dark"] .bubble-sender-label {
  color: var(--mes-text-muted-dark);
}

.chat-bubble.student .bubble-sender-label {
  display: none;
}

.bubble-msg-text {
  font-size: 0.92rem;
  line-height: 1.5;
}

.bubble-status-time {
  font-size: 0.68rem;
  margin-top: 4px;
  opacity: 0.75;
  text-align: right;
}

/* Typing bubble */
.chat-bubble.typing-bubble {
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mes-blue);
  animation: mesDotBounce 1.3s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes mesDotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@keyframes msgBubbleSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Messenger Composer Bar (Input Bar)
   ========================================================================== */
.msg-composer {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--mes-border-light);
  background: #ffffff;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  flex-shrink: 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

[data-theme="dark"] .msg-composer {
  border-top-color: var(--mes-border-dark);
  background: var(--mes-bg-dark);
}

.messenger-bar-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.msg-left-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.msg-icon-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mes-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.msg-icon-action-btn:hover {
  background: var(--mes-hover-light);
  transform: scale(1.08);
}

[data-theme="dark"] .msg-icon-action-btn:hover {
  background: var(--mes-hover-dark);
}

.msg-input-pill-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 38px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #f0f2f5;
  display: flex;
  align-items: center;
}

[data-theme="dark"] .msg-input-pill-wrap {
  background: var(--mes-input-dark);
  border-color: #4b5563;
}

.msg-input-pill-wrap:focus-within {
  background: #ffffff;
  border-color: var(--mes-blue);
  box-shadow: 0 0 0 2px var(--mes-blue);
}

[data-theme="dark"] .msg-input-pill-wrap:focus-within {
  background: #242526;
}

.msg-messenger-pill-input {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  border-radius: 20px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #050505 !important;
  -webkit-text-fill-color: #050505 !important;
  caret-color: #0084ff !important;
  font-size: 0.92rem;
  line-height: normal !important;
  outline: none !important;
  opacity: 1 !important;
}

.msg-messenger-pill-input:focus {
  background: transparent !important;
  color: #050505 !important;
  -webkit-text-fill-color: #050505 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .msg-messenger-pill-input,
[data-theme="dark"] .msg-messenger-pill-input:focus {
  color: #e4e6eb !important;
  -webkit-text-fill-color: #e4e6eb !important;
}

.msg-messenger-pill-input::placeholder {
  color: #65676b !important;
  -webkit-text-fill-color: #65676b !important;
  opacity: 1 !important;
}

[data-theme="dark"] .msg-messenger-pill-input::placeholder {
  color: #b0b3b8 !important;
  -webkit-text-fill-color: #b0b3b8 !important;
  opacity: 1 !important;
}

.msg-send-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--mes-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.35);
}

.msg-send-action-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 132, 255, 0.5);
}

/* ==========================================================================
   Mobile Messenger Switcher (Screen width <= 820px)
   ========================================================================== */
@media (max-width: 820px) {
  .messenger-shell {
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    width: 100% !important;
    height: 100% !important;
  }

  /* When viewing threads list on mobile */
  .messenger-shell.mobile-view-threads .msg-sidebar {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
  }

  .messenger-shell.mobile-view-threads .msg-main-pane {
    display: none !important;
  }

  /* When viewing active chat on mobile */
  .messenger-shell.mobile-view-chat .msg-sidebar {
    display: none !important;
  }

  .messenger-shell.mobile-view-chat .msg-main-pane {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
  }

  /* Show back arrow in header on mobile */
  .btn-msg-mobile-back {
    display: flex !important;
  }

  .msg-bubble-row {
    max-width: 88% !important;
  }

  .msg-chat-header {
    padding: 0 10px !important;
  }

  .msg-left-tools .msg-icon-action-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .msg-input-pill-wrap {
    height: 36px !important;
  }

  .msg-messenger-pill-input {
    height: 36px !important;
    font-size: 0.9rem !important;
    line-height: normal !important;
    padding: 0 12px !important;
  }

  .msg-send-action-btn {
    width: 34px !important;
    height: 34px !important;
  }
}


/* Messenger Simulated Calling Overlay */
.messenger-calling-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  align-items: center;
  justify-content: center;
}

.messenger-calling-overlay.active {
  display: flex;
}

.calling-modal-card {
  text-align: center;
  max-width: 360px;
  width: 90%;
  padding: 30px 20px;
  color: #fff;
}

.calling-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, #0084ff, #0099ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 0 0 10px rgba(0, 132, 255, 0.25), 0 0 40px rgba(0, 132, 255, 0.5);
  animation: pulseCallRing 1.8s infinite;
}

@keyframes pulseCallRing {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 132, 255, 0.25);
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 16px rgba(0, 132, 255, 0.4);
  }
}

.calling-contact-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.calling-status-text {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 28px;
}

.calling-actions-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.btn-calling-tool {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.3rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-calling-hangup {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.5);
  transition: all 0.2s;
}

.btn-calling-hangup:hover {
  transform: scale(1.08);
}

/* ============================================================================
   CHÍNH QUYỀN ĐỊA PHƯƠNG 2 CẤP & SÁP NHẬP ĐƠN VỊ HÀNH CHÍNH (SAFE SCHOOL)
   ============================================================================ */
.btn-province-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-province-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-province-tab.active {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.two-tier-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.two-tier-tier-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.two-tier-tier-box.tier-1 {
  border-left: 5px solid #2563eb;
}

.two-tier-tier-box.tier-2 {
  border-left: 5px solid #10b981;
}

.two-tier-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.two-tier-badge.tier-1 {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.two-tier-badge.tier-2 {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.two-tier-agency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.two-tier-agency-card {
  background: var(--bg-card-subtle, rgba(248, 250, 252, 0.8));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
}

.two-tier-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  margin: -6px 0;
}

.merger-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

/* ==========================================================================
   ENHANCED SCHOOL PORTAL EXECUTIVE STYLING
   ========================================================================== */
#schoolPortalWorkspace .sch-bento-kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  #schoolPortalWorkspace .sch-bento-kpi-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #schoolPortalWorkspace .sch-bento-kpi-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sch-settings-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-xl, 18px);
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .sch-settings-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================================
   📊 PHÂN KHU 4: BÁO CÁO AN TOÀN 360° & BẢN ĐỒ ĐIỂM NÓNG THỜI GIAN THỰC
   ============================================================================ */

.sch-a360-drilldown-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  color: var(--text-primary);
}

[data-theme="dark"] .sch-a360-drilldown-banner {
  background: rgba(2, 132, 199, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
}

.sch-a360-drilldown-clear {
  border: 1px solid rgba(2, 132, 199, 0.35);
  background: var(--bg-elevated, #ffffff);
  color: #0284c7;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.sch-a360-drilldown-clear:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

[data-theme="dark"] .sch-a360-drilldown-clear {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

[data-theme="dark"] .sch-a360-drilldown-clear:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.sch-a360-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--font-primary);
}

/* 1. Command Header */
.sch-a360-command-header {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-top: 3px solid #2563eb;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 10px 28px -10px rgba(15, 23, 42, 0.09);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="dark"] .sch-a360-command-header {
  background: rgba(18, 25, 41, 0.88);
  border-color: rgba(255, 255, 255, 0.09);
  border-top-color: #38bdf8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.sch-a360-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.sch-a360-telemetry-left,
.sch-a360-telemetry-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sch-a360-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #059669;
}

[data-theme="dark"] .sch-a360-live-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.sch-a360-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
  animation: schA360LivePulse 1.8s infinite;
}

@keyframes schA360LivePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.sch-a360-live-pill.paused {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.36);
  color: #d97706;
}

[data-theme="dark"] .sch-a360-live-pill.paused {
  color: #fbbf24;
}

.sch-a360-live-pill.paused .sch-a360-pulse-dot {
  background: #f59e0b;
  animation: none;
}

.sch-a360-clock-pill,
.sch-a360-countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .sch-a360-clock-pill,
[data-theme="dark"] .sch-a360-countdown-pill {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.sch-a360-clock-pill strong,
.sch-a360-countdown-pill strong {
  color: var(--text-primary);
  font-weight: 800;
}

.sch-a360-sync-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-subtle, #cbd5e1);
  padding-left: 6px;
}

.sch-a360-interval-group,
.sch-a360-timeframe-group,
.sch-a360-severity-group,
.sch-a360-mode-group,
.sch-a360-layer-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 3px;
}

[data-theme="dark"] .sch-a360-interval-group,
[data-theme="dark"] .sch-a360-timeframe-group,
[data-theme="dark"] .sch-a360-severity-group,
[data-theme="dark"] .sch-a360-mode-group,
[data-theme="dark"] .sch-a360-layer-group {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.1);
}

.sch-a360-iv-btn,
.sch-a360-tf-btn,
.sch-a360-sev-btn,
.sch-a360-mode-btn,
.sch-a360-layer-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.sch-a360-iv-btn:hover,
.sch-a360-tf-btn:hover,
.sch-a360-sev-btn:hover,
.sch-a360-mode-btn:hover,
.sch-a360-layer-btn:hover {
  color: var(--primary, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}

.sch-a360-iv-btn.active,
.sch-a360-tf-btn.active,
.sch-a360-sev-btn.active,
.sch-a360-mode-btn.active,
.sch-a360-layer-btn.active {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.sch-a360-sev-btn[data-sev="urgent_sos"].active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.28);
}

.sch-a360-ctrl-btn,
.sch-a360-mini-btn {
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

[data-theme="dark"] .sch-a360-ctrl-btn,
[data-theme="dark"] .sch-a360-mini-btn {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
}

.sch-a360-ctrl-btn:hover,
.sch-a360-mini-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
}

[data-theme="dark"] .sch-a360-ctrl-btn:hover,
[data-theme="dark"] .sch-a360-mini-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.sch-a360-mini-btn.primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
}

.sch-a360-mini-btn.primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.34);
}

[data-theme="dark"] .sch-a360-mini-btn.primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

[data-theme="dark"] .sch-a360-mini-btn.primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  color: #ffffff;
}

.sch-a360-ctrl-btn.paused {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
}

[data-theme="dark"] .sch-a360-ctrl-btn.paused {
  color: #fbbf24;
}

.sch-a360-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.sch-a360-title-block {
  flex: 1 1 320px;
  min-width: 0;
}

.sch-a360-hero-title {
  margin: 0;
  font-size: clamp(1.12rem, 2.2vw, 1.38rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.sch-a360-hero-subtitle {
  margin: 5px 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sch-a360-controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sch-a360-action-btns {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.sch-a360-action-btn {
  font-weight: 700;
  border-radius: 10px;
}

/* Shared Bento Card Surface */
.sch-a360-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px -10px rgba(15, 23, 42, 0.08);
  min-width: 0;
}

[data-theme="dark"] .sch-a360-card {
  background: rgba(18, 25, 41, 0.85);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.sch-a360-card-head,
.sch-a360-panel-head,
.sch-a360-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.sch-a360-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.sch-a360-card-sub {
  margin: 3px 0 0;
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 2. Bento KPI Grid (4 Cards) */
.sch-a360-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.sch-a360-kpi-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 6px 20px -10px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .sch-a360-kpi-card {
  background: rgba(18, 25, 41, 0.85);
  border-color: rgba(255, 255, 255, 0.09);
}

.sch-a360-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 12px 24px -10px rgba(2, 132, 199, 0.18);
}

.sch-a360-kpi-clickable {
  cursor: pointer;
}

.sch-a360-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sch-a360-kpi-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sch-a360-kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Radial Safety Gauge */
.sch-a360-kpi-gauge {
  background: linear-gradient(145deg, rgba(2, 132, 199, 0.07), rgba(16, 185, 129, 0.05));
  border-color: rgba(2, 132, 199, 0.24);
}

[data-theme="dark"] .sch-a360-kpi-gauge {
  background: linear-gradient(145deg, rgba(2, 132, 199, 0.14), rgba(16, 185, 129, 0.09));
}

.sch-a360-gauge-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sch-a360-gauge-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.sch-a360-gauge-svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.sch-a360-gauge-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 7;
}

.sch-a360-gauge-arc {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.sch-a360-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.sch-a360-gauge-score {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.sch-a360-gauge-max {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sch-a360-gauge-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sch-a360-grade-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
}

.sch-a360-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.sch-a360-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.sch-a360-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 800;
}

.sch-a360-delta.up-warn {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.sch-a360-delta.down-good {
  background: rgba(16, 185, 129, 0.13);
  color: #059669;
}

.sch-a360-delta.neutral {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-secondary);
}

[data-theme="dark"] .sch-a360-delta.up-warn {
  color: #f87171;
}

[data-theme="dark"] .sch-a360-delta.down-good {
  color: #34d399;
}

.sch-a360-kpi-hotspot {
  border-left: 4px solid #f59e0b;
}

.sch-a360-kpi-zone-title {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.sch-a360-focus-map-btn {
  border: 1px solid rgba(2, 132, 199, 0.32);
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sch-a360-focus-map-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

[data-theme="dark"] .sch-a360-focus-map-btn {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
}

/* 3. Main Split: Interactive Map (Left) + Real-time Live Stream (Right) */
.sch-a360-main-split {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.sch-a360-map-panel,
.sch-a360-feed-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sch-a360-map-pane,
.sch-a360-campus-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sch-a360-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
}

[data-theme="dark"] .sch-a360-map-toolbar {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-a360-toolbar-left,
.sch-a360-perimeter-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.sch-a360-ring-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
}

[data-theme="dark"] .sch-a360-ring-chip {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.sch-a360-ring-chip.ring-50 {
  color: #dc2626;
}

.sch-a360-ring-chip.ring-150 {
  color: #d97706;
}

.sch-a360-ring-chip.ring-300 {
  color: #0284c7;
}

/* Leaflet Map Container (z-index isolated so sticky header & modals stay above) */
.sch-a360-leaflet-wrap {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: #e2e8f0;
  isolation: isolate;
}

[data-theme="dark"] .sch-a360-leaflet-wrap {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}

.sch-a360-leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 1;
  font-family: var(--font-primary);
}

#schHotspotLeafletMap .leaflet-pane,
#schHotspotLeafletMap .leaflet-top,
#schHotspotLeafletMap .leaflet-bottom,
#schHotspotLeafletMap .leaflet-control {
  z-index: 2;
}

#schHotspotLeafletMap .leaflet-popup-pane {
  z-index: 4;
}

[data-theme="dark"] #schHotspotLeafletMap.layer-osm .leaflet-tile-pane {
  filter: invert(92%) hue-rotate(180deg) brightness(94%) contrast(90%);
}

[data-theme="dark"] #schHotspotLeafletMap .leaflet-control-zoom a {
  background: #1e293b;
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] #schHotspotLeafletMap .leaflet-popup-content-wrapper,
[data-theme="dark"] #schHotspotLeafletMap .leaflet-popup-tip {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#schHotspotLeafletMap .leaflet-popup-content {
  font-family: var(--font-primary);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 10px 12px;
}

.sch-a360-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 10px;
  color: var(--text-primary);
}

[data-theme="dark"] .sch-a360-map-fallback {
  background: rgba(15, 23, 42, 0.94);
}

.sch-a360-fallback-card {
  max-width: 420px;
  width: 100%;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .sch-a360-fallback-card {
  background: rgba(30, 41, 59, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.sch-a360-fallback-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.sch-a360-fallback-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sch-a360-fallback-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Leaflet Marker Popups */
.sch-a360-popup {
  min-width: 225px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-primary);
  color: var(--text-main);
}

.sch-a360-popup-head {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.sch-a360-popup-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sch-a360-popup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
}

.sch-a360-popup-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.sch-a360-popup-cat,
.sch-a360-popup-loc {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

.sch-a360-popup-gps-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sch-a360-popup-gps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
}

.sch-a360-popup-gps.exact {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.sch-a360-popup-gps.est {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

[data-theme="dark"] .sch-a360-popup-gps.exact {
  color: #34d399;
}

[data-theme="dark"] .sch-a360-popup-gps.est {
  color: #fbbf24;
}

.sch-a360-popup-desc {
  margin: 2px 0 0;
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.45;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .sch-a360-popup-desc {
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
}

.sch-a360-popup-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.sch-a360-popup-actions .sch-a360-mini-btn {
  flex: 1 1 auto;
  justify-content: center;
}

/* Custom Leaflet Pulsing Pin */
.sch-a360-leaflet-pin {
  background: transparent;
  border: none;
}

.sch-a360-pin-marker {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sch-a360-pin-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.45;
  animation: schA360PinRadar 1.9s infinite ease-out;
}

@keyframes schA360PinRadar {
  0% {
    transform: scale(0.65);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

.sch-a360-pin-core {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
}

.sch-a360-pin-marker.sev-critical .sch-a360-pin-core,
.sch-a360-pin-marker.sev-critical .sch-a360-pin-ring {
  background: #ef4444;
}

.sch-a360-pin-marker.sev-urgent .sch-a360-pin-core,
.sch-a360-pin-marker.sev-urgent .sch-a360-pin-ring {
  background: #f59e0b;
}

.sch-a360-pin-marker.sev-normal .sch-a360-pin-core,
.sch-a360-pin-marker.sev-normal .sch-a360-pin-ring {
  background: #0284c7;
}

.sch-a360-pin-marker.sev-resolved .sch-a360-pin-core,
.sch-a360-pin-marker.sev-resolved .sch-a360-pin-ring {
  background: #10b981;
}

.sch-a360-pin-marker.sev-resolved .sch-a360-pin-ring {
  animation: none;
  opacity: 0;
}

.sch-a360-pin-marker.sev-school .sch-a360-pin-core {
  width: 24px;
  height: 24px;
  background: #2563eb;
  font-size: 12px;
}

.sch-a360-pin-marker.sev-school .sch-a360-pin-ring {
  background: #2563eb;
}

.sch-a360-pin-marker.is-focused .sch-a360-pin-core {
  transform: scale(1.28);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Campus SVG + 6x4 Matrix Pane */
.sch-a360-campus-map-panel,
.sch-a360-matrix-panel {
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 14px;
}

[data-theme="dark"] .sch-a360-campus-map-panel,
[data-theme="dark"] .sch-a360-matrix-panel {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-a360-campus-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.sch-a360-map-bg {
  fill: #f1f5f9;
}

[data-theme="dark"] .sch-a360-map-bg {
  fill: #0f172a;
}

.sch-a360-map-road {
  fill: #e2e8f0;
}

[data-theme="dark"] .sch-a360-map-road {
  fill: #1e293b;
}

.sch-a360-map-road-line {
  stroke: #cbd5e1;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

[data-theme="dark"] .sch-a360-map-road-line {
  stroke: #334155;
}

.sch-a360-map-zone {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sch-a360-map-zone:hover {
  opacity: 0.92;
}

.sch-a360-map-bldg {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.sch-a360-map-yard {
  fill: #ecfdf5;
  stroke: #34d399;
  stroke-width: 1.5;
}

.sch-a360-map-corridor {
  fill: #eff6ff;
  stroke: #60a5fa;
  stroke-width: 1.5;
}

.sch-a360-map-cyber {
  fill: #f5f3ff;
  stroke: #a78bfa;
  stroke-width: 1.5;
}

[data-theme="dark"] .sch-a360-map-bldg {
  fill: #1e293b;
  stroke: #475569;
}

[data-theme="dark"] .sch-a360-map-yard {
  fill: rgba(16, 185, 129, 0.14);
  stroke: #10b981;
}

[data-theme="dark"] .sch-a360-map-corridor {
  fill: rgba(37, 99, 235, 0.16);
  stroke: #3b82f6;
}

[data-theme="dark"] .sch-a360-map-cyber {
  fill: rgba(139, 92, 246, 0.16);
  stroke: #8b5cf6;
}

.sch-a360-map-label {
  fill: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-primary);
}

.sch-a360-zone-halo {
  transition: all 0.25s ease;
}

.sch-a360-pin-pulse {
  animation: schA360LivePulse 1.8s infinite;
}

.sch-a360-hotspot-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-elevated, #ffffff);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sch-a360-hotspot-chip.active,
.sch-a360-hotspot-chip:hover {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

[data-theme="dark"] .sch-a360-hotspot-chip {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .sch-a360-hotspot-chip.active,
[data-theme="dark"] .sch-a360-hotspot-chip:hover {
  color: #38bdf8;
  border-color: #38bdf8;
}

/* Matrix Table */
.sch-a360-matrix-scroll {
  width: 100%;
  overflow-x: auto;
}

.sch-a360-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  font-size: 0.75rem;
}

.sch-a360-matrix-table th {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 6px;
}

.sch-a360-matrix-zone-th {
  text-align: left !important;
  min-width: 120px;
}

.sch-a360-matrix-zone-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.sch-a360-matrix-zone-btn:hover,
.sch-a360-matrix-zone-btn.active {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

[data-theme="dark"] .sch-a360-matrix-zone-btn:hover,
[data-theme="dark"] .sch-a360-matrix-zone-btn.active {
  color: #38bdf8;
}

.sch-a360-heat-cell {
  border-radius: 8px;
  padding: 7px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  font-variant-numeric: tabular-nums;
}

.sch-a360-heat-cell:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.sch-a360-heat-cell.heat-0 {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.sch-a360-heat-cell.heat-1 {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.sch-a360-heat-cell.heat-2 {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.sch-a360-heat-cell.heat-3 {
  background: rgba(249, 115, 22, 0.25);
  color: #c2410c;
}

.sch-a360-heat-cell.heat-4 {
  background: rgba(239, 68, 68, 0.26);
  color: #b91c1c;
  font-weight: 800;
}

[data-theme="dark"] .sch-a360-heat-cell.heat-1 {
  color: #34d399;
}

[data-theme="dark"] .sch-a360-heat-cell.heat-2 {
  color: #fbbf24;
}

[data-theme="dark"] .sch-a360-heat-cell.heat-3 {
  color: #fb923c;
}

[data-theme="dark"] .sch-a360-heat-cell.heat-4 {
  color: #f87171;
}

.sch-a360-heat-num {
  font-weight: 800;
  font-size: 0.82rem;
}

.sch-a360-heat-sos {
  font-size: 0.66rem;
  font-weight: 800;
  color: #dc2626;
}

.sch-a360-heat-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Zone Inspector Strip */
.sch-a360-inspector-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 14px 16px;
}

[data-theme="dark"] .sch-a360-inspector-box {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-a360-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.sch-a360-inspector-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.sch-a360-inspector-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sch-a360-inspector-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sch-a360-inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.sch-a360-inspect-item {
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="dark"] .sch-a360-inspect-item {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-a360-inspect-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
}

.sch-a360-inspect-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sch-a360-inspect-meta,
.sch-a360-inspect-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sch-a360-inspector-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
}

/* Right Panel: Real-time Live Feed */
.sch-a360-feed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .sch-a360-feed-badge {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.sch-a360-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 550px;
  overflow-y: auto;
  padding-right: 4px;
}

.sch-a360-feed-item {
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-left: 4px solid #0284c7;
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

[data-theme="dark"] .sch-a360-feed-item {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}

.sch-a360-feed-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.12);
}

.sch-a360-feed-item.is-focused {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 8px 20px -8px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .sch-a360-feed-item.is-focused {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22), 0 8px 20px -8px rgba(0, 0, 0, 0.45);
}

.sch-a360-feed-item.sev-critical {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

.sch-a360-feed-item.sev-urgent {
  border-left-color: #f59e0b;
}

.sch-a360-feed-item.sev-resolved {
  border-left-color: #10b981;
}

.sch-a360-feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.sch-a360-feed-code {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
}

.sch-a360-reltime {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sch-a360-feed-body {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sch-a360-feed-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sch-a360-feed-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.sch-a360-risk-badge,
.sch-a360-status-pill,
.sch-a360-sla-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
}

.sch-a360-risk-badge.sev-critical {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.sch-a360-risk-badge.sev-urgent {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.sch-a360-risk-badge.sev-normal {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.sch-a360-status-pill.is-resolved {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.sch-a360-status-pill.is-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.sch-a360-sla-chip.is-overdue {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.sch-a360-sla-chip.is-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

[data-theme="dark"] .sch-a360-risk-badge.sev-critical,
[data-theme="dark"] .sch-a360-sla-chip.is-overdue {
  color: #f87171;
}

[data-theme="dark"] .sch-a360-risk-badge.sev-urgent,
[data-theme="dark"] .sch-a360-status-pill.is-pending {
  color: #fbbf24;
}

[data-theme="dark"] .sch-a360-risk-badge.sev-normal {
  color: #38bdf8;
}

[data-theme="dark"] .sch-a360-status-pill.is-resolved,
[data-theme="dark"] .sch-a360-sla-chip.is-ok {
  color: #34d399;
}

/* 4. Analytics Trio Row: Trend SVG + Donut + SLA Funnel */
.sch-a360-trio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.sch-a360-svg-chart-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
}

.sch-a360-trend-svg {
  width: 100%;
  height: auto;
  display: block;
}

.sch-a360-gridline {
  stroke: rgba(148, 163, 184, 0.25);
  stroke-dasharray: 4 4;
}

.sch-a360-axis-text {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-primary);
}

.sch-a360-bar-count {
  fill: var(--text-primary);
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-primary);
}

.sch-a360-bar-group {
  cursor: pointer;
}

.sch-a360-trend-node {
  transition: r 0.15s ease;
}

.sch-a360-empty-bar {
  fill: rgba(148, 163, 184, 0.14);
}

.sch-a360-hl-box {
  fill: rgba(2, 132, 199, 0.08);
  stroke: rgba(2, 132, 199, 0.3);
}

.sch-a360-legend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.sch-a360-leg-sq {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
}

.sch-a360-leg-ln {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.sch-a360-chart-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  min-width: 145px;
}

.sch-a360-tip-title {
  font-weight: 800;
  margin-bottom: 4px;
  color: #38bdf8;
}

.sch-a360-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.45;
}

.sch-a360-bucket-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(2, 132, 199, 0.07);
  border: 1px solid rgba(2, 132, 199, 0.22);
  font-size: 0.78rem;
}

/* Donut Chart */
.sch-a360-donut-layout {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sch-a360-donut-box {
  position: relative;
  width: 142px;
  height: 142px;
  flex-shrink: 0;
  margin: 0 auto;
}

.sch-a360-donut-svg {
  width: 142px;
  height: 142px;
  transform: rotate(-90deg);
}

.sch-a360-donut-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.2);
}

.sch-a360-donut-arc {
  fill: none;
  transition: stroke-dasharray 0.5s ease;
}

.sch-a360-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.sch-a360-donut-center strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.sch-a360-donut-center span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.sch-a360-cat-list {
  flex: 1 1 165px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.sch-a360-cat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sch-a360-cat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.sch-a360-cat-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 0;
}

.sch-a360-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sch-a360-cat-val {
  font-weight: 800;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* SLA Funnel */
.sch-a360-funnel-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sch-a360-funnel-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sch-a360-funnel-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.sch-a360-funnel-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sch-a360-funnel-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.sch-a360-funnel-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.sch-a360-funnel-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.sch-a360-funnel-sub {
  font-size: 0.71rem;
  color: var(--text-muted);
}

/* 5. Smart Tactical Alerts Row */
.sch-a360-alerts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sch-a360-alerts-grid,
.sch-a360-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sch-a360-insight-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-left: 4px solid #0284c7;
  border-radius: 16px;
  padding: 15px 17px;
  box-shadow: 0 6px 20px -10px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

[data-theme="dark"] .sch-a360-insight-card {
  background: rgba(18, 25, 41, 0.85);
  border-color: rgba(255, 255, 255, 0.09);
}

.sch-a360-insight-card.level-critical {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), transparent);
}

.sch-a360-insight-card.level-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), transparent);
}

.sch-a360-insight-card.level-success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), transparent);
}

.sch-a360-insight-card.level-info {
  border-left-color: #2563eb;
}

.sch-a360-insight-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sch-a360-insight-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sch-a360-insight-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.sch-a360-insight-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

.sch-a360-insight-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Responsive Breakpoints for #sch-subview-analytics */
@media (max-width: 1100px) {
  .sch-a360-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sch-a360-main-split {
    grid-template-columns: 1fr;
  }

  .sch-a360-feed-list {
    max-height: 380px;
  }

  .sch-a360-trio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sch-a360-trio-trend {
    grid-column: 1 / -1;
  }

  .sch-a360-alerts-grid,
  .sch-a360-insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sch-a360-command-header {
    padding: 15px 16px;
    border-radius: 16px;
  }

  .sch-a360-card {
    padding: 14px 15px;
    border-radius: 15px;
  }

  .sch-a360-leaflet-wrap {
    height: 320px;
  }

  .sch-a360-trio-grid,
  .sch-a360-alerts-grid,
  .sch-a360-insights-grid {
    grid-template-columns: 1fr;
  }

  .sch-a360-mode-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .sch-a360-mode-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .sch-a360-kpi-grid {
    grid-template-columns: 1fr;
  }

  .sch-a360-telemetry-bar,
  .sch-a360-header-main {
    gap: 10px;
  }

  .sch-a360-controls-row {
    width: 100%;
  }

  .sch-a360-timeframe-group,
  .sch-a360-severity-group {
    width: 100%;
    justify-content: space-between;
  }

  .sch-a360-tf-btn,
  .sch-a360-sev-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 6px 6px;
    font-size: 0.72rem;
  }

  .sch-a360-action-btns {
    width: 100%;
  }

  .sch-a360-action-btns .sch-a360-action-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media print {

  .sch-a360-controls-row,
  .sch-a360-telemetry-right,
  .sch-a360-map-toolbar,
  .sch-a360-mode-group,
  .sch-a360-feed-actions {
    display: none !important;
  }
}

.sch-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.sch-table-action-btn {
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.sch-table-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}



/* ============================================================================
   🌟 TRUNG TÂM PHÒNG CHỐNG BẠO LỰC HỌC ĐƯỜNG TOÀN DIỆN (A, B, C)
   ============================================================================ */

/* 1. Thanh Tab chuyển đổi A, B, C (Ngắn gọn, cân đối trên mọi thiết bị) */
.edu-nav-tabs-wrapper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 1.25rem auto 0.25rem;
  max-width: 1080px;
  width: 100%;
}

.edu-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  text-align: left;
  min-width: 0;
  width: 100%;
}

[data-theme="dark"] .edu-tab-btn {
  background: #1e293b;
  border-color: #334155;
}

.edu-tab-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #0284c7);
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.12);
}

.edu-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.26);
}

.edu-tab-btn .tab-ico {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
}

.edu-tab-btn .tab-txt {
  flex: 1 1 auto;
  min-width: 0;
}

.edu-tab-btn .tab-txt strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

.edu-tab-btn.active .tab-txt strong {
  color: #ffffff;
}

.edu-tab-btn .tab-txt small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
  line-height: 1.3;
}

.edu-tab-btn.active .tab-txt small {
  color: rgba(255, 255, 255, 0.88);
}

.edu-tab-btn .tab-arrow {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  transition: transform 0.22s ease, color 0.22s ease;
  flex-shrink: 0;
}

.edu-tab-btn.active .tab-arrow {
  color: #ffffff;
  transform: rotate(180deg);
}

/* Nav quick link pill in navbar */
.pill-nav-topic {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

[data-theme="dark"] .pill-nav-topic {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.pill-nav-topic:hover {
  background: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Animation & Toolbar cho từng pane */
.edu-pane {
  animation: eduFadeIn 0.3s ease;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(2, 132, 199, 0.18);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .edu-pane {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(56, 189, 248, 0.2);
}

@keyframes eduFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.edu-pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-subtle, #cbd5e1);
}

.edu-pane-badge {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

[data-theme="dark"] .edu-pane-badge {
  color: #38bdf8;
}

.edu-collapse-btn {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: #0284c7;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.edu-collapse-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Định nghĩa pháp lý gọn */
.edu-compact-def-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.07), rgba(37, 99, 235, 0.04));
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.edu-def-icon {
  font-size: 1.65rem;
  line-height: 1.1;
  flex-shrink: 0;
}

.edu-def-body strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.edu-def-law {
  font-size: 0.76rem;
  font-weight: 600;
  color: #0284c7;
}

.edu-def-body p {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* 2. Style cho Phần A (5 Hình thức bạo lực) */
.edu-types-5-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.edu-type-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

[data-theme="dark"] .edu-type-card {
  background: #1e293b;
  border-color: #334155;
}

.edu-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.edu-type-top-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.edu-type-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.edu-type-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.edu-type-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  color: var(--text-primary);
}

.edu-type-desc {
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 8px;
  flex: 1;
}

.edu-type-signs-box {
  background: var(--bg-elevated, #f8fafc);
  border: 1px dashed var(--border-subtle, #cbd5e1);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.73rem;
  line-height: 1.4;
}

[data-theme="dark"] .edu-type-signs-box {
  background: rgba(15, 23, 42, 0.6);
  border-color: #334155;
}

/* Khối 2 cột so sánh & nguyên tắc (Không dùng bảng tràn ngang) */
.edu-dual-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edu-summary-box {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}

[data-theme="dark"] .edu-summary-box {
  background: #1e293b;
  border-color: #334155;
}

.edu-summary-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.edu-vs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.edu-vs-item {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.edu-vs-item.safe {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.edu-vs-item.danger {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.edu-vs-badge {
  font-weight: 800;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.edu-vs-item.safe .edu-vs-badge {
  color: #059669;
}

.edu-vs-item.danger .edu-vs-badge {
  color: #dc2626;
}

.edu-vs-item ul {
  margin: 0;
  padding-left: 15px;
  color: var(--text-secondary);
}

.edu-vs-item li {
  margin-bottom: 4px;
}

.edu-vs-item li:last-child {
  margin-bottom: 0;
}

/* 3. Style cho Phần B (Video + 3 Câu chuyện trên lưới 2 cột cân đối) */
.edu-media-layout-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.edu-single-video-wrapper {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] .edu-single-video-wrapper {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.edu-video-ratio-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000000;
}

.edu-video-ratio-box video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

.edu-video-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.edu-video-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.edu-mini-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.edu-mini-pill.red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.edu-mini-pill.green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.edu-video-main-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.edu-video-short-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
}

.edu-video-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.edu-stories-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.edu-stories-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.edu-stories-col-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.edu-story-compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edu-story-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="dark"] .edu-story-card {
  background: #1e293b;
  border-color: #334155;
}

.edu-story-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.edu-story-meta strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.edu-story-meta span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
}

.edu-story-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.edu-story-quote {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

.edu-story-lesson {
  font-size: 0.73rem;
  font-weight: 700;
}

/* 4. Style cho Phần C (Kỹ Năng Xử Lý Thực Chiến) */
.edu-section-mini-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.edu-skills-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.edu-step-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 13px 14px;
  position: relative;
  transition: all 0.22s ease;
}

[data-theme="dark"] .edu-step-card {
  background: #1e293b;
  border-color: #334155;
}

.edu-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.edu-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.edu-step-title {
  font-size: 0.88rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
}

.edu-step-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

.edu-4l-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.edu-4l-item {
  background: var(--bg-elevated, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.77rem;
  line-height: 1.4;
}

[data-theme="dark"] .edu-4l-item {
  background: rgba(15, 23, 42, 0.65);
  border-color: #334155;
}

.edu-4l-item strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.edu-4l-item span {
  color: var(--text-secondary);
}

/* Đáp ứng đa thiết bị cho Trung Tâm Phòng Chống Bạo Lực Học Đường */
@media (max-width: 1100px) {
  .edu-types-5-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .edu-skills-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edu-media-layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .edu-types-5-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edu-dual-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Scenario Simulator Box */
.edu-scenario-box {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  border-radius: 18px;
  padding: 22px;
  margin-top: 1.5rem;
}

[data-theme="dark"] .edu-scenario-box {
  background: #1e293b;
  border-color: #334155;
}

.scenario-choice-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-elevated, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .scenario-choice-btn {
  background: #0f172a;
  border-color: #334155;
}

.scenario-choice-btn:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: #0284c7;
}

.scenario-choice-btn.selected-correct {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: #059669 !important;
  font-weight: 700;
}

.scenario-choice-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* ============================================================================
   📱 TỐI ƯU HÓA ĐÁP ỨNG CHO MỌI THIẾT BỊ (RESPONSIVE FOR ALL DEVICES)
   ============================================================================ */

/* Chống tràn ngang tuyệt đối trên mọi màn hình di động */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* Thanh điều hướng Navbar trên điện thoại & máy tính bảng nhỏ (EcoLife Drawer) */
@media (max-width: 1024px) {
  .nav-menu {
    gap: 1.1rem;
  }

  .nav-link {
    font-size: 0.88rem;
  }
}

@media (max-width: 1024px),
(hover: none) and (pointer: coarse) {
  .hide-on-mobile {
    display: none !important;
  }

  .nav-bar,
  .site-header,
  .nav-bar.scrolled,
  .site-header.scrolled {
    padding: 0.42rem 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .nav-bar .nav-container {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 0 0.65rem !important;
    gap: 0.35rem !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    min-width: 0 !important;
  }

  .nav-bar nav[aria-label="Primary Navigation"] {
    width: 0 !important;
    height: 0 !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .nav-actions .utility-switcher,
  .nav-actions #loggedInUserBadge,
  .nav-actions #btnBackToHome {
    display: none !important;
  }

  .nav-actions,
  .header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.35rem !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  .mobile-toggle,
  #mobileMenuToggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(2, 132, 199, 0.1) !important;
    border: 1.5px solid rgba(2, 132, 199, 0.35) !important;
    border-radius: 10px !important;
    color: #0284c7 !important;
    cursor: pointer !important;
    z-index: 1002 !important;
    position: relative !important;
    pointer-events: auto !important;
  }

  .mobile-toggle svg.mobile-toggle-icon,
  #mobileMenuToggle svg.mobile-toggle-icon {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
    stroke-width: 2.6 !important;
    display: block !important;
  }

  .mobile-toggle[aria-expanded="true"] {
    background: rgba(2, 132, 199, 0.16);
    border-color: rgba(2, 132, 199, 0.4);
    color: var(--primary);
  }

  [data-theme="dark"] .mobile-toggle[aria-expanded="true"] {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
  }

  .nav-drawer-backdrop {
    display: block;
    position: fixed;
    top: var(--header-height, 58px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: pointer;
  }

  .nav-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  [data-theme="dark"] .nav-drawer-backdrop {
    background: rgba(2, 6, 23, 0.62);
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height, 58px);
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-direction: column;
    padding: 0.6rem 1rem 1.15rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 0 18px 18px;
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, visibility 0.22s ease;
    gap: 0;
    align-items: stretch;
    max-height: calc(100vh - var(--header-height, 58px));
    max-height: calc(100dvh - var(--header-height, 58px));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 999;
  }

  [data-theme="dark"] .nav-menu {
    background: rgba(15, 23, 42, 0.98);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu>li {
    width: 100%;
  }

  .nav-menu>li:not(.nav-mobile-only) {
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  [data-theme="dark"] .nav-menu>li:not(.nav-mobile-only) {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.98rem;
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    margin: 2px 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link:active {
    background: rgba(2, 132, 199, 0.08);
  }

  .nav-link.active {
    background: rgba(2, 132, 199, 0.12);
    color: var(--primary);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary);
  }

  [data-theme="dark"] .nav-link:hover,
  [data-theme="dark"] .nav-link:active {
    background: rgba(56, 189, 248, 0.1);
  }

  [data-theme="dark"] .nav-link.active {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    box-shadow: inset 3px 0 0 #38bdf8;
  }

  .nav-mobile-only {
    display: block;
  }

  .nav-mobile-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.7rem 0.5rem 0.45rem;
  }

  .nav-mobile-quick-row,
  .nav-mobile-account-row {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    width: 100%;
    margin-bottom: 0.45rem;
  }

  .nav-mobile-action-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-mobile-action-btn:hover {
    background: #f1f5f9;
  }

  [data-theme="dark"] .nav-mobile-action-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
  }

  [data-theme="dark"] .nav-mobile-action-btn:hover {
    background: rgba(51, 65, 85, 0.92);
  }

  .nav-mobile-auth-btn,
  .nav-mobile-account-btn {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.28);
    color: var(--primary);
  }

  [data-theme="dark"] .nav-mobile-auth-btn,
  [data-theme="dark"] .nav-mobile-account-btn {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
  }

  .nav-mobile-logout-btn {
    flex: 0 0 auto;
    min-width: 78px;
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.28);
    color: #e11d48;
  }

  [data-theme="dark"] .nav-mobile-logout-btn {
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.32);
    color: #fda4af;
  }

  .brand-logo {
    font-size: 1.18rem;
  }

  .brand-logo .logo-icon {
    width: 32px;
    height: 32px;
  }

  .btn-header-sos {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    min-height: 38px;
  }

  .hero-quote {
    padding: 1.2rem 1.4rem;
  }

  .quote-text {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {

  /* Mascot và mây trang trí co nhỏ lại không che chữ */
  .hero-mascot-wrapper {
    display: none;
  }

  .hero-deco-layer {
    opacity: 0.4;
  }

  .footer-plane-deco {
    display: none !important;
  }

  .hero-showcase-row {
    flex-direction: column;
    gap: 14px;
    align-items: center;
  }

  .hero-title-character {
    width: 100%;
    max-width: 280px;
  }

  .main-title p {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  /* 3 Tab A, B, C hiển thị gọn gàng trên cùng 1 hàng trên cả máy tính bảng & điện thoại */
  .edu-nav-tabs-wrapper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .edu-tab-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
    gap: 5px;
    border-radius: 12px;
  }

  .edu-tab-btn .tab-ico {
    font-size: 1.35rem;
  }

  .edu-tab-btn .tab-txt strong {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .edu-tab-btn .tab-txt small {
    font-size: 0.66rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .edu-tab-btn .tab-arrow {
    display: none;
  }

  .edu-pane {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .edu-pane-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .edu-pane-badge {
    font-size: 0.7rem;
  }

  /* Các lưới card chuyển đổi mượt mà trên điện thoại */
  .edu-types-5-grid,
  .edu-video-grid,
  .edu-poster-grid,
  .edu-story-grid,
  .edu-skills-step-grid,
  .edu-vs-cards,
  .edu-4l-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Modal trên di động */
  .modal-box {
    width: 95% !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    padding: 16px !important;
    border-radius: 16px !important;
  }

  /* Hộp thư trên màn hình điện thoại */
  .msg-app-layout {
    flex-direction: column;
    height: calc(100vh - 65px);
  }

  .msg-sidebar-pane {
    width: 100%;
    max-width: 100%;
    flex: 1;
  }

  .msg-main-pane {
    width: 100%;
  }

  /* Form nhập tin nhắn trên điện thoại */
  .messenger-bar-form {
    padding: 6px 10px;
    gap: 6px;
  }

  .msg-input-field {
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.08rem;
  }

  .brand-logo .logo-text,
  .brand-tab-text {
    font-size: 0.88rem !important;
  }

  .brand-logo .logo-icon,
  .brand-tab-icon {
    font-size: 0.98rem !important;
  }

  .btn-header-sos {
    padding: 0.4rem 0.76rem;
    font-size: 0.76rem;
    gap: 0.32rem;
  }

  .header-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .main-title p {
    font-size: 1.55rem !important;
  }

  .hero-cta-stack {
    flex-direction: column;
    width: 100%;
  }

  .hero-mailbox-btn,
  .hero-sos-btn,
  .hero-install-app-btn {
    width: 100%;
    justify-content: center;
  }

  .btn-header-install {
    padding: 0.36rem 0.55rem !important;
    font-size: 0.74rem !important;
    min-height: 36px !important;
  }
}

/* ============================================================================
   📲 NÚT TẢI APP & ĐƯA RA MÀN HÌNH CHÍNH (1-CHẠM TRÊN MỌI THIẾT BỊ)
   ============================================================================ */
.btn-header-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.42rem 0.85rem;
  min-height: 38px;
  border-radius: 999px;
  border: 1.5px solid rgba(5, 150, 105, 0.35);
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-header-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.32);
}

.btn-header-install-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  background: #ffffff;
  flex-shrink: 0;
}

.hero-install-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(5, 150, 105, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hero-install-app-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(2, 132, 199, 0.36);
}

.hero-install-app-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.hero-install-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 390px) {
  .btn-header-install-text {
    display: none;
  }

  .btn-header-install {
    padding: 0.36rem 0.48rem !important;
  }
}

/* ============================================================================
   ⭐ HỆ THỐNG ĐÁNH GIÁ WEB 5 SAO (KIỂU ĐÁNH GIÁ ĐƠN HÀNG) & QUẢN TRỊ ADMIN
   ============================================================================ */
.home-web-review-section {
  max-width: 1200px;
  margin: 28px auto 36px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.home-web-review-card {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

[data-theme="dark"] .home-web-review-card {
  background: rgba(18, 25, 41, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.home-review-summary-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.home-review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.home-review-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.3;
}

.home-review-subtitle {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary, #475569);
  line-height: 1.55;
}

.home-review-score-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
}

[data-theme="dark"] .home-review-score-box {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.home-review-score-left {
  text-align: center;
  min-width: 96px;
  padding-right: 14px;
  border-right: 1px solid #e2e8f0;
}

[data-theme="dark"] .home-review-score-left {
  border-right-color: rgba(255, 255, 255, 0.12);
}

.home-review-avg-number {
  font-size: 2rem;
  font-weight: 800;
  color: #f59e0b;
  line-height: 1.05;
}

.home-review-avg-stars {
  font-size: 0.95rem;
  color: #f59e0b;
  letter-spacing: 1px;
  margin: 4px 0 2px;
}

.home-review-total-count {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.home-review-bars-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.star-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
}

.star-dist-label {
  width: 34px;
  font-weight: 700;
  white-space: nowrap;
}

.star-dist-track {
  flex: 1;
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

[data-theme="dark"] .star-dist-track {
  background: rgba(255, 255, 255, 0.12);
}

.star-dist-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.35s ease;
}

.star-dist-count {
  width: 34px;
  text-align: right;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.home-review-trust-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #059669;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.45;
  font-weight: 600;
}

.home-review-form-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

[data-theme="dark"] .home-review-form-col {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}

.home-review-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.home-review-form-head strong {
  font-size: 0.98rem;
  color: var(--text-primary, #0f172a);
}

.home-review-hint {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

.order-star-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.order-star-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 2.25rem;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), color 0.16s ease, filter 0.16s ease;
  user-select: none;
}

.order-star-row-lg .order-star-btn {
  font-size: 2.65rem;
}

.order-star-btn.active,
.order-star-btn.hover-preview {
  color: #f59e0b;
  transform: scale(1.12);
  filter: drop-shadow(0 3px 8px rgba(245, 158, 11, 0.35));
}

.order-star-label {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #d97706;
  margin-bottom: 12px;
}

.review-tag-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 12px;
}

.review-tag-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

[data-theme="dark"] .review-tag-chip {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.review-tag-chip:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.review-tag-chip.selected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .review-tag-chip.selected {
  background: rgba(37, 99, 235, 0.28);
  border-color: #60a5fa;
  color: #93c5fd;
}

.home-review-inputs-row {
  margin-bottom: 8px;
}

.home-review-role-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.home-review-textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 64px;
}

.home-review-submit-row {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.btn-submit-web-review {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-submit-web-review:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.36);
}

.home-review-thankyou-box {
  text-align: center;
  padding: 18px 12px;
}

.home-review-thankyou-box h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #059669;
  font-weight: 800;
}

.home-review-thankyou-box p {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-secondary, #475569);
}

/* Modal popup đánh giá sau khi gửi báo cáo 3 giây */
#webReviewModal {
  z-index: 100050 !important;
}

.web-review-modal-card {
  max-width: 480px;
  width: 94%;
  padding: 0 !important;
  border-radius: 22px !important;
  overflow: hidden;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  animation: msgBubblePop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .web-review-modal-card {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.web-review-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  color: #ffffff;
}

.web-review-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.web-review-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.web-review-modal-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
}

.web-review-modal-sub {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.web-review-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.web-review-modal-body {
  padding: 18px 20px 14px;
}

.web-review-prompt-text {
  text-align: center;
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

[data-theme="dark"] .web-review-prompt-text {
  color: #cbd5e1;
}

.web-review-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 18px;
  border-top: 1px solid #f1f5f9;
}

[data-theme="dark"] .web-review-modal-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Giao diện quản lý đánh giá trong Trang Admin */
.admin-rev-dist-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.admin-overview-reviews-list,
.admin-reviews-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.admin-review-card {
  background: var(--bg-elevated, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="dark"] .admin-review-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-review-stars {
  color: #f59e0b;
  font-size: 1rem;
  letter-spacing: 1px;
  font-weight: 800;
}

.admin-review-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-review-source-badge.post-report {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.admin-review-source-badge.home-footer {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.admin-review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-review-tag-pill {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  font-weight: 600;
}

.admin-review-comment {
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
  line-height: 1.5;
  white-space: pre-wrap;
}

[data-theme="dark"] .admin-review-comment {
  color: #e2e8f0;
}

.admin-review-meta-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  border-top: 1px dashed var(--border-color, #e2e8f0);
  padding-top: 8px;
}

@media (max-width: 860px) {
  .home-web-review-card {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 18px;
  }

  .home-review-score-box {
    flex-direction: column;
    align-items: stretch;
  }

  .home-review-score-left {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding-right: 0;
    padding-bottom: 10px;
  }
}

/* ============================================================================
   👩‍⚕️ CỔNG ĐĂNG KÝ, XÉT DUYỆT SỞ GD&ĐT & QUẢN LÝ CHUYÊN GIA TƯ VẤN (v50)
   ============================================================================ */
.cf-role-reg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.18s ease;
}

.cf-role-reg-pill.school:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.cf-role-reg-pill.expert {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.cf-role-reg-pill.expert:hover {
  border-color: #7c3aed;
  background: #ede9fe;
  color: #5b21b6;
}

.cf-compact-reg-form .cf-field-group {
  margin-bottom: 11px;
}

.cf-compact-reg-form .cf-field-label {
  font-size: 0.83rem;
  margin-bottom: 5px;
  white-space: nowrap;
}

.cf-compact-reg-form .cf-input {
  height: 43px;
  padding: 0 13px;
  font-size: 0.9rem;
}

.cf-compact-reg-form .cf-input.has-eye {
  padding-right: 38px;
}

.cf-compact-reg-form select.cf-input {
  padding: 0 28px 0 12px;
  text-overflow: ellipsis;
}

.cf-reg-hint-strip {
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.cf-reg-hint-strip.expert {
  color: #5b21b6;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}

/* Bước 2: Ô xác minh mã OTP qua SĐT hoặc Gmail */
.cf-otp-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 7px 12px;
  margin-bottom: 12px;
  font-size: 0.77rem;
  font-weight: 700;
}

.cf-otp-step.done {
  color: #059669;
}

.cf-otp-step.active {
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 9px;
  border-radius: 999px;
}

.cf-otp-step-arrow {
  color: #94a3b8;
  font-size: 0.75rem;
}

.cf-otp-summary-card {
  background: linear-gradient(135deg, #f8fafc, #f0f9ff);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.cf-otp-summary-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.cf-otp-summary-meta {
  min-width: 0;
  flex: 1;
}

.cf-otp-summary-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-otp-summary-sub {
  font-size: 0.76rem;
  color: #475569;
  margin-top: 1px;
}

.cf-otp-section-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 7px;
}

.cf-otp-channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.cf-otp-channel-card {
  text-align: left;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  min-width: 0;
}

.cf-otp-channel-card:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.cf-otp-channel-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cf-otp-channel-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.cf-otp-radio-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.cf-otp-channel-card.active .cf-otp-radio-dot {
  border-color: #2563eb;
}

.cf-otp-channel-card.active .cf-otp-radio-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #2563eb;
}

.cf-otp-channel-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1e293b;
}

.cf-otp-channel-val {
  font-size: 0.77rem;
  font-weight: 600;
  color: #0369a1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 22px;
}

.cf-send-otp-action-btn {
  width: 100%;
  border: 1.5px solid #0284c7;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cf-send-otp-action-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
}

.cf-send-otp-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.cf-otp-code-input {
  width: 100%;
  box-sizing: border-box;
  height: 52px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-otp-code-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cf-otp-code-input::placeholder {
  letter-spacing: 6px;
  color: #cbd5e1;
  font-weight: 600;
}

.cf-otp-sent-hint {
  font-size: 0.76rem;
  color: #64748b;
  text-align: center;
  margin: 7px 0 14px;
  line-height: 1.4;
}

.cf-otp-back-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.cf-otp-back-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.cf-otp-back-btn:hover {
  color: #2563eb;
  text-decoration: underline;
}

@media (max-width: 540px) {
  .cf-auth-card {
    padding: 20px 16px 18px;
  }

  .cf-otp-channel-grid {
    grid-template-columns: 1fr;
  }
}

.cf-reg-role-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.cf-reg-role-tab {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cf-reg-role-tab.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* Admin Sở GD&ĐT - Danh sách xét duyệt Chuyên gia */
.admin-experts-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-expert-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-expert-card.is-pending {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 35%);
}

.admin-expert-card.is-approved {
  border-left: 4px solid #10b981;
}

.admin-expert-card.is-rejected {
  border-left: 4px solid #ef4444;
  opacity: 0.88;
}

[data-theme="dark"] .admin-expert-card,
#ministryAdminWorkspace[data-ministry-theme="dark"] .admin-expert-card {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.2);
}

.admin-expert-left {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex: 1;
  min-width: 260px;
}

.admin-expert-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.22);
}

.admin-expert-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-expert-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-expert-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

#ministryAdminWorkspace[data-ministry-theme="dark"] .admin-expert-name {
  color: #f8fafc;
}

.admin-expert-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.admin-expert-status-pill.pending {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.admin-expert-status-pill.approved {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.admin-expert-status-pill.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.admin-expert-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary, #334155);
  font-weight: 600;
}

#ministryAdminWorkspace[data-ministry-theme="dark"] .admin-expert-contact-row {
  color: #cbd5e1;
}

.admin-expert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ============================================================================
   CỔNG QUẢN LÝ CHUYÊN GIA TỐI GIẢN (#expertPortalWorkspace)
   ============================================================================ */
#expertPortalWorkspace {
  min-height: 100vh;
  background: #f1f5f9;
  color: #0f172a;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] #expertPortalWorkspace {
  background: #0f172a;
  color: #f8fafc;
}

.exp-portal-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .exp-portal-topbar {
  background: #1e293b;
  border-color: #334155;
}

.exp-portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exp-portal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.exp-portal-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exp-portal-name-row strong {
  font-size: 1rem;
  font-weight: 800;
}

.exp-verified-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.exp-portal-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

[data-theme="dark"] .exp-portal-sub {
  color: #94a3b8;
}

.exp-portal-tabs {
  display: inline-flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 14px;
}

[data-theme="dark"] .exp-portal-tabs {
  background: #0f172a;
}

.exp-nav-tab {
  border: none;
  background: transparent;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
}

[data-theme="dark"] .exp-nav-tab {
  color: #94a3b8;
}

.exp-nav-tab.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.exp-tab-badge {
  background: rgba(255, 255, 255, 0.24);
  color: inherit;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.exp-nav-tab:not(.active) .exp-tab-badge {
  background: #e2e8f0;
  color: #334155;
}

.exp-portal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exp-portal-main {
  flex: 1;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 20px 28px;
  box-sizing: border-box;
}

/* Khu 1: Hộp thư 2 cột (Hội nhóm & Nhắn riêng) */
.exp-inbox-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 16px;
  height: calc(100vh - 118px);
  min-height: 540px;
}

.exp-inbox-sidebar,
.exp-inbox-chat {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .exp-inbox-sidebar,
[data-theme="dark"] .exp-inbox-chat {
  background: #1e293b;
  border-color: #334155;
}

.exp-sidebar-top {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

[data-theme="dark"] .exp-sidebar-top {
  border-color: #334155;
}

.exp-sidebar-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.exp-sidebar-desc {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: #64748b;
}

.exp-refresh-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.9rem;
}

[data-theme="dark"] .exp-refresh-btn {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.exp-filter-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px 6px;
}

.exp-filter-pill {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 10px;
  padding: 6px 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.16s ease;
}

[data-theme="dark"] .exp-filter-pill {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

.exp-filter-pill.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

[data-theme="dark"] .exp-filter-pill.active {
  background: rgba(37, 99, 235, 0.22);
  border-color: #3b82f6;
  color: #93c5fd;
}

.exp-filter-pill span {
  background: rgba(15, 23, 42, 0.08);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.exp-search-wrap {
  padding: 6px 12px 10px;
}

.exp-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.8rem;
  color: inherit;
}

[data-theme="dark"] .exp-search-input {
  background: #0f172a;
  border-color: #334155;
}

.exp-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exp-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.16s ease;
  color: inherit;
}

.exp-thread-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="dark"] .exp-thread-item:hover {
  background: rgba(15, 23, 42, 0.65);
  border-color: #334155;
}

.exp-thread-item.active {
  background: #eff6ff;
  border-color: #93c5fd;
}

[data-theme="dark"] .exp-thread-item.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
}

.exp-thread-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #fff;
}

.exp-thread-body {
  flex: 1;
  min-width: 0;
}

.exp-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.exp-thread-title {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exp-thread-tag {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.exp-thread-tag.direct {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}

.exp-thread-tag.group {
  background: rgba(234, 88, 12, 0.14);
  color: #c2410c;
}

.exp-thread-preview {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .exp-thread-preview {
  color: #94a3b8;
}

.exp-chat-header {
  padding: 13px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
}

[data-theme="dark"] .exp-chat-header {
  background: #0f172a;
  border-color: #334155;
}

.exp-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

[data-theme="dark"] .exp-chat-stream {
  background: #0b1120;
}

.exp-quick-chips {
  padding: 8px 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: #ffffff;
}

[data-theme="dark"] .exp-quick-chips {
  background: #1e293b;
  border-color: #334155;
}

.exp-attachment-preview {
  padding: 8px 16px;
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.exp-composer-bar {
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
}

[data-theme="dark"] .exp-composer-bar {
  background: #1e293b;
  border-color: #334155;
}

.exp-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  font-size: 1.05rem;
  flex-shrink: 0;
}

[data-theme="dark"] .exp-attach-btn {
  background: #0f172a;
  border-color: #334155;
}

.exp-composer-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.86rem;
  background: #f8fafc;
  color: inherit;
}

.exp-composer-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}

[data-theme="dark"] .exp-composer-input {
  background: #0f172a;
  border-color: #334155;
}

.exp-send-btn {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Khu 2: Chỉnh sửa Hồ sơ Chuyên gia */
.exp-profile-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-profile-preview,
.exp-profile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .exp-profile-preview,
[data-theme="dark"] .exp-profile-card {
  background: #1e293b;
  border-color: #334155;
}

.exp-profile-form-head h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 800;
}

.exp-profile-form-head p {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: #64748b;
}

.exp-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.exp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.exp-form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: inherit;
}

.exp-form-input,
.exp-form-textarea {
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 0.86rem;
  background: #f8fafc;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.exp-form-input:focus,
.exp-form-textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
}

[data-theme="dark"] .exp-form-input,
[data-theme="dark"] .exp-form-textarea {
  background: #0f172a;
  border-color: #334155;
}

.exp-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

[data-theme="dark"] .exp-profile-actions {
  border-color: #334155;
}

@media (max-width: 920px) {
  .exp-portal-topbar {
    padding: 12px 14px;
  }

  .exp-inbox-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .exp-inbox-sidebar {
    max-height: 320px;
  }

  .exp-inbox-chat {
    min-height: 480px;
  }

  .exp-form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}