/* Global responsive enhancements for AdminLTE admin panel */

@media (max-width: 991.98px) {
    .layout-fixed .wrapper .content-wrapper {
        padding-top: calc(3.5rem + 2px);
    }

    .content-wrapper > .content {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .content-header {
        padding: 0.75rem 0.65rem;
    }

    .content-header h1 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .content-header .breadcrumb {
        float: none !important;
        flex-wrap: wrap;
        padding-left: 0;
        margin-top: 0.35rem;
    }

    .main-sidebar .nav-link {
        padding: 0.7rem 1rem;
    }

    .main-sidebar .nav-link p {
        font-size: 0.95rem;
    }
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding-bottom: 0.5rem;
    }

    .content-wrapper > .content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-group {
        margin-bottom: 0.65rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.35rem;
    }

    .btn-block-xs {
        display: block;
        width: 100%;
        margin-bottom: 0.35rem;
    }

    .main-header {
        position: fixed;
        width: 100%;
        z-index: 1030;
    }

    input[type="date"],
    input[type="datetime-local"],
    input.form-control:not(textarea),
    select.form-control:not([multiple]):not([size]) {
        min-height: 44px;
        font-size: 16px;
        line-height: 1.25;
        padding-top: calc((44px - 1.25em - 2px) / 2);
        padding-bottom: calc((44px - 1.25em - 2px) / 2);
    }

    input.form-control.form-control-sm:not(textarea),
    select.form-control.form-control-sm:not([multiple]):not([size]) {
        min-height: 40px;
        padding-top: calc((40px - 1.25em - 2px) / 2);
        padding-bottom: calc((40px - 1.25em - 2px) / 2);
    }

    .select2-container--bootstrap4 .select2-selection--single {
        height: 44px !important;
        min-height: 44px !important;
    }

    .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
        line-height: 44px !important;
    }

    .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
        height: 44px;
    }

    select.form-control-sm + .select2-container--bootstrap4 .select2-selection--single {
        height: 40px !important;
        min-height: 40px !important;
    }

    select.form-control-sm + .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
        line-height: 40px !important;
    }

    select.form-control-sm + .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
        height: 40px;
    }

    .receipt-upload-container {
        text-align: center;
    }

    .receipt-preview {
        max-width: 100%;
        height: auto;
    }

    /* DataTables toolbar on mobile */
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        text-align: left;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }

    .dataTables_wrapper .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dt-buttons .btn {
        flex: 1 1 calc(50% - 0.35rem);
        margin: 0 !important;
    }

    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
        padding-left: 2rem;
    }

    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
        top: 50%;
        transform: translateY(-50%);
        line-height: 1;
    }

    table.dataTable > tbody > tr.child ul.dtr-details {
        width: 100%;
    }

    table.dataTable > tbody > tr.child ul.dtr-details > li {
        border-bottom: 1px solid #eef1f4;
        padding: 0.45rem 0;
    }

    .form-row {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
    }

    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .content-wrapper {
        padding: 0.75rem;
    }
}

/* Mobile camera / receipt helpers */
.camera-capture-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.camera-preview {
    width: 100%;
    max-height: 300px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.receipt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.receipt-item {
    position: relative;
    width: 100px;
    height: 140px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.receipt-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.receipt-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #dc3545;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-app-container {
    max-width: 540px;
    margin: 0 auto;
}

.mobile-card {
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mobile-card .card-header {
    padding: 15px;
    font-weight: bold;
}

.mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.save-changes-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 10px 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    display: none;
}

@media (max-width: 767.98px) {
    body.has-mobile-sticky-save .save-changes-btn {
        display: block;
    }

    body.has-mobile-sticky-save .main-footer {
        padding-bottom: 60px;
    }
}
