/* =============================================
   DoctorPro — Custom responsive styles
   ============================================= */

/* ---- Touch-friendly action buttons ---- */
.btn-xs {
    padding: 5px 9px;
    font-size: 0.78rem;
    line-height: 1.3;
    border-radius: 3px;
    min-width: 30px;
}

/* ---- Action columns: never wrap buttons ---- */
.table td.actions-col,
.table th.actions-col {
    white-space: nowrap;
    width: 1%;          /* shrink to content */
}

/* ---- Consistent btn-sm in all headers ---- */
.content-header .btn {
    font-size: 0.82rem;
}

/* ---- Pagination: center & wrap on small screens ---- */
.card-footer .pagination {
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.card-footer .page-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
}

/* ---- Table: always prevent overflow ---- */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* ---- Badge sizing ---- */
.badge {
    font-size: 0.75em;
    font-weight: 600;
}

/* ---- Form inputs: comfortable height ---- */
.form-control-sm,
.input-group-sm .form-control {
    font-size: 0.875rem;
}

/* ============================================
   MOBILE (≤ 768px)
   ============================================ */
@media (max-width: 768px) {

    /* Content header: smaller title, stack button below on xs */
    .content-header h1 {
        font-size: 1.15rem;
        line-height: 1.3;
    }

    /* Wrap header content on very small screens */
    .content-header .d-flex {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Cards: remove side padding */
    .card-body {
        padding: 0.75rem;
    }

    /* Tables: smaller font on mobile */
    .table-sm th,
    .table-sm td {
        font-size: 0.78rem;
        padding: 0.3rem 0.4rem;
    }

    /* Hide less important table columns on mobile */
    .d-mobile-none {
        display: none !important;
    }

    /* Action buttons: slightly bigger touch targets */
    .btn-xs {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Card footer: stack pagination */
    .card-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        font-size: 0.8rem;
    }
    .card-footer .pagination {
        justify-content: center;
    }

    /* Forms: full-width inputs on mobile */
    .form-group .form-control,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
    }

    /* Info-boxes on dashboard */
    .info-box {
        min-height: 60px;
    }
    .info-box-icon {
        width: 60px;
        line-height: 60px;
        font-size: 1.5rem;
    }
    .info-box-number {
        font-size: 1.1rem;
    }

    /* Modal dialogs: full width */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ============================================
   EXTRA SMALL (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .content-header h1 {
        font-size: 1rem;
    }

    /* Tables: compress further */
    .table-sm th,
    .table-sm td {
        font-size: 0.73rem;
        padding: 0.25rem 0.3rem;
    }

    /* Sidebar menu text */
    .nav-sidebar .nav-link p {
        font-size: 0.88rem;
    }
}

/* ============================================
   SEARCH BAR (responsive)
   ============================================ */
.dp-search-form .dp-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.dp-search-form .dp-search-main {
    flex: 1 1 200px;
    min-width: 180px;
}
.dp-search-form .dp-search-date {
    flex: 0 1 160px;
    min-width: 140px;
}
.dp-search-form .dp-search-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
}

@media (max-width: 576px) {
    .dp-search-form .dp-search-main,
    .dp-search-form .dp-search-date {
        flex: 1 1 100%;
    }
    .dp-search-form .dp-search-actions {
        width: 100%;
    }
    .dp-search-form .dp-search-actions .btn {
        flex: 1;
    }

    /* small-box: reduce h3 font so amounts like "Bs. 410.00" don't overflow */
    .small-box .inner h3 {
        font-size: 1.4rem;
    }
    .small-box .inner p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    /* Hide the background icon on very small screens to avoid overlap */
    .small-box .icon {
        display: none;
    }
}
