/* DepEd Escalante City C19 Monitoring System Styles */
/* Zero horizontal scroll guarantee across all viewports */
html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Critical utility: Ensure hidden modals and backdrops are always completely hidden */
[hidden],
.modal-backdrop.hidden,
.modal.hidden {
  display: none !important;
}

:root {
  --deped-blue: #0b3b60;
  --deped-dark-blue: #07253d;
  --deped-light-blue: #1a568c;
  --deped-gold: #f59e0b;
  --deped-gold-hover: #d97706;
  --gov-slate: #1e293b;
  --gov-bg: #f8fafc;
  --gov-border: #e2e8f0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Organization Chart Connectors */
.org-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.org-connector-vertical {
  width: 2px;
  height: 24px;
  background-color: #94a3b8;
  margin: 0 auto;
}

.org-connector-horizontal {
  position: relative;
  height: 20px;
  border-top: 2px solid #94a3b8;
  margin: 0 40px;
}

/* Print Styling */
@media print {
  .no-print, nav, #role-switcher-banner, .modal, button:not(.allow-print) {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  .print-only {
    display: block !important;
  }
  .card, .table-container {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
}

/* Subtle Card Hover Effects */
.interactive-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.interactive-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(11, 59, 96, 0.12), 0 8px 10px -6px rgba(11, 59, 96, 0.08);
}

/* Status Badges */
.badge-due {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.badge-due-soon {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-upcoming {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.badge-completed {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Table row highlight on hover */
.employee-row:hover {
  background-color: #f8fafc;
}

/* Modal animation */
.modal-backdrop {
  backdrop-filter: blur(2px);
}

/* Custom modal internal scroll styling */
.custom-modal-scroll::-webkit-scrollbar {
  width: 5px;
}
.custom-modal-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-modal-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.custom-modal-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Elegant Pastel UI Colors for Mass Update System */
.pastel-emerald {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.pastel-sky {
  background-color: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
.pastel-amber {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.pastel-rose {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.pastel-indigo {
  background-color: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

/* Diff visual badges */
.diff-badge-old {
  background-color: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 1px 5px;
  border-radius: 4px;
}
.diff-badge-new {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Pastel Purple */
.pastel-purple {
  background-color: #faf5ff;
  border-color: #e9d5ff;
  color: #6b21a8;
}

/* Separation Reason Badges */
.badge-retirement {
  background-color: #faf5ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}
.badge-transfer {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.badge-resignation {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.badge-deceased {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.badge-others {
  background-color: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

/* Position Classification Badges */
.badge-teaching {
  background-color: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.badge-non-teaching {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-related-teaching {
  background-color: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

/* Employment Status Badges */
.badge-permanent {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-casual {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-provisional {
  background-color: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.badge-contract-of-service {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

/* Sex at Birth Badges */
.badge-male {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.badge-female {
  background-color: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}
.badge-unassigned {
  background-color: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Report Tab Styles */
.report-card-kpi {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.report-card-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px rgba(11, 59, 96, 0.08);
}
.report-tab-btn {
  transition: all 0.15s ease;
}
.report-tab-btn.active {
  background-color: #0b3b60;
  color: #fde047;
  box-shadow: 0 2px 4px rgba(11, 59, 96, 0.15);
}

/* Official Header Branding & Logos */
header.masthead-header {
  background: linear-gradient(135deg, #0b3b60 0%, #0d4775 50%, #0b3b60 100%);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
}

.masthead-inner {
  max-width: 96rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1rem;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem;
  box-sizing: border-box;
}

.masthead-branding {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.masthead-brand-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-shrink: 1;
}

/* ==========================================================================
   Masthead Header Responsive Visibility (Deterministic Rules)
   ========================================================================== */

/* Base / Mobile (< 640px): Compact single-line branding to fit small screens */
.deped-subtitle {
  display: none !important;
}
.deped-title-desktop {
  display: none !important;
}
.deped-title-mobile {
  display: inline !important;
}
#masthead-personnel-brand {
  display: none !important;
}
.masthead-divider {
  display: none !important;
}
#header-school-search-input {
  display: none !important;
}

@media (max-width: 639px) {
  .masthead-inner {
    padding: 0.35rem 0.5rem !important;
    gap: 0.25rem !important;
  }
  .masthead-branding {
    flex: 0 1 auto !important;
    min-width: 0 !important;
  }
  .masthead-right {
    margin-left: auto !important;
    gap: 0.25rem !important;
  }
}

/* Tablet & Mobile Landscape (>= 640px) */
@media (min-width: 640px) {
  .deped-subtitle {
    display: block !important;
  }
  .deped-title-desktop {
    display: inline !important;
  }
  .deped-title-mobile {
    display: none !important;
  }
  #header-school-search-input {
    display: block !important;
  }
}

/* Tablet Landscape, Laptop & Desktop (>= 768px): Show Personnel Section & Divider */
@media (min-width: 768px) {
  #masthead-personnel-brand {
    display: flex !important;
    align-items: center !important;
  }
  .masthead-divider {
    display: block !important;
  }
}

.masthead-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}

.masthead-text-block h1 {
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  color: #fde047 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.masthead-text-block span {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.header-search-icon-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
}

.header-search-icon-btn:hover {
  color: #fde047 !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
}

.header-search-icon-btn:focus-visible {
  outline: 2px solid #f59e0b !important;
  outline-offset: 2px !important;
}

.header-search-icon-btn svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.masthead-divider {
  height: 2rem;
  width: 1px;
  background-color: rgba(255, 255, 255, 0.25);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.header-logo-container {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 9999px !important;
  background-color: #ffffff !important;
  border: 2px solid #f59e0b !important;
  padding: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
  box-sizing: border-box !important;
}

.header-logo-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 9999px !important;
  display: block !important;
}

/* Navigation Bar Layout & Even Distribution */
nav.portal-nav {
  background-color: #07253d;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 0.5rem;
  width: 100%;
}

nav.portal-nav .nav-container {
  max-width: 96rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.25rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

nav.portal-nav .nav-container::-webkit-scrollbar {
  height: 3px;
}

nav.portal-nav .nav-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

/* Primary links track distributed across the available space */
nav.portal-nav .nav-links-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.25rem;
}

/* Administration section pinned to the far right */
nav.portal-nav .nav-admin-section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

nav.portal-nav button {
  padding: 0.35rem 0.55rem;
  font-size: 0.775rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0.5rem;
  color: #cbd5e1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease-in-out;
}

nav.portal-nav .nav-links-track button {
  flex: 0 1 auto;
}

nav.portal-nav button:hover:not(.nav-active-tab):not([aria-current="page"]) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Clear, Noticeable Active Navigation Tab (Desktop) */
nav.portal-nav button.nav-active-tab,
nav.portal-nav button[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fde047 !important; /* DepEd Golden Amber 300 */
  font-weight: 700 !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
  border-bottom: 3px solid #f59e0b !important; /* Bold Amber 500 Active Stripe */
  border-radius: 0.5rem !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

nav.portal-nav button.nav-active-tab svg,
nav.portal-nav button[aria-current="page"] svg {
  color: #fde047 !important;
}

nav.portal-nav button[data-nav="admin"] {
  flex-shrink: 0;
  background: rgba(6, 78, 59, 0.35);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-bottom: 3px solid transparent;
  color: #6ee7b7;
}

nav.portal-nav button[data-nav="admin"]:hover:not(.nav-active-tab):not([aria-current="page"]) {
  background: rgba(6, 78, 59, 0.55);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.5);
}

nav.portal-nav button[data-nav="admin"].nav-active-tab,
nav.portal-nav button[data-nav="admin"][aria-current="page"] {
  background: rgba(6, 78, 59, 0.8) !important;
  color: #fde047 !important;
  border: 1px solid rgba(251, 191, 36, 0.6) !important;
  border-bottom: 3px solid #f59e0b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

nav.portal-nav button[data-nav="admin"].nav-active-tab svg,
nav.portal-nav button[data-nav="admin"][aria-current="page"] svg {
  color: #fde047 !important;
}

/* Mobile Collapsible Drawer Active Tab Highlighting */
#mobile-nav-drawer button {
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
}

#mobile-nav-drawer button:hover:not(.mobile-nav-active):not([aria-current="page"]) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

#mobile-nav-drawer button.mobile-nav-active,
#mobile-nav-drawer button[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fde047 !important;
  font-weight: 700 !important;
  border: 1px solid rgba(251, 191, 36, 0.5) !important;
  border-left: 4px solid #f59e0b !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

#mobile-nav-drawer button.mobile-nav-active svg:first-child,
#mobile-nav-drawer button[aria-current="page"] svg:first-child {
  color: #fde047 !important;
}

#mobile-nav-drawer button[data-mobile-nav="admin"].mobile-nav-active,
#mobile-nav-drawer button[data-mobile-nav="admin"][aria-current="page"] {
  background: rgba(6, 78, 59, 0.8) !important;
  color: #fde047 !important;
  border: 1px solid rgba(251, 191, 36, 0.6) !important;
  border-left: 4px solid #f59e0b !important;
}

@media (max-width: 1023px) {
  nav.portal-nav {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  #mobile-nav-toggle-btn,
  #mobile-nav-drawer {
    display: none !important;
  }
  nav.portal-nav {
    display: block !important;
    padding: 0 0.75rem;
  }
  nav.portal-nav button {
    font-size: 0.8125rem;
    padding: 0.38rem 0.6rem;
    gap: 0.35rem;
  }
}

@media (min-width: 1280px) {
  nav.portal-nav {
    padding: 0 1rem;
  }
  nav.portal-nav .nav-links-track {
    gap: 0.5rem;
  }
  nav.portal-nav button {
    padding: 0.4rem 0.75rem;
    font-size: 0.825rem;
    gap: 0.4rem;
  }
}

@media (min-width: 1536px) {
  nav.portal-nav .nav-links-track {
    gap: 0.75rem;
  }
  nav.portal-nav button {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    gap: 0.45rem;
  }
}

/* Default typography & box sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

body, button, input, select, textarea {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

nav.portal-nav button svg {
  width: 1rem !important;
  height: 1rem !important;
  max-width: 1rem !important;
  max-height: 1rem !important;
}

/* Defensive SVG scaling fallbacks */
svg {
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
}
svg.w-3, svg.h-3 { width: 0.75rem !important; height: 0.75rem !important; max-width: 0.75rem !important; max-height: 0.75rem !important; }
svg.w-3\.5, svg.h-3\.5 { width: 0.875rem !important; height: 0.875rem !important; max-width: 0.875rem !important; max-height: 0.875rem !important; }
svg.w-4, svg.h-4 { width: 1rem !important; height: 1rem !important; max-width: 1rem !important; max-height: 1rem !important; }
svg.w-5, svg.h-5 { width: 1.25rem !important; height: 1.25rem !important; max-width: 1.25rem !important; max-height: 1.25rem !important; }
svg.w-6, svg.h-6 { width: 1.5rem !important; height: 1.5rem !important; max-width: 1.5rem !important; max-height: 1.5rem !important; }
svg.w-7, svg.h-7 { width: 1.75rem !important; height: 1.75rem !important; max-width: 1.75rem !important; max-height: 1.75rem !important; }
svg.w-8, svg.h-8 { width: 2rem !important; height: 2rem !important; max-width: 2rem !important; max-height: 2rem !important; }
svg.w-10, svg.h-10 { width: 2.5rem !important; height: 2.5rem !important; max-width: 2.5rem !important; max-height: 2.5rem !important; }
svg.w-12, svg.h-12 { width: 3rem !important; height: 3rem !important; max-width: 3rem !important; max-height: 3rem !important; }
svg.w-14, svg.h-14 { width: 3.5rem !important; height: 3.5rem !important; max-width: 3.5rem !important; max-height: 3.5rem !important; }
svg.w-16, svg.h-16 { width: 4rem !important; height: 4rem !important; max-width: 4rem !important; max-height: 4rem !important; }
svg.w-80, svg.h-80 { width: 20rem !important; height: 20rem !important; max-width: 100% !important; }

/* Essential Utility Fallbacks for Robust Offline / Sandboxed Rendering */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-1 { flex: 1 1 0% !important; }
.flex-shrink-0, .shrink-0 { flex-shrink: 0 !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.items-baseline { align-items: baseline !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem !important; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem !important; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem !important; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }

/* Truncation & Line Clamping */
.truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.line-clamp-1 { display: -webkit-box !important; -webkit-line-clamp: 1 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.line-clamp-2 { display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.line-clamp-3 { display: -webkit-box !important; -webkit-line-clamp: 3 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }

/* Common Font & Layout Helpers */
.font-sans { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }
.font-black { font-weight: 900 !important; }
.uppercase { text-transform: uppercase !important; }
.lowercase { text-transform: lowercase !important; }
.italic { font-style: italic !important; }
.underline { text-decoration: underline !important; }
.leading-none { line-height: 1 !important; }
.leading-tight { line-height: 1.25 !important; }
.leading-snug { line-height: 1.375 !important; }
.leading-relaxed { line-height: 1.625 !important; }
.tracking-tight { letter-spacing: -0.025em !important; }
.tracking-wider { letter-spacing: 0.05em !important; }
.tracking-widest { letter-spacing: 0.1em !important; }
.cursor-pointer { cursor: pointer !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.inset-0 { inset: 0 !important; }
.overflow-hidden { overflow: hidden !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.rounded-full { border-radius: 9999px !important; }
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-w-0 { min-width: 0 !important; }
.max-w-xs { max-width: 20rem !important; }

/* Font sizes */
.text-\[9px\] { font-size: 9px !important; line-height: 12px !important; }
.text-\[10px\] { font-size: 10px !important; line-height: 14px !important; }
.text-\[11px\] { font-size: 11px !important; line-height: 15px !important; }
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }

/* Backgrounds & Text Colors */
.bg-white { background-color: #ffffff !important; }
.bg-slate-50 { background-color: #f8fafc !important; }
.bg-slate-100 { background-color: #f1f5f9 !important; }
.bg-slate-200 { background-color: #e2e8f0 !important; }
.bg-blue-100 { background-color: #dbeafe !important; }
.bg-amber-50 { background-color: #fffbeb !important; }
.bg-amber-100 { background-color: #fef3c7 !important; }
.bg-pink-50 { background-color: #fdf2f8 !important; }
.bg-pink-100 { background-color: #fce7f3 !important; }
.bg-pink-200 { background-color: #fbcfe8 !important; }
.bg-pink-600 { background-color: #db2777 !important; }
.bg-rose-500 { background-color: #f43f5e !important; }
.bg-rose-600 { background-color: #e11d48 !important; }
.bg-emerald-100 { background-color: #d1fae5 !important; }

.text-white { color: #ffffff !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-900 { color: #0f172a !important; }
.text-blue-700 { color: #1d4ed8 !important; }
.text-pink-600 { color: #db2777 !important; }
.text-pink-700 { color: #be185d !important; }
.text-pink-800 { color: #9d174d !important; }
.text-pink-900 { color: #831843 !important; }
.text-amber-700 { color: #b45309 !important; }
.text-amber-800 { color: #92400e !important; }
.text-amber-900 { color: #78350f !important; }
.text-emerald-700 { color: #047857 !important; }
.text-emerald-800 { color: #065f46 !important; }

.border { border-width: 1px !important; border-style: solid !important; }
.border-b { border-bottom-width: 1px !important; border-bottom-style: solid !important; }
.border-t { border-top-width: 1px !important; border-top-style: solid !important; }
.border-slate-100 { border-color: #f1f5f9 !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }
.border-pink-100 { border-color: #fce7f3 !important; }
.border-pink-200 { border-color: #fbcfe8 !important; }
.border-amber-200 { border-color: #fde68a !important; }

/* ========================================== */
/* HOME DASHBOARD FEATURED TRI-CARD SHOWCASE */
/* News & Updates, Vacancies & Birthday Celebrants */
/* ========================================== */
/* HOME FEATURED TRI-CARDS SHOWCASE           */
/* ========================================== */

.home-featured-cards-section {
  width: 100%;
  margin-bottom: 2rem;
  box-sizing: border-box;
}

.home-featured-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.home-secondary-cards-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .home-secondary-cards-row.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#home-card-news.home-feature-card,
#home-card-vacancies.home-feature-card {
  min-height: auto;
  padding: 1.25rem 1.5rem;
}

/* Announcement & Vacancy Cards & Responsive Grid */
.announcement-cards-grid,
.vacancy-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .announcement-cards-grid,
  .vacancy-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .announcement-cards-grid,
  .vacancy-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.announcement-card,
.vacancy-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.875rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.announcement-card:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.vacancy-card:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
  box-shadow: 0 10px 15px -3px rgba(11, 59, 96, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.card-media-wrapper {
  position: relative;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
}

/* Publication of Vacancy Multi-Format Media Engine */
.vac-media-container {
  position: relative;
  width: 100%;
  height: 180px;
  background-color: #0b1329;
  border-radius: 0.625rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
}

.vac-media-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.vac-media-container video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000000 !important;
}

/* PDF Document First-Page Canvas Preview */
.vac-pdf-page-container {
  position: relative;
  width: 100%;
  height: 180px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  text-align: left;
}

/* Control buttons inside vacancy media preview */
.vac-ctrl-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 9999px !important;
  padding: 0.25rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  width: 1.625rem !important;
  height: 1.625rem !important;
}
.vac-ctrl-btn:hover {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: scale(1.05);
}

.vac-view-doc-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  background: #0b3b60 !important;
  color: #fde047 !important;
  border: 1px solid #1e3a8a !important;
  border-radius: 0.5rem !important;
  padding: 0.25rem 0.65rem !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
  transition: all 0.15s ease !important;
}
.vac-view-doc-action-btn:hover {
  background: #07253d !important;
  color: #fef08a !important;
  transform: translateY(-1px);
}

.home-feature-card,
.home-tri-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 380px;
  max-height: none;
  width: 100%;
  min-width: 0; /* Prevents grid/flex child overflow */
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-feature-card:hover,
.home-tri-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Card Button Reset & Styling */
.home-feature-card button,
.home-tri-card button {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-align: left;
}

/* Individual list item button styling */
.home-item-btn {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.625rem !important;
  width: 100% !important;
  padding: 0.625rem 0.75rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid transparent !important;
  background-color: transparent !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  box-sizing: border-box !important;
}
.home-item-btn:hover {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
.home-item-btn.news-item:hover {
  background-color: #fefce8 !important;
  border-color: #fde68a !important;
}
.home-item-btn.vacancy-item:hover {
  background-color: #eff6ff !important;
  border-color: #bfdbfe !important;
}

.home-feature-card button[onclick*="Slide"] {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  width: 1.5rem !important;
  height: 1.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  color: #334155 !important;
}

.home-feature-card button[onclick*="setNewsSlide"],
.home-feature-card button[onclick*="setVacancySlide"],
.home-feature-card button[onclick*="setCelebrantSlide"] {
  border-radius: 9999px !important;
  padding: 0 !important;
  min-width: 0 !important;
  height: 6px !important;
  background-color: #e2e8f0 !important;
}

/* Ensure internal media and containers never overflow */
.home-feature-card img,
.home-tri-card img {
  max-width: 100%;
  height: auto;
  display: block;
}

.home-feature-card svg,
.home-tri-card svg {
  flex-shrink: 0;
}

.home-feature-card *,
.home-tri-card * {
  min-width: 0;
}

/* Birthday Celebration Visual Accents & Animation */
@keyframes floatParticle {
  0% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
  50% { transform: translateY(-8px) rotate(10deg); opacity: 1; }
  100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
}

.celebration-sparkle {
  position: absolute;
  pointer-events: none;
  animation: floatParticle 3.5s ease-in-out infinite;
}

.celebrant-avatar-ring {
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  padding: 2.5px;
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.celebrant-avatar-ring img,
.celebrant-avatar-ring .avatar-placeholder {
  border-radius: 9999px;
  border: 2px solid #ffffff;
}

.celebrant-bounce {
  animation: floatParticle 4s ease-in-out infinite;
}

/* ==========================================================================
   Party Confetti & Floating Pastel Balloon Birthday Celebration Theme
   ========================================================================== */

/* Party Container & Celebratory Outer Border */
.birthday-party-container {
  position: relative;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 45%, #fdf2f8 100%);
  border: 2px solid #fbcfe8;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(244, 63, 94, 0.08);
  transition: all 0.3s ease;
}

.birthday-party-container:hover {
  border-color: #f472b6;
  box-shadow: 0 8px 25px -4px rgba(244, 63, 94, 0.14);
}

/* Background Confetti & Balloon Layer (Positioned behind content at z-0) */
.birthday-confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Continuously Falling & Rotating Paper Confetti */
@keyframes confettiFall {
  0% {
    top: -12px;
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 0.95;
  }
  25% {
    transform: translateY(0) rotate(180deg) translateX(10px) scale(0.92);
  }
  50% {
    transform: translateY(0) rotate(360deg) translateX(-10px) scale(0.85);
  }
  75% {
    transform: translateY(0) rotate(540deg) translateX(8px) scale(0.78);
  }
  100% {
    top: 105%;
    transform: translateY(0) rotate(720deg) translateX(-6px) scale(0.7);
    opacity: 0;
  }
}

.confetti-piece {
  position: absolute;
  top: -12px;
  pointer-events: none;
  animation: confettiFall 5.5s linear infinite;
  will-change: transform, top, opacity;
}

/* Confetti Shapes & Sizes */
.confetti-rect {
  width: 8px;
  height: 14px;
  border-radius: 2px;
}

.confetti-square {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.confetti-circle {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
}

.confetti-ribbon {
  width: 6px;
  height: 16px;
  border-radius: 3px;
}

/* Confetti Colors (Vibrant festive cheerful tones) */
.confetti-c1 { background-color: #f43f5e; } /* Rose */
.confetti-c2 { background-color: #38bdf8; } /* Sky Blue */
.confetti-c3 { background-color: #facc15; } /* Amber Gold */
.confetti-c4 { background-color: #34d399; } /* Mint Green */
.confetti-c5 { background-color: #c084fc; } /* Lavender Purple */
.confetti-c6 { background-color: #fb923c; } /* Tangerine Orange */
.confetti-c7 { background-color: #f472b6; } /* Pink */
.confetti-c8 { background-color: #2dd4bf; } /* Teal */

/* Gentle Floating Pastel Balloons */
@keyframes balloonSway {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(4deg);
  }
}

.party-balloon {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.60;
  animation: balloonSway 4.8s ease-in-out infinite;
  z-index: 0;
}

.balloon-body {
  width: 24px;
  height: 30px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  position: relative;
  box-shadow: inset -3px -3px 6px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.balloon-body::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 5px;
  width: 5px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.balloon-knot {
  width: 4px;
  height: 3px;
  border-radius: 1px;
  margin-top: -1px;
}

.balloon-string {
  width: 1px;
  height: 18px;
  background: rgba(148, 163, 184, 0.5);
}

/* Balloon Colors in Soft Pastels */
.balloon-pink .balloon-body { background: #fbcfe8; border: 1px solid #f472b6; }
.balloon-pink .balloon-knot { background: #f472b6; }
.balloon-blue .balloon-body { background: #bae6fd; border: 1px solid #38bdf8; }
.balloon-blue .balloon-knot { background: #38bdf8; }
.balloon-lavender .balloon-body { background: #e9d5ff; border: 1px solid #c084fc; }
.balloon-lavender .balloon-knot { background: #c084fc; }
.balloon-mint .balloon-body { background: #bbf7d0; border: 1px solid #4ade80; }
.balloon-mint .balloon-knot { background: #4ade80; }
.balloon-yellow .balloon-body { background: #fef08a; border: 1px solid #facc15; }
.balloon-yellow .balloon-knot { background: #facc15; }

/* Foreground Content Container (z-10 ensures content is never covered) */
.birthday-content-layer {
  position: relative;
  z-index: 10;
}

/* Individual Celebrant Card Styles */
.celebrant-card-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border: 1.5px solid #fbcfe8;
  border-radius: 0.875rem;
  box-shadow: 0 2px 8px -1px rgba(244, 63, 94, 0.08);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.celebrant-card-item:hover {
  transform: translateY(-2px);
  border-color: #f472b6;
  box-shadow: 0 6px 16px -2px rgba(244, 63, 94, 0.16);
  background: #ffffff;
}

.celebrant-avatar-pastel-ring {
  background: linear-gradient(135deg, #fbcfe8, #bae6fd, #fef08a);
  padding: 2.5px;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.celebrant-avatar-pastel-ring img,
.celebrant-avatar-pastel-ring .avatar-placeholder {
  border-radius: 9999px;
  border: 2px solid #ffffff;
}

/* Responsive Adaptive Grids for Celebrants */
.celebrant-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.celebrant-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
}
@media (min-width: 640px) {
  .celebrant-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.celebrant-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
}
@media (min-width: 640px) {
  .celebrant-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.celebrant-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
  width: 100%;
}
@media (min-width: 640px) {
  .celebrant-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .celebrant-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.celebrant-grid-multi {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: 100%;
}
@media (min-width: 640px) {
  .celebrant-grid-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  .celebrant-grid-multi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .celebrant-grid-multi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Schools Top Toolbar - Single Horizontal Row Alignment */
.schools-controls-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 0.75rem !important;
  width: 100% !important;
}

.schools-filter-pills-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.375rem !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0 !important;
}

.school-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.school-filter-btn span {
  white-space: nowrap !important;
}

.schools-search-box-wrapper {
  position: relative !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  width: 220px !important;
  max-width: 240px !important;
}

@media (max-width: 640px) {
  .schools-search-box-wrapper {
    width: 160px !important;
    max-width: 180px !important;
  }
}

/* Employee Search Top Toolbar - Single Horizontal Row Alignment */
.search-controls-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 0.75rem !important;
  width: 100% !important;
  overflow: visible !important;
  position: relative !important;
}

.search-filter-controls-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0 !important;
}

.search-filter-select {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  font-size: 0.75rem !important;
  line-height: 1rem !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 0.5rem !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #f8fafc !important;
  color: #334155 !important;
  cursor: pointer !important;
}

.search-filter-select:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.search-box-wrapper {
  position: relative !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  width: auto !important;
  max-width: 320px !important;
}

.search-box-wrapper .search-input-field-container {
  position: relative !important;
  width: 190px !important;
  max-width: 220px !important;
}

#search-page-suggestions {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .search-box-wrapper .search-input-field-container {
    width: 135px !important;
    max-width: 155px !important;
  }
}

/* ========================================================
   Mobile Responsiveness, Touch Optimization & Modal Bounds
   ======================================================== */

/* Prevent horizontal viewport spillover on all touch devices */
html, body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

/* Touch inertia for horizontally scrollable tables */
.table-container,
.overflow-x-auto {
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
}

/* Mobile Navigation Drawer Animations & Touch Targets */
#mobile-nav-drawer {
  animation: mobileNavSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

@keyframes mobileNavSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#mobile-nav-drawer button {
  min-height: 44px !important;
  touch-action: manipulation;
}

/* Modal containment and responsiveness across handheld displays */
@media (max-width: 639px) {
  .modal-backdrop {
    padding: 0.5rem !important;
  }
  .modal-backdrop > div {
    width: 100% !important;
    max-width: calc(100vw - 1rem) !important;
    max-height: 92vh !important;
    margin: auto !important;
  }
}

/* Defensive chart responsiveness */
svg {
  max-width: 100%;
}

/* ========================================================
   Accessibility & Readability: Global Typography & Contrast Standards
   ======================================================== */

/* Elevate pale/low-contrast text classes on light surfaces to WCAG AA / AAA compliant tones */
main .text-slate-400:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
#main-content .text-slate-400:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
.modal-backdrop .text-slate-400,
.bg-white .text-slate-400:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
.bg-slate-50 .text-slate-400:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
table .text-slate-400 {
  color: #475569 !important; /* Slate-600: Contrast ratio 7.0:1 on white (WCAG AA > 4.5:1) */
}

main .text-slate-500:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
#main-content .text-slate-500:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
.modal-backdrop .text-slate-500,
.bg-white .text-slate-500:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
.bg-slate-50 .text-slate-500:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
table .text-slate-500 {
  color: #334155 !important; /* Slate-700: Contrast ratio 9.6:1 on white (WCAG AAA) */
}

/* Secondary text readability */
main .text-slate-600:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
#main-content .text-slate-600:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *),
.modal-backdrop .text-slate-600,
.bg-white .text-slate-600:not(.masthead-header *):not(.portal-nav *):not(#mobile-nav-drawer *):not(footer *):not(.bg-\[\#0b3b60\] *):not(.bg-slate-900 *) {
  color: #1e293b !important; /* Slate-800: Contrast ratio 13.4:1 */
}

/* Scale up micro-fonts that strain readability without breaking layout */
main .text-\[8px\],
#main-content .text-\[8px\],
.modal-backdrop .text-\[8px\] {
  font-size: 11px !important;
}

main .text-\[9px\],
#main-content .text-\[9px\],
.modal-backdrop .text-\[9px\] {
  font-size: 11.5px !important;
}

main .text-\[10px\],
#main-content .text-\[10px\],
.modal-backdrop .text-\[10px\] {
  font-size: 12px !important;
}

main .text-\[11px\],
#main-content .text-\[11px\],
.modal-backdrop .text-\[11px\] {
  font-size: 12.5px !important;
}

/* Table Header and Row Typography Standardization */
table thead th {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 0.03em;
}

table tbody td {
  font-size: 12.5px;
  color: #1e293b;
}

/* Form labels and helper text */
.modal-backdrop label,
#main-content label {
  color: #0f172a !important;
  font-weight: 600;
}

/* Protect dark surfaces - keep high-contrast light text */
.masthead-header .text-slate-400,
.portal-nav .text-slate-400,
#mobile-nav-drawer .text-slate-400,
footer.bg-slate-900 .text-slate-400,
.bg-\[\#0b3b60\] .text-slate-400,
.bg-slate-900 .text-slate-400 {
  color: #cbd5e1 !important; /* Slate-300: High contrast on dark surfaces */
}

.masthead-header .text-slate-500,
.portal-nav .text-slate-500,
#mobile-nav-drawer .text-slate-500,
footer.bg-slate-900 .text-slate-500,
.bg-\[\#0b3b60\] .text-slate-500,
.bg-slate-900 .text-slate-500 {
  color: #e2e8f0 !important; /* Slate-200: High contrast on dark surfaces */
}

footer.bg-slate-900 .text-\[11px\] {
  font-size: 12px !important;
  color: #cbd5e1 !important;
}

