[hidden] { display: none !important; }
/* Natursara · app de gestión */
body { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--brand); color: #fff; }
.top-title { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 38px; height: 38px; border-radius: 12px; font-size: 26px; line-height: 1; display: grid; place-items: center; }
.sync { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #9BE3B3; }
.sync.pend .sync-dot, .sync.busy .sync-dot { background: #FFD27A; }
.sync.busy .sync-dot { animation: pulse 1s infinite; }
.sync.off .sync-dot { background: #C9C0C6; }
.sync.err .sync-dot { background: #FF8A8A; }
@keyframes pulse { 50% { opacity: .3; } }
main#view { max-width: 680px; margin: 0 auto; padding: 14px 16px; }

/* login */
.login { max-width: 360px; margin: 8vh auto 0; text-align: center; }
.login-logo { width: 220px; max-width: 70%; margin-bottom: 24px; }
.login .card { text-align: left; }
.err { color: var(--bad); font-size: 13px; min-height: 1em; margin: 8px 0 0; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-card); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; margin-top: 10px; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-card); border: 1px solid var(--line); color: var(--brand); text-decoration: none; font-size: 18px; }
.fab { position: fixed; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 28px; text-decoration: none; box-shadow: 0 8px 22px rgba(120, 19, 85, .35); }

/* lista */
.list-head { display: flex; gap: 8px; margin-bottom: 12px; position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 4px 0; }
input[type=search], .form input, .form select, .form textarea, .login input, .sheet .link {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card); color: var(--ink); font: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }

/* ficha */
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.phead h1 { font-size: 21px; }
.phead p { margin: 4px 0 0; font-size: 13px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tabs { display: flex; width: 100%; margin-bottom: 14px; }
.tabs button { flex: 1; padding: 9px 6px; font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* formularios */
.form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.form label small { font-weight: 400; }
.form label input, .form label select, .form label textarea { margin-top: 5px; }
.form h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin: 18px 0 10px; }
.form-who { margin: 0 0 10px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.numf { position: relative; }
.numf .ref { position: absolute; left: 2px; top: 76px; font-size: 10.5px; color: var(--muted); font-style: normal; }
.numf { padding-bottom: 14px; }
.numf .live { position: absolute; right: 10px; top: 33px; font-size: 12px; font-weight: 700; pointer-events: none; }
.live.good { color: var(--good); } .live.bad { color: var(--bad); } .live.same { color: var(--same); }
.imc-live { font-weight: 700; color: var(--brand); margin: 0 0 12px; font-size: 14px; }

/* hoja de compartir */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 8, 16, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: var(--bg-card); border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet p { font-size: 13px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #2A2229; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.small { font-size: 12px; margin-top: 14px; }
.row.rep { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.row.rep .avatar { font-size: 10px; }
.tabs button { font-size: 12px; padding: 9px 4px; }
