body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
}
.main-layout {
    /* This is now just a container for the fixed sidebar and the content area */
    position: relative;
}
.main-content-wrapper {
    padding: 20px;
    transition: margin-left 0.3s ease;
    margin-left: 260px; /* Add margin to account for the sidebar */
}
.main-layout.sidebar-collapsed .main-content-wrapper {
    margin-left: 80px;
}
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: #343a40;
    color: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 1000;
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar.collapsed .logo,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .submenu-arrow {
    display: none;
}
.sidebar.collapsed .nav a i {
    font-size: 1.5em; /* Make icons bigger when collapsed */
}
.sidebar.collapsed .nav a {
    justify-content: center;
}
.sidebar.collapsed .user-info {
    flex-direction: column;
    gap: 10px;
}
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: #343a40;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #f8f9fa;
    z-index: 1001;
    transition: transform 0.3s ease;
}
.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* --- GLOBAL CSS CHO NỘI DUNG CHÍNH --- */
.main-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
.stats-box { display: flex; justify-content: space-around; background-color: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #dee2e6; flex-wrap: wrap; gap: 10px; }
.stat-item { text-align: center; font-size: 1em; color: #6c757d; }
.stat-item strong { display: block; font-size: 1.5em; color: #343a40; margin-top: 5px; }
.stat-item .stat-live { color: #28a745; }
.stat-item .stat-die { color: #dc3545; }
.stat-item .stat-unchecked { color: #ffc107; }
.search-form { display: flex; margin-bottom: 20px; }
.search-form input { flex-grow: 1; padding: 10px; border-radius: 4px 0 0 4px; border: 1px solid #ccc; border-right: none;}
.search-form button { padding: 10px 15px; border: none; background-color: #007bff; color: white; border-radius: 0 4px 4px 0; cursor: pointer; }
.controls { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls button, .copy-custom-btn, .submit-btn, .delete-duplicates-btn, .delete-selected-btn, .select-empty-btn, .select-die-btn, .select-live-btn, .nuoi-btn { padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; color: white; display: inline-flex; align-items: center; gap: 8px; }
.submit-btn { background-color: #28a745; }
.delete-duplicates-btn, .delete-selected-btn { background-color: #dc3545; }
.copy-custom-btn { background-color: #17a2b8; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.9em; background-color: #fff; }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; white-space: nowrap; }
th { background-color: #343a40; color: white; }
tr:nth-child(even) { background-color: #f8f9fa; }
.no-data { text-align: center; padding: 20px; color: #6c757d; }
.status-live { background-color: #d4edda !important; color: #155724; }
.status-die { background-color: #f8d7da !important; color: #721c24; }
.pagination { margin-top: 20px; text-align: center; }
.pagination a { color: #007bff; padding: 8px 16px; text-decoration: none; border: 1px solid #dee2e6; margin: 0 4px; border-radius: 4px; }
.pagination a.active { background-color: #007bff; color: white; border-color: #007bff; }
.pagination a:hover:not(.active) { background-color: #e9ecef; }
.toast-notification { position: fixed; top: 20px; right: 20px; background-color: #28a745; color: white; padding: 15px 20px; border-radius: 5px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 1051; opacity: 0; visibility: hidden; transform: translateY(-20px); transition: all 0.5s ease-in-out; }
.toast-notification.success { background-color: #28a745; }
.toast-notification.error { background-color: #dc3545; }
.toast-notification.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* Custom Modal Styles */
.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); display: none;
    justify-content: center; align-items: center; z-index: 2000;
}
.custom-modal-content {
    background: #fff; padding: 25px; border-radius: 8px;
    width: 90%; max-width: 400px; text-align: center;
}
.custom-modal-content h3 { margin-top: 0; }
.custom-modal-buttons { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-btn { padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; }
.modal-btn.ok { background-color: #dc3545; color: white; }
.modal-btn.cancel { background-color: #6c757d; color: white; }

/* CSS for DEMO VIEW */
.content-area {
    padding: 25px;
    overflow-y: auto;
    margin-left: 260px; /* Add margin to account for the fixed sidebar */
}
.sidebar h1 {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #4CAF50;
    text-align: center;
}
.navigation-tabs-container {
    border-bottom: none;
    margin-bottom: 0;
}
.navigation-tabs-row {
    display: flex;
    flex-direction: column; 
    align-items: stretch;
    gap: 8px; 
    margin-bottom: 15px;
}
.navigation-tabs-row a {
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    background-color: #e9ecef;
    transition: background-color 0.2s, color 0.2s;
    text-align: left;
    display: block;
}
.navigation-tabs-row a.active, .navigation-tabs-row a:hover {
    background-color: #4CAF50;
    color: white;
}
.sidebar-footer {
    margin-top: auto; 
}
.contact-row {
    padding: 15px 0;
    font-size: 14px;
    border-top: 1px solid #eee;
}
.contact-row a { font-weight: bold; color: #0d6efd; text-decoration: none; }
.auth-actions { 
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.auth-actions button { 
    width: 100%;
    background-color: #007bff; 
    color: white; 
    padding: 12px 25px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 16px; 
    margin-bottom: 10px;
    transition: background-color 0.3s; 
}
.auth-actions button:hover { background-color: #0056b3; }
.auth-actions button.register { background-color: #28a745; }
.auth-actions button.register:hover { background-color: #218838; }
.content-area table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}
.content-area th, .content-area td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.content-area th {
    background-color: #343a40;
    color: white;
}
.content-area tr:nth-child(even) {
    background-color: #f2f2f2;
}
.content-area .controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.content-area button, .content-area .submit-btn, .content-area .copy-custom-btn, .content-area .delete-duplicates-btn, .content-area .delete-selected-btn, .content-area .select-empty-btn, .content-area .select-die-btn, .content-area .select-live-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.content-area .submit-btn { background-color: #28a745; }
.content-area .delete-duplicates-btn { background-color: #dc3545; }
.content-area .copy-custom-btn { background-color: #17a2b8; }
.content-area .delete-selected-btn { background-color: #dc3545; }
.content-area .stats-box {
    display: flex;
    justify-content: space-around;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 10px;
}
.content-area .stat-item {
    text-align: center;
    font-size: 1em;
    color: #6c757d;
}
.content-area .stat-item strong {
    display: block;
    font-size: 1.5em;
    color: #343a40;
    margin-top: 5px;
}
.content-area .stat-item .stat-live { color: #28a745; }
.content-area .stat-item .stat-die { color: #dc3545; }
.content-area .stat-item .stat-unchecked { color: #ffc107; }
.content-area .import-section {
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    margin-bottom: 20px;
}
.content-area .import-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.content-area .import-layout .input-column, .content-area .import-layout .output-column {
    display: flex;
    flex-direction: column;
}
.content-area .import-layout label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #495057;
}
.content-area textarea {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: monospace;
    box-sizing: border-box;
}
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); justify-content: center; align-items: center; }
.modal-content { background-color: #fefefe; margin: auto; padding: 25px; border: 1px solid #888; width: 90%; max-width: 450px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; }
.close-btn { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-content h2 { margin-top: 0; }
.modal-content input[type="text"], .modal-content input[type="password"], .modal-content input[type="email"] { width: 100%; padding: 12px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.modal-content button[type="submit"] { width: 100%; background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
.message-feedback.error { background-color: #f8d7da; color: #721c24; padding: 10px; margin-bottom: 15px; border-radius: 4px; text-align: center; } 
/* CẬP NHẬT: Thêm style cho việc cắt ngắn text bằng CSS */
.main-content table td[data-col] {
    max-width: 250px; /* Chiều rộng tối đa cho một ô */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}