/* ==========================================================
   Galveston Chinese Church - Design System & Styling Tokens
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-chinese: 'Noto Sans SC', 'Plus Jakarta Sans', sans-serif;

  --bg-primary: #070a12;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-glass: rgba(15, 23, 42, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --accent-crimson: #ef4444;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-glass: 0 16px 40px -10px rgba(0, 0, 0, 0.55), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.18);
}

/* Light Theme Color Tokens (Eye-Comfort, Glare-Free, WCAG AAA Contrast) */
[data-theme="light"] {
  --bg-primary: #edf2f7;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.98);
  --border-subtle: #cbd5e1;
  --border-focus: #1d4ed8;

  --accent-gold: #b45309;
  --accent-blue: #1d4ed8;
  --accent-teal: #0f766e;
  --accent-crimson: #b91c1c;
  --accent-emerald: #047857;
  --accent-indigo: #4338ca;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #4b5563;

  --shadow-glass: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 16px rgba(29, 78, 216, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, .glass-panel, .glass-card, input, select, textarea, .nav-tab, .filter-pill, .modal-content, table, th, td, .login-card-elevated, .wysiwyg-canvas {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(30, 58, 138, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(13, 148, 136, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.4) 0%, transparent 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: 1.75rem 2rem;
}

.glass-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  transition: all 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

/* Utilities */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.85rem 1.15rem; }
.p-4 { padding: 1.25rem 1.5rem; }
.p-5 { padding: 1.6rem 1.85rem; }
.p-6 { padding: 2rem 2.35rem; }
.p-8 { padding: 2.5rem 3rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.85rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  color: var(--text-primary);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.7);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(71, 85, 105, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: var(--accent-gold);
  color: #fff;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: var(--accent-emerald);
  color: #fff;
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #047857, #065f46);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.825rem;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sending {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: none;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

.template-card-tag-pill {
  transition: all 0.15s ease-in-out;
}

.template-card-tag-pill:hover {
  background: rgba(99, 102, 241, 0.35) !important;
  color: #ffffff !important;
  border-color: rgba(99, 102, 241, 0.6) !important;
  transform: translateY(-1px);
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(13, 148, 136, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Quick Filter Pills */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease-in-out;
}

.filter-pill:hover {
  color: var(--text-primary);
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(13, 148, 136, 0.25));
  border-color: #3b82f6;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.filter-pill .pill-count {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.filter-pill.active .pill-count {
  background: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* Table Styling */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.65);
}

.table-container::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.75);
}

table.gcc-data-table, .table-container table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  table-layout: auto;
}

table.gcc-data-table th,
.table-container th {
  background: rgba(30, 41, 59, 0.95);
  padding: 0.75rem 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}

table.gcc-data-table td,
.table-container td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  line-height: 1.4;
}

table.gcc-data-table tr:hover td,
.table-container tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

table.gcc-data-table tr.row-selected td,
.table-container tr.row-selected td {
  background: rgba(2, 132, 199, 0.08);
}

table.gcc-data-table tr.row-selected:hover td,
.table-container tr.row-selected:hover td {
  background: rgba(2, 132, 199, 0.15);
}

/* Smart Column Layout Tokens */
.col-select {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding: 0.65rem 0.5rem;
}

.col-select input[type="checkbox"],
input[type="checkbox"].row-select-checkbox,
input[type="checkbox"]#masterSelectCheckbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0284c7;
  vertical-align: middle;
  border-radius: 4px;
}

.col-index {
  width: 42px;
  min-width: 42px;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
}

.col-name {
  min-width: 90px;
  max-width: 130px;
  white-space: nowrap;
  font-weight: 600;
  color: #f8fafc;
}

.col-email {
  min-width: 160px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #93c5fd;
}

.col-group {
  min-width: 130px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
}

.col-prayer {
  min-width: 180px;
  max-width: 280px;
  line-height: 1.35;
  font-size: 0.8rem;
  word-break: break-word;
  color: #cbd5e1;
}

.col-lang {
  min-width: 130px;
  white-space: nowrap;
  font-size: 0.8rem;
}

.col-status {
  min-width: 110px;
  text-align: center;
  white-space: nowrap;
}

.col-timestamp {
  min-width: 130px;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

.col-actions {
  width: 90px;
  min-width: 90px;
  text-align: right;
  white-space: nowrap;
}

/* App Header Responsiveness */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.app-header-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  body {
    padding: 0.75rem !important;
  }
  
  .glass-panel {
    padding: 1.25rem !important;
    border-radius: var(--radius-md) !important;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .app-header-meta, .app-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .app-header-actions > * {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .grid-controls-stack {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .grid-controls-stack input {
    max-width: 100% !important;
    width: 100% !important;
  }

  .grid-filter-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap !important;
  }

  .grid-filter-scroll button {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .modal-content {
    margin: 1rem;
    padding: 1.25rem !important;
    width: 94vw !important;
  }
}

.grid-responsive-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .grid-responsive-2col {
    grid-template-columns: 1fr;
  }
}

/* Modals (Refined Spacious Layout & Deep Elevation) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem 2.5rem !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 2rem 2.25rem !important;
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.75);
}

/* Tag Pill Inserts */
.tag-pill-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  background: rgba(37, 99, 235, 0.15);
  border: 1px dashed rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-pill-btn:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: #60a5fa;
  color: #fff;
}

/* ==========================================================
   Modern Login & Auth Interface Styles
   ========================================================== */

.login-page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  position: relative;
}

.login-card-elevated {
  width: 100%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.login-card-elevated::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), rgba(16, 185, 129, 0.6), transparent);
}

.church-crest-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(145deg, #1e3a8a 0%, #0d9488 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.church-title-en {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.church-title-zh {
  font-family: var(--font-chinese);
  font-size: 1.05rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.church-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Alert Banner */
.login-alert-banner {
  display: none;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  animation: bannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Google SSO Button */
.btn-google-sso {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
}

.btn-google-sso:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-google-sso:active {
  transform: translateY(1px);
}

.btn-google-sso:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

/* Divider */
.login-divider {
  position: relative;
  text-align: center;
  margin: 1.75rem 0 1.25rem;
}

.login-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.login-divider span {
  position: relative;
  background: #0f172a;
  padding: 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Leadership Roster Section & Switcher */
.login-roster-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.roster-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
}

.roster-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.roster-card:focus-visible {
  outline: 2px solid var(--accent-indigo);
  outline-offset: 2px;
}

.roster-card.selected {
  background: rgba(30, 58, 138, 0.4) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 1px #38bdf8, 0 4px 14px rgba(56, 189, 248, 0.2) !important;
}

.leader-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #93c5fd;
  flex-shrink: 0;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.trust-item i {
  color: #60a5fa;
  width: 16px;
  height: 16px;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 400px;
  width: calc(100vw - 2.5rem);
  pointer-events: none;
}

.toast-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(30px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.toast-card.toast-show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast-card.toast-hide {
  opacity: 0;
  transform: translateX(40px) scale(0.9);
}

.toast-icon-wrapper {
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.toast-message {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

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

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  animation: toastCountdown linear forwards;
}

@keyframes toastCountdown {
  from { width: 100%; }
  to { width: 0%; }
}

/* Toast Type Variations */
.toast-success {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.95), rgba(15, 23, 42, 0.95));
}
.toast-success .toast-progress-bar {
  background: #34d399;
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.95), rgba(15, 23, 42, 0.95));
}
.toast-error .toast-progress-bar {
  background: #f87171;
}

.toast-warning {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.95), rgba(15, 23, 42, 0.95));
}
.toast-warning .toast-progress-bar {
  background: #fbbf24;
}

.toast-info {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(12, 74, 110, 0.95), rgba(15, 23, 42, 0.95));
}
.toast-info .toast-progress-bar {
  background: #38bdf8;
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(-8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@media (max-width: 640px) {
  .login-card-elevated {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .church-title-en {
    font-size: 1.3rem;
  }
  .trust-strip {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .trust-item {
    flex-direction: row;
    text-align: left;
    gap: 0.5rem;
  }
}

/* ==================== WYSIWYG RICH TEXT EDITOR ==================== */
.wysiwyg-toolbar {
  user-select: none;
}

.wysiwyg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.wysiwyg-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.wysiwyg-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.wysiwyg-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.2rem;
}

.wysiwyg-color-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.wysiwyg-color-label:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* WYSIWYG Editable Surface */
.wysiwyg-canvas {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 0.975rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  text-align: left;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.7);
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wysiwyg-canvas:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 1px #38bdf8, 0 8px 24px rgba(0, 0, 0, 0.3);
}

.wysiwyg-canvas p,
.wysiwyg-canvas div:not([style*="margin"]):not([class]):not(.table-container) {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.wysiwyg-canvas p:last-child,
.wysiwyg-canvas div:not([style*="margin"]):not([class]):not(.table-container):last-child {
  margin-bottom: 0;
}

.wysiwyg-canvas br {
  line-height: 1.8;
}

/* Precise Icon Alignment with Text in Live Editor */
.wysiwyg-canvas i[data-lucide],
.wysiwyg-canvas svg.lucide,
.wysiwyg-canvas svg {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2;
  flex-shrink: 0;
}

.wysiwyg-canvas h1 svg, .wysiwyg-canvas h1 i[data-lucide],
.wysiwyg-canvas h2 svg, .wysiwyg-canvas h2 i[data-lucide],
.wysiwyg-canvas h3 svg, .wysiwyg-canvas h3 i[data-lucide],
.wysiwyg-canvas h4 svg, .wysiwyg-canvas h4 i[data-lucide] {
  vertical-align: -0.18em;
  margin-right: 0.35em;
}

.wysiwyg-canvas strong,
.wysiwyg-canvas b {
  font-weight: 700;
  color: inherit;
}

.wysiwyg-canvas em,
.wysiwyg-canvas i {
  font-style: italic;
  color: inherit;
}

.wysiwyg-canvas u {
  text-decoration: underline;
  color: inherit;
}

.wysiwyg-canvas s,
.wysiwyg-canvas strike,
.wysiwyg-canvas del {
  text-decoration: line-through;
  color: inherit;
}

.wysiwyg-canvas mark {
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background-color: #fef08a;
  color: #854d0e;
}

.wysiwyg-canvas h1,
.wysiwyg-canvas h2,
.wysiwyg-canvas h3,
.wysiwyg-canvas h4,
.wysiwyg-canvas h5,
.wysiwyg-canvas h6 {
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  color: inherit;
}

.wysiwyg-canvas h1:not([style*="color"]),
.wysiwyg-canvas h2:not([style*="color"]),
.wysiwyg-canvas h3:not([style*="color"]),
.wysiwyg-canvas h4:not([style*="color"]) {
  color: #f8fafc;
}

.wysiwyg-canvas h1 { font-size: 1.45rem; }
.wysiwyg-canvas h2 { font-size: 1.25rem; }
.wysiwyg-canvas h3 { font-size: 1.125rem; }
.wysiwyg-canvas h4 { font-size: 1.025rem; }

.wysiwyg-canvas blockquote {
  border-left: 4px solid #0284c7;
  padding: 0.75rem 1.15rem;
  margin: 1rem 0;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 8px 8px 0;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.7;
}

.wysiwyg-canvas ul,
.wysiwyg-canvas ol {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 1.75rem;
}

.wysiwyg-canvas li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.wysiwyg-canvas a {
  text-decoration: underline;
  word-break: break-all;
  font-weight: 500;
}

.wysiwyg-canvas a:not([style*="color"]) {
  color: #38bdf8;
}

.wysiwyg-canvas a:hover {
  color: #7dd3fc;
}

.wysiwyg-canvas hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 1.5rem 0;
}

.wysiwyg-canvas img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.75rem 0;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Content Tables in Live Editor & Email Previewer */
.wysiwyg-canvas table,
#previewEmailBody table {
  border-collapse: collapse;
  margin: 1rem 0;
  max-width: 100%;
  font-size: 0.925rem;
}

.wysiwyg-canvas table:not([style*="width"]):not([width]),
#previewEmailBody table:not([style*="width"]):not([width]) {
  width: 100%;
}

.wysiwyg-canvas th,
.wysiwyg-canvas td,
#previewEmailBody th,
#previewEmailBody td {
  vertical-align: middle;
  line-height: 1.5;
}

/* Paragraphs inside table cells should not bloat table row height */
.wysiwyg-canvas td p,
.wysiwyg-canvas th p,
#previewEmailBody td p,
#previewEmailBody th p {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: inherit;
}

.wysiwyg-canvas td p:last-child,
.wysiwyg-canvas th p:last-child,
#previewEmailBody td p:last-child,
#previewEmailBody th p:last-child {
  margin-bottom: 0;
}

/* Default border when table does not have border="0" */
.wysiwyg-canvas table:not([border="0"]) th,
.wysiwyg-canvas table:not([border="0"]) td,
#previewEmailBody table:not([border="0"]) th,
#previewEmailBody table:not([border="0"]) td {
  border: 1px solid #cbd5e1;
}

.wysiwyg-canvas table:not([border="0"]) th:not([style*="background"]):not([bgcolor]),
#previewEmailBody table:not([border="0"]) th:not([style*="background"]):not([bgcolor]) {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}

/* Default cell padding only when not specified by table or inline style */
.wysiwyg-canvas table:not([cellpadding]) th:not([style*="padding"]),
.wysiwyg-canvas table:not([cellpadding]) td:not([style*="padding"]),
#previewEmailBody table:not([cellpadding]) th:not([style*="padding"]),
#previewEmailBody table:not([cellpadding]) td:not([style*="padding"]) {
  padding: 0.65rem 0.9rem;
}

.wysiwyg-canvas table[cellpadding="0"] th:not([style*="padding"]),
.wysiwyg-canvas table[cellpadding="0"] td:not([style*="padding"]),
#previewEmailBody table[cellpadding="0"] th:not([style*="padding"]),
#previewEmailBody table[cellpadding="0"] td:not([style*="padding"]) {
  padding: 0;
}

/* HTML Table Alignment (Horizontally positioning the table on the page) */
.wysiwyg-canvas table[align="center"],
#previewEmailBody table[align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.wysiwyg-canvas table[align="right"],
#previewEmailBody table[align="right"] {
  margin-left: auto;
  margin-right: 0;
}

.wysiwyg-canvas table[align="left"],
#previewEmailBody table[align="left"] {
  margin-left: 0;
  margin-right: auto;
}

/* HTML Content Text Alignment Attributes */
.wysiwyg-canvas td[align="center"],
.wysiwyg-canvas th[align="center"],
.wysiwyg-canvas p[align="center"],
.wysiwyg-canvas div[align="center"],
.wysiwyg-canvas h1[align="center"],
.wysiwyg-canvas h2[align="center"],
.wysiwyg-canvas h3[align="center"],
.wysiwyg-canvas h4[align="center"],
.wysiwyg-canvas center,
#previewEmailBody td[align="center"],
#previewEmailBody th[align="center"],
#previewEmailBody p[align="center"],
#previewEmailBody div[align="center"],
#previewEmailBody h1[align="center"],
#previewEmailBody h2[align="center"],
#previewEmailBody h3[align="center"],
#previewEmailBody h4[align="center"],
#previewEmailBody center {
  text-align: center;
}

.wysiwyg-canvas td[align="right"],
.wysiwyg-canvas th[align="right"],
.wysiwyg-canvas p[align="right"],
.wysiwyg-canvas div[align="right"],
.wysiwyg-canvas h1[align="right"],
.wysiwyg-canvas h2[align="right"],
.wysiwyg-canvas h3[align="right"],
.wysiwyg-canvas h4[align="right"],
#previewEmailBody td[align="right"],
#previewEmailBody th[align="right"],
#previewEmailBody p[align="right"],
#previewEmailBody div[align="right"],
#previewEmailBody h1[align="right"],
#previewEmailBody h2[align="right"],
#previewEmailBody h3[align="right"],
#previewEmailBody h4[align="right"] {
  text-align: right;
}

.wysiwyg-canvas td[align="left"],
.wysiwyg-canvas th[align="left"],
.wysiwyg-canvas p[align="left"],
.wysiwyg-canvas div[align="left"],
.wysiwyg-canvas h1[align="left"],
.wysiwyg-canvas h2[align="left"],
.wysiwyg-canvas h3[align="left"],
.wysiwyg-canvas h4[align="left"],
#previewEmailBody td[align="left"],
#previewEmailBody th[align="left"],
#previewEmailBody p[align="left"],
#previewEmailBody div[align="left"],
#previewEmailBody h1[align="left"],
#previewEmailBody h2[align="left"],
#previewEmailBody h3[align="left"],
#previewEmailBody h4[align="left"] {
  text-align: left;
}

.wysiwyg-canvas td[align="justify"],
.wysiwyg-canvas th[align="justify"],
.wysiwyg-canvas p[align="justify"],
.wysiwyg-canvas div[align="justify"],
#previewEmailBody td[align="justify"],
#previewEmailBody th[align="justify"],
#previewEmailBody p[align="justify"],
#previewEmailBody div[align="justify"] {
  text-align: justify;
}

.wysiwyg-canvas td[valign="top"],
.wysiwyg-canvas th[valign="top"],
#previewEmailBody td[valign="top"],
#previewEmailBody th[valign="top"] {
  vertical-align: top;
}

.wysiwyg-canvas td[valign="middle"],
.wysiwyg-canvas th[valign="middle"],
#previewEmailBody td[valign="middle"],
#previewEmailBody th[valign="middle"] {
  vertical-align: middle;
}

.wysiwyg-canvas td[valign="bottom"],
.wysiwyg-canvas th[valign="bottom"],
#previewEmailBody td[valign="bottom"],
#previewEmailBody th[valign="bottom"] {
  vertical-align: bottom;
}

/* Dark mode default table styling */
[data-theme="dark"] .wysiwyg-canvas table:not([border="0"]) th:not([style*="border"]),
[data-theme="dark"] .wysiwyg-canvas table:not([border="0"]) td:not([style*="border"]) {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .wysiwyg-canvas table:not([border="0"]) th:not([style*="background"]):not([bgcolor]) {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
}

/* WYSIWYG Raw HTML Source Textarea */
.wysiwyg-source-textarea {
  width: 100%;
  min-height: 280px;
  max-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1.25rem 1.5rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.wysiwyg-source-textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 1px #38bdf8, 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Attachment Chips */
.attachment-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: #f8fafc;
  transition: all 0.15s ease;
}

.attachment-card:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
}

.attachment-card-remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.2rem;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.attachment-card-remove:hover {
  color: #f87171;
}

/* ==========================================================
   Comprehensive Eye-Comfort Light Theme Design System
   ========================================================== */

[data-theme="light"] body {
  background-color: #edf2f7;
  color: #111827;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(29, 78, 216, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(15, 118, 110, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(237, 242, 247, 0.9) 0%, transparent 100%);
}

/* Glass Panels & Cards in Light Mode */
[data-theme="light"] .glass-panel {
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glass-card {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glass-card:hover {
  border-color: #9ca3af;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Generic Structural Strips & Containers in Light Mode */
[data-theme="light"] div[style*="background: rgba(15, 23, 42"] {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
}

[data-theme="light"] div[style*="background: rgba(30, 41, 59"] {
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
}

[data-theme="light"] span[style*="color: #f8fafc"]:not(#previewEmailBody *),
[data-theme="light"] span[style*="color: #cbd5e1"]:not(#previewEmailBody *),
[data-theme="light"] div[style*="color: #f8fafc"]:not(#previewEmailBody *) {
  color: #111827 !important;
}

[data-theme="light"] span[style*="color: #94a3b8"]:not(#previewEmailBody *) {
  color: #374151 !important;
}

[data-theme="light"] div[style*="color: #94a3b8"]:not(#previewEmailBody *),
[data-theme="light"] p[style*="color: #94a3b8"]:not(#previewEmailBody *),
[data-theme="light"] label[style*="color: #94a3b8"]:not(#previewEmailBody *) {
  color: #374151 !important;
}

[data-theme="light"] h1:not(#previewEmailBody *),
[data-theme="light"] h2:not(#previewEmailBody *),
[data-theme="light"] h3:not(#previewEmailBody *),
[data-theme="light"] h4:not(#previewEmailBody *) {
  color: #111827 !important;
}

/* Table in Light Mode */
[data-theme="light"] .table-container {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] table.gcc-data-table {
  background: #ffffff !important;
}

[data-theme="light"] table.gcc-data-table th,
[data-theme="light"] .table-container th {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-bottom: 2px solid #94a3b8 !important;
  font-weight: 700 !important;
}

[data-theme="light"] table.gcc-data-table td,
[data-theme="light"] .table-container td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  background-color: transparent;
}

/* Force high contrast text on any text element inside table cells */
[data-theme="light"] table.gcc-data-table td span:not(.badge):not(.tag-pill-btn),
[data-theme="light"] .table-container td span:not(.badge):not(.tag-pill-btn) {
  color: inherit !important;
}

[data-theme="light"] table.gcc-data-table tr:hover td,
[data-theme="light"] .table-container tr:hover td {
  background-color: #f1f5f9 !important;
}

[data-theme="light"] table.gcc-data-table tr.row-selected td,
[data-theme="light"] .table-container tr.row-selected td {
  background-color: #dbeafe !important;
  color: #1e3a8a !important;
}

[data-theme="light"] table.gcc-data-table tr.row-selected:hover td,
[data-theme="light"] .table-container tr.row-selected:hover td {
  background-color: #bfdbfe !important;
}

[data-theme="light"] .col-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .col-email {
  color: #1d4ed8 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .col-index {
  color: #475569 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .col-prayer,
[data-theme="light"] .col-lang,
[data-theme="light"] .col-timestamp {
  color: #334155 !important;
}

[data-theme="light"] .editable-cell:hover {
  background-color: #e2e8f0 !important;
  outline: 1px dashed #1d4ed8 !important;
}

/* Form Inputs in Light Mode */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff;
  border: 1px solid #9ca3af;
  color: #111827;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #6b7280;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

/* Buttons in Light Mode */
[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border: 1px solid #9ca3af;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .btn-secondary:hover {
  background: #f3f4f6;
  border-color: #6b7280;
  color: #111827;
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #172554);
}

[data-theme="light"] .btn-emerald {
  background: linear-gradient(135deg, #047857, #065f46);
  border-color: #047857;
  color: #ffffff;
}

[data-theme="light"] .btn-gold {
  background: linear-gradient(135deg, #b45309, #92400e);
  border-color: #b45309;
  color: #ffffff;
}

/* Navigation Tabs in Light Mode */
[data-theme="light"] .nav-tab {
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  color: #374151;
}

[data-theme="light"] .nav-tab:hover {
  background: #d1d5db;
  color: #111827;
}

[data-theme="light"] .nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  border-color: #1d4ed8;
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.22);
}

/* Filter Pills in Light Mode */
[data-theme="light"] .filter-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .filter-pill:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

[data-theme="light"] .filter-pill.active {
  background: #dbeafe;
  border-color: #1d4ed8;
  color: #1e40af;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(29, 78, 216, 0.15);
}

[data-theme="light"] .filter-pill .pill-count {
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
}

[data-theme="light"] .filter-pill.active .pill-count {
  background: #1d4ed8;
  color: #ffffff;
}

/* Badges in Light Mode */
[data-theme="light"] .badge-tag {
  background: #e0e7ff;
  color: #312e81;
  border: 1px solid #c7d2fe;
  font-weight: 600;
}

[data-theme="light"] .badge-pending {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
  font-weight: 700;
}

[data-theme="light"] .badge-delivered {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
  font-weight: 700;
}

[data-theme="light"] .badge-sending {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

[data-theme="light"] .badge-failed {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
  font-weight: 700;
}

/* Modals in Light Mode (Eye-Comfort Subtle Neutral Surface, Non-Glare, High Contrast) */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .modal-content,
[data-theme="light"] .modal-card {
  background: #f4f6f9 !important; /* Subtle soothing neutral surface, avoiding harsh pure white glare */
  color: #111827 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.22), 0 0 1px 1px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .modal-content h1,
[data-theme="light"] .modal-content h2,
[data-theme="light"] .modal-content h3,
[data-theme="light"] .modal-content h4,
[data-theme="light"] .modal-card h1,
[data-theme="light"] .modal-card h2,
[data-theme="light"] .modal-card h3,
[data-theme="light"] .modal-card h4 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .modal-content label,
[data-theme="light"] .modal-card label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

[data-theme="light"] .modal-content p,
[data-theme="light"] .modal-content span:not(.badge):not(.tag-pill-btn),
[data-theme="light"] .modal-card p,
[data-theme="light"] .modal-card span:not(.badge):not(.tag-pill-btn) {
  color: #334155 !important;
}

[data-theme="light"] .modal-content input,
[data-theme="light"] .modal-content select,
[data-theme="light"] .modal-content textarea,
[data-theme="light"] .modal-card input {
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
  color: #0f172a !important;
  font-weight: 500 !important;
  padding: 0.75rem 1rem !important;
}

[data-theme="light"] .modal-content input:focus,
[data-theme="light"] .modal-content select:focus,
[data-theme="light"] .modal-content textarea:focus,
[data-theme="light"] .modal-card input:focus {
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2) !important;
}

[data-theme="light"] .modal-content input::placeholder,
[data-theme="light"] .modal-card input::placeholder {
  color: #64748b !important;
}

[data-theme="light"] .modal-content select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] #columnListContainer > div,
[data-theme="light"] #versionListContainer > div,
[data-theme="light"] #driveFileListContainer > div {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
  padding: 0.85rem 1.15rem !important;
}

/* Tag Pill Inserts */
[data-theme="light"] .tag-pill-btn {
  background: #eff6ff;
  border: 1px dashed #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}

[data-theme="light"] .tag-pill-btn:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
  color: #1e40af;
}

/* WYSIWYG Editor in Light Mode */
[data-theme="light"] .wysiwyg-toolbar {
  background: #f3f4f6 !important;
  border: 1px solid #d1d5db !important;
  border-bottom: none !important;
}

[data-theme="light"] #wysiwygBlockSelect {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #111827 !important;
}

[data-theme="light"] .wysiwyg-btn,
[data-theme="light"] .wysiwyg-color-label {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #1f2937;
}

[data-theme="light"] .wysiwyg-btn:hover,
[data-theme="light"] .wysiwyg-color-label:hover {
  background: #e0f2fe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

[data-theme="light"] .wysiwyg-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

[data-theme="light"] .wysiwyg-divider {
  background: #d1d5db;
}

[data-theme="light"] .wysiwyg-canvas {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #d1d5db;
}

[data-theme="light"] .wysiwyg-canvas h1:not([style*="color"]),
[data-theme="light"] .wysiwyg-canvas h2:not([style*="color"]),
[data-theme="light"] .wysiwyg-canvas h3:not([style*="color"]),
[data-theme="light"] .wysiwyg-canvas h4:not([style*="color"]) {
  color: #0f172a;
}

[data-theme="light"] .wysiwyg-canvas a:not([style*="color"]) {
  color: #0284c7;
}

[data-theme="light"] .wysiwyg-canvas a:hover {
  color: #0369a1;
}

[data-theme="light"] .wysiwyg-canvas blockquote {
  background: #f8fafc;
  color: #334155;
  border-left-color: #0284c7;
}

[data-theme="light"] .wysiwyg-canvas hr {
  border-top-color: #e2e8f0;
}

[data-theme="light"] .wysiwyg-canvas th,
[data-theme="light"] .wysiwyg-canvas td {
  border-color: #cbd5e1;
}

[data-theme="light"] .wysiwyg-canvas th {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .wysiwyg-source-textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .wysiwyg-source-textarea:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 1px #0284c7, 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Attachment Chips in Light Mode */
[data-theme="light"] .attachment-card {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #111827;
}

[data-theme="light"] .attachment-card:hover {
  background: #e0f2fe;
  border-color: #93c5fd;
}

/* Header & Banner Elements in Light Mode */
[data-theme="light"] #driveAssetsSummaryStrip {
  background: #ffffff !important;
  border-color: #d1d5db !important;
}

[data-theme="light"] #driveAssetsSummaryStrip div,
[data-theme="light"] #driveAssetsSummaryStrip span,
[data-theme="light"] #driveAssetsSummaryStrip strong {
  color: #111827 !important;
}

[data-theme="light"] #workspaceModeBanner {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="light"] #workspaceModeBanner span,
[data-theme="light"] #workspaceModeBanner code {
  color: #065f46 !important;
}

/* Login Page & Authorized Leadership Roster in Light Mode */
[data-theme="light"] .login-card-elevated {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .church-title-en {
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="light"] .church-title-zh {
  color: #1e293b !important;
  font-weight: 700 !important;
}

[data-theme="light"] .church-subtitle {
  color: #475569 !important;
}

/* Authorized Leadership Roster Section in Light Mode */
[data-theme="light"] .login-roster-section {
  background: #f4f6f9 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .roster-heading-title {
  color: #334155 !important;
  font-weight: 700 !important;
}

/* Individual Roster Cards in Light Mode */
[data-theme="light"] .roster-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .roster-card:hover {
  background: #f0f7ff !important;
  border-color: #3b82f6 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12) !important;
}

[data-theme="light"] .roster-card.selected {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="light"] .roster-card .leader-avatar-circle {
  background: linear-gradient(135deg, #dbeafe, #ccfbf1) !important;
  border: 1px solid #93c5fd !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .roster-card .leader-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .roster-card .leader-email {
  color: #475569 !important;
  font-weight: 500 !important;
}

[data-theme="light"] .login-divider::before {
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent) !important;
}

[data-theme="light"] .login-divider span {
  background: #ffffff !important;
  color: #64748b !important;
}

[data-theme="light"] .trust-strip {
  border-top-color: #e2e8f0 !important;
}

[data-theme="light"] .trust-item span {
  color: #334155 !important;
}

[data-theme="light"] .trust-item i {
  color: #1d4ed8 !important;
}



/* L-3: Responsive button group classes (replacing invalid inline sm: syntax) */
@media (min-width: 640px) {
  .responsive-btn-group {
    width: auto;
  }
  .responsive-flex-initial {
    flex: initial;
  }
}

/* ==========================================================================
   Email Previewer Rich Typography & Formatted HTML Styles
   ========================================================================== */
#previewEmailBody {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.8;
  font-size: 0.975rem;
  letter-spacing: 0.01em;
  text-align: left;
  color: #1e293b;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#previewEmailBody p,
#previewEmailBody div:not([style*="margin"]):not([class]):not(.table-container) {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.8;
}

#previewEmailBody p:last-child,
#previewEmailBody div:not([style*="margin"]):not([class]):not(.table-container):last-child {
  margin-bottom: 0;
}

#previewEmailBody br {
  line-height: 1.8;
}

/* Precise Icon Alignment with Text in Previewer */
#previewEmailBody i[data-lucide],
#previewEmailBody svg.lucide,
#previewEmailBody svg {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1.15em;
  height: 1.15em;
  stroke-width: 2;
  flex-shrink: 0;
}

#previewEmailBody h1 svg, #previewEmailBody h1 i[data-lucide],
#previewEmailBody h2 svg, #previewEmailBody h2 i[data-lucide],
#previewEmailBody h3 svg, #previewEmailBody h3 i[data-lucide],
#previewEmailBody h4 svg, #previewEmailBody h4 i[data-lucide] {
  vertical-align: -0.18em;
  margin-right: 0.35em;
}

#previewEmailBody strong,
#previewEmailBody b {
  font-weight: 700;
  color: inherit;
}

#previewEmailBody em,
#previewEmailBody i {
  font-style: italic;
  color: inherit;
}

#previewEmailBody u {
  text-decoration: underline;
  color: inherit;
}

#previewEmailBody s,
#previewEmailBody strike,
#previewEmailBody del {
  text-decoration: line-through;
  color: inherit;
}

#previewEmailBody mark {
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

#previewEmailBody h1,
#previewEmailBody h2,
#previewEmailBody h3,
#previewEmailBody h4,
#previewEmailBody h5,
#previewEmailBody h6 {
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  color: inherit;
}

[data-theme="light"] #previewEmailBody h1:not([style*="color"]),
[data-theme="light"] #previewEmailBody h2:not([style*="color"]),
[data-theme="light"] #previewEmailBody h3:not([style*="color"]),
[data-theme="light"] #previewEmailBody h4:not([style*="color"]) {
  color: #0f172a !important;
}

#previewEmailBody h1 { font-size: 1.45rem; }
#previewEmailBody h2 { font-size: 1.25rem; }
#previewEmailBody h3 { font-size: 1.125rem; }
#previewEmailBody h4 { font-size: 1.025rem; }

#previewEmailBody a {
  color: #0284c7;
  text-decoration: underline;
  word-break: break-all;
  font-weight: 500;
}

#previewEmailBody a:hover {
  color: #0369a1;
}

#previewEmailBody ul,
#previewEmailBody ol {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-left: 1.75rem;
}

#previewEmailBody li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

#previewEmailBody blockquote {
  border-left: 4px solid #0284c7;
  margin: 1rem 0;
  padding: 0.75rem 1.15rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  color: #334155;
  font-style: italic;
  line-height: 1.7;
}

#previewEmailBody img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.75rem 0;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#previewEmailBody hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

