﻿/* ==========================================================================
   1. DEFAULTS & RESET (Nền tảng hệ thống)
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    background: #f0f2f5;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333333;
    line-height: 1.6;
}

p {
    margin-bottom: 10px;
    line-height: 1.6em;
}

a:link, a:visited { 
    color: #1a73e8; 
    text-decoration: none; 
    transition: color 0.2s; 
}
a:hover { 
    color: #0d47a1; 
    text-decoration: underline; 
}
a:active { 
    color: #1a73e8; 
}

h1, h2, h3, h4, h5, h6 {
    color: #666666;
    text-transform: none;
    font-weight: 200;
    margin-bottom: 0px;
}
h1 { font-size: 1.6em; }
h2 { font-size: 1.5em; font-weight: 600; }
h3 { font-size: 1.2em; }

.clear { 
    clear: both; 
}

.failureNotification { 
    font-size: 0.8rem;
    margin-top: 4px;
    display: block; 
    color: Red; 
}
.bold { 
    font-weight: bold; 
}
.hidden-element {
    display: none !important;
}
.form-group{
    display: flex !important;
    flex-direction: column !important; /* Ép các thành phần bên trong xếp chồng lên nhau */
    align-items: flex-start !important;
    width: 100%;
    
}
/* CHIA 2 CỘT CHO TỪ NGÀY - ĐẾN NGÀY */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Chia đều 2 cột 50% - 50% */
    gap: 15px; /* Khoảng cách giữa 2 cột */
}


/* ==========================================================================
   2. PRIMARY LAYOUT & HEADER & NAVIGATION MENU
   ========================================================================== */
.page {
    max-width: 1200px;
    width: 95%;
    background-color: #ffffff;
    margin: 20px auto;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.header {
    background: #1e3a8a;
    width: 100%;
}

.header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0;
}

.header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    width: 100%;
}

.title {
    display: block;
}

/* Cụm nút đăng nhập/đăng xuất */
.loginDisplay {
    display: flex !important;
    align-items: center !important;
    color: #ffffff;
    gap: 12px;
}
.loginDisplay a {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}
.loginDisplay a:hover {
    background-color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}
.change-pass-link {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

/* Navigation Menu */
.menu-container, div.hideSkiplink {
    background-color: #0f172a;
    width: 100%;
}
div.hideSkiplink:empty,
    div.hideSkiplink:not(:has(div.menu)) {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
    }
div.menu {
    padding: 4px 0px 4px 8px;
}
div.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    width: auto;
}
div.menu ul li a, div.menu ul li a:visited {
    color: #cbd5e1;
    display: block;
    padding: 12px 18px;
    font-weight: 500;
    line-height: 1.35em;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
div.menu ul li a:hover {
    background-color: #1e293b;
    color: #ffffff;
    text-decoration: none;
}

/* Nút Icon 3 gạch */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    margin: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
}
.menu-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #dde4ec;
    margin: 4px 0;
    transition: all 0.2s;
}

.main {
    padding: 0px 12px;
    margin: 12px 8px 8px 8px;
    min-height: 420px;
}

.footer {
    color: #4e5766;
    padding: 8px 0px 0px 0px;
    margin: 0px auto;
    text-align: center;
    line-height: normal;
}

/* Trạng thái hiển thị thiết bị mặc định */
.mobile-menu-wrapper { display: block; }
.mobile-login-container { display: none; }
.desktop-buttons { display: flex; gap: 15px; align-items: center; }

/* ==========================================================================
   3. GLOBAL MEDIA QUERIES (Quy hoạch toàn bộ Responsive Mobile tại đây)
   ========================================================================== */
@media (max-width: 768px) {
    .page {
        width: 95%;
    }

    .header h1 {
        font-size: 1.35rem !important;
        white-space: nowrap;
    }

    .desktop-buttons{
        display: none;
    }

    .mobile-login-container .change-pass-link, .logout-status{
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px;
        border-radius: 6px;
        font-weight: bold;
        text-decoration: none !important;
    }
    /* Thanh Menu di động */
    div.hideSkiplink {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        padding: 0 15px !important;
        height: 50px !important;
        position: relative;
    }
    .menu-toggle {
        display: block !important;
        padding: 6px 10px;
    }
    .menu-toggle .icon-bar {
        width: 20px;
    }
    .mobile-menu-wrapper {
        display: none !important;
        position: absolute;
        left: 0;
        top: 50px;
        width: 100%;
        background-color: #0f172a;
        z-index: 999;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    .mobile-menu-wrapper.wrapper-open {
        display: block !important;
    }
    div.menu {
        display: block !important;
        width: 100% !important;
        padding: 0px !important;
    }
    div.menu ul {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0;
        margin: 0;
    }
    div.menu ul li {
        width: 100% !important;
    }
    div.menu ul li a, div.menu ul li a:visited {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding: 14px 20px !important;
        display: block;
        width: 100%;
        color: #cbd5e1 !important;
    }
    /* Khung login di động */
    .mobile-login-container {
        display: flex !important;
        flex-direction: column;
        padding: 15px 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        gap: 10px;
        background-color: #0f172a;
    }
    .responsive-text-mobile {
        font-size: 0.7rem !important;
    }
}