:root {
  --bg: #f6f4f1; --card: #fff; --ink: #22201d; --mut: #6d675f; --line: #e7e2db;
  --heart: #d6336c; --turq: #0fb5ae; --ok: #2f9e44; --warn: #f08c00; --red: #e03131;
  --s-pedida: #adb5bd; --s-aprobada: #339af0; --s-en_curso: #fcc419; --s-hecha: #8ce99a; --s-realizada: #2f9e44; --s-rechazada: #868e96;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
.hide { display: none !important; }
.muted { color: var(--mut); }
.center { text-align: center; padding: 40px 16px; }
.small { font-size: 13px; }

header#top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; }
.brand b { color: var(--heart); }
.bell { position: relative; font-size: 22px; text-decoration: none; }
.bell span { position: absolute; top: -6px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bell span.personal { background: var(--turq); }

main { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(90px + var(--safe-b)); }
nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); }
nav#tabs a { flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; text-decoration: none; color: var(--mut); }
nav#tabs a span { display: block; font-size: 20px; }
nav#tabs a.on { color: var(--heart); font-weight: 700; }

h1 { font-size: 22px; margin: 6px 0 12px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card.alert { border-color: var(--turq); background: #e6fcf5; }
.card.warn { border-color: var(--warn); background: #fff4e6; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.item { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }

button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--heart); color: #fff; cursor: pointer;
  text-decoration: none; display: inline-block; text-align: center; }
button.sec, .btn.sec { background: #ece7e1; color: var(--ink); }
button.ok, .btn.ok { background: var(--ok); }
button.turq, .btn.turq { background: var(--turq); }
button.danger { background: var(--red); }
button.big { width: 100%; padding: 14px; font-size: 17px; font-weight: 700; }
button:disabled { opacity: .5; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.answers { display: flex; gap: 8px; }
.answers button { flex: 1; background: #ece7e1; color: var(--ink); }
.answers button.on { background: var(--ok); color: #fff; }
.answers button.on.no { background: var(--red); }
.answers button.on.tarde { background: var(--warn); }

label { display: block; font-size: 14px; color: var(--mut); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: auto; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.st { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; }
.st.pedida { background: var(--s-pedida); } .st.aprobada { background: var(--s-aprobada); } .st.en_curso { background: var(--s-en_curso); color: #5c4400; }
.st.hecha { background: var(--s-hecha); color: #1b4d23; } .st.realizada { background: var(--s-realizada); } .st.rechazada { background: var(--s-rechazada); }
.prio { display: inline-block; min-width: 24px; text-align: center; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 6px; background: #ffe3e3; color: var(--red); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #f1ede8; color: var(--mut); }

.notif { border-left: 4px solid var(--red); padding-left: 10px; }
.notif.personal { border-left-color: var(--turq); }
.notif.read { border-left-color: var(--ok); opacity: .7; }
.notif .t { font-weight: 700; }

.datehead { font-size: 13px; font-weight: 700; color: var(--mut); text-transform: capitalize; margin: 14px 0 4px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90%; text-align: center; }
.toast.err { background: var(--red); }

.lock { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.lock .heart { font-size: 64px; color: var(--heart); }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.steps i { width: 30px; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--heart); }
.code { font-size: 26px; letter-spacing: 4px; font-weight: 800; background: #f1ede8; border-radius: 10px; padding: 8px 14px; display: inline-block; }
.ios-share { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.fab { position: fixed; right: 18px; bottom: calc(78px + var(--safe-b)); width: 56px; height: 56px; border-radius: 50%; font-size: 30px; padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 9; }
