:root {
    --bg: #070a12;
    --panel: rgba(255, 255, 255, 0.075);
    --panel-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.13);
    --text: #f4f7fb;
    --muted: #9ca7bb;
    --primary: #7c5cff;
    --primary2: #00d4ff;
    --danger: #ff5c7a;
    --success: #31d09b;
    --warning: #ffcb66;
    --shadow: 0 20px 60px rgba(0,0,0,.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.35), transparent 34%),
        radial-gradient(circle at top right, rgba(0, 212, 255, 0.22), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

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

button, input, textarea {
    font: inherit;
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.auth-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 7px;
    color: var(--muted);
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    background: rgba(255,255,255,.075);
    padding: 13px 14px;
    outline: none;
}

.form-control:focus {
    border-color: rgba(124,92,255,.75);
    box-shadow: 0 0 0 4px rgba(124,92,255,.16);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    font-weight: 700;
}

.btn.full {
    width: 100%;
}

.btn.danger {
    background: linear-gradient(135deg, #ff5c7a, #ff8f6b);
}

.btn.success {
    background: linear-gradient(135deg, #31d09b, #00d4ff);
}

.btn.ghost {
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border);
}

.alert {
    padding: 13px 14px;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.08);
}

.alert.error {
    border-color: rgba(255, 92, 122, .45);
    color: #ffd6dd;
}

.alert.success {
    border-color: rgba(49, 208, 155, .45);
    color: #d9fff3;
}

.auth-link {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
}

.auth-link a {
    color: white;
    font-weight: 700;
}

.app-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 700px) 330px;
    gap: 20px;
    width: min(1380px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    padding: 18px;
}

.sidebar {
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    border: 1px solid var(--border);
    border-radius: 30px;
    background: rgba(255,255,255,.07);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    font-weight: 900;
}

.brand-title {
    font-size: 21px;
    font-weight: 900;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 17px;
    color: var(--muted);
    font-weight: 700;
}

.side-nav a:hover,
.side-nav a.active {
    color: white;
    background: rgba(255,255,255,.10);
}

.side-nav span {
    width: 22px;
    text-align: center;
}

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

.sidebar-user {
    margin-top: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.065);
    border-radius: 20px;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-info strong,
.sidebar-user-info span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    color: var(--muted);
    font-size: 13px;
}

.logout-btn {
    margin-top: 12px;
    display: block;
    padding: 12px;
    border-radius: 16px;
    text-align: center;
    color: #ffd6dd;
    background: rgba(255, 92, 122, .12);
    border: 1px solid rgba(255, 92, 122, .25);
    font-weight: 800;
}

.main-column {
    min-width: 0;
}

.page-header {
    position: sticky;
    top: 18px;
    z-index: 4;
    padding: 18px 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(7,10,18,.75);
    backdrop-filter: blur(16px);
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

.page-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.card {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 15px;
}

.create-post textarea {
    min-height: 100px;
    resize: vertical;
}

.create-post-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.post-card {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 15px;
}

.post-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-sm,
.avatar-md,
.avatar-lg {
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: white;
    font-weight: 900;
}

.avatar-sm {
    width: 42px;
    height: 42px;
    border-radius: 15px;
}

.avatar-md {
    width: 52px;
    height: 52px;
    border-radius: 18px;
}

.avatar-lg {
    width: 92px;
    height: 92px;
    border-radius: 30px;
    font-size: 34px;
}

.avatar-sm img,
.avatar-md img,
.avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-name {
    font-weight: 900;
}

.post-meta {
    color: var(--muted);
    font-size: 13px;
}

.post-content {
    margin-top: 14px;
    line-height: 1.55;
}

.post-image-wrap {
    margin-top: 14px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.18);
}

.post-image {
    width: 100%;
    display: block;
    max-height: 650px;
    object-fit: cover;
}

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

.action-btn {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.075);
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 13px;
    cursor: pointer;
    font-weight: 800;
}

.action-btn:hover,
.action-btn.liked {
    color: white;
    background: rgba(124,92,255,.2);
}

.comments-box {
    display: none;
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 13px;
}

.comments-box.show {
    display: block;
}

.comment-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.comment-item span {
    color: var(--muted);
    font-size: 13px;
}

.comment-item p {
    margin: 5px 0 0;
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.comment-form input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: white;
    background: rgba(255,255,255,.075);
    padding: 10px 13px;
    outline: none;
}

.comment-form button {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.right-column {
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    overflow: auto;
}

.widget h3 {
    margin: 0 0 12px;
}

.trend-item,
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.trend-item:last-child,
.user-row:last-child {
    border-bottom: 0;
}

.trend-item span,
.user-row span {
    color: var(--muted);
    font-size: 13px;
}

.profile-cover {
    height: 150px;
    border-radius: 26px;
    background:
        radial-gradient(circle at 20% 20%, rgba(124,92,255,.85), transparent 28%),
        radial-gradient(circle at 80% 40%, rgba(0,212,255,.7), transparent 32%),
        rgba(255,255,255,.06);
    border: 1px solid var(--border);
}

.profile-info {
    margin-top: -48px;
    padding: 0 18px 18px;
}

.profile-name-row {
    margin-top: 10px;
}

.profile-name-row h2 {
    margin: 0;
}

.profile-name-row span {
    color: var(--muted);
}

.profile-bio {
    color: var(--text);
    margin-top: 10px;
    line-height: 1.55;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,.1);
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status.pending {
    background: rgba(255, 203, 102, .14);
    color: #ffe3a2;
}

.status.approved {
    background: rgba(49, 208, 155, .14);
    color: #c7ffee;
}

.status.rejected {
    background: rgba(255, 92, 122, .14);
    color: #ffd6dd;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-actions form {
    margin: 0;
}

.showid-img {
    width: 90px;
    height: 62px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 1120px) {
    .app-layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .right-column {
        display: none;
    }
}

@media (max-width: 760px) {
    .app-layout {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-radius: 24px;
    }

    .side-nav {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        top: 10px;
    }
}
