:root {
  --azul: #0b3d6e; --azul2: #1565a8; --fondo: #f2f5f9; --tarjeta: #fff; --texto: #14202e; --suave: #5b6b7c;
  --ok: #1b8a4b; --alerta: #c77700; --error: #c62828; --borde: #d5dde6; --radio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.sin-scroll { overflow: hidden; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 0 0 calc(84px + env(safe-area-inset-bottom)); }
.cargando { text-align: center; padding: 3rem 1rem; color: var(--suave); }
.top { background: var(--azul); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top h1 { font-size: 1.1rem; margin: 0; }
.top small { opacity: .8; display: block; font-size: .8rem; }
.top .salir { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; padding: 6px 10px; font-size: .85rem; }
main { padding: 12px 16px; display: grid; gap: 12px; }
.card { background: var(--tarjeta); border-radius: var(--radio); padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h2, .card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.fila { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--borde); }
.fila:last-child { border-bottom: 0; }
.suave { color: var(--suave); font-size: .9rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #e3eaf2; color: var(--azul); }
.badge.ok { background: #dcf3e5; color: var(--ok); } .badge.alerta { background: #fff0d6; color: var(--alerta); } .badge.error { background: #fde1e1; color: var(--error); } .badge.gris { background: #eceff2; color: var(--suave); }
.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acciones .ancho { grid-column: 1 / -1; }
.btn { appearance: none; border: 0; border-radius: var(--radio); background: var(--azul2); color: #fff; font: inherit; font-weight: 600; min-height: 56px; padding: 10px 14px; width: 100%; cursor: pointer; }
.btn:active { filter: brightness(.9); }
.btn:disabled { opacity: .5; }
.btn.sec { background: #e3eaf2; color: var(--azul); }
.btn.ok { background: var(--ok); } .btn.peligro { background: var(--error); }
.btn.chico { min-height: 40px; width: auto; padding: 6px 12px; font-size: .9rem; }
.campo { display: grid; gap: 4px; margin-bottom: 10px; }
.campo span { font-size: .85rem; color: var(--suave); font-weight: 600; }
input, select, textarea { font: inherit; padding: 12px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; width: 100%; min-height: 48px; color: var(--texto); }
textarea { min-height: 90px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chk { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; } .chk input { width: 24px; min-height: 24px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--borde); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 2px; font-size: .72rem; color: var(--suave); display: grid; gap: 2px; justify-items: center; min-height: 56px; }
.tabs button span { font-size: 1.3rem; line-height: 1; }
.tabs button.activo { color: var(--azul2); font-weight: 700; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--borde); }
.sheet-head h2 { margin: 0; font-size: 1.1rem; }
.cerrar { border: 0; background: #eceff2; border-radius: 99px; width: 40px; height: 40px; font-size: 1rem; }
.sheet-body { padding: 16px; overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
#toasts { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 50; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ok); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.toast.error { background: var(--error); }
.centro { padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.centro h1 { color: var(--azul); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--borde); }
th { color: var(--suave); font-size: .78rem; }
td.n, th.n { text-align: right; }
.lista-click .fila { cursor: pointer; }
.labor { padding: 8px 0; border-bottom: 1px solid var(--borde); display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.labor:last-child { border-bottom: 0; }
.labor b { color: var(--azul); }
.bloque { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 2px dashed var(--borde); }
