/* =====================================================
   assets/css/portal.css — Watpanchatayikawat Super Portal
   Luxury Clean White & Royal Sapphire Blue Edition (Image 1 Style)
   60% White/Pearl Surface • 30% Crisp Slate • 10% Luxury Royal Blue Gradient
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800;900&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Prompt', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;

  /* 60-30-10 LUXURY PALETTE */
  --color-bg: #fcfbf7;
  --color-border-gold: rgba(245, 158, 11, 0.22);
  --color-gold-50: #fffdf5;
  --color-gold-100: #fef9e7;
  --color-gold-200: #fef08a;
  --color-gold-500: #f59e0b;
  --color-gold-600: #d97706;
  --color-gold-700: #b45309;
  --color-gold-900: #78350f;
  --grad-boon-sunshine: linear-gradient(135deg, #FFFDF8 0%, #FEF3C7 50%, #FDE68A 100%);
  --grad-boon-gold-btn: linear-gradient(145deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  /* Soft Pearl White (Exact match to Image 1) */
  --color-card-bg: #ffffff;
  /* Pure Crisp White */
  --color-border: #eef2f6;
  /* Subtle Clean Border */

  /* Luxury Royal Blue Gradients */
  --color-primary: #1e3a8a;
  --color-primary-light: #2563eb;
  --color-indigo: #4f46e5;
  --grad-luxury-blue: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #4f46e5 100%);
  --grad-luxury-pill: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #6366f1 100%);
  --grad-emerald: linear-gradient(135deg, #059669 0%, #10b981 100%);

  /* Typography */
  --color-text-main: #1e293b;
  --color-text-sub: #475569;
  --color-text-muted: #64748b;

  /* Soft Luxury Shadows */
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 10px 25px -5px rgba(37, 99, 235, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.03);
  --shadow-wow: 0 20px 30px -10px rgba(37, 99, 235, 0.16), 0 10px 15px -5px rgba(15, 23, 42, 0.04);

  /* Radii (Matching Image 1 rounded-[24px] / [28px]) */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 26px;
  --radius-full: 9999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =====================================================
   DYNAMIC ANIMATIONS & WOW INTERACTIONS (Image 1 Physics)
   ===================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSoft {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

.fade-up {
  animation: fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.delay-1 {
  animation-delay: 0.05s;
}

.delay-2 {
  animation-delay: 0.10s;
}

.delay-3 {
  animation-delay: 0.15s;
}

.delay-4 {
  animation-delay: 0.20s;
}

.wow-card {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.25s ease;
}

.wow-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: var(--shadow-wow);
}

.wow-card:active {
  transform: translateY(-2px) scale(0.99);
}

.wow-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wow-card:hover .wow-icon,
.daily-card:hover .wow-icon,
.step-card:hover .step-icon {
  transform: scale(1.16) rotate(7deg);
}

/* =====================================================
   TOP HEADER / NAVBAR (Image 1 Clean Style)
   ===================================================== */
.portal-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  width: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.brand-wrap:hover .brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

.brand-heading-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-system-full {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

/* CONTROLS TOOLBAR (RIGHT SIDE ON DESKTOP) */
.nav-controls-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-refresh-ver {
  background: #ffffff;
  color: #4f46e5;
  border: 1.5px solid #c7d2fe;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.btn-refresh-ver:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
  transform: translateY(-1px);
}

.btn-refresh-ver:active {
  transform: scale(0.96);
}

.btn-refresh-ver i {
  font-size: 0.82rem;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-refresh-ver:hover i {
  transform: rotate(180deg);
}

.term-pill-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: #1e3a8a;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: all 0.2s;
  width: fit-content;
}

.term-pill-compact:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.term-pill-compact i {
  font-size: 0.7rem;
  color: #2563eb;
}

.term-pill-select {
  background: transparent;
  border: none;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  outline: none;
  cursor: pointer;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.user-class-tag {
  font-size: 0.68rem;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 9999px;
}

.btn-logout-icon {
  color: #ef4444;
  margin-left: 4px;
  font-size: 0.78rem;
}

.btn-login {
  background: var(--grad-luxury-blue);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* =====================================================
   TOP OVERVIEW STATS (EXACT IMAGE 1 STYLE — 3 WHITE + 1 LUXURY GRADIENT)
   ===================================================== */
.overview-top-section {
  padding: 22px 0 8px;
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* Colored Left Strip (Like Image 1) */
.stat-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  border-radius: 0 4px 4px 0;
}

.strip-blue {
  background: #2563eb;
}

.strip-emerald {
  background: #10b981;
}

.strip-rose {
  background: #f43f5e;
}

.stat-info {
  min-width: 0;
  flex: 1;
  padding-left: 6px;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #1e293b;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 2px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.icon-blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(191, 219, 254, 0.6);
}

.icon-emerald {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(167, 243, 208, 0.6);
}

.icon-rose {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid rgba(254, 205, 211, 0.6);
}

/* 4th Stat Card: Luxury Royal Blue Gradient Card (Image 1's 4th Card!) */
.stat-card-luxury {
  background: var(--grad-luxury-blue);
  border: none;
  color: #ffffff;
  box-shadow: 0 14px 28px -6px rgba(37, 99, 235, 0.35);
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
}

.stat-card-luxury::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}

.stat-luxury-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.stat-card-luxury .stat-label {
  color: rgba(219, 234, 254, 0.9);
}

.stat-card-luxury .stat-value {
  color: #ffffff;
}

.stat-card-luxury .stat-unit {
  color: rgba(219, 234, 254, 0.85);
}

.icon-glass {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.stat-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

.stat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6ee7b7 0%, #38bdf8 100%);
  border-radius: 9999px;
  width: 0%;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =====================================================
   DAILY TEACHER OPERATIONS (2 ระบบหลักประจำวันของครู — คลีน เด่น กดง่าย)
   ===================================================== */
.steps-section {
  padding: 14px 0 48px;
  width: 100%;
}

.daily-ops-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  margin: 12px 0 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eef2f6;
  width: 100%;
}

.daily-ops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.daily-ops-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #1e293b;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  gap: 10px;
}

.daily-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.daily-ops-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  animation: pulseSoft 1.8s infinite;
}

.daily-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.daily-card {
  background: #f8fafc;
  border-radius: 20px;
  padding: 20px 22px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.daily-card:hover {
  background: #ffffff;
  transform: translateY(-5px);
  box-shadow: var(--shadow-wow);
}

.daily-card-attendance {
  border-left: 5px solid #2563eb;
}

.daily-card-duty {
  border-left: 5px solid #059669;
}

.daily-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

.daily-card-attendance .daily-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.daily-card-duty .daily-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.daily-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.daily-card-attendance .daily-icon {
  background: #eff6ff;
  color: #2563eb;
}

.daily-card-duty .daily-icon {
  background: #ecfdf5;
  color: #059669;
}

.daily-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 6px;
}

.daily-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

.daily-btn {
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.daily-card-attendance .daily-btn {
  background: var(--grad-luxury-blue);
  box-shadow: 0 6px 16px -3px rgba(37, 99, 235, 0.35);
}

.daily-card-duty .daily-btn {
  background: var(--grad-emerald);
  box-shadow: 0 6px 16px -3px rgba(5, 150, 105, 0.35);
}

.daily-card:hover .daily-btn i.fa-arrow-right {
  transform: translateX(5px);
}

.daily-btn i.fa-arrow-right {
  transition: transform 0.25s ease;
}

/* =====================================================
   5 STEPS GRID (CLEAN WHITE CARDS + SHORT TEXT + 5 COLORS)
   ===================================================== */
.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad-luxury-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  width: 100%;
}

.step-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid #eef2f6;
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  border: 1px solid transparent;
}

.step-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.step-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 10px;
  color: #1e293b;
}

.step-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.45;
}

.step-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.feature-tag {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.step-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  border-radius: 13px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: var(--font-heading);
  transition: all 0.25s ease;
  color: #ffffff;
  border: 1px solid transparent;
}

.step-action-btn i.fa-arrow-right {
  transition: transform 0.25s ease;
}

.step-action-btn:hover i.fa-arrow-right {
  transform: translateX(4px);
}

/* STEP 1: Royal Blue */
.step-card-1 {
  border-top: 4px solid #2563eb;
}

.step-card-1 .step-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.step-card-1 .step-icon {
  background: #eff6ff;
  color: #2563eb;
  border-color: #dbeafe;
}

.step-card-1 .feature-tag i {
  color: #2563eb;
}

.step-card-1 .step-action-btn {
  background: var(--grad-luxury-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.step-card-1 .step-action-btn:hover {
  opacity: 0.95;
}

/* STEP 2: Royal Violet */
.step-card-2 {
  border-top: 4px solid #7c3aed;
}

.step-card-2 .step-badge {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

.step-card-2 .step-icon {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ede9fe;
}

.step-card-2 .feature-tag i {
  color: #7c3aed;
}

.step-card-2 .step-action-btn {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.22);
}

/* STEP 3: Luxury Amber Gold */
.step-card-3 {
  border-top: 4px solid #d97706;
}

.step-card-3 .step-badge {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.step-card-3 .step-icon {
  background: #fffbeb;
  color: #d97706;
  border-color: #fef3c7;
}

.step-card-3 .feature-tag i {
  color: #d97706;
}

.step-card-3 .step-action-btn {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.22);
}

.step-card-3 .step-action-btn-soft {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
  box-shadow: none;
}

.step-card-3 .step-action-btn-soft:hover {
  background: #fef3c7;
}

/* STEP 4: Emerald Green (PRIMARY DISTINCT FOCUS FOR STEP 4) */
.step-card-4 {
  border: 2px solid #10b981;
  border-top: 5px solid #059669;
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.12);
}

.step-card-4 .step-badge {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.step-card-4 .step-icon {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.step-card-4 .feature-tag i {
  color: #059669;
}

.step-card-4 .step-action-btn {
  background: var(--grad-emerald);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.step-card-4 .step-action-btn.btn-step-duty {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.step-card-4 .step-action-btn-soft {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
  box-shadow: none;
}

.step-card-4 .step-action-btn-soft:hover {
  background: #d1fae5;
}

/* STEP 5: Rose Crimson */
.step-card-5 {
  border-top: 4px solid #e11d48;
}

.step-card-5 .step-badge {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.step-card-5 .step-icon {
  background: #fff1f2;
  color: #e11d48;
  border-color: #ffe4e6;
}

.step-card-5 .feature-tag i {
  color: #e11d48;
}

.step-card-5 .step-action-btn {
  background: linear-gradient(135deg, #be123c 0%, #e11d48 100%);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22);
}

.step-card-5 .step-action-btn-soft {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
  box-shadow: none;
}

.step-card-5 .step-action-btn-soft:hover {
  background: #ffe4e6;
}

/* =====================================================
   EVALUATION RUBRIC BANNER (CLEAN WHITE CARD AT BOTTOM)
   ===================================================== */
.eval-rubric-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 18px 24px;
  margin-top: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #eef2f6;
  border-left: 5px solid #2563eb;
  width: 100%;
}

.eval-rubric-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.eval-rubric-trophy {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.eval-rubric-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #1e293b;
}

.eval-rubric-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.eval-rubric-btn {
  background: var(--grad-luxury-blue);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.eval-rubric-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* =====================================================
   FOOTER & MOBILE BOTTOM BAR
   ===================================================== */
.portal-footer {
  margin-top: auto;
  background: #ffffff;
  border-top: 1px solid #eef2f6;
  padding: 18px 0 22px;
  font-size: 0.78rem;
  color: #64748b;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand strong {
  color: #1e293b;
}

.footer-exec {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
}

.footer-dot {
  color: #cbd5e1;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid #e2e8f0;
  z-index: 999;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.06);
  width: 100%;
}

.mobile-bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 500px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  font-family: var(--font-heading);
  position: relative;
  transition: all 0.2s;
}

.bottom-nav-item i {
  font-size: 1.12rem;
  margin-bottom: 2px;
}

.bottom-nav-item.active {
  color: #2563eb;
}

.bottom-nav-item.highlight-att {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.bottom-nav-item.highlight-duty {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.nav-tiny-badge {
  position: absolute;
  top: 1px;
  right: 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.54rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 9999px;
  line-height: 1.1;
}

/* =====================================================
   RESPONSIVE DESIGN (MOBILE FIRST — ZERO OVERFLOW)
   ===================================================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 74px;
  }

  .mobile-bottom-nav {
    display: block;
  }

  .daily-ops-box {
    padding: 16px;
    border-radius: 20px;
  }

  .daily-ops-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .eval-rubric-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .eval-rubric-btn {
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 12px;
  }

  .overview-top-section {
    padding: 14px 0 4px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 14px;
    border-radius: 20px;
  }

  .stat-label {
    font-size: 0.66rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-radius: 12px;
  }
}

/* =====================================================
   HARMONIZED LUXURY 3D DESIGN SYSTEM (User Directed)
   2-Column Stats on Mobile, Rich Colored Shades & Lights,
   3D Clay Mascots on Daily Cards, Clean Term Dropdown
   ===================================================== */
.overview-top-section {
  padding: 16px 0 8px;
}

/* Stats Grid: Exactly 2 Columns on Mobile/Tablet, 4 on Desktop */
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* Stat Cards: Restored Rich Depth, Colored Strips, Shadows */
.stat-card {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 18px 20px !important;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03) !important;
  border: 1px solid #eef2f6 !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease !important;
  text-decoration: none !important;
  overflow: hidden !important;
  position: relative !important;
}

.stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.12) !important;
  border-color: #cbd5e1 !important;
}

/* Restored Colored Accent Strips (Shades & Depth) */
.stat-strip {
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 6px !important;
  height: 100% !important;
  border-radius: 0 4px 4px 0 !important;
}

.strip-blue {
  background: #2563eb !important;
}

.strip-emerald {
  background: #059669 !important;
}

.strip-rose {
  background: #e11d48 !important;
}

.stat-info {
  padding-left: 6px !important;
}

.stat-label {
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin-bottom: 4px !important;
  font-family: var(--font-heading) !important;
}

.stat-value {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  font-family: var(--font-heading) !important;
  line-height: 1.1 !important;
}

.stat-icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
}

/* Stat 4: Glowing Luxury Royal Sapphire Blue Gradient with Blur Lights */
.stat-card-luxury {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px -6px rgba(37, 99, 235, 0.45), 0 6px 14px -2px rgba(37, 99, 235, 0.3) !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  position: relative !important;
  overflow: hidden !important;
}

.stat-card-luxury::before {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  top: -24px !important;
  right: -24px !important;
  width: 110px !important;
  height: 110px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 50% !important;
  filter: blur(18px) !important;
  pointer-events: none !important;
}

.stat-card-luxury .stat-label {
  color: rgba(219, 234, 254, 0.95) !important;
  font-weight: 700 !important;
}

.stat-card-luxury .stat-value {
  color: #ffffff !important;
}

.stat-card-luxury .icon-glass {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

.stat-progress-track {
  height: 7px !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 9999px !important;
  margin-top: 10px !important;
  overflow: hidden !important;
}

.stat-progress-bar {
  height: 100% !important;
  background: linear-gradient(90deg, #67e8f9 0%, #38bdf8 100%) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8) !important;
  border-radius: 9999px !important;
  transition: width 1s ease-in-out !important;
}

/* Navbar: Perfectly Aligned Term Dropdown Pill */
.term-pill-compact {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #ffffff !important;
  color: #1e3a8a !important;
  padding: 0 14px !important;
  height: 38px !important;
  border-radius: 14px !important;
  border: 1px solid #c7d2fe !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08) !important;
  white-space: nowrap !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  width: fit-content !important;
  position: relative !important;
  flex: 0 0 auto !important;
}

.term-pill-compact:hover {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
  transform: translateY(-1px) !important;
}

.term-pill-compact i.term-icon {
  font-size: 0.82rem !important;
  color: #2563eb !important;
  flex-shrink: 0 !important;
}

.term-pill-select {
  background: transparent !important;
  border: none !important;
  color: #1e3a8a !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  font-family: var(--font-heading) !important;
  outline: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding: 0 4px 0 2px !important;
  line-height: 36px !important;
}

.term-arrow {
  font-size: 0.65rem !important;
  color: #64748b !important;
  pointer-events: none !important;
  flex-shrink: 0 !important;
  margin-left: 2px !important;
}

/* Teacher Daily Operations Box & Cards (With 3D Clay Mascots) */
.daily-ops-box {
  background: #ffffff !important;
  border-radius: 24px !important;
  padding: 22px 24px !important;
  margin: 10px 0 24px !important;
  border: 1px solid #eef2f6 !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05) !important;
}

.daily-ops-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-bottom: 16px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px dashed #e2e8f0 !important;
}

.daily-ops-title {
  font-size: 1.08rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  font-family: var(--font-heading) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.daily-title-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 11px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
}

.live-clock-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  font-family: var(--font-heading) !important;
}

.daily-ops-pulse {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #dbeafe !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  font-family: var(--font-heading) !important;
}

.daily-ops-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
}

@media (max-width: 768px) {
  .daily-ops-grid {
    grid-template-columns: 1fr !important;
  }
}

.daily-card {
  background: #f8fafc !important;
  border-radius: 20px !important;
  padding: 20px 22px !important;
  border: 1px solid #e2e8f0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 14px !important;
  text-decoration: none !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease !important;
}

.daily-card:hover {
  background: #ffffff !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.1) !important;
  border-color: #cbd5e1 !important;
}

.daily-card-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.daily-card-left {
  flex: 1 !important;
}

.daily-card-clay {
  width: 76px !important;
  height: 76px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.daily-card-clay .clay-figure {
  width: 76px !important;
  height: 76px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.14)) !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.daily-card:hover .daily-card-clay .clay-figure {
  transform: scale(1.1) rotate(4deg) !important;
}

.daily-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 9999px !important;
  font-family: var(--font-heading) !important;
}

.daily-card-duty .daily-badge {
  background: #ecfdf5 !important;
  color: #059669 !important;
}

.daily-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 8px 0 4px !important;
  line-height: 1.35 !important;
  font-family: var(--font-heading) !important;
}

.daily-desc {
  font-size: 0.85rem !important;
  color: #64748b !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.daily-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  padding: 9px 14px !important;
  border-radius: 11px !important;
  transition: all 0.2s ease !important;
  font-family: var(--font-heading) !important;
}

.daily-card:hover .daily-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.daily-card-duty:hover .daily-btn {
  background: #059669 !important;
  border-color: #059669 !important;
}


/* =====================================================
   PORTAL HUB MEGA DROPDOWN & BREADCRUMB BAR (LUXURY)
   ===================================================== */
.portal-hub-dropdown {
  position: relative;
  display: inline-block;
}

.btn-portal-hub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-portal-hub:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.2);
}

.btn-portal-hub .hub-chevron {
  font-size: 0.68rem;
  transition: transform 0.3s ease;
}

.portal-hub-dropdown.is-open .btn-portal-hub .hub-chevron {
  transform: rotate(180deg);
}

.portal-hub-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 330px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 38px -10px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.05);
  padding: 10px;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.portal-hub-dropdown.is-open .portal-hub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hub-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.hub-menu-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e3a8a;
  font-family: var(--font-heading);
}

.hub-menu-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 9999px;
}

.hub-menu-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hub-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hub-menu-item:hover {
  background: #f8fafc;
  transform: translateX(4px);
}

.hub-menu-item.is-active {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}

.hub-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.hub-icon-blue {
  background: #eff6ff;
  color: #2563eb;
}

.hub-icon-violet {
  background: #f5f3ff;
  color: #7c3aed;
}

.hub-icon-amber {
  background: #fffbeb;
  color: #d97706;
}

.hub-icon-emerald {
  background: #ecfdf5;
  color: #059669;
}

.hub-icon-rose {
  background: #fff1f2;
  color: #e11d48;
}

.hub-icon-red {
  background: #fef2f2;
  color: #dc2626;
}

.hub-item-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hub-item-content strong {
  font-size: 0.78rem;
  color: #0f172a;
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-item-content span {
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Breadcrumb Bar */
.portal-breadcrumb-bar {
  background: rgba(248, 250, 252, 0.88);
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 0;
  backdrop-filter: blur(8px);
}

.breadcrumb-inner {
  display: flex;
  align-items: center;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
  font-family: var(--font-heading);
}

.crumb-link {
  color: #64748b;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.crumb-link:hover {
  color: #1e3a8a;
}

.crumb-sep {
  font-size: 0.58rem;
  color: #94a3b8;
}

.crumb-current {
  color: #1e3a8a;
  font-weight: 700;
}

@media (max-width: 768px) {
  .portal-hub-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 74px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 72vh !important;
    overflow-y: auto !important;
    border-radius: 20px !important;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.2) !important;
    transform: translateY(12px) scale(0.98) !important;
  }

  .portal-hub-dropdown.is-open .portal-hub-menu {
    transform: translateY(0) scale(1) !important;
  }

  .portal-breadcrumb-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .breadcrumb-nav {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
}

/* Universal Zero Horizontal Overflow Guardrail */
html,
body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

/* =====================================================
   AUSPICIOUS LUMINOUS & 3D CLAY SYSTEM (โทนสว่างบุญๆ & 3D CLAY)
   ===================================================== */
:root {
  --clay-shadow-card: 10px 16px 30px -4px rgba(217, 119, 6, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03), inset 0 2px 4px rgba(255, 255, 255, 0.95), inset 0 -2px 4px rgba(245, 158, 11, 0.05);
  --clay-shadow-btn: 0 8px 18px -4px rgba(217, 119, 6, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.65), inset 0 -2px 4px rgba(0, 0, 0, 0.12);
  --clay-shadow-hover: 12px 22px 36px -4px rgba(217, 119, 6, 0.14), 0 6px 16px -2px rgba(15, 23, 42, 0.05), inset 0 2px 5px rgba(255, 255, 255, 1), inset 0 -2px 5px rgba(245, 158, 11, 0.08);
}

body {
  background-color: var(--color-bg) !important;
  background-image: 
    radial-gradient(110% 70% at 50% 0%, rgba(251, 191, 36, 0.12) 0%, rgba(254, 243, 199, 0.05) 45%, transparent 80%),
    radial-gradient(70% 40% at 90% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 60%) !important;
  word-break: keep-all !important;
  line-break: strict !important;
  overflow-wrap: break-word !important;
  line-height: 1.6 !important;
}

/* 3D Clay Card */
.clay-card {
  background: #ffffff !important;
  border-radius: 24px !important;
  box-shadow: var(--clay-shadow-card) !important;
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.25s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.clay-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--clay-shadow-hover) !important;
  border-color: rgba(245, 158, 11, 0.38) !important;
}

.clay-card:active {
  transform: scale(0.98) translateY(1px) !important;
}

/* 3D Clay Buttons */
.clay-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  border-radius: 9999px !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  border: none !important;
  min-height: 44px !important;
  padding: 0.6rem 1.4rem !important;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: var(--clay-shadow-btn) !important;
  touch-action: manipulation !important;
  user-select: none !important;
}

.clay-btn:active {
  transform: scale(0.96) translateY(2px) !important;
  box-shadow: 0 3px 8px -2px rgba(217, 119, 6, 0.3), inset 0 2px 2px rgba(0, 0, 0, 0.1) !important;
}

.clay-btn-gold {
  background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(120, 53, 15, 0.35) !important;
}

.clay-btn-white {
  background: linear-gradient(145deg, #ffffff 0%, #fef9e7 100%) !important;
  color: #78350f !important;
  box-shadow: 0 6px 14px -2px rgba(217, 119, 6, 0.12), inset 0 2px 3px rgba(255, 255, 255, 1), inset 0 -2px 4px rgba(245, 158, 11, 0.08) !important;
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
}

/* 3D Clay Badges */
.clay-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 9999px !important;
  font-family: var(--font-heading) !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.05), inset 0 1px 2px rgba(255, 255, 255, 0.85), inset 0 -1px 2px rgba(0, 0, 0, 0.04) !important;
}

.clay-badge-gold {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #78350f !important;
  border: 1px solid #fcd34d !important;
}

.clay-badge-emerald {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
}

.clay-badge-sky {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
  color: #075985 !important;
  border: 1px solid #7dd3fc !important;
}

.clay-badge-amber {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%) !important;
  color: #9a3412 !important;
  border: 1px solid #fdba74 !important;
}

/* 3D Clay Icon Bubbles */
.clay-icon-bubble {
  width: 48px !important;
  height: 48px !important;
  border-radius: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 8px 16px -4px rgba(217, 119, 6, 0.22), inset 0 2px 3px rgba(255, 255, 255, 0.8), inset 0 -2px 3px rgba(0, 0, 0, 0.08) !important;
  font-size: 1.25rem !important;
  flex-shrink: 0 !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.clay-icon-gold {
  background: linear-gradient(145deg, #fef3c7 0%, #f59e0b 100%) !important;
  color: #78350f !important;
}

.clay-icon-emerald {
  background: linear-gradient(145deg, #d1fae5 0%, #10b981 100%) !important;
  color: #064e3b !important;
}

.clay-icon-sky {
  background: linear-gradient(145deg, #e0f2fe 0%, #38bdf8 100%) !important;
  color: #0c4a6e !important;
}

.clay-icon-rose {
  background: linear-gradient(145deg, #ffe4e6 0%, #f43f5e 100%) !important;
  color: #881337 !important;
}

/* World-Class Mobile Form Controls Standards */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom */
  }
  .btn, .clay-btn, a.btn {
    min-height: 44px !important; /* Touch target standard for explicit CTA controls */
  }
}

/* =====================================================
   UNIFIED NAVBAR & BRIDGE BANNER RESPONSIVE POLISH
   (Fixes 320px-430px Mobile, 769px-1279px Tablet, & Desktop)
   ===================================================== */
.portal-navbar > .container.navbar-inner {
  width: 100% !important;
  max-width: 1380px !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  row-gap: 10px !important;
  column-gap: 16px !important;
}

.portal-navbar .brand-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.portal-navbar .brand-logo {
  width: 48px !important;
  height: 48px !important;
  flex-shrink: 0 !important;
}

.portal-navbar .brand-heading-wrap {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.portal-navbar .brand-title {
  font-size: clamp(1rem, 1.45vw, 1.2rem) !important;
  white-space: nowrap !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}

.portal-navbar .brand-system-full {
  font-size: 0.78rem !important;
  line-height: 1.32 !important;
  word-break: keep-all !important;
  overflow-wrap: break-word !important;
}

.portal-navbar .nav-controls-stack {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.btn-portal-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-portal-back:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.portal-navbar .btn-portal-hub {
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 11px !important;
  font-size: 0.76rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.portal-navbar .term-pill-compact {
  height: 36px !important;
  padding: 0 10px !important;
  border-radius: 11px !important;
  gap: 5px !important;
  box-sizing: border-box !important;
}

.portal-navbar .term-pill-select {
  font-size: 0.75rem !important;
  line-height: 34px !important;
  padding: 0 2px !important;
}

.portal-navbar .btn-refresh-ver {
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 11px !important;
  font-size: 0.76rem !important;
  box-sizing: border-box !important;
}

@media (max-width: 1180px) and (min-width: 769px) {
  .portal-navbar .navbar-inner {
    row-gap: 8px !important;
  }
  .portal-navbar .nav-controls-stack {
    justify-content: flex-end !important;
  }
}

@media (max-width: 768px) {
  .portal-navbar {
    position: relative !important;
    padding: 10px 0 12px !important;
  }

  .portal-navbar > .container.navbar-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .portal-navbar .brand-wrap {
    width: 100% !important;
    gap: 10px !important;
  }

  .portal-navbar .brand-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
  }

  .portal-navbar .brand-title {
    font-size: clamp(0.95rem, 4.3vw, 1.12rem) !important;
    white-space: nowrap !important;
  }

  .portal-navbar .brand-system-full {
    font-size: 0.71rem !important;
    line-height: 1.3 !important;
    margin-top: 1px !important;
  }

  .portal-navbar .nav-controls-stack {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    gap: 6px !important;
    padding-top: 8px !important;
    border-top: 1px solid #f1f5f9 !important;
  }

  .portal-navbar .btn-portal-back {
    order: 1;
    flex: 0 0 auto !important;
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 0.73rem !important;
    border-radius: 10px !important;
  }

  .portal-navbar .portal-hub-dropdown {
    order: 2;
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }

  .portal-navbar .portal-hub-dropdown .btn-portal-hub {
    width: 100% !important;
    height: 36px !important;
    justify-content: center !important;
    padding: 0 8px !important;
    font-size: 0.73rem !important;
    border-radius: 10px !important;
  }

  .portal-navbar .btn-portal-hub {
    height: 36px !important;
    justify-content: center !important;
    padding: 0 10px !important;
    font-size: 0.73rem !important;
    border-radius: 10px !important;
  }

  .portal-navbar .term-pill-compact {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    width: auto !important;
    height: 36px !important;
    justify-content: center !important;
    padding: 0 8px !important;
    border-radius: 10px !important;
  }

  .portal-navbar .term-pill-select {
    font-size: 0.73rem !important;
    line-height: 34px !important;
  }

  /* Guest without back-home (index.php / safety): balanced 2x2 grid */
  .portal-navbar .nav-controls-stack.is-guest:not(.has-back-home) .portal-hub-dropdown {
    order: 1;
    flex: 1 1 calc(50% - 4px) !important;
  }
  .portal-navbar .nav-controls-stack.is-guest:not(.has-back-home) .sso-btn-login {
    order: 2;
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 36px !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }
  .portal-navbar .nav-controls-stack.is-guest:not(.has-back-home) .term-pill-compact {
    order: 3;
    flex: 1 1 calc(50% - 4px) !important;
  }
  .portal-navbar .nav-controls-stack.is-guest:not(.has-back-home) .btn-refresh-ver {
    order: 4;
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 36px !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }

  /* Guest with back-home (homevisit): Row 1 [Back + Hub + Refresh icon], Row 2 [Login + Term] */
  .portal-navbar .nav-controls-stack.is-guest.has-back-home .portal-hub-dropdown {
    order: 2;
    flex: 1 1 calc(100% - 135px) !important;
    min-width: max-content !important;
  }
  .portal-navbar .nav-controls-stack.is-guest.has-back-home .btn-refresh-ver {
    order: 3;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }
  .portal-navbar .nav-controls-stack.is-guest.has-back-home .btn-refresh-ver span {
    display: none !important;
  }
  .portal-navbar .nav-controls-stack.is-guest.has-back-home .sso-btn-login {
    order: 4;
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 36px !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }
  .portal-navbar .nav-controls-stack.is-guest.has-back-home .term-pill-compact {
    order: 5;
    flex: 1 1 calc(50% - 4px) !important;
  }

  /* Logged-in without back-home (index.php): Row 1 [Hub + Term + Refresh icon], Row 2 [User Bar] */
  .portal-navbar .nav-controls-stack.is-logged-in:not(.has-back-home) .portal-hub-dropdown {
    order: 1;
    flex: 1 1 auto !important;
    min-width: max-content !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in:not(.has-back-home) .term-pill-compact {
    order: 2;
    flex: 1 1 auto !important;
    padding: 0 7px !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in:not(.has-back-home) .btn-refresh-ver {
    order: 3;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in:not(.has-back-home) .btn-refresh-ver span {
    display: none !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in:not(.has-back-home) .sso-user-bar {
    order: 4;
    width: 100% !important;
  }

  /* Logged-in with back-home (homevisit): Row 1 [Back + Hub], Row 2 [Term + Refresh], Row 3 [User Bar] */
  .portal-navbar .nav-controls-stack.is-logged-in.has-back-home .portal-hub-dropdown {
    order: 2;
    flex: 1 1 calc(100% - 92px) !important;
    min-width: max-content !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in.has-back-home .term-pill-compact {
    order: 3;
    flex: 1 1 calc(50% - 4px) !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in.has-back-home .btn-refresh-ver {
    order: 4;
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 36px !important;
    border-radius: 10px !important;
    justify-content: center !important;
    padding: 0 8px !important;
    font-size: 0.73rem !important;
  }
  .portal-navbar .nav-controls-stack.is-logged-in.has-back-home .sso-user-bar {
    order: 5;
    width: 100% !important;
  }
}

/* =====================================================
   HOME VISIT BRIDGE BANNER (MOBILE-FIRST STUDIO CARD)
   ===================================================== */
.homevisit-bridge-banner {
  margin-bottom: 20px;
  width: 100%;
}

.hb-banner-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #064e3b 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  border-radius: 22px;
  padding: 20px 26px;
  text-decoration: none;
  box-shadow: 0 10px 28px -6px rgba(6, 78, 59, 0.35), 0 0 18px rgba(52, 211, 153, 0.16);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hb-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -6px rgba(6, 78, 59, 0.42), 0 0 22px rgba(52, 211, 153, 0.24);
}

.hb-banner-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(52, 211, 153, 0.16) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.hb-banner-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.hb-icon-box {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  flex-shrink: 0;
}

.hb-icon-box img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.hb-badge-area {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.hb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 3px 11px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
  box-shadow: 0 0 8px #34d399;
}

.hb-badge-short {
  display: none;
}

.hb-copy-area {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.hb-title {
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 0;
  font-family: var(--font-heading);
  line-height: 1.35;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hb-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  margin: 4px 0 0;
  line-height: 1.48;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.hb-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #064e3b;
  padding: 11px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .homevisit-bridge-banner {
    margin-bottom: 16px;
  }

  .hb-banner-link {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
  }

  .hb-banner-grid {
    grid-template-columns: 48px 1fr;
    column-gap: 12px;
    row-gap: 10px;
  }

  .hb-icon-box {
    grid-column: 1;
    grid-row: 1;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .hb-icon-box img {
    width: 38px;
    height: 38px;
  }

  .hb-badge-area {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
  }

  .hb-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .hb-badge-full {
    display: none;
  }

  .hb-badge-short {
    display: inline;
  }

  .hb-copy-area {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hb-title {
    font-size: 1.05rem;
    line-height: 1.38;
    margin-top: 0;
  }

  .hb-desc {
    font-size: 0.79rem;
    line-height: 1.5;
    margin-top: 5px;
  }

  .hb-cta {
    width: 100%;
    padding: 11px 16px;
    border-radius: 13px;
    font-size: 0.88rem;
  }
}
