/* ═══════════════════════════════════════════════════════
       RESET & BASE
        ═══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/*
:root {
    --c-bg: #F8F7F4;
    --c-surface: #FFFFFF;
    --c-border: rgba(0, 0, 0, 0.08);
    --c-border-m: rgba(0, 0, 0, 0.15);
    --c-text: #1A1A18;
    --c-muted: #6B6B67;
    --c-hint: #A8A8A4;
    --c-accent: #1A1A18;
    --c-blue-bg: #EBF3FD;
    --c-blue-tx: #0C447C;
    --c-green-bg: #EAF3DE;
    --c-green-tx: #3B6D11;
    --c-amber-bg: #FDF0DA;
    --c-amber-tx: #633806;
    --c-red-bg: #FCEAEA;
    --c-red-tx: #8C1F1F;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Lato', system-ui, sans-serif;
}*/
:root {
    /* Light mode (default) */
    --bg: #EEF2FF;
    --surface: #FFFFFF;
    --surface-2: #F5F7FF;
    --surface-3: #E0E7FF;

    --border: rgba(99, 102, 241, 0.08);
    --border-md: rgba(99, 102, 241, 0.18);

    --text: #0F172A;
    --text-2: #334155;
    --text-3: #64748B;

    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-active: #3730A3;
    --primary-bg: rgba(79, 70, 229, 0.1);
    --primary-text: #4F46E5;

    --accent: #F97316;
    --accent-hover: #EA580C;
    --accent-active: #C2410C;
    --accent-bg: rgba(249, 115, 22, 0.1);
    --accent-text: #C2410C;

    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-text: #15803D;

    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #D97706;

    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #DC2626;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

    --glow-primary: 0 0 0 3px rgba(79, 70, 229, 0.2);
    --glow-accent: 0 0 0 3px rgba(249, 115, 22, 0.2);

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

    /* compat */
    --c-bg: var(--bg);
    --c-surface: var(--surface);
    --c-border: var(--border);
    --c-border-m: var(--border-md);
    --c-text: var(--text);
    --c-muted: var(--text-2);
    --c-hint: var(--text-3);
    --c-accent: var(--accent);
    --c-blue-bg: #DBEAFE;
    --c-blue-tx: #1D4ED8;
    --c-green-bg: #DCFCE7;
    --c-green-tx: #15803D;
    --c-amber-bg: #FEF3C7;
    --c-amber-tx: #D97706;
    --c-red-bg: #FEE2E2;
    --c-red-tx: #DC2626;
}

body {
    background: var(--c-bg);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: var(--font-sans);
}

textarea,
input,
select {
    font-family: var(--font-sans);
}

/* ═══════════════════════════════════════════════════════
       TOP NAVIGATION
    ═══════════════════════════════════════════════════════ */

/* ── TOPNAV ── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1.5rem;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--c-text);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.nav-logo strong {
    font-weight: 500;
}

.nav-sep {
    width: 1px;
    height: 22px;
    background: var(--c-border-m);
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    gap: 0;
    flex: 1;
}

.nav-tab {
    padding: 0 1rem;
    height: 58px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--c-muted);
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--c-text);
}

.nav-tab.active {
    color: var(--c-text);
    border-bottom-color: var(--c-text);
    font-weight: 700;
}

.nav-spacer {
    flex: 1;
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-sm);
    padding: 0 10px;
    gap: 6px;
    height: 34px;
}

.nav-search input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--c-text);
    outline: none;
    width: 200px;
}

.nav-search input::placeholder {
    color: var(--c-hint);
}

.nav-search svg {
    color: var(--c-hint);
    flex-shrink: 0;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--c-text);
    color: var(--c-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
       FLASH MESSAGES
    ═══════════════════════════════════════════════════════ */
.flash {
    max-width: 1120px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}

.flash-msg {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-success {
    background: var(--c-green-bg);
    color: var(--c-green-tx);
}

.flash-error {
    background: var(--c-red-bg);
    color: var(--c-red-tx);
}

/* ═══════════════════════════════════════════════════════
       PAGE LAYOUT
    ═══════════════════════════════════════════════════════ */
.page-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 230px;
    gap: 1.75rem;
    align-items: start;
}

/* ═══════════════════════════════════════════════════════
       SIDEBAR SHARED
    ═══════════════════════════════════════════════════════ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 74px;
}

.sidebar-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-head {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    font-family: var(--font-serif);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-muted);
    font-weight: 400;
}

.sidebar-link-all {
    font-size: 11px;
    color: var(--c-hint);
    transition: color .15s;
}

.sidebar-link-all:hover {
    color: var(--c-text);
}

/* LEFT NAV */
.nav-list {
    padding: 6px 0;
}

.nav-entry.active::before {
    background: var(--accent);
}

.nav-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--c-muted);
    transition: background .12s, color .12s;
    position: relative;
}

.nav-entry:hover {
    background: var(--c-bg);
    color: var(--c-text);
}

.nav-entry.active {
    background: var(--c-bg);
    color: var(--c-text);
    font-weight: 700;
}

.nav-entry.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--c-text);
    border-radius: 0 2px 2px 0;
}

.nav-entry svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ACTIVITY */
.activity-list {
    padding: 6px 0;
}

.activity-entry {
    padding: 10px 16px;
    border-bottom: 1px solid var(--c-border);
}

.activity-entry:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 10px;
    color: var(--c-hint);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.activity-text {
    font-size: 12px;
    color: var(--c-muted);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
       MAIN FEED
    ═══════════════════════════════════════════════════════ */
.feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ─── TABS (Feed / Forum) ─── */
.feed-tabs {
    display: flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 6px;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.feed-tab {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 400;
    color: var(--c-muted);
    transition: background .15s, color .15s;
    border: none;
    background: transparent;
}

.feed-tab:hover {
    color: var(--c-text);
    background: var(--c-bg);
}

.feed-tab.active {
    background: var(--accent);
    color: white;
}

/* ─── COMPOSER ─── */
.composer {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.composer-header {
    padding: 14px 18px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.composer-av {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-text);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.composer-label {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 400;
    color: var(--c-muted);
    font-style: italic;
}

.composer-body {
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.c-input,
.c-textarea {
    width: 100%;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 13px;
    color: var(--c-text);
    outline: none;
    resize: none;
    transition: border-color .15s, box-shadow .15s;
}

.c-input:focus,
.c-textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.c-input::placeholder,
.c-textarea::placeholder {
    color: var(--c-hint);
}

.composer-row {
    display: flex;
    gap: 8px;
}

.c-select {
    flex: 1;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 13px;
    color: var(--c-text);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.composer-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--c-bg);
}

.composer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-m);
    background: var(--c-surface);
    font-size: 12px;
    color: var(--c-muted);
    transition: color .15s, border-color .15s;
}

.upload-btn:hover {
    color: var(--c-text);
    border-color: var(--c-text);
}

.upload-btn input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.upload-btn svg {
    width: 13px;
    height: 13px;
}

#preview-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 18px 0;
}

.preview-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--c-border-m);
    background: var(--c-bg);
}

.btn-post {
    background: var(--accent);
    color: white;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: background .15s;
}

.btn-post:hover {
    background: var(--accent-hover);
}
/* ─── POST CARD ─── */
.post-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeUp .3s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 0;
}

.post-av {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-muted);
    flex-shrink: 0;
    text-transform: uppercase;
}

.post-meta {
    flex: 1;
    min-width: 0;
}

.post-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
}

.post-date {
    font-size: 11px;
    color: var(--c-hint);
    margin-top: 1px;
}

/* Dropdown options */
.post-options {
    position: relative;
}

.options-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--c-hint);
    font-size: 18px;
    line-height: 1;
    transition: background .12s, color .12s;
}

.options-btn:hover {
    background: var(--c-bg);
    color: var(--c-muted);
}

.options-menu {
    position: absolute;
    right: 0;
    top: 36px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 20;
    min-width: 170px;
    display: none;
}

.options-menu.open {
    display: block;
}

.options-menu a,
.options-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--c-muted);
    border: none;
    background: transparent;
    text-align: left;
    transition: background .1s, color .1s;
}

.options-menu a:hover,
.options-menu button:hover {
    background: var(--c-bg);
    color: var(--c-text);
}

.options-menu .danger:hover {
    background: var(--c-red-bg);
    color: var(--c-red-tx);
}

.options-menu svg {
    width: 13px;
    height: 13px;
}

/* Post category badge */
.post-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 2px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

.tag-annonce {
    background: var(--accent-bg);
    color: var(--accent);
}

.tag-inscription {
    background: var(--c-blue-bg);
    color: var(--c-blue-tx);
}

.tag-certification {
    background: var(--c-green-bg);
    color: var(--c-green-tx);
}

.tag-releve {
    background: #F3EAFD;
    color: #533AB7;
}

.tag-pvr {
    background: #FDE8F0;
    color: #8C2250;
}

.tag-rattrapage {
    background: #FEEEEA;
    color: #8C3020;
}

.tag-forum {
    background: var(--c-bg);
    color: var(--c-muted);
    border: 1px solid var(--c-border-m);
}

.tag-general {
    background: var(--c-bg);
    color: var(--c-muted);
}

.post-title-line {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--c-text);
    line-height: 1.35;
    margin-bottom: 6px;
}

.post-body {
    padding: 10px 18px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--c-muted);
}

/* Media grid */
.media-grid {
    padding: 0 18px 14px;
    display: grid;
    gap: 4px;
}

.media-grid.count-1 {
    grid-template-columns: 1fr;
}

.media-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

.media-grid.count-3 {
    grid-template-columns: 2fr 1fr;
}

.media-grid.count-3 .media-item:first-child {
    grid-row: span 2;
}

.media-grid.count-many {
    grid-template-columns: 1fr 1fr;
}

.media-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--c-bg);
    position: relative;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.media-item:hover img {
    transform: scale(1.03);
}

.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 24, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

/* Post stats row */
.post-stats {
    padding: 0 18px 10px;
    display: flex;
    gap: 1.25rem;
}

.stat-item {
    font-size: 12px;
    color: var(--c-hint);
}

.stat-item strong {
    color: var(--c-muted);
    font-weight: 700;
}

/* Post actions */
.post-actions {
    display: flex;
    border-top: 1px solid var(--c-border);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 12px;
    color: var(--c-hint);
    border: none;
    background: transparent;
    border-right: 1px solid var(--c-border);
    transition: background .12s, color .12s;
}

.action-btn:last-child {
    border-right: none;
}

.action-btn:hover {
    background: var(--c-bg);
    color: var(--c-text);
}

.action-btn.liked {
    color: #C0392B;
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

/* Comment area */
.comments-area {
    border-top: 1px solid var(--c-border);
    padding: 14px 18px;
    display: none;
}

.comments-area.open {
    display: block;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--c-muted);
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-bubble {
    background: var(--c-bg);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    padding: 8px 12px;
    flex: 1;
}

.comment-author {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.5;
}

.comment-time {
    font-size: 10px;
    color: var(--c-hint);
    margin-top: 4px;
}

.comment-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 10px;
}

.comment-form textarea {
    flex: 1;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--c-text);
    outline: none;
    resize: none;
    font-family: var(--font-sans);
    transition: border-color .15s;
    min-height: 36px;
}

.comment-form textarea:focus {
    border-color: var(--c-text);
}

.comment-form textarea::placeholder {
    color: var(--c-hint);
}

.btn-comment {
    background: var(--c-text);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    transition: opacity .15s;
    flex-shrink: 0;
}

.btn-comment:hover {
    opacity: 0.8;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: .35;
}

.empty-state h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--c-muted);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    color: var(--c-hint);
}

/* Pagination */
.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.pagination-wrap .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-m);
    background: var(--c-surface);
    font-size: 13px;
    color: var(--c-muted);
    transition: background .12s, color .12s;
}

.pagination-wrap .page-item.active .page-link {
    background: var(--c-text);
    color: #fff;
    border-color: var(--c-text);
}

.pagination-wrap .page-item .page-link:hover {
    background: var(--c-bg);
    color: var(--c-text);
}

/* ─── FORUM SECTION ─── */
.forum-header {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.forum-header h2 {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 4px;
}

.forum-header p {
    font-size: 13px;
    color: var(--c-muted);
}

.forum-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 18px;
    background: var(--c-text);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    transition: opacity .15s;
}

.forum-new-btn:hover {
    opacity: 0.82;
}

.forum-thread {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 14px;
    transition: border-color .15s;
}

.forum-thread:hover {
    border-color: var(--c-border-m);
}

.thread-av {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--c-muted);
    flex-shrink: 0;
    text-transform: uppercase;
}

.thread-main {
    flex: 1;
    min-width: 0;
}

.thread-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 4px;
}

.thread-excerpt {
    font-size: 13px;
    color: var(--c-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--c-hint);
}

.thread-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-meta-item svg {
    width: 11px;
    height: 11px;
}

/* ─── RIGHT SIDEBAR ─── */
.recent-item {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--c-border);
    transition: background .12s;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: var(--c-bg);
}

.recent-thumb {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    object-fit: cover;
    flex-shrink: 0;
}

.recent-info {
    min-width: 0;
}

.recent-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.4;
    margin-bottom: 2px;
}

.recent-time {
    font-size: 10px;
    color: var(--c-hint);
}

.members-list {
    padding: 6px 0;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    transition: background .12s;
}

.member-row:hover {
    background: var(--c-bg);
}

.member-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 1px solid var(--c-border-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--c-muted);
    flex-shrink: 0;
}

.member-name {
    font-size: 12px;
    color: var(--c-text);
}

.member-status {
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3B6D11;
    flex-shrink: 0;
}

/* ─── MODAL ─── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 24, .4);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    display: none;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
}

.modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--c-hint);
    transition: background .12s;
}

.modal-close:hover {
    background: var(--c-bg);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--c-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--c-bg);
}

.btn-secondary {
    padding: 8px 18px;
    border: 1px solid var(--c-border-m);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    font-size: 13px;
    color: var(--c-muted);
    transition: background .12s;
}

.btn-secondary:hover {
    background: var(--c-bg);
}

/* ─── EDIT FORM ─── */
.edit-form {
    display: none;
}

.edit-form.open {
    display: block;
    padding: 12px 18px;
    border-top: 1px solid var(--c-border);
}

/* ═══════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg: #0B1120;
    --surface: #111827;
    --surface-2: #1F2937;
    --surface-3: #374151;

    --border: rgba(148, 163, 184, 0.12);
    --border-md: rgba(148, 163, 184, 0.2);

    --text: #F9FAFB;
    --text-2: #CBD5F5;
    --text-3: #94A3B8;

    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-active: #1D4ED8;
    --primary-bg: rgba(59, 130, 246, 0.12);
    --primary-text: #93C5FD;

    --accent-bg: rgba(249, 115, 22, 0.12);
    --accent-text: #FDBA74;
    --success-bg: rgba(34, 197, 94, 0.12);
    --success-text: #86EFAC;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-text: #FCD34D;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-text: #FCA5A5;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.5);

    /* compat */
    --c-bg: var(--bg);
    --c-surface: var(--surface);
    --c-border: var(--border);
    --c-border-m: var(--border-md);
    --c-text: var(--text);
    --c-muted: var(--text-2);
    --c-hint: var(--text-3);
    --c-blue-bg: var(--primary-bg);
    --c-blue-tx: var(--primary-text);
    --c-green-bg: var(--success-bg);
    --c-green-tx: var(--success-text);
    --c-amber-bg: var(--warning-bg);
    --c-amber-tx: var(--warning-text);
    --c-red-bg: var(--danger-bg);
    --c-red-tx: var(--danger-text);
    --c-accent: var(--accent);
}

/* ─── THEME TOGGLE BUTTON ─── */
.theme-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .15s, border-color .2s;
    color: var(--text-3);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    transform: rotate(12deg);
}

/* ═══════════════════════════════════════════════════════
   APP SHELL — SIDEBAR LAYOUT
═══════════════════════════════════════════════════════ */
html, body { height: 100%; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── LEFT SIDEBAR ── */
.app-sidebar {
    width: 256px;
    min-width: 256px;
    background: #0F172A;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    flex-shrink: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ── SIDEBAR BRAND ── */
.sidebar-brand {
    padding: 22px 20px 18px;
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.sidebar-brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

/* ── SIDEBAR MENU ── */
.sidebar-menu {
    flex: 1;
    padding: 4px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    transition: background .15s, color .15s;
    text-decoration: none;
    cursor: pointer;
}

.menu-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.menu-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

/* ── SIDEBAR DECO ── */
.sidebar-deco {
    padding: 10px 20px 4px;
    display: flex;
    justify-content: center;
    opacity: 0.18;
    flex-shrink: 0;
}

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user-av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(79,70,229,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    flex: 1;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ── FLASH BAR ── */
.flash-bar {
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-bar-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-bottom: 1px solid rgba(34,197,94,0.15);
}

.flash-bar-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-bottom: 1px solid rgba(239,68,68,0.15);
}

/* ═══════════════════════════════════════════════════════
   PAGE TOPBAR (inner search bar)
═══════════════════════════════════════════════════════ */
.page-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar-search {
    flex: 1;
    max-width: 480px;
    background: var(--surface-2);
    border: 1px solid var(--border-md);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 40px;
    transition: border-color .15s, box-shadow .15s;
}

.topbar-search:focus-within {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.topbar-search input {
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text);
    outline: none;
    flex: 1;
    font-family: var(--font-sans);
}

.topbar-search input::placeholder { color: var(--text-3); }
.topbar-search svg { color: var(--text-3); flex-shrink: 0; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-md);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    transition: background .15s, color .15s;
    cursor: pointer;
    flex-shrink: 0;
}

.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text); }

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════
   HOME PAGE LAYOUT
═══════════════════════════════════════════════════════ */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 288px;
    gap: 20px;
    padding: 20px 24px 32px;
    align-items: start;
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ── HERO BANNER ── */
.hero-banner {
    background: linear-gradient(130deg, #0F172A 0%, #1e3a6e 55%, #1e1b4b 100%);
    border-radius: 18px;
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    min-height: 148px;
}

.hero-text h2 {
    font-size: 26px;
    font-weight: 400;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
    font-family: var(--font-sans);
}

.hero-text h2 strong { font-weight: 700; }

.hero-text p {
    font-size: 17px;
    color: rgba(255,255,255,0.72);
}

.hero-img-wrap {
    width: 170px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0.88;
}

.hero-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── QUICK CARDS ── */
.quick-cards {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.quick-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-card-icon.indigo  { background: rgba(79,70,229,0.1);  color: #4F46E5; }
.quick-card-icon.rose    { background: rgba(239,68,68,0.1);  color: #EF4444; }
.quick-card-icon.amber   { background: rgba(245,158,11,0.1); color: #D97706; }

.quick-card-more {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.quick-card-sub {
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
}

.quick-card-detail {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.5;
    margin-top: 2px;
}

/* ── SECTION HEADING ── */
.section-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════
   HOME RIGHT SIDEBAR
═══════════════════════════════════════════════════════ */
.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.panel-card-head {
    padding: 13px 16px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.panel-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-col-heads {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
}

.demarche-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demarche-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.demarche-info { flex: 1; min-width: 0; }

.demarche-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demarche-sub {
    font-size: 11px;
    color: var(--text-3);
}

.demarche-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    flex-shrink: 0;
}

.badge-green  { background: rgba(34,197,94,0.12); color: #16A34A; }
.badge-amber  { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-blue   { background: rgba(79,70,229,0.12);  color: #4F46E5; }

.msg-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 2px 0;
}

.msg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.msg-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-2);
    flex-shrink: 0;
    position: relative;
}

.msg-info { flex: 1; min-width: 0; }

.msg-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.msg-status-txt {
    font-size: 11px;
    color: var(--text-3);
}

.msg-online {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--surface);
    position: absolute;
    bottom: 0;
    right: 0;
}

.msg-online.green { background: #22C55E; }
.msg-online.amber { background: #F59E0B; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar { position: static; }
}

@media (max-width: 860px) {
    .app-sidebar { display: none; }
    .quick-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
    .quick-cards { grid-template-columns: 1fr; }
    .hero-img-wrap { display: none; }
    .home-layout { padding: 12px 14px 24px; }
}

/* ═══════════════════════════════════════════════════════
       CHATBOT WIDGET
    ═══════════════════════════════════════════════════════ */

.chatbot-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ── FAB ── */
.chatbot-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(79, 70, 229, 0.55);
}

.chatbot-fab:active {
    transform: scale(0.96);
}

.chatbot-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-fab-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

/* ── WINDOW ── */
.chatbot-window {
    width: 360px;
    max-height: 520px;
    background: var(--surface);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* hidden state */
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.chatbot-window--open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* ── HEADER ── */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-header-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.chatbot-header-status {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

.chatbot-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ADE80;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
}

.chatbot-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

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

/* ── MESSAGES ── */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.chatbot-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chatbot-msg--bot {
    align-self: flex-start;
    align-items: flex-start;
}

.chatbot-msg--user {
    align-self: flex-end;
    align-items: flex-end;
}

.chatbot-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.chatbot-msg--bot .chatbot-msg-bubble {
    background: var(--surface-2);
    color: var(--text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.chatbot-msg--user .chatbot-msg-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chatbot-msg-time {
    font-size: 10.5px;
    color: var(--text-3);
    margin-top: 3px;
    padding: 0 2px;
}

/* ── SUGGESTIONS ── */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    padding-left: 2px;
}

.chatbot-suggestion-chip {
    background: var(--primary-bg);
    color: var(--primary-text);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.chatbot-suggestion-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── TYPING INDICATOR ── */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    display: inline-block;
    animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* ── INPUT AREA ── */
.chatbot-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--border-md);
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface-2);
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.15s;
}

.chatbot-input:focus {
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.chatbot-input::placeholder {
    color: var(--text-3);
}

.chatbot-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}

.chatbot-send:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: scale(1.06);
}

.chatbot-send:disabled {
    background: var(--surface-3);
    color: var(--text-3);
    cursor: not-allowed;
}

/* ── DARK MODE ── */
[data-theme="dark"] .chatbot-window {
    background: var(--surface);
    border-color: var(--border-md);
}

[data-theme="dark"] .chatbot-input {
    background: var(--surface-2);
    color: var(--text);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 16px;
        right: 16px;
    }
    .chatbot-window {
        width: calc(100vw - 32px);
        max-height: 70vh;
    }
}
