:root {
  color-scheme: dark;
  --bg-primary: #050507;
  --bg-secondary: #131d31;
  --bg-tertiary: #1e293b;
  --card-bg: rgba(17, 18, 24, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(37, 211, 102, 0.35);

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

  --accent: #00d2ff; /* WhatsApp Emerald */
  --accent-hover: #38bdf8;
  --accent-light: rgba(37, 211, 102, 0.12);
  --accent-glow: rgba(37, 211, 102, 0.35);

  --blue-accent: #38bdf8;
  --blue-light: rgba(56, 189, 248, 0.12);
  --purple-accent: #a855f7;
  --purple-light: rgba(168, 85, 247, 0.12);

  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);

  --border: #243048;
  --border-focus: #25d366;

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

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 211, 102, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.04) 0%, transparent 40%);
}

/* Ambient glow orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  top: -100px;
  left: 20%;
  width: 450px;
  height: 450px;
  background: rgba(37, 211, 102, 0.08);
}
.glow-2 {
  bottom: -150px;
  right: 15%;
  width: 500px;
  height: 500px;
  background: rgba(56, 189, 248, 0.06);
}

.app-container {
  max-width: 1380px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Glass Panels - Matte Frosted Glass Theme (v3.2) */
.glass-panel {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.14), inset 0 0 20px rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 48px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Header */
.app-header {
  padding: 20px 24px;
  margin-bottom: 24px;
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 34px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.2), rgba(56, 189, 248, 0.2));
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(37, 211, 102, 0.3);
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.2);
}

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

.app-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #d1fae5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  background: var(--accent);
  color: #04260e !important;
  -webkit-text-fill-color: #04260e !important;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.4);
  vertical-align: middle;
}

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

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Replaced by Apple Profile & Log Out Bar */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* User Profile Header Badge (v3.1 Clickable Maintain Profile) */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 24px;
  padding: 5px 14px 5px 8px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.user-profile-badge:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.25);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-profile-badge .user-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-sub {
  font-size: 10.5px;
  color: #38bdf8;
  font-weight: 600;
}

/* Large Prominent Top-Right Log Out Button (v3.1) */
.btn-logout-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.5) 100%);
  border: 1.5px solid rgba(248, 113, 113, 0.6);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-logout-large .logout-icon {
  font-size: 18px;
  font-weight: 800;
  display: inline-block;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-logout-large:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.55) 0%, rgba(220, 38, 38, 0.8) 100%);
  border-color: #fca5a5;
  color: #ffffff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-logout-large:hover .logout-icon {
  transform: translateX(2px) scale(1.1);
}

.btn-logout-large:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout-pill {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-pill:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-header-action.btn-highlight {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: var(--accent);
}

.btn-header-action.btn-highlight:hover {
  background: var(--accent);
  color: #03210d;
}

/* Template Select Row & Actions */
.template-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-template-action {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-template-action:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-template-action.btn-danger-action {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-template-action.btn-danger-action:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-header-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.2);
}

.btn-header-action.btn-subtle {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-header-action.btn-subtle:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-header-action.btn-danger-action {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-header-action.btn-danger-action:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.btn-header-action.rotating .action-icon {
  animation: spin 1s linear infinite;
}

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

.badge-pill {
  font-size: 10px;
  background: var(--accent);
  color: #04260e;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 800;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
.dot-red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
.dot-blue { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }
.dot-gray { background: #64748b; }

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

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

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

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

/* Generic Card */
.card {
  padding: 24px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* AI Settings Card */
.ai-settings-card {
  border-left: 3px solid var(--accent);
}

.card-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

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

.card-title-group .card-title {
  margin-bottom: 0;
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

.date-summary-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.btn-collapse {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s;
}

.btn-collapse.collapsed {
  transform: rotate(-90deg);
}

.ai-card-body {
  margin-top: 16px;
  transition: all 0.3s;
}

.ai-card-body.collapsed {
  display: none;
}

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

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

.input-with-button {
  display: flex;
  position: relative;
}

.btn-inner-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-inner-toggle:hover {
  opacity: 1;
}

.key-status-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.ai-button-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-secondary {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--text-muted);
}

.btn-test-ai:hover {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
  background: var(--blue-light);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.btn-save-ai:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.2);
}

.ai-test-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
  animation: fadeIn 0.25s ease-out;
}

.ai-test-box.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.ai-test-box.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
  font-weight: 600;
}

.preset-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preset:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-preset.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.35);
}

.dropdown-row {
  margin-bottom: 12px;
}

.select-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2325d366' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}

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

.form-control {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border);
  color: var(--text-primary);
  color-scheme: dark;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

/* Date and Time Picker Indicators (Guaranteed High Contrast & Visible in All Browsers) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1) !important;
  cursor: pointer !important;
  opacity: 1 !important;
  background-color: rgba(37, 211, 102, 0.25) !important;
  border: 1px solid rgba(37, 211, 102, 0.5) !important;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.2) !important;
  margin-right: -2px;
  transition: all 0.2s ease !important;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(37, 211, 102, 0.45) !important;
  border-color: #25d366 !important;
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.5) !important;
  transform: scale(1.08);
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.link-external {
  color: var(--blue-accent);
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
}

.link-external:hover {
  text-decoration: underline;
}

/* Radio Cards */
.radio-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.radio-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(11, 15, 25, 0.8);
}

.radio-card input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.radio-card:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: rgba(37, 211, 102, 0.06);
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.15);
}

.radio-content {
  flex: 1;
}

.radio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.radio-icon {
  font-size: 16px;
}

.radio-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.radio-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Custom Filter Panel */
.custom-filter-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-panel {
  background: rgba(11, 15, 25, 0.85);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-left: 10px;
  animation: panelSlideDown 0.25s ease-out;
}

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

/* Template Sub-Panel (User Request #3: Preserve format or upload/change) */
.format-option-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-sub-panel {
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-mode-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.sub-radio-label input[type="radio"] {
  accent-color: var(--accent);
}

/* Template Dropzone */
.template-dropzone {
  border: 2px dashed rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.03);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.template-dropzone:hover {
  border-color: var(--accent);
  background: rgba(37, 211, 102, 0.08);
}

.dropzone-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

.dropzone-title {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.template-active-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  font-size: 12px;
}

.btn-badge-clear {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
}

/* Progress Tracker (Bug Fix: Freeze protection & visual progress) */
.progress-section {
  margin-top: 16px;
  margin-bottom: 10px;
  background: rgba(11, 15, 25, 0.7);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  animation: fadeIn 0.25s ease-out;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-label {
  color: var(--accent);
}

.progress-percent {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #25d366, #38bdf8);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.6);
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 20px; }
}

.progress-cancel-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-cancel-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.btn-cancel-task:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-cancel-task:active {
  transform: translateY(0);
}

.btn-cancel-task:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Action Button */
.action-area {
  margin-top: 14px;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #25d366 0%, #10b981 100%);
  color: #04260e;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.35);
  letter-spacing: -0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2ae06e 0%, #059669 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.3);
}

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

/* QR Card */
.qr-card {
  text-align: center;
  border-color: rgba(245, 158, 11, 0.4);
}

.qr-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.qr-image-wrapper {
  display: inline-block;
  background: white;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.qr-image-wrapper img {
  display: block;
  width: 240px;
  height: 240px;
}

/* Console Card */
.console-card {
  flex: 1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

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

.console-header .card-title {
  margin-bottom: 0;
}

.console-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.console-pulse-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.btn-text-only {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-text-only:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.console-output {
  flex: 1;
  background: rgba(7, 10, 18, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.console-output::-webkit-scrollbar {
  width: 6px;
}
.console-output::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.log-line {
  word-break: break-word;
}
.log-info { color: #94a3b8; }
.log-success { color: #34d399; font-weight: 500; }
.log-warn { color: #fbbf24; }
.log-error { color: #f87171; font-weight: 600; }

/* Result Card */
.result-card {
  border-color: rgba(37, 211, 102, 0.4);
  animation: fadeIn 0.3s ease-out;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.result-header .card-title {
  margin-bottom: 2px;
}

.result-file-path {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-pill {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

/* Download Suite & Dropdown Menu (v3.1) */
.download-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.btn-download-primary {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.45) 100%) !important;
  border: 1px solid rgba(52, 211, 153, 0.5) !important;
  color: #ecfdf5 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download-primary:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.65) 100%) !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.dropdown-arrow {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 2px;
}

.download-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 270px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 120;
  animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.download-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #f1f5f9;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.download-dropdown-menu .dropdown-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  transform: translateX(3px);
}

.download-dropdown-menu .dropdown-item .item-icon {
  font-size: 20px;
  line-height: 1;
}

.download-dropdown-menu .dropdown-item .item-info {
  display: flex;
  flex-direction: column;
}

.download-dropdown-menu .dropdown-item .item-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.download-dropdown-menu .dropdown-item:hover .item-title {
  color: #38bdf8;
}

.download-dropdown-menu .dropdown-item .item-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.download-dropdown-menu .dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 4px;
}

.result-preview {
  background: rgba(7, 10, 18, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  color: #e2e8f0;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  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;
  animation: fadeIn 0.2s ease-out;
}

.glass-modal {
  background: rgba(19, 29, 49, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  max-width: 580px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-large {
  max-width: 720px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 28px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

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

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

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.terms-scroll::-webkit-scrollbar {
  width: 6px;
}
.terms-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.terms-section {
  margin-bottom: 18px;
}

.terms-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.terms-section p {
  color: var(--text-secondary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(11, 15, 25, 0.4);
}

.btn-deny {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-deny:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-allow {
  width: auto;
  padding: 10px 24px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

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

/* Maintain Profile Modal Styles (v3.1) */
.profile-modal-card {
  max-width: 540px !important;
  border-radius: 24px !important;
}

.profile-modal-icon {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #38bdf8 !important;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.profile-modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.profile-overview-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 22px;
}

.profile-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.profile-overview-meta h4 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.profile-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-meta-tags .meta-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-form-section {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
}

.profile-form-section .section-title {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-section {
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.security-section .section-title {
  color: #f87171 !important;
}

.field-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

.form-row {
  display: flex;
  gap: 12px;
}

/* Release Notes */
.release-item {
  margin-bottom: 24px;
}

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

.version-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 3px 10px;
  border-radius: 12px;
}

.version-badge.badge-latest {
  background: var(--accent);
  color: #04260e;
}

.release-date {
  font-size: 12px;
  color: var(--text-muted);
}

.release-list {
  padding-left: 20px;
  color: var(--text-secondary);
}

.release-list li {
  margin-bottom: 8px;
}

/* Shutdown Overlay */
.shutdown-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.shutdown-card {
  text-align: center;
  padding: 36px 32px;
  max-width: 480px;
  border-color: rgba(239, 68, 68, 0.3);
}

.shutdown-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.shutdown-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.shutdown-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.shutdown-sub {
  color: var(--text-muted) !important;
  font-size: 12px !important;
}

/* Locked UI helper */
.ui-denied-lock {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.8);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Replaced by Apple Footer */



/* =========================================================================
   Apple-Inspired Fluid & Vibrant UI Enhancements (v3.0.0 Cloud Edition)
   ========================================================================= */

/* Brand Logo Styling */
.header-brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 14px rgba(0, 210, 255, 0.4));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-brand-logo:hover {
  transform: scale(1.04);
}

/* User Profile & Session Controls */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 5px 14px 5px 6px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}
.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}
.user-profile-badge .user-name {
  font-weight: 700;
  font-size: 13px;
  color: #f4f4f5;
  letter-spacing: -0.01em;
}
.btn-logout-pill {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-logout-pill:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

/* WhatsApp Connection Hub Card */
.wa-hub-card {
  border: 1px solid rgba(0, 210, 255, 0.2);
  position: relative;
  overflow: hidden;
}
.wa-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00d2ff, #3b82f6, #8b5cf6, #10b981);
}
.card-title-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}
.card-subtitle-small {
  font-size: 12px;
  color: #a1a1aa;
  margin-top: 2px;
}
.status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.status-badge.badge-connected {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.status-badge.badge-action {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.status-badge.badge-disconnected {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a1a1aa;
}

/* Telemetry Grid */
.wa-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 14px;
}
.wa-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wa-detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a;
}
.wa-detail-val {
  font-size: 13px;
  font-weight: 700;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Buttons Row */
.wa-hub-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-wa-hub {
  flex: 1;
  min-width: 140px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-wa-hub:hover {
  transform: translateY(-2px);
}
.btn-wa-hub:active {
  transform: translateY(0);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* QR Code Interactive Viewport */
.wa-qr-viewport {
  margin-top: 18px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 16px;
  display: flex;
  gap: 24px;
  align-items: center;
  animation: appleFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wa-qr-box {
  width: 190px;
  height: 190px;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 210, 255, 0.25);
  flex-shrink: 0;
}
.wa-qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.wa-qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00d2ff, #3b82f6, transparent);
  box-shadow: 0 0 12px #00d2ff;
  animation: scanBeam 2.2s ease-in-out infinite alternate;
}
@keyframes scanBeam {
  0% { top: 6px; }
  100% { top: 180px; }
}
.wa-qr-instructions {
  flex: 1;
}
.wa-qr-instructions h4 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px 0;
}
.wa-steps-list {
  padding-left: 20px;
  color: #a1a1aa;
  font-size: 13px;
  line-height: 1.8;
  margin: 0 0 12px 0;
}
.wa-steps-list strong {
  color: #f4f4f5;
}
.wa-qr-countdown {
  font-size: 11px;
  color: #00d2ff;
  font-weight: 600;
}

/* Diagnostic Ping Box */
.wa-ping-result {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: appleFadeIn 0.3s ease-out;
}
.wa-ping-result.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.wa-ping-result.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

/* Direct Browser Downloads */
.btn-action-download {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2) 0%, rgba(58, 123, 213, 0.2) 100%) !important;
  border: 1px solid rgba(0, 210, 255, 0.4) !important;
  color: #70e1ff !important;
  font-weight: 700 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.btn-action-download:hover {
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4) !important;
  transform: translateY(-2px);
}

/* Dynamic Island Floating Toasts */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.dynamic-toast {
  pointer-events: auto;
  background: rgba(17, 18, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.dynamic-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.25);
}
.dynamic-toast.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
}
@keyframes toastPop {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modern Apple Footer */
.app-footer {
  margin-top: 48px;
  margin-bottom: 32px;
}
.app-footer .footer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  border-radius: 20px;
  background: rgba(17, 18, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.footer-brand-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}
.footer-meta-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-meta-desc {
  font-size: 12px;
  color: #71717a;
  margin: 3px 0 0 0;
}
.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .app-footer .footer-card {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .footer-brand-meta {
    flex-direction: column;
  }
  .wa-qr-viewport {
    flex-direction: column;
    text-align: center;
  }
  .wa-qr-box {
    margin: 0 auto;
  }
}

/* =========================================================================
   v3.2 SaaS Subpage Navigation & Tabbed Architecture
   ========================================================================= */
.subpage-nav-bar {
  margin-bottom: 24px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  position: sticky;
  top: 16px;
  z-index: 40;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-tab .tab-icon {
  font-size: 16px;
}

.nav-pill-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-pill-version {
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Subpage Views */
.subpage-container {
  position: relative;
  min-height: 480px;
}

.subpage-view {
  display: none;
}

.subpage-view.active {
  display: block;
  animation: subpageFade 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.subpage-inner {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

/* Card Section Header */
.card-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.card-section-icon {
  font-size: 26px;
  line-height: 1;
}
.card-section-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 3px;
}

/* Unified Format Selector Cards (Eliminating Duplicate Report Settings) */
.unified-format-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .unified-format-cards {
    grid-template-columns: 1fr;
  }
}
.subpage-jump-link {
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.subpage-jump-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* =========================================================================
   v3.2 Dynamic Progress Bar & Glowing Stage Progression
   ========================================================================= */
.progress-card {
  margin-bottom: 20px;
  padding: 22px;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.15);
}

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

.progress-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.progress-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.progress-percent {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(11, 15, 25, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 50%, #10b981 100%);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  animation: progressShine 1.6s infinite linear;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-stages {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stage {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  transition: color 0.3s ease;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.3s ease;
}

.stage.active {
  color: #38bdf8;
  font-weight: 700;
}

.stage.active .stage-dot {
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 18px rgba(56, 189, 248, 0.8);
  animation: stagePulse 1.2s infinite ease-in-out;
}

@keyframes stagePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.stage.completed {
  color: #34d399;
}

.stage.completed .stage-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* =========================================================================
   v3.2 Compact Execution Console (Capped at 220px to eliminate long scroll)
   ========================================================================= */
.console-card {
  margin-top: 16px;
}
.console-body {
  background: rgba(7, 10, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  max-height: 220px; /* User requirement: no endless scrolling */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.console-body::-webkit-scrollbar {
  width: 6px;
}
.console-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Maintain Profile Page Subpage Forms */
.profile-page-card {
  padding: 28px;
}
.profile-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 22px;
}
@media (max-width: 840px) {
  .profile-forms-grid {
    grid-template-columns: 1fr;
  }
}

.info-callout {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}
.info-callout-icon {
  font-size: 20px;
  color: #38bdf8;
  line-height: 1;
}
.info-callout strong {
  color: #f8fafc;
  display: block;
  margin-bottom: 2px;
}
.info-callout p {
  margin: 0;
}

