.mobile-nav-bar,
.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 0.875rem;
    background: linear-gradient(180deg, #1a4d2e, #0d2818);
    color: #fff;
    z-index: 900;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .mobile-nav-bar .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-nav-bar .mobile-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: #86efac;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    width: min(288px, 88vw);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
    padding-top: calc(56px + 1rem) !important;
    width: 100%;
  }

  .layout {
    flex-direction: column;
  }

  .app-logo {
    width: 88px;
    height: 88px;
  }

  .sidebar-header {
    padding: 1rem;
  }

  .sidebar-header h1 {
    font-size: 1.25rem;
  }

  .nav-item {
    min-height: 44px;
  }

  .page-header,
  .dashboard-header,
  .section-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.875rem !important;
  }

  .page-header h1,
  .payroll-page .page-header h1 {
    font-size: 1.5rem !important;
  }

  .dashboard-header h1 {
    font-size: 1.75rem !important;
  }

  .dashboard,
  .timesheets-page,
  .employees-page,
  .customers-page,
  .jobs-page,
  .expenses-page,
  .assets-page,
  .maintenance-page,
  .financials-review-page,
  .payroll-page,
  .invoices-page,
  .invoicing-reports,
  .user-settings,
  .database-management-page,
  .audit-log-page,
  .vacation-tracker-page,
  .assets-portfolio-page {
    padding: 0 !important;
  }

  .form-row,
  .invoice-fields-section,
  .invoice-header-section,
  .invoice-totals-summary,
  .review-section,
  .alerts-group,
  .dashboard-grid,
  .management-actions {
    grid-template-columns: 1fr !important;
  }

  .filters-row,
  .filters-section,
  .period-selection,
  .selection-footer,
  .modal-actions,
  .confirmation-modal-actions,
  .action-buttons,
  .report-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .filter-group,
  .doc-filters,
  .period-select-group {
    width: 100% !important;
    max-width: none !important;
  }

  .btn-primary,
  .btn-secondary,
  .login-button,
  .logout-btn,
  .theme-toggle-btn {
    min-height: 44px;
  }

  .modal-overlay {
    padding: 0.75rem !important;
    align-items: flex-end !important;
  }

  .modal-content,
  .confirmation-modal-content,
  .invoice-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    margin: 0 !important;
    border-radius: 1rem 1rem 0 0 !important;
  }

  .table-container,
  .invoices-table,
  .reports-table-container {
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
  }

  .data-table,
  .reports-table,
  .invoice-work-table {
    min-width: 640px;
    font-size: 0.8125rem;
  }

  .data-table th,
  .data-table td,
  .reports-table th,
  .reports-table td {
    padding: 0.625rem 0.5rem;
  }

  .kpi-grid,
  .summary-cards,
  .expenses-summary,
  .invoices-summary,
  .assignment-summary {
    grid-template-columns: 1fr !important;
  }

  .login-container {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }

  .login-logo {
    width: 140px;
    height: 140px;
  }

  .search-bar {
    flex-wrap: wrap;
  }

  .weeks-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem !important;
    padding-top: calc(56px + 0.75rem) !important;
  }

  .data-table,
  .reports-table {
    min-width: 560px;
  }
}
