:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --ink: #18212d;
  --muted: #5d6673;
  --line: #e4e0d8;
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --accent: #e8a33d;
  --ok: #2f7d4f;
  --ok-bg: #e5f3ea;
  --warn: #9a6400;
  --warn-bg: #fdf1dc;
  --info: #2b5c9e;
  --info-bg: #e5eef9;
  --bad: #b23a3a;
  --bad-bg: #fbe7e7;
  --note: #fff7d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 6px 20px rgba(20, 30, 45, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -.03em;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700;
  background: var(--brand); color: var(--brand-ink); transition: filter .15s; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); background: rgba(0,0,0,.04); filter: none; }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn-light { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
.field select { min-height: 48px; }
.spot-row { position: relative; }
.spot-row + .spot-row { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.spot-del { position: absolute; right: 0; top: 18px; background: none; border: 0; color: var(--bad); font: inherit; font-size: 13px; cursor: pointer; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side {
  background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: radial-gradient(circle at 85% 15%, rgba(232,163,61,.25), transparent 40%),
                    radial-gradient(circle at 10% 90%, rgba(255,255,255,.08), transparent 45%);
}
.login-side .logo { color: #fff; }
.login-side .logo-mark { background: var(--accent); color: var(--brand); }
.login-side h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; max-width: 14ch; }
.login-side p { color: rgba(255,255,255,.75); max-width: 38ch; }
.login-features { display: grid; gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
.login-features li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); }
.login-features li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.login-main { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card .btn { width: 100%; padding: 14px; margin-top: 4px; }
.login-help { color: var(--muted); font-size: 14px; margin-top: 20px; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 8px; }

@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-side { padding: 28px 16px; gap: 16px; }
  .login-side .login-features, .login-side .foot { display: none; }
  .login-side h1 { font-size: 26px; max-width: none; }
}

/* ---------- Portal ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(245,243,238,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .who { color: var(--muted); font-size: 14px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }

.hero {
  background: var(--brand); color: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end;
  background-image: radial-gradient(circle at 95% 0%, rgba(232,163,61,.3), transparent 45%);
}
.hero h1 { font-size: 28px; letter-spacing: -.02em; }
.hero p { margin: 6px 0 0; color: rgba(255,255,255,.8); }
.hero .total { text-align: right; }
.hero .total small { display: block; color: rgba(255,255,255,.7); font-size: 13px; }
.hero .total strong { font-size: 34px; letter-spacing: -.02em; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero .total { text-align: left; }
}

.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-head h2 { font-size: 20px; letter-spacing: -.01em; }
.section-head span { color: var(--muted); font-size: 14px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.unit-card { display: flex; gap: 14px; align-items: flex-start; }
.unit-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--info-bg); color: var(--info); }
.unit-icon.cochera { background: var(--warn-bg); color: var(--warn); }
.unit-card h3 { font-size: 16px; }
.unit-card .kind { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.unit-card .amt { font-weight: 700; margin-top: 6px; }
.unit-card .meta { color: var(--muted); font-size: 14px; }

.pay-list { display: grid; gap: 10px; }
.pay-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
}
.pay-row .what strong { display: block; }
.pay-row .what span { color: var(--muted); font-size: 14px; }
.pay-row .money { font-weight: 700; text-align: right; white-space: nowrap; }
.pay-row .money small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.pay-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) {
  .pay-row { grid-template-columns: 1fr auto; }
  .pay-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.period-label { font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-pendiente { background: var(--warn-bg); color: var(--warn); }
.chip-vencido { background: var(--bad-bg); color: var(--bad); }
.chip-informado { background: var(--info-bg); color: var(--info); }
.chip-pagado { background: var(--ok-bg); color: var(--ok); }

.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.note { background: var(--note); border-radius: 4px 4px 14px 4px; padding: 18px; box-shadow: var(--shadow); position: relative; }
.note.urgente { background: #ffe3e0; }
.note.aviso { background: #e7f0fb; }
.note h3 { font-size: 16px; margin-bottom: 6px; }
.note p { margin: 0; white-space: pre-wrap; }
.note .when { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.note .tag { font-weight: 700; }

.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 20px; text-align: center; }

/* ---------- Contacto ---------- */
.contact { margin-top: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.contact h2 { font-size: 18px; margin-bottom: 4px; }
.contact p { margin: 0; color: var(--muted); }
.btn-wa { background: #1f8f4e; }

/* ---------- Registro ---------- */
.reg-head { max-width: 680px; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.reg-wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 64px; }
.reg-intro h1 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0; }
.reg-intro p { color: var(--muted); margin: 0 0 8px; }
.reg-lock { font-size: 14px; background: var(--info-bg); color: var(--info) !important; padding: 10px 12px; border-radius: 10px; }
.reg-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; box-shadow: var(--shadow); }
.reg-sec h2 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.reg-sec h2 span { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; display: grid; place-items: center; flex: none; }
.reg-sec .field:last-child { margin-bottom: 0; }
.reg-help { color: var(--muted); font-size: 14px; margin: -4px 0 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.photo-pick { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--line); border-radius: 12px; padding: 14px; cursor: pointer; font-weight: 600; }
.photo-pick:hover, .photo-pick.has-photo { border-color: var(--brand); }
.photo-pick input { display: none; }
.photo-pick img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span { display: block; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; font-weight: 600; font-size: 14px; line-height: 1.3; background: #fff; }
.pick small { font-weight: 500; color: var(--muted); }
.pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick input:checked + span small { color: rgba(255,255,255,.8); }
.pick input:focus-visible + span { outline: 2px solid var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.pw-meter { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.reg-submit { width: 100%; padding: 16px; font-size: 17px; margin-top: 18px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg); flex: none; }
.reg-kicker { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  background: var(--accent); color: var(--brand); padding: 3px 10px; border-radius: 999px; margin-top: 4px; }
.reg-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.reg-divider::before, .reg-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.reg-more summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.reg-more summary::-webkit-details-marker { display: none; }
.reg-more summary h2 { margin: 0; }
.reg-more summary h2::after { content: "Completar ›"; margin-left: auto; font-size: 13px; color: var(--brand); font-weight: 700; }
.reg-more[open] summary h2::after { content: "Ocultar"; }
.reg-more summary small { color: var(--muted); padding-left: 36px; }
.reg-sub { font-size: 15px; margin: 18px 0 6px; }
.pending-card { overflow-wrap: anywhere; min-width: 0; }
.loose-rc { margin-top: 10px; font-size: 14px; background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 10px; }

/* ---------- Menú (sándwich) y perfil ---------- */
.topbar-left { display: flex; align-items: center; gap: 6px; }
.burger { width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
.burger:hover { background: rgba(0,0,0,.05); }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.me-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--brand); color: var(--accent); font-weight: 800; font-size: 15px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.menu-bg { position: fixed; inset: 0; background: rgba(15,22,33,.35); z-index: 30; }
.menu { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); background: var(--surface); z-index: 31;
  box-shadow: 8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; animation: menu-in .18s ease-out; }
@keyframes menu-in { from { transform: translateX(-100%); } }
.menu-head { background: var(--brand); color: #fff; padding: 22px 18px; display: flex; gap: 12px; align-items: center;
  background-image: radial-gradient(circle at 95% 0%, rgba(232,163,61,.35), transparent 55%); }
.menu-head .me-pic { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.menu-head strong { display: block; }
.menu-head small { color: rgba(255,255,255,.75); word-break: break-all; }
.menu nav { padding: 10px; display: grid; gap: 2px; }
.menu nav a, .menu nav button, .menu nav .menu-file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 0; background: none;
  color: var(--ink); text-decoration: none; font-weight: 600; text-align: left; width: 100%; }
.menu nav a:hover, .menu nav button:hover, .menu nav .menu-file:hover { background: var(--bg); }
.menu nav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.menu nav .danger { color: var(--bad); }
.menu-foot { margin-top: auto; padding: 16px 18px; color: var(--muted); font-size: 12px; }

/* ---------- En revisión ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.step { font-size: 12px; color: rgba(255,255,255,.65); display: grid; gap: 6px; }
.step i { height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); }
.step.done i { background: var(--accent); }
.step.now i { background: linear-gradient(90deg, var(--accent) 50%, rgba(255,255,255,.2) 50%); }
.step.done, .step.now { color: #fff; font-weight: 600; }
.pay-card h2 { font-size: 18px; margin-bottom: 4px; }
.pay-card > p { color: var(--muted); margin: 0 0 14px; }
.pay-lines { display: grid; gap: 8px; }
.pay-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.pay-line small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pay-line b { font-size: 17px; word-break: break-all; }
.pay-extra { white-space: pre-wrap; color: var(--muted); font-size: 14px; margin-top: 10px; }
.send-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.send-ways .btn { width: 100%; }
@media (max-width: 520px) { .send-ways { grid-template-columns: 1fr; } }
.sent-list { margin-top: 12px; font-size: 14px; color: var(--ok); }

/* ---------- Administración ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent); color: var(--brand); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.tabs { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }
.tabs .count:empty { display: none; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat small { display: block; color: var(--muted); font-size: 13px; }
.stat strong { font-size: 22px; letter-spacing: -.01em; }
.todo-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; white-space: nowrap; }
.table .mono { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table .meta, .meta { color: var(--muted); font-size: 13px; }
.pending-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.pending-card h3 { font-size: 16px; }
.hint { color: var(--muted); font-size: 14px; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 14px; }
.ficha dt { color: var(--muted); }
.ficha dd { margin: 0; }
.table details summary { cursor: pointer; font-weight: 600; }
.prop-card { margin-bottom: 14px; }
.prop-head { display: flex; justify-content: space-between; gap: 16px; }
.prop-head h3 { font-size: 17px; }
.prop-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.prop-side b { font-size: 20px; }
.prop-side small { color: var(--muted); font-size: 12px; }
.prop-notes { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; }
.unit-chips { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-top: 12px; }
.unit-chip { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; text-align: left;
  background: var(--surface); color: var(--ink); cursor: pointer; }
.unit-chip:hover { border-color: var(--brand); }
.unit-chip.add { background: none; color: var(--brand); }
.unit-chip b { display: block; }
.unit-chip span { color: var(--muted); }
.unit-chip.on { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.unit-chip.on span { color: var(--ok); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 22, 32, .5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.ref-box { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.ref-box .label { font-size: 13px; color: var(--muted); }
.ref-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; }
.pay-data { white-space: pre-wrap; font-size: 14px; background: var(--bg); padding: 14px; border-radius: 10px; margin-bottom: 16px; }
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; display: block;
}
.drop:hover, .drop.has-file { border-color: var(--brand); color: var(--ink); }
.drop input { display: none; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Menú: elegir foto */
.menu nav .menu-file { cursor: pointer; }

/* Panel: pizarrón y fotos */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pending-card .card-actions { flex-direction: column; align-items: stretch; }
.post-form { margin-bottom: 8px; }
.field textarea { resize: vertical; }
.post-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px;
  border-left: 4px solid #e8c95a; overflow-wrap: anywhere; }
.post-row.aviso { border-left-color: #6d9bd1; }
.post-row.urgente { border-left-color: var(--bad); }
.post-row h3 { font-size: 16px; margin: 4px 0; }
.post-row > button { flex: none; }
.post-row p { margin: 0; white-space: pre-wrap; color: var(--ink); }
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.photo-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-card.new { outline: 2px solid var(--accent); }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.photo-card figcaption { padding: 12px 14px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.photo-card .card-actions { margin-top: 6px; }

/* Portal: mis fotos */
.my-photos-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.my-photos-head input { flex: 1 1 220px; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.my-photos .photo-grid { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* Panel: ventanas de la base interna */
.code-box { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
#am .modal { max-height: 92vh; overflow-y: auto; }
#am textarea { font: inherit; width: 100%; }
.table tr.muted td { opacity: .5; }

/* =====================================================================
   Diseño 2 (nov 2026): fondo con profundidad, tarjetas más vivas,
   pestañas tipo píldora, avisos flotantes, bienvenida y movimiento suave.
   ===================================================================== */
:root {
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .05), 0 10px 30px -12px rgba(20, 30, 45, .18);
  --shadow-hi: 0 2px 4px rgba(20, 30, 45, .06), 0 18px 40px -14px rgba(20, 30, 45, .28);
  --glass: rgba(255, 255, 255, .72);
}

/* Fondo: manchas suaves de los colores de la marca + puntitos */
body {
  background:
    radial-gradient(900px 600px at 105% -10%, rgba(232, 163, 61, .18), transparent 60%),
    radial-gradient(800px 600px at -10% 10%, rgba(31, 58, 95, .12), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(47, 125, 79, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(31, 58, 95, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

/* Barra superior de vidrio */
.topbar { background: rgba(245, 243, 238, .7); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom-color: rgba(228, 224, 216, .7); }
.logo-mark { background: linear-gradient(135deg, #2a4d7c, var(--brand)); box-shadow: 0 4px 12px -4px rgba(31, 58, 95, .6); }

/* Pestañas tipo píldora, deslizables en el celu */
.tabs { max-width: 1040px; margin: 0 auto; padding: 4px 12px 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s, transform .1s; }
.tabs button:hover { background: rgba(31, 58, 95, .07); color: var(--ink); }
.tabs button:active { transform: scale(.96); }
.tabs button.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(31, 58, 95, .8); }
.tabs .count:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--accent); color: var(--brand); font-size: 12px; font-weight: 800; }

/* Botones con más cuerpo */
.btn { background: linear-gradient(180deg, #284a76, var(--brand)); box-shadow: 0 6px 16px -10px rgba(31, 58, 95, .9);
  transition: transform .1s, filter .15s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid rgba(232, 163, 61, .7); outline-offset: 2px; }
.btn-light { background: var(--surface); box-shadow: none; }
.btn-ghost { box-shadow: none; background: transparent; }
.btn-wa { background: linear-gradient(180deg, #25a35b, #1f8f4e); }
.btn:disabled { position: relative; color: transparent !important; }
.btn:disabled::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-light:disabled::after { border-color: rgba(31, 58, 95, .25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tarjetas */
.card, .pay-row, .reg-sec, .stat { border-color: rgba(228, 224, 216, .8); transition: transform .2s, box-shadow .2s; }
.card:hover, .pay-row:hover { box-shadow: var(--shadow-hi); }
.unit-card:hover { transform: translateY(-2px); }
.stat { background: var(--glass); backdrop-filter: blur(6px); border: 1px solid rgba(228, 224, 216, .8); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.stat strong { font-size: 24px; letter-spacing: -.02em; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.todo-row { border-radius: 14px; }

/* Cabecera del portal con brillo en movimiento */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 30px;
  background: linear-gradient(135deg, #2a4d7c 0%, var(--brand) 55%, #142740 100%); }
.hero::before { content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: radial-gradient(circle at 75% 20%, rgba(232, 163, 61, .28), transparent 30%),
              radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .10), transparent 30%);
  animation: drift 14s ease-in-out infinite alternate; }
.hero::after { content: "ZX"; position: absolute; right: -10px; bottom: -40px; font-size: 160px; font-weight: 800;
  letter-spacing: -.06em; color: rgba(255, 255, 255, .05); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
@keyframes drift { to { transform: translate(8%, 6%) rotate(8deg); } }

/* Notas del pizarrón con leve inclinación */
.note { transition: transform .2s, box-shadow .2s; }
.note:nth-child(3n+1) { transform: rotate(-.6deg); }
.note:nth-child(3n+2) { transform: rotate(.5deg); }
.note:hover { transform: rotate(0) translateY(-3px); box-shadow: var(--shadow-hi); }

/* Tablas del panel */
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.table thead th { position: sticky; top: 0; background: #faf9f6; z-index: 1; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(31, 58, 95, .035); }

/* Ventanas: fondo borroso y aparición */
.modal-bg { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); border-radius: 20px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* Paneles que entran suave al cambiar de pestaña */
[data-panel]:not([hidden]) { animation: fadeup .3s ease-out; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

/* Entrada en cascada de las tarjetas (ui.js) */
.rv { animation: rise .45s ease-out both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; translate: 0 14px; } }

/* Avisos flotantes (toast) */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 13px 16px; border-radius: 14px; font-weight: 600; font-size: 15px; color: #fff; background: #1d2734;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .45); animation: toastin .25s ease-out; transition: opacity .3s, transform .3s; }
.toast-ok { background: linear-gradient(180deg, #33895a, var(--ok)); }
.toast-error { background: linear-gradient(180deg, #c24848, var(--bad)); }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } }

/* Bienvenida: hora, clima y perrito */
.welcome { display: grid; gap: 14px; grid-template-columns: 1.1fr 1.3fr .9fr; margin-top: 18px; }
.w-card { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(228, 224, 216, .8); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.w-date { font-weight: 700; color: var(--muted); font-size: 14px; }
.w-clock { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0 6px; }
.w-phrase { font-size: 14px; color: var(--ink); font-style: italic; }
.w-now { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.w-icon { font-size: 40px; line-height: 1; }
.w-temp { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.w-weather .meta { color: var(--muted); font-size: 13px; }
.w-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.w-day { display: grid; justify-items: center; gap: 2px; background: rgba(255, 255, 255, .7); border-radius: 12px; padding: 6px; font-size: 12px; color: var(--muted); }
.w-day b { font-size: 20px; }
.w-pet { display: grid; gap: 10px; justify-items: center; align-content: start; }
.w-pet img { width: 100%; height: 130px; object-fit: cover; border-radius: 12px; background: var(--bg); }
@media (max-width: 860px) { .welcome { grid-template-columns: 1fr 1fr; } .w-pet { grid-column: 1 / -1; } .w-pet img { height: 200px; } }
@media (max-width: 520px) { .welcome { grid-template-columns: 1fr; } }

/* Celulares: más aire y botones cómodos de tocar */
@media (max-width: 640px) {
  .wrap { padding: 16px 12px 80px; }
  .hero { padding: 22px; border-radius: 18px; }
  .btn { min-height: 44px; }
  .section { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 520px) { .section-head { flex-wrap: wrap; } .section-head span { flex-basis: 100%; } }

/* Sugerencia "Entrar con huella" (account.js) */
.pk-offer { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--card, #fff); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(15, 30, 60, .18); }
.pk-offer b { display: block; }
.pk-offer span { color: var(--muted); font-size: 14px; }
.pk-offer .card-actions { margin: 0; }
#pk-list { display: grid; gap: 8px; margin: 4px 0 8px; }

/* Buscador general del panel */
.gsearch { position: relative; margin: 4px 0 18px; }
.gsearch input { width: 100%; font-size: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line, #d9dee7);
  background: var(--card, #fff); box-shadow: 0 2px 10px rgba(15, 30, 60, .06); }
.gsearch input:focus { outline: 2px solid var(--brand, #1f3a5f); outline-offset: 1px; }
.gs-res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; max-height: 70vh; overflow: auto;
  background: var(--card, #fff); border-radius: 14px; padding: 8px; box-shadow: 0 14px 40px rgba(15, 30, 60, .2); }
.gs-group h4 { margin: 10px 8px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gs-group h4 span { font-weight: 600; }
.gs-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.gs-item:hover, .gs-item:focus { background: var(--bg, #f3f5f8); }
.gs-item b { display: block; }
.gs-item span { color: var(--muted); font-size: 14px; }
.gs-more { padding: 4px 10px; }

/* Filtros de cobros */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; padding: 14px; margin-bottom: 10px; }
.filters .field { margin: 0; }
.filters .filter-q { grid-column: 1 / -1; }
.filter-sum { margin: 0 2px 10px; color: var(--muted); }

/* Fichas de lugar y de persona */
.prop-contacts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 4px; font-size: 14px; }
.form-sub { font-size: 15px; margin: 18px 0 8px; }
#fl-contacts { display: grid; gap: 8px; }
.contact-add { margin-top: 10px; padding: 12px; }
