:root {
    color-scheme: dark;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #0e1114;
    color: #e7e7e7;
}
.post-content {
    white-space: pre-wrap;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.7;
}


.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.topbar {
    background: #11161b;
    border-bottom: 1px solid #222a33;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

.brand {
    color: #7db5ff;
    text-decoration: none;
    font-weight: 700;
}

.links a, .footlinks a, .auth a {
    color: #cfd6dd;
    text-decoration: none;
    margin-right: 12px;
}

    .links a:hover, .auth a:hover, .footlinks a:hover {
        color: #fff;
    }

.page {
    padding: 22px 16px;
}

.footer {
    border-top: 1px solid #222a33;
    background: #0b0e11;
    margin-top: 40px;
}

.foot {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    color: #9aa7b2;
}

.card {
    background: #121820;
    border: 1px solid #222a33;
    border-radius: 12px;
    padding: 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
    .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
}

.btn {
    background: #2f78d8;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
}

    .btn:hover {
        filter: brightness(1.06);
    }

.btn-link {
    background: transparent;
    border: 0;
    color: #cfd6dd;
    cursor: pointer;
}

.inline {
    display: inline;
}

.input, textarea, select {
    width: 100%;
    background: #0f141a;
    color: #e7e7e7;
    border: 1px solid #2a3440;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
}

label {
    display: block;
    margin: 10px 0 6px;
    color: #b7c0c9;
}

.toast {
    background: #16304a;
    border: 1px solid #2f78d8;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.hr {
    border-top: 1px solid #222a33;
    margin: 14px 0;
}

.small {
    color: #9aa7b2;
    font-size: 0.92rem;
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

    .card-link:hover {
        filter: brightness(1.05);
    }

/* ---- FOOTER (public only) ---- */
.site-footer {
    margin-top: 48px;
    background: #0b0e11;
    border-top: 1px solid #222a33;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    padding: 26px 0;
    align-items: start;
}

.footer-brand {
    max-width: 420px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.footer-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a3440;
    border-radius: 8px;
    color: #7db5ff;
    font-weight: 800;
}

.footer-name {
    font-weight: 700;
    color: #cfd6dd;
}

.footer-desc {
    margin: 0 0 12px 0;
    color: #9aa7b2;
    font-size: 0.95rem;
    line-height: 1.4;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a3440;
    border-radius: 8px;
    color: #cfd6dd;
    text-decoration: none;
    font-weight: 700;
    opacity: 0.9;
}

    .social:hover {
        opacity: 1;
        filter: brightness(1.1);
    }

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-title {
    color: #cfd6dd;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-col a {
    color: #9aa7b2;
    text-decoration: none;
}

    .footer-col a:hover {
        color: #ffffff;
    }

.footer-bottom {
    border-top: 1px solid #222a33;
}

.footer-copy {
    padding: 14px 0;
    color: #9aa7b2;
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- STAFF DASHBOARD ---- */
.staff-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    min-height: calc(100vh - 140px);
}

.staff-sidebar {
    background: #0b0e11;
    border: 1px solid #222a33;
    border-radius: 16px;
    padding: 16px;
}

.staff-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #cfd6dd;
}

.staff-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2f78d8;
}

.staff-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-link {
    display: block;
    padding: 10px 10px;
    border-radius: 12px;
    color: #cfd6dd;
    text-decoration: none;
    border: 1px solid transparent;
    opacity: .9;
}

    .staff-link:hover {
        opacity: 1;
        border-color: #222a33;
        background: #10151b;
    }

    .staff-link.active {
        background: #101a26;
        border-color: #2a3440;
    }

.staff-bottom {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #222a33;
}

.staff-main {
    padding: 6px 0;
}

.staff-stats {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
    margin-top: 10px;
}

.staff-num {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 6px;
}

.staff-comment-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
}

.staff-comment-head {
    display: flex;
    gap: 10px;
    align-items: center;
}

.staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #222a33;
}

.staff-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #222a33;
}

.staff-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
}

    .staff-table th, .staff-table td {
        padding: 12px 10px;
        border-bottom: 1px solid #222a33;
        text-align: left;
    }

    .staff-table th {
        color: #9aa7b2;
        font-weight: 700;
    }

.staff-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .85rem;
    border: 1px solid #2a3440;
    color: #cfd6dd;
}

    .staff-pill.active {
        opacity: .95;
    }

    .staff-pill.suspended {
        border-color: #6b2b2b;
        color: #ffb4b4;
    }

@media (max-width: 1100px) {
    .staff-stats {
        grid-template-columns: repeat(2,1fr);
    }

    .staff-comment-grid {
        grid-template-columns: 1fr;
    }

    .staff-shell {
        grid-template-columns: 1fr;
    }
}

.staff-pill.active {
    border-color: #2a3440;
    color: #cfd6dd;
    opacity: .95;
}

/* ---- ADMIN DASHBOARD ---- */
.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    min-height: calc(100vh - 140px);
}

.admin-sidebar {
    background: #0b0e11;
    border: 1px solid #222a33;
    border-radius: 16px;
    padding: 16px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #cfd6dd;
}

.admin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2f78d8;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-link {
    display: block;
    padding: 10px 10px;
    border-radius: 12px;
    color: #cfd6dd;
    text-decoration: none;
    border: 1px solid transparent;
    opacity: .9;
}

    .admin-link:hover {
        opacity: 1;
        border-color: #222a33;
        background: #10151b;
    }

    .admin-link.active {
        background: #101a26;
        border-color: #2a3440;
    }

.admin-main {
    padding: 6px 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
    margin-top: 10px;
}

.admin-num {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 6px;
}

.admin-two {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

    .admin-table th, .admin-table td {
        padding: 12px 10px;
        border-bottom: 1px solid #222a33;
        text-align: left;
    }

    .admin-table th {
        color: #9aa7b2;
        font-weight: 700;
    }

.admin-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #222a33;
}

@media (max-width: 1100px) {
    .admin-stats {
        grid-template-columns: repeat(2,1fr);
    }

    .admin-two {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }
}

/* ---- ADMIN PANELS (exact look) ---- */
.admin-panel {
    padding: 18px;
}

.admin-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.admin-roleform {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-select {
    width: 120px;
}

.btn-pill {
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 600;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-postcard {
    background: #10161d;
    border: 1px solid #222a33;
    border-radius: 14px;
    padding: 18px;
}

.admin-posttitle {
    margin: 10px 0 6px;
    font-size: 1.25rem;
}

.admin-postactions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.admin-rolecard {
    background: #10161d;
    border: 1px solid #222a33;
    border-radius: 14px;
    padding: 18px;
}

/* ---- Membership pill color variants ---- */
.staff-pill.membership.basic {
    background: #e5e7eb;
    color: #111;
}

.staff-pill.membership.gold {
    background: #ffd700;
    color: #000;
}

.staff-pill.membership.vip {
    background: #7b2cff;
    color: white;
}

.staff-pill.membership.platinum {
    background: #0f172a;
    color: white;
}

/* ---- Action buttons (Edit / Suspend) ---- */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 38px;
    padding: 0 16px;
    background: #2f78d8;
    color: #fff;
    border-radius: 14px;
    /* White outline for better contrast (as in the reference screenshot) */
    border: 1.5px solid rgba(255,255,255,0.85);
    /* Subtle lift */
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), 0 2px 6px rgba(0,0,0,0.35);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

    .btn-action:hover {
        filter: brightness(1.08);
    }

    .btn-action:active {
        transform: translateY(1px);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.4);
    }

/* ---- Burger menu (mobile) ---- */
.burger {
    display: none;
    width: 44px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #222a33;
    background: #0f141a;
    padding: 8px 10px;
    cursor: pointer;
}

    .burger span {
        display: block;
        height: 2px;
        background: #cfd6dd;
        margin: 6px 0;
        border-radius: 2px;
    }

/* Mobile dropdown container */
.mobile-menu {
    display: none;
    margin-top: 10px;
    background: #11161b;
    border: 1px solid #222a33;
    border-radius: 16px;
    padding: 12px;
}

    .mobile-menu.open {
        display: block;
    }

.mobile-links, .mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .mobile-links a, .mobile-auth a {
        color: #cfd6dd;
        text-decoration: none;
        padding: 10px 10px;
        border-radius: 12px;
    }

        .mobile-links a:hover, .mobile-auth a:hover {
            background: #10151b;
        }

/* Desktop default */
@media (max-width: 768px) {
    .burger {
        display: inline-block;
    }

    /* Hide desktop menu on mobile */
    #desktopNav,
    #desktopAuth {
        display: none;
    }
}

/* ---- Compact actions in tables ---- */
.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.actions-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Wrap nicely on small screens */
    justify-content: flex-end;
}

.action-btn {
    padding: 8px 12px;
    border-radius: 12px;
}

/* Action select (scoped to action area; not global select styles) */
.action-select {
    width: 140px;
    min-width: 120px;
    max-width: 160px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #0f141a;
    color: #e7e7e7;
    border: 1px solid #2a3440;
    box-sizing: border-box;
}

/* ---- Comment rank badges ---- */
.rank-badge {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border: 1px solid #222a33;
    opacity: .95;
    line-height: 18px;
}

.rank-admin {
    background: #c0392b;
}

.rank-staff {
    background: #2f78d8;
}

.rank-basic {
    background: #7f8c8d;
}

.rank-gold {
    background: #f1c40f;
    color: #000;
}

.rank-vip {
    background: #8e44ad;
}

.rank-platinum {
    background: #1abc9c;
}

.lvl-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #222a33;
    opacity: .85;
}

.pending-icon {
    margin-left: 8px;
    display: inline-flex;
    vertical-align: middle;
    transform: translateY(1px);
}

/* ---- Messages table: prevent column collapsing; allow horizontal scroll inside card ---- */
.admin-table-messages {
    min-width: 980px;
    table-layout: fixed;
}

    /* Column widths (via colgroup classes) */
    .admin-table-messages .col-name {
        width: 160px;
    }

    .admin-table-messages .col-email {
        width: 260px;
    }

    .admin-table-messages .col-date {
        width: 170px;
    }

    .admin-table-messages .col-actions {
        width: 130px;
    }
/* col-message takes remaining space */

/* Email ellipsis */
.email-cell {
    white-space: nowrap;
}

.email-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Message wraps normally */
.admin-table-messages td.message-col {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* "View" summary should not wrap */
.msg-summary {
    white-space: nowrap;
    display: inline-flex;
}
/* Smaller buttons/selects in Users tab */
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.1;
}

/* Red-ish danger button (keeps your theme, just more warning) */
.btn-danger {
    border-color: rgba(255, 59, 48, .35);
    background: rgba(255, 59, 48, .10);
    color: #ff3b30;
}

/* Users actions layout: stack on left, role on right */
.actions-users {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 12px;
}

/* Vertical stack for Edit/Suspend/Delete */
.actions-users-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

/* Role block */
.actions-users-role {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Smaller select */
.action-select-sm {
    height: 32px;
    font-size: 12px;
    padding: 4px 10px;
    min-width: 130px;
}

/* Make Actions column a bit tighter but still fits */
.admin-table-users .u-col-actions {
    width: 360px;
}
