:root {
    --bg: #17171b;
    --bg-card: #202024;
    --bg-row-hover: #28282d;
    --border: #2a2a2e;
    --text: #e4e4e7;
    --text-dim: #8b8b93;
    --accent: #4da3e8;
    --accent-hover: #6bb8f5;
    --link-user: #c9a876;
    --nav-bg: #101013;
    --green: #3fae5a;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
}

html { height: 100%; }

body {
    position: relative;
    min-height: 100%;
    padding-bottom: 100px;
}

a {
    color: inherit;
    text-decoration: none;
}

ul { list-style: none; margin: 0; padding: 0; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon-chevron {
    width: 14px;
    height: 14px;
}

/* Íconos rellenos (menú de navegación). */
.icon-solid {
    width: 15px;
    height: 15px;
    fill: currentColor;
    stroke: none;
}

/* ---------- Topbar / banner ---------- */

.topbar {
    position: relative;
    min-height: 190px;
    display: flex;
    align-items: flex-start;
    background-color: #1a0f08;
}

.topbar-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(180deg, #2a1a12 0%, #6b3a1f 35%, #d97f3a 60%, #f2b25a 75%, #3a2418 100%);
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.topbar-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.1) 40%, rgba(0,0,0,.55) 100%);
}

.topbar-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 22px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    margin-top: 22px;
    width: 230px;
    height: 110px;
    overflow: hidden;
}

.site-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #0a1d30;
    border: none;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}

.btn-accent:hover { background: var(--accent-hover); }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d63b3b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.15);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: #fff;
    font: inherit;
}

.user-menu-wrap {
    position: relative;
}

.user-avatar, .lastpost-avatar, .avatar-fallback, .cat-icon {
    position: relative;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name { font-weight: 600; font-size: 13px; }

.account-dropdown {
    position: fixed;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    overflow: hidden;
    display: none;
    z-index: 60;
    padding-bottom: 6px;
}

.account-dropdown.open { display: block; }

.create-dropdown { width: 200px; padding: 6px 0; }

/* ---------- Notificaciones ---------- */

.notif-dropdown { width: 360px; max-width: calc(100vw - 24px); padding-bottom: 0; }

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.notif-mark-all:hover { text-decoration: underline; }

.notif-dropdown .notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-row-hover); }

.notif-unread { background: rgba(77,163,232,.08); box-shadow: inset 3px 0 0 var(--accent); }

.notif-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 6px; }

.notif-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-row-hover);
    color: var(--text-dim);
}

.notif-icon .icon { width: 18px; height: 18px; }
.notif-icon-global { background: rgba(77,163,232,.18); color: var(--accent); }
.notif-icon-level { background: rgba(63,174,90,.18); color: var(--green); }
.notif-icon-group { background: rgba(201,168,118,.18); color: var(--link-user); }
.notif-icon-moderation { background: rgba(214,59,59,.18); color: #e06464; }

.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.notif-label { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .3px; }
.notif-time { font-size: 11px; color: var(--text-dim); }

.notif-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--text-dim); }

.notif-see-all {
    display: block;
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--accent);
    border-top: 1px solid var(--border);
}

.notif-see-all:hover { background: var(--bg-row-hover); }

/* ---------- Mensajes privados ---------- */

.pm-list { border-top-left-radius: 0; }

.pm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.pm-row:last-child { border-bottom: none; }
.pm-row:hover { background: var(--bg-row-hover); }
.pm-unread { background: rgba(77,163,232,.08); box-shadow: inset 3px 0 0 var(--accent); }
.pm-unread .pm-row-subject { color: var(--accent); }

.pm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-row-subject { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-row-meta { font-size: 12px; color: var(--text-dim); }
.pm-row-time { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.pm-everyone-tag { color: var(--accent); font-weight: 700; }

a.profile-tab { cursor: pointer; }
a.profile-tab:hover { color: var(--text); }

.modal-box.pm-compose-box { width: 900px; max-width: calc(100vw - 24px); }
.pm-compose-box .pm-to-input { max-width: 320px; }
.pm-compose-actions { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }

.account-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 10px;
    color: inherit;
}

.level-badge {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}

.level-badge-lg { width: 64px; height: 64px; }
.level-badge-sm { width: 28px; height: 28px; vertical-align: middle; }

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-row-hover);
    color: var(--text-dim);
    flex-shrink: 0;
}

.account-rank-label {
    font-size: 11px;
    color: var(--text-dim);
}

.account-rank-name {
    font-size: 14px;
    font-weight: 700;
}

.rank-progress {
    height: 6px;
    background: var(--bg-row-hover);
    border-radius: 4px;
    margin: 0 16px;
    overflow: hidden;
}

.rank-progress-bar {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
}

.account-rank-note {
    font-size: 12px;
    color: var(--text-dim);
    padding: 6px 16px 12px;
}

.account-dropdown-section {
    padding: 10px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--accent);
    border-top: 1px solid var(--border);
}

.account-dropdown-link {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
}

.account-dropdown-link:hover { background: var(--bg-row-hover); }

.account-dropdown-highlight { color: var(--accent); font-weight: 600; }

.account-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* ---------- Invitado: conectar / registrar ---------- */

.guest-login-wrap {
    position: relative;
}

.guest-connect-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.guest-connect-btn strong { font-weight: 700; }

.login-panel {
    position: fixed;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    display: none;
    z-index: 60;
}

.login-panel.open { display: block; }

.login-panel h3 {
    margin: 0 0 14px;
    font-size: 16px;
}

.login-panel form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-panel input[type="text"],
.login-panel input[type="email"],
.login-panel input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    width: 100%;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

.forgot-link:hover { color: var(--text); text-decoration: underline; }

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-dim);
    cursor: pointer;
}

.checkbox-row input { accent-color: var(--accent); margin-top: 2px; }
.checkbox-row small { color: var(--text-dim); }
.checkbox-row a { color: var(--link-user); text-decoration: underline; }

.btn-block { width: 100%; justify-content: center; }

.form-error {
    background: rgba(214,59,59,.15);
    border: 1px solid rgba(214,59,59,.4);
    color: #f28b8b;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
}

.settings-image-row { display: flex; align-items: center; gap: 10px; }
.settings-image-row input { flex: 1; min-width: 0; }
.settings-image-thumb { flex-shrink: 0; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; }
.settings-avatar-thumb { width: 40px; height: 40px; }
.settings-cover-thumb { width: 72px; height: 40px; }

.form-success {
    background: rgba(63,174,90,.15);
    border: 1px solid rgba(63,174,90,.4);
    color: #7bd996;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
}

/* ---------- Ajustes de la cuenta ---------- */

.settings-body { padding: 18px; }

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.settings-form.settings-form-wide { max-width: none; }

.settings-form label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
}

.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"],
.settings-form select,
.settings-form textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    width: 100%;
    font-family: inherit;
    resize: vertical;
}

.admin-delete-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-delete-btn:hover {
    border-color: #e05252;
    color: #e05252;
}

.admin-edit-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-edit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-row-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.admin-move-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    width: 30px;
    height: 30px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
}

.admin-move-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-move-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.admin-current-image {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-current-image img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.admin-color-input {
    width: 60px !important;
    height: 38px;
    padding: 4px !important;
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.admin-tab-btn .icon { width: 15px; height: 15px; }

.admin-tab-btn:hover { color: var(--text); border-color: var(--text-dim); }

.admin-tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a1d30;
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.admin-group-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-group-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.admin-group-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-group-badge-preview {
    height: 22px;
    width: auto;
    border-radius: 4px;
}

.admin-group-name {
    font-weight: 700;
    font-size: 13px;
}

.settings-form h3 { margin: 0; font-size: 15px; }

.settings-hint { margin: 0; font-size: 12px; color: var(--text-dim); }

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.settings-form .btn-block { margin-top: 10px; }

/* ---------- Perfil ---------- */

.profile-page { padding-top: 24px; padding-bottom: 60px; }

.profile-cover {
    position: relative;
    height: 180px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(135deg, #6a5a8c 0%, #cdbfe0 45%, #e9dff2 70%, #8a76b0 100%);
    background-size: cover;
    background-repeat: no-repeat;
}

.profile-cover-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 10px;
}

.btn-cover-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
}

.btn-cover-action:hover { background: rgba(0,0,0,.65); }
.btn-cover-action .icon { width: 14px; height: 14px; }
button.btn-cover-action { font: inherit; cursor: pointer; }

.profile-cover.has-photo { cursor: pointer; }

.cover-reposition-hint {
    position: absolute;
    left: 16px;
    top: 16px;
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 3;
}

.cover-reposition-hint .icon { width: 14px; height: 14px; }

.profile-cover.has-photo:hover .cover-reposition-hint { display: flex; }

.cover-edit-done {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    display: none;
}

.profile-cover.editing {
    cursor: grab;
}

.profile-cover.editing:active { cursor: grabbing; }

.profile-cover.editing .cover-edit-done { display: inline-flex; }

.profile-cover.editing .profile-cover-actions,
.profile-cover.editing .cover-reposition-hint {
    display: none;
}

.profile-header-row {
    display: flex;
    align-items: flex-end;
    padding: 14px 20px 16px 134px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 44px;
}

.profile-avatar-frame {
    position: absolute;
    left: 20px;
    bottom: -50px;
    width: 96px;
    height: 96px;
    z-index: 2;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.profile-avatar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 4px solid var(--bg-card);
    background: var(--accent);
    overflow: hidden;
}

.profile-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }

.avatar-edit-badge {
    position: absolute;
    left: -6px;
    bottom: -6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-row-hover);
    border: 2px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.avatar-edit-badge .icon { width: 13px; height: 13px; }

.avatar-tooltip {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.profile-avatar-frame:hover .avatar-tooltip { opacity: 1; }

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.profile-identity { padding-bottom: 12px; }

.profile-header-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    padding-bottom: 12px;
}

.profile-followers-card { flex-direction: column; align-items: stretch; }

.profile-followers-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.profile-follower-avatar { width: 36px; height: 36px; border-radius: 6px; }

.profile-follower-more {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-row-hover);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
}

.profile-identity h1 {
    margin: 0;
    font-size: 22px;
}

.profile-badge {
    display: inline-block;
    margin-top: 10px;
    background: var(--bg-row-hover);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 3px 8px;
    border-radius: 4px;
}

.profile-stats-row {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 22px;
}

.profile-stat { display: flex; flex-direction: column; gap: 2px; }

.profile-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-dim);
}

.profile-stat-value { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

.dot-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.profile-activity-btn { margin-left: auto; }

.btn-outline-accent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 6px;
}

.btn-outline-accent:hover { background: rgba(240,164,40,.1); }
.btn-outline-accent .icon { width: 16px; height: 16px; }

.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
    align-items: start;
}

.widget-body.profile-side-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
}

.profile-side-title { font-size: 14px; font-weight: 700; }
.profile-side-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.profile-warning-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
}

.profile-warning-ring.warning-low { border-color: #d6b03b; color: #d6b03b; }
.profile-warning-ring.warning-mid { border-color: #e08a3c; color: #e08a3c; }
.profile-warning-ring.warning-high { border-color: #d63b3b; color: #e06464; }

.profile-warnings-card { flex-direction: column; align-items: stretch; }
.profile-warnings-head { display: flex; align-items: center; gap: 12px; }

.warning-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.warning-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12.5px;
}

.warning-list strong { color: #e08a3c; }
.warning-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.warning-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.warning-delete:hover { color: #e06464; }

.profile-badge-banned { margin-left: 6px; background: rgba(214,59,59,.15) !important; color: #e06464 !important; border: 1px solid #d63b3b; }
.profile-badge-muted { margin-left: 6px; background: rgba(224,138,60,.15) !important; color: #e08a3c !important; border: 1px solid #e08a3c; }

/* ---------- Usuarios ignorados ---------- */

.post-card.post-is-ignored { display: none; }

.post-ignored-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dim);
}

.post-ignored-bar .icon { width: 16px; height: 16px; }
.post-ignored-bar strong { color: var(--text); }

.post-ignored-show {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
}

.post-ignored-show:hover { background: var(--bg-row-hover); }

.ignored-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    text-align: center;
}

.ignored-profile h2 { margin: 6px 0 0; font-size: 20px; }
.ignored-profile-icon { width: 44px; height: 44px; color: var(--text-dim); }
.ignored-profile form { margin-top: 10px; }

.btn-outline-accent.btn-ignore { color: var(--text-dim); border-color: var(--border); }
.btn-outline-accent.btn-ignore:hover { color: #e06464; border-color: #d63b3b; }

.ignored-list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ignored-list-row:last-child { border-bottom: none; }
.ignored-list-row .pm-row-main a { color: var(--text); font-weight: 700; }

/* ---------- Panel de moderación de usuario ---------- */

.mod-shield-btn { padding-left: 10px; padding-right: 10px; }
.mod-shield-btn .icon { width: 18px; height: 18px; }

.mod-status {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.mod-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.mod-lift-btn { padding: 4px 10px; font-size: 12px; }

.mod-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: 12px; }

.mod-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
}

.mod-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.mod-tab-danger.active { color: #e06464; border-bottom-color: #d63b3b; }

.mod-panel { display: none; margin-top: 12px; }
.mod-panel.active { display: flex; }

.btn-accent.mod-ban-submit { background: #d63b3b; color: #fff; }

.profile-rank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.profile-level-info { flex: 1; min-width: 0; }
.profile-level-info a { color: var(--accent); }
.profile-level-progress { margin: 8px 0 6px; }

.profile-level-stats {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
    text-align: center;
}

.profile-level-stats strong { display: block; font-size: 17px; }
.profile-level-stats span { font-size: 11px; color: var(--text-dim); }

@media (max-width: 620px) {
    .profile-rank-card { flex-wrap: wrap; }
    .profile-level-stats { width: 100%; justify-content: space-around; }
}

.levels-intro { margin-bottom: 16px; }

.level-row-current { background: var(--bg-row-hover); }
.level-row-locked .level-badge { filter: grayscale(1) opacity(.45); }

.level-req-progress { display: flex; gap: 8px; flex-shrink: 0; }

.level-req {
    min-width: 74px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
}

.level-req strong { display: block; font-size: 13px; color: var(--text); }
.level-req-ok { border-color: var(--green); }
.level-req-ok strong { color: var(--green); }

@media (max-width: 620px) {
    .level-req-progress { width: 100%; padding-left: 80px; }
}

.rank-badge-lg {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.rank-badge-lg .icon { width: 22px; height: 22px; }

.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.profile-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    cursor: default;
}

.profile-tab.active {
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: 2px solid var(--accent);
    border-radius: var(--radius) var(--radius) 0 0;
}

.profile-main .activity-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (max-width: 720px) {
    .profile-layout { grid-template-columns: 1fr; }
    .profile-stats-row { flex-wrap: wrap; row-gap: 10px; }
    .profile-activity-btn { margin-left: 0; }
}

/* ---------- Modal de registro ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.open { display: flex; }

/* Modal de confirmación: va por encima de cualquier otro modal (ej. el panel de moderación). */
.confirm-overlay { z-index: 200; }
.modal-box.confirm-box { width: 440px; }
.confirm-message { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn-accent.btn-danger { background: #d63b3b; color: #fff; }
.btn-accent.btn-danger:hover { background: #e04c4c; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 420px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-box-wide { width: 640px; }

.form-row {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.form-row:last-of-type { border-bottom: none; }

.form-row-label {
    width: 120px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    padding-top: 8px;
}

.form-row-control {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.radio-row input { accent-color: var(--accent); }

.modal-row-error { margin: 16px 24px 0; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { margin: 0; font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover { color: var(--text); }

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

.forum-picker-tree {
    max-height: 420px;
    overflow-y: auto;
}

.forum-picker-group { margin-bottom: 6px; }

.forum-picker-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    padding: 8px 6px;
}

.forum-picker-cat .icon-chevron { width: 16px; height: 16px; flex-shrink: 0; }

.forum-picker-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    padding: 9px 12px 9px 32px;
    border-radius: 6px;
    cursor: pointer;
}

.forum-picker-sub { padding-left: 48px; font-size: 13px; }

.forum-picker-item:hover {
    background: var(--bg-row-hover);
    color: var(--accent);
}

.forum-picker-empty {
    padding: 4px 12px 4px 32px;
    font-size: 13px;
    color: var(--text-dim);
}

.modal-body label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.form-row-control input[type="text"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    width: 100%;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.file-drop-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-radius: 6px;
    padding: 4px;
}

.file-drop-inline.dragover {
    outline: 2px dashed var(--accent);
    outline-offset: 4px;
}

.file-select-btn {
    cursor: pointer;
    white-space: nowrap;
}

.file-drop-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-drop-hint { font-size: 12px; color: var(--text-dim); }
.file-drop-meta { font-size: 11px; color: var(--text-dim); }
.form-row-or { font-size: 12px; color: var(--text-dim); }

.file-preview {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
}

.file-preview.show { display: flex; }

.file-preview img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-row-hover);
}

.file-preview-name { font-size: 13px; font-weight: 600; }
.file-preview-size { font-size: 12px; color: var(--text-dim); }

.modal-body .btn-block { margin-top: 12px; }

.required {
    color: #e05252;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    letter-spacing: .3px;
}

/* ---------- Subnav ---------- */

.subnav {
    position: relative;
    z-index: 2;
    margin-top: -30px;
    background: rgba(16, 16, 19, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-bottom: 1px solid var(--border);
}

.subnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.subnav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 100%;
}

.subnav-links li { height: 100%; display: flex; align-items: center; }

.subnav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dim);
    height: 100%;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.subnav-links a:hover { color: var(--text); }

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.search-form input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    padding: 8px 14px;
    width: 220px;
    font-size: 13px;
}

.search-form button {
    background: var(--bg-row-hover);
    border: none;
    color: var(--text-dim);
    width: 34px;
    height: 34px;
    margin-right: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.breadcrumb-left a { color: var(--text-dim); }
.breadcrumb-sep { margin: 0 6px; color: var(--text-dim); }

.breadcrumb-right { display: flex; gap: 22px; }

.breadcrumb-right a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
}

.breadcrumb-right a:hover { color: var(--text); }

/* ---------- Main layout ---------- */

.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    padding-top: 28px;
    padding-bottom: 60px;
    align-items: start;
}

.forums-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.forums-heading h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: .5px;
    color: var(--accent);
}

.btn-new-topic { white-space: nowrap; }

/* ---------- Category groups ---------- */

.cat-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 22px;
    overflow: hidden;
}

.cat-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.cat-group-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.cat-group-header.has-image {
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.cat-group-header.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.5) 55%, rgba(0,0,0,.22) 100%);
}

.cat-group-header.has-image h2 {
    position: relative;
    z-index: 1;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,.7);
}

.cat-group-header.has-image .collapse-btn {
    position: relative;
    z-index: 1;
    color: #fff;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
}

.collapse-btn .icon-chevron {
    transition: transform .2s ease;
}

.cat-rows {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease;
}

.cat-group.collapsed .cat-group-header {
    border-bottom: none;
}

.cat-group.collapsed .cat-rows {
    max-height: 0;
    opacity: 0;
}

.cat-group.collapsed .collapse-btn .icon-chevron {
    transform: rotate(-90deg);
}

.cat-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.cat-row:last-child { border-bottom: none; }

.cat-row:hover { background: var(--bg-row-hover); }

.cat-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d2138, var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cat-icon.cat-icon-has-image { background: none; }

.cat-icon-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
    color: #fff;
}

.cat-info { flex: 1; min-width: 0; }

.cat-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.cat-title:hover { color: var(--accent); }

.cat-tags {
    font-size: 12.5px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-subforum-row { padding-left: 42px; }

.cat-tags a { color: var(--accent); }
.cat-tags a:hover { text-decoration: underline; }

.cat-count {
    width: 90px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-dim);
    font-size: 12.5px;
}

.cat-count strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
}

.cat-lastpost {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 260px;
    flex-shrink: 0;
}

.lastpost-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lastpost-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
    color: #0a1d30;
}

.lastpost-info { min-width: 0; }
.lastpost-empty { font-size: 13px; color: var(--text-dim); }

.lastpost-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lastpost-title:hover { color: var(--accent); }

.lastpost-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.lastpost-meta a { color: var(--link-user); font-weight: 600; }
.lastpost-meta a:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.widget-body { padding: 8px 0; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2a1a0d;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon .icon { width: 16px; height: 16px; }

.activity-content { flex: 1; min-width: 0; }

.activity-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.activity-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    line-height: 1.35;
}

.activity-title:hover { color: var(--accent); }

.badge-count {
    background: var(--bg-row-hover);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}

.badge-count.badge-green { background: var(--green); color: #fff; }

.activity-desc {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 2px;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.activity-meta a { color: var(--accent); }
.activity-meta a:hover { text-decoration: underline; }

.mini-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    object-fit: cover;
}

.stats-body { padding: 6px 18px 16px; }

.stat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
    color: var(--text-dim);
    font-size: 13px;
}

.stat-value {
    font-weight: 700;
    font-size: 14px;
}

.stat-value-wrap { text-align: right; }

.stat-sub {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 2px;
}

.stat-newest {
    padding-top: 14px;
}

.stat-label-caps {
    display: block;
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 10px;
}

.newest-member {
    display: flex;
    align-items: center;
    gap: 10px;
}

.newest-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--accent);
    color: #0a1d30;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.newest-name { font-weight: 700; font-size: 13px; }
.newest-name:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .main-layout { grid-template-columns: 1fr; }
    .subnav-links { display: none; }
    .cat-lastpost { width: 190px; }
    .cat-tags { white-space: normal; }
}

@media (max-width: 620px) {
    .cat-row { flex-wrap: wrap; }
    .cat-count { display: none; }
    .cat-lastpost { width: 100%; padding-left: 62px; }
}

/* ---------- Foro / tema ---------- */

.forum-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 18px;
}

.forum-header-card h1 { margin: 0; font-size: 20px; }

.forum-follow-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.forum-follow-btn.is-following { background: var(--accent); color: #0d1620; border-color: var(--accent); }
.forum-follow-btn.is-following .forum-follow-count { background: rgba(0,0,0,.2); color: #0d1620; }

.forum-follow-count {
    background: var(--bg-row-hover);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.forum-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.forum-view-toggle {
    display: flex;
    gap: 6px;
    margin-right: auto;
}

.forum-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
}

.forum-view-btn.active { color: var(--accent); border-color: var(--accent); }

.topic-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--bg-row-hover); }

.topic-info { flex: 1; min-width: 0; }

.topic-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.topic-title:hover { color: var(--accent); }

.topic-pin {
    display: inline-block;
    background: var(--accent);
    color: #0a1d30;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.topic-pin-locked { background: #e05252; color: #2b0a0a; }
.topic-pin-private { background: #8b8b93; color: #1a1a1c; }

.topic-meta { font-size: 12.5px; color: var(--text-dim); }
.topic-meta a { color: var(--link-user); }

.topic-excerpt {
    display: none;
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.5;
}

.topic-list.view-excerpt .topic-excerpt { display: block; }

.topic-stats {
    width: 90px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-dim);
    font-size: 12.5px;
}

.topic-stats strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
}

.pagination-link:hover { color: var(--text); }
.pagination-link.active { background: var(--accent); border-color: var(--accent); color: #0a1d30; }

.topic-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.post-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.post-author {
    width: 140px;
    flex-shrink: 0;
    text-align: center;
}

.post-author-avatar { width: 64px; height: 64px; margin: 0 auto 8px; }

.post-author-name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 10px;
}

.post-author-meta { font-size: 11.5px; color: var(--text-dim); }

.post-author-avatar-wrap {
    position: relative;
    width: 96px;
    margin: 0 auto 8px;
}

.post-author-avatar-wrap .post-author-avatar {
    width: 96px;
    height: 96px;
    margin: 0;
    border-radius: 6px;
}

.post-author-level-badge {
    position: absolute;
    left: -10px;
    bottom: -8px;
    width: 34px;
    height: 34px;
}

.post-author-msgcount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-dim);
}

.post-author-msgcount .icon { width: 13px; height: 13px; }

.post-body-wrap { flex: 1; min-width: 0; }

.post-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-dim);
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.post-mod-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-mod-btn .icon { width: 15px; height: 15px; }

.post-mod-btn:hover { border-color: var(--accent); color: var(--accent); }

.mod-edit-textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

.post-mod { position: relative; display: inline-flex; }

.post-mod-menu {
    display: none;
    position: fixed;
    width: 210px;
    background: #1c1c20;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    z-index: 60;
}

.post-mod-menu.open { display: block; }

.post-mod-menu form { margin: 0; }

.post-mod-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.post-mod-menu-item .icon { width: 15px; height: 15px; flex-shrink: 0; }

.post-mod-menu-item:hover { background: var(--bg-row-hover); }

.post-mod-menu-danger { color: #e05252; }

.post-mod-menu-danger:hover { background: rgba(224,82,82,.12); }

.post-edit-form { display: none; margin-top: 12px; }

.post-edit-form.open { display: block; }

.post-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.post-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.post-body a { color: var(--accent); text-decoration: underline; }

/* ---------- Editor BBCode ---------- */

.editor-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    background: var(--bg-row-hover);
    border: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
    padding: 6px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.editor-group { display: flex; gap: 2px; flex-shrink: 0; }

.editor-sep {
    width: 1px;
    height: 22px;
    flex-shrink: 0;
    background: var(--border);
    margin: 0 4px;
}

.editor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.editor-btn:hover { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.editor-btn .icon { width: 16px; height: 16px; }

.editor-textarea {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
    margin-top: -1px;
    font-family: inherit;
}

.editor-editable {
    min-height: 160px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.6;
}

.editor-editable:focus { outline: none; }

.editor-editable:empty::before {
    content: attr(data-placeholder);
    color: var(--text-dim);
}

.editor-editable a { color: var(--accent); text-decoration: underline; }
.editor-editable .bbcode-quote,
.editor-editable .bbcode-spoiler { margin: 8px 0; }

.editor-code-textarea {
    width: 100%;
    min-height: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    color: var(--text);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
}

.editor-code-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.editor-code-footer select {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
}

/* Emoji */

.emoji-popover {
    position: fixed;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    padding: 10px;
    width: 260px;
    z-index: 120;
}

.emoji-popover.open { display: grid; }

.emoji-item {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.emoji-item:hover { background: var(--bg-row-hover); }

/* Preview */

.preview-device-tabs {
    display: flex;
    gap: 4px;
    padding: 14px 20px 0;
}

.preview-device-tab {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
}

.preview-device-tab.active { color: var(--accent); border-color: var(--accent); background: var(--bg); }

.editor-preview-wrap {
    background: var(--bg);
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.editor-preview-frame {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    width: 100%;
}

.editor-preview-frame.device-tablet { width: 640px; max-width: 100%; }
.editor-preview-frame.device-phone { width: 340px; max-width: 100%; }

/* ---------- Render de BBCode ---------- */

.bbcode-quote {
    margin: 10px 0;
    padding: 10px 14px;
    background: var(--bg);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    color: var(--text-dim);
}

.bbcode-spoiler {
    margin: 10px 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.bbcode-spoiler summary {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--accent);
    background: var(--bg-row-hover);
}

.bbcode-spoiler-body { padding: 12px 14px; }

.bbcode-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.bbcode-align-left { text-align: left; }
.bbcode-align-center { text-align: center; }
.bbcode-align-right { text-align: right; }
.bbcode-align-justify { text-align: justify; }

.bbcode-html {
    margin: 10px 0;
    max-width: 100%;
    overflow-x: auto;
    /* .post-body hereda white-space: pre-wrap; sin este reset, cada salto de línea
       literal del HTML pegado por el usuario se ve como un <br> real, aunque no exista. */
    white-space: normal;
}

.bbcode-code-wrap {
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.bbcode-code-lang {
    background: var(--bg-row-hover);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 6px 12px;
}

.bbcode-code {
    margin: 0;
    padding: 14px;
    background: var(--bg);
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.bbcode-code code { white-space: pre; }

.tok-comment { color: #7a8699; font-style: italic; }
.tok-string { color: #d7ba7d; }
.tok-keyword { color: var(--accent); font-weight: 600; }
.tok-number { color: #d19a66; }
.tok-variable { color: #56b6c2; }
.tok-tag { color: #e06c75; }
.tok-attr-name { color: #d19a66; }
.tok-attr-value { color: #98c379; }
.tok-punctuation { color: var(--text-dim); }

/* ---------- Staff ---------- */

.staff-group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.staff-group-header {
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}

.staff-group-body { padding: 18px; }

.staff-empty { margin: 0; font-size: 13px; color: var(--text-dim); }

.staff-member-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.staff-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 76px;
    text-align: center;
}

.staff-member-avatar { width: 48px; height: 48px; }

.staff-member-name {
    font-size: 12px;
    font-weight: 600;
    word-break: break-word;
}

.staff-online-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
}

.homepage-online-wrap { padding-bottom: 32px; }

.staff-online-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.staff-online-count {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: none;
}

.staff-online-body {
    padding: 14px 18px;
    font-size: 13px;
}

.staff-online-name { color: var(--text); font-weight: 600; }
.staff-online-name:hover { color: var(--accent); }

/* ---------- Insignia de rango en posts ---------- */

.post-author-rank-badge {
    margin-top: 8px;
    display: inline-block;
}

.post-author-rank-badge img {
    max-width: 100%;
    max-height: 44px;
    border-radius: 4px;
}

.post-author-rank-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ---------- Footer ---------- */

.site-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.site-footer-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
}

.site-footer-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.site-footer-copy {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--text-dim);
}
