/* Portal QA Control: misma paleta y tipografía que qacontrol.mx */
@font-face { font-family: Inter; src: url(fuentes/inter400.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fuentes/inter600.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url(fuentes/inter700.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Inter; src: url(fuentes/inter800.ttf); font-weight: 800; font-display: swap; }

:root {
  --ink: #0f1f36; --muted: #51637d; --line: #dfe7f2; --line-soft: #eef3f9;
  --bg: #f2f7fc; --ice: #e6f1fb; --white: #fff;
  --navy: #0a4a8f; --navy-deep: #06325f; --blue: #0b6bcb; --blue-bright: #0ea5e9; --sky-soft: #bfe0fb;
  --ok: #1f7a4d; --ok-bg: #e7f5ee; --warn: #9a5b00; --warn-bg: #fff4e0; --bad: #b42318; --bad-bg: #fdecea;
  --a: #1f7a4d; --b: #0b6bcb; --c: #7a869a;
  --radius: 14px; --shadow: 0 1px 2px #0a4a8f0d, 0 4px 14px #0a4a8f0f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg);
       font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.num, td.n, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.lateral { background: var(--navy-deep); color: #bfe0fb; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px;
           position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.lateral .marca { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.lateral .marca img { width: 120px; filter: brightness(0) invert(1); }
.lateral .marca small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #7cc3f5; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; }
.lateral nav a { color: #d6e9fb; padding: 9px 12px; border-radius: 9px; font-weight: 600; display: flex; justify-content: space-between; }
.lateral nav a:hover { background: #ffffff14; text-decoration: none; }
.lateral nav a.activo { background: var(--blue); color: #fff; }
.lateral nav a .candado { font-size: 11px; opacity: .6; font-weight: 400; }
.lateral .sep { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #5a9fd6; padding: 0 12px; margin-top: 6px; }
.lateral .pie { margin-top: auto; font-size: 12px; padding: 0 10px; display: flex; flex-direction: column; gap: 8px; }
.lateral .pie b { color: #fff; display: block; }
.lateral .pie form button { background: none; border: 0; color: #7cc3f5; padding: 0; cursor: pointer; font: inherit; }
.contenido { padding: 28px 32px 60px; max-width: 1240px; width: 100%; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cabecera { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.cabecera .sub { color: var(--muted); margin-top: 4px; }
.etiqueta { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--blue); }

/* ---------- piezas ---------- */
.tarjeta { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
           display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tarjeta > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.rejilla.dos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cifras { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cifra { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cifra span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cifra b { display: block; font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.cifra small { color: var(--muted); }
.vacio { color: var(--muted); padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; background: var(--white); }
.nota { background: var(--ice); border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.muted { color: var(--muted); }
.peq { font-size: 12px; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fila.fin { justify-content: flex-end; }
.pila { display: flex; flex-direction: column; gap: 10px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
        background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.azul { background: #e1effb; color: var(--blue); }
.prio { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12px; color: #fff; }
.prio.A { background: var(--a); } .prio.B { background: var(--b); } .prio.C { background: var(--c); }
.prio.none { background: var(--line); color: var(--muted); }

/* ---------- tablas ---------- */
.tabla-env { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700;
     padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td .sec { display: block; color: var(--muted); font-size: 12px; }
td.min { width: 1%; white-space: nowrap; }
tbody tr:hover { background: #f8fafd; }

/* barras de reparto */
.barras { display: flex; flex-direction: column; gap: 7px; }
.barra { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 10px; align-items: center; font-size: 13px; }
.barra .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.barra .b { grid-column: 1 / -1; height: 6px; border-radius: 9px; background: var(--line-soft); overflow: hidden; }
.barra .b i { display: block; height: 100%; background: var(--blue); border-radius: 9px; }

/* embudo */
.embudo { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.embudo a, .embudo div { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--white); color: inherit; }
.embudo a:hover { border-color: var(--blue); text-decoration: none; }
.embudo .activo { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.embudo span { font-size: 12px; color: var(--muted); display: block; }
.embudo b { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---------- formularios ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--white); border: 1px solid #cfdcec; border-radius: 9px;
                          padding: 9px 11px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--blue); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-bright); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.campos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.campos .ancho { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 9px;
       padding: 9px 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy); border-color: var(--navy); text-decoration: none; }
.btn.sec { background: var(--white); color: var(--blue); border-color: #cfdcec; }
.btn.sec:hover { border-color: var(--blue); background: var(--ice); }
.btn.peligro { background: var(--white); color: var(--bad); border-color: #f1c4bf; }
.btn.peq { padding: 5px 10px; font-size: 13px; }
.filtros { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filtros label { flex: 1 1 150px; }
.filtros .q { flex: 3 1 240px; }

.aviso { border-radius: 10px; padding: 12px 14px; font-weight: 500; overflow-wrap: anywhere; }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }
.aviso.error { background: var(--bad-bg); color: var(--bad); }
.aviso.enlace { background: #fffbe6; border: 1px solid #f0d78c; color: #5c4400; display: flex; flex-direction: column; gap: 8px; }
.aviso.enlace code { background: #fff; border: 1px solid #f0d78c; padding: 6px 8px; border-radius: 6px; user-select: all; font-size: 12px; }

.pestanas { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pestanas a { padding: 8px 14px; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 600; }
.pestanas a.activo { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }

.paginas { display: flex; gap: 6px; align-items: center; justify-content: center; }

/* ficha de prospecto (portal del cliente) */
.fichas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.ficha { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ficha header { display: flex; gap: 10px; align-items: flex-start; }
.ficha header div { min-width: 0; flex: 1; }
.ficha h3 { font-size: 15px; }
.ficha .cargo { color: var(--muted); font-size: 13px; }
.ficha dl { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 13px; }
.ficha dt { color: var(--muted); font-size: 12px; }
.ficha dd { margin: 0; overflow-wrap: anywhere; }

/* acceso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
          background: radial-gradient(1200px 600px at 10% -10%, #d6e9fb 0, transparent 60%), var(--bg); }
.acceso .caja { width: min(100%, 400px); background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px;
                box-shadow: 0 8px 20px #0a4a8f1a, 0 32px 80px #0a4a8f14; display: flex; flex-direction: column; gap: 18px; }
.acceso img { width: 130px; }
.acceso form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .lateral nav { flex-direction: row; flex-wrap: wrap; }
  .lateral .pie { flex-direction: row; justify-content: space-between; align-items: center; }
  .contenido { padding: 20px 16px 48px; }
}
.confirmar-aviso { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; width: max-content; max-width: 300px; font-size: 12px;
                   color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow); }

/* embudo CONNECT Enterprise (SVG server-side, P7) */
.embudo-svg { display: block; max-width: 420px; margin: 4px auto; }
.embudo-svg .barra { fill: var(--blue); }
.embudo-svg .eti { fill: #fff; font-size: 11px; font-weight: 600; font-family: inherit; }
.cifra b.na { color: var(--muted); font-weight: 700; }
.aviso.dato-incompleto { background: var(--warn-bg); color: var(--warn); }
.bandeja { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
