/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.leave-maintenance-container {
    padding: 20px;
    width: 100%;
}


/* =========================================================
   HEADER
   ========================================================= */

.page-header {
    margin-bottom: 18px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 20px;
    font-weight: 600;
    color: #202124;
}

    .page-title i {
        font-size: 19px;
    }


/* =========================================================
   MODULE BUTTONS
   ========================================================= */

.module-buttons {
    display: flex;
    gap: 7px;
}

.module-btn {
    background: #fff;
    border: 1px solid #3788ff;
    color: #1677ff;
    border-radius: 5px;
    padding: 8px 14px;
    font-size: 14px;
    transition: all .15s ease;
}

    .module-btn:hover {
        background: #f0f7ff;
    }

    .module-btn.active {
        background: #1976d2;
        color: #fff;
    }


/* =========================================================
   FILTER PANEL
   ========================================================= */

.filter-panel {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
}

.filter-field {
    min-width: 210px;
}

    .filter-field label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 5px;
    }

.search-field {
    flex: 1;
}

.filter-actions {
    display: flex;
    gap: 7px;
}

    .filter-actions .btn {
        min-width: 105px;
        height: 38px;
    }


/* =========================================================
   TABLE
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.maintenance-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    font-size: 13px;
}

    .maintenance-table thead th {
        background: #f7f8fa;
        color: #111;
        font-weight: 600;
        border: 1px solid #dee2e6;
        padding: 9px 10px;
        white-space: nowrap;
        text-align: center;
    }

    .maintenance-table tbody td {
        border: 1px solid #dee2e6;
        padding: 8px 10px;
        vertical-align: middle;
        background: #fff;
    }

    .maintenance-table tbody tr:hover td {
        background: #f7fbff;
    }


/* =========================================================
   BADGES
   ========================================================= */

.code-badge {
    display: inline-block;
    background: #eef4ff;
    color: #1967d2;
    border-radius: 4px;
    padding: 3px 8px;
    font-weight: 600;
    font-size: 12px;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.description-cell {
    max-width: 300px;
}

    .description-cell span {
        display: inline-block;
        max-width: 280px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        vertical-align: middle;
    }


/* =========================================================
   ACTION BUTTON
   ========================================================= */

.action-btn {
    width: 32px;
    height: 30px;
    padding: 0;
    margin: 0 2px;
}


/* =========================================================
   FORM CARD
   ========================================================= */

.form-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.form-card-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: #1976d2;
    color: #fff;
    border-radius: 5px 5px 0 0;
}

    .form-card-header h5 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }

    .form-card-header small {
        opacity: .85;
    }

.back-button {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.form-card-body {
    padding: 20px;
}


/* =========================================================
   SETTINGS BOX
   ========================================================= */

.settings-box {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    background: #fafafa;
}


/* =========================================================
   FORM ACTIONS
   ========================================================= */

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}


/* =========================================================
   MOBILE CARDS
   ========================================================= */

.maintenance-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions {
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

    .card-actions .btn {
        flex: 1;
    }


/* =========================================================
   LEDGER
   ========================================================= */

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1967d2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.ledger-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
}

    .ledger-summary div {
        background: #f7f8fa;
        border-radius: 5px;
        padding: 9px;
        text-align: center;
    }

    .ledger-summary span {
        display: block;
        font-size: 11px;
        color: #777;
    }

    .ledger-summary strong {
        display: block;
        font-size: 15px;
        margin-top: 3px;
    }


/* =========================================================
   REMAINING BALANCE
   ========================================================= */

.remaining-success {
    color: #198754;
    font-weight: 700;
}

.remaining-warning {
    color: #d88a00;
    font-weight: 700;
}

.remaining-danger {
    color: #dc3545;
    font-weight: 700;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: #6c757d;
    gap: 10px;
}


/* =========================================================
   EMPTY
   ========================================================= */

.empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #777;
    border: 1px solid #eee;
    background: #fafafa;
}

    .empty-container i {
        font-size: 38px;
        margin-bottom: 10px;
        color: #aaa;
    }


/* =========================================================
   DELETE MODAL
   ========================================================= */

.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.custom-modal {
    width: 450px;
    max-width: calc(100% - 30px);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    overflow: hidden;
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid #dee2e6;
}

    .custom-modal-header h5 {
        margin: 0;
        font-size: 16px;
    }

.custom-modal-body {
    padding: 20px;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #dee2e6;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .leave-maintenance-container {
        padding: 12px;
    }

    .filter-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-field {
        width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

        .filter-actions .btn {
            flex: 1;
        }

    .module-buttons {
        overflow-x: auto;
    }

    .module-btn {
        white-space: nowrap;
    }
}

/* =========================================================
           LEDGER ADJUSTMENT
           ========================================================= */

.adjustment-modal {
    max-width: 550px;
    width: 95%;
}


.ledger-adjustment-info {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
}


.adjustment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 7px 0;
    border-bottom: 1px solid #e9ecef;
}


    .adjustment-info-row:last-child {
        border-bottom: none;
    }


    .adjustment-info-row span {
        color: #6c757d;
    }


    .adjustment-info-row strong {
        color: #212529;
        text-align: right;
    }


/* =========================================================
           PREVIEW
           ========================================================= */

.adjustment-preview {
    border-radius: 10px;
    padding: 15px;
    border: 1px solid;
}


.adjustment-preview-positive {
    background: #f0fdf4;
    border-color: #bbf7d0;
}


.adjustment-preview-negative {
    background: #fff7ed;
    border-color: #fed7aa;
}


.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}


    .preview-row span {
        color: #6c757d;
    }


    .preview-row strong {
        color: #212529;
    }


/* =========================================================
           ACTION BUTTONS
           ========================================================= */

.action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}


/* =========================================================
           MOBILE
           ========================================================= */

@media (max-width: 767px) {

    .adjustment-modal {
        width: 94%;
    }

    .adjustment-info-row {
        font-size: 14px;
    }
}
