/* ==========================================================================
   INTENT OS — Premium SaaS UI/UX Design System (Fine-Toothed Comb Refinement)
   Visual Identity: LTM Marketing Clean Light SaaS
   Primary Accent: #FE6C05 (LTM Orange) | Background: #f8fafc | Sidebar: #ffffff
   ========================================================================== */

:root {
  --bg-body: #f8fafc;
  --sidebar-bg: #ffffff;
  --header-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: #cbd5e1;
  
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  /* LTM Brand Colors */
  --primary: #FE6C05;
  --primary-hover: #e55f00;
  --primary-light: #fff4ee;
  --primary-border: #ffd7be;
  --primary-glow: rgba(254, 108, 5, 0.18);
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;

  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fee2e2;

  --info: #2563eb;
  --info-bg: #dbeafe;
  --info-border: #bfdbfe;

  --violet: #8b5cf6;
  --violet-bg: #f3e8ff;

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

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 25px rgba(15, 23, 42, 0.09);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Login Overlay
   -------------------------------------------------------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}
.login-overlay.hidden { display: none; }

.login-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-modal);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 3rem;
  color: var(--primary);
  filter: drop-shadow(0 4px 12px var(--primary-glow));
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 0.5rem;
  letter-spacing: -0.02em;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   App Container & Sidebar
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.logo-icon {
  font-size: 2.2rem;
  color: var(--primary);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-item i { font-size: 1.2rem; }

.nav-item:hover {
  background: #f1f5f9;
  color: var(--text-heading);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-color: var(--primary-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.badge-count {
  margin-left: auto;
  background: rgba(254, 108, 5, 0.15);
  color: var(--primary);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
}

.sidebar-footer {
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.success { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.warning { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }

.subdomain-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   Main Content & Top Header
   -------------------------------------------------------------------------- */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1500px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: #ffffff;
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.page-title h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #f1f5f9;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
  border: 1px solid var(--card-border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Buttons & Form Controls
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 12px var(--primary-glow);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--card-border);
  color: var(--text-heading);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger-outline {
  background: #ffffff;
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* --------------------------------------------------------------------------
   Cards & Dashboard Widgets
   -------------------------------------------------------------------------- */
.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

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

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* AI Morning Briefing Card (PRD Módulo 8) */
.ai-briefing-card {
  background: linear-gradient(135deg, #ffffff 0%, #fff9f6 100%);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.ai-briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ai-briefing-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-briefing-body {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* Setup Guide Card */
.setup-guide-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.setup-guide-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setup-guide-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

.setup-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.setup-step-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.step-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.step-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pill-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}
.pill-tag.orange { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.pill-tag.green { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.pill-tag.blue { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.pill-tag.purple { background: var(--violet-bg); color: var(--violet); }
.pill-tag.red { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.stat-icon.orange { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }

.stat-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: block;
}

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

/* --------------------------------------------------------------------------
   INTENT OS KANBAN BOARD (PRD Módulo 6)
   -------------------------------------------------------------------------- */
.kanban-board-wrapper {
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  min-width: 1550px;
}

.kanban-column {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.85rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2.5px solid #cbd5e1;
}

.kanban-column-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kanban-column-count {
  background: #ffffff;
  color: var(--text-muted);
  padding: 0.1rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--card-border);
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

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

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kanban-card-username {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-heading);
}

.intent-score-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}

.kanban-card-temp {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.kanban-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--card-border);
}

.stage-select {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: #ffffff;
  color: var(--text-heading);
  font-weight: 600;
  outline: none;
}

/* Sales Copilot Widget in Timeline Drawer (PRD Módulo 14) */
.copilot-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid var(--success-border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.copilot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.copilot-header h5 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Timeline Drawer Modal (PRD Módulo 7) */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--card-border);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
}

.timeline-details {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active { display: flex; }

.modal-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  box-shadow: var(--shadow-modal);
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
}

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--text-heading);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  animation: slideIn 0.3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
