/* ==========================================================================
   Ale Safety/Safety SMS: Material 3, Glassmorphism & Aviation Blue Theme
   ========================================================================== */

:root {
  /* PREMIUM CORPORATE BLUE & WHITE SCHEME (DEFAULT LIGHT MODE) */
  --login-bg-start: #f0f6ff; /* Ice Blue White */
  --login-bg-end: #d6e4fd; /* Soft Blue-Gray */
  --login-card-bg: rgba(255, 255, 255, 0.85);
  --login-card-border: rgba(2, 132, 199, 0.12);
  --login-text-primary: #0f172a;
  --login-text-secondary: #475569;
  
  --md-sys-color-primary: #0077b6; /* Corporate Sky Blue */
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #e0f2fe;
  --md-sys-color-on-primary-container: #0369a1;
  --md-sys-color-surface: rgba(255, 255, 255, 0.95);
  --md-sys-color-on-surface: #0f172a;
  --md-sys-color-surface-variant: #f1f5f9;
  --md-sys-color-on-surface-variant: #475569;
  --md-sys-color-outline: #cbd5e1;
  --md-sys-color-outline-variant: #e2e8f0;
  --md-sys-color-background: #f8fafc;
  --md-sys-color-on-background: #0f172a;
  --md-sys-color-error: #dc2626;
  
  /* RISK ASSESSMENT MATRIX COLORS */
  --risk-low: #10b981; /* Green */
  --risk-medium: #eab308; /* Amber / Yellow */
  --risk-high: #ef4444; /* Red */
}

/* Dark Theme Overrides */
body.dark-theme, .dark-theme {
  --login-bg-start: #051630; /* Dark Sky Navy */
  --login-bg-end: #000c1e; /* Midnight Abyss */
  --login-card-bg: rgba(15, 23, 42, 0.6);
  --login-card-border: rgba(255, 255, 255, 0.08);
  --login-text-primary: #f1f5f9;
  --login-text-secondary: #94a3b8;
  
  --md-sys-color-primary: #0284c7; /* Aviation Royal Blue */
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #0f172a; /* Sleek Dark Container */
  --md-sys-color-on-primary-container: #38bdf8; /* Soft Electric Blue */
  --md-sys-color-surface: rgba(15, 23, 42, 0.85);
  --md-sys-color-on-surface: #f1f5f9;
  --md-sys-color-surface-variant: #1e293b;
  --md-sys-color-on-surface-variant: #94a3b8;
  --md-sys-color-outline: #334155;
  --md-sys-color-outline-variant: #1e293b;
  --md-sys-color-background: #020617;
  --md-sys-color-on-background: #f8fafc;
  --md-sys-color-error: #f43f5e; /* Rose Error */
}

body.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--login-bg-start) 0%, var(--login-bg-end) 100%);
  position: relative;
  overflow-x: hidden;
}

/* Premium Background Floating Circle */
body.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, transparent 60%);
  animation: bg-pulse 25s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 0;
}

@keyframes bg-pulse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8%, 8%) scale(1.08); }
}

/* Login Card and Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: var(--md-spacing-lg);
  transition: max-width 0.6s var(--md-transition-easing-standard);
}

.login-container.menu-expanded {
  max-width: 1140px;
}

.login-card {
  background: var(--login-card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--login-card-border);
  border-radius: 32px;
  padding: var(--md-spacing-xl) var(--md-spacing-lg);
  box-shadow: 0px 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform, box-shadow;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--md-transition-easing-standard),
              box-shadow 0.4s var(--md-transition-easing-standard),
              padding 0.6s var(--md-transition-easing-standard),
              align-items 0.6s var(--md-transition-easing-standard);
}

.login-card.menu-card-expanded {
  padding: var(--md-spacing-lg) var(--md-spacing-xl);
  align-items: stretch;
  text-align: left;
}

.login-card.antigravity-active {
  transition: transform 80ms linear, box-shadow 80ms linear;
  transform: translate3d(var(--gravity-offset-x), var(--gravity-offset-y), 25px)
             rotateX(var(--gravity-rotate-x))
             rotateY(var(--gravity-rotate-y))
             scale(var(--gravity-scale));
  box-shadow: 0px calc(25px + var(--gravity-offset-y)) var(--gravity-shadow-blur) 8px rgba(0, 0, 0, 0.35);
}

/* Identity & Brand - Refined with Splash Connection (v4.9.6) */
.login-brand {
  margin-bottom: var(--md-spacing-lg);
  opacity: 0;
  transform: translateY(15px);
  animation: revealLoginBrand 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 1.65s; /* Se sincroniza con el desvanecimiento del Splash Screen */
}

@keyframes revealLoginBrand {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-card-mini {
  background-color: #ffffff; /* Mantiene la nitidez para mix-blend-mode multiply */
  border-radius: 1.5rem; /* Curva de estilo iOS matching splash screen */
  padding: 1rem 1.75rem;
  box-shadow: 0px 8px 25px rgba(0, 42, 84, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateZ(0);
  margin: 0 auto var(--md-spacing-md) auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.logo-card-mini:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0px 12px 30px rgba(0, 42, 84, 0.08);
}

.logo-image-mini {
  width: 170px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.login-title {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--login-text-primary);
  margin-bottom: var(--md-spacing-xs);
  text-align: center;
}

.login-title strong {
  font-weight: 600;
  color: var(--md-sys-color-primary); /* Se acopla dinámicamente al tono azul del tema activo */
}

.login-subtitle {
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--login-text-secondary);
  text-align: center;
}

/* Google Sign-In elements */
.oauth-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: var(--md-spacing-lg);
  min-height: 48px;
}

.login-loader {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 3px solid var(--md-sys-color-primary);
  width: 28px;
  height: 28px;
  animation: spin 1s linear infinite;
  display: none;
  margin: 0 auto var(--md-spacing-md) auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Navigation Drawer overlay & panel */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 10, 30, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--md-transition-easing-standard);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.navigation-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: rgba(10, 25, 47, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 24px 24px 0;
  box-shadow: 10px 0px 40px rgba(0, 0, 0, 0.4);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1.0);
  display: flex;
  flex-direction: column;
  padding: var(--md-spacing-lg);
}

body:not(.dark-theme) .navigation-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(2, 132, 199, 0.1);
  box-shadow: 10px 0px 30px rgba(2, 132, 199, 0.08);
}
@media (prefers-color-scheme: light) {
  .navigation-drawer {
    background: rgba(255, 255, 255, 0.98);
    border-right: 1px solid rgba(2, 132, 199, 0.1);
    box-shadow: 10px 0px 30px rgba(2, 132, 199, 0.08);
  }
}

.navigation-drawer.open {
  transform: translateX(0);
}

.navigation-drawer .drawer-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--md-spacing-md);
  margin-bottom: var(--md-spacing-lg);
}

body:not(.dark-theme) .navigation-drawer .drawer-header {
  border-bottom: 1px solid rgba(2, 132, 199, 0.1);
}
@media (prefers-color-scheme: light) {
  .navigation-drawer .drawer-header {
    border-bottom: 1px solid rgba(2, 132, 199, 0.1);
  }
}

.navigation-drawer .drawer-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-sm);
}

.navigation-drawer .drawer-subtitle {
  font-size: 13.5px;
  color: var(--login-text-secondary);
  margin-top: 2px;
}

.navigation-drawer .drawer-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-sm);
  flex-grow: 1;
}

.navigation-drawer .drawer-item {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-md);
  padding: 14px 20px;
  border-radius: 100px;
  cursor: pointer;
  color: var(--login-text-secondary);
  font-weight: 500;
  font-size: 15px;
  transition: all 0.25s var(--md-transition-easing-standard);
}

.navigation-drawer .drawer-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--login-text-primary);
}

body:not(.dark-theme) .navigation-drawer .drawer-item:hover {
  background-color: rgba(2, 132, 199, 0.05);
  color: var(--md-sys-color-primary);
}
@media (prefers-color-scheme: light) {
  .navigation-drawer .drawer-item:hover {
    background-color: rgba(2, 132, 199, 0.05);
    color: var(--md-sys-color-primary);
  }
}

.navigation-drawer .drawer-item.active {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: 0px 4px 12px rgba(2, 132, 199, 0.15);
}

body:not(.dark-theme) .navigation-drawer .drawer-item.active {
  background-color: var(--md-sys-color-primary);
  color: #ffffff;
}
@media (prefers-color-scheme: light) {
  .navigation-drawer .drawer-item.active {
    background-color: var(--md-sys-color-primary);
    color: #ffffff;
  }
}

.drawer-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--md-spacing-md);
}

body:not(.dark-theme) .drawer-footer {
  border-top: 1px solid rgba(2, 132, 199, 0.1);
}
@media (prefers-color-scheme: light) {
  .drawer-footer {
    border-top: 1px solid rgba(2, 132, 199, 0.1);
  }
}

.btn-signout-drawer {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--login-text-secondary);
  padding: 12px 20px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-spacing-sm);
  transition: all 0.2s;
}

.btn-signout-drawer:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-error);
}

/* Top App Bar Layout */
.top-app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  padding-bottom: var(--md-spacing-md);
  margin-bottom: var(--md-spacing-lg);
  width: 100%;
}

@media (prefers-color-scheme: light) {
  .top-app-bar {
    border-bottom: none;
  }
}

.app-bar-avatar-text {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #8c7355; /* Warm premium taupe/brown matching screenshot */
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0px 4px 10px rgba(140, 115, 85, 0.25);
  flex-shrink: 0;
  user-select: none;
  text-transform: uppercase;
}

.menu-hamburger-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
}

.menu-hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: light) {
  .menu-hamburger-btn:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

.menu-hamburger-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--login-text-primary);
}

.app-bar-title-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin-left: var(--md-spacing-md);
}

.app-bar-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--login-text-primary);
}

.app-bar-tenant-tag {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.app-bar-user-profile {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-md);
}

.app-bar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--md-sys-color-primary);
  box-shadow: 0px 4px 10px rgba(2, 132, 199, 0.2);
}

.user-role-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body:not(.dark-theme) .user-role-badge {
  background: #e0f2fe !important; /* Premium sky-blue container */
  color: #0284c7 !important;      /* Deep royal sky-blue text */
  font-weight: 700 !important;
}
@media (prefers-color-scheme: light) {
  .user-role-badge {
    background: #e0f2fe !important; /* Premium sky-blue container */
    color: #0284c7 !important;      /* Deep royal sky-blue text */
    font-weight: 700 !important;
  }
}

/* SPA Central Content Area */
.main-content-view {
  width: 100%;
  animation: view-fade-in 0.4s var(--md-transition-easing-standard) forwards;
}

@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   DASHBOARD VIEW STYLING
   ========================================================================== */

/* Metrics Stats */
.dashboard-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--md-spacing-md);
  margin-bottom: var(--md-spacing-lg);
  width: 100%;
}

.dashboard-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: var(--md-spacing-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  transition: border-color 0.3s, background 0.3s;
}

@media (prefers-color-scheme: light) {
  .dashboard-stat-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(2, 132, 199, 0.1);
  }
}

.dashboard-stat-card:hover {
  border-color: rgba(2, 132, 199, 0.2);
  background: rgba(2, 132, 199, 0.02);
}

.stat-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--login-text-secondary);
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--login-text-primary);
  margin-top: 4px;
}

.stat-card-trend {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--risk-high); }
.trend-down { color: var(--risk-low); }

/* Dashboard layout grid for content blocks (Left: Matrix / Right: Alerts) */
.dashboard-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--md-spacing-lg);
  width: 100%;
}

@media (min-width: 900px) {
  .dashboard-layout-grid {
    grid-template-columns: 3fr 2fr;
  }
}

.dashboard-panel-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: var(--md-spacing-lg);
}

@media (prefers-color-scheme: light) {
  .dashboard-panel-card {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(2, 132, 199, 0.1);
  }
}

.panel-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--login-text-primary);
  margin-bottom: var(--md-spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Safety Risk Assessment Matrix 5x5 */
.matrix-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.matrix-grid-wrapper {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: 1fr 30px;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-top: var(--md-spacing-sm);
}

/* Y Axis Label (Likelihood) */
.matrix-y-axis {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--login-text-secondary);
}

.matrix-y-axis span {
  transform: rotate(-90deg);
  white-space: nowrap;
}

/* X Axis Label (Severity) */
.matrix-x-axis {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--login-text-secondary);
  padding-left: 10px;
}

/* The actual 5x5 grid */
.matrix-5x5 {
  grid-row: 1;
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px;
}

.matrix-cell {
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.matrix-cell:hover {
  transform: scale(1.06);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Score cell colors */
.cell-low {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.cell-medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.cell-high {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Active report counter indicator inside matrix cells */
.cell-dot-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ffffff;
  color: #020617;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: light) {
  .cell-dot-counter {
    background: #000;
    color: #ffffff;
  }
}

/* OACI Table Matrix Styles (v4.9.2) */
.oaci-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.01);
  box-shadow: var(--md-elevation-1);
}

body:not(.dark-theme) .oaci-table-wrapper {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
}

.oaci-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Outfit', sans-serif;
  min-width: 650px;
}

.oaci-title-cell {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 15px;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark-theme) .oaci-title-cell {
  background: rgba(0, 0, 0, 0.02);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.oaci-main-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
}

.oaci-sub-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--login-text-secondary);
  margin-top: 2px;
}

.oaci-matrix-table th, .oaci-matrix-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 8px;
  vertical-align: middle;
}

body:not(.dark-theme) .oaci-matrix-table th, 
body:not(.dark-theme) .oaci-matrix-table td {
  border-color: rgba(0, 0, 0, 0.08);
}

.oaci-header-valor {
  width: 50px;
  font-weight: 700;
  color: var(--login-text-primary);
  background: rgba(255, 255, 255, 0.02);
}

body:not(.dark-theme) .oaci-header-valor {
  background: rgba(0, 0, 0, 0.01);
}

.oaci-valor-cell {
  font-weight: 800;
  font-size: 14px;
  color: var(--login-text-primary);
  background: rgba(255, 255, 255, 0.02);
}

body:not(.dark-theme) .oaci-valor-cell {
  background: rgba(0, 0, 0, 0.01);
}

.oaci-header-gravedad {
  width: 110px;
  font-weight: 700;
  color: var(--login-text-primary);
  background: rgba(255, 255, 255, 0.02);
}

body:not(.dark-theme) .oaci-header-gravedad {
  background: rgba(0, 0, 0, 0.01);
}

.oaci-gravedad-cell {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--login-text-secondary);
  text-align: left !important;
  padding-left: 12px !important;
  background: rgba(255, 255, 255, 0.01);
}

body:not(.dark-theme) .oaci-gravedad-cell {
  background: rgba(0, 0, 0, 0.005);
}

.oaci-header-prob {
  font-weight: normal;
  padding: 10px 6px !important;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.02);
}

body:not(.dark-theme) .oaci-header-prob {
  background: rgba(0, 0, 0, 0.01);
}

.prob-title {
  font-weight: 700;
  font-size: 11px;
  color: var(--login-text-primary);
  line-height: 1.2;
}

.prob-desc {
  font-size: 10px;
  color: var(--login-text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.prob-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin-top: 4px;
}

.oaci-matrix-cell {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  padding: 14px 6px !important;
}

.oaci-matrix-cell:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  z-index: 5;
  filter: brightness(1.15);
}

body:not(.dark-theme) .oaci-matrix-cell:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.oaci-cell-counter {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ffffff;
  color: #020617;
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  line-height: 1;
}

body:not(.dark-theme) .oaci-cell-counter {
  background: #000000;
  color: #ffffff;
}

/* Recent Alerts List */
.recent-alerts-list {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-sm);
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-alert-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px var(--md-spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--md-spacing-md);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.recent-alert-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

body:not(.dark-theme) .recent-alert-item {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(2, 132, 199, 0.08);
}

body:not(.dark-theme) .recent-alert-item:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(2, 132, 199, 0.18) !important;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
}

/* Clases para insignias de riesgo (v4.9.2) */
.risk-pill-neutral {
  background: rgba(255, 255, 255, 0.03);
  color: var(--login-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark-theme) .risk-pill-neutral {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.risk-pill-low {
  background: rgba(16, 185, 129, 0.08);
  color: var(--risk-low) !important;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

body:not(.dark-theme) .risk-pill-low {
  background: rgba(16, 185, 129, 0.1);
}

.risk-pill-medium {
  background: rgba(245, 158, 11, 0.08);
  color: var(--risk-medium) !important;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

body:not(.dark-theme) .risk-pill-medium {
  background: rgba(245, 158, 11, 0.1);
}

.risk-pill-high {
  background: rgba(239, 68, 68, 0.08);
  color: var(--risk-high) !important;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

body:not(.dark-theme) .risk-pill-high {
  background: rgba(239, 68, 68, 0.1);
}

.alert-item-info {
  display: flex;
  flex-direction: column;
}

.alert-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--login-text-primary);
}

.alert-item-meta {
  font-size: 11.5px;
  color: var(--login-text-secondary);
  margin-top: 2px;
}

/* Category severity colors */
.alert-badge-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
}

.badge-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--risk-low);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--risk-medium);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--risk-high);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Status Badge Pills for 4-Stage Flow */
.status-badge-abierto {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.status-badge-ongoing {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.status-badge-review {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.status-badge-cerrado {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #3b82f6 !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}



/* ==========================================================================
   REPORTS VIEW STYLING
   ========================================================================== */
.reports-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--md-spacing-lg);
  width: 100%;
}

@media (min-width: 900px) {
  .reports-layout-grid {
    grid-template-columns: 4fr 5fr;
  }
}

/* Forms layout M3 style */
.m3-form {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-xs);
}

.form-group label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--login-text-primary);
}

.m3-input, .m3-select, .m3-textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--login-text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.3s, background-color 0.3s;
}

@media (prefers-color-scheme: light) {
  .m3-input, .m3-select, .m3-textarea {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(2, 132, 199, 0.15);
  }
}

.m3-input:focus, .m3-select:focus, .m3-textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  background-color: rgba(2, 132, 199, 0.02);
}

.btn-m3-primary {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s, background-color 0.2s;
  box-shadow: 0px 4px 15px rgba(2, 132, 199, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--md-spacing-sm);
  margin-top: var(--md-spacing-sm);
}

.btn-m3-primary:hover {
  background-color: #0274b3;
  box-shadow: 0px 6px 20px rgba(2, 132, 199, 0.35);
}

/* Interactive Tabs for Reports list filtering */
.reports-tabs {
  display: flex;
  gap: var(--md-spacing-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: var(--md-spacing-md);
}

@media (prefers-color-scheme: light) {
  .reports-tabs {
    border-bottom-color: rgba(2, 132, 199, 0.12);
  }
}

.reports-tab-btn {
  background: transparent;
  border: none;
  color: var(--login-text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.reports-tab-btn:hover {
  color: var(--login-text-primary);
  background: rgba(255, 255, 255, 0.04);
}

@media (prefers-color-scheme: light) {
  .reports-tab-btn:hover {
    background: rgba(0, 0, 0, 0.03);
  }
}

.reports-tab-btn.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* Reports List view */
.reports-scroll-container {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-md);
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

.report-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: var(--md-spacing-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-sm);
  transition: all 0.3s var(--md-transition-easing-standard);
  position: relative;
}

@media (prefers-color-scheme: light) {
  .report-item-card {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(2, 132, 199, 0.08);
  }
}

.report-item-card:hover {
  border-color: rgba(2, 132, 199, 0.25);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

@media (prefers-color-scheme: light) {
  .report-item-card:hover {
    background: rgba(255, 255, 255, 0.8);
  }
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--md-spacing-md);
}

.report-card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--login-text-primary);
}

.report-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--login-text-secondary);
}

.report-card-excerpt {
  font-size: 13px;
  color: var(--login-text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.report-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: var(--md-spacing-xs);
  margin-top: var(--md-spacing-xs);
}

.report-card-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Scrim (Fondo translúcido) */
.details-drawer-scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 8, 25, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.2, 0, 0, 1);
}

.details-drawer-scrim.active {
  opacity: 1;
  pointer-events: auto;
}

/* Modal flotante translúcido */
.report-details-drawer {
  background: rgba(15, 23, 42, 0.65); /* Transparencia M3 Dark */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0px 24px 60px rgba(0, 0, 0, 0.4);
  position: fixed;
  top: 50%;
  left: 50%;
  width: 680px;
  height: 80vh;
  max-width: 95vw;
  max-height: 85vh;
  margin: 0;
  z-index: 1001;
  padding: var(--md-spacing-xl);
  border-radius: 32px; /* Amplia geometría M3 */
  display: flex;
  flex-direction: column;
  outline: none;
  
  /* Valores iniciales del Container Transform (Modificados dinámicamente por JS) */
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--transform-start-x, 0px)), calc(-50% + var(--transform-start-y, 20px))) 
             scale(var(--transform-start-scale-x, 0.92), var(--transform-start-scale-y, 0.92));
             
  /* Transición Cinemática Emphasized Decelerate */
  transition: transform 450ms cubic-bezier(0.2, 0, 0, 1), 
              opacity 400ms cubic-bezier(0.2, 0, 0, 1),
              background-color 300ms ease,
              border-color 300ms ease;
  will-change: transform, opacity;
}

body:not(.dark-theme) .report-details-drawer {
  background: rgba(255, 255, 255, 0.7); /* Transparencia M3 Light */
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0px 24px 60px rgba(0, 42, 84, 0.08);
}

.report-details-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Animación Staggered Fade-in en cascada para contenido interno */
.stagger-item {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 450ms cubic-bezier(0.2, 0, 0, 1), 
              transform 450ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform, opacity;
}

.report-details-drawer.open .stagger-item {
  opacity: 1;
  transform: translateY(0);
}

.report-details-drawer.open .stagger-item:nth-child(1) { transition-delay: 60ms; }
.report-details-drawer.open .stagger-item:nth-child(2) { transition-delay: 120ms; }
.report-details-drawer.open .stagger-item:nth-child(3) { transition-delay: 180ms; }
.report-details-drawer.open .stagger-item:nth-child(4) { transition-delay: 240ms; }

.report-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--md-spacing-md);
  margin-bottom: var(--md-spacing-md);
}

body:not(.dark-theme) .report-details-header {
  border-bottom-color: rgba(2, 132, 199, 0.12);
}


.btn-close-details {
  background: transparent;
  border: none;
  color: var(--login-text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.report-details-scrollable {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-md);
  padding-right: 4px;
}

/* Risk calculation console block inside details */
.risk-eval-console {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 16px;
  padding: var(--md-spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-sm);
  margin-top: var(--md-spacing-sm);
}

body:not(.dark-theme) .risk-eval-console {
  background: #f0f7ff;
  border-color: rgba(2, 132, 199, 0.3);
}


.eval-score-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
}

/* ==========================================================================
   ADMINISTRATION VIEW STYLING
   ========================================================================== */

/* User grid tables */
.m3-table-container {
  overflow-x: auto;
  width: 100%;
  margin-top: var(--md-spacing-md);
}

.m3-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.m3-table th {
  padding: 12px 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--login-text-secondary);
}

@media (prefers-color-scheme: light) {
  .m3-table th {
    border-bottom-color: rgba(2, 132, 199, 0.15);
  }
}

.m3-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13.5px;
  color: var(--login-text-primary);
  vertical-align: middle;
}

@media (prefers-color-scheme: light) {
  .m3-table td {
    border-bottom-color: rgba(2, 132, 199, 0.06);
  }
}

.m3-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

@media (prefers-color-scheme: light) {
  .m3-table tr:hover {
    background: rgba(2, 132, 199, 0.02);
  }
}

/* Interactive select tag in table for role selection */
.table-select-role {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--login-text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

@media (prefers-color-scheme: light) {
  .table-select-role {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.2);
  }
}

.table-select-role:focus {
  border-color: var(--md-sys-color-primary);
  outline: none;
}

/* Tenant details grid cards */
.tenant-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--md-spacing-md);
  margin-bottom: var(--md-spacing-lg);
  width: 100%;
}

.tenant-metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: var(--md-spacing-md);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-md);
}

@media (prefers-color-scheme: light) {
  .tenant-metric-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(2, 132, 199, 0.1);
  }
}

.tenant-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.15);
  color: var(--md-sys-color-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
}

.tenant-card-details {
  display: flex;
  flex-direction: column;
}

.tenant-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--login-text-primary);
}

.tenant-card-stats {
  font-size: 12.5px;
  color: var(--login-text-secondary);
  margin-top: 2px;
}

/* Role Simulator Switch Box inside Profile Box */
.role-simulator-bar {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: var(--md-spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--md-spacing-md);
}

.role-simulator-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-sys-color-on-primary-container);
  letter-spacing: 0.5px;
}

.role-simulator-select {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

body:not(.dark-theme) .role-simulator-bar {
  background: rgba(2, 132, 199, 0.06);
  border-color: rgba(2, 132, 199, 0.15);
}
@media (prefers-color-scheme: light) {
  .role-simulator-bar {
    background: rgba(2, 132, 199, 0.06);
    border-color: rgba(2, 132, 199, 0.15);
  }
}

body:not(.dark-theme) .role-simulator-select {
  background: #6b829e; /* Slate/steel blue matching screenshot */
  color: #ffffff;      /* Clean white text */
  border: 1px solid rgba(2, 132, 199, 0.1);
}
@media (prefers-color-scheme: light) {
  .role-simulator-select {
    background: #6b829e; /* Slate/steel blue matching screenshot */
    color: #ffffff;      /* Clean white text */
    border: 1px solid rgba(2, 132, 199, 0.1);
  }
}

/* FLOATING THEME SWITCHER BUTTON */
.theme-toggle-floating-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--login-card-bg);
  border: 1px solid var(--login-card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 19px;
  user-select: none;
}
.theme-toggle-floating-btn:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: var(--md-sys-color-primary);
}

/* PREMIUM GRAVITY GUIDE MODAL STRUCTURE */
.gravity-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 8, 25, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gravity-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.gravity-modal-card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--login-card-border);
  border-radius: 28px;
  width: 95%;
  max-width: 1040px;
  max-height: 88vh;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  animation: modal-scale-slide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes modal-scale-slide {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.gravity-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.05) 0%, transparent 100%);
}
.gravity-modal-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gravity-modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--login-text-secondary);
  font-size: 22px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gravity-modal-close-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--md-sys-color-error);
  border-color: rgba(220, 38, 38, 0.2);
}
.gravity-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

/* OACI GRAVITY CLASSIFICATION GUIDE TABLE */
.gravity-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--login-text-primary);
  background: rgba(255, 255, 255, 0.01);
}
.gravity-guide-table th {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  padding: 14px 10px;
  text-align: left;
  border: 1px solid var(--md-sys-color-outline-variant);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gravity-guide-table td {
  padding: 12px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  line-height: 1.45;
  vertical-align: top;
}
.gravity-guide-table tr:hover {
  background: rgba(2, 132, 199, 0.02);
}
.gravity-guide-table .code-cell {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  background: rgba(2, 132, 199, 0.03);
  color: var(--md-sys-color-primary);
  width: 60px;
}
.gravity-guide-table .label-cell {
  font-weight: 700;
  vertical-align: middle;
  width: 110px;
}
.gravity-guide-table .label-catastrophic { color: #ef4444; border-left: 4px solid #ef4444 !important; }
.gravity-guide-table .label-hazardous { color: #f97316; border-left: 4px solid #f97316 !important; }
.gravity-guide-table .label-major { color: #eab308; border-left: 4px solid #eab308 !important; }
.gravity-guide-table .label-minor { color: #3b82f6; border-left: 4px solid #3b82f6 !important; }
.gravity-guide-table .label-negligible { color: #10b981; border-left: 4px solid #10b981 !important; }

/* DYNAMIC FORM BUILDER PANEL */
.form-builder-box {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-md);
  margin-top: var(--md-spacing-md);
}
.fb-category-selector-bar {
  display: flex;
  align-items: center;
  gap: var(--md-spacing-md);
  padding: 16px;
  background: rgba(2, 132, 199, 0.05);
  border: 1px solid var(--login-card-border);
  border-radius: 16px;
}
.fb-workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--md-spacing-lg);
  margin-top: var(--md-spacing-sm);
}
@media (min-width: 900px) {
  .fb-workspace-grid {
    grid-template-columns: 5fr 4fr;
  }
}
.fb-questions-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-sm);
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.fb-question-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.25s ease;
}
.fb-question-card:hover {
  border-color: var(--md-sys-color-primary);
  background: rgba(2, 132, 199, 0.02);
  transform: translateX(2px);
}
.fb-question-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.fb-question-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--login-text-primary);
}
.fb-question-meta {
  font-size: 12px;
  color: var(--login-text-secondary);
}
.fb-required-tag {
  color: var(--md-sys-color-error);
  font-weight: 700;
  margin-left: 2px;
}
.fb-creator-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fb-creator-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* DYNAMIC INJECTED FORM CONTAINER */
.dynamic-fields-wrapper {
  background: rgba(2, 132, 199, 0.03);
  border: 1px solid var(--login-card-border);
  border-radius: 16px;
  padding: 16px;
  margin: var(--md-spacing-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-md);
}
.dynamic-fields-header {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: -4px;
  border-bottom: 1px solid var(--login-card-border);
  padding-bottom: 6px;
}
.guide-btn-inline {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--md-sys-color-primary);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  transition: all 0.2s;
}
.guide-btn-inline:hover {
  background: var(--md-sys-color-primary);
  color: #ffffff;
  border-color: var(--md-sys-color-primary);
}

/* Fallback Login Styles */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: var(--md-spacing-md) 0;
  width: 100%;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
body.dark-theme .login-divider::before,
body.dark-theme .login-divider::after {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body:not(.dark-theme) .login-divider::before,
body:not(.dark-theme) .login-divider::after {
  border-bottom: 1px solid rgba(2, 132, 199, 0.15);
}
.login-divider span {
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--login-text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fallback-login-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.btn-fallback-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--md-sys-color-primary);
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--md-transition-easing-standard);
  display: flex;
  align-items: center;
  gap: 8px;
}
body:not(.dark-theme) .btn-fallback-toggle {
  border-color: rgba(2, 132, 199, 0.25);
}
.btn-fallback-toggle:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-1px);
}
.fallback-form-fields {
  animation: slide-down-fade 0.35s var(--md-transition-easing-standard) forwards;
  width: 100%;
}
@keyframes slide-down-fade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Category Selection Grid - Module 2 (Informe SMS) Premium Styles
   ========================================================================== */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--login-card-border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body:not(.dark-theme) .category-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(2, 132, 199, 0.12);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.03);
}

/* Border gradient overlay on hover */
.category-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all 0.3s ease;
  opacity: 0;
}

.category-card-icon {
  font-size: 26px;
  background: rgba(255, 255, 255, 0.04);
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.dark-theme) .category-card-icon {
  background: rgba(2, 132, 199, 0.04);
  border-color: rgba(2, 132, 199, 0.1);
}

.category-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  min-width: 0;
}

.category-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--login-text-primary);
  transition: color 0.3s ease;
}

.category-card-desc {
  font-size: 12px;
  color: var(--login-text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.category-card-arrow {
  font-size: 18px;
  color: var(--login-text-secondary);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0.5;
}

/* GENERAL HOVER EFFECTS */
.category-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}

body:not(.dark-theme) .category-card:hover {
  background: #ffffff;
  border-color: transparent;
}

.category-card:hover::after {
  opacity: 1;
}

.category-card:hover .category-card-arrow {
  transform: translateX(4px);
  opacity: 1;
}

.category-card:hover .category-card-icon {
  transform: scale(1.1) rotate(4deg);
}

/* Clicks Feedback */
.category-card:active {
  transform: translateY(-1px) scale(0.98);
}

/* CATEGORY-SPECIFIC PALETTES & NEON GLOWS */

/* 1. Flight Ops (Sky Blue) */
.item-flight-ops:hover {
  box-shadow: 0 12px 24px rgba(2, 132, 199, 0.18);
}
.item-flight-ops:hover .category-card-icon {
  background: rgba(2, 132, 199, 0.12);
  color: #38bdf8;
  border-color: rgba(2, 132, 199, 0.3);
}
.item-flight-ops:hover .category-card-title {
  color: #38bdf8;
}
body:not(.dark-theme) .item-flight-ops:hover .category-card-title {
  color: #0284c7;
}
.item-flight-ops:hover .category-card-arrow {
  color: #38bdf8;
}
body:not(.dark-theme) .item-flight-ops:hover .category-card-arrow {
  color: #0284c7;
}
.item-flight-ops:hover::after {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.4), transparent);
}

/* 2. Maintenance (Amber) */
.item-maintenance:hover {
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.18);
}
.item-maintenance:hover .category-card-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}
.item-maintenance:hover .category-card-title {
  color: #fbbf24;
}
body:not(.dark-theme) .item-maintenance:hover .category-card-title {
  color: #d97706;
}
.item-maintenance:hover .category-card-arrow {
  color: #fbbf24;
}
body:not(.dark-theme) .item-maintenance:hover .category-card-arrow {
  color: #d97706;
}
.item-maintenance:hover::after {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), transparent);
}

/* 3. Cabin Safety (Purple) */
.item-cabin-safety:hover {
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.18);
}
.item-cabin-safety:hover .category-card-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}
.item-cabin-safety:hover .category-card-title {
  color: #a78bfa;
}
body:not(.dark-theme) .item-cabin-safety:hover .category-card-title {
  color: #7c3aed;
}
.item-cabin-safety:hover .category-card-arrow {
  color: #a78bfa;
}
body:not(.dark-theme) .item-cabin-safety:hover .category-card-arrow {
  color: #7c3aed;
}
.item-cabin-safety:hover::after {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), transparent);
}

/* 4. Ground Ops (Emerald) */
.item-ground-ops:hover {
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.18);
}
.item-ground-ops:hover .category-card-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.item-ground-ops:hover .category-card-title {
  color: #34d399;
}
body:not(.dark-theme) .item-ground-ops:hover .category-card-title {
  color: #059669;
}
.item-ground-ops:hover .category-card-arrow {
  color: #34d399;
}
body:not(.dark-theme) .item-ground-ops:hover .category-card-arrow {
  color: #059669;
}
.item-ground-ops:hover::after {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), transparent);
}

/* 5. Security AVSEC (Rose Red) */
.item-security:hover {
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.18);
}
.item-security:hover .category-card-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.item-security:hover .category-card-title {
  color: #f87171;
}
body:not(.dark-theme) .item-security:hover .category-card-title {
  color: #dc2626;
}
.item-security:hover .category-card-arrow {
  color: #f87171;
}
body:not(.dark-theme) .item-security:hover .category-card-arrow {
  color: #dc2626;
}
.item-security:hover::after {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), transparent);
}

/* 6. Other Factor (Magenta/Pink) */
.item-other:hover {
  box-shadow: 0 12px 24px rgba(217, 70, 239, 0.18);
}
.item-other:hover .category-card-icon {
  background: rgba(217, 70, 239, 0.12);
  color: #f472b6;
  border-color: rgba(217, 70, 239, 0.3);
}
.item-other:hover .category-card-title {
  color: #f472b6;
}
body:not(.dark-theme) .item-other:hover .category-card-title {
  color: #c026d3;
}
.item-other:hover .category-card-arrow {
  color: #f472b6;
}
body:not(.dark-theme) .item-other:hover .category-card-arrow {
  color: #c026d3;
}
.item-other:hover::after {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.4), transparent);
}

/* ==========================================================================
   History List and Premium Cards Layout Rules - Hotfix v3.2
   ========================================================================== */
.history-list-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.category-card.history-card {
  width: 100%;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
  align-items: flex-start !important; /* Prevents centering vertical overflows */
}

.category-card.history-card .category-card-desc {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* ==========================================================================
   Management Module - Hotfix v3.3 Grid & Premium Card Styles
   ========================================================================== */
.management-layout-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  height: calc(100vh - 120px);
  min-height: 500px;
  align-items: stretch;
  width: 100%;
}

@media (max-width: 1024px) {
  .management-layout-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.premium-inner-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--login-card-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body:not(.dark-theme) .premium-inner-card {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.04);
}

/* Active states for each category inside Management Module */
.category-card.active {
  transform: scale(0.98);
  border-color: transparent !important;
}

.category-card.active::after {
  opacity: 1 !important;
}

/* 1. Flight Ops Active Glow */
.category-card.item-flight-ops.active {
  background: rgba(2, 132, 199, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(2, 132, 199, 0.15), 0 0 15px rgba(2, 132, 199, 0.2) !important;
  border: 1px solid rgba(2, 132, 199, 0.5) !important;
}
.category-card.item-flight-ops.active .category-card-icon {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
}
.category-card.item-flight-ops.active .category-card-title {
  color: #38bdf8 !important;
}
body:not(.dark-theme) .category-card.item-flight-ops.active .category-card-title {
  color: #0284c7 !important;
}
.category-card.item-flight-ops.active::after {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.5), transparent) !important;
}

/* 2. Maintenance Active Glow */
.category-card.item-maintenance.active {
  background: rgba(245, 158, 11, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.15), 0 0 15px rgba(245, 158, 11, 0.2) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
}
.category-card.item-maintenance.active .category-card-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}
.category-card.item-maintenance.active .category-card-title {
  color: #fbbf24 !important;
}
body:not(.dark-theme) .category-card.item-maintenance.active .category-card-title {
  color: #d97706 !important;
}
.category-card.item-maintenance.active::after {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.5), transparent) !important;
}

/* 3. Cabin Safety Active Glow */
.category-card.item-cabin-safety.active {
  background: rgba(139, 92, 246, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.15), 0 0 15px rgba(139, 92, 246, 0.2) !important;
  border: 1px solid rgba(139, 92, 246, 0.5) !important;
}
.category-card.item-cabin-safety.active .category-card-icon {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #a78bfa !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}
.category-card.item-cabin-safety.active .category-card-title {
  color: #a78bfa !important;
}
body:not(.dark-theme) .category-card.item-cabin-safety.active .category-card-title {
  color: #7c3aed !important;
}
.category-card.item-cabin-safety.active::after {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), transparent) !important;
}

/* 4. Ground Ops Active Glow */
.category-card.item-ground-ops.active {
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.15), 0 0 15px rgba(16, 185, 129, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
}
.category-card.item-ground-ops.active .category-card-icon {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}
.category-card.item-ground-ops.active .category-card-title {
  color: #34d399 !important;
}
body:not(.dark-theme) .category-card.item-ground-ops.active .category-card-title {
  color: #059669 !important;
}
.category-card.item-ground-ops.active::after {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), transparent) !important;
}

/* 5. Security AVSEC Active Glow */
.category-card.item-security.active {
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(239, 68, 68, 0.15), 0 0 15px rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
}
.category-card.item-security.active .category-card-icon {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
.category-card.item-security.active .category-card-title {
  color: #f87171 !important;
}
body:not(.dark-theme) .category-card.item-security.active .category-card-title {
  color: #dc2626 !important;
}
.category-card.item-security.active::after {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), transparent) !important;
}

/* 6. Other Factor Active Glow */
.category-card.item-other.active {
  background: rgba(217, 70, 239, 0.08) !important;
  box-shadow: inset 0 0 12px rgba(217, 70, 239, 0.15), 0 0 15px rgba(217, 70, 239, 0.2) !important;
  border: 1px solid rgba(217, 70, 239, 0.5) !important;
}
.category-card.item-other.active .category-card-icon {
  background: rgba(217, 70, 239, 0.15) !important;
  color: #f472b6 !important;
  border-color: rgba(217, 70, 239, 0.4) !important;
}
.category-card.item-other.active .category-card-title {
  color: #f472b6 !important;
}
body:not(.dark-theme) .category-card.item-other.active .category-card-title {
  color: #c026d3 !important;
}
.category-card.item-other.active::after {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.5), transparent) !important;
}

/* ==========================================================================
   HOTFIX v4.0: TRANSICIÓN A ESTILO PREMIUM ENTERPRISE FULL-SCREEN (ALE DUTY)
   ========================================================================== */

/* 1. Body y Fondo de la Aplicación en Estado Logged-In */
body.logged-in {
  background: #f1f5f9 !important;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
body.logged-in::before {
  display: none !important;
}
body.dark-theme.logged-in {
  background: #090d16 !important;
}

/* 2. Expansión de Contenedores Principales a Pantalla Completa (Full Viewport) */
body.logged-in .login-container {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 10 !important;
  background: transparent !important;
}

body.logged-in .login-card {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #f1f5f9 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  text-align: left !important;
  overflow: hidden !important;
}
body.dark-theme.logged-in .login-card {
  background: #090d16 !important;
}

/* 3. Área de Contenido Principal (Derecha) */
body.logged-in #profile-section {
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
  height: 100vh !important;
  overflow-y: auto !important;
  padding: 0 32px 40px 32px !important;
  box-sizing: border-box !important;
  margin-left: 260px !important;
  transition: margin-left 0.3s !important;
  width: calc(100% - 260px) !important;
}
@media (max-width: 1024px) {
  body.logged-in #profile-section {
    margin-left: 0 !important;
    padding: 0 20px 20px 20px !important;
    width: 100% !important;
  }
}

/* 4. Barra Lateral de Navegación (Sidebar) Permanente en Escritorio */
@media (min-width: 1025px) {
  body.logged-in .navigation-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    transform: translateX(0) !important;
    width: 260px !important;
    border-radius: 0 32px 32px 0 !important;
    box-shadow: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    z-index: 99 !important;
    display: flex !important;
  }
  body.dark-theme.logged-in .navigation-drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 0 32px 32px 0 !important;
  }
  body.logged-in .drawer-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

/* 5. Cabecera y Título del Drawer Lateral */
body.logged-in .navigation-drawer .drawer-header {
  padding-bottom: 20px !important;
  margin-bottom: 24px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-header {
  border-bottom: 1px solid #1e293b !important;
}
body.logged-in .navigation-drawer .drawer-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-title {
  color: #f8fafc !important;
}
body.logged-in .navigation-drawer .drawer-subtitle {
  font-size: 13px !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
  margin-top: 4px !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-subtitle {
  color: #38bdf8 !important;
}

/* 6. Elementos de Menú de la Barra Lateral */
body.logged-in .navigation-drawer .drawer-item {
  padding: 12px 16px !important;
  border-radius: 12px !important;
  font-size: 14.5px !important;
  color: #475569 !important;
  margin-bottom: 4px !important;
  transition: all 0.2s ease !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-item {
  color: #94a3b8 !important;
}
body.logged-in .navigation-drawer .drawer-item:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-item:hover {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Elemento Activo en la Barra Lateral (Píldora Celeste con Texto Azul, estilo ALE Duty) */
body.logged-in .navigation-drawer .drawer-item.active {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
body.dark-theme.logged-in .navigation-drawer .drawer-item.active {
  background-color: #0f2d4a !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

/* 7. Sección de Perfil de Usuario y Botón de Cerrar Sesión en Drawer Footer */
body.logged-in .drawer-profile-info {
  border-top: 1px solid #e2e8f0 !important;
  padding: 16px 12px 12px 12px !important;
  margin-bottom: 12px !important;
}
body.dark-theme.logged-in .drawer-profile-info {
  border-top: 1px solid #1e293b !important;
}

body.logged-in .btn-signout-drawer {
  border: none !important;
  background: transparent !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  color: #ef4444 !important;
  transition: background 0.2s !important;
  width: 100% !important;
}
body.logged-in .btn-signout-drawer:hover {
  background: #fee2e2 !important;
}
body.dark-theme.logged-in .btn-signout-drawer:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}

/* 8. Tarjetas de Workspace (Fondo Glassmorphism + Material 3) */
body.logged-in .dashboard-stat-card,
body.logged-in .dashboard-panel-card,
body.logged-in .tenant-metric-card,
body.logged-in .category-card,
body.logged-in .premium-inner-card,
body.logged-in .report-item-card {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 42, 84, 0.04) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 24px !important; /* Geometría M3 amplia */
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1), 
              box-shadow 300ms cubic-bezier(0.2, 0, 0, 1),
              border-color 300ms ease !important;
}

body.dark-theme.logged-in .dashboard-stat-card,
body.dark-theme.logged-in .dashboard-panel-card,
body.dark-theme.logged-in .tenant-metric-card,
body.dark-theme.logged-in .category-card,
body.dark-theme.logged-in .premium-inner-card,
body.dark-theme.logged-in .report-item-card {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 24px !important;
}

/* Efectos de elevación minimalistas al flotar (Hover) */
body.logged-in .category-card:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  transform: translateY(-4px) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

body.dark-theme.logged-in .category-card:hover {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: var(--md-sys-color-primary) !important;
}

/* 9. Barra Superior (Top App Bar) y Simulador en Workspace */
body.logged-in .top-app-bar {
  position: sticky !important;
  top: 12px !important;
  z-index: 100 !important;
  background: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  padding: 12px 24px !important;
  margin: 12px auto 20px auto !important;
  border-radius: 100px !important; /* Estilo Cápsula */
  max-width: 1400px !important;
  width: calc(100% - 32px) !important;
  box-shadow: 0 4px 30px rgba(0, 42, 84, 0.04) !important;
}
@media (max-width: 1024px) {
  body.logged-in .top-app-bar {
    padding: 10px 16px !important;
    border-radius: 24px !important;
    margin: 8px auto 16px auto !important;
    width: calc(100% - 16px) !important;
  }
}
body.dark-theme.logged-in .top-app-bar {
  background: rgba(15, 23, 42, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25) !important;
}
body.logged-in .app-bar-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
body.dark-theme.logged-in .app-bar-title {
  color: #f8fafc !important;
}
body.logged-in .app-bar-tenant-tag {
  background: none !important;
  color: var(--md-sys-color-primary, #0284c7) !important;
  font-weight: 500 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  margin-top: 2px !important;
  display: inline-block !important;
  letter-spacing: 0.3px !important;
}
body.dark-theme.logged-in .app-bar-tenant-tag {
  background: none !important;
  color: #38bdf8 !important;
}

@media (min-width: 1025px) {
  body.logged-in .menu-hamburger-btn {
    display: flex !important;
  }
}

/* Panel de Simulador Sandbox */
body.logged-in .role-simulator-bar {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 24px !important;
  padding: 12px 20px !important;
  margin: 0 auto 24px auto !important;
  max-width: 1400px !important;
  width: calc(100% - 32px) !important;
  color: #475569 !important;
}
body.dark-theme.logged-in .role-simulator-bar {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #94a3b8 !important;
}
body.logged-in .role-simulator-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
}
body.dark-theme.logged-in .role-simulator-select {
  background: #1f2937 !important;
  border: 1px solid #374151 !important;
  color: #f8fafc !important;
}

/* 10. Inputs de Formularios y Elementos Interactivos */
body.logged-in input,
body.logged-in select,
body.logged-in textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 8px !important;
}
body.dark-theme.logged-in input,
body.dark-theme.logged-in select,
body.dark-theme.logged-in textarea {
  background: #1f2937 !important;
  border: 1px solid #374151 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   Hotfix v4.2 - Ajustes de Inputs de Ancho Completo en Premium Inner Card
   ========================================================================== */
body.logged-in .premium-inner-card input[type="text"],
body.logged-in .premium-inner-card input[type="date"],
body.logged-in .premium-inner-card input[type="number"],
body.logged-in .premium-inner-card select,
body.logged-in .premium-inner-card textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
  margin-top: 4px !important;
  margin-bottom: 8px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

body.logged-in .premium-inner-card input[type="text"]:focus,
body.logged-in .premium-inner-card input[type="date"]:focus,
body.logged-in .premium-inner-card input[type="number"]:focus,
body.logged-in .premium-inner-card select:focus,
body.logged-in .premium-inner-card textarea:focus {
  border-color: var(--md-sys-color-primary) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
  outline: none !important;
}

/* Modal de Visualización de Correo Electrónico HTML Premium */
.email-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.email-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.email-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 650px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #e2e8f0;
}

.email-modal-overlay.active .email-modal-card {
  transform: scale(1);
}

.email-modal-header {
  background: #0f172a;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
}

.email-modal-header h3 {
  color: #ffffff;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  line-height: 1;
}

.email-modal-close-btn:hover {
  color: #ffffff;
}

.email-modal-body {
  padding: 24px;
  background: #f1f5f9;
  max-height: 70vh;
  overflow-y: auto;
}

.email-html-canvas {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
}

.email-html-header {
  background: #0284c7;
  padding: 24px;
  text-align: center;
  color: #ffffff;
}

.email-html-header-logo {
  font-size: 32px;
  margin-bottom: 8px;
}

.email-html-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.email-html-content {
  padding: 32px 24px;
  color: #334155;
}

.email-html-content p {
  font-size: 14.5px;
  line-height: 1.6;
  margin-top: 0;
  margin-bottom: 20px;
}

.email-html-details-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0284c7;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 24px;
}

.email-html-details-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
}

.email-html-details-label {
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
}

.email-html-details-value {
  color: #0f172a;
  font-weight: 500;
}

.email-html-btn-container {
  text-align: center;
  margin: 28px 0 10px 0;
}

.email-html-btn {
  display: inline-block;
  background: #0284c7;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: background 0.2s, transform 0.2s;
}

.email-html-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.email-html-footer {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.4;
}

.email-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #ffffff;
}

/* Estilos de Dropzone de Seguimiento */
.followup-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.35) !important;
  background: rgba(16, 185, 129, 0.01) !important;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.followup-dropzone:hover {
  background: rgba(16, 185, 129, 0.04) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
}

body.dark-theme .followup-dropzone {
  border-color: rgba(16, 185, 129, 0.25) !important;
  background: rgba(16, 185, 129, 0.005) !important;
}

/* ==========================================================================
   Hotfix v4.3 - Ajustes de Usabilidad, Evidencias y Flujo de Revisión
   ========================================================================== */

body.logged-in .drawer-footer {
  padding-top: 0 !important;
}

.drawer-action-links-row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 16px !important;
  margin-bottom: 16px !important;
  padding: 0 12px !important;
  gap: 8px 12px !important;
}

.drawer-action-link {
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  color: var(--login-text-secondary) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
  padding-bottom: 2px !important;
  white-space: nowrap !important;
}

.drawer-action-link:hover {
  color: var(--md-sys-color-primary, #0284c7) !important;
  border-bottom: 1px solid var(--md-sys-color-primary, #0284c7) !important;
}

body.dark-theme .drawer-action-link {
  color: #94a3b8 !important;
}

body.dark-theme .drawer-action-link:hover {
  color: #38bdf8 !important;
  border-bottom: 1px solid #38bdf8 !important;
}

/* Colores por defecto para los iconos monocromáticos */
.item-flight-ops .category-card-icon,
.category-icon-flight_ops { color: #0284c7 !important; }

.item-maintenance .category-card-icon,
.category-icon-maintenance { color: #f97316 !important; }

.item-cabin-safety .category-card-icon,
.category-icon-cabin_safety { color: #a855f7 !important; }

.item-ground-ops .category-card-icon,
.category-icon-ground_ops { color: #22c55e !important; }

.item-security .category-card-icon,
.category-icon-security { color: #ef4444 !important; }

.item-other .category-card-icon,
.category-icon-other { color: #64748b !important; }

/* Animaciones y Transiciones de Colapso Sidebar */
body.logged-in .navigation-drawer {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s !important;
}
body.logged-in #profile-section {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.logged-in.sidebar-collapsed .navigation-drawer {
  transform: translateX(-260px) !important;
}
body.logged-in.sidebar-collapsed #profile-section {
  margin-left: 0 !important;
  width: 100% !important;
}

/* Modales Premium de Soporte y Manual de Usuario */
.sms-premium-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 11000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sms-premium-modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sms-premium-modal-card {
  background: #ffffff !important;
  color: #1e293b !important;
  width: 90% !important;
  max-width: 580px !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: scale(0.9) translateY(20px) !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  border: 1px solid #cbd5e1 !important;
}

body.dark-theme .sms-premium-modal-card {
  background: #111827 !important;
  color: #f8fafc !important;
  border: 1px solid #374151 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3) !important;
}

.sms-premium-modal-overlay.active .sms-premium-modal-card {
  transform: scale(1) translateY(0) !important;
}

.sms-premium-modal-header {
  padding: 18px 24px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.dark-theme .sms-premium-modal-header {
  border-bottom: 1px solid #1e293b !important;
}

.sms-premium-modal-header h3 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #0f172a !important;
}

body.dark-theme .sms-premium-modal-header h3 {
  color: #f8fafc !important;
}

.sms-premium-modal-close-btn {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 26px !important;
  cursor: pointer !important;
  transition: color 0.2s, transform 0.2s !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.sms-premium-modal-close-btn:hover {
  color: #ef4444 !important;
  transform: rotate(90deg) !important;
}

body.dark-theme .sms-premium-modal-close-btn {
  color: #94a3b8 !important;
}

body.dark-theme .sms-premium-modal-close-btn:hover {
  color: #f87171 !important;
}

.sms-premium-modal-body {
  padding: 24px 28px !important;
  max-height: 75vh !important;
  overflow-y: auto !important;
  font-size: 14.5px !important;
  line-height: 1.6 !important;
}

.sms-premium-manual-step {
  margin-bottom: 16px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px dashed #e2e8f0 !important;
}

body.dark-theme .sms-premium-manual-step {
  border-bottom: 1px dashed #334155 !important;
}

.sms-premium-manual-step:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.sms-premium-manual-step-title {
  font-weight: 700 !important;
  color: #0284c7 !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body.dark-theme .sms-premium-manual-step-title {
  color: #38bdf8 !important;
}

.sms-premium-modal-footer {
  padding: 16px 24px !important;
  display: flex !important;
  justify-content: flex-end !important;
  border-top: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

body.dark-theme .sms-premium-modal-footer {
  border-top: 1px solid #1e293b !important;
  background: #0f172a !important;
}

.sms-premium-modal-btn {
  padding: 10px 20px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-size: 14px !important;
}

.sms-premium-modal-btn-primary {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: none !important;
}

.sms-premium-modal-btn-primary:hover {
  background: #0369a1 !important;
  transform: translateY(-1px) !important;
}

.sms-premium-modal-btn-secondary {
  background: transparent !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
  margin-right: 10px !important;
  display: inline-block !important;
}

body.dark-theme .sms-premium-modal-btn-secondary {
  border: 1px solid #334155 !important;
  color: #94a3b8 !important;
}

.sms-premium-modal-btn-secondary:hover {
  background: #f1f5f9 !important;
}

body.dark-theme .sms-premium-modal-btn-secondary:hover {
  background: #1e293b !important;
}


/* ==========================================================================
   Cinematic 3D Splash Screen Loader Animation (v4.9.5)
   ========================================================================== */
:root {
  --splash-bg: #f8fafc;
  --splash-text: #002A54;
  --splash-card-bg: #ffffff;
  --splash-card-shadow: rgba(0, 42, 84, 0.08);
}

body.dark-theme, .dark-theme {
  --splash-bg: #051630;
  --splash-text: #38bdf8;
  --splash-card-bg: #ffffff; /* Mantenemos blanco para que mix-blend-mode multiply funcione */
  --splash-card-shadow: rgba(0, 0, 0, 0.4);
}

#splash-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: var(--splash-bg);
  z-index: 9999;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden; 
  animation: fadeOutSplash 0.4s ease-in-out forwards;
  animation-delay: 1.75s;
  pointer-events: auto;
  margin: 0 !important;
  padding: 0 !important;
  align-self: flex-start !important; /* Fixes layout shift inside body flex container on mobile WebViews */
  justify-self: flex-start !important;
}

@keyframes fadeOutSplash {
  0% { 
    opacity: 1; 
    visibility: visible;
    pointer-events: auto;
  }
  99% {
    opacity: 0;
    visibility: visible;
    pointer-events: auto;
  }
  100% { 
    opacity: 0; 
    visibility: hidden; 
    display: none; 
    pointer-events: none;
  }
}

.image-anim-container {
  position: relative;
  margin-bottom: 3rem;
  z-index: 20;
  opacity: 0;
  animation: revealImage 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

.logo-card {
  background-color: var(--splash-card-bg);
  border-radius: 3rem;
  padding: 2rem 3rem;
  box-shadow: 0px 15px 35px var(--splash-card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateZ(0);
}

.logo-image {
  width: 280px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@keyframes revealImage {
  0% { 
    transform: scale(0.6) translateY(40px); 
    opacity: 0; 
    filter: blur(10px);
  }
  60% { 
    transform: scale(1.05) translateY(0); 
    opacity: 1; 
    filter: blur(0px);
  }
  100% { 
    transform: scale(1) translateY(0); 
    opacity: 1; 
    filter: blur(0px);
  }
}

.brand-text-reveal {
  position: relative;
  color: var(--splash-text);
  font-size: 3.5rem;
  font-weight: 300;
  letter-spacing: 12px;
  margin-right: -12px; /* Compensar el letter-spacing para centrado óptico perfecto */
  text-align: center;
  z-index: 10;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: revealText 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.6s; 
}

.brand-text-reveal strong {
  font-weight: 600;
}

@keyframes revealText {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1024px) {
  .image-anim-container { margin-bottom: 2rem; }
  .logo-card { padding: 1.5rem 2rem !important; border-radius: 2rem !important; }
  .logo-image { width: 180px !important; }
  .brand-text-reveal { font-size: 2.2rem; letter-spacing: 6px; margin-right: -6px !important; }
}

/* ==========================================================================
   PILAR 1 & 3: MICRO-ANIMACIONES, TACTILIDAD Y SWITCHES M3
   ========================================================================== */

/* Física de compresión táctil al hacer clic (Active Press) */
.btn-m3-primary:active,
.btn-signout-drawer:active,
.drawer-round-btn:active,
.btn-fallback-toggle:active,
.theme-toggle-floating-btn:active,
.recent-alert-item:active,
.report-card:active,
.category-card:active,
.bento-card:active {
  transform: scale(0.96) !important;
  opacity: 0.9 !important;
  transition: transform 100ms cubic-bezier(0, 0, 0.2, 1) !important;
}

/* Transmutación de Checkboxes a Switches Estilo Material 3 - Solución Deslizante Ultra-Minimalista */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 100px;
  border: 2px solid var(--md-sys-color-outline, #79747E) !important;
  background: transparent !important;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  box-sizing: border-box !important;
}

/* OFF state (unchecked): Ball is on the RIGHT, transparent outline track, gray ball */
input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--md-sys-color-outline, #79747E) !important;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(20px); /* Positioned on the RIGHT */
}

/* ON state (checked): Ball is on the LEFT, filled primary track, white ball */
input[type="checkbox"]:checked {
  background: var(--md-sys-color-primary, #002A54) !important;
  border-color: var(--md-sys-color-primary, #002A54) !important;
}

input[type="checkbox"]:checked::after {
  transform: translateX(0); /* Positioned on the LEFT */
  background: #FFFFFF !important; /* White ball for ON */
}

/* Dark theme overrides */
body.dark-theme input[type="checkbox"] {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

body.dark-theme input[type="checkbox"]::after {
  background: rgba(255, 255, 255, 0.4) !important;
}

body.dark-theme input[type="checkbox"]:checked {
  background: var(--md-sys-color-primary, #38bdf8) !important;
  border-color: var(--md-sys-color-primary, #38bdf8) !important;
}

body.dark-theme input[type="checkbox"]:checked::after {
  background: #ffffff !important;
}

/* 10. Animaciones interactivas en selectores de riesgo 5x5 */
.btn-selector-risk {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.btn-selector-risk:hover {
  transform: translateY(-2px) scale(1.06) !important;
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: var(--md-sys-color-primary, #0284c7) !important;
  color: var(--md-sys-color-primary, #0284c7) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
}
body.dark-theme .btn-selector-risk:hover {
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2) !important;
}
.btn-selector-risk:active {
  transform: translateY(1px) scale(0.95) !important;
}
.btn-selector-risk.active {
  background: var(--md-sys-color-primary, #0284c7) !important;
  border-color: var(--md-sys-color-primary, #0284c7) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3) !important;
}
body.dark-theme .btn-selector-risk.active {
  background: #38bdf8 !important;
  border-color: #38bdf8 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4) !important;
}


/* ==========================================================================
   11. DISEÑADOR DE FORMULARIOS INTERACTIVO (FORM BUILDER v5.0.0)
   ========================================================================== */

.fb-workspace-grid-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  min-height: 100px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  border: 1.5px dashed var(--login-card-border, rgba(2, 132, 199, 0.15));
  transition: all 0.3s ease;
}

body.dark-theme .fb-workspace-grid-container {
  background: rgba(15, 23, 42, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}

.fb-workspace-grid-container.drag-over {
  border-color: var(--md-sys-color-primary, #0284c7) !important;
  background: rgba(2, 132, 199, 0.04) !important;
  box-shadow: inset 0 0 12px rgba(2, 132, 199, 0.1) !important;
}

body.dark-theme .fb-workspace-grid-container.drag-over {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.04) !important;
  box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.1) !important;
}

/* Tarjeta de Pregunta en el Diseñador */
.fb-question-card {
  position: relative !important;
  cursor: grab !important;
  user-select: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, width 0.1s ease !important;
}

.fb-question-card:active {
  cursor: grabbing !important;
}

.fb-question-card.dragged {
  opacity: 0.35 !important;
  transform: scale(0.96) !important;
  border-style: dashed !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

/* Handle para Redimensionar con el Mouse */
.fb-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fb-question-card:hover .fb-resize-handle {
  background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .fb-question-card:hover .fb-resize-handle {
  background: rgba(255, 255, 255, 0.02);
}

.fb-resize-handle:hover,
.fb-resize-handle:active {
  background: var(--md-sys-color-primary, #0284c7) !important;
  width: 12px;
}

body.dark-theme .fb-resize-handle:hover,
body.dark-theme .fb-resize-handle:active {
  background: #38bdf8 !important;
}

/* Indicador de Línea de Redimensionamiento Activo */
.fb-resize-handle::after {
  content: "";
  display: block;
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
}

.fb-resize-handle:hover::after,
.fb-resize-handle:active::after {
  background: #ffffff;
}

/* Glassmorphism Premium Modales */
.fb-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000 !important;
  animation: fb-modal-fade-in 0.3s ease-out;
}

.fb-modal-container {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 24px 60px rgba(0, 42, 84, 0.18) !important;
  border-radius: 24px !important;
  width: 520px !important;
  max-width: 90% !important;
  padding: 30px !important;
  animation: fb-modal-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #0f172a !important;
}

body.dark-theme .fb-modal-container {
  background: rgba(30, 41, 59, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
  color: #f8fafc !important;
}

@keyframes fb-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fb-modal-slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Selector visual de iconos para categorías */
.fb-icon-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.fb-icon-option {
  border: 1px solid var(--login-card-border, rgba(255, 255, 255, 0.1));
  background: rgba(0, 0, 0, 0.15);
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-icon-option:hover {
  border-color: rgba(2, 132, 199, 0.5);
  transform: translateY(-2px);
  background: rgba(2, 132, 199, 0.05);
}

.fb-icon-option.selected {
  border-color: var(--md-sys-color-primary, #0284c7) !important;
  background: rgba(2, 132, 199, 0.15) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2) !important;
}

body.dark-theme .fb-icon-option.selected {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25) !important;
}

/* ==========================================================================
   SECCION: CONFIGURACION - PESTANAS Y GESTION DE USUARIOS (v5.2.0)
   ========================================================================== */

/* Barra de Pestanas MD3 */
.config-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--login-card-border, rgba(255, 255, 255, 0.08));
  padding-bottom: 12px;
}

.config-tab-btn {
  background: transparent;
  color: var(--login-text-secondary, #9ca3af);
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.config-tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--login-text-primary, #ffffff);
}

.config-tab-btn.active {
  color: var(--md-sys-color-primary, #38bdf8);
  background: rgba(2, 132, 199, 0.08);
}

body.dark-theme .config-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Indicador de pestana activa */
.config-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--md-sys-color-primary, #0284c7);
  border-radius: 100px;
}

body.dark-theme .config-tab-btn.active::after {
  background: #38bdf8;
}

/* Tabla de Gestion de Usuarios */
.user-management-table {
  width: 100%;
  border-collapse: collapse;
}

.user-management-table th {
  font-size: 12px;
  color: var(--login-text-secondary, #9ca3af);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--login-card-border, rgba(255, 255, 255, 0.08));
  padding: 12px 8px;
}

.user-management-table td {
  padding: 12px 8px;
  vertical-align: middle;
}

/* Selector de Estatus Premium (Boton de Estado) */
.status-toggle-btn {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  outline: none;
}

.status-toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Estado Activo (Verde / Teal soft) */
.status-toggle-btn.active {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.status-toggle-btn.active:not(:disabled):hover {
  background: rgba(16, 185, 129, 0.22) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

/* Estado Inactivo (Gris / Red soft) */
.status-toggle-btn.inactive {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.18) !important;
}

.status-toggle-btn.inactive:not(:disabled):hover {
  background: rgba(239, 68, 68, 0.18) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

/* Hover suave en filas de la tabla */
.user-management-table tbody tr {
  transition: background 0.15s ease;
}

.user-management-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

@media (max-width: 1024px) {
  /* 1. Dashboard - Estructuras Principales */
  body.logged-in #profile-section {
    padding: 0 10px 16px 10px !important;
  }

  body.logged-in .top-app-bar {
    padding: 8px 12px !important;
    border-radius: 16px !important;
    margin: 6px auto 12px auto !important;
    width: calc(100% - 12px) !important;
  }

  .app-bar-title {
    font-size: 16px !important;
  }

  .app-bar-tenant-tag {
    font-size: 11px !important;
  }

  /* 2. Dashboard - Métricas */
  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  
  .dashboard-stat-card {
    padding: 12px !important;
    min-height: 90px !important;
    border-radius: 16px !important;
  }
  
  .stat-card-title {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
  }
  
  .stat-card-value {
    font-size: 24px !important;
    font-weight: 700 !important;
    margin-top: 2px !important;
  }
  
  .stat-card-trend {
    font-size: 10px !important;
    margin-top: 2px !important;
  }

  /* 3. Dashboard - Panel de Layout y OACI */
  .dashboard-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .dashboard-panel-card {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .panel-card-title {
    font-size: 15px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  /* 4. Dashboard - Feed de Notificaciones de Seguridad (Recent Alerts) */
  .recent-alerts-list {
    max-height: 480px !important;
  }

  .recent-alert-item {
    display: grid !important;
    grid-template-columns: 36px 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 8px 12px !important;
    padding: 12px !important;
    align-items: start !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
  }

  .recent-alert-item .alert-item-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin-top: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .recent-alert-item > div:nth-child(2),
  .recent-alert-item .alert-item-info,
  .recent-alert-item > div[style*="flex-grow: 1"] {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important; /* Critically important to allow text wrapping inside grid on mobile */
    text-align: left !important;
  }

  .recent-alert-item .alert-item-title {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
    color: var(--login-text-primary) !important;
    display: block !important;
  }

  .recent-alert-item .alert-item-time,
  .recent-alert-item .alert-item-meta {
    font-size: 11.5px !important;
    color: var(--login-text-secondary) !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
    display: block !important;
  }

  /* Support status and category pill wrapping cleanly on mobile */
  .recent-alert-item > div:nth-child(2) > div,
  .recent-alert-item .alert-item-info > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    align-items: center !important;
    margin-top: 2px !important;
  }

  .recent-alert-item > div:last-child,
  .recent-alert-item > div[style*="align-items: flex-end"] {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-left: 0 !important;
    margin-top: 2px !important;
    width: 100% !important;
  }

  .recent-alert-item .alert-badge-pill {
    font-size: 9.5px !important;
    padding: 3px 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border-radius: 50px !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* 5. Informe SMS - Rejilla de Categorías */
  .category-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .category-card {
    padding: 14px 16px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }

  .category-card-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
    border-radius: 10px !important;
  }

  .category-card-title {
    font-size: 14px !important;
  }

  .category-card-desc {
    font-size: 11.5px !important;
  }

  /* 6. Informe SMS - Navegación de pestañas */
  .reports-tabs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    gap: 4px !important;
  }

  .reports-tab-btn {
    padding: 6px 12px !important;
    font-size: 12.5px !important;
  }

  /* 7. Informe SMS - Apilado de Formulario */
  #sms-report-form .form-group[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Campos dinámicos opcionales */
  .dynamic-fields-wrapper {
    grid-template-columns: repeat(12, 1fr) !important;
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 12px !important;
  }

  .dynamic-fields-wrapper .form-group[style*="grid-column"] {
    grid-column: span 12 !important;
  }

  /* Inputs de formulario responsivos */
  body.logged-in .m3-input,
  body.logged-in .m3-textarea,
  body.logged-in select {
    padding: 10px 12px !important;
    font-size: 13.5px !important;
  }

  /* Botones del formulario */
  .m3-form button[type="submit"],
  .m3-form button[type="button"] {
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
  }

  /* Invertir y apilar botones: primario arriba, secundario abajo */
  #sms-report-form div[style*="display: flex"][style*="gap: 12px"],
  #sms-report-form div[style*="gap: 12px"] {
    flex-direction: column-reverse !important;
    gap: 10px !important;
  }

  /* 8. Top App Bar - Optimizacion de Perfil y Nombre Largo */
  .app-bar-user-profile {
    gap: 6px !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }
  
  .app-bar-user-profile > div:first-child,
  .app-bar-user-profile div[style*="align-items: flex-end"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    max-width: 90px !important; /* Forces the text container to stay compact and never overflow */
    min-width: 0 !important;
  }

  .app-bar-user-profile span {
    font-size: 11px !important;
    font-weight: 700 !important;
    max-width: 90px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    line-height: 1.2 !important;
    text-align: right !important;
  }
  
  .user-role-badge {
    padding: 2px 6px !important;
    font-size: 9px !important;
    max-width: 90px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .app-bar-avatar-text {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
  }
}

/* ==========================================================================
   Frappe Gantt Popup Wrapper Glassmorphism Overrides
   ========================================================================== */
.gantt-container .popup-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Make sure the pointer (triangle arrow) uses theme-aware colors */
body.dark-theme .gantt-container .popup-wrapper .pointer {
  border-top-color: #1e1e2e !important;
  border-bottom-color: #1e1e2e !important;
}
body:not(.dark-theme) .gantt-container .popup-wrapper .pointer {
  border-top-color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}

/* ==========================================================================
   Proxy (Impersonation) Mode Premium Styles
   ========================================================================== */
#proxy-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 999999;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1e293b;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

body.proxy-active {
  padding-top: 44px !important;
}

body.proxy-active .top-app-bar {
  top: 56px !important;
}

body.proxy-active .navigation-drawer {
  top: 44px !important;
}

.proxy-banner-btn {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.proxy-banner-btn:hover {
  background: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.proxy-banner-btn:active {
  transform: translateY(0);
}





