/* Mobile Responsive Styles */

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        position: relative;
    }
    
    body {
        display: block;
    }
    
    * {
        max-width: 100%;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 260px;
        max-width: 80vw;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-wrapper {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }
    
    .stat-card {
        min-width: 0;
        max-width: 100%;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    
    .page-actions {
        flex-wrap: wrap;
        overflow-x: visible;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    
    .search-box input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .data-table {
        font-size: 0.813rem;
        width: 100%;
        max-width: 100%;
        display: block;
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .card-body {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Keep action buttons on one row even on mobile */
    
    .top-header {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .user-info {
        gap: 0.5rem;
    }
    
    .company-dropdown-toggle .company-name {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .company-dropdown-menu {
        min-width: 200px;
        max-width: 90vw;
        right: 0;
        left: auto;
    }
    
    .auth-box {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 1rem auto;
        width: calc(100% - 2rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.25rem;
    }
    
    .client-select-wrapper {
        flex-direction: column;
    }
    
    .btn-add-client {
        width: 100%;
        justify-content: center;
    }
    
    /* Forms */
    .form-group {
        width: 100%;
        max-width: 100%;
    }
    
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Tables */
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Action buttons */
    .action-buttons {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        max-width: 100%;
    }
    
    .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Detail Grid */
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .top-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .top-header h1 {
        font-size: 1.125rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.813rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.813rem;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-title h2 {
        font-size: 1.25rem;
    }
    
    .page-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .filter-select,
    .search-box {
        width: 100%;
        min-width: 100%;
    }
}

