:root {
  /* Core Theme Colors */
  --bg-main: #F8FAFC; /* Light Gray */
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #FFFFFF;
  
  --border-subtle: #E2E8F0;
  --border-focus: rgba(0, 200, 150, 0.5);
  --border-active: rgba(0, 200, 150, 0.3);
  
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  
  /* Brand Colors */
  --primary-color: #00C896; /* Teal */
  --primary-gradient: linear-gradient(135deg, #00C896 0%, #00A67C 100%);
  --primary-hover: linear-gradient(135deg, #00A67C 0%, #008A66 100%);
  --success-gradient: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #1E293B;
  --sidebar-border: #E2E8F0;
  --sidebar-hover: #F1F5F9;
  --sidebar-active: #E6FBF5;
  
  --wa-green: #25D366;
  --wa-dark-green: #075E54;
  --wa-chat-bg: #EFEAE2; /* Light WA chat bg */
  --wa-bubble-bg: #D9FDD3;
  --wa-bubble-text: #111B21;
  
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;
  --accent-cyan: #3B82F6; /* Blue instead of Cyan */
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(0, 200, 150, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #059669 0%, transparent 70%);
  top: -100px;
  left: 5%;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #25D366 0%, transparent 70%);
  bottom: -150px;
  right: 5%;
}

/* Layout Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1000;
}

/* Main Content Area */
.app-main-content {
  flex: 1;
  padding: 24px 32px 48px;
  max-width: calc(100vw - 280px);
}

/* Sidebar Logo & Menu */
.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  display: block;
}
.sidebar-logo img {
  height: 32px;
  width: auto;
}
.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
}
.sidebar-item-icon {
  font-size: 1.2rem;
}
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Header (Top Bar) */
.main-header {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-primary {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* User Profile Dropdown */
.user-dropdown-wrapper {
  position: relative;
}
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.1);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-display-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.user-display-email {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.dropdown-caret {
  color: var(--text-muted);
  transition: transform 0.2s;
}
.user-dropdown-wrapper.open .dropdown-caret {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 220px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  text-align: left;
}
.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.dropdown-item.text-danger {
  color: #f87171;
}
.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

/* Status Pill (Header) */
.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transition: all 0.25s ease;
}

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

.status-connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-connecting .status-dot,
.status-qrcode .status-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
  animation: pulse 1.5s infinite;
}

.status-disconnected .status-dot {
  background: var(--accent-red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 0, 0, 0.05);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.card-icon-tag {
  font-size: 1.2rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Greeting Banner */
.greeting-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #E6FBF5; /* Very light teal */
  border: 1px solid #00C896;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.callout-icon {
  font-size: 1.1rem;
}

.code-pill {
  background: rgba(0, 200, 150, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Editor & Toolbar */
.editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.format-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s;
}

.format-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.editor-counter {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.custom-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.15);
}

/* WhatsApp Screen Preview */
.preview-recipient-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.custom-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
}

.wa-chat-preview-box {
  background: var(--wa-chat-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.wa-chat-header {
  background: #1f2c34;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.wa-contact-info {
  display: flex;
  flex-direction: column;
}

.wa-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e9edef;
}

.wa-sub {
  font-size: 0.68rem;
  color: #8696a0;
}

.wa-chat-body {
  padding: 18px 14px;
  min-height: 180px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
}

.wa-bubble-in {
  align-self: flex-start;
  max-width: 90%;
  background: var(--wa-bubble-bg);
  color: var(--wa-bubble-text);
  border-radius: 0 10px 10px 10px;
  padding: 10px 12px 6px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  font-size: 0.85rem;
  line-height: 1.5;
}

.wa-bubble-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: #8696a0;
}

.wa-ticks {
  color: #53bdeb;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-color);
  background: #E6FBF5; /* Very light teal */
  box-shadow: var(--shadow-sm);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  color: #818cf8;
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.text-accent {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Contacts Summary & Table */
.contacts-summary {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-item {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-valid .stat-value { color: #34d399; }
.stat-invalid .stat-value { color: #f87171; }

.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-container {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.contacts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.contacts-table th {
  position: sticky;
  top: 0;
  background: #111827;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.contacts-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.badge-valid {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-invalid {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Dispatch & Anti-Ban Section */
.safety-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.shield-badge {
  background: #E6FBF5;
  border: 1px solid rgba(0, 200, 150, 0.3);
  color: #008A66; /* Dark Teal for contrast */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

.progress-section {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

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

.badge-idle {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.badge-running {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  animation: pulse 1.5s infinite;
}

.badge-paused {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.counter-text {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--success-gradient);
  border-radius: 20px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.next-info-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Dispatch Buttons */
.dispatch-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0, 200, 150, 0.3);
  transition: all 0.25s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 200, 150, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Activity Log Console */
.log-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.log-console {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  line-height: 1.4;
  color: #cbd5e1;
}

.log-entry.log-success { color: #34d399; }
.log-entry.log-error { color: #f87171; }
.log-entry.log-warn { color: #fbbf24; }
.log-entry.log-cooldown { color: #38bdf8; }

/* Small buttons & utility */
.btn-sm {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  border: 1px solid #6366f1;
  color: #a5b4fc;
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.15);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.btn-ghost-sm:hover {
  color: var(--text-secondary);
}

.btn-text-action {
  background: none;
  border: none;
  color: #818cf8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.btn-text-action:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-dialog {
  background: #131b2e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

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

.modal-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.qr-code-img {
  width: 240px;
  height: 240px;
  border-radius: 8px;
}

.qr-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 600;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.qr-security-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================================
   NAV TABS BAR
   ======================================================== */
.nav-tabs-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 24px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.badge-tab-counter {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tab-view {
  display: block;
  animation: fadeInView 0.25s ease;
}

.tab-view.hidden {
  display: none !important;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   TAB 2: SCHEDULER & MONTHLY DEVOTIONALS
   ======================================================== */
.schedule-top-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1080px) {
  .schedule-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Switch Control (iOS Style Premium) */
.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-control {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  cursor: pointer;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.switch-control input:checked + .switch-slider {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(26px);
}

.switch-status-group {
  display: flex;
  flex-direction: column;
}

.switch-status-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.switch-status-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Scheduler Time Bar */
.scheduler-time-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 16px 0;
}

.time-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.time-bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.time-inputs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-input {
  width: 38px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.time-colon {
  font-size: 1.05rem;
  font-weight: 800;
  color: #a5b4fc;
}

.time-tz-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

.time-presets {
  display: flex;
  gap: 6px;
}

.btn-time-preset {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-time-preset:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

/* Today's Devotional Hero Card */
.today-hero-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.65) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.today-hero-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.today-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.today-hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 10px;
  border-radius: 20px;
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s infinite;
}

.today-date-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
}

.today-status-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.today-status-chip.sent {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.today-hero-content {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.today-hero-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.today-hero-text {
  flex: 1;
  min-width: 0;
}

.today-hero-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 4px;
}

.today-hero-meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

.today-hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.status-summary-text {
  font-size: 0.8rem;
  color: #94a3b8;
}

.btn-trigger-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
}

.btn-trigger-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
}

.schedule-safety-hint {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Active PDF Summary Banner */
.pdf-active-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.active-banner-icon {
  font-size: 1.5rem;
}

.active-banner-info strong {
  display: block;
  color: #34d399;
  font-size: 0.88rem;
  font-weight: 700;
}

.active-banner-info p {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-top: 2px;
}

/* PDF Dropzone & Guide */
.pdf-dropzone {
  min-height: 120px;
  background: var(--bg-card-hover);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.pdf-dropzone:hover, .pdf-dropzone.dragover {
  border-color: #3B82F6; /* Blue border on hover */
  background: #EFF6FF; /* Very light blue */
}

.pdf-icon-glow {
  color: #f43f5e;
  filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.4));
}

.pdf-status-box {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.pdf-status-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.pdf-status-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.pdf-format-guide {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border-left: 3px solid var(--accent-amber);
}

.guide-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.guide-list {
  padding-left: 18px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================================
   MONTHLY CALENDAR & GRID
   ======================================================== */
.monthly-calendar-card {
  margin-bottom: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.search-box svg {
  color: #a5b4fc;
}

.search-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.84rem;
  font-family: var(--font-sans);
  outline: none;
  width: 220px;
}

.search-input::placeholder {
  color: #64748b;
}

.filter-pills {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

.devotionals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

/* Devotional Card (Rich SaaS Look) */
.devotional-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  position: relative;
}

.devotional-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.2);
}

.devotional-card.is-today {
  border: 1.5px solid #6366f1;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.65) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.35);
}

.devotional-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* Calendar Mini Badge on Card */
.cal-mini-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.2) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 5px 12px;
  min-width: 58px;
}

.cal-badge-month {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #a5b4fc;
  letter-spacing: 0.05em;
}

.cal-badge-day {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.cal-badge-weekday {
  font-size: 0.62rem;
  font-weight: 600;
  color: #94a3b8;
}

.card-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.today-badge-pulse {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

.devotional-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

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

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

.devotional-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scripture-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.devotional-card-quote {
  border-left: 2px solid rgba(99, 102, 241, 0.35);
  padding-left: 10px;
  margin-bottom: 16px;
}

.devotional-card-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.devotional-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background: var(--primary-gradient);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-card-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-secondary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ========================================================
   MODAL EDIT RENUNGAN (LARGE)
   ======================================================== */
.modal-large {
  max-width: 1040px;
  width: 95%;
}

.edit-modal-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 20px 24px;
}

@media (max-width: 900px) {
  .edit-modal-layout {
    grid-template-columns: 1fr;
  }
}

.edit-form-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.custom-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 12px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.custom-input:focus {
  border-color: var(--border-focus);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.edit-sm-area {
  font-size: 0.8rem;
  padding: 8px 10px;
  line-height: 1.4;
}

.edit-preview-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.preview-in-modal {
  max-height: 480px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   AUTH SCREEN (LOGIN GOOGLE & MULTI-TENANT)
============================================================ */
.auth-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-card {
  max-width: 480px;
  width: 100%;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(79, 70, 229, 0.2);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
}

.auth-header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.btn-google-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

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

.btn-google-login:active {
  transform: translateY(0);
}

.btn-google-login svg {
  width: 20px;
  height: 20px;
}

.auth-features-list {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-feature-item span.icon {
  color: #10b981;
  font-weight: bold;
}

.auth-dev-callout {
  margin-top: 20px;
  padding: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-dev-login {
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dev-login:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* ============================================================
   USER PROFILE IN HEADER
============================================================ */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-display-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-display-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-logout-google {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  margin-left: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-logout-google:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================================
   Dropdown Menu & Modals
======================================================== */
.user-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dropdown-item.text-danger {
  color: var(--danger-color, #ff4757);
}

.dropdown-item.text-danger:hover {
  background: rgba(255, 71, 87, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.dropdown-caret {
  margin-left: 8px;
  opacity: 0.7;
}

/* Locked Overlay for Premium Feature */
.locked-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 16px;
  padding: 20px;
}

.locked-overlay h3 {
  font-size: 1.5rem;
  margin: 16px 0 8px 0;
  color: #fff;
}

.locked-overlay p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 400px;
  margin-bottom: 24px;
}

/* ==========================================
 * ANALYTICS DASHBOARD
 * ========================================== */
.analytics-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.analytics-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.analytics-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-light);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stat-icon-purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  padding: 24px;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  flex: 1;
  width: 100%;
  position: relative;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .sidebar-header {
    padding: 16px;
    justify-content: center;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
  }
  .sidebar-item {
    width: auto;
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .sidebar-footer {
    padding: 10px;
  }
  .app-main-content {
    max-width: 100%;
    padding: 12px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .main-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    text-align: center;
  }
  .header-brand {
    flex-direction: column;
  }
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  /* Cards Mobile Fixes */
  .card {
    padding: 16px;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .card-title-group {
    width: 100%;
  }
  .btn-text-action {
    align-self: flex-start;
  }
  .greeting-callout {
    align-items: flex-start;
    padding: 12px;
  }
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .editor-counter {
    width: 100%;
    text-align: left;
    margin-left: 0;
    margin-top: 4px;
  }
  .preview-recipient-picker {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .custom-select {
    width: 100%;
  }
  .wa-chat-body {
    padding: 12px 10px;
  }
}
