/* Michroma y Manrope: tipografías de la app Essential, alojadas localmente (assets/fonts, OFL-1.1) */
@font-face { font-family: "Michroma"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/Michroma-Regular.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/Manrope-400.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/Manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/Manrope-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/Manrope-700.woff2") format("woff2"); }

/* ==========================================================================
   Réplicas de pantallas de Simian Sage Essential (Finanzas, Potenciales, Dashboard)
   Mismo diseño que la app: Michroma para títulos y cifras, Manrope para el texto.
   ========================================================================== */

:root {
  --app-display: "Michroma", var(--font);
  --app-body: "Manrope", var(--font);
  --app-bg: #f6f8fb;
  --app-line: #e8ebf0;
  --app-muted: #6b7280;
  --app-green: #10b981;
  --app-amber: #f59e0b;
  --app-red: #ef4444;
}

/* Tipografías de la app también en la réplica del dashboard */
.dash-hello { font-family: var(--app-display); font-weight: 400; letter-spacing: 0; }
.dash-msg, .kpi span { font-family: var(--app-body); }
.kpi strong { font-family: var(--app-display); font-weight: 400; letter-spacing: 0; }

/* ---------- Marco común ---------- */
.app-shot {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.35);
  font-family: var(--app-body);
  container-type: inline-size;
}
.app-body { padding: 16px; background: var(--app-bg); display: grid; gap: 12px; }
.app-shot figcaption { padding: 8px 16px 10px; font-size: 12px; color: var(--muted); text-align: right; background: var(--app-bg); font-family: var(--font); }

/* ---------- Finanzas ---------- */
.fin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fin-kpi { padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--app-line); min-width: 0; }
.fin-kpi span { display: block; font-size: 9px; font-weight: 600; letter-spacing: .1em; color: var(--app-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-kpi strong { display: block; margin-top: 8px; font-family: var(--app-display); font-weight: 400; font-size: clamp(14px, 1.5vw, 19px); color: var(--text); white-space: nowrap; }
.fin-kpi.is-green strong { color: var(--app-green); }
.fin-kpi.is-amber strong { color: var(--app-amber); }
.fin-kpi.is-red strong { color: var(--app-red); }

.app-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #eceff3; overflow-x: auto; scrollbar-width: none; }
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs button {
  flex: none; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font: 600 12.5px/1.2 var(--app-body); color: var(--app-muted); transition: background .2s, color .2s, box-shadow .2s;
}
.app-tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.app-table-wrap, .leads-list { border-radius: 12px; background: #fff; border: 1px solid var(--app-line); overflow: hidden; transition: opacity .3s ease; }
.app-table-wrap.is-out, .leads-list.is-out, .leads-board.is-out { opacity: 0; }
.app-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.app-table th {
  padding: 10px 12px; text-align: left; background: #f6f7f9; border-bottom: 1px solid var(--app-line);
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--app-muted); white-space: nowrap;
}
.app-table td { padding: 11px 12px; border-bottom: 1px solid #f0f2f5; color: var(--text); white-space: nowrap; }
.app-table tr:last-child td { border-bottom: 0; }
.app-table td b { font-weight: 700; }
.app-table td small { display: block; color: var(--app-muted); font-size: 11.5px; margin-top: 1px; }
.app-btn { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.app-btn-lg { padding: 8px 14px; font-size: 12.5px; }
.app-ghost { display: inline-block; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--app-line); font-size: 11.5px; font-weight: 600; }
.app-days { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #fee2e2; color: #dc2626; font-size: 11px; font-weight: 700; }
.app-count { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e0e7ff; color: #4338ca; font-size: 11px; font-weight: 700; }

/* ---------- Potenciales ---------- */
.leads-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-search, .app-select {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: 9px; background: #fff; border: 1px solid var(--app-line); font-size: 12.5px; color: var(--app-muted); white-space: nowrap;
}
.app-search { flex: 1 1 180px; }
.app-search .i { width: 15px; height: 15px; }
.app-select { color: var(--text); }
.app-select::after { content: ""; width: 6px; height: 6px; margin-left: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.leads-views { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #eceff3; margin-left: auto; }
.leads-views button { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--app-muted); cursor: pointer; }
.leads-views button .i { width: 16px; height: 16px; }
.leads-views button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill-green { background: #d1fae5; color: #047857; }
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-violet { background: #ede9fe; color: #6d28d9; }

.leads-board { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; transition: opacity .3s ease; }
.board-col { padding: 10px; border-radius: 12px; background: #eef1f5; display: grid; align-content: start; gap: 8px; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; font-size: 12.5px; font-weight: 700; border-bottom: 2px solid var(--blue); }
.board-head span { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; font-size: 11px; color: var(--app-muted); }
.board-head.is-green { border-color: var(--blue); }
.board-head.is-blue { border-color: #8b5cf6; }
.board-head.is-orange { border-color: #f97316; }
.board-head.is-teal { border-color: #14b8a6; }
.board-card { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); font-size: 12.5px; }
.board-card b { display: block; font-weight: 700; }
.board-card small { display: block; color: var(--app-muted); margin-top: 2px; }
.board-card em { display: block; font-style: normal; color: var(--app-muted); font-size: 11.5px; margin-top: 8px; padding-top: 6px; border-top: 1px solid #f0f2f5; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .leads-toolbar .app-select:nth-of-type(3), .leads-toolbar .app-select:nth-of-type(4) { display: none; }
}
@media (max-width: 760px) {
  .app-table .col-opt { display: none; }
  .leads-board { grid-template-columns: repeat(2, 1fr); }
  .leads-toolbar .app-select { display: none; }
}
@media (max-width: 560px) {
  .fin-kpis { grid-template-columns: 1fr 1fr; }
  .app-table .col-act { display: none; }
  .app-table td, .app-table th { padding: 9px 8px; }
  .app-btn-lg { display: none; }
  .app-body { padding: 10px; }
}

/* Se adapta al ancho real de la réplica (no al de la ventana) */
@container (max-width: 700px) {
  .app-table .col-act { display: none; }
  .app-table td:first-child { white-space: normal; }
  .fin-kpi span { white-space: normal; line-height: 1.25; min-height: 2.5em; }
  .app-table td, .app-table th { padding: 9px 9px; }
  .app-table { font-size: 12px; }
}
@container (max-width: 470px) {
  .app-fin .app-table th:nth-child(3), .app-fin .app-table td:nth-child(3) { display: none; }
  .app-leads .app-table th:nth-child(5), .app-leads .app-table td:nth-child(5) { display: none; }
  .app-table { font-size: 11.5px; }
  .app-table td, .app-table th { padding: 8px 7px; }
  .app-table th { font-size: 9px; letter-spacing: .06em; }
}

/* Red de seguridad: si aun así no cabe, la tabla se desplaza dentro de su marco */
.app-table-wrap, .leads-list { overflow-x: auto; scrollbar-width: thin; }
