/* ═══════════════════════════════════════════════════════════════
   PROFIL2.CSS — Nowy design profilu (mobile-first card)
   Nasza-Biedronka.pl · Portal Pracowniczy
   ═══════════════════════════════════════════════════════════════ */

/* ── Root tokens ── */
:root {
    --p2-hero-from: #E30613;
    --p2-hero-to: #f97316;
    --p2-card-bg: #fff;
    --p2-card-radius: 28px;
    --p2-text: #1f2937;
    --p2-text-muted: #6b7280;
    --p2-border: #f3f4f6;
    --p2-accent: #E30613;
    --p2-stat-bg: rgba(255, 255, 255, 0.15);
    --p2-tab-active-bg: #E30613;
    --p2-tab-active-text: #fff;
    --p2-tab-bg: #f9fafb;
    --p2-tab-text: #6b7280;
    --p2-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    --p2-body-bg: #fef6ee;
    --p2-bottom-bg: #fff;
}

html.dark {
    --p2-hero-from: #991b1b;
    --p2-hero-to: #b45309;
    --p2-card-bg: #1f2937;
    --p2-text: #f3f4f6;
    --p2-text-muted: #9ca3af;
    --p2-border: #374151;
    --p2-tab-bg: #374151;
    --p2-tab-text: #9ca3af;
    --p2-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    --p2-body-bg: #111827;
    --p2-bottom-bg: #1f2937;
}

/* ── Page body ── */
.p2-page {
    background: var(--p2-body-bg);
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ── Wrapper: centres card on desktop ── */
.p2-wrap {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

/* ── Hero ── */
.p2-hero {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--p2-hero-from), var(--p2-hero-to));
    overflow: hidden;
}

.p2-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    mix-blend-mode: multiply;
}

/* Ladybug dots on hero */
.p2-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
}

.p2-dot-1 {
    width: 60px;
    height: 60px;
    top: 15%;
    right: 8%;
}

.p2-dot-2 {
    width: 40px;
    height: 40px;
    top: 50%;
    right: 25%;
}

.p2-dot-3 {
    width: 25px;
    height: 25px;
    top: 20%;
    right: 35%;
}

.p2-dot-4 {
    width: 45px;
    height: 45px;
    bottom: 10%;
    left: 6%;
}

.p2-dot-5 {
    width: 20px;
    height: 20px;
    top: 40%;
    left: 25%;
}

/* Back + menu buttons on hero */
.p2-hero-btn {
    position: absolute;
    top: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    border: none;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s;
}

.p2-hero-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.p2-hero-back {
    left: 14px;
}

.p2-hero-menu {
    right: 14px;
}

/* ── Card (white body overlapping hero) ── */
.p2-card {
    position: relative;
    margin-top: -60px;
    background: var(--p2-card-bg);
    border-radius: var(--p2-card-radius) var(--p2-card-radius) 0 0;
    box-shadow: var(--p2-shadow);
    padding: 56px 24px 24px;
    z-index: 2;
}

/* ── Avatar (overlaps hero/card boundary) ── */
.p2-avatar {
    position: absolute;
    top: -98px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--p2-card-bg);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.4rem;
    font-weight: 900;
    color: #fff;
    transition: transform 0.2s;
}

.p2-avatar:hover {
    transform: translateX(-50%) scale(1.04);
}

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

/* ── Info badges row (stanowisko+ranga / miasto+ocena / data) ── */
.p2-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 5px 0 0;
}

.p2-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--p2-tab-bg);
    color: var(--p2-text-muted);
    border: 1px solid var(--p2-border);
    white-space: nowrap;
}

.p2-badge i {
    font-size: 0.8rem;
}

/* Rating badge — czerwony dla jasnego i ciemnego trybu */
.p2-badge-rating {
    color: #b91c1c;
    background: #fff1f2;
    border-color: #fecaca;
}

html.dark .p2-badge-rating {
    color: #fca5a5;
    background: #450a0a;
    border-color: #7f1d1d;
}

/* ── Rank-specific badge colors (override generic p2-badge defaults) ── */
.p2-badge.rank-admin   { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.p2-badge.rank-moderator { background: #fff7ed; color: #9a3412; border-color: #ffedd5; }
.p2-badge.rank-supporter { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.p2-badge.rank-friend  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.p2-badge.rank-super   { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.p2-badge.rank-engaged { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.p2-badge.rank-active  { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.p2-badge.rank-user    { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }
.p2-badge.rank-new     { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }

/* Wspieram — gradient shimmer */
.p2-badge.rank-wspieram {
    background: linear-gradient(135deg, #fef2f2, #fffbeb, #fef2f2);
    background-size: 200% auto;
    color: #dc2626;
    border-color: #fca5a5;
    animation: p2-wspieram-shimmer 3s linear infinite;
    font-weight: 700;
}
@keyframes p2-wspieram-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Dark mode rank overrides */
html.dark .p2-badge.rank-admin    { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
html.dark .p2-badge.rank-moderator{ background: #431407; color: #fdba74; border-color: #7c2d12; }
html.dark .p2-badge.rank-supporter{ background: #052e16; color: #86efac; border-color: #166534; }
html.dark .p2-badge.rank-friend   { background: #022c22; color: #6ee7b7; border-color: #065f46; }
html.dark .p2-badge.rank-super    { background: #431407; color: #fb923c; border-color: #9a3412; }
html.dark .p2-badge.rank-engaged  { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
html.dark .p2-badge.rank-active   { background: #3b0764; color: #d8b4fe; border-color: #7e22ce; }
html.dark .p2-badge.rank-user     { background: #374151; color: #9ca3af; border-color: #4b5563; }
html.dark .p2-badge.rank-new      { background: #374151; color: #9ca3af; border-color: #4b5563; }
html.dark .p2-badge.rank-wspieram { background: linear-gradient(135deg, #450a0a, #451a03, #450a0a); background-size: 200% auto; color: #fca5a5; border-color: #7f1d1d; }

/* ── Username + rank ── */
.p2-username {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--p2-text);
    text-align: center;
    margin: 0;
    line-height: 1.2;
}

.p2-username.rank-wspieram-gradient {
    background: linear-gradient(135deg, #dc2626, #f59e0b, #dc2626);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wspieram-shimmer 3s linear infinite;
}

.p2-rank-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -2px;
}

.p2-join-date {
    text-align: center;
    font-size: 0.78rem;
    color: var(--p2-text-muted);
    margin: 4px 0 0;
}

.p2-stanowisko {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #16a34a;
}

.p2-stanowisko i {
    font-size: 1rem;
}

/* ── Bio / description (future) ── */
.p2-bio {
    text-align: center;
    font-size: 0.82rem;
    color: var(--p2-text-muted);
    margin: 10px 0 0;
    line-height: 1.5;
    font-style: italic;
}

/* ── Stats row ── */
.p2-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid var(--p2-border);
    border-bottom: 1px solid var(--p2-border);
}

.p2-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.p2-stat-icon {
    font-size: 1.4rem;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    opacity: 0.85;
}

.p2-stat-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--p2-text);
    line-height: 1.2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
}

.p2-stat-label {
    font-size: 0.72rem;
    color: var(--p2-text-muted);
    text-transform: capitalize;
    font-weight: 600;
    margin-top: 6px;
    height: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* ── Bio / opis użytkownika ── */
.p2-bio {
    position: relative;
    margin: 16px 0 0;
    padding: 18px 24px 14px;
    background: var(--p2-tab-bg);
    border: 1px solid var(--p2-border);
    border-radius: 14px;
    text-align: center;
}
.p2-bio-text {
    margin: 0;
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.65;
    color: var(--p2-text-muted);
    word-break: break-word;
}
.p2-bio-quote {
    color: var(--p2-accent);
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.35;
}
.p2-bio-quote-open {
    position: absolute;
    top: 6px;
    left: 10px;
    transform: scaleX(-1);
}
.p2-bio-quote-close {
    position: absolute;
    bottom: 4px;
    right: 10px;
}

/* ── Tab navigation ── */
.p2-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.p2-tabs::-webkit-scrollbar {
    display: none;
}

.p2-tab {
    flex: 1;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
    border-radius: 14px;
    background: var(--p2-tab-bg);
    border: none;
    cursor: pointer;
    color: var(--p2-tab-text);
    font-size: 0.65rem;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
}

.p2-tab i {
    font-size: 1.15rem;
}

.p2-tab.active {
    background: var(--p2-tab-active-bg);
    color: var(--p2-tab-active-text);
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.3);
}

.p2-tab:not(.active):hover {
    background: #f3f4f6;
}

html.dark .p2-tab:not(.active):hover {
    background: #4b5563;
}

.p2-tab-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E30613;
}

/* ── Tab content area ── */
.p2-content {
    min-height: 200px;
}

.p2-panel {
    display: none;
    animation: p2FadeIn 0.25s ease-out;
}

.p2-panel.active {
    display: block;
}

@keyframes p2FadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Last activity section ── */
.p2-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.p2-activity-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--p2-text);
}

.p2-activity-title i {
    font-size: 1rem;
}

.p2-activity-link {
    font-size: 0.72rem;
    color: var(--p2-accent);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}

.p2-activity-link:hover {
    text-decoration: underline;
}

.p2-activity-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--p2-tab-bg);
    border-radius: 14px;
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.p2-activity-card:hover {
    background: #f3f4f6;
}

html.dark .p2-activity-card:hover {
    background: #4b5563;
}

.p2-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.p2-activity-icon i {
    color: #92400e;
    font-size: 1rem;
}

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

.p2-activity-meta-label {
    font-size: 0.7rem;
    color: var(--p2-text-muted);
}

.p2-activity-meta-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--p2-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p2-activity-meta-time {
    font-size: 0.68rem;
    color: var(--p2-text-muted);
    margin-top: 1px;
}

.p2-activity-arrow {
    color: var(--p2-text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Bottom bar ── */
.p2-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100vw;
    background: var(--p2-bottom-bg);
    border-top: 1px solid var(--p2-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding: 6px 0;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.p2-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    max-width: 520px;
    padding: 0 4px;
}

.p2-bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--p2-text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    border-radius: 10px;
    min-width: 52px;
    flex: 1;
    max-width: 80px;
}

.p2-bottom-btn span {
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.p2-bottom-btn i {
    font-size: 1.2rem;
}

.p2-bottom-btn.active,
.p2-bottom-btn:hover {
    color: var(--p2-accent);
}

.p2-bottom-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    flex-shrink: 0;
    flex-grow: 0;
    border-radius: 50%;
    border: 3px solid var(--p2-accent);
    overflow: hidden;
    margin-top: -18px;
    background: var(--p2-accent);
    box-shadow: 0 2px 12px rgba(227, 6, 19, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

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

/* ── Post/Comment items in tabs ── */
.p2-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--p2-border);
}

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

.p2-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--p2-text);
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p2-item-title a {
    color: inherit;
    text-decoration: none;
}

.p2-item-title a:hover {
    color: var(--p2-accent);
}

.p2-item-body {
    font-size: 0.78rem;
    color: var(--p2-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}

.p2-item-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--p2-text-muted);
}

.p2-item-footer i {
    margin-right: 2px;
}

/* ── Loading / Empty ── */
.p2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--p2-text-muted);
    gap: 8px;
}

.p2-loading i {
    font-size: 1.5rem;
}

.p2-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--p2-text-muted);
    font-size: 0.82rem;
}

.p2-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* ── Pagination ── */
.p2-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 16px 0 4px;
}

.p2-page-btn {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--p2-border);
    background: var(--p2-card-bg);
    color: var(--p2-text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.p2-page-btn:hover {
    border-color: var(--p2-accent);
    color: var(--p2-accent);
}

.p2-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Banned banner ── */
.p2-banned {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

html.dark .p2-banned {
    background: linear-gradient(135deg, #450a0a, #7f1d1d);
    border-color: #991b1b;
}

.p2-banned i {
    font-size: 1.2rem;
    color: #dc2626;
    flex-shrink: 0;
}

.p2-banned-text {
    font-size: 0.78rem;
    color: #991b1b;
    font-weight: 600;
}

html.dark .p2-banned-text {
    color: #fca5a5;
}

/* ── Info grid (admin tab) ── */
.p2-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.p2-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--p2-border);
}

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

.p2-info-row i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.p2-info-label {
    font-size: 0.72rem;
    color: var(--p2-text-muted);
}

.p2-info-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--p2-text);
}

/* ── Access denied ── */
.p2-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.p2-denied-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

html.dark .p2-denied-icon {
    background: #450a0a;
}

.p2-denied-icon i {
    font-size: 2rem;
    color: #dc2626;
}

.p2-denied h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--p2-text);
    margin: 0 0 8px;
}

.p2-denied p {
    font-size: 0.82rem;
    color: var(--p2-text-muted);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Responsive: hide bottom bar on large screens ── */
@media (min-width: 640px) {
    .p2-bottom {
        display: none;
    }

    .p2-page {
        padding-bottom: 24px;
    }

    .p2-hero {
        height: 260px;
    }
}

/* ── Toast ── */
.p2-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    pointer-events: none;
}

.p2-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Send message button ── */
.p2-msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #E30613, #c0050f);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.35);
    font-family: inherit;
    letter-spacing: 0.01em;
    margin-top: 10px;
}

.p2-msg-btn i {
    font-size: 0.9rem;
}

.p2-msg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(227, 6, 19, 0.45);
    background: linear-gradient(135deg, #f00e1c, #E30613);
}

.p2-msg-btn:active {
    transform: translateY(0);
}

/* ── Message Modal Overlay ── */
.msg-tooltip {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.msg-tooltip-card {
    background: #fff;
    border-radius: 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: msgCardIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark .msg-tooltip-card {
    background: #1f2937;
}

@keyframes msgCardIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.msg-tooltip-header {
    background: linear-gradient(135deg, #E30613, #b8000e);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.msg-tooltip-header-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #fff;
}

.msg-tooltip-header h2 {
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    margin: 0 0 2px;
}

.msg-tooltip-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    margin: 0;
}

.msg-tooltip-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.msg-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.msg-tooltip-body {
    padding: 22px;
}

.msg-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 5px;
}

html.dark .msg-field-label {
    color: #d1d5db;
}

.msg-field-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
    color: #1f2937;
    box-sizing: border-box;
}

html.dark .msg-field-input {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
}

.msg-field-input:focus {
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
    background: #fff;
}

html.dark .msg-field-input:focus {
    background: #0f172a;
}

.msg-field-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
    color: #1f2937;
    resize: vertical;
    min-height: 110px;
    box-sizing: border-box;
}

html.dark .msg-field-textarea {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
}

.msg-field-textarea:focus {
    border-color: #E30613;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

html.dark .msg-field-textarea:focus {
    background: #0f172a;
}

.msg-space {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.btn-msg-cancel {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.btn-msg-cancel:hover {
    color: #374151;
}

html.dark .btn-msg-cancel:hover {
    color: #d1d5db;
}

.btn-msg-send {
    background: linear-gradient(135deg, #E30613, #b8000e);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(227, 6, 19, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-msg-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(227, 6, 19, 0.4);
}

.btn-msg-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.msg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    align-items: center;
}

.msg-alert {
    padding: 9px 13px;
    border-radius: 9px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 7px;
}

.msg-alert.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.msg-alert.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

html.dark .msg-alert.error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

html.dark .msg-alert.success {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
}

.msg-char-counter {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: right;
    margin-top: 3px;
}

#profileMsgToast {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 99999;
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: none;
    align-items: center;
    gap: 8px;
}
@keyframes p2-fade-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Subforum cards ── */
.p2-subforum-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--p2-tab-bg);
    border: 1px solid var(--p2-border);
    border-radius: 14px;
    flex-wrap: wrap;
}
.p2-subforum-left {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    flex: 1;
}
.p2-subforum-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--p2-bg);
    border: 1px solid var(--p2-border);
    flex-shrink: 0;
    font-size: 1.2rem;
}
.p2-subforum-info { min-width: 0; }
.p2-subforum-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--p2-text);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p2-subforum-name:hover { color: #E30613; }
.p2-subforum-meta {
    font-size: 0.72rem;
    color: var(--p2-text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.p2-subforum-sep { margin: 0 3px; }
.p2-subforum-vis { font-weight: 600; }
.p2-subforum-btn {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
}
.p2-subforum-btn-manage {
    background: rgba(99,102,241,0.12);
    color: #6366f1;
    border: 1px solid rgba(99,102,241,0.28);
}
.p2-subforum-btn-manage:hover { background: rgba(99,102,241,0.2); }
.p2-subforum-btn-visit {
    background: var(--p2-tab-bg);
    color: var(--p2-text-muted);
    border: 1px solid var(--p2-border);
}
.p2-subforum-btn-visit:hover { opacity: 0.75; }

/* ── Subforum sections (owned / joined) ── */
.p2-subforum-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--p2-text-muted);
    padding: 0 2px 6px;
    border-bottom: 1px solid var(--p2-border);
    margin-bottom: 8px;
}
.p2-subforum-section-count {
    margin-left: auto;
    background: var(--p2-tab-bg);
    border: 1px solid var(--p2-border);
    border-radius: 99px;
    padding: 0 7px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--p2-text-muted);
}

/* ── Admin stats stripe ── */
.p2-subforum-admin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--p2-border);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--p2-text-muted);
}
.p2-subforum-admin-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Warning cards ── */
.p2-warn-card {
    background: var(--p2-tab-bg);
    border: 1px solid var(--p2-border);
    border-left: 4px solid #dc2626;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}
.p2-warn-inner {
    display: flex;
    gap: 12px;
    padding: 12px;
    align-items: flex-start;
}
.p2-warn-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}
.p2-warn-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.p2-warn-body { flex: 1; min-width: 0; }
.p2-warn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.p2-warn-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--p2-text);
}
.p2-warn-date {
    font-size: 0.72rem;
    color: var(--p2-text-muted);
    white-space: nowrap;
}
.p2-warn-reason {
    font-size: 0.82rem;
    color: var(--p2-text);
    margin: 0 0 8px;
    line-height: 1.5;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.p2-warn-reason-icon {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}
.p2-warn-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.p2-warn-by {
    font-size: 0.72rem;
    color: var(--p2-text-muted);
}
.p2-warn-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.p2-warn-status-active {
    background: rgba(220,38,38,0.1);
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.25);
}
.p2-warn-status-expired {
    background: rgba(22,163,74,0.1);
    color: #16a34a;
    border: 1px solid rgba(22,163,74,0.25);
}
.p2-warn-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: #E30613;
    text-decoration: none;
    margin-top: 6px;
}
.p2-warn-link:hover { text-decoration: underline; }