/* Cotalia Móvil · diseño para el móvil: botones grandes, contraste alto, modo oscuro y zonas seguras del iPhone */
:root { --navy: #363a44; --gold: #de9126; --bg: #f4f4f1; --card: #fff; --text: #1d2433; --muted: #6b7180; --line: #dcdcd6; --ok: #2e7d4f; --warn: #c77700; --bad: #c62828; --blue: #2563a8; --r: 14px;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px); }
@media (prefers-color-scheme: dark) { :root { --bg: #15171c; --card: #22252d; --text: #eceef2; --muted: #9aa0ad; --line: #353944; --navy: #0f1116; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(72px + var(--sb)); overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
.cargando { display: grid; place-items: center; height: 100vh; font-weight: 700; color: var(--muted); }
.cab { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--st)) 12px 10px; background: var(--navy); color: #fff; }
.cab h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab .ico { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; min-width: 44px; min-height: 44px; border-radius: 10px; }
.cab .ico:active { background: rgba(255,255,255,.12); }
.cab .mini { width: 32px; height: 32px; border-radius: 8px; margin: 0 4px; }
.cont { padding: 14px 14px 24px; max-width: 760px; margin: 0 auto; }
.pie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--sb); }
.pie button { flex: 1; background: none; border: 0; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; }
.pie button span { font-size: 22px; } .pie button.on { color: var(--gold); font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; }
.btn.pri { background: var(--gold); border-color: var(--gold); color: #1d1f26; } .btn.peligro { color: var(--bad); border-color: #e9b4b4; }
.btn.grande { width: 100%; min-height: 56px; font-size: 17px; margin: 14px 0 6px; } .btn.peq { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.fila { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; } .fila.fin { justify-content: flex-end; } .fila > .btn { flex: 1 1 auto; }
.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fab { position: fixed; right: 18px; bottom: calc(78px + var(--sb)); z-index: 25; width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--gold); color: #1d1f26; font-size: 32px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tarjeta { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.tarjeta b { display: block; font-size: 17px; margin: 4px 0 2px; } .t1 { display: flex; justify-content: space-between; align-items: center; } .t2 { font-size: 13px; color: var(--muted); }
.chip { font-size: 12px; font-weight: 700; color: var(--navy); background: #fff3d6; border-radius: 999px; padding: 2px 10px; }
@media (prefers-color-scheme: dark) { .chip { color: #1d1f26; } }
.est { font-size: 12px; font-weight: 700; } .est.amb { color: var(--warn); } .est.ok { color: var(--ok); } .est.azul { color: var(--blue); } .est.gris { color: var(--muted); }
.vacio { text-align: center; color: var(--muted); padding: 40px 10px; } .vacio b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.acciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 4px; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; }
.acc span { font-size: 26px; } .acc:active { background: #fff3d6; }
.fila-nav { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 8px; text-align: left; font-weight: 600; min-height: 54px; }
.fila-nav small { color: var(--muted); font-weight: 500; white-space: nowrap; margin-left: auto; } .fila-nav small.ok { color: var(--ok); }
button.fila-nav::after { content: '›'; color: var(--muted); font-size: 22px; margin-left: 4px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 2px 8px; }
.campo { margin-bottom: 12px; } .campo label { display: block; font-size: 14px; font-weight: 600; margin: 0 2px 5px; }
.campo input, .campo select, .campo textarea, .fila-l input, .fila-l select, .tarj-ed input, .insp input, #bp { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 16px; }
.campo textarea { min-height: 96px; resize: vertical; } .campo.dudoso input, .campo.dudoso select { border-color: var(--warn); background: #fff6e5; }
@media (prefers-color-scheme: dark) { .campo.dudoso input { background: #3a2f1a; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips button { min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); } .chips.mini button { min-height: 36px; padding: 5px 11px; font-size: 13px; }
.chips button.on.verde { background: var(--ok); border-color: var(--ok); } .chips button.on.amb { background: var(--warn); border-color: var(--warn); } .chips button.on.rojo { background: var(--bad); border-color: var(--bad); }
.chips.sueltas button.usada { opacity: .55; }
.sw { display: flex; align-items: center; gap: 12px; margin: 6px 2px 14px; font-weight: 600; min-height: 44px; }
.sw input { position: absolute; opacity: 0; } .sw span { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: .2s; }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw input:checked + span { background: var(--ok); } .sw input:checked + span::after { left: 23px; }
.lista .fila-l { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; } .fila-l > * { flex: 1; min-width: 0; } .fila-l .x { flex: none; }
.x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--bad); font-size: 24px; }
.tarj-ed, .insp, .caja, .audio { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; }
.tarj-ed summary { cursor: pointer; padding: 4px 0; } .tarj-ed summary small { color: var(--muted); }
.insp b { display: block; margin-bottom: 6px; } .insp input { margin-top: 8px; }
.caja h3 { margin: 0 0 8px; font-size: 16px; } .kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; } .kv:last-of-type { border-bottom: 0; }
.kv .ok { color: var(--ok); font-weight: 600; } .kv .mal { color: var(--bad); font-weight: 600; } .kv.tot { font-size: 16px; margin: 6px 2px; }
.nota { font-size: 14px; color: var(--muted); margin: 6px 2px 10px; } .nota.centro { text-align: center; }
.aviso { background: #fff6e5; border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 8px; margin: 8px 0 12px; font-size: 14px; color: #5a3d00; }
.aviso.mal { background: #fdecec; border-color: var(--bad); color: #7a1c1c; }
.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; } .galeria.peq { grid-template-columns: repeat(4, 1fr); }
.mini-f { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--line); }
.mini-f img { width: 100%; height: 100%; object-fit: cover; display: block; } .mini-f span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 10px 5px 4px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foto-g { width: 100%; border-radius: var(--r); display: block; margin-bottom: 12px; background: var(--line); max-height: 60vh; object-fit: contain; }
.hoja-ov { position: fixed; inset: 0; z-index: 100; background: rgba(15,17,22,.5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .15s; }
.hoja-ov.on { opacity: 1; }
.hoja { width: 100%; max-width: 760px; max-height: 88vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + var(--sb)); }
.hoja.alta { max-height: 94vh; } .hoja h2 { margin: 6px 0 12px; font-size: 19px; } .hoja-asa { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 8px; }
.opcion { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 8px; min-height: 52px; }
.opcion small { display: block; color: var(--muted); margin-top: 3px; }
.prop { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.prop input { width: 22px; height: 22px; margin-top: 2px; flex: none; } .prop b { display: block; font-size: 13px; color: var(--muted); }
.grabador { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0; }
.tiempo { font-size: 40px; font-variant-numeric: tabular-nums; font-weight: 700; }
.rec { width: 84px; height: 84px; border-radius: 50%; border: 6px solid #fff; background: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.rec.on { border-radius: 22px; animation: lat 1.2s infinite; } @keyframes lat { 50% { opacity: .6; } }
.audio audio { width: 100%; margin: 8px 0; } .audio textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--card); margin-bottom: 6px; }
.anot-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.anot-bar button { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; } .anot-bar button.on { background: var(--navy); color: #fff; }
.colores { display: flex; gap: 6px; margin-left: auto; } .colores button { width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 2px solid var(--line); } .colores button.on { border: 3px solid var(--gold); }
.anot-lienzo canvas { width: 100%; touch-action: none; border-radius: 10px; display: block; }
.firma-cv { width: 100%; height: 200px; background: #fff; border: 1px dashed var(--muted); border-radius: 12px; touch-action: none; display: block; }
table.med { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; } table.med th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 600; padding: 2px; }
table.med td { padding: 2px; } table.med input { width: 100%; min-width: 0; min-height: 40px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 15px; }
table.med td:first-child { width: 34%; } td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pasos { padding-left: 20px; } .pasos li { margin: 6px 0; }
pre.texto { white-space: pre-wrap; font-size: 12px; background: var(--card); padding: 10px; border-radius: 8px; max-height: 60vh; overflow: auto; }
.activar { max-width: 480px; margin: 0 auto; padding: calc(30px + var(--st)) 20px 30px; } .activar .logo { width: 84px; height: 84px; border-radius: 18px; display: block; margin: 0 auto 10px; }
.activar h1 { text-align: center; margin: 4px 0; } .activar .sub { text-align: center; color: var(--muted); margin-top: 0; }
.activar label { font-weight: 600; display: block; margin: 20px 0 6px; } .activar textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: 13px ui-monospace, monospace; background: var(--card); }
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--sb)); transform: translateX(-50%); z-index: 200; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; text-align: center; font-size: 15px; }
#toast.show { opacity: 1; }
@media (min-width: 700px) { .acciones { gap: 12px; } .galeria { grid-template-columns: repeat(5, 1fr); } }
