/* =========================================================
   app.css — Estilos móviles. Pensado para pantalla de teléfono:
   una pantalla a la vez, áreas táctiles ≥44px y safe areas de iOS.
   ========================================================= */
:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --border: #e6e9ef;
  --border-soft: #eef1f5;
  --text: #1c2434;
  --text-soft: #5b6577;
  --text-mute: #9aa3b2;
  --brand: #2f6df6;
  --brand-dark: #1f54cc;
  --danger: #dc2626;
  --burbuja-in: #fff;
  --burbuja-out: #e7ffdb;
  --chat-bg: #efeae2;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1420;
    --panel: #151d2c;
    --border: #25304a;
    --border-soft: #1d2638;
    --text: #e6e9f0;
    --text-soft: #9aa6bd;
    --text-mute: #6b7689;
    --brand: #4d83ff;
    --brand-dark: #3a6ae6;
    --danger: #f87171;
    --burbuja-in: #1f2a37;
    --burbuja-out: #144d3c;
    --chat-bg: #0b141a;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- pantallas ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.screen--chat { background: var(--chat-bg); z-index: 5; }

/* ---------- login ---------- */
.screen--login { justify-content: center; align-items: center; padding: 24px; }
.login { width: 100%; max-width: 340px; text-align: center; }
.login__logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 16px;
  background: var(--brand); color: #fff; font-size: 30px; font-weight: 700;
  display: grid; place-items: center;
}
.login h1 { font-size: 24px; font-weight: 700; }
.login__sub { color: var(--text-soft); font-size: 14px; margin-bottom: 26px; }
.login input {
  width: 100%; padding: 15px 16px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); outline: none;
}
.login input:focus { border-color: var(--brand); }
.login button[type=submit] {
  width: 100%; padding: 15px; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 16px;
}
.login button[type=submit]:disabled { opacity: .6; }
.login__err { color: var(--danger); font-size: 13.5px; margin-top: 12px; }
.login__cfg { margin-top: 20px; color: var(--text-mute); font-size: 13px; text-decoration: underline; }
/* instalar en la pantalla de inicio (solo web) */
.login__cfg--fuerte { display: block; margin: 14px auto 0; color: var(--brand); font-weight: 600; }
.login__ios { margin-top: 14px; color: var(--text-mute); font-size: 12.5px; line-height: 1.5; }
.login__ios b { color: var(--text-soft); font-weight: 600; }

/* ---------- cabecera de la lista ---------- */
.hdr { background: var(--panel); border-bottom: 1px solid var(--border); padding-top: var(--safe-top); flex-shrink: 0; }
.hdr__row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.hdr__row h1 { font-size: 21px; font-weight: 700; }
.hdr__actions { display: flex; gap: 4px; }
.ibtn {
  position: relative; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; color: var(--text-soft);
}
.ibtn:active { background: var(--bg); }
.ibtn__dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--panel);
}
.buscar { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 10px 12px; background: var(--bg); border-radius: 11px; }
.buscar svg { width: 18px; height: 18px; color: var(--text-mute); flex-shrink: 0; }
.buscar input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }

/* filtros: tira horizontal deslizable (no caben en vertical en un móvil) */
.filtros { display: flex; gap: 7px; overflow-x: auto; padding: 0 16px 11px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtro {
  flex-shrink: 0; padding: 7px 14px; border-radius: 20px; font-size: 13.5px; font-weight: 600;
  color: var(--text-soft); background: var(--bg); border: 1px solid transparent; white-space: nowrap;
}
.filtro--on { background: var(--brand); color: #fff; }
.filtro--handoff.filtro--tiene { color: var(--danger); border-color: var(--danger); }
.filtro--handoff.filtro--on { background: var(--danger); color: #fff; border-color: transparent; }
.filtro__n { margin-left: 5px; font-weight: 800; }

/* ---------- lista de conversaciones ---------- */
.lista { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--safe-bot); }
.conv { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); background: var(--panel); }
.conv:active { background: var(--bg); }
.conv--handoff { box-shadow: inset 4px 0 0 var(--danger); background: rgba(220,38,38,.06); }
.conv__av {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px;
}
.conv__ch { position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; border: 2px solid var(--panel); }
.conv__main { flex: 1; min-width: 0; }
.conv__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv--handoff .conv__name { color: var(--danger); }
.conv__hora { font-size: 12px; color: var(--text-mute); flex-shrink: 0; }
.conv__bot { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.conv__prev { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv--nolei .conv__prev { color: var(--text); font-weight: 500; }
.conv__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #25d366; color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.conv__tag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; color: #fff; background: var(--danger); padding: 1px 6px; border-radius: 5px; }
.vacio { padding: 50px 24px; text-align: center; color: var(--text-mute); font-size: 14px; }

/* ---------- hilo ---------- */
.chdr {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  padding-top: calc(var(--safe-top) + 8px);
  background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chdr__back { margin-left: -6px; }
.chdr__av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13.5px; flex-shrink: 0; }
.chdr__main { flex: 1; min-width: 0; }
.chdr__name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chdr__sub { font-size: 12px; color: var(--text-soft); }
.camila {
  flex-shrink: 0; padding: 6px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  background: #d8f5e3; color: #0f7a3d;
}
.camila--off { background: rgba(220,38,38,.14); color: var(--danger); }
.aviso { padding: 9px 16px; font-size: 12.5px; color: var(--danger); background: rgba(220,38,38,.1); border-bottom: 1px solid rgba(220,38,38,.25); flex-shrink: 0; }

.mensajes { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.dia { align-self: center; margin: 12px 0 8px; padding: 4px 12px; border-radius: 12px; background: rgba(0,0,0,.08); font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
@media (prefers-color-scheme: dark) { .dia { background: rgba(255,255,255,.1); } }

.msg { max-width: 82%; padding: 8px 11px 6px; border-radius: 12px; font-size: 14.5px; line-height: 1.42; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.07); }
.msg--in { align-self: flex-start; background: var(--burbuja-in); border-top-left-radius: 4px; }
.msg--out { align-self: flex-end; background: var(--burbuja-out); border-top-right-radius: 4px; }
.msg__quien { font-size: 11.5px; font-weight: 700; color: var(--brand); margin-bottom: 2px; }
.msg__txt { white-space: pre-wrap; }
.msg__pie { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; font-size: 10.5px; color: var(--text-mute); }
.msg__img { display: block; max-width: 100%; border-radius: 8px; margin-bottom: 4px; }
.msg__doc { display: flex; align-items: center; gap: 8px; padding: 9px 11px; margin-bottom: 4px; border-radius: 9px; background: rgba(0,0,0,.06); font-size: 13px; text-decoration: none; color: inherit; }
.msg__audio { width: 210px; max-width: 100%; margin-bottom: 4px; }
.cargando { align-self: center; padding: 26px; color: var(--text-soft); font-size: 13.5px; }

/* ---------- composer ---------- */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 9px 12px;
  padding-bottom: calc(var(--safe-bot) + 9px);
  background: var(--panel); border-top: 1px solid var(--border); flex-shrink: 0;
}
.composer textarea {
  flex: 1; max-height: 120px; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--bg); outline: none; resize: none; line-height: 1.4;
}
.composer textarea:focus { border-color: var(--brand); }
.enviar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.enviar:disabled { opacity: .45; }
.enviar svg { width: 20px; height: 20px; }

/* ---------- hoja inferior (notificaciones) ---------- */
.hoja { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.hoja__fondo { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.hoja__panel {
  position: relative; width: 100%; max-height: 72vh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 18px 18px 0 0;
  padding-bottom: var(--safe-bot); animation: subir .22s ease;
}
@keyframes subir { from { transform: translateY(100%); } }
.hoja__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.hoja__leer { color: var(--brand); font-size: 13px; font-weight: 600; }
.hoja__body { overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--border-soft); }
.notif--nueva { background: rgba(47,109,246,.06); }
.notif__ico { font-size: 17px; flex-shrink: 0; }
.notif__t { font-size: 14px; font-weight: 600; }
.notif__b { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.notif__h { font-size: 11px; color: var(--text-mute); margin-top: 3px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bot) + 80px); transform: translateX(-50%);
  z-index: 60; max-width: 88%; padding: 11px 18px; border-radius: 22px;
  background: rgba(28,36,52,.95); color: #fff; font-size: 13.5px; text-align: center;
}

/* =========================================================
   Contenedor con barra inferior + secciones
   ========================================================= */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.tabview { position: absolute; inset: 0 0 var(--tabbar-h) 0; display: flex; flex-direction: column; background: var(--bg); }
:root { --tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px)); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; }

/* barra inferior */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  display: flex; background: var(--panel); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 10;
}
.tb {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--text-mute); font-size: 10px; font-weight: 600;
}
.tb svg { width: 21px; height: 21px; }
.tb--on { color: var(--brand); }
.tb__dot { position: absolute; top: 7px; right: 50%; transform: translateX(14px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* el chat va por encima de la barra */
.screen--chat { z-index: 20; }

/* =========================================================
   KPIs, filas y tarjetas (secciones de datos)
   ========================================================= */
.kpis { display: grid; gap: 10px; padding: 14px 16px 4px; }
.kpis--1 { grid-template-columns: 1fr; }
.kpis--2 { grid-template-columns: 1fr 1fr; }
.kpis--3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; }
.kpi__v { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.kpis--3 .kpi__v { font-size: 15.5px; }
.kpi__l { font-size: 11px; font-weight: 600; color: var(--text-mute); text-transform: uppercase; letter-spacing: .02em; margin-top: 3px; }
.kpi__s { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }
.kpi--bien .kpi__v { color: #1a8f5f; }
.kpi--mal .kpi__v { color: var(--danger); }
@media (prefers-color-scheme: dark) { .kpi--bien .kpi__v { color: #34d399; } }

.fila { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--panel); border-bottom: 1px solid var(--border-soft); }
.fila:active { background: var(--bg); }
.fila__main { flex: 1; min-width: 0; }
.fila__t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila__s { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila__der { text-align: right; flex-shrink: 0; }
.fila__monto { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.fila__min { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.rojo { color: var(--danger); }

.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10.5px; font-weight: 700; background: var(--bg); color: var(--text-soft); }
.pill--ok { background: rgba(26,143,95,.14); color: #1a8f5f; }
.pill--medio { background: rgba(245,158,11,.16); color: #b45309; }
.pill--mal { background: rgba(220,38,38,.14); color: var(--danger); }
@media (prefers-color-scheme: dark) { .pill--ok { color: #34d399; } .pill--medio { color: #fbbf24; } }

.card { margin: 14px 16px 0; padding: 15px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.card h2 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.aviso-box { margin: 16px; padding: 16px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; color: var(--text-soft); font-size: 13.5px; }
.aviso-box__btn { display: block; margin: 12px auto 0; padding: 9px 16px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; }

/* gráfica de barras en CSS (un SVG con ejes no se lee en un móvil) */
.barras { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.barra { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.barra__t { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.barra__t span { flex: 1; max-width: 9px; border-radius: 3px 3px 0 0; min-height: 2px; }
.barra__in { background: #2a78d6; }
.barra__out { background: #eb6834; }
.barra__l { font-size: 8.5px; color: var(--text-mute); margin-top: 4px; white-space: nowrap; }
.barra__n { font-size: 9px; color: var(--text-soft); font-weight: 600; }
.leyenda { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 11px; color: var(--text-soft); }
.leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.leyenda i { width: 9px; height: 9px; border-radius: 2px; }
.c-in { background: #2a78d6; } .c-out { background: #eb6834; }

/* contenido dentro de la hoja inferior */
.hoja__meta { padding: 14px 18px 0; font-size: 13px; color: var(--text-soft); }
.hoja__sub { padding: 16px 18px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-mute); letter-spacing: .03em; }
.hoja__p { padding: 0 18px 14px; font-size: 13.5px; line-height: 1.5; }
.hoja__pdf { display: block; margin: 14px 18px; padding: 12px; border-radius: 10px; background: var(--brand); color: #fff; text-align: center; font-weight: 600; text-decoration: none; }
.hoja__audio { width: calc(100% - 36px); margin: 0 18px 14px; }
.hoja__det { margin: 0 18px 16px; font-size: 13px; }
.hoja__det summary { color: var(--brand); font-weight: 600; cursor: pointer; padding: 6px 0; }
.hoja__det pre { margin-top: 8px; padding: 12px; background: var(--bg); border-radius: 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; font-family: inherit; }
.promesa { margin: 10px 18px; padding: 11px 13px; border-radius: 10px; background: rgba(26,143,95,.12); color: #1a8f5f; font-size: 13.5px; }
@media (prefers-color-scheme: dark) { .promesa { color: #34d399; } }
.linea { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.linea__d { flex: 1; min-width: 0; }
.linea__n { text-align: right; color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.linea__n b { display: block; color: var(--text); font-size: 13.5px; }
.linea--total { border-bottom: 0; font-weight: 700; }

/* ---------- visor de PDF (dentro de la app) ---------- */
.screen--pdf { z-index: 30; background: var(--bg); }
.pdf { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px; text-align: center; }
.pdf__pag {
  display: block; margin: 0 auto 10px; border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.18); background: #fff;
}
/* el botón de ver PDF ahora es <button>, no <a> */
button.hoja__pdf { width: calc(100% - 36px); border: 0; font-size: 15px; cursor: pointer; }

/* ---------- dispositivos (dentro de la hoja) ---------- */
.devrow { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); }
.devrow--act { background: rgba(47,109,246,.06); }
.devrow > div:first-child { flex: 1; min-width: 0; }
.devrow__n { font-size: 14px; font-weight: 600; }
.devrow__aqui { font-size: 9.5px; font-weight: 800; text-transform: uppercase; color: var(--brand); }
.devrow__s { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.devrow__x { width: 30px; height: 30px; border-radius: 8px; color: var(--text-mute); font-size: 14px; flex-shrink: 0; }
.devrow__x:active { background: rgba(220,38,38,.12); color: var(--danger); }
.dev-nuevo { display: block; width: calc(100% - 36px); margin: 14px 18px 18px; padding: 12px; border: 1px dashed var(--border); border-radius: 11px; font-size: 14px; font-weight: 600; color: var(--text-soft); background: none; }
.qrbox { padding: 20px 18px; text-align: center; }
.qrimg { width: 240px; max-width: 80%; border-radius: 10px; background: #fff; margin-bottom: 14px; }

/* ---------- tickets (dentro de la hoja) ---------- */
.tkform { padding: 6px 18px 20px; }
.tk-lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 14px; }
.tk-inp { display: block; width: 100%; margin-top: 5px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); outline: none; font-size: 15px; }
.tk-inp:focus { border-color: var(--brand); }
.tk-area { resize: vertical; min-height: 100px; line-height: 1.45; }
.tk-row { display: flex; gap: 10px; }
.tk-row .tk-lbl { flex: 1; }
.tk-err { color: var(--danger); font-size: 13px; margin: 0 0 10px; }
/* --- adjuntos --- */
.tk-hint { font-weight: 400; color: var(--text-mute); }
.tk-adjrow { display: flex; gap: 8px; margin-top: 6px; }
.tk-adj { flex: 1; padding: 12px 10px; border: 1px dashed var(--border); border-radius: 10px; background: var(--panel); color: var(--text-soft); font-size: 13.5px; font-weight: 600; }
.tk-adj:active { border-color: var(--brand); color: var(--brand); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tk-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 6px 6px 10px; border-radius: 9px; background: var(--panel); border: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--text); }
.tk-chip-n { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-chip-p { color: var(--text-mute); font-size: 11px; }
.tk-chip-x { width: 22px; height: 22px; border-radius: 5px; color: var(--text-mute); font-size: 17px; line-height: 1; }
.tk-chip-x:active { background: var(--danger); color: #fff; }
.tk-send { width: 100%; padding: 14px; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; }
.tk-send:disabled { opacity: .6; }
.tk-ok { text-align: center; padding: 30px 20px; }
.tk-ok-ic { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: rgba(37,211,102,.15); color: #1a8f5f; font-size: 28px; font-weight: 800; display: grid; place-items: center; }
.tk-ok p { font-size: 14.5px; color: var(--text-soft); line-height: 1.5; }
.tk-otro { margin-top: 18px; padding: 10px 20px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-soft); }

/* ---------- gestión de usuarios (dentro de la hoja) ---------- */
.urow { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border-soft); }
.urow:active { background: var(--bg); }
.urow > div:first-child { flex: 1; min-width: 0; }
.urow__n { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow__s { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.urow__go { color: var(--text-mute); font-size: 20px; }
.uform { padding: 6px 18px 20px; }
.uchks { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.uchk { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.uchk--on { border-color: var(--brand); background: rgba(47,109,246,.07); color: var(--brand); font-weight: 600; }
.uchk--sens.uchk--on { border-color: #d9a400; background: rgba(217,164,0,.1); color: #a97b00; }
.uchks__nota { font-size: 12px; color: var(--text-mute); margin: 8px 0 16px; }
/* grupos de permisos por plataforma */
.upgrp { margin-top: 14px; }
.upgrp__h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.upgrp__h b { font-size: 13px; color: var(--text); }
.upgrp__all, .upgrp__none { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel); color: var(--text-soft); }
.upgrp__all:active { color: var(--brand); border-color: var(--brand); }
.upgrp__none:active { color: var(--danger); border-color: var(--danger); }
.uborrar { width: 100%; margin-top: 12px; padding: 12px; border: 1px solid rgba(220,38,38,.4); border-radius: 11px; color: var(--danger); font-weight: 600; font-size: 14px; background: none; }

/* ---------- tickets: pestañas y lista (móvil) ---------- */
.tktabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.tktab { padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--text-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tktab--on { color: var(--brand); border-color: var(--brand); }
.tkitem { padding: 13px 18px; border-bottom: 1px solid var(--border-soft); }
.tkitem__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tkitem__t { font-weight: 600; font-size: 14px; }
.tkitem__m { font-size: 12px; color: var(--text-mute); margin-top: 3px; }
.tkitem__as { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.tkitem__a { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 9px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-soft); text-decoration: none; }
.tkitem__e { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.tkitem__e--nuevo { background: var(--bg); color: var(--text-soft); }
.tkitem__e--prog { background: rgba(245,158,11,.16); color: #b45309; }
.tkitem__e--ok { background: rgba(37,211,102,.15); color: #1a8f5f; }
