/* Mobile App Simulation Styles */

@media (max-width: 991px) {

    /* --- Login View Adjustments --- */
    .login .wrapper.wrapper-login {
        display: flex;
        flex-direction: column;
        height: 100vh;
        /* Full height */
        overflow-y: auto;
    }

    .login .login-aside {
        width: 100% !important;
        flex: 0 0 auto;
        /* Don't grow/shrink unexpectedly */
    }

    /* Branding Section (Left/Top side) */
    .login .login-aside.bg-secondary-gradient {
        min-height: 150px;
        /* Smaller height for header feel */
        padding: 20px;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        z-index: 2;
    }

    .login .login-aside.bg-secondary-gradient .title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem !important;
    }

    .login .login-aside.bg-secondary-gradient .title img {
        max-width: 200px;
        /* Limit logo size */
        height: auto;
    }

    .login .login-aside.bg-secondary-gradient .subtitle {
        display: none;
        /* Hide subtitle to save space */
    }

    /* Form Section (Right/Bottom side) */
    .login .login-aside.bg-white {
        flex: 1;
        /* Take remaining space */
        align-items: flex-start !important;
        /* Align to top */
        padding-top: 40px;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .login .container-login {
        width: 100% !important;
        padding: 0 20px;
    }

    /* Input & Button Enhancements for Touch */
    .login .form-control {
        height: 50px;
        /* Taller inputs */
        font-size: 16px;
        /* Prevent iOS zoom */
        border-radius: 10px;
    }

    .login .btn {
        height: 50px;
        font-size: 16px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* --- Layout / Dashboard Adjustments --- */

    /* Header */
    .main-header .navbar-header {
        width: 100%;
        padding: 0 15px;
        display: none;
        /* Hide top user menu in mobile */
    }

    .main-header .logo-header {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Sidebar / Drawer */
    .sidebar {
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }

    /* Content Area */
    .main-panel {
        width: 100% !important;
    }

    .main-panel>.container {
        padding: 15px;
    }

    /* Card Adjustments for Mobile */
    .card {
        border-radius: 15px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        margin-bottom: 20px;
        border: none;
    }

    .card-header {
        padding: 15px 20px;
    }

    .card-body {
        padding: 15px 20px;
    }

    /* Typography */
    h1,
    h2,
    h3,
    h4 {
        font-weight: 700;
    }

    /* --- Exam List Card View --- */
    #tableEstudio_wrapper .dataTables_filter {
        text-align: left !important;
        margin-bottom: 15px;
    }

    #tableEstudio_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        align-items: center;
    }

    #tableEstudio_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 10px;
        height: 45px;
        border-radius: 20px;
        padding-left: 15px;
        border: 1px solid #ddd;
    }

    #tableEstudio thead {
        display: none;
    }

    #tableEstudio tbody tr {
        display: flex;
        /* Use Flexbox for layout control */
        flex-wrap: wrap;
        background: #fff;
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        margin-bottom: 20px;
        padding: 15px;
        position: relative;
        border: 1px solid #f1f1f1;
    }

    #tableEstudio tbody td {
        display: block;
        border: none;
        padding: 0px !important;
        margin: 0px !important;
    }

    /* 1. Date (Top Left) */
    #tableEstudio tbody td:nth-child(1) {
        width: 100%;
        order: 1;
        font-size: 0.9rem;
        color: #888;
        margin-bottom: 5px;
        padding-bottom: 0 !important;
        text-align: left !important;
    }

    /* 2. Exam Name (Below Date) */
    #tableEstudio tbody td:nth-child(2) {
        width: 100%;
        order: 2;
        font-size: 1.1rem;
        font-weight: 700;
        color: #1a2035;
        margin-bottom: 0 px;
    }

    /* 3. Clinic Logo (Top Right - Absolute) */
    #tableEstudio tbody td:nth-child(3) {
        position: absolute;
        top: 15px;
        right: 15px;
        width: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        /* No order needed */
    }

    #tableEstudio tbody td:nth-child(3) img {
        position: absolute;
        height: 30px;
        top: 30px;
        right: 10px;
        border: 1px
    }

    /* 4. Status (Row 3, Left Half) */
    #tableEstudio tbody td:nth-child(4) {
        width: 50%;
        order: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0px;
        padding: 0px !important;
    }

    /* 5. Actions (Row 3, Right Half) */
    #tableEstudio tbody td:nth-child(5) {
        width: 50%;
        order: 4;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 0 !important;
        border-top: none !important;
    }

    #tableEstudio tbody td:nth-child(5) .btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #f8f9fa;
        margin: 0 3px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #tableEstudio tbody td:nth-child(5) .btn:active {
        background: #e9ecef;
    }
}

/* Global Touch Improvements */
button,
a {
    touch-action: manipulation;
}