﻿/* =========================================================
   CODAL REPORTS
   Table + Filters + Pagination + Persian Datepicker
========================================================= */


/* =========================================================
   1. REPORT TABLE
========================================================= */

.report-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
 
    background: #fff;

    border: 1px solid #dce4ee;
    border-radius: 10px;
}


/* Column widths */

.report-table th:nth-child(1),
.report-table td:nth-child(1) {
    width: 55%;
}

.report-table th:nth-child(2),
.report-table td:nth-child(2) {
    width: 25%;
}

.report-table th:nth-child(3),
.report-table td:nth-child(3) {
    width: 20%;
}


/* Header */

.report-table thead th {
    padding: 14px 18px;

    background: #074390;
    color: #fff;

    text-align: right;
    vertical-align: middle;

    border-left: 1px solid rgba(255, 255, 255, 0.15);

    font-weight: 500;
}

.report-table thead th:last-child {
    border-left: 0;
}


/* Body cells */

.report-table tbody td {
    padding: 14px 18px;

    vertical-align: middle;

    border-bottom: 1px solid #e4e9ef;

    color: #344054;
}


/* Zebra */

.report-table tbody tr:nth-child(odd) {
    background: #fff;
}

.report-table tbody tr:nth-child(even) {
    background: #f5f8fb;
}


/* Row hover */

.report-table tbody tr {
    transition: background-color 0.2s ease;
}

.report-table tbody tr:hover {
    background: #eaf1f8;
}


/* Last row */

.report-table tbody tr:last-child td {
    border-bottom: 0;
}


/* Long title */

.report-table .col-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   2. DOWNLOAD LINK
========================================================= */

.report-table .download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #074390;

    text-decoration: none;
    white-space: nowrap;

    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.report-table .download-link:hover {
    color: #0a58b7;
    text-decoration: none;

    transform: translateY(-1px);
}

.report-table .download-link span {
    font: inherit;
}


/* FontAwesome download icon */

.report-table .download-link i {
    margin: 0;

    font-size: 15px;
    line-height: 1;

    flex-shrink: 0;
}


/* PDF SVG */

.report-table .pdf-download-icon {
    display: block;

    width: 20px;
    height: 20px;

    flex: 0 0 20px;

    color: inherit;
}


/* =========================================================
   3. FILTER BOX
========================================================= */

.codal-filter-box {
    display: flex;
    align-items: flex-end;

    width: 100%;

    gap: 14px;

    margin-bottom: 18px;
    padding: 18px;

    direction: rtl;

    background: #f8fafc;

    border: 1px solid #dce4ee;
    border-radius: 10px;
}


/* Filter item */

.codal-filter-item {
    display: flex;
    flex-direction: column;

    gap: 7px;

    flex: 0 0 280px;

    min-width: 0;
}

.codal-filter-item.codal-search-item {
    flex: 1 1 auto;
}


/* Label */

.codal-filter-item label {
    margin: 0;

    color: #344054;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
}


/* =========================================================
   4. FILTER INPUTS
========================================================= */

.codal-input-wrapper {
    position: relative;

    width: 100%;
}


/* Text fields */

.codal-input-wrapper input[type="text"] {
    width: 100%;
    height: 44px;

    padding: 0 42px 0 14px;

    background: #fff;
    color: #344054;

    border: 1px solid #dce4ee;
    border-radius: 8px;

    outline: none;

    font-family: inherit;
    font-size: 14px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.codal-input-wrapper input[type="text"]::placeholder {
    color: #98a2b3;
}

.codal-input-wrapper input[type="text"]:hover {
    border-color: #b8c9dd;
}

.codal-input-wrapper input[type="text"]:focus {
    background: #fff;

    border-color: #074390;

    box-shadow:
        0 0 0 3px rgba(7, 67, 144, 0.08);
}


/* Input icon */

.codal-input-wrapper > i {
    position: absolute;

    top: 50%;
    right: 15px;

    z-index: 2;

    color: #7b8794;

    font-size: 14px;

    pointer-events: none;

    transform: translateY(-50%);

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.codal-input-wrapper:focus-within > i {
    color: #074390;
}


/* =========================================================
   5. DATE INPUT
========================================================= */

.codal-date-wrapper {
    cursor: pointer;
}

.codal-date-wrapper input[type="text"] {
    cursor: pointer;

    caret-color: transparent;
}

.codal-date-wrapper input[type="text"]:hover {
    background: #fbfdff;

    border-color: #aebfd2;
}

.codal-date-wrapper > i {
    color: #074390;
}

.codal-date-wrapper:focus-within > i {
    transform:
        translateY(-50%)
        scale(1.06);
}


/* =========================================================
   6. CLEAR FILTER BUTTON
========================================================= */

.codal-filter-actions {
    display: flex;
    align-items: center;
}

.codal-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    height: 44px;

    padding: 0 18px;

    background: #fff;
    color: #667085;

    border: 1px solid #dce4ee;
    border-radius: 8px;

    outline: none;

    cursor: pointer;

    white-space: nowrap;

    font-family: inherit;
    font-size: 13px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.codal-clear-filter i {
    font-size: 12px;
}

.codal-clear-filter:hover {
    background: #f3f7fb;

    color: #074390;

    border-color: #b8c9dd;

    transform: translateY(-1px);
}


/* =========================================================
   7. EMPTY RESULT
========================================================= */

.codal-no-result {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 70px;

    gap: 9px;

    color: #667085;
}

.codal-no-result i {
    color: #98a2b3;

    font-size: 16px;
}

.report-table tbody tr.codal-empty-row,
.report-table tbody tr.codal-empty-row:hover {
    background: #fff;
}


/* =========================================================
   8. PAGINATION
========================================================= */

.codal-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 28px;

    direction: rtl;
}


.codal-pagination .pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 40px;

    padding: 0 13px;

    background: transparent;
    color: #5f6b7a;

    border: 1px solid #e1e6ec;
    border-radius: 8px;

    cursor: pointer;

    font-family: inherit;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Pagination hover */

.codal-pagination .pagination-btn:hover:not(:disabled):not(.active) {
    background: #f3f7fb;

    color: #074390;

    border-color: #b8c9dd;

    transform: translateY(-1px);
}


/* Active */

.codal-pagination .pagination-btn.active {
    background: #074390;

    color: #fff;

    border-color: #074390;

    box-shadow:
        0 4px 12px rgba(7, 67, 144, 0.18);
}


/* Disabled */

.codal-pagination .pagination-btn:disabled {
    background: #f8f9fb;

    color: #b8bec7;

    border-color: #edf0f3;

    cursor: default;

    opacity: 1;
}


/* Previous / Next */

.codal-pagination .pagination-btn:first-child,
.codal-pagination .pagination-btn:last-child {
    min-width: 72px;

    padding: 0 16px;
}


/* =========================================================
   PERSIAN DATEPICKER - FINAL THEME
========================================================= */

#jalaliDatepicker {
    width: 340px !important;
    max-width: calc(100vw - 24px) !important;

    padding: 14px !important;

    background: #ffffff !important;
    color: #344054 !important;

    border: 1px solid #dce4ee !important;
    border-radius: 14px !important;

    box-shadow:
        0 20px 45px rgba(15, 38, 66, 0.15),
        0 5px 15px rgba(15, 38, 66, 0.06) !important;

    font-family: inherit !important;

    direction: rtl !important;

    z-index: 999999 !important;

    overflow: hidden !important;
}


/* =========================================================
   HEADER
========================================================= */

#jalaliDatepicker .pdhheader {
    display: grid !important;

    grid-template-columns:
        36px
        36px
        1fr
        1.25fr
        36px
        36px !important;

    align-items: center !important;

    gap: 5px !important;

    margin: 0 0 14px !important;
    padding: 8px !important;

    background: #074390 !important;

    border-radius: 10px !important;
}


/* =========================================================
   HEADER BUTTONS
========================================================= */

#jalaliDatepicker .pdhheader button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: rgba(255,255,255,0.12) !important;
    color: #ffffff !important;

    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 7px !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1 !important;

    cursor: pointer !important;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        transform .2s ease !important;
}

#jalaliDatepicker .pdhheader button:hover {
    background: rgba(255,255,255,0.24) !important;

    border-color: rgba(255,255,255,0.4) !important;

    transform: translateY(-1px) !important;
}


/* =========================================================
   YEAR / MONTH SELECT
========================================================= */

#jalaliDatepicker .pdhheader select {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;

    margin: 0 !important;

    padding: 0 8px !important;

    background: rgba(255,255,255,0.12) !important;
    color: #ffffff !important;

    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 7px !important;

    outline: none !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-size: 12px !important;

    cursor: pointer !important;
}

#jalaliDatepicker .pdhheader select:hover,
#jalaliDatepicker .pdhheader select:focus {
    background: rgba(255,255,255,0.18) !important;

    border-color: rgba(255,255,255,0.45) !important;
}


/* Dropdown options */

#jalaliDatepicker .pdhheader select option {
    background: #ffffff !important;
    color: #344054 !important;
}


/* =========================================================
   CALENDAR GRID
========================================================= */

#jalaliDatepicker .calendar-grid {
    display: grid !important;

    grid-template-columns: repeat(7, 1fr) !important;

    width: 100% !important;

    gap: 4px !important;
}


/* Week names */

#jalaliDatepicker .day-pdhheader {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    height: 32px !important;

    color: #7c8798 !important;

    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 500 !important;

    user-select: none !important;
}


/* Friday */

#jalaliDatepicker .day-pdhheader.friday {
    color: #d92d20 !important;
}


/* =========================================================
   EMPTY CELLS
========================================================= */

#jalaliDatepicker .empty-cell {
    height: 38px !important;
}


/* =========================================================
   DAYS
========================================================= */

#jalaliDatepicker .day-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;
    color: #344054 !important;

    border: none !important;
    border-radius: 8px !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    cursor: pointer !important;

    transition:
        background-color .18s ease,
        color .18s ease,
        transform .18s ease,
        box-shadow .18s ease !important;
}


/* Day hover */

#jalaliDatepicker .day-cell:hover {
    background: #edf4fc !important;

    color: #074390 !important;

    transform: translateY(-1px) !important;
}


/* =========================================================
   TODAY
========================================================= */

#jalaliDatepicker .day-cell.today {
    background: #eef4fb !important;

    color: #074390 !important;

    font-weight: 600 !important;

    box-shadow:
        inset 0 0 0 1px #b9cde3 !important;
}


/* =========================================================
   SELECTED DAY
========================================================= */

#jalaliDatepicker .day-cell.selected-day {
    background: #074390 !important;

    color: #ffffff !important;

    font-weight: 600 !important;

    box-shadow:
        0 5px 12px rgba(7, 67, 144, .22) !important;
}

#jalaliDatepicker .day-cell.selected-day:hover {
    background: #063a7d !important;

    color: #ffffff !important;
}


/* Today + selected */

#jalaliDatepicker .day-cell.today.selected-day {
    background: #074390 !important;

    color: #ffffff !important;

    box-shadow:
        0 5px 12px rgba(7, 67, 144, .22) !important;
}


/* =========================================================
   OFFICIAL HOLIDAYS
========================================================= */

#jalaliDatepicker .day-cell.holiday-official {
    color: #d92d20 !important;
}

#jalaliDatepicker .day-cell.holiday-official:hover {
    background: #fff1f0 !important;

    color: #c51f17 !important;
}


/* اگر تعطیل انتخاب شد */

#jalaliDatepicker .day-cell.holiday-official.selected-day {
    background: #074390 !important;

    color: #ffffff !important;
}


/* =========================================================
   BOTTOM ACTIONS
   کتابخانه روی این دکمه‌ها Inline Style دارد
========================================================= */

#jalaliDatepicker .go-today-btn,
#jalaliDatepicker .clear-btn {
    height: 38px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    border-radius: 8px !important;

    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    cursor: pointer !important;

    box-shadow: none !important;

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease !important;
}


/* امروز */

#jalaliDatepicker .go-today-btn {
    flex: 2 1 0 !important;

    background: #074390 !important;

    color: #ffffff !important;

    border: 1px solid #074390 !important;
}

#jalaliDatepicker .go-today-btn:hover {
    background: #ffffff !important;

    color: #074390 !important;

    border-color: #074390 !important;

    transform: translateY(-1px) !important;
}


/* خالی */

#jalaliDatepicker .clear-btn {
    flex: 1 1 0 !important;

    background: #ffffff !important;

    color: #667085 !important;

    border: 1px solid #dce4ee !important;
}

#jalaliDatepicker .clear-btn:hover {
    background: #f6f8fb !important;

    color: #344054 !important;

    border-color: #b8c9dd !important;

    transform: translateY(-1px) !important;
}


/* =========================================================
   DATE INPUT
========================================================= */

.codal-date-wrapper {
    cursor: pointer;
}

.codal-date-wrapper input.date-input-field {
    cursor: pointer !important;

    caret-color: transparent !important;
}

.codal-date-wrapper input.date-input-field:hover {
    background: #fbfdff !important;

    border-color: #b8c9dd !important;
}

.codal-date-wrapper input.date-input-field:focus {
    background: #ffffff !important;

    border-color: #074390 !important;

    box-shadow:
        0 0 0 3px rgba(7, 67, 144, .08) !important;
}

.codal-date-wrapper > i {
    color: #074390 !important;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 576px) {

    #jalaliDatepicker {
        width: calc(100vw - 24px) !important;

        max-width: 340px !important;

        padding: 10px !important;

        border-radius: 12px !important;
    }


    #jalaliDatepicker .pdhheader {
        grid-template-columns:
            32px
            32px
            1fr
            1.2fr
            32px
            32px !important;

        gap: 4px !important;

        padding: 6px !important;
    }


    #jalaliDatepicker .pdhheader button {
        width: 32px !important;
        min-width: 32px !important;
        height: 34px !important;
    }


    #jalaliDatepicker .pdhheader select {
        height: 34px !important;

        padding: 0 5px !important;

        font-size: 11px !important;
    }


    #jalaliDatepicker .calendar-grid {
        gap: 2px !important;
    }


    #jalaliDatepicker .day-cell {
        height: 35px !important;
        min-height: 35px !important;

        font-size: 11px !important;
    }


    #jalaliDatepicker .day-pdhheader {
        height: 30px !important;

        font-size: 11px !important;
    }

}