:root {
  --navy: #1a2744;
  --navy-dark: #0f1a30;
  --navy-light: #243460;
  --gold: #B8860B;
  --gold-bright: #DAA520;
  --gold-pale: #FDF6E3;
  --gold-border: #e8c84a;
  --bg: #f4f6fb;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(26,39,68,0.10);
  --shadow-lg: 0 8px 32px rgba(26,39,68,0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;

  /* status colors */
  --c-cerrado: #16a34a;
  --c-cerrado-bg: #dcfce7;
  --c-encurso: #d97706;
  --c-encurso-bg: #fef3c7;
  --c-recurrente: #2563eb;
  --c-recurrente-bg: #dbeafe;
  --c-pendiente: #9333ea;
  --c-pendiente-bg: #f3e8ff;
  --c-vencido: #dc2626;
  --c-vencido-bg: #fee2e2;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── NAV ─────────────────────────────────────────────────────── */
nav {
  background: var(--navy);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 2rem;
  text-decoration: none;
}
.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.nav-brand-text {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.nav-brand-sub {
  color: var(--gold-bright);
  font-size: 0.7rem;
  display: block;
  font-family: var(--font-body);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}
.nav-link.active {
  background: rgba(218,165,32,0.2);
  color: var(--gold-bright);
}
.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── LAYOUT ──────────────────────────────────────────────────── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}
.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy);
  line-height: 1.2;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

/* ─── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-body { padding: 1.25rem; }

/* ─── KPI BOXES ───────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold-bright);
}
.kpi-box.danger::before { background: var(--c-vencido); }
.kpi-box.success::before { background: var(--c-cerrado); }
.kpi-box.info::before { background: var(--c-recurrente); }
.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin: 4px 0 2px;
}
.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── EXECUTIVE CARDS ─────────────────────────────────────────── */
.exec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.exec-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.exec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.exec-card-header {
  background: var(--navy);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.exec-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.exec-name {
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}
.exec-area {
  color: var(--gold-bright);
  font-size: 0.75rem;
}
.exec-card-body { padding: 1rem 1.25rem; }
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-bar-fill.danger { background: var(--c-vencido); }
.exec-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.exec-stat {
  text-align: center;
  padding: 6px 4px;
  background: var(--bg);
  border-radius: 6px;
}
.exec-stat-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}
.exec-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ─── TABLA DE TAREAS ─────────────────────────────────────────── */
.tareas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.tareas-table thead th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.tareas-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.tareas-table tbody tr:hover { background: #f8faff; }
.tareas-table td {
  padding: 10px 12px;
  vertical-align: top;
}
.tareas-table td.actividad { max-width: 320px; }
.tareas-table td.obs { max-width: 260px; color: var(--text-muted); }

/* ─── STATUS BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}
.badge-cerrado   { background: var(--c-cerrado-bg);   color: var(--c-cerrado); }
.badge-encurso   { background: var(--c-encurso-bg);   color: var(--c-encurso); }
.badge-recurrente{ background: var(--c-recurrente-bg);color: var(--c-recurrente);}
.badge-pendiente { background: var(--c-pendiente-bg); color: var(--c-pendiente);}
.badge-vencido   { background: var(--c-vencido-bg);   color: var(--c-vencido); }

/* ─── BOTONES ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-light); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--navy-dark);
}
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--bg); }
.btn-danger { background: var(--c-vencido); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-icon { padding: 6px 8px; }

/* ─── FORMULARIOS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(218,165,32,0.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ─── MODAL ───────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,50,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  background: var(--navy);
  color: var(--white);
  padding: 1.1rem 1.5rem;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
}
.modal-close:hover { color: white; background: rgba(255,255,255,0.1); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── TIMELINE DE REUNIONES ───────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.timeline-item:hover {
  background: var(--gold-pale);
  border-color: var(--gold-border);
}
.timeline-dot {
  width: 10px; height: 10px;
  background: var(--gold-bright);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.timeline-label { font-size: 0.875rem; font-weight: 500; }

/* ─── ALERT ───────────────────────────────────────────────────── */
.alert {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-danger  { background: var(--c-vencido-bg); color: var(--c-vencido); border: 1px solid #fca5a5; }
.alert-success { background: var(--c-cerrado-bg); color: var(--c-cerrado); border: 1px solid #86efac; }
.alert-info    { background: var(--c-recurrente-bg); color: var(--c-recurrente); border: 1px solid #93c5fd; }

/* ─── CHIPS DE ÁREA ───────────────────────────────────────────── */
.chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── GRID UTILS ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .exec-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 1rem; }
  nav { padding: 0 1rem; }
}

/* ─── MISC ────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-bright); }
.text-navy { color: var(--navy); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.obs-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  resize: none;
  outline: none;
  cursor: text;
}
.obs-input:focus { color: var(--text); }
.saving-indicator {
  font-size: 0.7rem;
  color: var(--gold-bright);
  opacity: 0;
  transition: opacity 0.3s;
}
.saving-indicator.show { opacity: 1; }
