:root {
  --green: #1d5e3a;
  --green-2: #2f7d4f;
  --green-soft: #e6f2ea;
  --ink: #1b1f1c;
  --muted: #5b655e;
  --line: #d9ded9;
  --bg: #f4f6f2;
  --card: #ffffff;
  --red: #b3261e;
  --amber: #8a5a00;
  --amber-soft: #fff4dc;
  --wa: #128c4a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 19px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}
body.public { padding-bottom: 32px; }
a { color: var(--green); }
h1 { font-size: 1.5rem; margin: .4em 0 .5em; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; }
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 16px 24px; }
.wrap.narrow { max-width: 480px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Cabecera y menú inferior */
.top {
  position: sticky; top: 0; z-index: 10; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.brand img { background: #fff; border-radius: 10px; }
.avatar {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--green); font-weight: 700; font-size: 1.15rem;
}
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.bottom a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 10px;
  color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; min-height: 68px; position: relative;
}
.bottom svg { width: 28px; height: 28px; fill: currentColor; }
.bottom a.on { color: var(--green); }
.bottom a.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 4px; border-radius: 0 0 4px 4px; background: var(--green); }
.bottom a.soon { opacity: .5; }
.bottom small { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* Logo público */
.logo { text-align: center; margin: 24px 0 16px; }
.logo img { border-radius: 16px; }
.logo h1 { color: var(--green); margin: 8px 0 0; }
.logo h1 span { font-weight: 400; }

/* Tarjetas */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px; margin: 0 0 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); border: 1px solid #e8ebe7;
}
.soon-card { background: var(--green-soft); border-color: #cfe5d6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; border: 1px solid #e8ebe7; }
.stat span { display: block; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { display: block; font-size: 1.35rem; margin-top: 2px; word-break: break-word; }
.hello { margin-bottom: 0; }
.big-num { font-size: 2rem; font-weight: 700; margin: 0; }
.big-num small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.ok-line { color: var(--green); font-weight: 600; }
.warn-line { color: var(--amber); font-weight: 600; }
.rank-now { font-size: 1.4rem; font-weight: 700; color: var(--green); margin: 0 0 8px; }
.bar { height: 16px; background: #e4e9e4; border-radius: 99px; overflow: hidden; margin: 6px 0 8px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), var(--green)); border-radius: 99px; }

/* Formularios */
.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea {
  font: inherit; width: 100%; padding: 13px 14px; border: 2px solid #c9d0ca; border-radius: 12px; background: #fff; color: var(--ink);
  min-height: 56px;
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,94,58,.18); }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
label.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
label.check input { width: 26px; height: 26px; min-height: 26px; margin-top: 2px; flex: none; accent-color: var(--green); }
.indent { padding-left: 36px; display: grid; gap: 8px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 80px; }
.show-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--green); font: inherit; font-weight: 700; padding: 8px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.searchbar { grid-template-columns: 1fr auto; margin-bottom: 14px; }
.searchbar input { grid-column: 1 / -1; }
.copybox { display: flex; gap: 8px; margin-bottom: 14px; }
.copybox input { font-size: .9rem; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 12px 22px;
  border-radius: 12px; border: 2px solid var(--green); background: var(--green); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn.big { min-height: 62px; font-size: 1.1rem; }
.btn.small { min-height: 48px; padding: 8px 14px; width: auto; }
.btn.ghost { background: #fff; color: var(--green); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.ghost.danger { background: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); margin-bottom: 14px; }
.btn.wa-outline { color: var(--wa); border-color: var(--wa); margin-top: 10px; }
.link { background: none; border: 0; color: var(--green); font: inherit; font-weight: 600; text-decoration: underline; padding: 8px 0; cursor: pointer; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 1.1rem; min-width: 44px; min-height: 44px; cursor: pointer; }
.actions { display: grid; gap: 10px; }

/* Avisos */
.alert { padding: 14px 16px; border-radius: 12px; margin: 0 0 14px; font-weight: 500; }
.alert-ok { background: var(--green-soft); color: #134a2c; }
.alert-error { background: #fde8e6; color: #7d1a14; }
.alert-warn { background: var(--amber-soft); color: #5c3d00; }
.alert-info { background: #e6effa; color: #163e6b; }
.alert.block { display: block; text-decoration: none; }

/* Listas y tablas */
.menu-list { background: var(--card); border-radius: var(--radius); border: 1px solid #e8ebe7; margin-bottom: 16px; overflow: hidden; }
.menu-list a { display: flex; justify-content: space-between; align-items: center; padding: 18px; min-height: 60px; text-decoration: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a span { color: var(--green); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list.cards li { padding: 0; border: 0; margin-bottom: 10px; }
.list.cards a { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; background: #fff; border: 1px solid #e8ebe7; border-radius: 12px; text-decoration: none; color: var(--ink); }
.kv { list-style: none; padding: 0; margin: 0 0 14px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; text-align: right; }
.kv li span { color: var(--muted); text-align: left; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eee; color: #444; white-space: nowrap; }
.tag-activo { background: var(--green-soft); color: var(--green); }
.tag-pendiente { background: var(--amber-soft); color: var(--amber); }
.tag-suspendido, .tag-rechazado { background: #fde8e6; color: var(--red); }
.badge { background: var(--red); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: .8rem; margin-right: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.tbl tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.tbl td.neg { color: var(--red); }
.tbl.inputs input { min-height: 48px; padding: 8px 6px; text-align: right; min-width: 62px; }
@media (max-width: 480px) {
  .tbl { font-size: .85rem; }
  .tbl th, .tbl td { padding: 9px 3px; }
  .tbl th { font-size: .68rem; }
}
.tbl-scroll { overflow-x: auto; margin: 0 -6px; }
.month-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.month-nav h1 { text-align: center; font-size: 1.3rem; }
.chart { width: 100%; height: 140px; display: block; }
.chart rect { fill: var(--green-2); }
.chart line { stroke: var(--line); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.steps { padding-left: 1.2em; margin: 0 0 14px; }
.steps li { margin-bottom: 6px; }
.sample { background: #f1f3f0; padding: 10px; border-radius: 8px; font-size: .9rem; }
.prose p { margin: .5em 0 .9em; }

@media (min-width: 700px) {
  .grid2 { grid-template-columns: repeat(4, 1fr); }
}

details.card summary { font-weight: 700; color: var(--green); cursor: pointer; min-height: 32px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 4px; }
.tabs a { flex: none; padding: 10px 16px; border-radius: 99px; background: #fff; border: 2px solid #d5dbd6; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.tabs a.on { background: var(--green); border-color: var(--green); color: #fff; }
.lchart { width: 100%; height: auto; display: block; }
.lchart .grid { stroke: #e3e7e3; }
.lchart .ax { font-size: 10px; fill: #6b746d; }
.lchart .val { font-size: 10px; fill: #1b1f1c; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; font-size: .9rem; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid #d5dbd6; border-radius: 99px; font-weight: 500; font-size: .9rem; }
.chip input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--green); }
.tbl.heat td { text-align: center; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.title-row h1, .title-row h2 { margin-bottom: .4em; }
.tabs a small { opacity: .7; font-weight: 700; margin-left: 4px; }
.clist { list-style: none; padding: 0; margin: 0 0 16px; }
.clist li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e8ebe7; border-radius: 12px; margin-bottom: 8px; }
.cmain { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--ink); min-height: 64px; }
.cinfo { display: grid; }
.cinfo small { color: var(--muted); font-size: .85rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: #b9c4bc; }
.dot-caliente { background: #d9480f; }
.dot-tibio { background: #e0a100; }
.dot-frio { background: #5b8fd6; }
.due { color: var(--red); }
.wa-btn { display: grid; place-items: center; width: 56px; height: 56px; margin-right: 8px; border-radius: 50%; background: var(--wa); color: #fff; flex: none; }
.btn.wa svg, .wa-btn svg { flex: none; }
.chead h1 { margin: 0; }
.ctitle { display: flex; align-items: center; gap: 10px; }
.chead .btn { margin-top: 10px; }
.big-line { font-size: 1.1rem; font-weight: 600; }
.due-card { border: 2px solid #f0b4ad; }
.choices-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choices-row .btn { flex: 1 1 30%; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; min-height: 86px; border: 2px solid #d5dbd6; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; line-height: 1.25; background: #fff; }
.act span { font-size: 1.4rem; }
.act:active { border-color: var(--green); background: var(--green-soft); }
fieldset.choices { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.choices legend { font-weight: 600; margin-bottom: 8px; }
label.pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid #d5dbd6; border-radius: 99px; font-weight: 600; }
label.pill input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--green); }
label.pill:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
details summary { font-weight: 700; color: var(--green); cursor: pointer; padding: 6px 0; }
.timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ticon { width: 32px; text-align: center; flex: none; font-size: 1.2rem; }
.note-box { background: var(--amber-soft); padding: 10px 12px; border-radius: 10px; }
.inline-note { margin-bottom: 8px; }
.today { list-style: none; padding: 0; margin: 0; }
.today li { border-top: 1px solid var(--line); padding: 12px 0; }
.today li:first-child { border-top: 0; }
.tmain { display: grid; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.tmain span { color: var(--muted); font-size: .92rem; }
.t-reconsumo .tmain strong::after { content: " · Reconsumo"; color: var(--amber); font-size: .85rem; }
.t-activacion .tmain strong::after { content: " · Activación"; color: #2b6cb0; font-size: .85rem; }
.tbtns { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.tbtns .btn.wa { margin: 0; }
.calc { font-weight: 700; color: var(--green); min-height: 1.5em; }
