/* Base styles – tokens in theme.css (load after this file) */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}


/* ─── AUTH PAGES ─────────────────────────────── */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s var(--transition) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.auth-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo .logo-icon svg {
    color: #fff;
}

.auth-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--input-bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 50%, #7c3aed 100%);
    background-size: 200% 200%;
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 14px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-position: 100% 50%;
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    width: auto;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.06);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}


/* ─── ALERTS ─────────────────────────────────── */

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

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


/* ─── APP LAYOUT ─────────────────────────────── */

.app-layout {
    display: flex;
    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    width: var(--sidebar-w);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.25rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    color: #fff;
}

.sidebar-brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sidebar-brand);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding: 0.5rem 0.6rem 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.75rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    color: #fff;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--sidebar-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    transition: background var(--transition);
}

.user-info:hover {
    background: var(--sidebar-hover);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sidebar-text-active);
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-soft);
}


/* MAIN CONTENT */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* TOPBAR */

.topbar {
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    position: absolute;
    top: -2px;
    right: -2px;
    border: 2px solid var(--surface);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7
    }
}


/* PAGE CONTENT */

.page-body {
    padding: 1.75rem 2rem;
    flex: 1;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}


/* ─── CARDS ──────────────────────────────────── */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

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

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.card-body {
    padding: 1.25rem;
}


/* STAT CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.indigo {
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.12);
    color: var(--secondary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.stat-icon.amber {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}


/* ACTIVITY LIST */

.activite-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.activite-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow var(--transition), border-color var(--transition);
    animation: fadeIn 0.3s ease both;
}

.activite-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.activite-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-pending {
    background: var(--warning);
}

.dot-progress {
    background: var(--primary);
}

.dot-done {
    background: var(--success);
}

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

.activite-label {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activite-meta {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-high {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-medium {
    background: #fffbeb;
    color: #92400e;
}

.badge-low {
    background: #f0fdf4;
    color: #166534;
}


/* FORM CARD */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}


/* NOTIFICATION LIST */

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background var(--transition);
}

.notif-item.unread {
    border-left: 3px solid var(--primary);
    background: rgba(79, 70, 229, 0.03);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-text {
    font-size: 0.875rem;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}


/* TOAST */

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    min-width: 260px;
    max-width: 340px;
    background: var(--toast-bg);
    color: var(--toast-text);
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: all;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.toast.out {
    animation: toastOut 0.25s ease both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: none;
    }
    to {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-info {
    border-left: 3px solid var(--primary);
}

.toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-success .toast-dot {
    background: var(--success);
}

.toast-error .toast-dot {
    background: var(--danger);
}

.toast-info .toast-dot {
    background: var(--primary);
}


/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(12px);
    transition: transform var(--transition), opacity var(--transition);
}

.modal-overlay.open .modal {
    transform: none;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--border);
}


/* SIDEBAR TOGGLE (mobile) */

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    color: var(--text-muted);
}


/* BREADCRUMB */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.breadcrumb span:last-child {
    color: var(--text);
    font-weight: 600;
}

.breadcrumb-sep {
    color: var(--border);
}


/* EMPTY STATE */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}


/* PROGRESS BAR (page load) */

#nprogress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    z-index: 9998;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: 0 2px 2px 0;
}


/* SKELETON LOADER */

.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0
    }
    100% {
        background-position: -200% 0
    }
}


/* RESPONSIVE */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .page-body {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ─── SOCIAL – AMIS ──────────────────────────── */

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

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

.search-result-item:hover {
    background: var(--bg);
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

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

.user-info-sm .name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info-sm .handle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow var(--transition);
}

.friend-card:hover {
    box-shadow: var(--shadow-md);
}

.friend-card .actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
}

.tab-bar {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 9px;
    padding: 3px;
    margin-bottom: 1.25rem;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.tab-panel {
    display: none;
}

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


/* ─── SOCIAL – CHAT ──────────────────────────── */

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    height: calc(100vh - 60px - 3.5rem);
    min-height: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chat-sidebar {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.95rem;
}

.conv-list {
    flex: 1;
    overflow-y: auto;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

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

.conv-item.active {
    background: rgba(79, 70, 229, 0.06);
    border-left: 3px solid var(--primary);
}

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

.conv-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.conv-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-active {
    display: none;
    height: 100%;
}

#chat-active.visible {
    display: flex;
}

.chat-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fafafa;
}

.chat-header .name {
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--success);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg);
}

.chat-bubble-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    max-width: 72%;
}

.chat-bubble-wrap.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px 12px 12px 2px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: var(--shadow);
    max-width: 100%;
    word-break: break-word;
}

.chat-bubble-wrap.me .chat-bubble {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    border-radius: 12px 12px 2px 12px;
}

.bubble-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chat-bubble-wrap.me .bubble-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-bar {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.6rem;
    background: var(--surface);
}

.chat-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.chat-send-btn:active {
    transform: scale(0.92);
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }
    .chat-sidebar {
        display: block;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 125px);
        overflow-y: auto;
    }
    .chat-main {
        display: none;
    }
    .chat-layout.mobile-chat-active .chat-sidebar {
        display: none;
    }
    .chat-layout.mobile-chat-active .chat-main {
        display: flex;
    }
    .chat-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        font-size: 0.75rem;
    }
}

.chat-back-btn {
    display: none;
}


/* ─── SOCIAL – POSTS / FEED ──────────────────── */

.feed-compose {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}

.compose-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.compose-textarea {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    resize: none;
    font-family: inherit;
    outline: none;
    min-height: 80px;
    transition: border-color var(--transition);
}

.compose-textarea:focus {
    border-color: var(--primary);
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compose-opts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.compose-opts select {
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    background: var(--bg);
    cursor: pointer;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: box-shadow var(--transition);
    animation: fadeIn 0.3s ease both;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem 0;
}

.post-body {
    padding: 0.6rem 1.1rem 0.9rem;
}

.post-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.post-content {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.55;
    white-space: pre-wrap;
}

.post-footer {
    padding: 0.6rem 1.1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.post-activite-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-radius: 99px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.visibility-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.feed-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skel-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
}

.skel-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.skel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.skel-line {
    height: 12px;
    border-radius: 4px;
}