body {
    min-height: 100vh;
    display: flex; /* Kích hoạt Flexbox */
    flex-direction: column;
    justify-content: center; /* Căn giữa theo chiều dọc */
    align-items: center;     /* Căn giữa theo chiều ngang */
    background-image: url('/assets/images/bg_portal.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    margin: 0;
    padding: 20px 0; /* Tạo khoảng trống trên dưới cho mobile */
}

.btn-custom { background-color: #dc3545; color: white; width: 100%; padding: 12px; font-weight: bold; border-radius: 8px; border: none; }
.btn-custom:hover { background-color: #c82333; }
.titlethangtv{   justify-content: space-between;}
.huongdan a { color: #333; font-size: 0.9rem; }
.footer{color:#fad848;padding:3px;text-align:center;font-size:.9rem;background:red;width:100%;position:fixed;bottom:0;left:0;z-index:1000;border-top:5px solid var(--party-gold)}
.main-card {
    width: 100%;
    max-width: 900px; /* Giới hạn độ rộng để không bị quá to trên máy tính */
    margin: 0 auto;   /* Căn giữa dự phòng */
    border-radius: 15px;
    overflow: hidden;
}
.form-label{padding:0px 10px}
.form-control, .form-select {width: 50% !important;}
.portal-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center; /* Căn giữa logo và chữ */
    margin-bottom: 40px;
}
.thangfooter {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: auto; /* Đẩy footer xuống đáy nếu dùng flex-column */
    color: #fff; /* Nếu nền đỏ thì chữ trắng cho dễ đọc */
}
.card-header-custom{background:#860808; color:white; padding:20px; background-image:url('/images/trongdong.png'); background-size:cover}
.nav-tabs .nav-link{color:#555;font-weight:500;border:none;padding:15px 20px} .nav-tabs .nav-link.active{color:#860808;font-weight:bold;border-bottom:3px solid #860808;background:none}
.section-title{font-weight:700; color:#860808; background:#fff5f5; padding:10px; border-left:5px solid #860808; margin-top:20px;text-transform: uppercase;    display: flex !important;    flex-direction: row-reverse;    justify-content: flex-end;}
:root { --primary-red: #da251d; --gold: #fff200; --dark-red: #860808; }
.formthangtv {border: 1px dashed #ff00005e;} 
a.dangxuat{   background: #961717;    padding: 5px;    font-weight: bold;}
.dangxuat:hover{background:#ffc107}
.login-container {
    width: 100%; max-width: 450px; padding: 20px;
}
/* Hiệu ứng cho form đã khóa sổ */
.form-locked {
    opacity: 0.6; /* Làm mờ card */
    filter: grayscale(0.5); /* Làm nhạt màu sắc */
    transition: all 0.3s ease;
}
.form-locked:hover {
    opacity: 0.9; /* Khi rà chuột vào thì hiện rõ hơn một chút để xem nội dung */
    filter: grayscale(0);
}
/*End Hiệu ứng cho form đã khóa sổ */
    .card {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
        overflow: hidden; border-top: 5px solid var(--gold);
    }
    .card-header {
        background: var(--primary-red); color: white; padding: 20px; text-align: center;
    }
    .card-body { padding: 30px; }
    .logo-img { width: 80px; margin-bottom: 10px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
    h3 { margin: 0; font-size: 1.2rem; letter-spacing: 1px; }
    .system-name { color: var(--gold); font-weight: bold; margin-top: 5px; display: block; }
    
    .alert {
        padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; line-height: 1.4;
        display: flex; align-items: center; justify-content: center; gap: 10px;
    }
    .alert-timeout { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; animation: shake 0.5s; }
    .alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
    
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    .form-group { margin-bottom: 20px; text-align: left; }
    .form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #444; }
    input {
        width: 100%; padding: 12px 15px; border: 2px solid #ddd; border-radius: 8px;
        font-size: 1rem; transition: all 0.3s; box-sizing: border-box;
    }
    input:focus { border-color: var(--primary-red); outline: none; box-shadow: 0 0 8px rgba(218, 37, 29, 0.2); }
    
    .btn-submit {
        width: 100%; padding: 14px; background: var(--primary-red); color: white;
        border: none; border-radius: 8px; font-size: 1rem; font-weight: bold;
        cursor: pointer; transition: 0.3s;
    }
    .btn-submit:hover { background: var(--dark-red); transform: translateY(-2px); }
    
    .footer-text {
        margin-top: 20px; font-size: 0.8rem; color: #eee; text-align: center;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    }
/* Ẩn tất cả các khối có thuộc tính cha mặc định */
        [data-parent-id] {
            display: none;
        }
        /* Class bổ trợ để chắc chắn ẩn khi JS yêu cầu */
        .hidden {
            display: none !important;
        }
        #reportForm > .d-grid {
            display: block !important;
            text-align: center;
        }
        /* Đảm bảo khung KPI luôn nằm đúng vị trí */
        #kpi-dashboard {
            display: block;
            margin-top: 20px;
        }
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0;
    pointer-events: none;
}

/* Đảm bảo các ô nhập liệu hiện ra rõ ràng */
.field-container:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s ease-in;
}

.hidden {
    display: none !important;
    visibility: hidden;
}
.field-container {
    transition: all 0.3s ease; /* Hiệu ứng hiện ra mượt mà */
}
.text-muted img {
    width: 100% !important;
    height: auto !important;
}
.footer{color:#fad848;padding:3px;text-align:center;font-size:.9rem;background:red;width:100%;position:fixed;bottom:0;left:0;z-index:1000;border-top:5px solid var(--party-gold)}
.login-box{background:rgba(255,255,255,0.95);border-radius:10px;width:95%;text-align:center;}
.btn-custom{background:#860808;color:white;padding:12px;width:100%;border:none;border-radius:5px;font-size:1.1rem;}
.btn-custom:hover{background:#a00000;color:white;}
.logingmail:hover{color: #6914d7}
.card-footer.bg-warning.text-center.py-2 {    border-radius: 0px 0px 10px 10px;}
.anhdaidienform img {width: 100% !important;height: auto !important;}
.main-content {flex: 1;display: flex;align-items: center;justify-content: center;width: 100%;padding: 20px 0;}

.hover-shadow:hover {     box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25) !important;     transform: translateY(-3px);    transition: all 0.3s ease; }

.footer {   color: #fad848;    padding: 10px;    text-align: center;    font-size: .9rem;    background: #ce1616;    width: 100%;
    position: fixed;    bottom: 0;    left: 0;    z-index: 1000;    border-top: 4px solid #fad848;}

.card {    border: none;    border-radius: 10px;    background: rgba(255, 255, 255, 0.95);}

/* CSS cho ô copy link */
.link-box {
    background: #f8f9fa;
    border: 1px dashed #adb5bd;
    border-radius: 5px;
    padding: 5px 10px;
    margin-bottom: 15px;
}
.link-input {
    background-color: #fff !important;
    font-size: 0.85rem;
    color: #555;
}
.loginthangtv {
    position: relative;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: bold;
    color: #da251c; /* Chữ màu đỏ */
    background-color: transparent;
    border: 2px solid #da251c; /* Viền đỏ */
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: color 0.4s ease;
    z-index: 1;
    box-shadow: 0 0 0 rgba(218, 37, 28, 0);
}

/* Lớp nền màu vàng sẽ trượt lên khi hover */
.loginthangtv::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 0;
    bottom: 0;
    left: 0;
    background-color: #ffd700;
    transition: height 0.3s ease-out;
}
.huongdan {
    background-color: rgb(255 193 7 / 23%) !important;
}
.loginthangtv:hover {
    color: #f00; 
    border-color: #da251c;
    /* Hiệu ứng Pulse: Lan tỏa sóng đỏ */
    animation: pulse-red 1.5s infinite;
}

.loginthangtv:hover::after {
    height: 100%; /* Màu nền đỏ dâng lên */
}

/* Định nghĩa chuyển động rung/tỏa sáng */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(218, 37, 28, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(218, 37, 28, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(218, 37, 28, 0);
    }
}

.loginthangtv {
    position: relative;
    padding: 15px 45px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Font chữ hiện đại, gãy gọn */
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffd700; /* Màu vàng kim loại (Gold) thay vì vàng chanh */
    background: linear-gradient(135deg, #b00e0e 0%, #da251c 100%); /* Đỏ cờ Đảng có chiều sâu */
    border: 1px solid #ffd700;
    border-radius: 4px; /* Bo góc nhẹ tạo sự nghiêm túc, không quá tròn */
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 10px rgba(218, 37, 28, 0.4); /* Bóng màu đỏ */
    z-index: 1;
}
/* Tạo luồng sáng quét qua (Hiệu ứng Chuyển đổi số) */
.huongdan::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.4), /* Ánh sáng vàng quét qua */
        transparent
    );
    transition: 0.5s;
    z-index: -1;
}

.huongdan:hover {
    color: #fff; /* Chữ chuyển trắng khi hover để dễ đọc */
    background: #da251c;
    box-shadow: 
        0 0 20px rgba(218, 37, 28, 0.6),
        0 0 40px rgba(255, 215, 0, 0.2); /* Hiệu ứng hào quang */
    transform: translateY(-2px);
    border-color: #fff;
}

.huongdan:hover::before {
    left: 100%; /* Luồng sáng chạy từ trái qua phải */
    transition: 0.5s;
}

.huongdan:active {
    transform: translateY(1px);
}
/* Hiệu ứng cho Form Nổi bật */
.card-highlight {
    border: 2px solid #ffc107 !important; /* Viền vàng */
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4) !important;
    transform: scale(1.02); /* Phóng to nhẹ */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.card-highlight::before {
    content: "HOT";
    position: absolute;
    top: 15px;
    right: -25px;
    background: #dc3545;
    color: white;
    width: 100px;
    text-align: center;
    transform: rotate(45deg);
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.card-highlight:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.6) !important;
}
/* Hiệu ứng cho Form Nổi bật */

/* [THÊM MỚI] Hiển thị viền đỏ và nền hồng ngay khi nhập sai Regex */
.input-field:invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}
/* [THÊM MỚI] Style cho số tổng trên Header */
.section-sum { 
    font-size: 0.9rem; 
    margin-left: 10px; 
    vertical-align: middle; 
}
/*END [THÊM MỚI] Hiển thị viền đỏ và nền hồng ngay khi nhập sai Regex */

.thangfooter {
    color: #f00 !important;
    font-weight: 600;
    text-shadow: 1px 0 0 #f8c343, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 1px 1px #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}