/* =====================================================================
   PANEL CORPORATIVO — Tema rojo / blanco / negro
   Todos los colores son variables: cambia estos valores y cambia todo.
   ===================================================================== */
:root {
  /* Paleta principal */
  --red: #d81f2a;
  --red-dark: #a5121b;
  --red-soft: #fbe7e8;
  --black: #14151a;
  --ink: #1c1d22;        /* texto principal */
  --white: #ffffff;

  /* Neutros */
  --bg: #f4f5f7;         /* fondo de la app */
  --panel: #ffffff;      /* tarjetas */
  --border: #e5e7eb;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  /* Estados */
  --ok: var(--black);
  --prog: var(--red);
  --pend: #c9ccd3;

  /* Medidas */
  --radius: 12px;
  --sidebar-w: 256px;
  --shadow: 0 1px 2px rgba(20,21,26,.06), 0 4px 16px rgba(20,21,26,.05);

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
.muted { color: var(--muted); }
code { background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  background: var(--black); color: #d6d8de; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 20px; letter-spacing: -1px;
  box-shadow: 0 4px 14px rgba(216,31,42,.45);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-weight: 800; font-size: 15px; letter-spacing: .5px; color: #fff; }
.logo-sub { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; color: #b5b8c0; cursor: pointer;
  padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 500;
  font-family: inherit; transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(216,31,42,.35); }

.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.foot-phase { display: inline-block; font-size: 12px; font-weight: 600; color: #fff; background: rgba(255,255,255,.08); padding: 5px 11px; border-radius: 999px; margin-bottom: 10px; }
.foot-note { font-size: 11px; color: var(--muted-2); }

/* ===================== ÁREA PRINCIPAL ===================== */
.main-area { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 32px; background: var(--white); border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.crumb { margin: 3px 0 0; font-size: 13px; }
.crumb #empresa-nombre-top { font-weight: 600; color: var(--ink); }
.fase { background: var(--red-soft); color: var(--red-dark); border: 1px solid #f3c9cc; padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 700; }

main { padding: 28px 32px; flex: 1; }
.view { display: none; }
.view.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.section-intro { margin-bottom: 18px; max-width: 720px; }

/* KPI cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.card .k { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.card .l { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.panel h2 { margin: 0 0 18px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
canvas { max-height: 280px; }

/* Hitos */
.hitos { display: flex; flex-direction: column; gap: 10px; }
.hito { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); }
.hito .badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 2px solid var(--border); color: transparent; }
.hito.done .badge { background: var(--red); color: #fff; border-color: var(--red); }
.hito .htxt { font-weight: 500; }
.hito.done .htxt { color: var(--muted); text-decoration: line-through; }
.hito .fecha { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }

/* Identidad */
.about p { margin: 8px 0; }
.about b { color: var(--red); font-weight: 700; }

/* ===================== TAREAS (kanban) ===================== */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.col h3 { margin: 0 0 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; display: flex; justify-content: space-between; align-items: center; }
.col h3 .count { color: #fff; background: var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.col.done h3 .count { background: var(--red); }
.task { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 13px; margin-bottom: 10px; border-left: 3px solid var(--pend); transition: box-shadow .15s, transform .15s; }
.task:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.task.alta { border-left-color: var(--red); }
.task.media { border-left-color: var(--ink); }
.task.baja { border-left-color: var(--pend); }
.task .area { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 5px; margin-bottom: 8px; }
.task .t { font-size: 14px; font-weight: 600; }
.task .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.pill .pdot { width: 7px; height: 7px; border-radius: 50%; }

/* ===================== EQUIPO ===================== */
.socio { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.socio .avatar { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 20px; }
.socio h3 { margin: 14px 0 2px; font-size: 17px; font-weight: 700; }
.socio .rol { color: var(--red); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.socio ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.socio ul li { margin-bottom: 4px; }

/* ===================== AGENTES ===================== */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.agent { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; }
.agent-head { display: flex; align-items: center; gap: 13px; }
.agent .ava { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--black); color: #fff; flex-shrink: 0; }
.agent .ava svg { width: 24px; height: 24px; }
.agent h3 { margin: 0; font-size: 16px; font-weight: 700; }
.agent .fn { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.status { position: absolute; top: 20px; right: 20px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.status .sdot { width: 7px; height: 7px; border-radius: 50%; }
.status.activo { background: var(--red-soft); color: var(--red-dark); }
.status.activo .sdot { background: var(--red); }
.status.desarrollo { background: #f3f4f6; color: var(--ink); }
.status.desarrollo .sdot { background: var(--muted-2); }
.status.inactivo { background: #f3f4f6; color: var(--muted); }
.status.inactivo .sdot { background: var(--muted-2); }
.agent .desc { color: var(--muted); font-size: 13px; margin: 14px 0; }
.progress { margin-top: 14px; }
.progress .plabel { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.progress .ptrack { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress .pfill { height: 100%; background: var(--red); border-radius: 999px; }
.agent .stats { display: flex; gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.agent .stat { }
.agent .stat .sv { font-size: 20px; font-weight: 800; }
.agent .stat .sl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* ===================== ORGANIGRAMA ===================== */
.org { display: flex; flex-direction: column; align-items: center; }
.node { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 13px 20px; text-align: center; min-width: 180px; box-shadow: var(--shadow); }
.org > .node { border-top: 3px solid var(--red); }
.node .n-t { font-weight: 700; font-size: 14px; }
.node .n-r { color: var(--muted); font-size: 12px; margin-top: 2px; }
.org-children { display: flex; gap: 22px; margin-top: 26px; position: relative; flex-wrap: wrap; justify-content: center; }
.connector { width: 2px; height: 26px; background: var(--border); }

/* ===================== IDEAS ===================== */
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.idea { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 3px solid var(--red); }
.idea h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.idea p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.idea .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
.tag.nueva { background: var(--red-soft); color: var(--red-dark); border-color: #f3c9cc; }
.tag.asignada { background: #eef2ff; color: #3730a3; border-color: #dddef7; }
.tag.en_progreso { background: #fff7ed; color: #9a3412; border-color: #fde3c8; }
.tag.resuelta { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===================== GUÍA DE INICIO ===================== */
.g-hero { background: var(--black); color: #fff; border-radius: var(--radius); padding: 28px 30px; margin-bottom: 26px; border-left: 5px solid var(--red); }
.g-hero h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.g-hero p { margin: 0; color: #d6d8de; font-size: 15px; max-width: 780px; }
.g-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--red); margin: 30px 0 16px; }

.g-concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.g-concept { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-top: 3px solid var(--red); }
.g-concept h4 { margin: 0 0 7px; font-size: 15px; font-weight: 700; }
.g-concept p { margin: 0; color: var(--muted); font-size: 13px; }

.g-steps { display: flex; flex-direction: column; gap: 14px; }
.g-step { display: flex; gap: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.g-num { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.g-step-body h4 { margin: 4px 0 6px; font-size: 15px; font-weight: 700; }
.g-step-body p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.g-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--red); text-decoration: none; background: var(--red-soft); padding: 5px 11px; border-radius: 7px; border: 1px solid #f3c9cc; word-break: break-all; }
.g-link:hover { background: var(--red); color: #fff; }

.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .g-grid { grid-template-columns: 1fr; } }
.g-list { margin: 0; padding-left: 0; list-style: none; }
.g-list li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.g-list li:last-child { border-bottom: 0; }
.g-list li b { color: var(--ink); }
.g-list.rec li b { color: var(--red); }
.g-steps-list { margin: 0; padding-left: 20px; }
.g-steps-list li { padding: 5px 0; font-size: 13px; color: var(--muted); }
.g-steps-list li::marker { color: var(--red); font-weight: 700; }
.g-nota { background: var(--red-soft); border: 1px solid #f3c9cc; border-left: 4px solid var(--red); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; font-size: 13px; color: var(--red-dark); font-weight: 500; }

/* Footer */
.foot { display: flex; justify-content: space-between; padding: 18px 32px; border-top: 1px solid var(--border); font-size: 12px; background: var(--white); flex-wrap: wrap; gap: 8px; }
.foot code { background: var(--bg); color: var(--red-dark); border: 1px solid var(--border); }

/* Responsive: sidebar colapsa arriba en móvil */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: column; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item span { display: none; }
  .nav-item { padding: 11px; }
}

/* =====================================================================
   CATÁLOGO DE 100 NEGOCIOS (sección "Catálogo")
   Todo con prefijo .cat- para no chocar con el resto del panel.
   ===================================================================== */
.cat-formula { font-size: 12px; font-weight: 700; color: var(--red-dark); background: var(--red-soft); border: 1px solid #f3c9cc; border-radius: 8px; padding: 9px 12px; display: inline-block; margin: 12px 0 0; }
.cat-enlaces { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cat-enlaces a { font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: var(--bg); }
.cat-enlaces a:hover { border-color: var(--red); color: var(--red); }

.cat-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cat-cifra { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 7px; }
.cat-cifra .cat-valor { font-size: 22px; font-weight: 800; color: var(--red); letter-spacing: -.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.cat-cifra .cat-que { font-size: 12.5px; color: var(--ink); margin: 0; }
.cat-cifra .cat-implica { font-size: 12px; color: var(--muted); margin: 0; border-top: 1px dashed var(--border); padding-top: 7px; }
.cat-cifra a { font-size: 11px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); align-self: flex-start; }
.cat-cifra a:hover { color: var(--red); border-color: var(--red); }
.cat-aviso { font-size: 12px; margin: 16px 0 0; border-top: 1px solid var(--border); padding-top: 12px; }

.cat-medias { display: grid; gap: 9px; }
.cat-media { display: grid; grid-template-columns: 200px 1fr 46px; align-items: center; gap: 12px; font-size: 12.5px; }
.cat-media b { color: var(--ink); font-weight: 600; }
.cat-media .cat-barra { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cat-media .cat-barra span { display: block; height: 100%; background: var(--red); }
.cat-media .cat-nota { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .cat-media { grid-template-columns: 1fr 40px; } .cat-media .cat-barra { grid-column: 1 / -1; } }

.cat-filtros { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 18px; }
.cat-filtros input, .cat-filtros select { font: inherit; font-size: 12.5px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--ink); }
.cat-filtros input { flex: 1 1 220px; min-width: 170px; }
.cat-filtros input:focus-visible, .cat-filtros select:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.cat-cuenta { font-size: 12px; color: var(--muted); margin-left: auto; }
.cat-cuenta b { color: var(--ink); font-weight: 700; }

.cat-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cat-ficha { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--white); display: flex; flex-direction: column; gap: 9px; position: relative; }
.cat-ficha.cat-top { border-color: var(--red); }
.cat-cab { display: flex; align-items: baseline; gap: 10px; }
.cat-puesto { font-size: 11px; font-weight: 800; color: var(--red); letter-spacing: .5px; white-space: nowrap; }
.cat-ficha h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.cat-ficha .cat-desc { margin: 0; font-size: 12.5px; color: var(--muted); }
.cat-ficha .cat-dato { margin: 0; font-size: 12.5px; color: var(--ink); }
.cat-ficha .cat-dato b { color: var(--muted); font-weight: 700; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; display: block; }
.cat-ficha .cat-ojo { margin: 0; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 9px; }
.cat-ficha .cat-ojo b { color: #8a6410; font-weight: 700; }
.cat-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-etiqueta { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.cat-etiqueta.cat-si { border-color: var(--red); color: var(--red-dark); background: var(--red-soft); }
.cat-notas { display: flex; gap: 14px; border-top: 1px solid var(--border); padding-top: 9px; font-size: 11px; color: var(--muted); }
.cat-notas span b { display: block; color: var(--ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cat-notas .cat-final b { color: var(--red); }
.cat-vacio { font-size: 13px; color: var(--muted); padding: 20px 0; }
