* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #f44336;
}

/* Dark Theme */
body.dark-theme {
    --card-bg: #2a2a2a;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --border-color: #404040;
    --light-bg: #1a1a1a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Authentication Page */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-page.hidden {
    display: none;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 32px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: var(--card-bg);
    color: var(--text-dark);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-auth:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-auth:active {
    transform: translateY(0);
}

.auth-switch {
    text-align: center;
    margin-top: 18px;
    color: var(--text-light);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-error {
    margin-top: 15px;
    padding: 12px;
    background: #ffe0e0;
    color: #d32f2f;
    border-radius: 8px;
    display: none;
    font-size: 14px;
    border-left: 4px solid #d32f2f;
}

.auth-error.show {
    display: block;
}

.auth-loading {
    text-align: center;
    color: var(--text-light);
    margin-top: 15px;
    display: none;
}

.auth-loading.show {
    display: block;
}

.auth-loading::after {
    content: '...';
    animation: dots 1s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo {
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.logo h2 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 16px;
}

.nav-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 15px;
    font-size: 20px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--light-bg);
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header-left h1 {
    font-size: 28px;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

.notification-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.notification-btn:hover {
    transform: scale(1.2);
}

.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    transform: scale(1.2) rotate(20deg);
}

.logout-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    transform: scale(1.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Pages Container */
.pages-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    display: inline-block;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 18px;
}

.chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 10px;
}

.bar {
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 5px 5px 0 0;
    flex: 1;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.bar:hover {
    transform: scaleY(1.05);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    gap: 15px;
    align-items: start;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.activity-item:hover {
    background: #efefef;
}

body.dark-theme .activity-item:hover {
    background: #353535;
}

.activity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.activity-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.activity-info span {
    font-size: 12px;
    color: var(--text-light);
}

/* Analytics Page */
.analytics-content h2 {
    margin-bottom: 25px;
    font-size: 24px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.analytics-card h4 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.analytics-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.progress-bar {
    height: 8px;
    background: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
}

body.dark-theme .progress-bar {
    background: #353535;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Profile Page */
.profile-content {
    max-width: 600px;
}

.profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-header img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
}

.profile-picture-container img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.btn-upload-photo {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.btn-upload-photo:hover {
    transform: scale(1.1);
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: var(--secondary-color, #6c757d);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

.profile-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.profile-info p {
    color: var(--text-light);
    margin-bottom: 4px;
}

.profile-info .email {
    font-size: 14px;
}

.profile-details {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item label {
    font-weight: 600;
    color: var(--text-dark);
}

.detail-item p {
    color: var(--text-light);
}

/* Settings Page */
.settings-content h2 {
    margin-bottom: 30px;
    font-size: 24px;
}

.settings-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.settings-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-dark);
}

.setting-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-item select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Chat Page */
.chat-container {
    display: flex;
    height: calc(100vh - 140px);
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 18px;
    margin: 0;
}

.new-chat-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.new-chat-btn:hover {
    transform: rotate(90deg);
}

.chat-search {
    margin: 10px 15px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--light-bg);
    color: var(--text-dark);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    width: calc(100% - 40px);
    box-sizing: border-box;
}

.chat-search:focus {
    border-color: var(--primary-color);
    background: white;
}

.chat-search::placeholder {
    color: var(--text-light);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    align-items: flex-start;
}

.chat-item:hover {
    background: var(--light-bg);
}

.chat-item.active {
    background: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
}

.chat-avatar-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.user-email-small {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.status-indicator.online {
    background: #31a24c;
    animation: pulse-green 2s infinite;
}

.status-indicator.offline {
    background: #8b8b8b;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 4px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 0 8px rgba(49, 162, 76, 0.6);
    }
}

.chat-preview {
    flex: 1;
    min-width: 0;
}

.chat-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    font-size: 12px;
    line-height: 1;
}

.status-badge.online {
    color: #31a24c;
}

.status-badge.offline {
    color: #8b8b8b;
}

.chat-message {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-top {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-user-info h3 {
    margin: 0;
    font-size: 16px;
}

.chat-user-info p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--text-light);
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.chat-action-btn:hover {
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    margin-bottom: 10px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 10px;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: var(--primary-color);
    color: white;
}

.message.received .message-content {
    background: var(--light-bg);
    color: var(--text-dark);
}

.message-content p {
    margin: 0 0 6px 0;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    margin-top: 4px;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.2);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Dark Theme Specific Styles */
body.dark-theme .chat-avatar {
    background: #353535;
    color: #e0e0e0;
}

body.dark-theme .chat-info h4 {
    color: #e0e0e0;
}

body.dark-theme .chat-search {
    background: #353535;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-theme .chat-search:focus {
    border-color: var(--primary-color);
    background: #353535;
}

body.dark-theme .chat-search::placeholder {
    color: #888;
}

body.dark-theme .message.received .message-content {
    background: #353535;
    color: #e0e0e0;
}

body.dark-theme .chat-item:hover,
body.dark-theme .chat-item.active {
    background: #353535;
}

body.dark-theme .statement-item {
    background: #353535;
}

body.dark-theme .search-box {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-theme .search-box::placeholder {
    color: #808080;
}

body.dark-theme .search-box:focus {
    border-color: #4CAF50;
}

body.dark-theme .chat-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-theme .chat-input::placeholder {
    color: #808080;
}

body.dark-theme .chat-input:focus {
    border-color: #4CAF50;
}

body.dark-theme select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-theme option {
    background: #2a2a2a;
    color: #e0e0e0;
}

/* Dark Theme Auth Form */
body.dark-theme .form-group input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-theme .form-group input::placeholder {
    color: #808080;
}

body.dark-theme .form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

body.dark-theme .auth-error {
    background: #5c2626;
    color: #ff6b6b;
}

body.dark-theme .btn-upload-photo {
    background: var(--primary-color);
}

body.dark-theme .btn-secondary {
    background: #6c757d;
    color: white;
}

/* Scrollbar Dark Theme */
body.dark-theme ::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-right {
        gap: 10px;
    }
    
    .search-box {
        width: 150px;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .logo {
        padding: 15px 20px;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
        min-width: 200px;
        text-align: left;
    }
    
    .logo h2 {
        font-size: 18px;
    }
    
    .nav-menu {
        flex-direction: row;
        padding: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .nav-item {
        padding: 15px 20px;
        border-left: none;
        border-bottom: 4px solid transparent;
        white-space: nowrap;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .main-content {
        height: auto;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-box {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        height: auto;
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    .chat-main {
        height: auto;
    }
}

@media (max-width: 768px) {
    .pages-container {
        padding: 15px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header-left h1 {
        font-size: 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin: 0 auto;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .nav-item {
        padding: 12px 15px;
    }
    
    .nav-item .icon {
        margin-right: 8px;
    }
    
    .logo h2 {
        font-size: 16px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .notification-btn {
        font-size: 18px;
    }
    
    .user-profile img {
        width: 32px;
        height: 32px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .chat-input-area {
        padding: 12px;
        gap: 8px;
    }
    
    .chat-send-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
