:root {
    --pacha-red: #c0392b;
    --pacha-red-dark: #922b21;
    --bg: #f2f0ee;
    --card-bg: #ffffff;
    --text: #222222;
    --muted: #767676;
    --border: #e7e3e0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- Header ---------- */
.pacha-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg);
    border-bottom: none;
}

.section-tabs {
    position: sticky;
    top: 72px; /* alto exacto del header: 12px + 12px de padding + 48px del logo */
    z-index: 19;
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar { display: none; }

.section-tab {
    flex: 1;
    min-width: max-content;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.section-tab.active {
    color: var(--pacha-red);
    border-bottom-color: var(--pacha-red);
}
.section-tab:hover:not(.active) { background: var(--bg); }

.zone-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}
.zone-notice-btn {
    background: none;
    border: 1px solid var(--pacha-red);
    color: var(--pacha-red);
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.pacha-logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    display: flex;
}

.header-spacer { width: 26px; }

/* ---------- Panel lateral ---------- */
.side-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 30;
}
.side-overlay.open { display: block; }

.side-panel {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 31;
    transition: left 0.25s ease;
    padding: 20px 16px;
    overflow-y: auto;
}
.side-panel.open { left: 0; }

.side-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.side-profile-info { display: flex; flex-direction: column; }

.side-menu { display: flex; flex-direction: column; }
.side-menu-general { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.side-menu a {
    padding: 12px 6px;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    font-size: 0.95rem;
}
.side-menu a:hover { background: var(--bg); }

/* ---------- Avatares ---------- */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 52px; height: 52px; }

.post-author-avatar { cursor: pointer; }

/* ---------- Feed ---------- */
.feed-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 10px 60px;
}

.new-post-box, .post-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px;
    margin-bottom: 14px;
}

.new-post-box textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 1rem;
    min-height: 60px;
    font-family: inherit;
    outline: none;
}

.new-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.attach-btn { cursor: pointer; color: var(--muted); font-size: 0.9rem; }

.btn-primary {
    background: var(--pacha-red);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-primary:hover:not(:disabled) { background: var(--pacha-red-dark); }

.image-preview-wrap { position: relative; margin-top: 10px; }
.image-preview-wrap img, .image-preview-wrap video { width: 100%; border-radius: 8px; max-height: 320px; object-fit: cover; }
.video-error { color: var(--pacha-red); font-size: 0.85rem; margin: 6px 0 0; }
.post-video { width: 100%; border-radius: 8px; margin-bottom: 8px; display: block; background: #000; }

/* ---------- Estilo de texto grande con fondo (posts de solo texto) ---------- */
.text-style-picker { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.text-style-swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer; padding: 0;
}
.text-style-swatch.active { border-color: var(--text); }
.text-style-none {
    background: #fff !important; border: 1px solid var(--border) !important;
    color: var(--muted); font-size: 0.7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.ts-sunset { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.ts-ocean { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.ts-forest { background: linear-gradient(135deg, #56ab2f, #a8e063); }
.ts-berry { background: linear-gradient(135deg, #8e2de2, #4a00e0); }
.ts-night { background: linear-gradient(135deg, #232526, #414345); }
.ts-pacha { background: linear-gradient(135deg, #c0392b, #7b1f16); }

#postText.ts-sunset, #postText.ts-ocean, #postText.ts-forest,
#postText.ts-berry, #postText.ts-night, #postText.ts-pacha {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    border: none;
}
#postText.ts-sunset::placeholder, #postText.ts-ocean::placeholder, #postText.ts-forest::placeholder,
#postText.ts-berry::placeholder, #postText.ts-night::placeholder, #postText.ts-pacha::placeholder {
    color: rgba(255,255,255,0.75);
}

.post-text-big {
    border-radius: 10px;
    padding: 44px 20px;
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}
.remove-image-btn {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    border-radius: 50%; width: 26px; height: 26px; cursor: pointer;
}

/* Botón "rotar 90°" sobre la vista previa de fotos/video */
.rotate-media-btn {
    position: absolute; bottom: 6px; right: 6px; z-index: 2;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    border-radius: 50%; width: 28px; height: 28px; cursor: pointer;
    font-size: 1rem; line-height: 1;
}
.rotate-media-btn:disabled { opacity: 0.5; cursor: default; }
.image-preview-grid .preview-item .rotate-media-btn { bottom: 4px; right: 4px; }
/* Video girado 90°/270°: el contenedor tiene la altura del lado largo */
#videoPreviewWrap.video-rotated-side { height: 320px; overflow: hidden; background: #000; border-radius: 8px; }
#videoPreviewWrap.video-rotated-side video {
    position: absolute; left: 50%; top: 50%; margin: 0 !important;
    max-height: none; object-fit: contain; border-radius: 0;
    transform-origin: center;
}

/* ---------- Post card ---------- */
.post-header { display: flex; align-items: center; gap: 10px; }
.post-author-info { display: flex; flex-direction: column; flex: 1; }
.post-author-name { font-weight: 600; font-size: 0.95rem; }
.post-meta { font-size: 0.78rem; color: var(--muted); }

.post-menu-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    flex-shrink: 0;
}
.post-menu-btn:hover { color: var(--text); }

.btn-follow {
    border: 1px solid var(--pacha-red);
    color: var(--pacha-red);
    background: none;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}
.btn-follow.following { background: var(--pacha-red); color: #fff; }

.post-text { margin: 10px 0; white-space: pre-wrap; line-height: 1.4; }
.post-text-toggle {
    background: none;
    border: none;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    font-size: inherit;
}
.post-text-toggle:hover { text-decoration: underline; color: var(--text); }
.post-image { width: 100%; border-radius: 8px; margin-bottom: 8px; display: block; }

/* ---------- Grilla de imágenes (estilo Facebook) ---------- */
.post-images-grid {
    display: grid;
    gap: 3px;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-height: 420px;
}
.post-images-grid img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }

.post-images-grid[data-count="1"] { grid-template-columns: 1fr; max-height: none; }
.post-images-grid[data-count="1"] img { max-height: 500px; }

.post-images-grid[data-count="2"] { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }

.post-images-grid[data-count="3"] { grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 10; }
.post-images-grid[data-count="3"] .grid-img-0 { grid-row: 1 / 3; }

.post-images-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }

.post-images-grid[data-count="5"] { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 10; }
.post-images-grid[data-count="5"] .grid-img-0 { grid-column: span 3; }
.post-images-grid[data-count="5"] .grid-img-1 { grid-column: span 3; }
.post-images-grid[data-count="5"] .grid-img-2,
.post-images-grid[data-count="5"] .grid-img-3,
.post-images-grid[data-count="5"] .grid-img-4 { grid-column: span 2; }

/* ---------- Preview de imágenes en el compositor ---------- */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.image-preview-grid .preview-item { position: relative; aspect-ratio: 1/1; }
.image-preview-grid .preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.image-preview-grid .preview-item .remove-image-btn { position: absolute; top: 4px; right: 4px; }

/* ---------- Lightbox (pantalla completa) ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    width: 36px; height: 36px; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.post-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 6px;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
}
.post-action-btn:hover { background: var(--bg); }
.post-action-btn.active { color: var(--pacha-red); font-weight: 600; }

.reaction-area { position: relative; display: flex; align-items: center; gap: 8px; }

.reaction-picker {
    display: none;
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 6px 8px;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-100%);
    margin-top: -8px;
    z-index: 5;
}
.reaction-picker.open { display: flex; }
.reaction-picker button {
    background: none; border: none; font-size: 1.4rem; cursor: pointer;
    transition: transform 0.1s ease;
}
.reaction-picker button:hover { transform: scale(1.25); }

.reaction-summary {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.reaction-summary:hover { background: var(--bg); text-decoration: underline; }

.comments-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; display: none; }
.comments-section.open { display: block; }
.comment-item { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.comment-bubble { background: var(--bg); border-radius: 12px; padding: 6px 10px; font-size: 0.88rem; flex: 1; min-width: 0; }
.comment-author { font-weight: 600; font-size: 0.74rem; color: var(--muted); margin-bottom: 2px; }
.comment-text { line-height: 1.35; word-wrap: break-word; }
.comment-edited { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.comment-own-actions { display: flex; gap: 4px; flex-shrink: 0; padding-top: 4px; }
.comment-own-actions button { background: none; border: none; cursor: pointer; font-size: 0.75rem; opacity: 0.7; padding: 0; }
.comment-own-actions button:hover { opacity: 1; }

.comment-form { display: flex; gap: 8px; margin-top: 6px; }
.comment-form input {
    flex: 1; border: 1px solid var(--border); border-radius: 16px;
    padding: 6px 12px; font-size: 0.88rem;
}
.comment-form button { background: none; border: none; color: var(--pacha-red); font-weight: 600; cursor: pointer; }

.feed-loader, .feed-end { text-align: center; color: var(--muted); padding: 16px; font-size: 0.85rem; }

/* ---------- Badge de mensajes no leídos ---------- */
.badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--pacha-red);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ---------- Popover "Enviar Mensaje" sobre el nombre de usuario ---------- */
.username-popover {
    position: absolute;
    z-index: 40;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    overflow: hidden;
}
.username-popover button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--pacha-red);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.username-popover button:hover { background: var(--bg); }
.post-author-name { cursor: pointer; }

/* ---------- Modales genéricos (lista de conversaciones / chat) ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 50;
}
.modal-overlay.open { display: block; }

.conv-panel, .chat-panel {
    display: none;
    position: fixed;
    z-index: 51;
    background: var(--card-bg);
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 420px;
    flex-direction: column;
}
.conv-panel.open, .chat-panel.open { display: flex; }

.conv-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.conv-chat-header strong { flex: 1; }
.chat-name { flex: 1; font-size: 0.95rem; }

/* ---------- Lista de conversaciones ---------- */
.conv-list { overflow-y: auto; flex: 1; }
.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.conv-item:hover { background: var(--bg); }
.conv-item-info { flex: 1; min-width: 0; }
.conv-item-name { font-weight: 600; font-size: 0.92rem; }
.conv-item-preview {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-item-preview.unread { color: var(--text); font-weight: 600; }
.conv-item-badge {
    background: var(--pacha-red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- Chat 1 a 1 ---------- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg);
}
.msg-row { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }

.msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.35;
}
.msg-bubble.theirs { background: #fff; border: 1px solid var(--border); }
.msg-bubble.mine { background: var(--pacha-red); color: #fff; }
.msg-bubble img { max-width: 100%; border-radius: 8px; display: block; }
.msg-bubble audio { max-width: 220px; }
.msg-time { display: block; font-size: 0.68rem; opacity: 0.7; margin-top: 3px; }

.msg-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--muted);
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}
.msg-menu-btn:hover { color: var(--text); }
.msg-menu-popover { z-index: 62; }
.msg-menu-popover button { text-align: left; }


/* ---------- Notificaciones toast ---------- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 16px;
    left: 16px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--text);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    max-width: 320px;
    pointer-events: auto;
    cursor: pointer;
    animation: toast-in 0.2s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.chat-input-row input[type="text"] {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 0.9rem;
}
.attach-btn-sm {
    cursor: pointer;
    font-size: 1.2rem;
    background: none;
    border: none;
    padding: 4px;
}

.audio-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}
.audio-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.audio-bar button { border: none; background: var(--bg); border-radius: 14px; padding: 4px 10px; cursor: pointer; }

/* ---------- Modal de subida (bloqueante) ---------- */
.upload-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 61;
    background: var(--card-bg);
    border-radius: 14px;
    padding: 26px 28px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.upload-modal.open { display: block; }

#uploadOverlay { z-index: 60; }

#uploadStatusText { font-weight: 600; margin: 0 0 4px; }

.upload-progress-track {
    width: 100%;
    height: 10px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    margin: 14px 0 6px;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--pacha-red);
    border-radius: 6px;
    transition: width 0.15s ease;
}
.upload-progress-bar.indeterminate {
    width: 40% !important;
    animation: upload-indeterminate 1.1s infinite ease-in-out;
}
@keyframes upload-indeterminate {
    0% { margin-left: 0%; }
    50% { margin-left: 58%; }
    100% { margin-left: 0%; }
}

.upload-percent { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 16px; }
.upload-cancel-btn { width: 100%; padding: 8px; }

/* ---------- Estado sin sesión ---------- */
.side-login-btn { width: 100%; margin-top: 10px; }

/* ---------- Aviso de ubicación no detectada (reintentar) ---------- */
.zone-notice-retry {
    justify-content: center;
    cursor: pointer;
    color: var(--pacha-red);
    font-weight: 600;
}
.zone-notice-retry:hover { background: #efe6e4; }

/* ---------- Modal: Buscar Ciudad ---------- */
.city-picker-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 61;
    background: var(--card-bg);
    border-radius: 14px;
    width: 92%;
    max-width: 420px;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.city-picker-modal.open { display: block; }
.city-picker-hint {
    margin: 10px 16px;
    font-size: 0.82rem;
    color: var(--muted);
}
.city-picker-map {
    width: 100%;
    height: 320px;
    background: var(--bg);
}
.city-picker-enter-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 14px 16px;
}

/* ---------- Buscador dentro de la sección ---------- */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.search-bar input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 0.9rem;
    outline: none;
}
.search-bar input:focus { border-color: var(--pacha-red); }
.search-clear-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    flex-shrink: 0;
}

/* ---------- Filtro de publicaciones reportadas (moderadores) ---------- */
.reported-filter-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 10px 16px;
    background: none;
    border: 1px solid var(--pacha-red);
    color: var(--pacha-red);
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.reported-filter-btn.active {
    background: var(--pacha-red);
    color: #fff;
}

/* ---------- Modal: Administrador ---------- */
.admin-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 61;
    background: var(--card-bg);
    border-radius: 14px;
    width: 92%;
    max-width: 420px;
    max-height: 82vh;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.admin-modal.open { display: flex; }
.admin-modal-body {
    padding: 14px 16px;
    overflow-y: auto;
}
#adminCitySelect {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.admin-user-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.admin-users-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.admin-user-info { display: flex; flex-direction: column; }
.admin-user-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-hab-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.admin-hab-btn.active {
    background: var(--pacha-red);
    border-color: var(--pacha-red);
    color: #fff;
}
.admin-verify-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.admin-verify-btn.active {
    background: #2e8b57;
    border-color: #2e8b57;
    color: #fff;
}
.admin-verify-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Insignia "Vecino Verificado" ---------- */
.verified-badge {
    color: #2e8b57;
    font-size: 0.85rem;
    margin-left: 3px;
}

/* ---------- Reputación (Servicios y Empleo) ---------- */
.author-rating { color: var(--muted); }
.rate-post-btn { color: var(--pacha-red); }

/* ---------- Vencimiento de publicaciones ---------- */
.post-expiry { color: var(--muted); }
.post-duration-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}
.post-duration-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ---------- Ubicación en publicaciones ---------- */
.post-location-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    margin-top: 8px;
    width: fit-content;
}
.post-location-chip button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
}
.post-location-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}
.post-location-btn:hover { color: var(--pacha-red); }

/* ---------- Modal: calificar publicación ---------- */
.rate-modal-body { padding: 8px 16px; display: flex; flex-direction: column; gap: 12px; }
.star-picker { display: flex; gap: 6px; justify-content: center; }
.star-picker button {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}
.star-picker button.filled { color: #f5a623; }
#rateComment {
    width: 100%;
    min-height: 70px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}
.admin-hab-btn:disabled { opacity: 0.6; cursor: default; }
