/* Vigía · app de campo (mobile-first) */
:root {
  --ink: #10151c;
  --muted: #5b6674;
  --line: #e3e8ef;
  --bg: #f4f6f9;
  --card: #ffffff;
  --brand: #f59e0b;
  --brand-dark: #b45309;
  --ok: #16a34a;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,21,28,.06), 0 8px 24px rgba(16,21,28,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100dvh;
}
button { font-family: inherit; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(150deg, #12161d, #0c0f14);
  border-bottom: 3px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand svg { width: 34px; height: 34px; flex: 0 0 auto; }
.brand b { font-size: 17px; letter-spacing: 2.5px; font-weight: 800; display: block; line-height: 1; }
.brand b i { color: var(--brand); font-style: normal; }
.brand span { font-size: 10.5px; color: #9aa6b5; letter-spacing: 1px; text-transform: uppercase; }
.top-right { display: flex; align-items: center; gap: 8px; }
.pill {
  background: rgba(255,255,255,.09); color: #dfe6ee; border: 1px solid rgba(255,255,255,.14);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap;
}
.pill b { color: var(--brand); }
.icon-btn {
  background: rgba(255,255,255,.09); color: #dfe6ee; border: 1px solid rgba(255,255,255,.14);
  width: 34px; height: 34px; border-radius: 10px; font-size: 15px; cursor: pointer;
}

/* ---------- screens ---------- */
.screen { max-width: 560px; margin: 0 auto; padding: 16px 14px calc(30px + env(safe-area-inset-bottom)); }
.hero { text-align: center; padding: 8px 0 4px; }
.hola { color: var(--muted); margin-bottom: 12px; font-size: 15px; }
.hola b { color: var(--ink); }
.big-cta {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1206;
  border: 0; border-radius: 18px; padding: 18px; cursor: pointer; text-align: left;
  box-shadow: 0 14px 34px rgba(245,158,11,.35);
}
.big-cta:active { transform: scale(.99); }
.cta-ic {
  width: 46px; height: 46px; border-radius: 14px; background: rgba(0,0,0,.18);
  display: grid; place-items: center; font-size: 19px; flex: 0 0 auto;
}
.big-cta b { display: block; font-size: 19px; }
.big-cta small { font-size: 12.5px; opacity: .8; }
.net-chip { margin-top: 12px; display: inline-block; font-size: 12px; color: var(--ok); }
.net-chip.off { color: var(--bad); }

.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-top: 16px; }
.block h2 { font-size: 14px; margin-bottom: 10px; }
.empty { color: var(--muted); font-size: 13.5px; }
.mylist .visit-row, #pendingList .visit-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; background: #fbfcfe;
}
.visit-row .v-main { min-width: 0; }
.visit-row .v-suc { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-row .v-meta { color: var(--muted); font-size: 12px; }
.visit-row .v-tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.v-tag.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.v-tag.inc { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.v-tag.pend { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.ghost {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 11px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.primary {
  background: linear-gradient(135deg, #f59e0b, #d97706); border: 0; color: #1a1206;
  border-radius: 11px; padding: 12px 18px; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(245,158,11,.3);
}
.primary:disabled, .ghost:disabled { opacity: .55; cursor: wait; }

/* ---------- wizard ---------- */
.wiz-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  position: sticky; top: calc(57px + env(safe-area-inset-top)); background: var(--bg); padding: 8px 0; z-index: 20;
}
#wizard .icon-btn { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.wiz-progress { flex: 1; height: 8px; background: #e6ebf2; border-radius: 999px; overflow: hidden; }
.wiz-bar { height: 100%; width: 14%; background: linear-gradient(90deg, #f59e0b, #d97706); border-radius: 999px; transition: width .3s; }
.wiz-step-label { font-size: 12px; color: var(--muted); white-space: nowrap; }

.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; }
.step h1 { font-size: 20px; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.sub { font-weight: 800; font-size: 13px; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .6px; margin: 14px 0 8px; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px; font-size: 16px; border: 1.5px solid #dde3ea; border-radius: 11px;
  background: #fbfcfe; outline: none; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gps-chip {
  display: flex; align-items: center; padding: 12px; font-size: 13.5px;
  border: 1.5px dashed #dde3ea; border-radius: 11px; color: var(--muted); background: #fbfcfe; min-height: 47px;
}
.gps-chip.ok { border-style: solid; border-color: #a7f3d0; background: #ecfdf5; color: #047857; }

/* radio cards (permiso) */
.radio-cards { display: grid; gap: 10px; }
.radio-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 2px solid var(--line); background: #fbfcfe; border-radius: 13px; padding: 14px; cursor: pointer; font-size: 15px;
}
.radio-card .rc-ic { font-size: 22px; }
.radio-card b { display: block; font-size: 15px; }
.radio-card small { color: var(--muted); font-size: 12.5px; }
.radio-card.on { border-color: var(--brand); background: #fffbeb; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

/* segmented sí/no */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 84px; padding: 12px 10px; border: 2px solid var(--line); border-radius: 11px;
  background: #fbfcfe; font-size: 14.5px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.seg button.on { border-color: var(--brand); background: #fffbeb; color: var(--brand-dark); }

/* counters */
.counter { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fbfcfe; }
.c-name { font-size: 14.5px; font-weight: 600; }
.c-ctrl { display: flex; align-items: center; gap: 6px; }
.c-ctrl button {
  width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff;
  font-size: 20px; font-weight: 800; color: var(--brand-dark); cursor: pointer;
}
.c-ctrl input { width: 74px; text-align: center; font-size: 17px; font-weight: 700; padding: 9px 4px; border: 1.5px solid #dde3ea; border-radius: 10px; background: #fff; }
.total-line { font-size: 14px; color: var(--muted); margin: 4px 0 12px; }
.total-line b { color: var(--ink); font-size: 16px; }

/* foto slots */
.foto-slot { border: 1.5px dashed #d3dae3; border-radius: 13px; padding: 12px; margin-bottom: 12px; background: #fbfcfe; }
.foto-slot label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.foto-slot label b { color: var(--brand-dark); }
.foto-btn {
  width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #12161d; color: #fff;
  font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.foto-slot.done { border-style: solid; border-color: #a7f3d0; background: #f0fdf4; }
.foto-slot.done .foto-btn { background: #065f46; }
.foto-prev { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; margin-top: 10px; }
.toggle-line .chk { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.toggle-line input { width: 20px; height: 20px; accent-color: var(--brand); }

.resumen { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; font-size: 13.5px; color: var(--muted); display: grid; gap: 4px; }
.resumen b { color: var(--ink); }

.wiz-nav {
  display: flex; gap: 10px; margin-top: 16px;
  padding-bottom: env(safe-area-inset-bottom);
}
.wiz-nav .ghost { flex: 1; padding: 14px; }
.wiz-nav .primary { flex: 2; padding: 14px; font-size: 16px; }

/* ---------- confirm + toast ---------- */
.confirm { position: fixed; inset: 0; background: rgba(10,13,18,.55); display: grid; place-items: end center; z-index: 60; }
.confirm-card {
  width: 100%; max-width: 560px; background: #fff; border-radius: 22px 22px 0 0; text-align: center;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
}
.confirm-ic { font-size: 46px; margin-bottom: 8px; }
.confirm-card h2 { font-size: 21px; margin-bottom: 6px; }
.confirm-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.confirm-card .primary { width: 100%; }

/* borrador + cola */
.draft-name { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.btn-row2 { display: flex; gap: 10px; }
.btn-row2 .primary { flex: 2; }
.btn-row2 .ghost { flex: 1; }
.v-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pend-del {
  background: #fff; border: 1.5px solid #fecaca; color: #b91c1c;
  border-radius: 9px; width: 36px; height: 36px; cursor: pointer; font-size: 14px;
}
.resumen .gps-warn { color: #b91c1c; font-weight: 700; }

/* ---------- cámara en la app ---------- */
.cam { position: fixed; inset: 0; background: #000; z-index: 90; display: flex; flex-direction: column; }
.cam video { flex: 1; width: 100%; object-fit: contain; background: #000; min-height: 0; }
.cam-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  background: rgba(10, 12, 16, .92);
}
.cam-side {
  background: rgba(255,255,255,.1); color: #e6ebf1; border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px; padding: 12px 14px; font-size: 14px; font-weight: 600; cursor: pointer; min-width: 96px;
}
.cam-shot {
  width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; cursor: pointer;
  background: linear-gradient(135deg, #f59e0b, #d97706); font-size: 26px;
  box-shadow: 0 0 0 5px rgba(255,255,255,.18);
}
.cam-shot:active { transform: scale(.94); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #12161d; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 70; max-width: 92vw; text-align: center;
}

@media (min-width: 640px) {
  .screen { padding-top: 22px; }
}
