:root{
  --navy:#1E2761; --navy-ink:#141b4d; --ice:#E8EEFC; --ice-line:#c9d6f5;
  --magenta:#C2185B; --magenta-tint:#FBE3EC; --gold:#B8860B;
  --text:#1E2761; --muted:#5A6B94; --bg:#F6F8FD; --card:#FFFFFF;
  --ok:#1E7A46; --ok-tint:#E4F4EA; --danger:#B3261E;
  --heading:#1E2761; --accent-num:#1E2761;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#11152b; --card:#181f45; --text:#e7ecff; --muted:#a9b6e6;
    --ice:#1f2a5c; --ice-line:#33407d; --magenta-tint:#3a1c2c;
    --ok-tint:#14301f; --heading:#cfe0ff; --accent-num:#cfe0ff;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#11152b; --card:#181f45; --text:#e7ecff; --muted:#a9b6e6;
  --ice:#1f2a5c; --ice-line:#33407d; --magenta-tint:#3a1c2c;
  --ok-tint:#14301f; --heading:#cfe0ff; --accent-num:#cfe0ff;
  color-scheme:dark;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ overscroll-behavior-y:contain; }
body{
  background:var(--bg); color:var(--text);
  font-family: Calibri, "Segoe UI", Roboto, Arial, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
  max-width:520px; margin:0 auto; font-size:14px;
}
img{ max-width:100%; }
[hidden]{ display:none !important; }

.app-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
h1{ font-family: Cambria, Georgia, serif; font-size:22px; margin:4px 0 2px; color:var(--heading); }
.eyebrow{ font-size:11px; font-weight:700; letter-spacing:1.3px; color:var(--magenta); text-transform:uppercase; margin:0; }
.subtitle{ color:var(--muted); font-size:13.5px; margin:2px 0 18px; }
.settings-title{ font-family:Cambria, Georgia, serif; font-size:17px; margin:0 0 4px; color:var(--heading); }
.card{ background:var(--card); border:1px solid var(--ice-line); border-radius:14px; padding:18px; margin-bottom:14px; }

.icon-btn{ background:none; border:1.5px solid var(--ice-line); color:var(--text); border-radius:10px;
  font-size:18px; width:42px; height:42px; cursor:pointer; flex:0 0 auto; }
.menu{ display:flex; flex-direction:column; gap:6px; background:var(--card); border:1px solid var(--ice-line);
  border-radius:12px; padding:8px; margin-bottom:14px; }
.menu button{ text-align:left; background:none; border:none; color:var(--text); font:inherit; font-weight:600;
  padding:11px 10px; border-radius:8px; cursor:pointer; }
.menu button:active{ background:var(--ice); }

label{ display:block; font-size:12.5px; font-weight:700; color:var(--muted); letter-spacing:.3px; margin:14px 0 6px; }
.card label:first-of-type{ margin-top:0; }
input[type=text], input[type=number], select, textarea{
  width:100%; padding:12px; border-radius:10px; border:1.5px solid var(--ice-line);
  background:var(--bg); color:var(--text); font-size:16px; font-family:inherit;
}
textarea{ min-height:70px; resize:vertical; font-size:13px; }
select{ appearance:none; -webkit-appearance:none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%235A6B94' d='M5 8l5 5 5-5z'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:34px;
}
.hidden-input{ display:none; }

.seg{ display:flex; gap:8px; margin-top:6px; }
.seg button{
  flex:1; padding:12px 6px; border-radius:10px; border:1.5px solid var(--ice-line);
  background:var(--bg); color:var(--text); font-family:inherit; font-size:14px; font-weight:600; cursor:pointer;
}
.seg button.active{ background:var(--navy); border-color:var(--navy); color:#fff; }

.submit-btn{
  display:block; width:100%; margin-top:20px; padding:15px; border:none; border-radius:12px;
  background:var(--navy); color:#fff; font-size:16px; font-weight:700; font-family:inherit; cursor:pointer;
}
.submit-btn:active{ background:var(--navy-ink); }
.submit-btn:disabled{ opacity:.55; }
.ghost-btn{
  display:block; width:100%; margin-top:10px; padding:13px; border-radius:12px;
  border:1.5px solid var(--ice-line); background:var(--card); color:var(--text);
  font-size:14px; font-weight:700; font-family:inherit; cursor:pointer;
}
.ghost-btn.danger{ color:var(--danger); border-color:var(--danger); }

.back-link{ display:inline-block; margin-bottom:10px; font-size:13px; color:var(--muted); cursor:pointer; font-weight:600; }

.confirm{ text-align:center; padding:40px 20px; }
.confirm .mark{
  width:64px; height:64px; border-radius:50%; background:var(--ok-tint); color:var(--ok);
  display:flex; align-items:center; justify-content:center; font-size:30px; margin:0 auto 16px;
}
.confirm h2{ font-family:Cambria, Georgia, serif; color:var(--heading); margin:0 0 6px; font-size:20px; }
.confirm p{ color:var(--muted); font-size:14px; margin:0 0 22px; }
.counter{
  display:inline-block; background:var(--ice); border-radius:20px; padding:6px 16px;
  font-size:13px; color:var(--heading); font-weight:700; margin-bottom:22px;
}
.field-optional{ font-weight:400; text-transform:none; letter-spacing:0; opacity:.75; }

.dash-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
.dash-filters{ display:flex; gap:8px; }
.dash-filters button{
  padding:8px 12px; border-radius:20px; border:1.5px solid var(--ice-line);
  background:var(--card); color:var(--muted); font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer;
}
.dash-filters button.active{ background:var(--navy); border-color:var(--navy); color:#fff; }
.refresh-btn{ border:none; background:none; color:var(--magenta); font-weight:700; font-size:12.5px; cursor:pointer; padding:4px; }
.stat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
.stat-card{ background:var(--card); border:1px solid var(--ice-line); border-radius:12px; padding:14px; text-align:center; }
.stat-num{ font-size:26px; font-weight:800; color:var(--accent-num); font-family:Cambria, Georgia, serif; }
.stat-label{ font-size:11px; color:var(--muted); font-weight:700; letter-spacing:.3px; margin-top:2px; }
.section-title{ font-size:13px; font-weight:700; color:var(--heading); margin:18px 0 8px; letter-spacing:.3px; }
.bar-row{ margin-bottom:9px; }
.bar-row .bar-label{ display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:3px; gap:10px; }
.bar-row .bar-label b{ color:var(--text); }
.bar-row .bar-label span{ color:var(--muted); }
.bar-track{ background:var(--ice); border-radius:6px; height:8px; overflow:hidden; }
.bar-fill{ background:var(--magenta); height:100%; border-radius:6px; }
.empty-note{ color:var(--muted); font-size:12.5px; text-align:center; padding:14px 0; }

.photo-choice{ display:flex; gap:8px; margin-top:6px; }
.photo-choice label{
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  border:1.5px dashed var(--ice-line); border-radius:10px; padding:12px 8px;
  cursor:pointer; background:var(--bg); margin:0; font-size:13px; font-weight:600;
  color:var(--muted); text-align:center;
}
.photo-preview{ margin-top:8px; max-width:140px; border-radius:8px; display:none; }
.photo-preview.show{ display:block; }
.identidad{
  font-size:12.5px; font-weight:600; color:var(--ok);
  background:rgba(16,138,86,.08); border-radius:8px;
  padding:8px 10px; margin-bottom:14px;
}
.loc-status{ font-size:11.5px; color:var(--muted); margin-top:8px; }
.loc-status.ok{ color:var(--ok); }
.loc-status.err{ color:var(--danger); }

.rec{ background:var(--card); border:1px solid var(--ice-line); border-radius:12px; padding:12px 14px; margin-bottom:9px; }
.rec-top{ display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.rec-rep{ font-weight:700; font-size:14.5px; }
.rec-when{ color:var(--muted); font-size:11.5px; white-space:nowrap; }
.rec-meta{ color:var(--muted); font-size:12.5px; margin-top:3px; }
.rec-badge{ display:inline-block; font-size:10.5px; font-weight:700; border-radius:20px; padding:2px 8px; margin-top:6px; }
.rec-badge.pend{ background:var(--magenta-tint); color:var(--magenta); }
.rec-badge.sync{ background:var(--ok-tint); color:var(--ok); }
.rec-foto{ display:block; margin-top:8px; font-size:12.5px; font-weight:600; color:var(--ok);
  background:none; border:none; padding:0; cursor:pointer; }
.rec-foto-img{ display:block; width:100%; max-width:320px; border-radius:10px; margin-top:8px; }

.offline-bar{ background:var(--magenta-tint); color:var(--magenta); font-size:12.5px; font-weight:700;
  border-radius:10px; padding:9px 12px; margin-bottom:12px; text-align:center; }
.toast{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(20px + env(safe-area-inset-bottom));
  background:var(--navy); color:#fff; padding:12px 18px; border-radius:24px; font-size:13.5px; font-weight:600;
  max-width:88vw; text-align:center; z-index:50; box-shadow:0 6px 20px rgba(0,0,0,.25); }
