/* ============================================================
   GOCARIA CRM - LUXURY AUTOMOTIVE LIGHT THEME
   Palette: Pure White, Slate, Corporate Gocar Orange (#ff5a2b), Emerald, Amber
============================================================ */

:root {
  --bg-main: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-glass: #e2e8f0;
  --border-focus: #ff5a2b;
  
  --primary-accent: #ff5a2b;
  --primary-hover: #ea580c;
  --primary-gradient: linear-gradient(135deg, #ff5a2b 0%, #ea580c 100%);
  --secondary-accent: #f59e0b;
  --success-accent: #10b981;
  --danger-accent: #ef4444;
  --purple-accent: #8b5cf6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(255, 90, 43, 0.22);
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(255, 90, 43, 0.06) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(255, 90, 43, 0.04) 0px, transparent 40%),
    radial-gradient(at 50% 100%, rgba(226, 232, 240, 0.5) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* Text Overrides for Light Theme Clarity */
.text-white {
  color: var(--text-main) !important;
}

.text-dim {
  color: var(--text-dim) !important;
}

/* Cards */
.gocaria-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gocaria-card:hover {
  border-color: rgba(255, 90, 43, 0.35);
  box-shadow: var(--shadow-lg);
}

/* Header & Navbar */
.gocaria-navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.brand-badge {
  background: var(--primary-gradient);
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-glow);
}

.agency-pill {
  background: rgba(255, 90, 43, 0.08);
  border: 1px solid rgba(255, 90, 43, 0.3);
  color: #ea580c;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.agency-pill:hover {
  background: rgba(255, 90, 43, 0.15);
  color: #c2410c;
}

/* Sidebar / Navigation Tabs */
.nav-link-custom {
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link-custom:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.nav-link-custom.active {
  color: #ea580c;
  background: rgba(255, 90, 43, 0.1);
  border: 1px solid rgba(255, 90, 43, 0.25);
  font-weight: 600;
}

/* Metric KPI Badges */
.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-main) !important;
}

.metric-rate {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.rate-whatsapp {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.rate-email {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Tables Custom Styling */
.table-gocaria {
  color: var(--text-main);
  margin-bottom: 0;
}

.table-gocaria th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
  font-weight: 700;
}

.table-gocaria td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
}

.table-gocaria tbody tr:hover td {
  background: #f8fafc;
}

/* Status Badges */
.badge-status {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active, .status-en-proceso, .status-disponible {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-borrador, .status-pausa, .status-pendiente {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-leido, .status-aprobada {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.status-fallido, .status-baja, .status-ocupado {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Timeline Components */
.timeline-track {
  position: relative;
  padding-left: 30px;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-point {
  position: absolute;
  left: -30px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: #ffffff;
  border: 2px solid #ff5a2b;
  color: #ff5a2b;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.timeline-point.whatsapp {
  border-color: #10b981;
  background: #ecfdf5;
  color: #059669;
}

.timeline-point.email {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.timeline-point.lead {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
}

/* Forms and Inputs */
.form-control-gocaria, .form-select-gocaria {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 14px;
}

.form-control-gocaria:focus, .form-select-gocaria:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.2);
  color: var(--text-main);
}

/* Buttons */
.btn-gocaria-primary {
  background: var(--primary-gradient);
  border: none;
  color: #ffffff !important;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(255, 90, 43, 0.35);
  transition: all 0.2s ease;
}

.btn-gocaria-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 90, 43, 0.5);
  transform: translateY(-1px);
  color: #ffffff !important;
  background: linear-gradient(135deg, #ff6b3d 0%, #d94819 100%);
}

.btn-gocaria-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
}

.btn-gocaria-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--text-main);
}

/* Modals */
.modal-content-gocaria {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  color: var(--text-main);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-header-gocaria {
  border-bottom: 1px solid var(--border-glass);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-gocaria .btn-close {
  filter: none !important;
  opacity: 0.7;
  background-color: #f1f5f9;
  border-radius: 50%;
  padding: 0.6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.modal-header-gocaria .btn-close:hover {
  opacity: 1;
  background-color: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg) scale(1.08);
}

.modal-footer-gocaria {
  border-top: 1px solid var(--border-glass);
  padding: 1rem 1.5rem;
  background: #ffffff;
  position: sticky;
  bottom: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-dialog-scrollable {
  max-height: calc(100vh - 3rem);
}

.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto;
}

/* Previews & Helpers */
.preview-bubble-customer {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.preview-bubble-bot {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

/* WhatsApp & Email Preview Simulators */
.simulator-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wa-simulator-header {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  color: #ffffff;
  padding: 10px 14px;
}

.wa-simulator-body {
  background-color: #efeae2;
  background-image: radial-gradient(#d1d7db 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 16px;
  min-height: 140px;
}

.wa-bubble-incoming {
  background: #ffffff;
  border-radius: 8px 8px 8px 0px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  color: #111b21;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 90%;
  position: relative;
}

.wa-time-stamp {
  font-size: 0.72rem;
  color: #667781;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 4px;
}

.email-simulator-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
}

.email-simulator-body {
  background: #f1f5f9;
  padding: 16px;
}

.email-card-content {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  color: #1e293b;
  font-size: 0.92rem;
  line-height: 1.55;
}

.preview-var-pill {
  background: rgba(255, 90, 43, 0.12);
  color: #ea580c;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 90, 43, 0.25);
  font-family: inherit;
}

/* ============================================================
   KÓD WYSIWYG CAMPAIGN EDITOR STYLES
   ============================================================ */
.wysiwyg-container {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wysiwyg-container:focus-within {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.15);
}

.wysiwyg-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.wysiwyg-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.82rem;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.wysiwyg-btn:hover {
  background: #f1f5f9;
  color: var(--primary-accent);
  border-color: #cbd5e1;
}

.wysiwyg-btn.active {
  background: #fff1ed;
  color: var(--primary-accent);
  border-color: rgba(255, 90, 43, 0.4);
  font-weight: 600;
}

.wysiwyg-select {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.8rem;
  color: #334155;
  height: 28px;
}

.wysiwyg-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 2px;
}

.wysiwyg-canvas {
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  padding: 14px 16px;
  outline: none;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1e293b;
  background: #ffffff;
}

.wysiwyg-canvas img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}

.wysiwyg-source {
  width: 100%;
  min-height: 220px;
  max-height: 380px;
  padding: 14px 16px;
  border: none;
  outline: none;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: #0f172a;
  color: #f1f5f9;
  resize: vertical;
}

.var-pill-btn {
  background: #ffffff;
  border: 1px dashed rgba(255, 90, 43, 0.45);
  color: #ea580c;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.var-pill-btn:hover {
  background: #fff1ed;
  border-color: #ea580c;
  transform: translateY(-1px);
}

.campaign-media-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.campaign-media-card.active {
  border-color: #10b981;
  background: #f0fdf4;
}

.campaign-media-thumb {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.wa-media-image-header {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
  margin-bottom: 8px;
  display: block;
}

/* Leads & Handoff Table Overflow & Dropdown Fixes */
.leads-card-wrapper {
  min-height: 480px;
  overflow: visible !important;
}

.leads-card-wrapper .table-responsive {
  overflow-x: auto;
  overflow-y: visible !important;
  min-height: 380px;
  padding-bottom: 120px;
}

.table-gocaria .dropdown-menu {
  z-index: 1060 !important;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid #334155 !important;
  padding: 6px 0;
}

.table-gocaria .dropdown-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.table-gocaria .dropdown-item:hover {
  background-color: #1e293b;
}


