/* ==========================================================================
   CSS Custom Properties / Theme Tokens
   ========================================================================== */
:root {
  --bg-dark: #09090b;
  --bg-gradient-1: rgba(16, 185, 129, 0.08);
  --bg-gradient-2: rgba(59, 130, 246, 0.05);

  --panel-bg: rgba(24, 24, 27, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --subcard-bg: rgba(39, 39, 42, 0.5);
  --subcard-border: rgba(255, 255, 255, 0.06);

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --accent-primary: #10b981;
  --accent-hover: #059669;
  --accent-muted: #f59e0b;
  --accent-blue: #3b82f6;

  --danger: #ef4444;
  --danger-hover: #dc2626;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --logo-filter: brightness(0) invert(1);
  --gauge-track: #27272a;
  --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-subtle: 0 10px 25px -10px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-gradient-1: rgba(16, 185, 129, 0.12);
  --bg-gradient-2: rgba(59, 130, 246, 0.08);

  --panel-bg: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(226, 232, 240, 0.9);
  --subcard-bg: rgba(241, 245, 249, 0.85);
  --subcard-border: rgba(203, 213, 225, 0.7);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-primary: #059669;
  --accent-hover: #047857;
  --accent-muted: #d97706;
  --accent-blue: #2563eb;

  --danger: #dc2626;
  --danger-hover: #b91c1c;

  /* Logo filter in Light Mode: dark black for high contrast on light header */
  --logo-filter: brightness(0);
  --gauge-track: #e2e8f0;
  --shadow-main: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 10px 25px -10px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  width: 100%;
  max-width: 1680px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ==========================================================================
   Glassmorphism Utilities
   ========================================================================== */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-subcard {
  background: var(--subcard-bg);
  border: 1px solid var(--subcard-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* ==========================================================================
   Header & Sync Status
   ========================================================================== */
.app-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  min-height: 80px;
}

.logo-icon {
  position: static;
  transform: none;
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: var(--logo-filter);
  transition: filter 0.3s ease, height 0.3s ease;
}

.logo-title {
  font-size: clamp(1.4rem, 2.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: var(--text-main);
  text-align: center;
  line-height: 1.1;
  transition: color 0.3s ease;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-right-group {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-search {
  width: 200px;
}

.header-search input {
  padding: 6px 10px 6px 32px;
  font-size: 0.8rem;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 400;
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.sync-badge.online .status-dot {
  background: var(--accent-primary);
}

.sync-badge.local .status-dot {
  background: var(--accent-muted);
}

.sync-badge.syncing .status-dot {
  background: var(--accent-blue);
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  color: var(--text-main);
  background: var(--subcard-bg);
  border-color: var(--accent-primary);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

:root:not([data-theme="light"]) .icon-sun { display: block; }
:root:not([data-theme="light"]) .icon-moon { display: none; }

/* Discrete Option Button (Gear / Management Icon) */
.btn-discrete {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
  transition: all 0.2s ease;
}

/* Fullscreen Toggle Button */
.btn-fullscreen {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
  transition: all 0.2s ease;
}

.btn-fullscreen:hover {
  opacity: 1;
  background: var(--subcard-bg);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

.icon-compress { display: none; }
.is-fullscreen .icon-expand { display: none; }
.is-fullscreen .icon-compress { display: block; }

/* Slide Navigation Arrows */
.slide-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.25s ease;
  z-index: 50;
}

.slide-nav-btn:hover {
  opacity: 1;
  background: var(--panel-bg);
  color: var(--text-main);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.prev-btn { left: 16px; }
.next-btn { right: 16px; }

/* Presentation Brand Title (Default / Normal Mode) */
.presentation-brand-title {
  display: none;
}

/* Fullscreen / Slide Presentation Mode Styles */
:fullscreen .app-header,
:fullscreen .church-tabs-wrapper,
:fullscreen .app-footer,
.is-fullscreen .app-header,
.is-fullscreen .church-tabs-wrapper,
.is-fullscreen .app-footer {
  display: none !important;
}

:fullscreen body,
.is-fullscreen body {
  padding: 0;
  overflow-y: auto;
}

:fullscreen .app-container,
.is-fullscreen .app-container {
  max-width: 100vw;
  min-height: 100vh;
  gap: 0;
}

:fullscreen .presentation-layout,
.is-fullscreen .presentation-layout {
  min-height: 100vh;
}

:fullscreen .presentation-card,
.is-fullscreen .presentation-card {
  width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  border-radius: 0;
  border: none;
  padding: 16px 56px 16px 56px;
  justify-content: space-between;
  box-shadow: none;
  background: var(--bg-dark);
  box-sizing: border-box;
  overflow-y: auto;
}

:fullscreen .presentation-brand-title,
.is-fullscreen .presentation-brand-title {
  display: inline-block;
  font-size: clamp(0.85rem, 1.4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 2px;
}

:fullscreen .center-header,
.is-fullscreen .center-header {
  text-align: center;
  width: 100%;
  justify-content: center;
  align-items: center;
}

:fullscreen .center-header > div,
.is-fullscreen .center-header > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

:fullscreen .btn-edit-discrete,
.is-fullscreen .btn-edit-discrete {
  display: none !important;
}

:fullscreen .large-title,
.is-fullscreen .large-title {
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
}

:fullscreen .church-subtitle,
.is-fullscreen .church-subtitle {
  font-size: clamp(0.75rem, 1vw, 1rem);
  margin-top: 2px;
}

:fullscreen .large-gauge-container,
.is-fullscreen .large-gauge-container {
  max-width: 1000px;
  max-height: 38vh;
}

:fullscreen .giant-percentage,
.is-fullscreen .giant-percentage {
  font-size: clamp(3rem, 6vw, 5.5rem);
}

:fullscreen .large-metrics-grid,
.is-fullscreen .large-metrics-grid {
  width: 100%;
  max-width: 1000px;
}

:fullscreen .large-metrics-grid .metric-card,
.is-fullscreen .large-metrics-grid .metric-card {
  padding: 10px 16px;
}

:fullscreen .large-amount,
.is-fullscreen .large-amount {
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

/* ==========================================================================
   Church Selector Tabs
   ========================================================================== */
.church-tabs-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 4px 4px 10px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.church-tabs-wrapper::-webkit-scrollbar {
  height: 5px;
}
.church-tabs-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.church-tabs-wrapper::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 10px;
}
.church-tabs-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.church-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  min-width: 100%;
}

.tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(39, 39, 42, 0.8);
}

.tab-btn.active {
  background: var(--text-main);
  color: var(--bg-dark);
  border-color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 0.72rem;
}

.tab-btn.active .tab-badge {
  background: rgba(0, 0, 0, 0.15);
  color: var(--bg-dark);
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-danger {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-text {
  gap: 6px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--subcard-bg);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
}
.btn-secondary:hover {
  background: rgba(63, 63, 70, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Discrete / Card Edit Button */
.discrete-text-link, .btn-edit-discrete {
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.discrete-text-link:hover, .btn-edit-discrete:hover {
  opacity: 1;
  background: var(--panel-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Presentation Layout (Large Gauge View)
   ========================================================================== */
.presentation-layout {
  display: flex;
  justify-content: center;
  width: 100%;
}

.presentation-card {
  width: 100%;
  max-width: 1600px;
  min-height: 82vh;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  align-items: center;
  justify-content: space-between;
}

.center-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.large-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.large-gauge-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 20px 0;
  flex-grow: 1;
}

.large-gauge-container {
  width: 100%;
  max-width: 1400px;
}

.giant-percentage {
  font-size: 7.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -4px;
  margin-top: 8px;
}

.large-metrics-grid {
  width: 100%;
  max-width: 1300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.large-amount {
  font-size: 2.1rem;
  font-weight: 700;
}

.church-name {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

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

/* ==========================================================================
   SVG Gauge Display (Minimalist Clean)
   ========================================================================== */
.gauge-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  gap: 10px;
}

.gauge-container {
  width: 100%;
  max-width: 380px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.gauge-center-info {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 4px;
}

.percentage-value {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -1px;
}

.percentage-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
}

/* Gauge Needle SVG Transitions & Dynamic Milestone Animation */
.gauge-needle {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tick-text {
  transition: fill 0.3s ease, font-size 0.3s ease, font-weight 0.3s ease;
}

.gauge-tick line {
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

/* ==========================================================================
   Metrics Grid
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 992px) {
  .app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 12px;
    min-height: auto;
  }

  .logo-title {
    font-size: clamp(1.4rem, 4.5vw, 2.2rem);
    white-space: normal;
    word-break: break-word;
  }

  .header-right-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-search {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 600px) {
  .app-header {
    gap: 10px;
    padding: 10px 8px;
  }

  .logo-icon {
    height: 48px;
  }

  .logo-title {
    font-size: clamp(1.2rem, 5.5vw, 1.8rem);
    letter-spacing: -0.5px;
  }

  .header-right-group {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .header-search {
    width: 100%;
    max-width: 100%;
  }

  .metrics-grid, .large-metrics-grid {
    grid-template-columns: 1fr;
  }

  .presentation-card {
    padding: 20px 16px;
  }

  .giant-percentage {
    font-size: 3.2rem;
  }
}

@media (max-width: 768px) {
  :fullscreen .presentation-card,
  .is-fullscreen .presentation-card {
    padding: 16px 20px 12px 20px;
  }

  :fullscreen .large-title,
  .is-fullscreen .large-title {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
  }

  :fullscreen .presentation-brand-title,
  .is-fullscreen .presentation-brand-title {
    font-size: clamp(0.85rem, 3.2vw, 1.2rem);
    letter-spacing: 2px;
  }

  :fullscreen .giant-percentage,
  .is-fullscreen .giant-percentage {
    font-size: clamp(3rem, 10vw, 4.5rem);
  }

  :fullscreen .large-gauge-container,
  .is-fullscreen .large-gauge-container {
    max-height: 38vh;
  }

  .slide-nav-btn {
    width: 40px;
    height: 40px;
  }
  .prev-btn { left: 8px; }
  .next-btn { right: 8px; }
}

@media (max-height: 700px) {
  :fullscreen .presentation-card,
  .is-fullscreen .presentation-card {
    padding: 12px 48px 10px 48px;
  }

  :fullscreen .large-title,
  .is-fullscreen .large-title {
    font-size: clamp(1.6rem, 4.5vh, 2.6rem);
  }

  :fullscreen .church-subtitle,
  .is-fullscreen .church-subtitle {
    display: none;
  }

  :fullscreen .large-gauge-container,
  .is-fullscreen .large-gauge-container {
    max-height: 40vh;
  }
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.highlight-subcard {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.03);
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.target-icon {
  background: rgba(113, 113, 122, 0.15);
  color: var(--text-muted);
}

.collected-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.metric-amount {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.accent-text {
  color: var(--accent-primary);
}

/* ==========================================================================
   Search Box
   ========================================================================== */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 36px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ==========================================================================
   Management Side Drawer / Overlay
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}

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

.drawer-card {
  width: 100%;
  max-width: 480px;
  height: 100%;
  border-radius: 0;
  border-left: 1px solid var(--panel-border);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

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

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 16px;
}

.drawer-title-group h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.drawer-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.drawer-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.churches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.church-item-card {
  padding: 12px 14px;
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.church-item-card:hover {
  border-color: #3f3f46;
}

.church-item-card.active {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.04);
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 500;
}

.item-pct {
  color: var(--accent-primary);
  font-weight: 600;
}

.item-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.item-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.item-numbers {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.item-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.item-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   Footer & Modal
   ========================================================================== */
.app-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 8px 0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

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

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close:hover {
  color: var(--text-main);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input {
  background: var(--subcard-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.target-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.target-input-wrapper input {
  width: 100%;
  padding-right: 44px;
}

.input-locked {
  background: rgba(255, 255, 255, 0.04) !important;
  cursor: not-allowed;
  opacity: 0.85;
}

.input-unlocked {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.btn-lock-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-lock-toggle:hover {
  color: var(--accent-gold, #f59e0b);
  background: rgba(255, 255, 255, 0.08);
}

.btn-lock-toggle.unlocked {
  color: var(--accent-primary, #10b981);
}

.unlock-code-container {
  margin-top: 6px;
  transition: all 0.3s ease;
}

.unlock-code-container.hidden {
  display: none;
}

.input-unlock-code {
  width: 100%;
  font-size: 0.85rem !important;
  padding: 8px 12px !important;
  border-color: var(--accent-gold, #f59e0b) !important;
  background: rgba(245, 158, 11, 0.05) !important;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.modal-right-actions {
  display: flex;
  gap: 10px;
}
