:root {
    --bg: #0b0b0f;
    --panel: #15151b;
    --panel-2: #1d1d25;
    --red: #e50914;
    --fire: #ff6b00;
    --text: #ffffff;
    --muted: #a8a8b3;
    --line: rgba(255,255,255,.1);
    --radius: 8px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 30% 0%, rgba(229,9,20,.22), transparent 32rem), var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(11,11,15,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; font-size: 14px; }
.brand img, .avatar-link img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,.18); }
.avatar-link img { width: 36px; height: 36px; }
.app-shell { width: min(760px, 100%); margin: 0 auto; padding: 18px 14px 92px; }
h1 { margin: 8px 0 14px; font-size: clamp(28px, 8vw, 42px); line-height: 1; }
h2 { margin: 0 0 8px; font-size: 20px; }
p { color: var(--muted); line-height: 1.55; }
.muted, .label, small { color: var(--muted); }
.label { display: inline-block; font-size: 12px; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; margin-bottom: 8px; }
.card, .auth-card { background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.24); }
.auth-card { margin: 24px auto; max-width: 440px; }
.hero-panel { min-height: 230px; display: flex; flex-direction: column; justify-content: end; padding: 22px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(11,11,15,.16), rgba(11,11,15,.94)), url("../img/logo.png") center 22px/120px no-repeat, linear-gradient(135deg, rgba(229,9,20,.7), rgba(255,107,0,.22)); border: 1px solid rgba(255,255,255,.12); }
.hero-panel .kicker { color: var(--fire); font-weight: 900; text-transform: uppercase; margin: 0 0 8px; }
.grid-dashboard, .stat-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 14px 0; }
.grid-dashboard .full { grid-column: 1 / -1; }
.flame { border-color: rgba(255,107,0,.35); }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-actions a, .btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.14); background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer; }
.quick-actions a { min-height: 72px; background: linear-gradient(135deg, rgba(229,9,20,.25), rgba(255,107,0,.08)); }
.btn-primary { border: 0; background: linear-gradient(135deg, var(--red), var(--fire)); }
.btn-danger, .mini-danger { border: 0; background: #8f1018; color: white; }
.btn-ghost { background: transparent; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
input, textarea, select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius); background: #101016; color: var(--text); padding: 11px 12px; font: inherit; }
textarea { min-height: 120px; resize: vertical; }
.center { text-align: center; }
.alert { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); }
.alert-success { background: rgba(37,176,111,.15); color: #bbffd9; }
.alert-error { background: rgba(229,9,20,.18); color: #ffd1d4; }
.list, .people { display: grid; gap: 12px; }
.media-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.media-card > img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); }
.detail-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 14px; }
.profile-head, .person, .message, .admin-row { display: flex; gap: 12px; align-items: center; }
.profile-head img, .person img, .message img, .admin-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.person, .message { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.person span, .message div { display: grid; }
.album-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.album-card { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-grid figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-grid figcaption { padding: 8px; font-size: 12px; color: var(--muted); }
.photo-grid.small { grid-template-columns: repeat(3, 1fr); }
.member-card { margin: 20px auto; max-width: 430px; padding: 22px; border-radius: 18px; background: linear-gradient(145deg, #202026, #09090c 55%, rgba(229,9,20,.48)); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.member-card-top { display: flex; align-items: center; justify-content: space-between; color: #fff; text-transform: uppercase; font-weight: 900; }
.member-card-top img { width: 70px; height: 70px; border-radius: 50%; }
.member-number { font-size: 34px; color: var(--fire); font-weight: 900; margin: 0 0 16px; }
.member-card dl { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.member-card dt { color: var(--muted); }
.member-card dd { margin: 0; font-weight: 800; }
.qr { width: 150px; height: 150px; border: 8px solid white; border-radius: var(--radius); margin-top: 16px; background: white; }
.chat-box { display: grid; gap: 10px; margin-bottom: 86px; }
.chat-form { position: fixed; left: 50%; bottom: 68px; transform: translateX(-50%); width: min(760px, calc(100% - 20px)); display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px; background: rgba(11,11,15,.92); border: 1px solid var(--line); border-radius: var(--radius); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(6, 1fr); background: rgba(13,13,18,.96); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)); backdrop-filter: blur(14px); }
.bottom-nav a { display: grid; place-items: center; gap: 2px; min-height: 52px; color: var(--muted); font-size: 11px; font-weight: 800; }
.bottom-nav a span { position: relative; font-size: 12px; letter-spacing: 0; }
.bottom-nav a b { position: absolute; right: -12px; top: -10px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: var(--red); color: white; font-size: 10px; }
.bottom-nav a.active { color: #fff; }
.admin-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; }
.admin-nav a { white-space: nowrap; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 800; }
.stat-grid .card strong { display: block; font-size: 34px; color: var(--fire); }
.admin-row { flex-wrap: wrap; }
.admin-row div { flex: 1 1 180px; }
.admin-row input, .admin-row select { flex: 1 1 110px; }
.admin-item { display: grid; gap: 8px; }
.compact { margin-bottom: 16px; }
.empty { padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.mini-danger { position: absolute; right: 6px; top: 6px; border-radius: 6px; padding: 6px 8px; font-size: 11px; }
@media (min-width: 680px) {
    .album-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-item { grid-template-columns: 1fr auto auto; align-items: center; }
}

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.urgent-banner { margin: 14px 0; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(229,9,20,.42), rgba(255,107,0,.18)); border: 1px solid rgba(255,107,0,.45); }
.urgent-banner span, .tag, .status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.level-facil, .status-activo { background: rgba(37,176,111,.24); color: #c9ffdd; }
.level-media, .status-pendiente { background: rgba(255,178,0,.22); color: #ffe1a3; }
.level-dificil, .status-baja { background: rgba(229,9,20,.26); color: #ffd1d4; }
.route-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.route-meta div { padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.route-meta span { display: block; color: var(--muted); font-size: 12px; }
.route-meta strong { display: block; margin-top: 4px; }
.notification.is-new { border-color: rgba(255,107,0,.55); }
.notification.is-read { opacity: .72; }
.quota-card { margin: 12px 0; }
.gallery-pro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chat-bubbles .bubble { align-items: flex-end; }
.bubble > div { position: relative; max-width: 82%; padding: 12px; border-radius: 16px 16px 16px 4px; background: #1b1b23; border: 1px solid var(--line); }
.bubble.own { flex-direction: row-reverse; }
.bubble.own > div { border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, rgba(229,9,20,.34), rgba(255,107,0,.16)); }
.member-card-pro { position: relative; overflow: hidden; }
.member-card-pro:before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent, rgba(255,255,255,.08), transparent); pointer-events: none; }
.print-actions { margin-top: 12px; }
.offline-panel img { width: 96px; margin: 0 auto 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.public-hero { min-height: 310px; }
.guest-form { margin-top: 16px; }
.mini-attendees { display: grid; gap: 3px; margin: 10px 0; color: var(--muted); font-size: 13px; }
.mini-attendees strong { color: #fff; }
.route-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.route-actions form { margin: 0; }
.btn-whatsapp { background: #128c4a; border-color: rgba(255,255,255,.14); }
.social-feed { display: grid; gap: 14px; }
.post-card { overflow: hidden; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.post-card > img { width: 100%; max-height: 380px; object-fit: cover; }
.post-body { padding: 14px; }
.post-body p { white-space: pre-wrap; }
.social-links.social-buttons { display: grid !important; grid-template-columns: 1fr; gap: 10px; margin: 14px 0 20px; }
.social-links .social-btn { display: grid !important; grid-template-columns: 52px 1fr; column-gap: 12px; align-items: center; min-height: 78px; padding: 12px; border-radius: 8px; background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.13); box-shadow: 0 16px 38px rgba(0,0,0,.24); text-align: left; }
.social-links .social-btn span { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; }
.social-links .social-btn strong { display: block; align-self: end; font-size: 16px; line-height: 1.1; color: #fff; }
.social-links .social-btn small { display: block; align-self: start; color: var(--muted); font-weight: 700; }
.social-links .social-btn.maps span { background: linear-gradient(135deg, #1a73e8, #34a853); }
.social-links .social-btn.facebook span { background: #1877f2; font-size: 24px; font-family: Arial, sans-serif; }
.social-links .social-btn.instagram span { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #515bd4); }
@media (min-width: 680px) {
    .social-links.social-buttons { grid-template-columns: repeat(3, 1fr); }
    .social-links .social-btn { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    .social-links .social-btn span { grid-row: auto; }
}
.admin-layout { display: grid; gap: 14px; }
.admin-side { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.admin-side a { white-space: nowrap; padding: 10px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 900; }
.admin-side a.active { color: #fff; border-color: rgba(255,107,0,.42); }
.admin-main { min-width: 0; }
.filters, .form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.stat-grid.pro { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.priority-urgente { border-color: rgba(229,9,20,.7); }
.priority-importante { border-color: rgba(255,107,0,.55); }
@media (min-width: 900px) {
    .admin-layout { grid-template-columns: 220px 1fr; align-items: start; }
    .admin-side { position: sticky; top: 76px; display: grid; overflow: visible; }
}
@media print {
    body { background: #fff; }
    .topbar, .bottom-nav, .print-actions, .alert { display: none !important; }
    .app-shell { padding: 0; }
    .member-card { color: #fff; box-shadow: none; }
}
