
:root {
    --primary-green: #78e671;
    --primary-green-dark: #198754;
    --primary-green-text: #2e3238;
    --primary-green-border: #198754;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", "Segoe UI", sans-serif;
}

body {
    background-repeat: no-repeat;
    background-position: center;
    color: #2e3238;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/IndexLogo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

.layout {
    display: flex;
    flex: 1;
}

/* HEADER */
header {
    background: linear-gradient(90deg, var(--primary-green-dark), var(--primary-green));
    color: var(--primary-green-text);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    z-index: 1000;
}

header h1 {
    color: #E5F7E5;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

header h1 i {
    color: #dbe8ff;
}

/* LOGIN BUTTON */
.login-btn {
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-dark));
    color: var(--primary-green-text);
    border: none;
    font-size: 16px;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--primary-green-dark);
    color: var(--primary-green-text);
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 210px;
    margin-top: 60px;
    padding: 30px;
    background: transparent;
    overflow-y: auto;
    transition: margin 0.3s ease;
}

.main-component {
    margin-top: 40px !important;
}

/* CAMERA PREVIEW BOX */
.camera-box video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

#logTable {
    font-size: 15px;
}

.time-display h2 {
    font-size: 32px;
    margin: 0;
    color: #212529;
    font-weight: 700;
}

.time-display p {
    margin: 0;
    color: #6c757d;
}

/* MODAL LOG IN */
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
}

@media (max-width: 992px) {
    .modal-backdrop.show {
        background-color: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(3px);
    }
}

@media (max-width: 576px) {
    .modal-backdrop.show {
        backdrop-filter: none !important;
        background-color: rgba(0, 0, 0, 0.4) !important;
    }
}

.custom-modalIndex {
    width: 25%;
    max-width: 400px;
    transition: width 0.3s ease;
}

.modal-content {
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-login {
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-dark));
    color: var(--primary-green-text);
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: all 0.3s ease;
}

.input-icons-wrapper button {
    margin-left: 3px;
    margin-right: 3px;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 1rem; 
    display: flex;
    align-items: center;
    justify-content: center;
}

#confirmEmployee:hover {
    background-color: var(--primary-green);
}

#resetEmployee:hover {
    background-color: var(--primary-green);
}

.btn-login:hover {
    background: var(--primary-green-dark);
    color: var(--primary-green-text);
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

@media (max-width: 992px) {
    .main-component .row {
        flex-direction: column;
        align-items: center;
    }

    .camera-box {
        width: 90%;
        max-width: 600px;
        margin: 0 auto;
    }

    .camera-box video {
        height: 280px;
    }

    .log-box {
        width: 95%;
        margin-top: 20px;
    }

    .custom-modalIndex {
        width: 50%;
    }
}

@media (max-width: 576px) {
    .camera-box {
        width: 100%;
        max-width: 600px;
    }

    .camera-box video {
        height: 250px;
    }

    #logTable {
        font-size: 14px;
    }

    .log-box {
        padding: 10px;
    }

    .custom-modalIndex {
        width: 85%;
        max-width: none;
    }
}   

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #ffffff;
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    transition: all 0.3s ease;
    z-index: 1050;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 12px 20px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
    border-radius: 0 6px 6px 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #343a40;
    text-decoration: none;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(207,252,204,0.2), rgba(25,135,84,0.1));
    border-left: 4px solid var(--primary-green-dark);
    color: var(--primary-green-dark);
    font-weight: 600;
    box-shadow: inset 0 0 8px rgba(13, 110, 253, 0.08);
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 70px;
        height: calc(100vh - 60px);
        box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
        z-index: 1050;
    }
    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1040;
        display: none;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding-left: 0 !important;
        position: relative;
        z-index: 1;
    }

    .custom-modalMain {
        width: 50% !important;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 200px;
        padding: 15px 0;
        box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    }

    .sidebar li {
        padding: 12px 15px;
        font-size: 14px;
    }

    .sidebar .nav-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .custom-modalMain {
        width: 95% !important;
    }
}

/* MY PROFILE */
.custom-modalMain {
    width: 25%;
    max-width: 400px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(125, 231, 125, 0.25);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    background: #ffffff;
}

.profile-card .card-header {
    background: linear-gradient(90deg, var(--primary-green), var(--primary-green-dark));
    color: var(--primary-green-text);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
}

.profile-card .card-body {
    font-size: 15px;
    color: #333;
    padding: 15px;
}

.profile-card .row {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-card .row:last-child {
    border-bottom: none;
}

@media (max-width: 992px) {
    .custom-modalMain {
        width: 50%;
        max-width: none;
    }
    .profile-card .card-body {
        font-size: 14.5px;
    }
    .profile-card .card-header {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .custom-modalMain {
        width: 95% !important;
        max-width: none;
        margin: 0 auto;
    }
    .profile-card {
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    }
    .profile-card .card-header {
        font-size: 14px;
        text-align: center;
    }
    .profile-card .card-body {
        font-size: 14px;
    }
    .profile-card .row {
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 6px 0;
    }
}

/* REQUEST LEAVES */
.customBox {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.leave-table,
.overtime-table,
.canteen-table,
.cav-table {
    margin: 10px;
}

@media (max-width: 992px) {
    #leaveModal .modal-dialog {
        max-width: 85%;
        margin: 0.8rem auto;
    }

    #overtimeModal .modal-dialog {
        max-width: 85%;
        margin: 0.8rem auto;
    }

    #canteenModal .modal-dialog {
        max-width: 85%;
        margin: 0.8rem auto;
    }

    #cavModal .modal-dialog {
        max-width: 85%;
        margin: 0.8rem auto;
    }

    #leaveModal .modal-content,
    #overtimeModal .modal-content,
    #canteenModal .modal-content,
    #cavModal .modal-content {
        border-radius: 10px;
        padding: 8px;
    }

    .leave-table table,
    .overtime-table table,
    .canteen-table table,
    .cav-table table {
        width: 100%;
        font-size: 0.9rem;
    }

    table.table th,
    table.table td {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 130px;
    }
}

@media (max-width: 576px) {
    #leaveModal .modal-dialog {
        max-width: 95%;
        margin: 0.3rem auto;
    }

    #overtimeModal .modal-dialog {
        max-width: 95%;
        margin: 0.3rem auto;
    }

    #canteenModal .modal-dialog {
        max-width: 95%;
        margin: 0.3rem auto;
    }

    #cavModal .modal-dialog {
        max-width: 95%;
        margin: 0.3rem auto;
    }

    #leaveModal .modal-content,
    #overtimeModal .modal-content,
    #canteenModal .modal-content,
    #cavModal .modal-content {
        border-radius: 10px;
        padding: 5px;
    }

    .leave-table,
    .overtime-table,
    .canteen-table,
    .cav-table {
        display: flex;
        justify-content: center;
        margin: 5px 0;
    }

    .leave-table table,
    .overtime-table table,
    .canteen-table table,
    .cav-table table {
        width: auto;
        margin: 0 auto;
        font-size: 0.85rem;
    }

    table.table th,
    table.table td {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 90px;
    }
}

/* HOME */
.custom-modal {
    max-width: 90%;
    overflow: auto;
}

.employee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 24px;
    justify-content: center;
}

.employee-card.system-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--primary-green);
    border-radius: 18px;
    width: 380px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    cursor: pointer;
}

.employee-card.system-card:hover {
    box-shadow: 0 8px 32px var(--primary-green-border);
    transform: translateY(-4px) scale(1.02);
}

.emp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.emp-card-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.emp-name {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--primary-green-dark);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.emp-position {
    font-size: 0.95em;
    color: #607d8b;
    font-weight: 500;
}

.emp-card-photo {
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 18px;
}

.emp-card-photo img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--primary-green);
    background: #fff;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

hr {
    border: none;
    border-top: 1.5x solid #e3f2fd;
    margin: 12px 0 10px 0;
}

.emp-card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95em;
}

.emp-row-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emp-label {
    font-weight: 600;
    color: var(--primary-green-dark);
    min-width: 120px;
}

.emp-value {
    color: #37474f;
    font-weight: 500;
    text-align: right;
}

.search-container {
    position: relative;
}

#employeeSearchInput #departmentSearchInput {
    padding-right: 35px;
    border-radius: 10px;
    border-color: var(--primary-green-border);
    border: 1px solid var(--primary-green);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#employeeSearchInput:focus {
    border-color: var(--primary-green-border);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

#departmentSearchInput:focus {
    border-color: var(--primary-green-border);
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
}

.clear-search-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #90a4ae;
    font-size: 1rem;
    z-index: 2;
    display: none;
}

.clear-search-icon:hover {
    color: var(--primary-green-border);
}

.emp-card-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.emp-menu-toggle {
    font-size: 18px;
    color: var(--primary-green-border);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.emp-menu-toggle:hover {
    background-color: rgba(21, 101, 192, 0.1);
}


.dropdown-menu {
    font-size: 0.9rem;
    min-width: 180px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(25, 135, 84, 0.35);
    border: 1px solid #e3f2fd;
}

.modal-backdrop.show:nth-of-type(2) {
    display: none !important;
}

.modal-backdrop {
    z-index: 1080 !important;
}

.modal {
    z-index: 1090 !important;
}

@media (max-width: 992px) {
    .employee-card.system-card {
        width: calc(50% - 20px);
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .emp-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100%;
    }

    .employee-card.system-card {
        width: 100%;
        max-width: 350px;
    }
    
    .emp-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .emp-card-menu {
        top: 4px;
        right: 4px;
    }
}

/* PAYSLIP */
.payslip-table {
    margin: 10px;
}

.payroll-table {
    margin: 10px;
}

.nowrap-column {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .payslip-table .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .payslip-table table {
        width: 100%;
        font-size: 0.95rem;
    }

    .payslip-table th,
    .payslip-table td {
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .payslip-table {
        display: flex;
        justify-content: center;
    }

    .payslip-table .table-responsive {
        width: 95%;
        margin: 0 auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .payslip-table table {
        width: auto;
        min-width: 500px;
        margin: 0 auto;
        font-size: 0.9rem;
    }

    .payslip-table th,
    .payslip-table td {
        text-align: center;
        padding: 8px 6px;
    }
}

select.form-select:hover,
select.form-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.25rem rgba(120, 230, 113, 0.25);
}

select.form-select option:hover {
    background-color: var(--primary-green);
    color: #fff;
}

select.form-select:focus {
    outline: none;
}

input[type="date"]:hover,
input[type="time"]:hover,
input[type="date"]:focus,
input[type="time"]:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.25rem rgba(120, 230, 113, 0.25);
    outline: none;
}

input[type="date"],
input[type="time"] {
    accent-color: var(--primary-green);
}

.dropdown-menu.p-3 {
    max-height: 300px;
    overflow-y: auto; 
    width: 250px; 
    z-index: 1050; 
    position: absolute; 
}

.dropdown-menu.p-3 label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.dropdown-menu.p-3 input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.form-select, .btn {
    height: 38px;
}

.maintenance {
    text-align: center;
    color: #333;
    margin-top: 15%;
}

.gear {
    font-size: 60px;
    color: var(--primary-green-border);
    animation: spin 2s linear infinite;
    display: inline-block;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* LIST VIEW MODAL */
#inAndOutModal .modal-dialog {
    max-width: 500px;
    margin: 1rem auto;
    z-index: 1050;
}

body.modal-open {
    overflow-y: hidden;
}

.attendance-table {
    margin: 10px;
}

#filterDepartment {
    min-width: 150px;
}

#employeeSearchInput {
    width: 100%;
}

#locationModal .modal-dialog {
    max-width: 90%;
}

#locationModal .modal-body {
    height: 80vh;
}

#locationMap {
    width: 100%;
    height: 700px !important;
}

@media (max-width: 576px) {
    #inAndOutModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }

    #inAndOutModal .modal-content {
        border-radius: 12px;
    }

    #inAndOutModal .camera-box {
        padding: 10px;
    }

    #inAndOutModal video {
        border-radius: 8px;
        width: 100%;
    }

    .attendance-table {
        display: flex;
        justify-content: center;
        overflow-x: auto;
        padding: 0 5px;
    }

    .attendance-table table {
        width: auto;
        margin: 0 auto;
        font-size: 13px;
        border-collapse: collapse;
        max-width: 100%;
    }

    .attendance-table th,
    .attendance-table td {
        padding: 6px 8px;
        text-align: center;
        white-space: nowrap;
    }
}

/* Change Shift */
.changeshift-table {
    margin: 10px;
}

.nowrap-column {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .changeshift-table .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .changeshift-table table {
        width: 100%;
        font-size: 0.95rem;
    }

    .changeshift-table th,
    .changeshift-table td {
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .changeshift-table {
        display: flex;
        justify-content: center;
    }

    .changeshift-table .table-responsive {
        width: 95%;
        margin: 0 auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .changeshift-table table {
        width: auto;
        min-width: 500px;
        margin: 0 auto;
        font-size: 0.9rem;
    }

    .changeshift-table th,
    .changeshift-table td {
        text-align: center;
        padding: 8px 6px;
    }
}

/* Audit Trail */
.audittrail-table {
    margin: 10px;
}

.nowrap-column {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .audittrail-table .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .audittrail-table table {
        width: 100%;
        font-size: 0.95rem;
    }

    .audittrail-table th,
    .audittrail-table td {
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .audittrail-table {
        display: flex;
        justify-content: center;
    }

    .audittrail-table .table-responsive {
        width: 95%;
        margin: 0 auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .audittrail-table table {
        width: auto;
        min-width: 500px;
        margin: 0 auto;
        font-size: 0.9rem;
    }

    .audittrail-table th,
    .audittrail-table td {
        text-align: center;
        padding: 8px 6px;
    }
}

.dataTables_filter {
    display: none !important;
}

@media (max-width: 576px) {
    .camera-box video {
        width: 100% !important;
        height: 240px !important;
    }

    .custom-modalIndex {
        width: 90% !important;
        max-width: none !important;
    }

    .custom-modalMain {
        width: 95% !important;
        max-width: none !important;
        height: auto !important;
    }

    .sidebar {
        width: 200px !important;
        height: calc(100vh - 70px) !important;
    }

    .employee-card.system-card {
        width: 100% !important;
        max-width: 340px !important;
    }

    #logTable {
        font-size: 14px !important;
    }

    table.table th,
    table.table td {
        max-width: 90px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .profile-card {
        width: 100% !important;
        max-width: 380px !important;
        margin: 0 auto !important;
    }
}
