@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Light Theme (Default) */
:root {
  /* Layout */
  --bottom-nav-height: 70px;

  /* Primary Colors */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;

  /* Semantic Colors */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  --error-50: #fef2f2;
  --error-200: #fecaca;
  --error-500: #ef4444;
  --error-700: #b91c1c;

  /* Surfaces */
  --surface: #ffffff;
  --background: var(--gray-50);
  --border: var(--gray-200);

  /* Text */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-500);

  /* Shadows - More layered and subtle for a premium feel */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Glassmorphism & Effects - Refined with subtle border */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

  /* Transitions */
  --btn-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

/* Dark Theme - Auto-detect from OS preference */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-500: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-900: #f1f5f9;

    --surface: #1e293b;
    --background: #0f172a;
    --border: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(51, 65, 85, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  }
}

/* Dark Mode Manual override */
.dark-mode {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-500: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-900: #f1f5f9;

    --surface: #1e293b;
    --background: #0f172a;
    --border: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(51, 65, 85, 0.3);
}

/* Reset and Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

.btn-export-sm {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-export-sm:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.btn-export-sm:active {
  transform: scale(0.95);
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 95px; /* Compensa la barra flotante */
}

@media (min-width: 992px) {
  body { padding-bottom: 0; }
}

/* Page transition animations */
@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth content-only transitions (ignores fixed/sticky headers & navigations) */
/* Dashboard */
.greeting-card,
.menu-section,
.dashboard-grid,
.stats-section,
.campaign-banner,
.campaign-countdown,
.report-alert-banner,
/* Informe (Predicar) */
.month-bar,
.form-container,
/* Solicitudes */
.new-request,
.my-requests,
/* Reunión / Programa */
.week-selector,
#vmc-view,
#weekend-view,
/* Tablero / Anuncios */
#announcements-list,
/* Documentos */
.docs-container > :not(.header-flex):not(.bottom-nav),
/* Grupos */
.groups-container,
.export-toolbar,
/* Territorios - búsqueda y tabs */
.search-container,
.app-container > .tabs,
.tab-content,
.content-tab,
/* Perfil */
.tab-nav,
/* Salidas / Predicación Pública */
main.container,
body > .container,
/* S-13 */
.app-container > .content {
  animation: pageSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

button, a {
  transition: var(--btn-transition);
  touch-action: manipulation;
}

h1, h2, h3, h4 {
    letter-spacing: -0.025em;
    font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
button,
textarea,
select {
  font: inherit;
}

/* Theme Toggle Button - Premium Styling */
.theme-toggle {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  background: var(--gray-200);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

.dark-mode .theme-toggle .icon-sun { display: none; }
.dark-mode .theme-toggle .icon-moon { display: block; }

.dark-mode .theme-toggle {
  background: var(--gray-200);
  color: var(--primary-400);
}

/* Header Actions Container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.congregation-id-badge {
    background: var(--primary-100);
    color: var(--primary-700);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 800;
    border: 1px solid var(--primary-200);
    display: inline-flex;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
}

.dark-mode .congregation-id-badge {
    background: var(--gray-200);
    color: var(--primary-400);
    border-color: var(--border);
}

/* Notifications Bell */
.notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.notif-btn:hover {
  background: var(--gray-200);
  transform: scale(1.05);
  color: var(--primary-600);
}

/* Bell Mute States */
.notif-btn.is-muted {
  color: var(--text-muted);
}

.notif-btn.is-muted .bell-svg {
  transform: rotate(-10deg);
}

.bell-svg {
  transition: transform 0.3s ease;
}

.bell-slash {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  transition: stroke-dashoffset 0.3s ease;
}

.notif-btn.is-muted .bell-slash {
  stroke-dashoffset: 0;
}

/* Default header (primary/blue) overrides */
.app-header .notif-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: none;
}

.app-header .notif-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--error-500);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  padding: 0 4px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: none; /* Hidden by default, shown by JS */
}

/* Dark mode overrides */
.dark-mode .notif-btn {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* App Container - Responsive */
.app-container {
  min-height: 100vh;
  /* Extra space (2rem) so content doesn't sit flush against the nav */
  padding-bottom: calc(var(--bottom-nav-height) + 2.5rem);
  padding-bottom: calc(var(--bottom-nav-height) + 2.5rem + env(safe-area-inset-bottom, 16px));

  max-width: 600px;
  margin: 0 auto;
  background: var(--background);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--primary-600);
  color: white;
  padding: 1rem 1.25rem;
  padding-top: max(1rem, env(safe-area-inset-top, 1rem));
  display: flex;

  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
}

.user-badge {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Glass & Premium Utilities */
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
}

.premium-shadow {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.bg-accent {
  background: var(--accent-gradient);
  color: white;
}

/* Welcome Section */
.welcome-section {
  padding: 1.5rem 1.25rem;
}

.welcome-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.welcome-section p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 1.25rem 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-icon {
  font-size: 2rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Actions Section */
.actions-section {
  padding: 0 1.25rem 2rem;
}

.actions-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.action-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  text-align: center;
}

.action-card:hover,
.action-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
}

.action-icon {
  font-size: 1.75rem;
}

.action-card span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Bottom Navigation - Fixed Premium Style (Master v5) */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  max-width: 500px;
  margin: 0 auto;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: 72px; /* Ligeramente más alto para mejor tacto */

  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 32px; /* Más orgánico */
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 0 8px;
  z-index: 10000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--gray-500);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-width: 0;
  height: 58px;
  border-radius: 20px;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2; /* Definición extra */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.7;
  transition: all 0.3s ease;
}

/* Active State Pill Styling */
.nav-item.active {
  color: var(--primary-700);
  background: rgba(79, 70, 229, 0.1);
}

.nav-item.active svg {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 4px 8px rgba(79, 70, 229, 0.25));
}

.nav-item.active span {
  opacity: 1;
  font-weight: 700;
  color: var(--primary-800);
}

.nav-item:active {
  transform: scale(0.92);
}

/* Dark Mode Overrides for Bottom Nav */
.dark-mode .bottom-nav {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.dark-mode .nav-item.active {
  color: var(--primary-400);
}

.dark-mode .nav-item::after {
  background: var(--primary-400);
  box-shadow: 0 0 12px var(--primary-500);
}

/* Alerts */
.alert {
  margin: 0 1.25rem 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
}

.alert-warning {
  background: var(--warning-50);
  border: 1px solid var(--warning-500);
  color: var(--warning-600);
}

.alert a {
  font-weight: 600;
  text-decoration: underline;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Hero Section (Landing) */
.hero {
  min-height: 60vh;
  background: linear-gradient(
    135deg,
    var(--primary-600) 0%,
    var(--primary-800) 100%
  );
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.btn-header {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-content h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* Features Grid */
.features {
  padding: 3rem 1.5rem;
  background: var(--surface);
}

.features h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  background: white;
  color: var(--primary-700);
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: transform 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

/* Trial Banner */
.trial-banner {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  padding: 2rem 1.5rem;
  text-align: center;
  color: white;
}

.trial-banner h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .app-container {
    max-width: 720px;
    padding: 0 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .app-container {
    max-width: 900px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .actions-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Multi-column for territory cards */
  .territory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .app-container {
    max-width: 1100px;
  }

  .territory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
   PAGE WRAPPERS WITH COLORFUL GRADIENTS
   ========================================== */
.page-wrapper-purple {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #a855f7 100%);
  min-height: 200px;
  padding: 1.5rem;
  color: white;
}

.page-wrapper-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  min-height: 200px;
  padding: 1.5rem;
  color: white;
}

.page-wrapper-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  min-height: 200px;
  padding: 1.5rem;
  color: white;
}

/* Section Cards with subtle color accents */
.section-card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  margin: -1.5rem 1rem 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
}
/* Biblia Treasures Enhancements */
.bright-diamond {
  font-size: 2rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1)) drop-shadow(0 0 20px rgba(42, 157, 143, 0.9));
  display: inline-block;
  vertical-align: middle;
  animation: shine 3s infinite alternate ease-in-out;
  transition: transform 0.3s ease;
}

.bright-diamond:hover {
  transform: scale(1.15) rotate(15deg);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1)) drop-shadow(0 0 30px rgba(42, 157, 143, 1));
}

/* Section Icon Box Styling */
.section-icon-box {
  display: inline-flex;
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: auto;
  height: auto;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  font-size: 2rem;
  line-height: 1;
  vertical-align: middle;
}

.section-icon-box.wheat {
  font-size: 2.15rem;
  animation: sway 4s infinite ease-in-out;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1)) drop-shadow(0 0 15px rgba(233, 163, 25, 0.8));
}

.section-icon-box.sheep {
  animation: bounce 3s infinite ease-in-out;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 1)) drop-shadow(0 0 15px rgba(155, 35, 53, 0.8));
}

@keyframes shine {
  from { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 18px rgba(42, 157, 143, 0.8)); }
  to { filter: drop-shadow(0 0 18px rgba(255, 255, 255, 1)) drop-shadow(0 0 25px rgba(42, 157, 143, 1)); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Custom Preaching Cart Icon */
.icon-preaching-cart-img {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    object-fit: contain;
    /* High compatibility for Retina displays (iPhone) */
    image-rendering: -webkit-optimize-contrast;
}

/* Global Preaching/Turnos Icon Style */
.icon-preaching-cart-img {
    width: 28px !important;
    height: 28px !important;
    filter: invert(0.2) grayscale(1) contrast(200%) !important; /* Soft Black / Antracita con detalle */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    vertical-align: middle;
}

.quick-bubble:hover .icon-preaching-cart-img,
.asig-card:hover .icon-preaching-cart-img {
    filter: invert(0) grayscale(1) contrast(300%) !important; 
    transform: scale(1.1);
}

/* ==============================================
   OFFLINE MODE - Global Styles (PWA 2026)
   ============================================== */
:root {
  --offline-banner-height: 0px;
}

/* Offline Banner (top fixed) */
#offline-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#offline-mode-banner.visible {
  transform: translateY(0);
}

.offline-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.01em;
  text-align: center;
  box-shadow: 0 2px 12px rgba(217, 119, 6, 0.3);
}

.offline-banner-icon {
  font-size: 0.9rem;
  animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Push sticky headers down when offline banner is visible */
body.offline-mode .app-header,
body.offline-mode .tabs-header,
body.offline-mode .mobile-header {
  top: var(--offline-banner-height) !important;
}

body.offline-mode .app-container,
body.offline-mode .app-shell {
  padding-top: var(--offline-banner-height);
}

/* Reconnection Toast (bottom floating) */
#offline-reconnect-toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height, 70px) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 99991;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
  width: calc(100% - 32px);
}

#offline-reconnect-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.reconnect-toast-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: #065f46;
  color: #ecfdf5;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 10px 25px -5px rgba(6, 95, 70, 0.4),
              0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

.reconnect-toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.reconnect-toast-text {
  flex: 1;
  line-height: 1.3;
}

.reconnect-toast-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.reconnect-toast-btn:hover,
.reconnect-toast-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

.reconnect-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  font-family: inherit;
}

.reconnect-toast-close:hover {
  color: white;
}

/* Disable interactive elements when offline */
body.offline-mode form[method="POST"] button[type="submit"],
body.offline-mode form[method="post"] button[type="submit"],
body.offline-mode .btn-premium:not(.mobile-header-save),
body.offline-mode .btn-edit,
body.offline-mode .btn-delete,
body.offline-mode [data-offline-hide] {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}

/* Dark mode overrides for offline components */
.dark-mode .offline-banner-inner {
  background: linear-gradient(135deg, #92400e, #78350f);
}

.dark-mode .reconnect-toast-inner {
  background: #064e3b;
}

/* ──────────────────────────────────────────────────────────────────────────
   PC (Desktop) Optimization Styles (Screens >= 992px)
   ────────────────────────────────────────────────────────────────────────── */
@media (min-width: 992px) {
  /* Center page containers on large screens and allow them to grow wide */
  .app-container,
  .app-shell,
  .form-container,
  .new-request,
  .my-requests,
  .docs-container,
  .groups-container {
    max-width: 1050px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-bottom: calc(var(--bottom-nav-height) + 3rem) !important;
  }

  /* Grid Layouts expansion for PC view */
  .agenda-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .list-view {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
}

@media (min-width: 1200px) {
  .agenda-list {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
