﻿
/* ==========================================================
   TABLE CONTAINER
========================================================== */

.table-responsive {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e5e7ef;
}

    .table-responsive th {
        position: sticky;
        top: 0;
        background-color: #fff;
        z-index: 2;
        box-shadow: inset 0 -1px 0 #ddd; /* Prevents border loss */
    }

    .table-responsive .container-250 {
        max-height: 250px !important;
    }

    .table-responsive .container-300 {
        max-height: 300px;
    }

    .table-responsive .container-350 {
        max-height: 350px !important;
    }

    .table-responsive .container-400 {
        max-height: 400px !important;
    }

    .table-responsive .container-450 {
        max-height: 450px !important;
    }

    .table-responsive .container-500 {
        max-height: 500px !important;
    }

/* ==========================================================
   COMMON TABLE STYLES
========================================================== */

.markdown > table thead th,
.table thead th {
    font-weight: 500 !important;
    text-transform: none !important;
}

.custom-bordered-table td,
.custom-bordered-table th {
    border: 1px solid #ddd !important;
}

.card-table tr td:first-child,
.card-table tr th:first-child {
    padding-left: 5px !important;
}

.card-table tr td:last-child,
.card-table tr th:last-child {
    padding-right: 5px !important;
}

/* ==========================================================
   DEFAULT TABLE
========================================================== */

.table {
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
}

    .table th {
        font-weight: 500;
        font-size: 12px;
        padding: 5px 8px;
        background: linear-gradient(180deg, #eef2ff, #e0e7ff);
        color: #1f2937;
        text-align: left;
        border-bottom: 1px solid #c7d2fe;
        white-space: nowrap;
    }

    .table thead th {
        background: #f8fafc;
        border-bottom: 2px solid #e2e8f0;
        font-size: 12px;
        font-weight: 500;
        padding: 5px 8px;
        background: linear-gradient(180deg, #eef2ff, #e0e7ff);
        color: #1f2937;
        border-bottom: 1px solid #c7d2fe;
        white-space: nowrap;
    }

    .table td {
        padding: 5px 8px;
        font-size: 13px;
        color: #374151;
        border-bottom: 1px solid #e5e7eb;
        vertical-align: middle;
    }

    .table tbody tr {
        transition: 0.25s;
    }

        .table tbody tr:hover {
            background: #f1f5f9;
        }

    .table td .btn {
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 0.8rem !important;
    }


.table-striped tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.table td:first-child,
.table th:first-child {
    border-left: 3px solid #6366f1;
}

.horizontal th {
    text-align: center !important;
}

.header-td {
    background: linear-gradient(135deg, #f4f6f8, #e6eaee) !important;
    color: #1f2937 !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    text-align: center !important;
}

/* ==========================================================
   ENTRY TABLE
========================================================== */

.entry_table {
    font-size: 0.9rem;
}

    .entry_table .table thead th {
        font-size: 0.85rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
        vertical-align: middle !important;
        text-align: center !important;
    }

    .entry_table .table tbody td {
        vertical-align: middle !important;
        padding: 3px 5px !important;
    }

    .entry_table .table-hover tbody tr:hover {
        background-color: #f8fafc;
    }

    .entry_table .btn-square {
        width: 26px;
        height: 26px;
        border-radius: 5px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 600;
    }

    .entry_table button .btn-success {
        background-color: #28a745;
        border: none;
    }

    .entry_table button .btn-danger {
        background-color: #dc3545;
        border: none;
    }


/* ==========================================================
   GRIDVIEW TABLE
========================================================== */

.table-gv {
    font-size: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
    margin: 0 !important;
}

    .table-gv th,
    .table-gv td {
        padding: 0.28rem 0.45rem;
        vertical-align: middle;
        border: .5px solid #dee2e6;
        font-size: 0.75rem !important;
    }

    .table-gv th {
        position: sticky;
        top: 0;
        z-index: 2;
        background-color: #f3f3f3 !important;
        color: #495057 !important;
        font-weight: bold !important;
    }

    .table-gv td {
        background-color: #fff;
    }

    .table-gv tr:hover {
        background-color: #f1f3f5 !important;
    }

/* ==========================================================
   MODERN TABLE
========================================================== */

.modern-table thead {
    background: #f0f2f7 !important;
    font-size: 12px;
}

.modern-table th {
    font-weight: 500;
    white-space: normal;
}

.modern-table td {
    font-size: 12px !important;
    padding: 5px 10px !important;
    white-space: nowrap !important;
}

.modern-table tbody tr:hover {
    background: #f9fafc !important;
}

.modern-table .text-end button {
    padding: 4px 10px;
}

/* ==========================================================
   REPORT TABLES
========================================================== */

.table_summary {
    min-width: 1000px;
}

    .table_summary th,
    .table_summary td,
    .table_details th,
    .table_details td {
        vertical-align: middle;
        font-size: 13px;
        white-space: nowrap;
    }

    .table_summary thead th {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 2;
    }

    .table_summary .total-row {
        background: linear-gradient(to right, #f3f6f9, #e8f0fe);
        font-weight: 600;
        color: #0d47a1;
        border-top: 2px solid #c5cae9;
    }

    .table_summary tr:hover:not(.total-row),
    .table_details tr:hover {
        background-color: #f9f9f9;
    }

/* ==========================================================
   REPORT INTERACTION
========================================================== */

.clickable-count,
.clickable-total {
    cursor: pointer;
}

    .clickable-count:hover,
    .clickable-total:hover {
        text-decoration: underline;
    }

/* ==========================================================
   REPORT SECTION
========================================================== */

.report-container {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .section-header h5,
    .section-header h6 {
        margin: 0;
        font-weight: 600;
        color: #333;
        font-size: 14px;
    }

.no-data {
    color: #dc3545;
    text-align: center;
    font-weight: 500;
    padding: 10px 0;
}

/* ==========================================================
   RESPONSIVE TABLES
========================================================== */

@media (max-width: 768px) {

    .table,
    .table-gv {
        font-size: 12px;
    }

    .gv-container {
        overflow-x: auto;
    }
}
