:root {
    --sidebar-width: 220px;
    --primary: #0d6efd;
}

* { box-sizing: border-box; }

body {
    font-size: 0.95rem;
    background: #f4f6f9;
    color: #1e293b;
}

/* ---------- Layout ---------- */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar .nav-link {
    color: #cbd5e1;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(13, 110, 253, 0.2);
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .nav-link { color: #cbd5e1; }

.content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    flex: 1;
    max-width: 1200px;
}

/* ---------- Page head ---------- */
.page-head {
    margin-bottom: 1.5rem;
}

.page-head h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid #eef2f6;
}

/* ---------- Stats ---------- */
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    opacity: 0.85;
}

/* ---------- Chat ---------- */
.chat-msg {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
}

.chat-msg.org2in { background: #fffbeb; }

.chat-meta { margin-bottom: 0.4rem; }

.chat-text { white-space: pre-wrap; }

/* ---------- Media thumbs ---------- */
.thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.media-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    background: #000;
}

.media-caption {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

/* ---------- Login ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #111827, #1f2937);
}

.login-card {
    width: 360px;
    border-radius: 14px;
}

/* ---------- Tables ---------- */
.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #eef2f6;
}
