:root {
  --azul: #006CB4; --azul-d: #00568f; --verde: #009C84; --verde-d: #017c69;
  --bg: #eef3f7; --card: #ffffff; --ink: #12303f; --muted: #6a808c;
  --line: #dde6ec; --ok: #009C84; --warn: #e08a00; --crit: #d64545;
  --shadow: 0 6px 22px rgba(0,60,100,.09); --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg,#f4f8fb,#eef3f7 240px); color: var(--ink);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }

/* Encabezado */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 4px 18px; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg,var(--azul),var(--verde));
  color: #fff; font-weight: 800; display: grid; place-items: center; letter-spacing: .5px; box-shadow: var(--shadow); }
.topbar h1 { font-size: 18px; margin: 0; line-height: 1.15; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.rolechip { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #e6f7f2; color: var(--verde-d); }
.rolechip.coord { background: #e5f0fa; color: var(--azul-d); }
.iconbtn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

/* Card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

/* Banner "ya se cerró" */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; }
.banner.ok { background: #e6f7f2; color: var(--verde-d); border: 1px solid #bfe9dd; }
.banner.pend { background: #fff4e0; color: #9a6400; border: 1px solid #f3d9a6; }

/* Anillo de progreso */
.ring-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: url(#grad); stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.ring .num small { font-size: 11px; color: var(--muted); font-weight: 600; }
.ring-txt b { font-size: 14.5px; } .ring-txt p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* Checklist */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check .box { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid #c4d2dc; display: grid; place-items: center; margin-top: 1px; transition: .15s; }
.check.on .box { background: var(--verde); border-color: var(--verde); }
.check .box svg { opacity: 0; transition: .15s; }
.check.on .box svg { opacity: 1; }
.check .txt { font-size: 14.5px; line-height: 1.35; padding-top: 2px; }
.check.on .txt { color: var(--muted); }
.check .del { margin-left: auto; color: var(--crit); font-size: 12px; opacity: .7; }

/* Campos */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfe; color: var(--ink); }
.field textarea { min-height: 68px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Botones */
.btn { width: 100%; font: inherit; font-weight: 700; font-size: 15.5px; padding: 15px; border-radius: 13px; border: 0; cursor: pointer;
  background: linear-gradient(135deg,var(--azul),var(--verde)); color: #fff; box-shadow: var(--shadow); }
.btn:disabled { background: #cfdae2; color: #8aa0ac; box-shadow: none; cursor: not-allowed; }
.btn.sec { background: var(--card); color: var(--azul); border: 1.5px solid var(--line); box-shadow: none; }
.btn.mini { width: auto; padding: 9px 14px; font-size: 13px; }

/* Tabs */
.tabs { display: flex; gap: 6px; background: #e2ebf1; padding: 5px; border-radius: 13px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13.5px; padding: 9px; border-radius: 9px; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--azul); box-shadow: 0 2px 8px rgba(0,60,100,.08); }

/* Historial */
.hrow { padding: 13px 4px; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hrow .h1 { display: flex; align-items: baseline; gap: 8px; }
.hrow .h1 b { font-size: 14.5px; } .hrow .h1 .d { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.hrow .obs { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #e6f7f2; color: var(--verde-d); }
.empty { text-align: center; color: var(--muted); padding: 26px 0; font-size: 13.5px; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; text-align: center; padding: 30px 26px; }
.login .logo { margin: 0 auto 14px; width: 56px; height: 56px; font-size: 20px; }
.login h2 { font-size: 20px; margin: 0 0 2px; } .login p.sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login .field { text-align: left; }
.login .err { color: var(--crit); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* Toast + modal */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); background: #12303f; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } .toast.err { background: var(--crit); }
.modal-bg { position: fixed; inset: 0; background: rgba(10,40,60,.45); display: grid; place-items: end center; z-index: 50; }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
@media (min-width: 600px){ .modal-bg{ place-items: center; } .modal{ border-radius: 20px; } }
