/* ==========================================================================
   1. GLOBAL VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --sidebar-width-expanded: 250px;
    --sidebar-width-collapsed: 70px;
    --bg-dark-main: #1d2127;
    --bg-dark-header: #171b1e;
    --bg-dark-hover: #242830;
    --accent-blue: #0088cc;
    --accent-blue-hover: #0077b3;
    --transition-speed: 0.25s;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #f4f7f6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: #333;
}

/* Page Layout cho trang Đăng nhập */
body.login-page {
    background-color: var(--bg-dark-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==========================================================================
   2. AUTHENTICATION MODULE (LOGIN & SIGN UP CARD)
   ========================================================================== */
.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: none;
}

.auth-header {
    background-color: var(--bg-dark-header);
    padding: 25px 20px;
    text-align: center;
    color: #fff;
    border-bottom: 3px solid var(--accent-blue);
}

.auth-header .brand-logo {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.auth-body {
    padding: 30px;
}

.btn-primary-custom {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
    font-weight: 600;
    padding: 10px;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    color: #fff;
}

.auth-toggle-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-toggle-link:hover {
    text-decoration: underline;
}

.d-none-custom {
    display: none !important;
}

/* ==========================================================================
   3. SIDEBAR NAVIGATION & MAIN CONTENT (PORTAL) - FIXED BUG TOOLTIP
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width-expanded);
    background-color: var(--bg-dark-main);
    min-height: 100vh;
    color: #abb4be;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transition: width var(--transition-speed) ease-in-out;
    white-space: nowrap;
    overflow-x: hidden;
}

.sidebar .brand {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background-color: var(--bg-dark-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.sidebar .nav-item {
    position: relative;
    width: 100%;
}

.sidebar .nav-link {
    color: #abb4be;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
    text-decoration: none;
    width: 100%;
}

.sidebar .nav-link:hover, 
.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--bg-dark-hover);
    border-left: 4px solid var(--accent-blue);
    padding-left: 16px;
}

.sidebar .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-text {
    margin-left: 12px;
    transition: opacity var(--transition-speed) ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FIX LỖI: ẨN MẶC ĐỊNH TOÀN BỘ TOOLTIP TRÊN MÀN HÌNH MỞ RỘNG */
.sidebar .sidebar-tooltip {
    display: none !important;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: #000;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1060;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ==========================================================================
   4. COLLAPSED STATE (TRẠNG THÁI THU NHỎ SIDEBAR)
   ========================================================================== */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed) !important;
}

body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .badge-count {
    display: none !important;
}

body.sidebar-collapsed .sidebar .brand,
body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 16px 0;
}

body.sidebar-collapsed .sidebar .nav-link:hover, 
body.sidebar-collapsed .sidebar .nav-link.active {
    padding-left: 0;
}

body.sidebar-collapsed .sidebar .nav-icon {
    margin: 0;
}

/* CHỈ HIỂN THỊ TOOLTIP KHI ĐÃ BẬT SIDEBAR-COLLAPSED VÀ RÊ CHUỘT (HOVER) */
body.sidebar-collapsed .sidebar .nav-item:hover .sidebar-tooltip {
    display: block !important;
}

/* ==========================================================================
   5. MAIN CONTENT & TOPBAR
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width-expanded);
    transition: margin-left var(--transition-speed) ease-in-out;
    padding: 20px 20px 0 20px;
    min-height: 100vh;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-width-collapsed) !important;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    margin: -20px -20px 20px -20px;
    padding: 12px 25px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-toggle-sidebar {
    background: #f0f3f5;
    border: 1px solid #dcdfe3;
    color: #333;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-sidebar:hover {
    background: #e4e8eb;
    color: var(--accent-blue);
}

.card-form-header {
    font-weight: 700;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
}

.pip-input[readonly] {
    background-color: #e9ecef !important;
    cursor: not-allowed;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}
.stat-icon {
		width: 48px;
		height: 48px;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 20px;
	}
.copyright{
	text-align:center;
	color:#6c6c6c;
	font-size:14px;
	font-style:italic
}
.profit{
	color:green;
	font-weight:700
}
/* ==========================================================================
   6. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar { width: var(--sidebar-width-collapsed) !important; }
    .sidebar .brand-text, .sidebar .nav-text, .sidebar .badge-count { display: none !important; }
    .sidebar .brand, .sidebar .nav-link { justify-content: center; padding: 16px 0; }
    .sidebar .nav-icon { margin: 0; }
    .sidebar .nav-item:hover .sidebar-tooltip { display: block !important; }
    .main-content { margin-left: var(--sidebar-width-collapsed) !important; }
}

@media (max-width: 767.98px) {
    .sidebar { left: calc(-1 * var(--sidebar-width-expanded)); width: var(--sidebar-width-expanded) !important; }
    body.mobile-sidebar-open .sidebar { left: 0; }
    body.mobile-sidebar-open .sidebar-backdrop { display: block; }
    .main-content { margin-left: 0 !important; padding: 15px; }
    .topbar { padding: 10px 15px; }
    .topbar-title { font-size: 16px; }
    .topbar-user { display: none !important; }
}
/* Tăng kích thước nút gạt trên Mobile để chống bấm nhầm */
@media (max-width: 767.98px) {
    .bot-card .form-check-input {
        width: 2.5em;
        height: 1.25em;
        cursor: pointer;
    }
    .bot-card {
        border-left: 4px solid #0d6efd !important; /* Vạch xanh bên trái tạo điểm nhấn */
    }
}