/* Consola TANTATIC: la plataforma vista por TANTATIC (clientes, suscripciones, altas y bajas, cobros, talleres y usuarios) */

/* Colores de los gráficos: dos series validadas para daltonismo (claro y oscuro) */
:root { --cs-serie-1: #2a78d6; --cs-serie-2: #eb6834; }
@media (prefers-color-scheme: dark) { :root { --cs-serie-1: #3987e5; --cs-serie-2: #d95926; } }

/* Cabecera */
.cab--consola { gap: 12px; }
.cs-cab__logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; }
.cs-cab__logo picture, .cs-cab__logo img { display: block; line-height: 0; }
.cs-cab__demo { padding: 2px 10px; border-radius: var(--radio-full); background: var(--ambar-suave); color: var(--ambar-texto); font-size: 13px; font-weight: 700; white-space: nowrap; }
.cs-cab__salir { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; color: var(--mahon); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cs-cab__salir .mm-icono { width: 20px; height: 20px; }
.cs-cab__marca { margin-left: auto; font-family: var(--font-display); font-weight: 600; color: var(--tinta-suave); }
.cs-lateral__tit { margin: 0; padding: 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--tinta); }
.cs-lateral__cerrar { border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; }

/* Entrada con clave */
.cs-entrada { display: grid; place-items: center; min-height: 70vh; }
.cs-entrada__caja { width: 100%; max-width: 480px; padding: 24px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); box-shadow: var(--sombra-carta); }
.cs-entrada__marca { margin: 0 0 12px; line-height: 0; }
.cs-entrada__logo { height: 30px; width: auto; }
.cs-ancho { width: 100%; }
@media (min-width: 768px) {
  body[data-consola="entrada"] #raiz { grid-template-columns: minmax(0, 1fr); }
  body[data-consola="entrada"] #vista, body[data-consola="entrada"] #cab { grid-column: 1; }
  body[data-consola="entrada"] #cab { display: none; }
}

/* Comunes */
.cs-aviso { margin: 0 0 16px; padding: 8px 12px; border-radius: var(--radio-m); background: var(--ambar-suave); color: var(--tinta); font-size: 14px; line-height: 20px; border-left: 4px solid var(--ambar); }
.cs-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cs-titulo .vista__titulo { margin: 0; }
.cs-dos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; }
.cs-dos > * { min-width: 0; }
.cs-enlace { color: var(--mahon); font-weight: 700; text-decoration: none; }
.cs-enlace:hover { text-decoration: underline; }
.cs-demo { display: inline-block; padding: 0 8px; border-radius: var(--radio-full); background: var(--mahon-suave); color: var(--mahon); font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: 1px; }
.cs [data-buscar][hidden] { display: none !important; }
.cs .etiqueta { display: block; }

/* Cifras */
.cs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-kpis .tile-mini { justify-items: start; text-align: left; padding: 10px 12px; }
.cs-kpis .tile-mini strong { font-family: var(--font-display); font-size: 24px; line-height: 30px; white-space: nowrap; }
.cs-kpis .tile-mini span { font-weight: 700; font-size: 14px; line-height: 18px; }
.cs-kpis .tile-mini small { font-size: 13px; line-height: 18px; color: var(--tinta-suave); }

/* Estados y marcas */
.cs-estado { display: inline-block; padding: 1px 10px; border-radius: var(--radio-full); font-size: 13px; font-weight: 700; line-height: 20px; white-space: nowrap; border: 1px solid transparent; }
.cs-estado--prueba { background: var(--mahon-suave); color: var(--mahon); }
.cs-estado--activa { background: var(--verde-suave); color: var(--verde); }
.cs-estado--impagada { background: var(--rojo-suave); color: var(--rojo); border-color: var(--rojo); }
.cs-estado--pausada { background: var(--ambar-suave); color: var(--ambar-texto); }
.cs-estado--baja { background: transparent; color: var(--tinta-suave); border-color: var(--linea); }
.cs-cobro { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: var(--radio-full); font-size: 12px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.cs-cobro--cobrada { background: var(--verde-suave); color: var(--verde); }
.cs-cobro--pendiente { background: var(--ambar-suave); color: var(--ambar-texto); }
.cs-cobro--devuelta { background: var(--rojo-suave); color: var(--rojo); }
td .cs-cobro { margin-left: 0; }

/* Avisos del día */
.cs-alertas { display: grid; gap: 8px; }
.cs-alerta { display: flex; align-items: center; gap: 12px; margin: 0; min-height: 56px; padding: 8px 12px; background: var(--superficie-alta); border: 1px solid var(--linea); border-left: 5px solid var(--mahon); border-radius: var(--radio-m); color: var(--tinta); text-decoration: none; }
.cs-alerta > .mm-icono:first-child { flex: none; width: 22px; height: 22px; color: var(--mahon); }
.cs-alerta > .mm-icono:last-child { flex: none; width: 20px; height: 20px; margin-left: auto; color: var(--tinta-suave); }
.cs-alerta span { min-width: 0; }
.cs-alerta strong { display: block; }
.cs-alerta small { display: block; font-size: 14px; line-height: 20px; color: var(--tinta-suave); }
.cs-alerta--mal { border-left-color: var(--rojo); }
.cs-alerta--mal > .mm-icono:first-child { color: var(--rojo); }
.cs-alerta--aviso { border-left-color: var(--ambar); }
.cs-alerta--aviso > .mm-icono:first-child { color: var(--ambar-texto); }
a.cs-alerta:hover { background: color-mix(in srgb, var(--mahon-suave) 55%, var(--superficie-alta)); }

/* Gráfico de altas y bajas: nuevos arriba, bajas abajo, de la misma línea */
.cs-ab { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; padding-top: 20px; }
.cs-ab__col { display: grid; grid-template-rows: 120px 80px auto; border-radius: 6px; outline: none; }
.cs-ab__col:hover, .cs-ab__col:focus-visible { background: color-mix(in srgb, var(--mahon-suave) 60%, transparent); }
.cs-ab__arriba, .cs-ab__abajo { position: relative; display: flex; flex-direction: column; align-items: center; }
.cs-ab__arriba { justify-content: flex-end; border-bottom: 2px solid var(--tinta-suave); }
.cs-ab__abajo { justify-content: flex-start; }
.cs-ab__arriba i, .cs-ab__abajo i { display: block; width: 62%; max-width: 26px; }
.cs-ab__arriba i { background: var(--cs-serie-1); border-radius: 4px 4px 0 0; margin-bottom: 2px; }
.cs-ab__abajo i { background: var(--cs-serie-2); border-radius: 0 0 4px 4px; margin-top: 2px; }
.cs-ab__n { font-size: 12px; font-weight: 700; line-height: 16px; color: var(--tinta); }
.cs-ab__mes { margin-top: 4px; font-size: 11px; line-height: 14px; font-weight: 700; text-align: center; color: var(--tinta-suave); }
.cs-ab__col--hoy .cs-ab__mes, .cs-mrr__col--hoy .cs-ab__mes { color: var(--mahon); }
.cs-serie1, .cs-serie2 { display: inline-block; }
.graf__leyenda .cs-serie1 { background: var(--cs-serie-1); }
.graf__leyenda .cs-serie2 { background: var(--cs-serie-2); }

/* Gráfico de la cuota mensual */
.cs-mrr { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding-top: 20px; }
.cs-mrr__eje { position: relative; height: 200px; }
.cs-mrr__eje span { position: absolute; right: 6px; transform: translateY(50%); font-size: 12px; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }
.cs-mrr__cols { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.cs-mrr__lineas { position: absolute; left: 0; right: 0; top: 0; height: 200px; pointer-events: none; }
.cs-mrr__lineas i { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--linea); }
.cs-mrr__col { position: relative; z-index: 1; display: grid; grid-template-rows: 200px auto; border-radius: 6px; outline: none; }
.cs-mrr__col:hover, .cs-mrr__col:focus-visible { background: color-mix(in srgb, var(--mahon-suave) 60%, transparent); }
.cs-mrr__zona { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.cs-mrr__zona i { display: block; width: 62%; max-width: 26px; background: var(--cs-serie-1); border-radius: 4px 4px 0 0; }
.cs-mrr__n { position: absolute; right: 0; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--tinta); background: var(--superficie); padding: 0 2px; border-radius: 4px; }

/* Uso e IA */
.cs-uso { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cs-uso div { display: grid; padding: 10px 12px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); }
.cs-uso span { font-size: 13px; line-height: 18px; color: var(--tinta-suave); font-weight: 700; }
.cs-uso strong { font-size: 20px; line-height: 26px; }
.cs-top { list-style: none; margin: 4px 0 0; padding: 0; }
.cs-top li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.cs-top a { color: var(--mahon); font-weight: 700; text-decoration: none; }
.tabla-simple td small { display: block; font-size: 13px; line-height: 18px; color: var(--tinta-suave); white-space: normal; }

/* Listas de clientes, talleres y usuarios */
.cs-filtros { display: grid; gap: 10px; margin-bottom: 16px; }
.cs-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cs-chips::-webkit-scrollbar { display: none; }
.cs-chips button { flex: none; min-height: 40px; padding: 0 14px; border: 1px solid var(--borde-control); border-radius: var(--radio-full); background: var(--superficie-alta); color: var(--tinta); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cs-chips button[aria-checked="true"] { background: var(--mahon); border-color: var(--mahon); color: var(--on-mahon); }
.cs-buscar { margin-bottom: 16px; }
.cs-tabla tbody tr { cursor: pointer; }
.cs-tabla tbody tr:hover { background: color-mix(in srgb, var(--mahon-suave) 45%, transparent); }
.cs-tabla td { vertical-align: top; }
.cs-card { display: grid; gap: 4px; padding: 12px 14px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); color: inherit; text-decoration: none; }
.cs-card .nota { margin: 0; }
.cs-card__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-card__pie { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--tinta-suave); }
.cs-card__pie strong { color: var(--tinta); }
.cs-roles { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; color: var(--tinta-suave); }
.cs-roles strong { color: var(--tinta); }
.cs-sinres { text-align: center; }

/* Ficha del cliente */
.cs-ficha__cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 12px; }
.cs-ficha__cab .vista__titulo { margin: 0; }
.cs-ficha__estado { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
@media (min-width: 768px) { .cs-ficha__estado { display: grid; justify-items: end; } }
.cs-ficha__estado strong { font-family: var(--font-display); font-size: 22px; line-height: 28px; }
.cs-acciones { margin: 12px 0 0; }
.cs-datos { display: grid; border-top: 1px solid var(--linea); }
.cs-dato { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.cs-dato span { color: var(--tinta-suave); flex: none; }
.cs-dato strong { text-align: right; font-weight: 700; }
.cs-dato a { color: var(--mahon); }
.cs-cambiar { margin-top: 12px; border: 1px solid var(--linea); border-radius: var(--radio-m); background: var(--superficie-alta); }
.cs-cambiar summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; cursor: pointer; color: var(--mahon); font-weight: 700; }
.cs-cambiar[open] { padding-bottom: 14px; }
.cs-cambiar[open] > :not(summary) { margin-left: 14px; margin-right: 14px; }
.cs-cambiar--baja summary { color: var(--rojo); }
.cs-form { display: grid; gap: 12px; margin: 4px 0 12px; }
.cs-barra { margin-bottom: 12px; }
.cs-barra__cab { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.cs-barra__cab small { font-weight: 400; color: var(--tinta-suave); }
.cs-barra__pista { height: 10px; margin-top: 4px; border-radius: var(--radio-full); background: var(--mahon-suave); overflow: hidden; }
.cs-barra__pista i { display: block; height: 100%; border-radius: var(--radio-full); background: var(--mahon); }
.cs-barra--aviso .cs-barra__pista i { background: var(--ambar); }
.cs-barra--mal .cs-barra__pista i { background: var(--rojo); }
.cs-barra--mal .cs-barra__cab strong { color: var(--rojo); }
.cs-simple { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.cs-simple li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.cs-simple li > .mm-icono { flex: none; width: 22px; height: 22px; color: var(--mahon); }
.cs-simple li > span:not(.cs-avatar):not(.cs-importe) { flex: 1; min-width: 0; }
.cs-simple strong { display: block; }
.cs-simple small { display: block; font-size: 14px; line-height: 20px; color: var(--tinta-suave); overflow-wrap: anywhere; }
.cs-simple .mm-boton--texto { flex: none; min-height: 40px; padding: 0 8px; }
.cs-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radio-full); background: var(--mahon-suave); color: var(--mahon); font-size: 14px; font-weight: 700; }
.cs-inactivo { opacity: 0.6; }
.cs-importe { flex: none; text-align: right; font-weight: 700; white-space: nowrap; }
.cs-importe .cs-cobro { display: block; margin: 2px 0 0 auto; width: fit-content; }
.cs-notas, .cs-historial { list-style: none; margin: 12px 0 0; padding: 0; }
.cs-notas li { padding: 10px 12px; margin-bottom: 8px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); }
.cs-notas small, .cs-historial small { display: block; font-size: 13px; line-height: 18px; color: var(--tinta-suave); }
.cs-notas p, .cs-historial p { margin: 2px 0 0; }
.cs-historial li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--linea); margin-left: 5px; }
.cs-historial li::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--superficie); border: 2px solid var(--borde-control); }
.cs-historial--pago::before, .cs-historial--reactivacion::before, .cs-historial--cobro::before { border-color: var(--verde) !important; background: var(--verde) !important; }
.cs-historial--baja::before, .cs-historial--impago::before { border-color: var(--rojo) !important; background: var(--rojo) !important; }
.cs-historial--alta::before { border-color: var(--mahon) !important; background: var(--mahon) !important; }
.cs-historial--soporte::before, .cs-historial--pausa::before { border-color: var(--ambar-texto) !important; }

/* Altas, bajas y cobros por mes */
.cs-mes { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.cs-mes strong { min-width: 190px; text-align: center; font-family: var(--font-display); font-size: 22px; line-height: 28px; }
.cs-mes__sig .mm-icono { transform: rotate(180deg); }
.cs-mes__hueco { width: 48px; }
.cs-kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-movs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.cs-movs li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.cs-movs small { display: block; font-size: 14px; line-height: 20px; color: var(--tinta-suave); }
.cs-mov { flex: none; min-width: 104px; padding: 1px 8px; border-radius: var(--radio-full); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; background: var(--superficie); border: 1px solid var(--linea); color: var(--tinta); }
.cs-mov--alta { background: var(--mahon-suave); border-color: transparent; color: var(--mahon); }
.cs-mov--pago { background: var(--verde-suave); border-color: transparent; color: var(--verde); }
.cs-mov--baja { background: var(--rojo-suave); border-color: transparent; color: var(--rojo); }
.cs-mov--plan { background: var(--ambar-suave); border-color: transparent; color: var(--ambar-texto); }
.cs-motivos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-motivos li { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 4px 10px; align-items: center; font-size: 15px; }
.cs-motivos__barra { grid-column: 1; height: 12px; border-radius: 0 4px 4px 0; background: transparent; }
.cs-motivos__barra i { display: block; height: 100%; background: var(--cs-serie-2); border-radius: 0 4px 4px 0; }
.cs-motivos strong { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 18px; }

/* Planes */
.cs-planes { display: grid; gap: 16px; }
.cs-plan { padding: 16px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); }
.cs-plan h2 { margin: 0; font-family: var(--font-display); font-size: 24px; line-height: 30px; }
.cs-lista-txt { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Más (móvil) */
.cs-mas { display: grid; gap: 8px; }
.cs-op { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 14px; background: var(--superficie-alta); border: 1px solid var(--linea); border-radius: var(--radio-m); color: var(--tinta); text-decoration: none; font-weight: 700; line-height: 22px; }
.cs-op small { display: block; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--tinta-suave); }
.cs-op .mm-icono { flex: none; width: 24px; height: 24px; color: var(--mahon); }

@media (min-width: 768px) {
  .cs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cs-kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cs-uso { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-filtros { grid-template-columns: auto minmax(240px, 1fr); align-items: center; }
  .cs-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-form__ancho { grid-column: 1 / -1; }
  .cs-planes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-planes .cs-form { grid-template-columns: 1fr; }
  .cab--consola { padding-right: var(--pad-x); }
}
@media (min-width: 1100px) {
  .cs-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-dos--ficha { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .cs-dos > .bloque, .cs-dos > div > .bloque:first-child { margin-top: 24px; }
}
@media (max-width: 520px) {
  .cs-cab__salir span { display: none; }
  .cs-cab__salir .mm-icono { width: 24px; height: 24px; }
}
@media (max-width: 400px) {
  .cs-ab__arriba i, .cs-ab__abajo i, .cs-mrr__zona i { width: 70%; }
  .cs-cab__demo { display: none; }
}

/* Listas largas: primero una parte y «Ver todas» (lo que se busca aparece siempre) */
.cs:not(.cs-todo) [data-extra]:not(.cs-coincide) { display: none !important; }
.cs-vermas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; color: var(--tinta-suave); font-size: 14px; }
.cs-todo .cs-vermas { display: none; }

/* Aviso de soporte dentro de la app del cliente */
.cs-soporte { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 6px 16px; background: var(--ambar); color: var(--on-ambar); font-size: 14px; line-height: 20px; text-align: center; }
.cs-soporte button { min-height: 32px; padding: 0 12px; border: 2px solid currentColor; border-radius: var(--radio-full); background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
