/* File: public/style-dashboard.css */

/* --- THIẾT LẬP CHUNG --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f9;
    margin: 0;
    color: #4a5568;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================== */
/* === BANNER (ĐÃ CẬP NHẬT) === */
/* ================================== */
.banner {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #005a9e, #007bff);
    color: white;
    padding: 15px 30px;
}

.logo {
    height: 80px;
    margin-right: 20px;
    flex-shrink: 0; /* Không co logo lại khi không đủ không gian */
}

.banner-text {
    flex: 1; /* Chiếm hết không gian còn lại */
    text-align: center; /* Căn giữa toàn bộ nội dung chữ */
}

.banner-text h1 {
    font-size: 24px; /* Cỡ chữ 20px theo yêu cầu */
    font-weight: 700;
    margin: 0;
    padding: 0 15px; /* Thêm khoảng đệm để không bị sát vào logo */
    text-transform: uppercase;
}

.banner-subtitle { /* Đây là thẻ h2 trong HTML */
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
    color: #ffcdd2; /* Màu đỏ nhạt để dễ đọc trên nền xanh */
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); /* Thêm bóng đổ cho dễ đọc hơn */
}

/* --- THANH NGƯỜI DÙNG --- */
.user-bar { display: flex; justify-content: space-between; align-items: center; background-color: #fff; padding: 10px 30px; border-bottom: 1px solid #e2e8f0; }
.user-details p { margin: 0; }
.avatar { width: 45px; height: 45px; border-radius: 50%; cursor: pointer; border: 2px solid #ddd; }
.profile-menu { display: none; position: absolute; right: 0; top: 60px; background-color: white; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); border-radius: 0.5rem; width: 250px; z-index: 1000; overflow: hidden; }
.profile-menu.show { display: block; }
.menu-header { padding: 15px; background-color: #f7fafc; border-bottom: 1px solid #e2e8f0; }
.profile-menu a { display: block; padding: 12px 15px; color: #4a5568; text-decoration: none; font-size: 15px; }
.profile-menu a:hover { background-color: #edf2f7; }

/* --- BỐ CỤC CHÍNH --- */
.dashboard-main { display: flex; max-width: 1500px; margin: 25px auto; padding: 0 25px; gap: 30px; }

/* CỘT TRÁI - MENU DANH MỤC */
.category-sidebar {
    flex: 0 0 280px;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 20px 15px;
    height: fit-content;
}
.category-sidebar h3 {
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 800;
    color: #007bff;
    margin: 0 10px 20px 10px;
    letter-spacing: 0.05em;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
	text-align: center; /* <-- THÊM DÒNG NÀY VÀO DANH MỤC CỘT TRÁI */
}
#category-menu { list-style: none; padding: 0; margin: 0; }
#category-menu li {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    margin-bottom: 8px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
    border-left: 4px solid transparent;
    transition: all 0.2s ease-in-out;
}
#category-menu li:hover { background-color: #f7fafc; color: #2d3748; }
#category-menu li.active {
    background-color: #e3f2fd;
    color: #007bff;
    font-weight: 600;
    border-left-color: #007bff;
}

/* CỘT PHẢI - NỘI DUNG */
.content-area { flex: 1; }
.dashboard-title { text-align: left; font-size: 28px; font-weight: 700; color: #E53935; margin-bottom: 25px; }
.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.system-card {
    background-color: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.system-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.system-image { width: 100%; height: 180px; object-fit: cover; }
.system-info { padding: 25px; }
.system-title { margin-top: 0; font-size: 18px; font-weight: 600; color: #2d3748; }
.system-description { font-size: 15px; line-height: 1.6; color: #718096; margin-top: 10px; }

/* --- KHUNG CHAT (Giữ nguyên) --- */
#chat-container { position: fixed; bottom: 0; right: 20px; z-index: 1001; }
#chat-panel { width: 530px; height: 400px; background-color: #fff; border: 1px solid #ccc; border-radius: 8px 8px 0 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; }
#chat-header { background-color: #007bff; color: white; padding: 10px 15px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
#chat-body { display: flex; flex-grow: 1; height: 100%; }
#online-users-panel { width: 200px; border-right: 1px solid #ddd; display: flex; flex-direction: column; background-color: #f8f9fa; }
#online-users-panel h4 { margin: 0; padding: 10px; font-size: 14px; background-color: #f1f1f1; border-bottom: 1px solid #ddd; flex-shrink: 0; }
#online-users-list {
    list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1;
    height: 0; /* ĐÃ THÊM: Để khắc phục vấn đề cuộn */
}
#online-users-list li { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 15px; }
#online-users-list li:hover { background-color: #e9ecef; }
#online-users-list li.active { background-color: #e0f0ff; font-weight: bold; }
#main-chat-area { flex: 1; display: flex; flex-direction: column; }
#messages {
    flex-grow: 1; padding: 15px; overflow-y: auto; list-style-type: none; margin: 0;
    height: 0; /* ĐÃ THÊM: Để khắc phục vấn đề cuộn và giữ vị trí ô nhập tin nhắn */
}
#chat-form { display: flex; border-top: 1px solid #ccc; flex-shrink: 0; }
#chat-input { flex-grow: 1; border: none; padding: 12px; font-size: 14px; }
#chat-input:focus { outline: none; }
#chat-form button { background-color: #007bff; color: white; border: none; padding: 0 15px; cursor: pointer; }
#toggle-chat-btn { background: none; border: none; color: white; cursor: pointer; font-size: 20px; }
#chat-container.minimized #chat-panel { height: 42px; }
#chat-container {
    display: none !important;
}