/* shared.css — Estilos comunes para todas las reuniones semanales */

/* ========== Icon system (SVG inline) ========== */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  vertical-align: -0.2em;
  display: inline-block;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke: currentColor;
}
.icon-lg { width: 1.4em; height: 1.4em; }
.icon-kpi {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  display: block;
}
.icon-pillar {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
}
.h2-with-icon, .h3-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
}
.h2-with-icon .icon { width: 32px; height: 32px; }
.h3-with-icon .icon { width: 22px; height: 22px; }

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

:root {
  --brown: #8B4513;
  --brown-dark: #5D2E0D;
  --brown-light: #D4A574;
  --beige-1: #f1e3d3;
  --beige-2: #f7efea;
  --green: #28a745;
  --green-light: #20c997;
  --red: #dc3545;
  --orange: #FF8C00;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --text: #3C3C3C;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: #fff;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }

/* ========== Sticky nav header ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.nav-link {
  color: var(--brown);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-link:hover { background: var(--beige-1); }
.nav-link.disabled {
  color: var(--gray-400);
  pointer-events: none;
  opacity: 0.4;
}
.nav-center {
  font-weight: 700;
  color: var(--gray-800);
}

/* ========== Scroll-snap sections ========== */
.section {
  min-height: calc(100vh - 60px);
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  scroll-snap-align: start;
  border-bottom: 1px solid var(--gray-100);
}
.section-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brown);
  margin-bottom: 12px;
}
.section h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.section h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 28px 0 12px;
}
.section .subtitle {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 28px;
}

/* ========== Cover (portada) ========== */
.cover {
  background: linear-gradient(135deg, var(--beige-1) 0%, var(--beige-2) 50%, #FFFFFF 100%);
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cover img.logo { height: 96px; margin-bottom: 24px; }
.cover h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--brown);
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}
.cover .cover-sub {
  font-size: 1.2rem;
  color: var(--brown-dark);
  margin-bottom: 36px;
}
.cover .pillar-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  max-width: 720px;
}
.pillar-badge {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brown);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.pillar-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--brown);
  color: white;
}

/* ========== KPI grid ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: white;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.kpi-card.brown {
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: white;
  border: none;
}
.kpi-card.green {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  border: none;
}
.kpi-icon { font-size: 1.6rem; margin-bottom: 10px; }
.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--brown);
}
.kpi-card.brown .kpi-value, .kpi-card.green .kpi-value { color: white; }
.kpi-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
}
.kpi-card.brown .kpi-label, .kpi-card.green .kpi-label { color: rgba(255,255,255,0.9); }
.kpi-sublabel {
  font-size: 0.75rem;
  margin-top: 6px;
  opacity: 0.75;
}

/* ========== Funnel table (idéntica a dashboard.html) ========== */
.funnel-container {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}
.funnel-table { width: 100%; border-collapse: collapse; }
.funnel-table thead { background: var(--gray-50); }
.funnel-table th {
  padding: 12px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.funnel-table th:first-child { text-align: left; padding-left: 22px; }
.funnel-table th.weekly-header { background: rgba(139,69,19,0.08); color: var(--brown); }
.funnel-table th.monthly-header { background: rgba(40,167,69,0.08); color: var(--green); }
.funnel-table td {
  padding: 14px;
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.92rem;
}
.funnel-table td:first-child {
  text-align: left;
  padding-left: 22px;
  font-weight: 600;
  color: var(--gray-800);
}
.funnel-table tbody tr:hover { background: var(--gray-50); }
.funnel-table tbody tr:last-child td { border-bottom: none; }
.value-current { font-weight: 700; color: var(--gray-900); }
.value-previous { color: var(--gray-500); }
.delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.78rem;
  min-width: 64px;
}
.delta.positive { background: rgba(40,167,69,0.12); color: var(--green); }
.delta.negative { background: rgba(220,53,69,0.12); color: var(--red); }
.delta.neutral  { background: var(--gray-100); color: var(--gray-600); }

/* ========== Charts ========== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-card-title { font-size: 0.95rem; font-weight: 700; color: var(--gray-800); }
.chart-legend { display: flex; gap: 14px; font-size: 0.78rem; color: var(--gray-600); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.legend-dot.this { background: var(--brown); }
.legend-dot.prev { background: var(--gray-300); }
.chart-canvas-wrap { height: 260px; position: relative; }

/* ========== Leads table ========== */
.leads-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  font-size: 0.92rem;
}
.leads-table th {
  background: var(--gray-50);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}
.leads-table td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.leads-table tbody tr:last-child td { border-bottom: none; }
.lead-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lead-status.prospecto         { background: rgba(108,117,125,0.15); color: var(--gray-700); }
.lead-status.en_conversacion   { background: rgba(255,140,0,0.15);   color: var(--orange); }
.lead-status.propuesta_enviada { background: rgba(139,69,19,0.15);   color: var(--brown); }
.lead-status.cerrado_ganado    { background: rgba(40,167,69,0.15);   color: var(--green); }
.lead-status.cerrado_perdido   { background: rgba(220,53,69,0.15);   color: var(--red); }

.callout {
  background: linear-gradient(135deg, var(--beige-1), var(--beige-2));
  border-left: 4px solid var(--brown);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 16px 0;
}
.callout h4 {
  color: var(--brown);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.callout ul { padding-left: 20px; }
.callout li { margin-bottom: 6px; line-height: 1.55; }

/* ========== Instagram posts ========== */
.ig-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 800px) { .ig-posts { grid-template-columns: 1fr; } }
.ig-post {
  background: white;
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.ig-post-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--gray-100);
  border-radius: 10px;
  margin-bottom: 12px;
  object-fit: cover;
  display: block;
}
.ig-post-caption {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ig-post-stats {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 600;
}

/* ========== Realizado / GLP-1 lists ========== */
.task-group { margin-bottom: 22px; }
.task-group-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--brown);
  font-weight: 700;
  margin-bottom: 10px;
}
.task-list {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.task-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-item:last-child { border-bottom: none; }
.task-item-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.95rem;
}
.task-item-desc {
  font-size: 0.86rem;
  color: var(--gray-600);
  line-height: 1.5;
}
.task-item-link {
  font-size: 0.78rem;
  color: var(--brown);
  font-weight: 600;
  text-decoration: underline;
}

/* ========== Live dashboard button ========== */
.btn-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brown);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 14px;
  transition: background 0.15s;
}
.btn-live:hover { background: var(--brown-dark); }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .section { padding: 40px 18px; }
  .section h2 { font-size: 1.7rem; }
  .cover h1 { font-size: 2rem; }
  .cover .cover-sub { font-size: 1rem; }
  .nav { padding: 10px 14px; font-size: 0.8rem; }
  .funnel-table { font-size: 0.78rem; }
  .funnel-table th, .funnel-table td { padding: 10px 6px; }
}

/* ========== Notes Drawer (panel lateral colapsable) ========== */
.notes-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brown);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.notes-toggle:hover {
  transform: translateY(-2px);
  background: var(--brown-dark);
}
.notes-toggle .icon {
  width: 24px;
  height: 24px;
  stroke: white;
}
.notes-toggle .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: var(--red);
  color: white;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid white;
}
.notes-toggle .badge.visible { display: flex; }

.notes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 92vw;
  background: white;
  z-index: 1200;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--gray-200);
}
.notes-drawer.open { transform: translateX(0); }

.notes-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--beige-1) 0%, var(--beige-2) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.notes-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}
.notes-drawer-title .icon { width: 22px; height: 22px; color: var(--brown); }
.notes-drawer-close {
  background: transparent;
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
}
.notes-drawer-close:hover { background: rgba(0,0,0,0.06); color: var(--gray-900); }

.notes-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 100px;
}

.notes-section {
  margin-bottom: 18px;
}
.notes-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brown);
  margin-bottom: 8px;
}
.notes-section-label .icon { width: 14px; height: 14px; }
.notes-section textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s, background 0.15s;
}
.notes-section textarea:focus {
  outline: none;
  border-color: var(--brown);
  background: white;
}
.notes-section textarea::placeholder { color: var(--gray-500); }

.notes-drawer-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  background: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notes-status {
  font-size: 0.78rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notes-status.success { color: var(--green); }
.notes-status.error { color: var(--red); }
.notes-status.loading { color: var(--brown); }
.notes-status .icon { width: 14px; height: 14px; }
.notes-actions { display: flex; gap: 8px; }
.notes-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
}
.notes-btn-primary { background: var(--brown); color: white; }
.notes-btn-primary:hover:not(:disabled) { background: var(--brown-dark); }
.notes-btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.notes-btn-secondary:hover { background: var(--gray-200); }
.notes-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.notes-btn .icon { width: 14px; height: 14px; }

@media (max-width: 600px) {
  .notes-drawer { width: 100vw; }
  .notes-toggle { right: 16px; bottom: 16px; width: 48px; height: 48px; }
}
