/* ==========================================================================
   COME2GROW AGENCY OS · SAAS EXECUTIVE LIGHT THEME
   Inspired by: Vertix / Cadra Manufacturing ERP / Content-OS
   Authority: Plan Maestro V2 & Dirección Humana (Iteración 6)
   Clean paper #F7F8FA, rounded 16px cards, slidePill horizontal nav,
   1 Hero Dark Card #111315, 1 Ice Blue Accent Card #DCE7FE, Cycle Timeline.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg-page: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F9FAFB;
  --bg-surface-subtle: #F1F3F5;
  --border-subtle: #EAECEF;
  --border-strong: #D5D9DE;
  
  --text-primary: #111315;
  --text-secondary: #4B5563;
  --text-muted: #8E95A0;
  
  --hero-dark: #111315;
  --hero-dark-surface: #1C1E23;
  --hero-dark-border: #2D3139;
  
  --ice-blue-card: #DCE7FE;
  --ice-blue-card-border: #BFDBFE;
  --ice-blue-text: #1E40AF;
  --ice-blue-muted: #3B82F6;
  
  --accent-blue: #2563EB;
  --accent-blue-light: #EFF6FF;
  --accent-emerald: #059669;
  --accent-emerald-light: #ECFDF5;
  --accent-amber: #D97706;
  --accent-amber-light: #FFFBEB;
  --accent-rose: #DC2626;
  --accent-rose-light: #FEF2F2;
  --accent-purple: #7C3AED;
  --accent-purple-light: #F5F3FF;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(17, 19, 21, 0.04);
  --shadow-card: 0 2px 8px rgba(17, 19, 21, 0.03), 0 12px 24px rgba(17, 19, 21, 0.02);
  --shadow-hero: 0 12px 36px rgba(17, 19, 21, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TOP BAR & EXECUTIVE HEADER
   ========================================================================== */
header.agency-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-badge {
  background: var(--text-primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

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

.system-telemetry {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.telemetry-pill {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.status-dot.busy {
  background: var(--accent-amber);
  animation: pulseDot 1s infinite alternate;
}

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

/* ==========================================================================
   SLIDEPILL HORIZONTAL NAVIGATION (CADRA / VERTIX STYLE)
   ========================================================================== */
.view-tabs-wrapper {
  background: var(--bg-page);
  padding: 1rem 2rem 0.25rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

nav.view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.48rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tab-btn.active {
  background: var(--text-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(17, 19, 21, 0.15);
}

.tab-badge {
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* ==========================================================================
   MAIN CONTENT AREA & GRID
   ========================================================================== */
.content-area {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 2rem 3rem 2rem;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CARDS (16px Radius, SaaS Light Standard)
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ==========================================================================
   DISTINCTIVE CARDS: HERO DARK & ICE BLUE
   ========================================================================== */
.card-hero-dark {
  background: var(--hero-dark);
  color: #FFFFFF;
  border: 1px solid var(--hero-dark-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-hero);
  margin-bottom: 1.25rem;
}

.card-hero-dark h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.card-hero-dark p {
  color: #9CA3AF;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.card-ice-blue {
  background: var(--ice-blue-card);
  color: var(--ice-blue-text);
  border: 1px solid var(--ice-blue-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-ice-blue h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--ice-blue-text);
}

.card-ice-blue p {
  font-size: 0.85rem;
  color: #2563EB;
  margin-bottom: 1rem;
}

/* ==========================================================================
   HORIZONTAL CYCLE TIMELINE (CONTENT-OS STYLE)
   ========================================================================== */
.cycle-timeline-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

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

.cycle-timeline {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 900px;
  padding: 0.5rem 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  position: relative;
  z-index: 2;
}

.timeline-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface-subtle);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.timeline-step.passed .timeline-step-icon {
  background: var(--accent-emerald-light);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.timeline-step.active .timeline-step-icon {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(17, 19, 21, 0.1);
}

.timeline-step.gate .timeline-step-icon {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.timeline-step-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.timeline-step-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.timeline-connector {
  position: absolute;
  top: 24px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--text-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #25282E;
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-strong);
}

.btn-ice {
  background: #FFFFFF;
  color: var(--ice-blue-text);
  border-color: var(--ice-blue-card-border);
  font-weight: 700;
}

.btn-ice:hover {
  background: #EFF6FF;
}

.btn-cyan {
  background: #EFF6FF;
  color: var(--accent-blue);
  border-color: #DBEAFE;
}

.btn-cyan:hover {
  background: #DBEAFE;
}

.btn-blue {
  background: var(--accent-blue);
  color: #FFFFFF;
}

.btn-emerald {
  background: var(--accent-emerald);
  color: #FFFFFF;
}

.btn-rose {
  background: var(--accent-rose);
  color: #FFFFFF;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-cyan { background: #EFF6FF; color: var(--accent-blue); }
.badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.badge-amber { background: var(--accent-amber-light); color: var(--accent-amber); }
.badge-rose { background: var(--accent-rose-light); color: var(--accent-rose); }
.badge-purple { background: var(--accent-purple-light); color: var(--accent-purple); }

/* ==========================================================================
   TABLES (EXECUTIVE LIGHT)
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.data-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-surface-hover);
}

/* ==========================================================================
   AGENT WORKSPACE (METRICOLADO STUDIO - LIGHT ISOMETRIC STATIONS)
   ========================================================================== */
.agent-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.agent-station-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.agent-station-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
}

.agent-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.agent-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.75rem;
}

/* Pipeline Board columns */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
}

.pipeline-col {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  min-height: 180px;
}

.pipeline-col-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-align: center;
}

.pipeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  box-shadow: var(--shadow-sm);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 21, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 90%;
  padding: 1.75rem;
  box-shadow: var(--shadow-hero);
}
