/* Home Travellers — estilos */
:root {
  --ht-green: #1D9E75;
  --ht-green-light: #9FE1CB;
  --ht-green-bg: #E1F5EE;
  --ht-blue: #B5D4F4;
  --ht-blue-strong: #3B82F6;
  --ht-red: #E24B4A;
  --ht-red-bg: #FCEBEB;
  --ht-yellow: #EF9F27;
  --ht-yellow-bg: #FAEEDA;
  --ht-text: #222222;
  --ht-text-2: #666666;
  --ht-text-3: #9aa0a6;
  --ht-border: #E0E0E0;
  --ht-border-soft: #EFEFEF;
  --ht-bg: #F5F6F8;
  --ht-bg-card: #FFFFFF;
  --ht-sidebar: #1B2530;
  --ht-sidebar-active: #243140;
  --ht-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --ht-shadow-lg: 0 10px 30px rgba(16,24,40,.12);

  --area-comercial: #3B82F6;
  --area-proyectos: #EF9F27;
  --area-operaciones: #1D9E75;
  --area-finanzas: #7C5CFA;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--ht-text);
  background: var(--ht-bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ── LOGIN ─────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(29,158,117,.08), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(124,92,250,.06), transparent 60%),
    #F5F6F8;
  padding: 40px 24px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--ht-shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 36px 36px 40px;
}
.login-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #1D9E75, #14B89A);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: -.5px;
}
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.login-sub { color: var(--ht-text-2); margin: 4px 0 28px; font-size: 14px; }

.login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.role-card {
  border: 1.5px solid var(--ht-border);
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: left;
}
.role-card:hover { border-color: var(--ht-green); box-shadow: var(--ht-shadow); }
.role-card.active { border-color: var(--ht-green); box-shadow: 0 0 0 3px rgba(29,158,117,.15); }
.role-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px;
  overflow: hidden;
}
.role-avatar image-slot { width: 100%; height: 100%; display: block; }
.role-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.role-role { color: var(--ht-text-2); font-size: 12px; }

.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login-form input {
  flex: 1;
  border: 1.5px solid var(--ht-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.login-form input:focus { border-color: var(--ht-green); }
.btn-primary {
  background: var(--ht-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 22px;
  font-weight: 600;
  font-size: 14px;
  transition: background .15s;
}
.btn-primary:hover { background: #168a64; }
.btn-primary:disabled { background: #b8d8cd; cursor: not-allowed; }
.login-error {
  color: var(--ht-red);
  font-size: 13px;
  margin-top: 10px;
  background: var(--ht-red-bg);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}
.login-hint {
  font-size: 12px;
  color: var(--ht-text-3);
  margin-top: 16px;
}
.login-form .btn-primary { width: 100%; padding: 13px; }

@media (max-width: 480px) {
  .login-page  { padding: 20px 16px; align-items: flex-start; padding-top: 60px; }
  .login-card  { padding: 28px 22px 32px; border-radius: 16px; }
  .login-title { font-size: 18px; }
}

/* ── Mobile layout ───────────────────────────────────────────────── */
.sb-hamburger {
  display: none;
  background: transparent; border: none;
  color: #555; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.sb-hamburger:hover { background: #f0f0f0; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}

@media (max-width: 768px) {
  .sb-hamburger { display: flex; align-items: center; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-260px);
    transition: transform .25s ease;
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 24px rgba(0,0,0,.35);
  }
  .sidebar-overlay.open { display: block; }

  .main { width: 100%; }

  .topbar {
    padding: 11px 14px;
    gap: 10px;
  }
  .topbar .crumb      { display: none; }
  .topbar .title      { font-size: 15px; }
  .topbar .meeting-toggle { display: none; }
  .meeting-banner     { font-size: 12px; padding: 8px 14px; }

  .page { padding: 14px 12px 60px; }
  .area-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .area-header .av { width: 44px; height: 44px; }

  /* KPIs */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-card .val { font-size: 26px; }

  /* Métricas */
  .meta-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .meta-card { padding: 14px 12px; }

  /* Tables — scroll horizontal */
  .tbl-wrap { border-radius: 8px; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 580px; }
  .tbl thead th { padding: 9px 10px; font-size: 11px; }
  .tbl tbody td { padding: 10px; font-size: 12px; }
  /* Ocultar columnas menos importantes en mobile */
  .tbl .col-hide-mobile { display: none; }

  /* Gantt — scroll horizontal */
  .gantt-wrap { padding: 14px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gantt-grid { min-width: 500px; }
  .gantt-legend { display: none; }

  /* Kanban pipeline — 2 cols en mobile, 1 col en muy pequeño */
  .kanban { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kanban-col { padding: 10px; min-height: 120px; }
  .kanban-card { padding: 9px 10px; }

  /* Pipeline summary cards — fila de 2 */
  .pipeline-head { gap: 8px; }
  .pipeline-summary { min-width: calc(50% - 4px); padding: 12px 14px; }
  .pipeline-summary .v { font-size: 20px; }

  /* Pipeline filter bar */
  .filter-bar { gap: 6px; }
  .filter-bar input[type="text"],
  .filter-bar select { font-size: 13px; }

  /* Modales — casi pantalla completa en mobile */
  .modal-back { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }

  /* Área de tareas */
  .tasks-section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tasks-section-head .right { align-self: flex-end; }
  .row-actions { gap: 4px; }
  .row-actions button { padding: 5px 8px; font-size: 12px; }

  /* Sección de eventos/reuniones */
  .event-row, .meeting-row { padding: 10px 12px; gap: 10px; }
  .event-row .meta, .meeting-row .meta { flex-direction: column; gap: 2px; }

  /* Dashboard admin — cards de área */
  .area-cards-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .area-card { padding: 14px 14px; }

  /* Dirección */
  .dir-grid { grid-template-columns: 1fr !important; }

  /* Evaluaciones */
  .eval-grid { grid-template-columns: 1fr !important; gap: 10px; }

  /* Botones de acción flotantes */
  .btn-add { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: 1fr 1fr !important; }
  .kanban { grid-template-columns: 1fr; }
  .pipeline-summary { min-width: 100%; }
  .topbar .title { font-size: 14px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-label { display: none; }
}

/* ── APP SHELL ─────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--ht-sidebar);
  color: #cfd6df;
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sb-brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #1D9E75, #14B89A);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
}
.sb-brand-text { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.sb-brand-sub { color: #8a96a4; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }

.sb-section { padding: 18px 12px 6px; font-size: 11px; color: #6c7682; text-transform: uppercase; letter-spacing: .6px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 1px 8px; border-radius: 8px;
  color: #cfd6df; font-size: 13px; font-weight: 500;
  border: none; background: transparent; width: calc(100% - 16px); text-align: left;
  cursor: pointer; transition: background .12s, color .12s;
}
.sb-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.sb-item.active { background: var(--ht-sidebar-active); color: #fff; }
.sb-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-item .ic { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: .85; }
.sb-spacer { flex: 1; }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sb-user .av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12px; }
.sb-user .nm { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.2; }
.sb-user .rl { font-size: 11px; color: #8a96a4; }
.sb-logout {
  background: transparent; border: none; color: #8a96a4;
  font-size: 12px; padding: 6px 10px; border-radius: 6px;
}
.sb-logout:hover { color: #fff; background: rgba(255,255,255,.06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--ht-border);
}
.topbar .crumb { color: var(--ht-text-2); font-size: 13px; }
.topbar .title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.topbar .spacer { flex: 1; }
.topbar .meeting-toggle {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--ht-border);
  padding: 7px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
}
.topbar .meeting-toggle.active { background: var(--ht-green); color: #fff; border-color: var(--ht-green); }
.topbar .meeting-toggle .led { width: 8px; height: 8px; border-radius: 50%; background: #c0c5cc; }
.topbar .meeting-toggle.active .led { background: #fff; }

.meeting-banner {
  background: linear-gradient(90deg, #1D9E75, #14B89A);
  color: #fff;
  padding: 8px 28px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.meeting-banner .pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.page { padding: 24px 28px 60px; max-width: 1480px; }

/* ── DASHBOARD ─────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.area-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--ht-shadow);
  border-top: 4px solid var(--area-color, #1D9E75);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.area-card:hover { transform: translateY(-2px); box-shadow: var(--ht-shadow-lg); }
.area-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.area-card .area-name { font-weight: 700; font-size: 15px; }
.area-card .semaforo {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.semaforo.verde { background: #E1F5EE; color: #127A56; }
.semaforo.amarillo { background: #FAEEDA; color: #B6750E; }
.semaforo.rojo { background: #FCEBEB; color: #B23636; }
.semaforo .dot { width: 7px; height: 7px; border-radius: 50%; }
.semaforo.verde .dot { background: #1D9E75; }
.semaforo.amarillo .dot { background: #EF9F27; }
.semaforo.rojo .dot { background: #E24B4A; }

.area-card .lider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.area-card .lider-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.area-card .lider-av image-slot, .area-card .lider-av .fb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600; }
.area-card .lider-nm { font-size: 13px; font-weight: 600; }
.area-card .lider-rl { font-size: 11px; color: var(--ht-text-3); }

.area-progress { margin-bottom: 14px; }
.area-progress .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ht-text-2); margin-bottom: 6px; }
.bar { height: 8px; background: #EEF1F4; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--area-color, #1D9E75); transition: width .25s; }

.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stat { background: var(--ht-bg); border-radius: 8px; padding: 8px 6px; text-align: center; }
.mini-stat .v { font-size: 16px; font-weight: 700; line-height: 1.1; }
.mini-stat .l { font-size: 10px; color: var(--ht-text-2); margin-top: 2px; }
.mini-stat.danger .v { color: var(--ht-red); }
.mini-stat.warning .v { color: #B6750E; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.panel {
  background: #fff; border-radius: 14px; box-shadow: var(--ht-shadow);
  padding: 18px 20px;
}
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel h3 .count { color: var(--ht-text-3); font-weight: 500; font-size: 13px; }

.event-row, .meeting-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--ht-border-soft);
}
.event-row:first-child, .meeting-row:first-child { border-top: 0; padding-top: 4px; }
.date-chip {
  width: 50px; min-width: 50px; text-align: center;
  background: var(--ht-bg); border-radius: 8px; padding: 6px 0;
}
.date-chip .d { font-size: 18px; font-weight: 700; line-height: 1; }
.date-chip .m { font-size: 10px; color: var(--ht-text-2); text-transform: uppercase; letter-spacing: .5px; }
.event-row .tit, .meeting-row .tit { font-weight: 600; font-size: 14px; }
.event-row .sub, .meeting-row .sub { font-size: 12px; color: var(--ht-text-2); margin-top: 2px; display: flex; align-items: center; gap: 8px; }

.badge-area {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.badge-area .dot { width: 6px; height: 6px; border-radius: 50%; }

.urgent-list .urgent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--ht-border-soft);
}
.urgent-list .urgent-item:first-child { border-top: 0; }

/* ── AREA VIEW ─────────────────────────────────────────────────── */
.area-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
  background: #fff; border-radius: 14px; padding: 18px 22px;
  box-shadow: var(--ht-shadow);
  border-left: 6px solid var(--area-color);
}
.area-header .av { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; }
.area-header .av image-slot { width: 100%; height: 100%; display: block; }
.area-header h1 { margin: 0 0 2px; font-size: 22px; letter-spacing: -.4px; }
.area-header .meta { color: var(--ht-text-2); font-size: 13px; }
.area-header .spacer { flex: 1; }
.btn-add {
  background: var(--ht-green); color: #fff; border: none;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-add:hover { background: #168a64; }
.btn-ghost {
  background: #fff; color: var(--ht-text); border: 1.5px solid var(--ht-border);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px;
}
.btn-ghost:hover { border-color: var(--ht-green); color: var(--ht-green); }

.kpi-area { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-tile {
  background: #fff; border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--ht-shadow);
  border-left: 4px solid var(--kpi-color);
}
.kpi-tile .l { font-size: 12px; color: var(--ht-text-2); }
.kpi-tile .v { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 4px 0 2px; }
.kpi-tile .m { font-size: 11px; color: var(--ht-text-3); }

/* ── TASK TABLE (Monday-style) ────────────────────────────────── */
.tasks-section { margin-bottom: 28px; }
.tasks-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  padding: 0 4px;
}
.tasks-section-head .lbl { font-weight: 700; font-size: 15px; }
.tasks-section-head.direccion .lbl { color: var(--ht-green); }
.tasks-section-head.propia .lbl { color: var(--ht-blue-strong); }
.tasks-section-head .count { color: var(--ht-text-3); font-size: 13px; font-weight: 500; }
.tasks-section-head .lock { font-size: 12px; color: var(--ht-text-3); display: inline-flex; align-items: center; gap: 4px; }

.tbl-wrap { background: #fff; border-radius: 12px; box-shadow: var(--ht-shadow); overflow: hidden; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ht-text-2);
  background: #fafbfc; border-bottom: 1px solid var(--ht-border);
  padding: 10px 14px; text-transform: uppercase; letter-spacing: .4px;
}
.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ht-border-soft);
  vertical-align: middle;
  font-size: 13px;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.parent { background: #fff; }
.tbl tbody tr.parent:hover { background: #fafbfc; }
.tbl .first-col { border-left: 4px solid var(--row-accent, #cfd6df); padding-left: 14px; }
.tbl .task-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tbl .task-name .caret {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--ht-text-2); flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.tbl .task-name .caret:hover { background: var(--ht-bg); color: var(--ht-text); }
.tbl .task-name .caret.open { transform: rotate(90deg); }
.tbl .lock-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--ht-green-bg); color: var(--ht-green);
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}
.tbl .own-badge {
  background: #DCEAFB; color: var(--ht-blue-strong);
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}

.status-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 110px; padding: 6px 10px;
  font-size: 12px; font-weight: 600; color: #fff;
  border-radius: 6px; cursor: pointer; border: none;
}
.status-pill.disabled { cursor: default; opacity: .9; }

.prio-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  border-radius: 5px;
}
.prio-pill .dot { width: 6px; height: 6px; border-radius: 50%; }

.avatar-sm { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 11px; }
.avatar-sm image-slot { width: 100%; height: 100%; display: block; }

.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.progress-cell .bar { flex: 1; height: 6px; }
.progress-cell .bar > span { background: var(--row-accent, #1D9E75); }
.progress-cell .pct { font-size: 12px; color: var(--ht-text-2); width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.row-actions { display: flex; gap: 4px; }
.icon-btn {
  background: transparent; border: none; padding: 6px;
  border-radius: 6px; color: var(--ht-text-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--ht-bg); color: var(--ht-text); }
.icon-btn.danger:hover { background: var(--ht-red-bg); color: var(--ht-red); }
.icon-btn .badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--ht-red); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 999px; min-width: 14px; height: 14px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn-wrap { position: relative; display: inline-block; }

.subrow-bg { background: #fafbfc; }
.sub-list { padding: 6px 0 4px; }
.sub-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 50px;
  font-size: 13px;
}
.sub-item input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ht-green); }
.sub-item .txt.done { text-decoration: line-through; color: var(--ht-text-3); }
.sub-item .x { margin-left: auto; opacity: 0; }
.sub-item:hover .x { opacity: 1; }
.sub-add {
  display: flex; gap: 8px; padding: 6px 14px 10px 50px;
}
.sub-add input {
  flex: 1; border: 1px solid var(--ht-border); border-radius: 6px;
  padding: 6px 10px; font-size: 13px; outline: none;
}
.sub-add input:focus { border-color: var(--ht-green); }

/* ── GANTT ─────────────────────────────────────────────────────── */
.gantt-wrap { background: #fff; border-radius: 12px; box-shadow: var(--ht-shadow); padding: 18px 20px; }
.gantt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gantt-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.gantt-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ht-text-2); }
.gantt-legend .sw { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }

.gantt-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  border-top: 1px solid var(--ht-border-soft);
}
.gantt-months {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--ht-border-soft);
}
.gantt-months > div { padding: 6px 10px; font-size: 11px; color: var(--ht-text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; border-right: 1px dashed var(--ht-border-soft); }
.gantt-months > div:last-child { border-right: 0; }

.gantt-row { display: contents; }
.gantt-row .name {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ht-border-soft);
  font-size: 12px; color: var(--ht-text);
  display: flex; align-items: center; gap: 8px;
  background: #fafbfc;
}
.gantt-row .name .ind { width: 8px; height: 8px; border-radius: 2px; }
.gantt-row .track {
  position: relative;
  border-bottom: 1px solid var(--ht-border-soft);
  height: 38px;
  background:
    linear-gradient(to right, transparent calc(33.33% - 1px), #EEF1F4 calc(33.33%), transparent calc(33.33% + 1px)),
    linear-gradient(to right, transparent calc(66.66% - 1px), #EEF1F4 calc(66.66%), transparent calc(66.66% + 1px));
}
.gantt-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 18px; border-radius: 4px;
  display: flex; align-items: center; padding: 0 8px;
  font-size: 11px; font-weight: 600; color: #2a2a2a;
  white-space: nowrap; overflow: hidden;
}
.gantt-today {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ht-red);
  z-index: 2;
}
.gantt-today::after {
  content: 'hoy'; position: absolute; top: -16px; left: -10px;
  background: var(--ht-red); color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
}

/* ── EVENTS / REUNIONES ────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-bar .pill {
  background: #fff; border: 1.5px solid var(--ht-border);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--ht-text-2);
}
.filter-bar .pill:hover { border-color: var(--ht-green); color: var(--ht-green); }
.filter-bar .pill.active { background: var(--ht-green); color: #fff; border-color: var(--ht-green); }
.filter-bar .spacer { flex: 1; }

.evt-tbl tbody tr.expanded > td:first-child { border-left: 4px solid var(--area-color, #1D9E75); padding-left: 14px; }
.evt-detail {
  background: #fafbfc;
  padding: 16px 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.evt-detail .field { font-size: 12px; }
.evt-detail .field .l { color: var(--ht-text-2); margin-bottom: 2px; }
.evt-detail .field .v { font-weight: 600; }
.evt-detail .desc { grid-column: 1 / -1; }
.evt-detail .desc .v { font-weight: 400; line-height: 1.5; color: var(--ht-text); background: #fff; border: 1px solid var(--ht-border-soft); padding: 10px 12px; border-radius: 8px; }

/* ── MODALS ────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px;
  max-width: 560px; width: 100%; max-height: 90vh; overflow: auto;
  padding: 24px 26px;
  box-shadow: var(--ht-shadow-lg);
}
.modal h2 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--ht-text-2); font-size: 13px; margin-bottom: 18px; }
.field-grp { margin-bottom: 14px; }
.field-grp label { display: block; font-size: 12px; color: var(--ht-text-2); font-weight: 600; margin-bottom: 4px; }
.field-grp input, .field-grp select, .field-grp textarea {
  width: 100%; border: 1.5px solid var(--ht-border); border-radius: 8px;
  padding: 9px 12px; outline: none;
}
.field-grp input:focus, .field-grp select:focus, .field-grp textarea:focus { border-color: var(--ht-green); }
.field-grp input[type="checkbox"] { width: auto; padding: 0; border: none; flex-shrink: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ── COMMENTS POPOVER ──────────────────────────────────────────── */
.comments-pop {
  position: absolute;
  background: #fff; border-radius: 12px;
  box-shadow: var(--ht-shadow-lg);
  width: 320px;
  padding: 14px 16px;
  z-index: 50;
  border: 1px solid var(--ht-border);
}
.comments-pop h4 { margin: 0 0 10px; font-size: 13px; }
.comment-item { font-size: 12px; padding: 8px 0; border-top: 1px solid var(--ht-border-soft); }
.comment-item:first-child { border-top: 0; }
.comment-item .meta { color: var(--ht-text-2); font-size: 11px; margin-bottom: 2px; }
.comments-pop textarea { width: 100%; border: 1px solid var(--ht-border); border-radius: 6px; padding: 6px; min-height: 50px; resize: vertical; outline: none; font-family: inherit; font-size: 12px; }

/* ── MEETING MODE TWEAKS ───────────────────────────────────────── */
.meeting-mode .row-actions { display: none; }
.meeting-mode .btn-add { display: none; }
.meeting-mode .sub-add { display: none; }
.meeting-mode .sub-item .x { display: none; }
.meeting-mode .status-pill { cursor: default; }

/* expanded comments in meeting mode */
.meeting-comments {
  padding: 8px 14px 12px 50px;
  background: #fafbfc;
}
.meeting-comments .ci {
  font-size: 12px; color: var(--ht-text);
  background: #fff; border: 1px solid var(--ht-border-soft);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 6px;
}
.meeting-comments .ci .who { color: var(--ht-text-2); font-size: 11px; margin-bottom: 2px; }

/* Avatar upload hint on hover */
.avatar-upload-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 10px; font-weight: 600;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}

/* Empty states */
.empty { text-align: center; padding: 32px 16px; color: var(--ht-text-3); font-size: 13px; }

/* ── METAS ─────────────────────────────────────────────────────── */
.metas-section { margin-bottom: 22px; }
.metas-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.metas-section-head .lbl { font-weight: 700; font-size: 15px; }
.metas-section-head .count { color: var(--ht-text-3); font-size: 13px; font-weight: 500; }
.metas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.meta-card {
  background: #fff; border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--ht-shadow);
  position: relative;
  border-left: 4px solid var(--meta-color);
}
.meta-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.meta-card .lbl { font-size: 12px; color: var(--ht-text-2); font-weight: 500; }
.meta-card .periodo { font-size: 10px; color: var(--ht-text-3); text-transform: uppercase; letter-spacing: .5px; }
.meta-card .nums { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 8px; }
.meta-card .actual { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.meta-card .meta-target { font-size: 13px; color: var(--ht-text-3); font-weight: 500; }
.meta-card .bar { height: 6px; background: #EEF1F4; border-radius: 99px; overflow: hidden; }
.meta-card .bar > span { display: block; height: 100%; background: var(--meta-color); border-radius: 99px; transition: width .35s; }
.meta-card .bar-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--ht-text-3); margin-top: 4px; }
.meta-card .bar-foot .pct { font-weight: 700; color: var(--meta-color); }

/* ── PIPELINE ──────────────────────────────────────────────────── */
.pipeline-head { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.pipeline-summary {
  background: #fff; border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--ht-shadow); flex: 1;
  border-left: 4px solid var(--sum-color, #1D9E75);
  min-width: 200px;
}
.pipeline-summary .l { font-size: 12px; color: var(--ht-text-2); }
.pipeline-summary .v { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 4px 0 2px; }
.pipeline-summary .sv { font-size: 11px; color: var(--ht-text-3); }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kanban-col {
  background: #fafbfc; border-radius: 12px; padding: 12px 12px 14px;
  min-height: 200px;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.kanban-col-head .name {
  font-weight: 700; font-size: 13px; padding: 4px 10px;
  border-radius: 6px;
}
.kanban-col-head .count {
  background: #fff; color: var(--ht-text-2);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--ht-border);
}
.kanban-col-head .uf { font-size: 11px; color: var(--ht-text-2); margin-left: auto; font-weight: 600; }
.kanban-card {
  background: #fff; border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  cursor: pointer; transition: box-shadow .12s, transform .12s;
  border-left: 3px solid var(--card-color);
  position: relative;
}
.kanban-card:hover { box-shadow: 0 6px 14px rgba(16,24,40,.08); transform: translateY(-1px); }
.kanban-card .cli { font-weight: 600; font-size: 13px; margin-bottom: 4px; line-height: 1.2; }
.kanban-card .dir { font-size: 11px; color: var(--ht-text-2); line-height: 1.3; }
.kanban-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 11px; }
.kanban-card .uf { font-weight: 700; color: var(--ht-text); font-size: 13px; }
.kanban-card .tip { background: #F4F5F7; padding: 2px 6px; border-radius: 4px; color: var(--ht-text-2); font-weight: 600; }
.kanban-card .broker { font-size: 10px; color: var(--ht-text-3); margin-top: 4px; }

/* ── Cambiar foto ─────────────────────────────────────────────── */
.change-photo-hint {
  position: absolute; bottom: -2px; right: -2px;
  background: var(--ht-green); color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}

/* ── ESTRATEGIAS (morado) ────────────────────────────────────── */

/* Pestañas Operativo / Estrategia */
.area-tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--ht-border);
  margin-bottom: 22px;
  padding: 0 4px;
}
.area-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border: none; background: transparent;
  font-size: 14px; font-weight: 600;
  color: #9aa0a6;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.area-tab:hover { color: #222; }
.area-tab.active {
  color: var(--tab-color, #222);
  border-bottom-color: var(--tab-color, #222);
}
.area-tab.estrategia.active {
  color: #7C3AED;
  border-bottom-color: #7C3AED;
}
.area-tab .tab-count {
  background: #F4F5F7; color: #666;
  padding: 1px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}
.area-tab.active .tab-count {
  background: var(--tab-color, #1D9E75); color: #fff;
}
.area-tab.estrategia.active .tab-count { background: #7C3AED; }

.estr-section { margin-bottom: 28px; }
.estr-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.estr-section-title {
  display: flex; align-items: center; gap: 10px;
}
.estr-section-bar {
  width: 5px; height: 22px; border-radius: 99px;
  background: #7C3AED;
}
.estr-section-name { font-weight: 700; font-size: 16px; color: #7C3AED; letter-spacing: -.2px; }
.estr-section-sub { font-size: 11px; color: #9aa0a6; margin-top: 1px; }
.estr-section-count { font-size: 12px; color: #9aa0a6; font-weight: 500; margin-left: 4px; }

.btn-estr {
  background: #7C3AED; color: #fff; border: none;
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s;
}
.btn-estr:hover { background: #6D28D9; }

.estr-empty {
  background: #FAF7FF; border: 1px dashed #DDD5F5; border-radius: 12px;
  padding: 24px; text-align: center; color: #7C3AED; font-size: 13px;
}

.estr-card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--ht-shadow);
  border-left: 4px solid #7C3AED;
  overflow: hidden;
  transition: box-shadow .15s;
}
.estr-card:hover { box-shadow: 0 4px 14px rgba(124, 58, 237, .12); }
.estr-card.expanded { box-shadow: 0 4px 14px rgba(124, 58, 237, .14); }
.estr-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px;
}
.estr-caret {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: #7C3AED; flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.estr-caret:hover { background: #F1ECFE; }
.estr-caret.open { transform: rotate(90deg); }
.estr-title { font-weight: 700; font-size: 15px; color: #222; letter-spacing: -.2px; }
.estr-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: #666; margin-top: 3px;
  flex-wrap: wrap;
}
.estr-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .5px;
}
.estr-card-actions { display: flex; gap: 4px; }

.estr-resumen {
  margin: 0 16px 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #F1ECFE, #F8F4FF);
  border-radius: 10px;
  border-left: 3px solid #7C3AED;
}
.estr-resumen-label {
  display: block;
  font-size: 10.5px; font-weight: 700; color: #7C3AED;
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 4px;
}
.estr-resumen-text { font-size: 14px; color: #2D1B5E; line-height: 1.5; }

.estr-progress {
  margin: 0 16px 10px;
}
.estr-progress-bar {
  height: 5px; background: #F1ECFE; border-radius: 99px; overflow: hidden;
}
.estr-progress-bar > span {
  display: block; height: 100%; background: #7C3AED; border-radius: 99px; transition: width .25s;
}

.estr-card-body {
  padding: 4px 16px 16px;
  border-top: 1px solid #F4F1FA;
  margin-top: 4px;
}

.estr-decision {
  margin-top: 12px;
  padding: 10px 12px;
  background: #FAFBFC; border-radius: 8px;
}
.estr-decision-label {
  font-size: 10.5px; font-weight: 700; color: #666;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.estr-decision-text { font-size: 13px; line-height: 1.5; color: #333; }

.estr-tareas {
  margin-top: 14px;
}
.estr-tareas-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.estr-tarea {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background .12s;
}
.estr-tarea:hover { background: #FAF7FF; }
.estr-tarea input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.estr-tarea-add {
  margin-top: 8px;
}
.estr-tarea-add input {
  width: 100%;
  border: 1.5px dashed #DDD5F5; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; background: #FAF7FF;
}
.estr-tarea-add input:focus { outline: none; border-color: #7C3AED; border-style: solid; background: #fff; }

/* Mini-resumen dashboard */
.estr-mini {
  padding: 10px 12px;
  background: #FAF7FF;
  border-radius: 8px;
  border-left: 3px solid #7C3AED;
  margin-bottom: 8px;
  transition: background .12s;
}
.estr-mini:hover { background: #F1ECFE; }
.estr-mini-title { font-weight: 600; font-size: 13px; color: #2D1B5E; margin-bottom: 4px; }
.estr-mini-resumen { font-size: 12px; color: #444; line-height: 1.4; }
.estr-mini-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.estr-mini-bar { flex: 1; height: 4px; background: #fff; border-radius: 99px; overflow: hidden; }
.estr-mini-bar > span { display: block; height: 100%; background: #7C3AED; border-radius: 99px; }
.estr-mini-pct { font-size: 10px; color: #7C3AED; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Eventos: outcome fields */
.outcome-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.outcome-block {
  background: var(--ht-green-bg); border-radius: 10px; padding: 12px 14px;
  border-left: 3px solid var(--ht-green);
}
.outcome-block h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #127A56; }
