/* ================================================================== */
/* Support panel UI — shared with landing editorial style              */
/* ================================================================== */

body.support-page { overflow: auto !important; }

/* --- Nav --- */
.support-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(15, 13, 11, 0.94) 0%, rgba(15, 13, 11, 0.72) 70%, transparent 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.support-nav-logo,
.support-nav .nav-logo {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: #fff !important;
    text-decoration: none;
}
.support-nav-logo span { color: var(--accent); }
.support-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.support-username { font-size: 0.88rem; color: rgba(255, 255, 255, 0.82); font-weight: 600; }
.support-role {
    color: #0a0a0a;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.support-role.user { background: #64748b; color: #fff; }
.support-role.member { background: #4ade80; }
.support-role.member\+ { background: #a78bfa; }
.support-role.admin { background: #fbbf24; }
.support-role.owner { background: var(--accent); color: #fff; }
.support-logout,
.support-nav .btn-outline {
    padding: 8px 14px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    background: transparent !important;
    text-decoration: none;
    transition: border-color 0.25s ease, color 0.25s ease;
}
.support-logout:hover,
.support-nav .btn-outline:hover {
    border-color: var(--accent) !important;
    color: #fff !important;
}

/* --- Page shell --- */
.sp-page,
.support-page,
.support-content,
.profile-content,
.perfs-content {
    padding: 112px 40px 80px;
    max-width: 1320px;
    margin: 0 auto;
    min-height: 100vh;
}
.sp-page--chat {
    padding: 88px 24px 16px;
    max-width: 1100px;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.sp-page--chat > .sp-back { flex-shrink: 0; margin-bottom: 8px; }
.sp-page--chat .sp-eyebrow { flex-shrink: 0; margin-bottom: 6px; }
.sp-page--chat .sp-headline { flex-shrink: 0; margin-bottom: 12px !important; font-size: clamp(1.4rem, 3vw, 2rem); }
.sp-page--chat .sp-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* --- Typography --- */
.sp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
}
.sp-eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.sp-headline {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}
.sp-headline .accent { color: var(--accent); font-style: italic; }
.sp-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 36px;
    max-width: 620px;
}
.sp-back,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45) !important;
    text-decoration: none;
    transition: color 0.25s ease;
}
.sp-back:hover,
.back-link:hover { color: var(--accent) !important; }

/* --- Panels & cards --- */
.sp-panel,
.profile-section {
    background: linear-gradient(145deg, #1c1917 0%, #12100e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 20px;
}
.section-title-small {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sp-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.sp-stat,
.stat-card,
.goal-item {
    text-align: center;
    padding: 20px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease;
}
.sp-stat-value,
.stat-value,
.points-display-large {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
}
.sp-stat-label,
.stat-label,
.goal-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.48);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.goal-item.achieved {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(74, 222, 128, 0.08);
}

/* --- Bento menu (perfs, index) --- */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}
.sp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 148px;
    padding: 24px 22px;
    border-radius: 18px;
    background: linear-gradient(145deg, #1c1917 0%, #12100e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.sp-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232, 83, 58, 0.12) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.sp-card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 83, 58, 0.45);
    box-shadow: 0 22px 50px -22px rgba(232, 83, 58, 0.4);
}
.sp-card:hover::before { opacity: 1; }
.sp-card > * { position: relative; z-index: 1; }
.sp-card-num { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; color: rgba(232, 83, 58, 0.75); margin-bottom: 10px; text-transform: uppercase; }
.sp-card-title, .menu-title { font-size: 1.08rem; font-weight: 700; color: #fff; margin: 0 0 8px; }
.sp-card-desc, .menu-desc { font-size: 0.82rem; line-height: 1.45; color: rgba(255, 255, 255, 0.52); margin: 0; }
.sp-card-arrow { position: absolute; top: 20px; right: 20px; color: rgba(255, 255, 255, 0.22); transition: transform 0.35s ease, color 0.35s ease; }
.sp-card:hover .sp-card-arrow { transform: translate(3px, -3px); color: var(--accent); }
.sp-span-4 { grid-column: span 4; }
.sp-span-6 { grid-column: span 6; }
.sp-span-12 { grid-column: span 12; }
.sp-span-full { grid-column: 1 / -1; }
.sp-grid--full { grid-template-columns: 1fr; }

/* --- Tabs --- */
.sp-tabs,
.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    border-bottom: none;
}
.sp-tab,
.leaderboard-tab,
.filter-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.sp-tab:hover,
.leaderboard-tab:hover,
.filter-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}
.sp-tab.active,
.leaderboard-tab.active,
.filter-btn.active {
    background: rgba(232, 83, 58, 0.15);
    border-color: rgba(232, 83, 58, 0.5);
    color: #fff;
}

/* --- Leaderboard --- */
.leaderboard-content { display: none; }
.leaderboard-content.active { display: block; }
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.leaderboard-item:hover {
    transform: translateX(4px);
    border-color: rgba(232, 83, 58, 0.35);
    box-shadow: 0 12px 32px -16px rgba(232, 83, 58, 0.35);
}
.leaderboard-rank {
    font-size: 1.6rem;
    font-weight: 800;
    min-width: 52px;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
}
.leaderboard-rank.gold { color: #fbbf24; }
.leaderboard-rank.silver { color: #94a3b8; }
.leaderboard-rank.bronze { color: #f97316; }
.leaderboard-username { font-weight: 700; font-size: 1rem; color: #fff; }
.leaderboard-user-role {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.leaderboard-user-role.member { background: #4ade80; color: #000; }
.leaderboard-user-role.member\+ { background: #a78bfa; color: #000; }
.leaderboard-user-role.admin { background: #fbbf24; color: #000; }
.leaderboard-user-role.owner { background: var(--accent); color: #fff; }
.leaderboard-value { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.leaderboard-value-label { font-size: 0.72rem; color: rgba(255, 255, 255, 0.45); text-transform: uppercase; letter-spacing: 0.06em; }

/* --- Calendar --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.event-card {
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(145deg, #1c1917 0%, #12100e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.event-card:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 83, 58, 0.4);
    box-shadow: 0 16px 40px -18px rgba(232, 83, 58, 0.35);
}
.event-card.upcoming { border-left: 3px solid var(--accent); }
.event-card.past { opacity: 0.65; }
.event-title { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.event-date { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.event-description { font-size: 0.82rem; color: rgba(255, 255, 255, 0.5); line-height: 1.45; }

/* --- Achievements --- */
.achievements-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.badge-card {
    padding: 24px 20px;
    border-radius: 16px;
    text-align: center;
    background: linear-gradient(145deg, #1c1917 0%, #12100e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.badge-card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 83, 58, 0.35);
}
.badge-card.owned {
    border-color: rgba(232, 83, 58, 0.5);
    background: linear-gradient(145deg, #221816 0%, #14100e 100%);
    box-shadow: 0 0 24px -8px rgba(232, 83, 58, 0.4);
}
.badge-icon { font-size: 2.8rem; margin-bottom: 12px; }
.badge-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.badge-description { font-size: 0.82rem; color: rgba(255, 255, 255, 0.5); line-height: 1.45; margin-bottom: 12px; }
.badge-stats { font-size: 0.72rem; color: rgba(255, 255, 255, 0.35); text-transform: uppercase; letter-spacing: 0.06em; }
.badge-owned-label {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(232, 83, 58, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
}

/* --- Profile grid --- */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 20px;
    align-items: start;
}
.profile-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}
.profile-value { font-size: 1rem; font-weight: 600; color: #fff; }
.profile-field { margin-bottom: 16px; }
.badges-grid.profile-badges {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.badge-item {
    padding: 14px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.badge-item.owned {
    border-color: rgba(232, 83, 58, 0.45);
    box-shadow: 0 0 16px -6px rgba(232, 83, 58, 0.4);
}
.badge-item:hover { transform: translateY(-2px); }

/* --- Chat --- */
html.chat-page-active,
html.chat-page-active body {
    overflow: hidden !important;
    height: 100%;
    max-height: 100dvh;
}
body.chat-page { overflow: hidden !important; height: 100vh; max-height: 100dvh; }
body.chat-page .site-shell { overflow: hidden; height: 100%; }
body.chat-page .page-atmosphere { display: none; }
.chat-content {
    padding: 0;
    max-width: none;
    margin: 0;
    min-height: 0;
    height: auto;
}
.chat-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(28, 25, 23, 0.95) 0%, rgba(18, 16, 14, 0.98) 100%);
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    min-height: 0;
    overscroll-behavior: contain;
}
.message {
    margin-bottom: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.message:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}
.message-author { color: var(--accent); font-weight: 700; font-size: 0.78rem; }
.chat-input-area {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}
.chat-text-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    min-height: 44px;
}
.chat-text-input:focus {
    outline: none;
    border-color: rgba(232, 83, 58, 0.5);
}
.send-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover, #c9442e) 100%);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(232, 83, 58, 0.6);
}
.file-input-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.file-input-label:hover { border-color: var(--accent); color: #fff; }
.date-divider {
    text-align: center;
    margin: 16px 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

/* --- Forms in support --- */
.support-content .form-group,
.profile-content .form-group { margin-bottom: 15px; }
.sp-page .form-group { margin-bottom: 18px; }
.sp-page .form-label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Manrope', 'Unbounded', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}
.sp-page .form-input,
.sp-page .form-textarea,
.support-content .form-input,
.profile-content .form-input,
.support-content .form-textarea,
.profile-content .form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    min-height: 50px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Manrope', 'Unbounded', sans-serif;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sp-page .form-input::placeholder,
.support-content .form-input::placeholder,
.profile-content .form-input::placeholder {
    color: rgba(255, 255, 255, 0.28);
    font-weight: 400;
}
.sp-page .form-input:focus,
.sp-page .form-textarea:focus,
.support-content .form-input:focus,
.profile-content .form-input:focus,
.support-content .form-textarea:focus,
.profile-content .form-textarea:focus {
    border-color: rgba(232, 83, 58, 0.55);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(232, 83, 58, 0.12);
    outline: none;
}
.support-content .form-label,
.profile-content .form-label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Manrope', 'Unbounded', sans-serif;
}
.support-content .btn,
.profile-content .btn,
.sp-page .btn {
    border-radius: 12px;
    font-weight: 700;
    min-height: 50px;
}
.form-input--wide { width: 100%; box-sizing: border-box; }
.users-access-empty { text-align: center; padding: 24px; color: rgba(255,255,255,0.4); font-size: 0.9rem; }
.users-access-section { margin-bottom: 8px; }

/* --- Responsive --- */
@media (max-width: 1080px) {
    .sp-span-4, .sp-span-6 { grid-column: span 6; }
    .sp-span-full { grid-column: 1 / -1; }
    .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .support-nav { padding: 14px 18px; }
    .sp-page, .support-content, .profile-content, .perfs-content {
        padding: 100px 18px 56px;
    }
    .sp-page--chat { padding: 82px 12px 10px; }
    .sp-grid { grid-template-columns: 1fr; }
    .sp-span-4, .sp-span-6, .sp-span-12 { grid-column: span 1; }
    .sp-stat-row, .achievements-stats { grid-template-columns: 1fr; }
    .leaderboard-item { flex-wrap: wrap; gap: 12px; }
}
