/* ═══════════════════════════════════════════════════════════
   Donaciones Venezuela — Rediseño 2025
   Tipografía: Plus Jakarta Sans · JetBrains Mono
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --gold:    #F5B800;
  --gold-d:  #D4A000;
  --gold-l:  #FFF8E1;
  --blue:    #0039A6;
  --blue-d:  #002680;
  --blue-l:  #EBF0FF;
  --red:     #CC122A;
  --red-l:   #FFF0F2;
  --bg:      #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --text:    #18223A;
  --muted:   #617090;
  --border:  #DFE8F5;
  --border-d:#C8D6EC;
  --r-sm:    10px;
  --r:       16px;
  --r-lg:    22px;
  --r-xl:    30px;
  --sh-xs:   0 1px 4px rgba(0,40,120,0.06);
  --sh-sm:   0 2px 12px rgba(0,40,120,0.08);
  --sh:      0 4px 22px rgba(0,40,120,0.10);
  --sh-md:   0 8px 36px rgba(0,40,120,0.13);
  --dur:     180ms;
  --ease:    cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; font-weight: 700; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* ── Franja bandera ─────────────────────────────────────── */
.flag-strip {
  height: 5px;
  background: linear-gradient(90deg,
    var(--gold) 0 33.33%, var(--blue) 33.33% 66.66%, var(--red) 66.66% 100%);
}

/* ── Nav ────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 980px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.97rem; color: var(--text); white-space: nowrap;
}
.topnav-brand .flag-em { font-size: 1.4rem; line-height: 1; }
.topnav-actions { display: flex; align-items: center; gap: 6px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  background: linear-gradient(150deg, #002A80 0%, #001866 100%);
  color: #fff; padding: 52px 20px 80px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 130%, rgba(245,184,0,.18), transparent);
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px; padding: 5px 14px; font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,.85); letter-spacing: .03em; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem); font-weight: 800;
  color: #fff; margin-bottom: 10px; position: relative;
}
.hero .subtitle {
  font-size: 1.05rem; color: rgba(255,255,255,.65);
  max-width: 420px; margin: 0 auto; position: relative;
}

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ── Stats band ─────────────────────────────────────────── */
.stats-band {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: -48px; position: relative; z-index: 10;
}
.stat-card {
  background: var(--surface); border-radius: var(--r);
  padding: 20px 18px 16px; box-shadow: var(--sh-md);
  border-top: 4px solid var(--gold);
  transition: transform var(--dur) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.7rem; font-weight: 700;
  color: var(--blue); line-height: 1.1; margin-bottom: 5px;
}
.stat-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

/* ── Sección ─────────────────────────────────────────────── */
.section { margin: 36px 0; }
.section-hd {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.section-hd h2 { font-size: 1.05rem; font-weight: 700; }
.section-hd::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Método de pago ─────────────────────────────────────── */
.methods-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 14px;
}
.method-card {
  background: var(--surface); border-radius: var(--r);
  border: 1px solid var(--border); padding: 20px 22px;
  display: flex; align-items: flex-start; gap: 16px; box-shadow: var(--sh-xs);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.method-card:hover { box-shadow: var(--sh-sm); transform: translateY(-2px); }
.method-icon-wrap {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--bg); display: grid; place-items: center; flex: none;
}
.method-body { flex: 1; min-width: 0; }
.method-name { font-weight: 700; font-size: 0.97rem; margin-bottom: 10px; }
.method-row { margin-bottom: 8px; }
.method-row-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 3px;
}
.method-code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 600;
  background: var(--bg); padding: 4px 9px; border-radius: 7px;
  color: var(--text); display: inline-block; word-break: break-all;
}
.method-val-row {
  display: flex; align-items: center; gap: 6px;
}
.ic-copy {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid var(--border); background: var(--bg);
  color: var(--muted); display: grid; place-items: center;
  transition: all var(--dur) var(--ease); cursor: pointer;
}
.ic-copy::after { content: '⎘'; font-size: 0.85rem; }
.ic-copy:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-l); }
.ic-copy.copied::after { content: '✓'; color: #16a34a; }
.ic-copy.copied { border-color: #22c55e; background: #f0fdf4; }

/* ── Lista donaciones ───────────────────────────────────── */
.donations-card {
  background: var(--surface); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--sh-xs);
  max-height: 420px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border-d) transparent;
}
.donations-card::-webkit-scrollbar { width: 5px; }
.donations-card::-webkit-scrollbar-thumb { background: var(--border-d); border-radius: 99px; }
.donation-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  transition: background var(--dur) var(--ease);
}
.donation-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.donation-row:hover { background: var(--surface-2); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #fff; font-weight: 700; font-size: 1rem;
  display: grid; place-items: center;
}
.donation-info { flex: 1; min-width: 0; }
.donation-name {
  font-weight: 700; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.donation-sub {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.donation-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 0.88rem; color: var(--text);
}
.donation-time {
  font-size: 0.78rem; color: var(--muted);
}
.donation-location {
  font-size: 0.78rem; color: var(--muted);
}

/* ── Estado vacío ───────────────────────────────────────── */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon { font-size: 2.2rem; margin-bottom: 8px; line-height: 1; }
.empty p { font-size: 0.88rem; }

/* ── Card genérica ──────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--sh-xs);
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: 12px;
  font-weight: 600; font-size: 0.9rem; border: none;
  transition: all var(--dur) var(--ease); white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 2px 8px rgba(0,57,166,.22);
}
.btn-primary:hover { background: var(--blue-d); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,57,166,.3); }
.btn-primary:active { transform: scale(.98); }
.btn-outline {
  background: transparent; color: var(--blue);
  border: 1.5px solid rgba(0,57,166,.2);
}
.btn-outline:hover { background: var(--blue-l); border-color: var(--blue); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border); padding: 8px 14px; font-size: 0.84rem;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-l); }
.btn-danger {
  background: var(--red-l); color: var(--red);
  border: 1px solid rgba(204,18,42,.2); padding: 7px 13px; font-size: 0.8rem;
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.83rem; border-radius: 9px; }

/* ── Formularios ─────────────────────────────────────────── */
.form-stack { display: grid; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
input, select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--border); border-radius: 11px;
  font: inherit; font-size: 0.92rem;
  background: var(--surface); color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,57,166,.12);
}
input::placeholder { color: var(--border-d); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* ── Mensajes ────────────────────────────────────────────── */
.msg {
  padding: 11px 14px; border-radius: 10px; font-size: 0.88rem; font-weight: 500;
  display: none; align-items: center; gap: 7px;
}
.msg:not(:empty) { display: flex; }
.msg.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.msg.err { background: var(--red-l); color: var(--red); border: 1px solid rgba(204,18,42,.2); }

/* ── Login screen ───────────────────────────────────────── */
#login-screen {
  min-height: 100vh; display: none;
  align-items: center; justify-content: center;
  padding: 24px; background: var(--bg); flex-direction: column;
}
#login-screen.visible { display: flex; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border-radius: var(--r-xl);
  padding: 36px 32px; box-shadow: var(--sh-md); border: 1px solid var(--border);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .flag-big { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.login-brand h1 { font-size: 1.2rem; }
.login-brand p { font-size: 0.84rem; color: var(--muted); margin-top: 4px; }

/* ── Admin shell ─────────────────────────────────────────── */
#admin-screen { display: none; min-height: 100vh; }
#admin-screen.visible { display: block; }

.admin-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.admin-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 0.94rem; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user-label { font-size: 0.83rem; color: var(--muted); }

/* Tabs móvil */
.m-tabs { display: none; border-bottom: 1px solid var(--border); background: var(--surface); }
.m-tab {
  flex: 1; padding: 12px 4px; font-size: 0.78rem; font-weight: 700;
  color: var(--muted); border-bottom: 2px solid transparent;
  transition: all var(--dur) var(--ease); text-align: center;
}
.m-tab.active { color: var(--blue); border-color: var(--blue); }

/* Layout admin */
.admin-body { display: grid; grid-template-columns: 210px 1fr; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 10px; display: flex; flex-direction: column;
  position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.s-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; border-radius: 10px;
  font-weight: 600; font-size: 0.88rem; color: var(--muted);
  border: none; background: none; width: 100%; text-align: left;
  transition: all var(--dur) var(--ease);
}
.s-item:hover { background: var(--bg); color: var(--text); }
.s-item.active { background: var(--blue-l); color: var(--blue); }
.s-divider { height: 1px; background: var(--border); margin: 10px 0; }
.s-back {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 10px; font-size: 0.82rem; color: var(--muted);
  transition: all var(--dur) var(--ease); text-decoration: none;
}
.s-back:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.admin-main { padding: 26px 22px; }
.panel { display: none; }
.panel.active { display: block; }
.panel-hd { margin-bottom: 20px; }
.panel-hd h2 { font-size: 1.2rem; }
.panel-hd p { font-size: 0.84rem; color: var(--muted); margin-top: 3px; }

/* Filas de admin */
.a-row { display: flex; align-items: center; gap: 11px; padding: 13px 16px; }
.a-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.a-row .who { flex: 1; min-width: 0; }
.a-row .who strong { font-size: 0.91rem; display: block; }
.a-row .who span { font-size: 0.77rem; color: var(--muted); }
.a-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 0.94rem; color: var(--blue); white-space: nowrap; margin-right: 6px;
}
.u-chip {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-l); color: var(--blue);
  font-weight: 700; font-size: 0.82rem;
  display: grid; place-items: center; flex: none;
}
.u-name { flex: 1; font-weight: 600; font-size: 0.91rem; }

/* ── Botón flotante ─────────────────────────────────────── */
.fab {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 300; white-space: nowrap;
  background: var(--blue); color: #fff;
  border-radius: 99px; padding: 14px 28px;
  font-size: 0.95rem; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,57,166,.35);
  display: flex; align-items: center; gap: 10px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  border: none; cursor: pointer;
}
.fab:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 10px 32px rgba(0,57,166,.4); }
.fab:active { transform: translateX(-50%) scale(.97); }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10,18,40,.55); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-backdrop.open { display: flex; }
@media (min-width: 600px) {
  .modal-backdrop { align-items: center; padding: 20px; }
}
.modal {
  background: var(--surface); width: 100%; max-width: 520px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 92dvh; overflow-y: auto; padding: 28px 24px 32px;
  box-shadow: var(--sh-md);
  scrollbar-width: thin; scrollbar-color: var(--border-d) transparent;
}
@media (min-width: 600px) {
  .modal { border-radius: var(--r-xl); }
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-hd h2 { font-size: 1.1rem; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); color: var(--muted); font-size: 1rem;
  display: grid; place-items: center; flex: none;
  transition: background var(--dur) var(--ease);
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-d); border-radius: var(--r);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--blue); background: var(--blue-l); }
.upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; border: none; padding: 0;
}
.upload-icon { font-size: 2rem; margin-bottom: 6px; }
.upload-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.upload-preview {
  margin-top: 10px; display: none;
}
.upload-preview img {
  max-height: 160px; border-radius: var(--r-sm); margin: 0 auto;
  border: 1px solid var(--border);
}
.upload-preview.show { display: block; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 28px 20px; font-size: 0.8rem; color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .stats-band { grid-template-columns: 1fr 1fr; }
  .stats-band .stat-card:nth-child(3) { grid-column: span 2; }
  .hero { padding: 38px 18px 68px; }
  .admin-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .m-tabs { display: flex; }
  .admin-main { padding: 18px 14px; }
  .admin-topbar { padding: 0 14px; }
  .login-card { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .stats-band { grid-template-columns: 1fr; }
  .stats-band .stat-card:nth-child(3) { grid-column: auto; }
  .row-2 { grid-template-columns: 1fr; }
  .topnav-inner { padding: 0 14px; }
  .hero h1 { font-size: 1.7rem; }
  .donation-row { padding: 12px 14px; gap: 10px; }
  .method-card { flex-direction: column; }
}
