/* ==========================================================================
   iOS 27 LIQUID GLASS DESIGN SYSTEM — CJP PUSH v3.0
   Premium Apple-inspired glassmorphism with spring physics, specular edges,
   animated orb ambiance, floating dock with pill indicator, and full
   high-contrast typography throughout.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --font-ios: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
    "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;

  /* Brand Palette */
  --liquid-accent:        #0071e3;
  --liquid-accent-hover:  #0077ed;
  --liquid-accent-glow:   rgba(0, 113, 227, 0.40);
  --liquid-purple:        #af52de;
  --liquid-pink:          #ff2d55;
  --liquid-cyan:          #5ac8fa;
  --liquid-amber:         #ff9500;
  --liquid-emerald:       #34c759;
  --liquid-red:           #ff3b30;

  /* Light Glass Tokens */
  --glass-bg:             rgba(255, 255, 255, 0.62);
  --glass-bg-hover:       rgba(255, 255, 255, 0.80);
  --glass-card-bg:        rgba(255, 255, 255, 0.72);
  --glass-card-bg-dense:  rgba(255, 255, 255, 0.88);
  --glass-border:         rgba(255, 255, 255, 0.68);
  --glass-border-specular:rgba(255, 255, 255, 0.92);
  --glass-border-top:     rgba(255, 255, 255, 0.95); /* specular edge */
  --glass-shadow:         0 20px 60px rgba(15, 23, 42, 0.10),
                          0 8px 20px rgba(15, 23, 42, 0.06);
  --glass-shadow-hover:   0 32px 80px rgba(15, 23, 42, 0.15),
                          0 12px 30px rgba(15, 23, 42, 0.08);
  --glass-inner-shadow:   inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
                          inset 0 -1px 2px rgba(0, 0, 0, 0.04);
  --glass-blur:           blur(32px) saturate(210%);
  --glass-blur-light:     blur(16px) saturate(180%);
  --text-main:            #0f172a;
  --text-secondary:       #334155;
  --text-muted:           #64748b;

  /* Spring Easing */
  --spring-ease:    cubic-bezier(0.32, 0.72, 0, 1);
  --spring-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-snappy:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Removed dark mode to force Light Liquid Glass everywhere */

/* ─── Base Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-ios);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Select Legibility Fix ──────────────────────────────────────────────── */
select {
  color-scheme: dark light;
}
select option {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  padding: 8px 12px;
}
select option:checked,
select option:hover {
  background-color: #2563eb !important;
  color: #ffffff !important;
}
/* Removed dark mode select styles */

/* ─── Animated Background Orbs ──────────────────────────────────────────── */
.liquid-bg-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.liquid-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.50;
  animation: orbFloat 22s ease-in-out infinite alternate;
  will-change: transform;
}

.liquid-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,113,227,0.85) 0%, rgba(99,102,241,0.5) 100%);
  top: -130px; left: -130px;
  animation-duration: 26s;
}
.liquid-orb-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(175,82,222,0.80) 0%, rgba(236,72,153,0.45) 100%);
  bottom: 3%; right: -100px;
  animation-duration: 21s;
  animation-delay: -6s;
}
.liquid-orb-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(90,200,250,0.75) 0%, rgba(20,184,166,0.45) 100%);
  top: 38%; left: 28%;
  animation-duration: 30s;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0%   { transform: translate(0,0) scale(1) rotate(0deg); }
  33%  { transform: translate(70px, 90px) scale(1.14) rotate(120deg); }
  66%  { transform: translate(-50px, 130px) scale(0.88) rotate(240deg); }
  100% { transform: translate(90px, -50px) scale(1.06) rotate(360deg); }
}

/* ─── Glass Cards ────────────────────────────────────────────────────────── */
.liquid-glass-panel,
.liquid-card,
.liquid-card-dense {
  background: var(--glass-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  /* Specular top edge — the iOS 27 "crystal rim" */
  box-shadow:
    var(--glass-shadow),
    var(--glass-inner-shadow),
    inset 0 1.5px 0 var(--glass-border-top);
  border-radius: 28px;
  transition:
    transform 0.4s var(--spring-ease),
    box-shadow 0.4s var(--spring-ease),
    border-color 0.35s var(--spring-ease),
    background 0.35s var(--spring-ease);
  position: relative;
  overflow: hidden;
  color: var(--text-main);
}

/* Glass Effect Container (grouping morphing views) */
.glass-effect-container {
  display: flex;
  gap: 20px;
  padding: 10px;
  /* Enables hardware acceleration for smooth child morphing */
  transform: translateZ(0); 
}

/* Shimmer sweep on hover */
.liquid-card::before {
  content: '';
  position: absolute;
  inset: 0;
  left: -120%;
  width: 60%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.18) 55%,
    transparent 100%
  );
  transition: left 0.7s var(--spring-snappy);
  pointer-events: none;
}
.liquid-card:hover::before { left: 130%; }

.liquid-card-interactive { cursor: pointer; }
.liquid-card-interactive:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--glass-shadow-hover), var(--glass-inner-shadow),
              inset 0 1.5px 0 var(--glass-border-top);
  border-color: var(--glass-border-specular);
}
.liquid-card-interactive:active {
  transform: translateY(-1px) scale(0.982);
}

/* Dense glass card for overlays/headers */
.liquid-card-dense {
  background: var(--glass-card-bg-dense);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.liquid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-ios);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: all 0.28s var(--spring-ease);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  color: var(--text-main);
}
.liquid-btn:active { transform: scale(0.93); }

/* Primary – Blue gradient */
.liquid-btn-primary {
  background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%);
  color: #ffffff !important;
  box-shadow: 0 8px 28px var(--liquid-accent-glow),
              inset 0 1.5px 0 rgba(255, 255, 255, 0.38);
}
.liquid-btn-primary:hover {
  background: linear-gradient(135deg, #0077ed 0%, #0062cc 100%);
  box-shadow: 0 14px 36px rgba(0, 113, 227, 0.55),
              inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  color: #ffffff !important;
}

/* Danger – Red */
.liquid-btn-danger {
  background: linear-gradient(135deg, #ff3b30 0%, #cc2a20 100%);
  color: #ffffff !important;
  box-shadow: 0 8px 28px rgba(255, 59, 48, 0.38),
              inset 0 1.5px 0 rgba(255, 255, 255, 0.35);
}
.liquid-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(255, 59, 48, 0.52);
  color: #ffffff !important;
}

/* Glass – Translucent */
.liquid-btn-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-light);
  -webkit-backdrop-filter: var(--glass-blur-light);
  border-color: var(--glass-border);
  color: var(--text-main) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06),
              var(--glass-inner-shadow),
              inset 0 1px 0 var(--glass-border-top);
}
.liquid-btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-specular);
  transform: translateY(-2px);
  color: var(--text-main) !important;
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.liquid-input {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-ios);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  outline: none;
  transition: all 0.3s var(--spring-ease);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03),
              inset 0 1px 0 rgba(255,255,255,0.85);
}
/* Removed dark mode input styles */
.liquid-input::placeholder { color: var(--text-muted); }
.liquid-input:focus {
  border-color: var(--liquid-accent);
  background: rgba(255, 255, 255, 0.80);
  box-shadow: 0 0 0 4px var(--liquid-accent-glow),
              inset 0 2px 4px rgba(0, 0, 0, 0.02);
}
/* Removed dark mode focus styles */

/* ─── Dropdown (glass panel) ─────────────────────────────────────────────── */
.liquid-dropdown-panel {
  position: absolute;
  z-index: 9999 !important;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(220%);
  -webkit-backdrop-filter: blur(40px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 22px;
  box-shadow: 0 24px 56px rgba(0,0,0,0.18),
              0 8px 16px rgba(0,0,0,0.08),
              inset 0 1.5px 0 rgba(255, 255, 255, 0.98);
  overflow: hidden;
}
/* Removed dark mode dropdown styles */

.liquid-dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main) !important;
  text-decoration: none;
  border-radius: 14px;
  margin: 2px 4px;
  width: calc(100% - 8px);
  transition: background 0.18s ease, color 0.18s ease;
}
.liquid-dropdown-item:hover {
  background: rgba(0, 113, 227, 0.10);
  color: var(--liquid-accent) !important;
}
.liquid-dropdown-item:active {
  background: rgba(0, 113, 227, 0.18);
  transform: scale(0.98);
}

/* ─── Navigation Bar ─────────────────────────────────────────────────────── */
/*
 * IMPORTANT: backdrop-filter on the nav element creates a stacking context
 * that traps dropdown panels. We use ::before to avoid this issue while
 * keeping the frosted glass look.
 */
.liquid-navbar {
  position: sticky;
  top: 0;
  z-index: 9999 !important;
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 0 15px;
  padding-top: max(env(safe-area-inset-top, 0px), 12px);
  border-radius: 0 0 2rem 2rem;
}
@supports (-webkit-touch-callout: none) {
  .liquid-navbar {
    padding-top: max(env(safe-area-inset-top, 0px), 44px);
  }
}
@media (display-mode: standalone) {
  .liquid-navbar {
    top: 0;
    margin-top: 0;
    padding-top: max(env(safe-area-inset-top, 0px), 48px);
    border-radius: 0 0 2rem 2rem;
  }
}
@media not all and (display-mode: standalone) {
  .liquid-navbar {
    top: 15px;
    border-radius: 2rem;
  }
}
.liquid-navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.1),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.98);
  border-radius: 0 0 2rem 2rem;
  z-index: -1;
  pointer-events: none;
}
@media (display-mode: standalone) {
  .liquid-navbar::before {
    border-radius: 0 0 2rem 2rem;
    border-top: none;
  }
}
@media not all and (display-mode: standalone) {
  .liquid-navbar::before {
    border-radius: 2rem;
  }
}
/* Removed dark mode navbar styles */

.liquid-nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary) !important;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 9999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.liquid-nav-link:hover {
  color: var(--liquid-accent) !important;
  background: rgba(0, 113, 227, 0.08);
}
.liquid-nav-link.active {
  color: var(--liquid-accent) !important;
  background: rgba(0, 113, 227, 0.12);
}

/* ─── Floating iOS 27 Dock ───────────────────────────────────────────────── */
.liquid-dock-wrapper {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 0; right: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 20px;
}

.liquid-dock-nav {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 400px;
  height: 72px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(40px) saturate(230%);
  -webkit-backdrop-filter: blur(40px) saturate(230%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 44px;
  /* Triple-layer shadow for depth */
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  user-select: none;
  -webkit-user-select: none;
}
/* Removed dark mode dock styles */

/* Active Pill – Sliding Indicator */
.liquid-dock-active-pill {
  position: absolute;
  top: 8px; bottom: 8px; left: 8px;
  width: calc((100% - 16px) / 3);
  background: linear-gradient(135deg,
    rgba(0, 113, 227, 0.26) 0%,
    rgba(175, 82, 222, 0.24) 100%);
  border: 1px solid rgba(0, 113, 227, 0.45);
  border-top-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 34px;
  /* Spring bounce transition */
  transition: transform 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 8px 28px rgba(0, 113, 227, 0.30),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 1;
  /* No entry animation to prevent JS conflict */
}
/* JS overrides the entrance animation to position pill at correct tab */
.liquid-dock-active-pill.pill-ready {
  animation: none;
}

.liquid-dock-item {
  position: relative; z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  /* Use brighter color for inactive items */
  color: var(--text-secondary) !important;
  text-decoration: none;
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.25s ease, transform 0.2s var(--spring-bounce);
  border-radius: 34px;
}
.liquid-dock-item:active { transform: scale(0.86); }
.liquid-dock-item.active {
  color: var(--liquid-accent) !important;
  text-shadow: 0 0 12px var(--liquid-accent-glow);
}

.liquid-dock-icon {
  width: 25px; height: 25px;
  transition: transform 0.3s var(--spring-bounce),
              filter 0.3s ease;
  stroke-width: 1.75;
}
.liquid-dock-item.active .liquid-dock-icon {
  transform: translateY(-3px) scale(1.18);
  filter: drop-shadow(0 3px 10px var(--liquid-accent-glow));
}

/* Notification Pulse Badge Base */
.liquid-badge-pulse {
  position: absolute;
  top: 8px; right: calc(50% - 20px);
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

/* Active State (Red/Pink for notifications) */
.liquid-badge-pulse-active {
  background: var(--liquid-pink);
  box-shadow: 0 0 12px var(--liquid-pink);
  animation: pulseBadgeActive 2s infinite;
}
@keyframes pulseBadgeActive {
  0%   { box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.70); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 45, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 85, 0); }
}

/* Inactive State (Green for no notifications) */
.liquid-badge-pulse-inactive {
  background: #34c759;
  box-shadow: 0 0 12px #34c759;
  /* Optional: animation can be removed or kept as a subtle pulse */
}

/* ─── SPA Progress Bar ───────────────────────────────────────────────────── */
#spa-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg,
    var(--liquid-cyan),
    var(--liquid-accent),
    var(--liquid-purple));
  z-index: 99999;
  box-shadow: 0 0 14px var(--liquid-accent);
  transition: width 0.3s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

/* ─── Page Transition ────────────────────────────────────────────────────── */
.spa-page-transition {
  animation: pageSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ─── Status Badges ──────────────────────────────────────────────────────── */
.liquid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.liquid-badge-blue   { background: rgba(0,113,227,0.15);   color: #005ec8; border-color: rgba(0,113,227,0.35); }
.liquid-badge-green  { background: rgba(52,199,89,0.15);   color: #1a9e3f; border-color: rgba(52,199,89,0.35); }
.liquid-badge-amber  { background: rgba(255,149,0,0.15);   color: #c46f00; border-color: rgba(255,149,0,0.35); }
.liquid-badge-purple { background: rgba(175,82,222,0.15);  color: #8a2de0; border-color: rgba(175,82,222,0.35); }
.liquid-badge-red    { background: rgba(255,59,48,0.15);   color: #c9271d; border-color: rgba(255,59,48,0.35); }
/* Removed dark mode badge styles */

/* ─── iOS Widget Style (admin dashboard cards) ───────────────────────────── */
.dashboard-widget {
  background: var(--glass-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner-shadow),
              inset 0 1.5px 0 var(--glass-border-top);
  border-radius: 32px;
  transition: transform 0.4s var(--spring-ease),
              box-shadow 0.4s var(--spring-ease),
              border-color 0.35s var(--spring-ease);
  position: relative;
  overflow: hidden;
  color: var(--text-main);
}
.dashboard-widget:hover {
  transform: translateY(-6px) scale(1.018);
  box-shadow: var(--glass-shadow-hover), var(--glass-inner-shadow),
              inset 0 1.5px 0 var(--glass-border-top);
  border-color: var(--glass-border-specular);
}
.dashboard-widget:active {
  transform: translateY(-2px) scale(0.982);
}
/* Widget number badge */
.widget-badge {
  position: absolute;
  top: 16px; right: 16px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--liquid-pink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 45, 85, 0.45);
  z-index: 5;
}

/* ─── iOS Interactive (touch feedback) ──────────────────────────────────── */
.ios-interactive {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--spring-bounce), opacity 0.18s ease;
}
.ios-interactive:active {
  transform: scale(0.94);
  opacity: 0.85;
}

/* Apple Action Button (gradient pill) */
.apple-action-button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  box-shadow: 0 16px 40px rgba(129, 140, 248, 0.55),
              inset 0 1.5px 0 rgba(255,255,255,0.42);
  transition: transform 0.3s var(--spring-bounce),
              box-shadow 0.3s var(--spring-ease);
}
.apple-action-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(129, 140, 248, 0.65),
              inset 0 1.5px 0 rgba(255,255,255,0.50);
}

/* ─── Text Utilities ─────────────────────────────────────────────────────── */
.glass-text-strong { color: var(--text-main) !important; }
.glass-text-secondary { color: var(--text-secondary) !important; }
.glass-text-muted { color: var(--text-muted) !important; }

/* ─── Scrollbar Styling ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.60);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .liquid-dock-nav { max-width: 360px; height: 66px; }
  .liquid-card { border-radius: 22px; }
  .dashboard-widget { border-radius: 26px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT CONTRAST OVERRIDE v3.1
   Problem: in dark mode, glass panels may render lighter than expected
   (white overlay on dark bg = grey-ish), making "dark:text-white" invisible.
   Solution: Use CSS variables that ALWAYS contrast with the background.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Dashboard page headers — must always be readable */
.dashboard-widget h2,
.dashboard-widget [class*="text-slate-9"] {
  color: var(--text-main) !important;
}

/* Admin / Coordinator / Designer standalone pages */
/* The header glass panel bg-white/70 in dark renders as light grey — force dark text */
body header h1,
body header h2,
body header h3 {
  color: var(--text-main) !important;
}

/* Section labels that use subdued accent color */
[class*="text-indigo-6"],
[class*="text-cyan-6"],
[class*="text-violet-6"] {
  /* keep the accent color but ensure it's not too light */
  opacity: 1;
}

/* Glass panels: text inside any glass card should inherit var(--text-main) */
.liquid-card h1, .liquid-card h2, .liquid-card h3,
.liquid-card-dense h1, .liquid-card-dense h2, .liquid-card-dense h3 {
  color: var(--text-main);
}

/* Form field text inside glass panels */
.liquid-card input,
.liquid-card textarea,
.liquid-card select {
  color: var(--text-main) !important;
}

/* Inline glass form fields (admin dashboard selects/inputs that use bg-transparent) */
.rounded-\[1\.6rem\] input,
.rounded-\[1\.6rem\] select,
.rounded-\[1\.6rem\] textarea {
  color: var(--text-main) !important;
}

/* Admin stat pills text */
.widget-badge { color: #fff !important; }

/* ─── Dock Pill Enhanced Glass ───────────────────────────────────────────── */
/* Give the dock pill a strong specular top edge for liquid glass feel */
.liquid-dock-active-pill {
  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(0, 113, 227, 0.22) 40%,
    rgba(175, 82, 222, 0.20) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  border-top-color: rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    0 8px 28px rgba(0, 113, 227, 0.25),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06) !important;
}
/* Removed dark mode override styles */

/* ═══════════════════════════════════════════════════════════════════════════
   ULTRA 3D GLASS BUTTON (Used on Login)
   ═══════════════════════════════════════════════════════════════════════════ */
.liquid-btn-glass-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.1) 20%, rgba(0,0,0,0.3) 100%);
  box-shadow: 0 15px 35px -5px rgba(0,0,0,0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border: none;
  outline: none;
}
.liquid-btn-glass-3d:active {
  transform: scale(0.95);
}
.liquid-btn-glass-3d-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 9999px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.65) 0%, rgba(99, 102, 241, 0.65) 100%);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  box-shadow: 
    inset 0 2px 10px rgba(255,255,255,0.7),
    inset 0 -2px 10px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  z-index: 1;
.liquid-btn-glass-3d {
  position: relative;
  display: inline-block;
  padding: 3px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 20%, rgba(0,0,0,0.1) 100%);
  box-shadow: 0 15px 35px -5px rgba(0,0,0,0.2);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: none;
  outline: none;
}
.liquid-btn-glass-3d:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 40px -5px rgba(0,113,227,0.3);
}
.liquid-btn-glass-3d:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: 0 5px 15px -5px rgba(0,113,227,0.2);
}
.liquid-btn-glass-3d-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.8) 0%, rgba(99, 102, 241, 0.8) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  box-shadow: 
    inset 0 2px 10px rgba(255,255,255,0.5),
    inset 0 -2px 10px rgba(0,0,0,0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
}
.liquid-btn-glass-3d-highlight {
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 35%;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}
.liquid-btn-glass-3d-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-ios);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMERALD 3D GLASS BUTTON (Android APK Download)
   ═══════════════════════════════════════════════════════════════════════════ */
.liquid-btn-emerald-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2.5px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 25%, rgba(0,0,0,0.15) 100%);
  box-shadow: 0 12px 30px -4px rgba(5, 150, 105, 0.45), 0 6px 14px -2px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none !important;
}
.liquid-btn-emerald-3d:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 18px 36px -4px rgba(5, 150, 105, 0.55);
}
.liquid-btn-emerald-3d:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 5px 12px -2px rgba(5, 150, 105, 0.35);
}
.liquid-btn-emerald-3d-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%);
  box-shadow: 
    inset 0 2px 8px rgba(255,255,255,0.6),
    inset 0 -3px 10px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.liquid-btn-emerald-3d-highlight {
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 40%;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}
.liquid-btn-emerald-3d-text {
  position: relative;
  z-index: 2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #ffffff !important;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Removed dark mode btn glass styles */


/* ═══════════════════════════════════════════════════════════════════════════
   APPLE INTELLIGENCE GLOW (Animated Perimeter Glow)
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes intelligence-glow {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.intelligence-glow-btn {
  position: relative;
  z-index: 1;
  background-clip: padding-box;
}

.intelligence-glow-btn::before, .intelligence-glow-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--liquid-cyan), var(--liquid-purple), var(--liquid-pink), var(--liquid-cyan));
  animation: intelligence-glow 4s linear infinite;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.intelligence-glow-btn::after {
  filter: blur(12px);
  opacity: 0.6;
}

.intelligence-glow-btn:hover::before, .intelligence-glow-btn:hover::after {
  animation-duration: 2s;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PULL TO REFRESH UI
   ═══════════════════════════════════════════════════════════════════════════ */
.pull-to-refresh-container {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

.pull-to-refresh-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--liquid-accent);
  transform: scale(0.5);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
}

.pull-to-refresh-spinner.active {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Media viewers */
.glass-fullscreen-blur {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--spring-ease);
}
.glass-fullscreen-blur.active {
  opacity: 1;
  pointer-events: auto;
}
.glass-fullscreen-blur img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.4s var(--spring-bounce);
}
.glass-fullscreen-blur.active img {
  transform: scale(1);
}
.glass-fullscreen-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.4);
}
