/* Đặt font chữ và nền */
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom right, #007583, #9f9dc0);
    color: #fff;
    text-align: center;
    display: flex;
    /* Enable flexbox layout */
    flex-direction: column;
    /* Stack content vertically */
    min-height: 100vh;
    /* Ensure the body covers the full height of the screen */
}

/* Logo + tiêu đề */
.header {
    margin-top: 20px;
}

.header img {
    height: 100px;
}

.header h1 {
    margin: 10px 0 5px;
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
}

.header h2 {
    font-size: 16px;
    font-weight: normal;
    margin: 0;
}

/* Container for the content */
.main-content {
    flex-grow: 1;
    /* Allow the content to take up remaining space */
}

/* Tiêu đề chính */
.main-title {
    margin: 20px 0 10px;
    font-size: 26px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Lưới chứa các ô chức năng */
.dashboard {
    display: flex;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;      
}

/* .dashboard>* {
    width: 100%;
    width: calc((100% - 70px) / 8);
} */

/* Ô chức năng */
.card {
    background: #fff;
    color: #003366;
    border-radius: 12px;
    padding: 12px 8px;
    /* Giảm padding để nhỏ gọn */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    box-sizing: border-box;
    width: 100%;
    /* Chiếm toàn bộ cell của grid */
}

/* Hover vẫn giữ */
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

/* Hình ảnh và chữ */
.card img {
    width: 35px;
    height: 35px;
    margin-bottom: 8px;
}

.card p {
    font-size: 12px;
    font-weight: bold;
    margin: 0;
}

/* Footer */
.footer {
    font-size: 14px;
    line-height: 1.6;
    padding: 20px 0;
    background-color: #0072d6;
    color: #fff;
    text-align: center;
    margin-top: auto;
    /* Ensures footer stays at the bottom */
}

.footer {
    font-size: 14px;
    line-height: 1.6;
    padding: 20px 0;
    background-color: #0072d6;
    color: #fff;
    display: flex;
    justify-content: space-around; /* căn đều các phần tử */
    align-items: center;
    flex-wrap: wrap; /* nếu màn hình nhỏ sẽ xuống hàng */
    margin-top: auto;
}

/* Button Logout */
.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border: 2px solid #ff0000;
    color: #ff0000;
    background-color: transparent;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    z-index: 1000;
    /* Đảm bảo nút luôn nổi trên */
}

.logout-btn i {
    margin-right: 10px;
}

.logout-btn:hover {
    background-color: #ff4d4d;
    color: ff0000;
    border-color: #e60000;
}

.logout-btn:focus {
    outline: none;
}


@media (max-width: 1024) {
    .dashboard>* {
        width: 100%;
        width: calc((100% - 50px) / 6);
    }

    .main-title {
        margin: 20px 0 10px;
        font-size: 18px;
        font-weight: bold;
        text-transform: uppercase;
    }
}

@media (max-width: 992) {
    .dashboard>* {
        width: 100%;
        width: calc((100% - 40px) / 5);
    }

    .main-title {
        margin: 20px 0 10px;
        font-size: 18px;
        font-weight: bold;
        text-transform: uppercase;
    }
}


@media (max-width: 768px) {
    .logout-btn {
        position: fixed;
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 14px;
        border-width: 1.5px;
    }

    .logout-btn i {
        margin-right: 6px;
        font-size: 14px;
    }

    .dashboard {
        padding: 10px;
    }

    .dashboard>* {
        width: 100%;
        width: calc((100% - 40px) / 5);
    }

    .main-title {
        margin: 20px 0 10px;
        font-size: 16px;
        font-weight: bold;
        text-transform: uppercase;
    }
}

@media (max-width: 480px) {
    .logout-btn {
        position: fixed;
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 12px;
        border-width: 1px;
    }

    .logout-btn i {
        margin-right: 5px;
        font-size: 14px;
    }

    .dashboard>* {
        width: 100%;
        width: calc((100% - 10px) / 2);
    }

    .main-title {
        margin: 20px 0 10px;
        font-size: 12px;
        font-weight: bold;
        text-transform: uppercase;
    }
}

      /* Thanh top bar */
    .topbar {
      background: #0470d5;
      color: #fff;
      padding: 8px 16px;
      display: flex;
      justify-content: flex-end;
      align-items: center;
    }

    /* User info + dropdown */
    .user-menu {
      position: relative;
      cursor: pointer;
    }

    .user-info {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 14px;
    }

    .user-name {
      font-weight: bold;
      color: #ffeb3b;
    }

    .user-code {
      font-size: 12px;
      color: #fff;
    }

    .arrow {
      border: solid white;
      border-width: 0 2px 2px 0;
      display: inline-block;
      padding: 3px;
      transform: rotate(45deg);
      margin-left: 6px;
    }

    /* Dropdown menu */
    .dropdown {
      display: none;
      position: absolute;
      right: 0;
      background: #027373;
      border-radius: 4px;
      margin-top: 6px;
      min-width: 150px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.2);
      z-index: 10;
    }

    .dropdown a {
      display: block;
      padding: 10px;
      text-decoration: none;
      color: #fff;
      font-size: 14px;
    }

    .dropdown a:hover {
      background: #015858;
    }

    /* Hiện dropdown khi hover */
    /* .user-menu:hover .dropdown {
      display: block;
    } */

    /* Khi có class active thì dropdown mới hiện */
    .dropdown.active {
      display: block;
    }

    /* Icon giả lập */
    .icon {
      width: 18px;
      height: 18px;
      background: white;
      border-radius: 50%;
      display: inline-block;
      margin-right: 4px;
    }