﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0366d6;
}

.page {
    display: flex;
    height: 100vh;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.main {
    flex: 1;
}

    .main .top-row {
        background-color: #f7f7f7;
        border-bottom: 1px solid #d6d5d5;
        justify-content: flex-end;
    }

        .main .top-row > a {
            margin-left: 1.5rem;
        }

/* Sidebar styling */
.sidebar {
    background-color: #faf7f2 !important;
    color: #3e2723;
    padding: 1rem;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
}

    .sidebar .navbar-brand {
        font-size: 1.2rem;
        color: #3e2723 !important;
    }

/* Nav item styling */
.nav-item a,
.nav-item .btn-link,
.nav-item button.btn-link {
    color: #5d4037 !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    height: auto;
    line-height: normal;
    padding: 0.45rem 0.6rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

    /* Hover effect for nav items */
    .nav-item a:hover,
    .nav-item button.btn-link:hover {
        color: #3e2723 !important;
        background-color: rgba(0, 0, 0, 0.06) !important;
    }

    /* Active nav item style */
    .nav-item a.active {
        color: #bf360c !important;
        background-color: rgba(191, 54, 12, 0.08) !important;
        font-weight: bold;
    }

/* Parent menu button in sidebar */
.parent-button {
    color: #5d4037 !important;
    text-decoration: none !important;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
}

.parent-button:hover {
    color: #3e2723 !important;
    background-color: rgba(0, 0, 0, 0.06) !important;
}

/* Child menu items */
.child-item {
    color: #6d4c41 !important;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
}

.child-item:hover {
    color: #3e2723 !important;
    background-color: rgba(0, 0, 0, 0.06) !important;
}

.content {
    padding-top: 1.1rem;
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .main .top-row {
        display: none;
    }
}

@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        display: block;
    }
}

/* Custom Scrollbar */
.my-custom-scrollbar {
    position: relative;
    height: 400px;
    overflow: auto;
}

.table-wrapper-scroll-y {
    display: block;
}

/* Định dạng cho mục cha */
.parent-item > .btn {
    color: #f5deb3 !important; /* Màu kem sáng trên nền sidebar nâu */
    font-weight: bold;
    padding-left: 0.5rem;
    width: 100%;
    text-align: left;
}

.parent-item > .btn:hover {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.1) !important;
    border-radius: 4px;
}

.parent-item i {
    width: 1.25em;           /* fixed width giống fa-fw để icon thẳng hàng */
    text-align: center;
    flex-shrink: 0;
}

/* Định dạng cho menu con */
.child-menu {
    padding-left: 1.25rem; /* Thụt lề cho toàn bộ vùng chứa mục con */
}

.child-item {
    color: #e8c99a !important; /* Màu kem nhạt hiện rõ trên nền nâu tối */
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

    .child-item:hover {
        color: #ffffff !important;
        background-color: rgba(255,255,255,0.12) !important;
    }

    .child-item i {
        width: 1.25em;       /* fixed width để icon thẳng hàng với parent */
        text-align: center;
        flex-shrink: 0;
    }

/* Style for select elements to match input fields */
.form-select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #495057;
    appearance: none; /* Ẩn mũi tên mặc định trên một số trình duyệt */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%2394959a' d='M2 0L0 2h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.65em auto;
    width: 100%;
}

    /* Đảm bảo khoảng cách padding trên và dưới cho đồng nhất với input */
    .form-select:focus {
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }
/* Style for labels to ensure they are above the input/select fields */
.form-label {
    display: block;
    margin-bottom: 0.25rem; /* Tạo khoảng cách dưới nhãn */
    font-weight: 500; /* Đảm bảo nhãn có trọng lượng đồng nhất */
    color: #495057; /* Màu chữ đồng bộ */
}

/* Đảm bảo các thành phần form có cùng khoảng cách giữa các cột */
.col-md-3 {
    margin-bottom: 1rem; /* Đảm bảo mỗi cột có khoảng cách dưới */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-content {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 600px; /* Giới hạn độ rộng tối đa */
    min-width: 400px; /* Đảm bảo độ rộng tối thiểu */
    width: 90%; /* Chiếm 90% chiều ngang màn hình nếu nhỏ hơn max-width */
    height: auto; /* Chiều cao tự động dựa trên nội dung */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    overflow-y: auto; /* Thêm thanh cuộn dọc nếu nội dung quá nhiều */
    max-height: 90vh; /* Không vượt quá 90% chiều cao màn hình */
}

/* Header style for modals */
.modal-header .modal-title {
    color: #8b5a2b;
    font-weight: bold;
    letter-spacing: 1px;
}

.modal-header hr {
    border-top: 2px solid #8b5a2b;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.modal-footer button {
    margin-left: 0.5rem;
}

.modal-footer .btn-secondary {
    background-color: #f7f7f7;
    color: #333;
}

.modal-footer .btn-primary {
    background-color: #8b5a2b;
    border-color: #8b5a2b;
    color: #fff;
}

/* Spacing for action buttons */
.gap-2 > * {
    margin-right: 8px !important;
}

/* Custom Table Sorting Arrows */
/* Đảm bảo bảng và các cột có chiều rộng nhất quán */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

    th.sortable-column {
        cursor: pointer;
        position: relative;
    }

.sortable-column.asc::after,
.sortable-column.desc::after {
    position: absolute;
    right: 8px;
    font-size: 0.75em;
    color: #ffa726;
}

.sortable-column.asc::after {
    content: "▲";
}

.sortable-column.desc::after {
    content: "▼";
}

/* Toggle switch styles */
.form-check-input {
    width: 3rem;
    height: 1.5rem;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    background-color: #dc3545; /* Màu đỏ khi tắt */
    border: 1px solid #dc3545;
    border-radius: 1.5rem;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

    .form-check-input:checked {
        background-color: #28a745; /* Màu xanh lá cây khi bật */
        border-color: #28a745;
    }

    .form-check-input::before {
        content: '';
        position: absolute;
        top: 0.25rem;
        left: 0.25rem;
        width: 1rem;
        height: 1rem;
        background-color: white;
        border-radius: 50%;
        transition: left 0.3s;
    }

    .form-check-input:checked::before {
        left: 1.75rem; /* Vị trí khi bật */
    }



.tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-node {
    list-style: none;
    padding: 0;
}

.tree-node-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid #ddd;
    position: relative;
}

    .tree-node-row:hover {
        background-color: #f9f9f9;
    }

    .tree-node-row.focused {
        background-color: #007bff;
        color: white;
    }

.expand-collapse {
    cursor: pointer;
    margin-right: 10px;
}

.node-text {
    flex-grow: 1;
    cursor: pointer;
}

.tree-node-actions {
    display: flex;
    gap: 5px;
}

.tree-children {
    list-style: none;
    padding-left: 20px;
}
.fixed-size {
   
    height: 150px; /* Chiều cao cố định */
    object-fit: cover; /* Giữ tỷ lệ và crop ảnh nếu cần */
    border-radius: 5px; /* Tùy chọn bo góc */
}
.btn-danger {
    background-color: #dc3545; /* Màu đỏ */
    color: white;
}

.btn-info {
    background-color: #17a2b8; /* Màu xanh dương */
    color: white;
}
.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

    .selected:hover {
        background-color: #0056b3;
        color: white;
        border-color: #0056b3;
    }

.modal-large {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    position: fixed;
    top: 50%;
    left: 50%;
    background-color: #fff;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header,
.modal-footer {
    flex-shrink: 0;
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
}
.bg-light-danger {
    background-color: #f8d7da !important; /* Màu đỏ nhạt */
}

.text-dark {
    color: #721c24 !important; /* Màu chữ đỏ đậm */
}
.text-selected {
    background-color:#ffa726!important;
    font-style:italic!important; /* Màu chữ đỏ đậm */
}
.modal-content-lg {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-height: 90%;
    overflow-y: auto;
}
/*.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}*/
/* Làm dropdown rõ nét, có bóng đậm và nền trắng */
.dropdown-menu {
    background-color: #fff !important;
    border: 1px solid #bdbdbd !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 1.5px 4px rgba(0,0,0,0.15) !important;
    filter: none !important;
    opacity: 1 !important;
}

    .dropdown-menu .dropdown-item {
        color: #333;
        font-weight: 500;
        padding: 10px 18px;
        border-radius: 4px;
    }

        .dropdown-menu .dropdown-item:hover,
        .dropdown-menu .dropdown-item:focus {
            background-color: #f0f0f0;
            color: #1d3557;
        }

.dropdown-menu {
    transition: box-shadow 0.2s, opacity 0.2s;
}

.badge {
    padding: 0.5em 1em !important;
    font-weight: 600;
    font-size: 1em;
    border-radius: 0.7em;
    letter-spacing: 0.02em;
    color: #fff !important;
}

    .badge.bg-warning {
        color: #fff !important;
    }

    .badge.bg-danger {
        color: #fff !important;
    }

.split-container {
    display: flex;
    height: 100%;
    min-height: 600px;
}

.split-left {
    min-width: 180px;
    max-width: 600px;
    background: #fff;
    border-right: none;
    transition: width 0.1s;
    overflow: auto;
}

.split-bar {
    width: 6px;
    background: linear-gradient(to bottom, #e0e0e0 0%, #bdbdbd 100%);
    cursor: col-resize;
    position: relative;
    z-index: 2;
    border-radius: 3px;
    margin: 0 0px;
}

    .split-bar:hover {
        background: #8b5a2b;
    }

.split-right {
    flex: 1 1 0;
    background: #fff;
    overflow: auto;
    padding-left: 24px;
}

/* wwwroot/css/site.css */
.form-control, .form-select {
    height: 38px !important;
    min-height: 38px !important;
    box-sizing: border-box;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* Thêm vào cuối site.css để override */
.row .col-md-3,
.row .col-md-1,
.row .col-md-2,
.row .col-md-6 {
    margin-bottom: 0 !important;
}

.weekend-border {
    border-right: 2px solid #007bff !important; /* Màu xanh dương, bạn có thể đổi */
    border-left: 2px solid #007bff !important; /* Màu xanh dương, bạn có thể đổi */
}

.attendance-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.attendance-modal-content {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 600px;
    min-width: 400px;
    width: 90%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    overflow-y: auto;
    max-height: 90vh;
}

.attendance-modal-header,
.attendance-modal-body {
    padding: 1rem;
}

.attendance-btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    float: right;
}

/* Dropdown chọn phòng ban cho AttendanceSheet */
.attendance-dept-dropdown-menu {
    background-color: #fff;
    border: 1px solid #bdbdbd;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 1.5px 4px rgba(0,0,0,0.15);
    filter: none;
    opacity: 1;
    border-radius: 4px;
    padding: 0.5rem 0;
    margin-top: 2px;
}

    .attendance-dept-dropdown-menu .attendance-dept-dropdown-item {
        color: #333;
        font-weight: 500;
        padding: 10px 18px;
        border-radius: 4px;
        background: none;
        border: none;
        width: 100%;
        text-align: left;
    }

        .attendance-dept-dropdown-menu .attendance-dept-dropdown-item:hover,
        .attendance-dept-dropdown-menu .attendance-dept-dropdown-item:focus {
            background-color: #f0f0f0;
            color: #1d3557;
        }

.custom-modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.custom-modal-dialog {
    max-width: none;
    width: auto;
    margin: auto;
    display: table;
}