/* NODU · sistema de diseño (manual de marca v1) */
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap; src: url('/fonts/montserrat-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap; src: url('/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --verde: #0B2B26;      /* Verde Profundo */
  --turquesa: #00D6C6;   /* Turquesa */
  --arena: #F5F3EC;      /* Arena */
  --blanco: #FFFFFF;
  --ink: #0B2B26;
  --muted: #5A6E69;
  --faint: #93A29E;
  --line: #E3E0D5;
  --soft: #EBE8DD;
  --turq-ink: #007F76;   /* turquesa legible sobre claro */
  --turq-soft: #D9F7F4;
  --ok: #1A8F5B; --ok-soft: #DDF3E7;
  --warn: #B7791F; --warn-soft: #FBEFD0;
  --bad: #C2392B; --bad-soft: #FBE1DD;
  --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(11,43,38,.06), 0 6px 20px rgba(11,43,38,.06);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-weight: 400; color: var(--ink); background: var(--arena); line-height: 1.5; font-size: 15px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-weight: 700; font-size: 26px; } h2 { font-weight: 700; font-size: 20px; } h3 { font-weight: 600; font-size: 16px; } h4 { font-weight: 600; font-size: 14px; }
p { margin: 0; } a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.b { font-weight: 700; } .sb { font-weight: 600; } .center { text-align: center; } .right { text-align: right; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.sm { gap: 8px; } .stack.lg { gap: 20px; }
.grid { display: grid; gap: 12px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3.keep { grid-template-columns: repeat(3, 1fr); } .g3:not(.keep) { grid-template-columns: 1fr; } .g2.stay { grid-template-columns: repeat(2, 1fr); } .g2:not(.stay) { grid-template-columns: 1fr; } }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--verde); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: transform .06s, opacity .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.turq { background: var(--turquesa); color: var(--verde); }
.btn.ghost { background: transparent; color: var(--verde); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.soft { background: var(--turq-soft); color: var(--turq-ink); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 13px; } .btn.block { display: flex; width: 100%; }
.btn.lg { min-height: 52px; font-size: 16px; }
.btn svg { flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--turq-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Formularios ---- */
label.f { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--turquesa); box-shadow: 0 0 0 3px rgba(0,214,198,.2); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.okmsg { background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #CFD6D3; border-radius: 999px; transition: background .15s; }
.switch i::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--turq-ink); } .switch input:checked + i::after { transform: translateX(18px); }

/* ---- Tarjetas y piezas ---- */
.card { background: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.dark { background: var(--verde); color: #fff; }
.card h3 + .muted, .card h2 + .muted { margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.turq { background: var(--turq-soft); color: var(--turq-ink); } .badge.dark { background: var(--verde); color: #fff; }
.stat { background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; } .stat .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat .d { font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--ok); }
.list > * + * { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.item .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--turq-soft); color: var(--turq-ink); display: grid; place-items: center; flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--turq-soft); color: var(--turq-ink); }
.tabs { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { flex: 1; text-align: center; white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; cursor: pointer; }
.tabs .on { background: #fff; color: var(--verde); box-shadow: 0 1px 3px rgba(11,43,38,.12); }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--turquesa); border-radius: 99px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tscroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
details.more { border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
details.more > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; } details.more[open] > summary { border-bottom: 1px solid var(--line); } details.more > .body { padding: 16px 18px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.locked { position: relative; opacity: .7; }
.lock-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; background: var(--warn-soft); color: var(--warn); padding: 4px 10px; border-radius: 99px; }

/* ---- Marca ---- */
.brand-curve { position: absolute; pointer-events: none; }
.logo { display: block; height: 28px; width: auto; }

/* ---- Pantalla de entrada ---- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--verde); position: relative; overflow: hidden; }
.auth::before { content: ''; position: absolute; right: -25vmin; bottom: -30vmin; width: 85vmin; height: 85vmin; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--turquesa), #04574F 70%); opacity: .9; }
.auth::after { content: ''; position: absolute; left: -20vmin; top: -25vmin; width: 55vmin; height: 55vmin; border-radius: 50%; background: rgba(0,214,198,.08); }
.auth .box { position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--arena); border-radius: 24px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth .logo { height: 34px; margin: 0 auto 18px; }

/* ---- Shell de paneles: barra inferior en celular, lateral en escritorio ---- */
.shell { min-height: 100dvh; padding-bottom: 76px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--verde); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
.topbar .logo { height: 22px; } .topbar .ttl { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar a, .topbar button { color: #fff; } .iconbtn { background: rgba(255,255,255,.1); border: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.support-bar { background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13px; padding: 8px 16px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.page { max-width: 980px; margin: 0 auto; padding: 18px 16px 24px; }
.page > * + * { margin-top: 16px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); overflow-x: auto; scrollbar-width: none; }
.nav a { flex: 1 0 auto; min-width: 68px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 8px 8px; font-size: 11px; font-weight: 600; color: var(--faint); text-decoration: none; }
.nav a.on { color: var(--turq-ink); } .nav a.on svg { stroke-width: 2.3; }
@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 230px; }
  .nav { top: 0; bottom: auto; width: 230px; right: auto; height: 100dvh; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 74px 12px 12px; overflow-y: auto; gap: 2px; }
  .nav a { flex: none; flex-direction: row; gap: 12px; font-size: 14px; padding: 11px 14px; border-radius: 12px; min-width: 0; }
  .nav a.on { background: var(--turq-soft); }
  .topbar { margin-left: -230px; padding-left: 20px; z-index: 40; }
  .page { padding-top: 24px; }
}

/* ---- Instalar app ---- */
.install { background: var(--verde); color: #fff; border-radius: var(--r-lg); padding: 16px; display: flex; gap: 14px; align-items: center; }
.install img { width: 48px; height: 48px; border-radius: 12px; }

/* ---- Toast y modal ---- */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--verde); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-bg { position: fixed; inset: 0; background: rgba(11,43,38,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--arena); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 24px; } }

/* ===== Métricas y facilidad de uso (Inicio del dueño y del admin) ===== */
.btn.bigcta { min-height: 64px; font-size: 19px; gap: 10px; box-shadow: 0 8px 22px rgba(0,214,198,.28); }
.kpi { background: #fff; border-radius: var(--r); padding: 14px 14px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.kpi .n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .dl { font-size: 13px; font-weight: 700; } .kpi .dl .muted { font-weight: 500; font-size: 12px; }
.msgc { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); border-left: 5px solid var(--line); }
.msgc .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--soft); }
.msgc.ok { border-left-color: var(--ok); } .msgc.ok .ico { background: var(--ok-soft); color: var(--ok); }
.msgc.warn { border-left-color: #E3A23A; } .msgc.warn .ico { background: var(--warn-soft); color: #B7791F; }
.msgc.bad { border-left-color: var(--bad); } .msgc.bad .ico { background: var(--bad-soft, #fde8e4); color: var(--bad); }
.msgc.info { border-left-color: var(--turquesa); } .msgc.info .ico { background: var(--turq-soft); color: var(--turq-ink); }
.msgc .b { font-size: 15px; line-height: 1.35; }
.cbars { display: flex; align-items: flex-end; gap: 3px; } .cbars .cb { flex: 1; height: 100%; display: flex; align-items: flex-end; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
.cbars .cb span { display: block; width: 100%; background: var(--turquesa); border-radius: 4px 4px 0 0; transition: filter .15s; } .cbars .cb:hover span, .cbars .cb:focus-visible span { filter: brightness(.82); }
.cbl { display: flex; gap: 3px; margin-top: 4px; } .cbl i { flex: 1; text-align: center; font-size: 10px; font-style: normal; color: var(--faint); white-space: nowrap; overflow: visible; }
.fstep { background: linear-gradient(90deg, var(--turquesa), #2FB9AE); color: #06302b; border-radius: 10px; padding: 9px 12px; font-size: 16px; min-width: 56px; }
.hm { display: grid; gap: 2px; } .hm .hh, .hm .hd { font-size: 10px; color: var(--faint); font-style: normal; align-self: center; text-align: center; }
.hm .hd { text-align: left; font-weight: 600; } .hm .hc { height: 24px; border: 0; border-radius: 4px; cursor: pointer; padding: 0; }
.hm .hc:focus-visible, .hm .hc:hover { outline: 2px solid var(--turquesa); }
.hbadge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.hbadge.g { background: var(--ok-soft); color: var(--ok); } .hbadge.y { background: var(--warn-soft); color: #B7791F; } .hbadge.r { background: #fde8e4; color: var(--bad); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr) !important; } }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } @media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: #fff; border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; min-height: 118px; }
.tile .ico { width: 46px; height: 46px; border-radius: 14px; background: var(--turq-soft); color: var(--turq-ink); display: grid; place-items: center; margin-bottom: 4px; } .tile .b { font-size: 16px; } .tile:active { transform: scale(.98); }

/* Ojito de la contraseña */
.pw { position: relative; } .pw .input { padding-right: 52px; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 12px; }
.pw .eye:hover, .pw .eye:focus-visible { color: var(--ink); background: var(--soft); }

/* Numerito de avisos nuevos en el menú */
.nav a { position: relative; }
.nbadge { position: absolute; top: 3px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
@media (min-width: 900px) { .nbadge { position: static; margin-left: auto; box-shadow: none; } }
.tray details.more > summary { font-size: 14px; }
.msgc .link { color: var(--muted); }

/* Listas largas: pie con el total y el botón "Cargar más" */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px 4px; flex-wrap: wrap; }
.pager:empty { display: none; }
.tabs .tn { opacity: .75; font-weight: 500; }
