@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');

/* ======= Table Wrapper ======= */
.wrapTable {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.tableContainer {
    background-color: #fff;
    position: relative;
    flex: 1;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.tableContainer-head {
    position: sticky;
    top: 0;
    background: #fff; /* Keeps header visible while scrolling */
    z-index: 10;
}

.tableContainer-body {
    display: block;
    max-height: 500px; /* Ensures vertical scrolling if needed */
    overflow-y: auto; /* Enables scrollbar only in body */
    overflow-x: auto; /* Enables horizontal scrolling if needed */
    white-space: nowrap;
}

/* ======= Scrollable Table ======= */
.table-scroll {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling */
    overflow-y: auto; /* Enables vertical scrolling */
    display: block;
    min-height: 500px; /* Ensures a minimum height */
    max-height: calc(100vh - 210px); /* Prevents the table from exceeding the screen height */
    white-space: nowrap; /* Prevents text wrapping */
}

/* ======= Table Structure ======= */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* Allow dynamic width */
}

/* ======= Table Header ======= */
thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

/* ======= Table Columns (Dynamic) ======= */
th,
td {
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    /* border: 1px solid #ddd; */
    min-width: 150px; /* Ensures columns are visible */
    word-wrap: break-word;
}

/* Ensures header and body columns align */
th {
    background: #f4f6f8;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    /* color: #fa4251; */
    color: #637481;
    font-weight: 700;
}

td {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #484848;
}

tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

th:first-child,
td:first-child {
    padding-left: 24px !important; /* Ensures consistent left padding */
}

.cell-mini {
    min-width: 80px;
}

.cell-mini-2 {
    min-width: 60px;
}

/* ========== SEARCH INPUT ========== */

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.table-title {
    font-size: 18px;
    line-height: 1.35;
    font-weight: bold;
    color: #333;
    display: flex;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.refresh-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    /* font-size: 30px; */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-button > span {
    font-size: 20px;
    line-height: 1;
}

.status-filter {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    max-height: 40px;
}

.date-picker {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    max-height: 40px;
}

.search-box {
    width: 250px;
    padding: 10px;
    padding-right: 35px; /* Space for the clear icon */
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    max-height: 40px;
}

.clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #999;
    display: none; /* Hidden by default */
}

.clear-icon:hover {
    color: #333;
}

#tableDashboard {
    gap: 16px;
    display: flex;
}

.dashbord-item {
    font-size: 14px;
}

.dashbord-item span {
    font-weight: 600;
    line-height: 18px !important;
}

/* ======= No data ======= */

.no-data {
    text-align: center;
    font-style: italic;
    color: #777;
    padding: 50px;
}

/* ======= Responsive Adjustments ======= */
@media (max-width: 768px) {
    th,
    td {
        padding: 8px;
        font-size: 14px;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
        flex-wrap: wrap;
    }

    #searchInput {
        flex: 1;
    }

    .table-scroll {
        max-height: calc(100vh - 170px);
    }

    .site-content {
        padding-top: 60px !important;
    }

    #tableDashboard {
        gap: 12px;
        /* flex-direction: column; */
    }
}

@media (max-width: 480px) {
    .wrapTable {
        padding: 16px;
    }
}

.swal2-input {
    color: white !important;
}
