:root {
    /* HT: Hoa Tieu System Colors */
    --ht-brand: #E50000;       /* Màu đỏ thương hiệu */
    --ht-brand-dark: #B30000;  /* Đỏ đậm (hover/text) */
    --ht-bg-light: #f4f6f8;    /* Màu nền xám nhạt */
    --ht-text-main: #343a40;   
}

/* --- Utility Classes (Các lớp tiện ích dùng chung) --- */
.text-ht-brand { color: var(--ht-brand) !important; }
.text-ht-brand-dark { color: var(--ht-brand-dark) !important; }
.bg-ht-brand { background-color: var(--ht-brand) !important; }

/* --- Layout & Components --- */
body {
    background-color: var(--ht-bg-light) !important;
}

/* 1. Header System (Hệ thống Header chuẩn) */
.ht-sticky-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: var(--ht-bg-light);
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.ht-header-card {
    border: none;
    border-radius: 1rem; 
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
    background-color: white;
}

.ht-header-title {
    font-weight: 700;
    color: var(--ht-text-main);
    margin-bottom: 0;
    line-height: 1.2;
    font-size: 1.1rem;
}

.ht-header-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

/* 2. Buttons & Icons */
.btn-primary, .badge.bg-primary {
    background-color: var(--ht-brand) !important;
    border-color: var(--ht-brand) !important;
}

.btn-primary:hover {
    background-color: var(--ht-brand-dark) !important;
    border-color: var(--ht-brand-dark) !important;
}

.btn-back-circle {
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background-color: #f8f9fa; 
    color: var(--ht-brand);
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    flex-shrink: 0; /* Không bị co lại trên mobile */
}

.btn-back-circle:hover {
    background-color: var(--ht-brand);
    color: white;
    transform: scale(1.05);
}

/* 3. Form Elements (Avatar, Switch...) */
.avatar-circle {
    width: 45px;
    height: 45px;
    background-color: #fce4ec;
    color: var(--ht-brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.form-check-input:checked {
    background-color: var(--ht-brand) !important;
    border-color: var(--ht-brand) !important;
}

/* Input "trong suốt" cho ghi chú */
.input-ghost {
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: transparent;
    padding-left: 0;
    color: #666;
    transition: border-color 0.3s;
}
.input-ghost:focus {
    box-shadow: none;
    border-bottom-color: var(--ht-brand);
    background: transparent;
}

/* --- Bottom Navigation Bar --- */
body {
    padding-bottom: 80px; /* Chừa chỗ cho menu dưới */
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: #ffffff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030; /* Cao hơn content nhưng thấp hơn Modal */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    font-size: 0.75rem;
    font-weight: 500;
    width: 100%;
    height: 100%;
    transition: all 0.2s;
}

.nav-item-link i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* Trạng thái đang chọn (Active) */
.nav-item-link.active {
    color: var(--ht-brand); /* Màu đỏ thương hiệu */
}

.nav-item-link:hover {
    background-color: #f9f9f9;
    color: var(--ht-brand-dark);
}

/* Đảm bảo mỗi nút chiếm đúng 25% chiều rộng */
.nav-item-link, .bottom-nav form {
    flex: 1;
    width: 0; /* Hack flexbox để chia đều */
}

/* --- DESKTOP NAVIGATION (Màn hình >= 768px) --- */
@media (min-width: 768px) {
    
    /* Reset padding body vì desktop không dùng bottom nav */
    body {
        padding-bottom: 20px !important;
    }

    /* Style cho Link Menu trên Desktop */
    .desktop-link {
        text-decoration: none;
        color: #6c757d; /* Màu xám */
        font-weight: 600;
        padding: 0.5rem 1rem;
        border-radius: 50rem; /* Bo tròn viên thuốc */
        transition: all 0.2s;
        font-size: 0.9rem;
    }

    .desktop-link:hover {
        background-color: #f8f9fa;
        color: var(--ht-brand);
    }

    /* Trạng thái Active trên Desktop */
    .desktop-link.active {
        background-color: var(--ht-brand); /* Nền đỏ */
        color: white !important;           /* Chữ trắng */
        box-shadow: 0 2px 5px rgba(229, 0, 0, 0.3);
    }
}

/* --- Style cho nút bấm ở Footer của Card --- */
.btn-footer-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    font-size: 0.75rem;
    color: #6c757d; /* Màu chữ xám (Secondary) */
    background-color: white;
    border: none; /* Mặc định không viền */
    border-radius: 0 !important; /* Vuông góc để khớp với Card */
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-footer-action:hover {
    background-color: #f8f9fa; /* Hover màu xám rất nhạt */
    color: var(--ht-brand-dark); /* Chữ chuyển đậm khi hover */
}

/* Ghi đè màu border của Bootstrap để nhạt hơn, tệp với màu Card */
.card-footer .border-start, 
.card-footer .border-end,
.card-footer.border-top {
    border-color: rgba(0, 0, 0, 0.08) !important; /* Màu siêu nhạt */
}