/* Panel de gerencia (Andrea y su papá) */

body.panel {
  min-height: 100vh;
  background: var(--bg);
  display: grid;
  grid-template-columns: 236px 1fr;
}

/* ---------- Riel lateral ---------- */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}

.rail .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 8px 18px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.rail .brand svg {
  width: 24px;
  height: 24px;
}

.seg {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(17, 18, 20, 0.06);
  margin-bottom: 16px;
}

.seg button {
  flex: auto;
  padding: 0 6px;
  white-space: nowrap;
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: background 200ms, color 200ms, box-shadow 200ms;
}

.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  transition: background 150ms;
}

.nav-item:hover {
  background: rgba(17, 18, 20, 0.04);
}

.nav-item.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.nav-item .badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.nav-item .badge.soft {
  background: rgba(17, 18, 20, 0.08);
  color: var(--ink-2);
}

.rail .me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.rail .me .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* ---------- Contenido ---------- */
.main {
  min-width: 0;
  padding: 22px 28px 40px;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top h1 {
  font-size: 26px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.live .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  color: var(--ok);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi {
  padding: 14px 16px 16px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  text-align: left;
  transition: transform 160ms var(--ease-out), box-shadow 200ms;
}

button.kpi:hover {
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}

button.kpi:active {
  transform: scale(0.985);
}

.kpi .k-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.kpi .k-val {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  font-feature-settings: "tnum", "zero";
}

.kpi .k-val small {
  font-size: 15px;
  color: var(--faint);
  letter-spacing: -0.02em;
}

.kpi .k-sub {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.kpi.bad .k-val {
  color: var(--bad);
}

.meter {
  height: 5px;
  margin-top: 10px;
  border-radius: 3px;
  background: rgba(17, 18, 20, 0.07);
  overflow: hidden;
  display: flex;
}

.meter i {
  display: block;
  height: 100%;
}

/* ---------- Hoy: lista + mapa ---------- */
.today {
  display: grid;
  grid-template-columns: 372px 1fr;
  gap: 14px;
  margin-top: 14px;
  height: calc(100vh - 210px);
  min-height: 560px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.box {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.box-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.box-h h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-row {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  border-top: 1px solid var(--line);
  transition: background 150ms;
}

.alert-row:hover {
  background: rgba(17, 18, 20, 0.025);
}

.alert-row .a-ico {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--bad-bg);
  color: var(--bad);
}

.alert-row .a-ico.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.alert-row b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.alert-row span {
  font-size: 12.5px;
  color: var(--muted);
}

.reps {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.filters {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters button {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(17, 18, 20, 0.04);
}

.filters button.on {
  background: var(--ink);
  color: #fff;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0 16px 10px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(17, 18, 20, 0.045);
  color: var(--muted);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: 13.5px;
  color: var(--ink);
}

.rep-list {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.rep {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background 150ms;
}

.rep:hover {
  background: rgba(17, 18, 20, 0.025);
}

.rep.on {
  background: var(--brand-tint);
}

.av {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9e8e3;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.av .co {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
  object-fit: contain;
}

.rep .r-main {
  flex: 1;
  min-width: 0;
}

.rep .r-main b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.rep .r-main span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.sdot.visita {
  background: var(--ok);
}

.sdot.ruta {
  background: #3b82f6;
}

.sdot.terminada {
  background: var(--ink-2);
}

.score {
  flex: none;
  text-align: right;
}

.score b {
  display: block;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
}

.score span {
  font-size: 11.5px;
  color: var(--muted);
}

.score.bad b {
  color: var(--bad);
}

.score.warn b {
  color: var(--warn);
}

/* Mapa */
.map-box {
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
  font-size: 12px;
  color: var(--ink-2);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.map-hint {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17, 18, 20, 0.82);
  color: #fff;
  font-size: 12.5px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 300ms;
}

/* Marcadores */
.mk-rep {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: 600 10.5px/1 var(--font);
  box-shadow: 0 0 0 2.5px var(--c, var(--ink)), 0 3px 10px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 200ms var(--spring);
}

.mk-rep:hover {
  transform: scale(1.15);
}

.mk-visit {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid #fff;
  color: #fff;
  font: 600 11px/1 var(--font);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 200ms var(--spring);
}

.mk-visit:hover,
.mk-visit.on {
  transform: scale(1.25);
}

.mk-client {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: #fff;
  border: 2px solid var(--bad);
}

.mk-now {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25);
  color: #3b82f6;
}

.maplibregl-popup-content {
  padding: 8px 10px !important;
  border-radius: 10px !important;
  font: 500 12.5px/1.35 var(--font);
  box-shadow: var(--shadow-2) !important;
}

/* ---------- Cajón del vendedor ---------- */
.drawer {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 390px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(calc(100% + 20px));
  transition: transform 520ms var(--ease);
  overflow: hidden;
  z-index: 5;
}

.drawer.open {
  transform: translateX(0);
}

.d-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.d-head .row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.d-head .av {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.d-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.d-stats div {
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(17, 18, 20, 0.035);
}

.d-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.d-stats span {
  font-size: 11px;
  color: var(--muted);
}

.d-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 20px;
}

.d-alert {
  margin: 10px 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bad-bg);
  color: #8f1f22;
  font-size: 13px;
}

.d-alert b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--bad);
  font-size: 13.5px;
}

.tl {
  position: relative;
  padding: 6px 0 0;
}

.tl-item {
  position: relative;
  padding: 0 14px 0 54px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.tl-item:first-child::before {
  top: 22px;
}

.tl-item:last-child::before {
  bottom: calc(100% - 22px);
}

.tl-dot {
  position: absolute;
  left: 18px;
  top: 10px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2.5px solid #fff;
  color: #fff;
  font: 600 11px/1 var(--font);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.tl-card {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 14px;
  text-align: left;
  transition: background 150ms, box-shadow 200ms;
}

.tl-card:hover {
  background: rgba(17, 18, 20, 0.03);
}

.tl-item.on .tl-card {
  background: var(--surface);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}

.tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tl-top b {
  font-size: 13.5px;
  font-weight: 600;
}

.tl-top .mono {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}

.tl-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.proof-row {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.pf {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ok-bg);
  color: var(--ok);
}

.pf svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.1;
}

.pf.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.pf.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.pf.off {
  background: rgba(17, 18, 20, 0.04);
  color: var(--faint);
}

.flag {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bad);
}

.tl-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 420ms var(--ease);
}

.tl-detail > div {
  overflow: hidden;
}

.tl-item.on .tl-detail {
  grid-template-rows: 1fr;
}

.det {
  padding: 4px 12px 12px;
}

.det-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.det-media figure {
  margin: 0;
  position: relative;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f4f2;
  box-shadow: inset 0 0 0 1px var(--line);
}

.det-media figure svg {
  width: 100%;
  height: 100%;
}

.det-media figcaption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
}

.det-media figure.sig figcaption {
  background: rgba(17, 18, 20, 0.06);
  color: var(--muted);
}

.det h4 {
  margin: 14px 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.det .line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--line-2);
}

.det .line:last-child {
  border-bottom: 0;
}

.quote {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 18, 20, 0.035);
  font-size: 13px;
}

.quote .stars {
  color: #f5b400;
  letter-spacing: 1px;
  font-size: 13px;
}

.quote.bad {
  background: var(--bad-bg);
  color: #8f1f22;
}

.private {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.close-x {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  margin-left: auto;
  color: var(--muted);
}

.close-x:hover {
  background: rgba(17, 18, 20, 0.05);
}

/* ---------- Tablas (Semana / Clientes) ---------- */
.table-box {
  margin-top: 14px;
}

table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.t th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.t th.num,
.t td.num {
  text-align: right;
}

.t th .arr {
  opacity: 0.5;
}

.t td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.t tr:last-child td {
  border-bottom: 0;
}

.t tbody tr {
  transition: background 150ms;
}

.t tbody tr:hover {
  background: rgba(17, 18, 20, 0.02);
}

.t td.num {
  font-family: var(--mono);
  font-feature-settings: "tnum";
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.who .av {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.who .av .co {
  width: 13px;
  height: 13px;
}

.bar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.bar-cell .meter {
  width: 80px;
  margin: 0;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.spark i {
  width: 6px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.75;
}

.spark i.zero {
  background: var(--bad);
  height: 3px !important;
  opacity: 1;
}

.note-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: var(--r);
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 13.5px;
}

/* ---------- Pedidos ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.lane {
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(17, 18, 20, 0.035);
  min-height: 200px;
}

.lane-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 12px;
}

.lane-h h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ocard {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  animation: rise 420ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.ocard .o-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.ocard b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.ocard .o-items {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.ocard .o-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Clientes nuevos ---------- */
.approve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.acard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  overflow: hidden;
  transition: opacity 400ms, transform 400ms var(--ease);
}

.acard.gone {
  opacity: 0;
  transform: scale(0.96);
}

.acard .ph {
  position: relative;
  height: 130px;
  background: #ddd;
}

.acard .ph svg {
  width: 100%;
  height: 100%;
}

.acard .ph .chip {
  position: absolute;
  left: 10px;
  top: 10px;
}

.acard .a-body {
  flex: 1;
  padding: 14px 16px;
}

.acard .a-body p {
  font-size: 12.5px;
  color: var(--muted);
}

.acard .a-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  font-size: 12.5px;
}

.acard .a-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.acard .a-meta span:first-child {
  color: var(--muted);
}

.acard .a-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 18, 20, 0.035);
  font-size: 12.5px;
}

.acard.sus .a-note {
  background: var(--bad-bg);
  color: #8f1f22;
}

.acard .a-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.view {
  animation: viewIn 420ms var(--ease) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }
  .today {
    grid-template-columns: 320px 1fr;
  }
  .approve-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  body.panel {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .rail .brand,
  .rail .me {
    display: none;
  }
  .seg {
    margin: 0;
    width: 100%;
  }
  .main {
    padding: 16px;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .today {
    grid-template-columns: 1fr;
    height: auto;
  }
  .map-box {
    height: 460px;
  }
  .reps {
    max-height: 420px;
  }
  .drawer {
    width: auto;
    left: 10px;
  }
  .board,
  .approve-grid {
    grid-template-columns: 1fr;
  }
  .table-box {
    overflow-x: auto;
  }
}

/* Código de visita en el detalle */
.det-media figure.codefig {
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  box-shadow: inset 0 0 0 1px rgba(14, 159, 91, 0.18);
}

.codefig > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: -14px;
}

.codefig .cf-ico {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
}

.codefig .cf-ico svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.codefig b {
  font-size: 22px;
  letter-spacing: 0.14em;
  color: var(--ok);
}

.det-media .codefig figcaption {
  left: 6px;
  right: 6px;
  text-align: center;
  background: transparent;
  color: var(--ok);
  font-family: var(--font);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.det-media figure.codefig.no {
  background: var(--bad-bg);
  box-shadow: inset 0 0 0 1px rgba(220, 59, 63, 0.18);
}

.codefig.no .cf-ico {
  background: var(--bad);
}

.codefig.no b,
.det-media .codefig.no figcaption {
  color: var(--bad);
}

.det-media figure.codefig.wait {
  background: rgba(17, 18, 20, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
}

.codefig.wait .cf-ico {
  background: var(--faint);
}

.codefig.wait b,
.det-media .codefig.wait figcaption {
  color: var(--muted);
}

/* ---------- Equipo ---------- */
.team-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.t td.acts {
  text-align: right;
}

.t td.acts .btn + .btn {
  margin-left: 6px;
}

.btn.danger {
  color: var(--bad);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(220, 59, 63, 0.25);
}

.btn.danger:hover {
  background: var(--bad-bg);
}

.btn.danger-solid {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--bad);
}

.modal-bd {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 12, 16, 0.38);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 280ms var(--ease);
}

.modal-bd.open {
  opacity: 1;
}

.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateY(12px) scale(0.98);
  transition: transform 380ms var(--ease);
}

.modal-bd.open .modal {
  transform: none;
}

.m-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.m-head .av {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.effects {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}

.effects li {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
}

.effects li + li {
  border-top: 1px solid var(--line);
}

.effects b {
  display: block;
  font-size: 13.5px;
}

.effects p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}

.e-ico {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(17, 18, 20, 0.05);
  color: var(--ink-2);
}

.e-ico.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.e-ico.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.m-select {
  width: 100%;
  height: 36px;
  margin-top: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(17, 18, 20, 0.05);
  font-size: 13px;
}

.m-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.m-field:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.m-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14.5px;
}

.m-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.modal .tag {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 13px;
  font-weight: 500;
}

.modal .tag.on {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.modal .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Reportes ---------- */
.rep-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.date-f {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
}

.date-f input {
  border: 0;
  outline: 0;
  background: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

.dl-group {
  display: flex;
  gap: 6px;
}

.spark.dense {
  gap: 1.5px;
}

.spark.dense i {
  width: 3px;
}

@media print {
  body.panel {
    display: block;
    background: #fff;
  }
  .rail,
  .rep-controls,
  .live,
  #p-toast,
  .note-strip button {
    display: none !important;
  }
  .main {
    padding: 0;
  }
  .kpi,
  .box {
    box-shadow: inset 0 0 0 1px #ddd;
  }
  .t th {
    position: static;
  }
  .t tr {
    break-inside: avoid;
  }
}
