/* Mobile-responsive table styles */
@media (max-width: 767px) {
    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        padding: 0.75rem;
        border: 1px solid;
        border-radius: 0.5rem;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: right;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        flex: 1;
        padding-right: 1rem;
    }

    .responsive-table td[data-label="Actions"] {
        justify-content: flex-end;
    }

    .responsive-table td[data-label="Actions"]::before {
        content: none;
    }

    /* Hide empty cells on mobile */
    .responsive-table td:empty {
        display: none;
    }
}

/* Touch-friendly button sizes */
button, a.button, .button {
    min-height: 44px;
    min-width: 44px;
}

/* Ensure modals are full-screen on mobile */
@media (max-width: 640px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-overlay {
        padding: 0;
    }
}

/* Horizontal scroll for data-heavy content */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* Improve form inputs on mobile */
@media (max-width: 640px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="url"],
    select,
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Stack card grids on mobile */
@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile-friendly spacing */
@media (max-width: 640px) {
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-6 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Ensure text is readable on mobile */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
}