/* UMBREACH Studio · estilos del cascarón (los módulos los reutilizan: .btn, .tarjeta, .rejilla, .campo, .chips, .barra…).
   Móvil primero: una columna, acciones abajo al alcance del pulgar; desde 900 px, barra lateral y rejilla. Botones de 48 px como mínimo. */
:root {
  --fondo: #0a0d11; --panel: #11151b; --panel2: #171c24; --linea: #232b36; --linea2: #2f3a48;
  --txt: #e8eaed; --tenue: #9aa4b0; --tenue2: #6b7582;
  --acento: #e8c547; --acento2: #ffd85c; --acento-bg: rgba(232,197,71,.13); --naranja: #ff7a1a;
  --ref: #ff5a4a; --ref-bg: rgba(255,90,74,.14); --ok: #34d17a; --ok-bg: rgba(52,209,122,.13); --aviso: #f2b43a; --aviso-bg: rgba(242,180,58,.14); --mal: #ff5a4a;
  --azul: #5aa9ff;
  --letra: "Bahnschrift", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; --mono: Consolas, "Cascadia Mono", Menlo, monospace;
  --radio: 10px; --alto-btn: 48px; --abajo: 68px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--fondo); color: var(--txt); font: 15px/1.4 var(--letra); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acento); }
.oculto { display: none !important; }
.tenue { color: var(--tenue); } .mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* ---------- cabecera ---------- */
.cab { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: linear-gradient(#12171e, #0d1116); border-bottom: 1px solid var(--linea); }
.cab .logo { width: 30px; height: 30px; }
.cab .nombre { font-weight: 800; letter-spacing: .26em; color: var(--acento); font-size: 13px; }
.cab .estados { margin-left: auto; display: flex; gap: 6px; align-items: center; overflow: hidden; }
.pild { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--linea2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.pild .punto { width: 9px; height: 9px; border-radius: 50%; background: var(--tenue2); }
.pild.ok .punto { background: var(--ok); } .pild.mal .punto { background: var(--mal); }
.pild.caro { border-color: var(--aviso); color: var(--aviso); background: var(--aviso-bg); }
.pild .mini-barra { width: 46px; height: 6px; border-radius: 3px; background: var(--linea2); overflow: hidden; }
.pild .mini-barra > i { display: block; height: 100%; background: var(--acento); }

/* ---------- navegación: abajo en el móvil, a la izquierda en el PC ---------- */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--abajo); display: flex; background: #0d1116; border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; min-width: 0; background: none; border: 0; color: var(--tenue); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; cursor: pointer; }
.nav button .ico { font-size: 22px; line-height: 1; }
.nav button.on { color: var(--acento); }
.nav button .cnt { position: absolute; margin: -26px 0 0 26px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--acento); color: #111; font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px; }
main { padding: 12px 12px calc(var(--abajo) + 90px); max-width: 1500px; margin: 0 auto; }
@media (min-width: 900px) {
  .nav { top: 56px; bottom: 0; right: auto; width: 92px; height: auto; flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--linea); padding-top: 8px; }
  .nav button { flex: 0 0 76px; }
  main { margin-left: 92px; padding: 18px 22px 110px; }
}

/* ---------- pestañas del módulo (chips) ---------- */
.pestanas { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button { flex: 0 0 auto; height: 42px; padding: 0 16px; border-radius: 21px; border: 1px solid var(--linea2); background: var(--panel); color: var(--tenue); font-weight: 700; cursor: pointer; }
.pestanas button.on { background: var(--acento-bg); border-color: var(--acento); color: var(--acento); }

/* ---------- botones ---------- */
.btn { min-height: var(--alto-btn); padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radio);
  border: 1px solid var(--linea2); background: var(--panel2); font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--txt); }
.btn .ico { font-size: 19px; }
.btn:hover { border-color: var(--acento); }
.btn.acento { background: var(--acento); border-color: var(--acento); color: #111; }
.btn.acento:hover { background: var(--acento2); }
.btn.rojo { color: var(--ref); } .btn.peq { min-height: 38px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; border-color: var(--linea2); }
.btn.bloque { width: 100%; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.acciones > .btn { flex: 1 1 140px; }
.flotantes { position: fixed; z-index: 25; right: 14px; bottom: calc(var(--abajo) + 14px); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.flotantes .btn { box-shadow: 0 6px 22px rgba(0,0,0,.5); border-radius: 28px; min-height: 54px; padding: 0 20px; }

/* ---------- tarjetas y rejilla ---------- */
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .rejilla { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.tarjeta { position: relative; background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; cursor: pointer; }
.tarjeta:hover, .tarjeta.sel { border-color: var(--acento); }
.tarjeta .img { aspect-ratio: 1; background: #0c1015 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--tenue2); }
.tarjeta .pie { padding: 8px 10px 10px; }
.tarjeta .nm { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta .sub { font-size: 12px; color: var(--tenue); display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.sello { position: absolute; top: 7px; left: 7px; padding: 3px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sello.ref { background: var(--ref); color: #fff; } .sello.nc { background: var(--naranja); color: #111; } .sello.pub { background: var(--ok); color: #062; left: auto; right: 7px; }
.sello.skin { background: var(--azul); color: #031; top: auto; bottom: 64px; }
.estado { font-size: 11.5px; font-weight: 700; }
.estado.pendiente { color: var(--aviso); } .estado.en_proceso { color: var(--azul); } .estado.hecha { color: var(--ok); } .estado.descartada { color: var(--tenue2); }
.vacio { padding: 40px 16px; text-align: center; color: var(--tenue); border: 1px dashed var(--linea2); border-radius: var(--radio); }
.grupo { margin: 18px 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--tenue2); font-weight: 700; }

/* ---------- barra de filtros ---------- */
.filtros { display: flex; gap: 8px; margin-bottom: 12px; }
.filtros input[type=search] { flex: 1; min-width: 0; }
.campo { margin: 10px 0; }
.campo > label { display: block; font-size: 12px; font-weight: 700; color: var(--tenue); margin-bottom: 5px; letter-spacing: .02em; }
input.t, select.t, textarea.t, .filtros input, .filtros select { width: 100%; min-height: var(--alto-btn); background: #0b0f14; border: 1px solid var(--linea2); border-radius: var(--radio); padding: 0 12px; outline: none; }
textarea.t { padding: 10px 12px; min-height: 90px; resize: vertical; }
textarea.t.codigo { font-family: var(--mono); font-size: 12px; min-height: 220px; white-space: pre; }
input.t:focus, select.t:focus, textarea.t:focus { border-color: var(--acento); }
.fila { display: flex; gap: 10px; flex-wrap: wrap; } .fila > * { flex: 1 1 150px; min-width: 0; }
.seg { display: flex; border: 1px solid var(--linea2); border-radius: var(--radio); overflow: hidden; }
.seg button { flex: 1; min-height: 44px; background: none; border: 0; color: var(--tenue); font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--acento-bg); color: var(--acento); } .seg button.on.r { background: var(--ref-bg); color: var(--ref); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 19px; background: var(--panel2); border: 1px solid var(--linea2); font-weight: 600; font-size: 13px; cursor: pointer; }
.chip.on { border-color: var(--acento); color: var(--acento); background: var(--acento-bg); }
.chip.pub { border-color: var(--ok); }

/* ---------- popups ---------- */
.capa { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.66); display: flex; align-items: flex-end; justify-content: center; }
.popup { width: 100%; max-height: 94vh; background: var(--panel); border: 1px solid var(--linea2); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; animation: sube .18s ease-out; }
@keyframes sube { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.popup .pcab { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--linea); min-height: 60px; }
.popup .pcab .tit { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup .x { width: 52px; height: 52px; border: 0; border-radius: 26px; background: var(--panel2); font-size: 22px; cursor: pointer; flex: 0 0 auto; }
.popup .asa { width: 44px; height: 5px; border-radius: 3px; background: var(--linea2); margin: 6px auto 0; }
.popup .pcuerpo { padding: 14px 16px 16px; overflow: auto; flex: 1; }
.popup .ppie { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); display: flex; gap: 8px; flex-wrap: wrap; }
.popup .ppie .btn { flex: 1 1 130px; }
@media (min-width: 900px) {
  .capa { align-items: center; }
  .popup { width: min(720px, 94vw); border-radius: 16px; max-height: 90vh; }
  .popup.l { width: min(1180px, 96vw); } .popup.s { width: min(480px, 94vw); }
  .popup .asa { display: none; }
}

/* ---------- avisos y progreso ---------- */
.msg { padding: 10px 12px; border-radius: var(--radio); margin: 8px 0; font-size: 14px; white-space: pre-wrap; }
.msg.info { background: rgba(90,169,255,.12); color: #bfe0ff; } .msg.ok { background: var(--ok-bg); color: #b9f5d2; } .msg.mal { background: var(--ref-bg); color: #ffc8c2; } .msg.aviso { background: var(--aviso-bg); color: #ffe2a8; }
.banda-ref { background: var(--ref); color: #fff; font-weight: 800; padding: 9px 12px; border-radius: var(--radio); letter-spacing: .03em; margin-bottom: 10px; }
.banda-nc { background: var(--naranja); color: #111; font-weight: 800; padding: 9px 12px; border-radius: var(--radio); margin-bottom: 10px; }
.barra { height: 12px; border-radius: 6px; background: var(--linea2); overflow: hidden; margin: 8px 0 4px; }
.barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--acento), var(--naranja)); transition: width .4s; }
.barra.indet > i { width: 35% !important; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { from { margin-left: -35%; } to { margin-left: 100%; } }
.trabajo { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px; margin: 8px 0; }
.trabajo .t1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.trabajo .t2 { font-size: 12.5px; color: var(--tenue); margin-top: 2px; }
#toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--abajo) + 18px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; pointer-events: none;
  background: #1d232c; border: 1px solid var(--acento); color: var(--txt); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: 92vw; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* ---------- semáforo de la revisión de subidas ---------- */
.semaforo { list-style: none; margin: 8px 0; padding: 0; }
.semaforo li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.semaforo li::before { content: ''; flex: 0 0 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--ok); }
.semaforo li.aviso::before { background: var(--aviso); } .semaforo li.mal::before { background: var(--mal); }
.nivel { display: inline-block; padding: 4px 10px; border-radius: 6px; font-weight: 800; }
.nivel.ok { background: var(--ok-bg); color: var(--ok); } .nivel.aviso { background: var(--aviso-bg); color: var(--aviso); } .nivel.mal { background: var(--ref-bg); color: var(--mal); }

/* ---------- ficha ---------- */
.vista { background: #0b0f14; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; margin-bottom: 10px; }
.vista img { display: block; max-width: 100%; max-height: 52vh; margin: 0 auto; }
.vista .mosaico { height: 240px; background-repeat: repeat; background-size: 120px; }
.vista audio { width: 100%; display: block; }
.vista .etq { font-size: 11.5px; color: var(--tenue); padding: 4px 8px; display: flex; justify-content: space-between; }
.vista canvas { display: block; width: 100%; height: 300px; touch-action: none; }
.versiones { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.info { font-size: 12.5px; color: var(--tenue); margin: 4px 0 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--linea); text-align: left; }
.soltar { border: 2px dashed var(--linea2); border-radius: var(--radio); padding: 26px 14px; text-align: center; color: var(--tenue); cursor: pointer; }
.soltar.encima { border-color: var(--acento); color: var(--acento); }
details.caja { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 4px 14px; margin: 10px 0; }
details.caja > summary { cursor: pointer; font-weight: 800; min-height: 48px; display: flex; align-items: center; gap: 8px; }
.login { max-width: 420px; margin: 9vh auto 0; background: var(--panel); border: 1px solid var(--linea2); border-radius: 16px; padding: 24px 20px; }
.login .logo { width: 64px; height: 64px; display: block; margin: 0 auto 10px; }
.login h1 { text-align: center; letter-spacing: .26em; color: var(--acento); font-size: 17px; margin: 0 0 18px; }
