/* ============================================================
   JSU Qabul Portal — Professional Dashboard Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary:        #3b82f6;
    --primary-dark:   #2563eb;
    --primary-light:  #eff6ff;
    --success:        #10b981;
    --success-light:  #ecfdf5;
    --warning:        #f59e0b;
    --warning-light:  #fffbeb;
    --danger:         #ef4444;
    --danger-light:   #fef2f2;
    --purple:         #8b5cf6;
    --purple-light:   #f5f3ff;

    --sidebar-bg:     #0f1728;
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-hover:  rgba(255,255,255,0.08);
    --sidebar-active: rgba(59,130,246,0.2);

    --bg:             #f1f5f9;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;

    --text-dark:      #0f172a;
    --text-medium:    #334155;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;

    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.10);
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      16px;
    --radius-xl:      20px;
}

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

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 2000;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo i { color: white; font-size: 16px; }

.sidebar-brand { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-name {
    font-size: 13px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-sub { font-size: 11px; color: var(--text-light); font-weight: 500; }

/* Nav sections */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-light);
    text-transform: uppercase;
    padding: 14px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    color: #94a3b8 !important;
    text-decoration: none !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
}

.nav-link .nav-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0 !important;
}
.nav-link:hover .nav-icon { background: rgba(255,255,255,0.1); }

.nav-link.active {
    background: var(--sidebar-active);
    color: #93c5fd !important;
}
.nav-link.active .nav-icon {
    background: rgba(59,130,246,0.25);
    color: var(--primary);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-link.nav-danger {
    color: #fca5a5 !important;
}
.nav-link.nav-danger .nav-icon { background: rgba(239,68,68,0.15); color: #fca5a5; }
.nav-link.nav-danger:hover { background: rgba(239,68,68,0.12); }

/* Sidebar footer */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 11px;
}
.sidebar-footer-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: white;
    flex-shrink: 0;
}
.sidebar-footer-info { flex: 1; min-width: 0; }
.sidebar-footer-name { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-role { font-size: 11px; color: var(--text-light); }


/* ════════════════════════════════════════
   MAIN WRAPPER
════════════════════════════════════════ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* ── Top Header ── */
.top-header {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1500;
    gap: 16px;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.hamburger-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-medium);
    transition: 0.2s;
}
.hamburger-btn:hover { background: var(--bg); color: var(--primary); }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.breadcrumb-home { color: var(--text-muted); text-decoration: none; }
.breadcrumb-sep { color: var(--text-light); font-size: 11px; }
.breadcrumb-current { font-weight: 600; color: var(--text-dark); }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-time {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-medium);
    background: var(--bg);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.header-time i { color: var(--primary); font-size: 12px; }

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer; position: relative;
    transition: 0.2s;
    background: var(--card-bg);
}
.user-chip:hover { border-color: var(--primary); background: var(--primary-light); }
.user-chip:hover .profile-dropdown { display: block; }

.user-avatar-sm {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
}
.user-chip-info { text-align: left; }
.user-chip-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.user-chip-role { font-size: 11px; color: var(--text-muted); }

.profile-dropdown {
    display: none;
    position: absolute; top: calc(100% + -1px); right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
}
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    color: var(--text-medium); text-decoration: none;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
    transition: 0.15s;
}
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }


/* ════════════════════════════════════════
   PAGE CONTENT
════════════════════════════════════════ */
.content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }


/* ════════════════════════════════════════
   STAT CARDS
════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px 22px 18px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 14px;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #ecfdf5; color: #10b981; }
.stat-icon.amber  { background: #fffbeb; color: #f59e0b; }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }

.stat-badge {
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 99px;
    display: flex; align-items: center; gap: 3px;
}
.stat-badge.up   { background: #ecfdf5; color: #10b981; }
.stat-badge.down { background: #fef2f2; color: #ef4444; }

.stat-value {
    font-size: 30px; font-weight: 800;
    color: var(--text-dark); line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12px; font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}


/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; gap: 12px;
}
.card-title {
    font-size: 15px; font-weight: 700; color: var(--text-dark);
    display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary); font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }


/* ════════════════════════════════════════
   DATA TABLE
════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: var(--bg);
    padding: 11px 16px;
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th:first-child { border-radius: 8px 0 0 8px; }
.data-table th:last-child  { border-radius: 0 8px 8px 0; }
.data-table td {
    padding: 13px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-medium);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table tr { transition: 0.15s; cursor: pointer; }
.data-table a { text-decoration: none; color: inherit; }

.td-id {
    font-weight: 700; font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 8px; border-radius: 6px;
    display: inline-block;
}
.td-name { font-weight: 600; color: var(--text-dark); font-size: 14px; }
.td-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }


/* ════════════════════════════════════════
   STATUS BADGES
════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.3px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-success { background: #ecfdf5; color: #059669; }
.badge-success::before { background: #10b981; }
.badge-info    { background: #eff6ff; color: #2563eb; }
.badge-info::before    { background: #3b82f6; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-warning::before { background: #f59e0b; }
.badge-danger  { background: #fef2f2; color: #dc2626; }
.badge-danger::before  { background: #ef4444; }


/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
}
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover  { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover   { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.4); }
.btn-secondary { background: var(--bg); color: var(--text-medium); border: 1px solid var(--border); }
.btn-secondary:hover { background: white; border-color: var(--primary); color: var(--primary); }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover    { background: #dc2626; }
.btn-ghost     { background: transparent; color: var(--text-medium); border: 1px solid var(--border); }
.btn-ghost:hover     { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }


/* ════════════════════════════════════════
   PAGINATION
════════════════════════════════════════ */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin-top: 24px;
}
.page-link {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 600; font-size: 13px;
    transition: 0.2s;
}
.page-link:hover:not(.active) { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }


/* ════════════════════════════════════════
   APP ITEMS (list style)
════════════════════════════════════════ */
.app-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--card-bg);
}
.app-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.app-item * { text-decoration: none !important; }

.app-item-avatar {
    width: 38px; height: 38px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; flex-shrink: 0;
}


/* ════════════════════════════════════════
   AVATAR
════════════════════════════════════════ */
.avatar {
    width: 40px; height: 40px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
}


/* ════════════════════════════════════════
   CHAT COMPONENTS
════════════════════════════════════════ */
.chat-card { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; }
.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    background: white; flex-shrink: 0;
}
.chat-online { width: 8px; height: 8px; background: var(--success); border-radius: 50%; border: 2px solid white; }
.chat-body {
    flex: 1; padding: 16px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    background: #f8fafc;
}
.msg {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px; line-height: 1.5;
    position: relative; font-weight: 450;
}
.msg.sent {
    align-self: flex-end;
    background: var(--primary); color: white;
    border-bottom-right-radius: 4px;
}
.msg.received {
    align-self: flex-start;
    background: white; color: var(--text-dark);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.msg-time { font-size: 11px; opacity: 0.7; margin-top: 4px; display: block; text-align: right; }
.chat-footer {
    padding: 12px 16px;
    background: white; border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-form { display: flex; gap: 10px; align-items: center; }
.chat-input {
    flex: 1; background: var(--bg); border: 1px solid var(--border);
    padding: 9px 14px; border-radius: var(--radius-md);
    outline: none; font-size: 13.5px; font-family: inherit;
    transition: 0.2s; color: var(--text-dark);
}
.chat-input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.btn-send {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary); color: white;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s; flex-shrink: 0;
}
.btn-send:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

/* FAQ chips */
.faq-section { margin-top: auto; display: flex; flex-direction: column; gap: 0; flex-shrink: 0; }
.faq-chip {
    background: white; color: var(--text-medium);
    border: none; border-top: 1px solid var(--border); border-radius: 0;
    padding: 12px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: 0.15s; text-align: left; width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-family: inherit;
}
.faq-chip:first-child { border-top: none; border-radius: 10px 10px 0 0; }
.faq-chip:last-child { border-radius: 0 0 10px 10px; }
.faq-chip:hover { background: var(--primary-light); color: var(--primary); }


/* ════════════════════════════════════════
   MESSENGER LAYOUT (Admin Chat)
════════════════════════════════════════ */
.messenger-content {
    flex: 1; display: flex; overflow: hidden;
    background: white; margin: 16px; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
    position: relative; z-index: 2;
}
.messenger-sidebar {
    width: 300px; background: white;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.messenger-sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
}
.messenger-sidebar-header h2 { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 12px; }
.search-box {
    background: var(--bg); padding: 8px 12px;
    border-radius: var(--radius-md); display: flex;
    align-items: center; gap: 8px;
    border: 1px solid var(--border); transition: 0.2s;
}
.search-box:focus-within { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.search-box i { color: var(--text-muted); font-size: 12px; }
.search-box input { border: none; background: none; outline: none; font-size: 13px; flex: 1; color: var(--text-dark); font-family: inherit; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-md);
    text-decoration: none; color: var(--text-dark);
    transition: 0.15s; margin-bottom: 2px; border: 1px solid transparent;
}
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--primary-light); border-color: rgba(59,130,246,0.15); }
.chat-info { flex: 1; min-width: 0; }
.chat-name { font-weight: 600; font-size: 13.5px; color: var(--text-dark); }
.chat-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot {
    width: 8px; height: 8px;
    background: var(--primary); border-radius: 50%; flex-shrink: 0;
}
.unread-badge {
    background: var(--primary); color: white;
    font-size: 11px; font-weight: 700;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.main-chat { flex: 1; display: flex; flex-direction: column; background: white; min-width: 0; }
.active-chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: white;
}
.messages-area {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px;
    background: #f8fafc;
}
.msg-wrapper { display: flex; flex-direction: column; max-width: 80%; }
.msg-wrapper.sent { align-self: flex-end; }
.msg-wrapper.received { align-self: flex-start; }
.input-area { padding: 14px 20px; border-top: 1px solid var(--border); background: white; }
.no-chat-placeholder {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-muted); gap: 12px;
}
.no-chat-placeholder i { font-size: 48px; color: var(--border); }


/* ════════════════════════════════════════
   STATUS BADGE (legacy compat)
════════════════════════════════════════ */
.status-badge {
    padding: 4px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
    display: inline-flex; align-items: center; gap: 5px;
}


/* ════════════════════════════════════════
   OVERLAY (mobile sidebar)
════════════════════════════════════════ */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1900;
}
.sidebar-overlay.active { display: block; }


/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed; left: -260px; height: 100vh;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 30px rgba(0,0,0,0.2);
    }
    .sidebar.active { left: 0; }
    .main-wrapper { margin-left: 0 !important; }

    .messenger-content { margin: 0 !important; border-radius: 0 !important; }
    .messenger-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex: none; max-height: 220px; }
    .chat-list { display: flex !important; flex-direction: row !important; overflow-x: auto !important; overflow-y: hidden !important; gap: 8px !important; padding: 8px !important; }
    .chat-item { flex-direction: column !important; gap: 4px !important; min-width: 64px; max-width: 64px; padding: 6px !important; align-items: center !important; border: none !important; background: transparent !important; }
    .chat-item .avatar { width: 48px !important; height: 48px !important; border-radius: 50% !important; }
    .chat-info { text-align: center; width: 100%; }
    .chat-name { font-size: 11px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-preview { display: none; }
    .messenger-content { flex-direction: column !important; height: calc(100vh - 64px) !important; }
    .main-chat { flex: 1; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .grid-2 { grid-template-columns: 1fr; }
    .content { padding: 14px; gap: 14px; }
    .card { padding: 16px; }
    .top-header { padding: 0 14px; }
    .header-time { display: none; }
    .breadcrumb { display: none; }
    .data-table .hide-mobile { display: none; }
    .app-item { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
