/* ===================================
   MOBILE-FIRST RESPONSIVE FIX 2025
   Garantia 100% Mobile
   =================================== */

/* ===================================
   1. RESET & BASE
   =================================== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

/* ===================================
   2. MOBILE TYPOGRAPHY
   =================================== */
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.4; }
h4 { font-size: 1.125rem; line-height: 1.4; }
p { font-size: 0.938rem; line-height: 1.6; }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
  p { font-size: 1rem; }
}

/* ===================================
   3. CONTAINER MOBILE
   =================================== */
.container, 
.container-responsive,
.main-content,
.dashboard-main {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .container,
  .container-responsive {
    max-width: 720px;
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container,
  .container-responsive {
    max-width: 960px;
    padding: 2rem;
  }
}

@media (min-width: 1280px) {
  .container,
  .container-responsive {
    max-width: 1200px;
  }
}

/* ===================================
   4. NAVIGATION MOBILE
   =================================== */
.navbar,
.header-2025 {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Menu Toggle Mobile */
.mobile-menu-toggle,
.sidebar-toggle,
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  color: #333;
  position: relative;
  z-index: 1001;
}

@media (min-width: 768px) {
  .mobile-menu-toggle,
  .sidebar-toggle {
    display: none;
  }
}

/* Sidebar Mobile */
.sidebar,
.sidebar-2025,
.dashboard-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transition: left 0.3s ease;
  z-index: 999;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar.active,
.sidebar-2025.active,
.dashboard-sidebar.active {
  left: 0;
}

@media (min-width: 768px) {
  .sidebar,
  .sidebar-2025,
  .dashboard-sidebar {
    position: sticky;
    left: 0;
    top: 0;
    height: 100vh;
  }
}

/* Overlay Mobile */
.sidebar-overlay,
.nav-overlay,
.modal-overlay-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.sidebar.active + .sidebar-overlay,
.sidebar-overlay.active,
.nav-overlay.active {
  display: block;
}

/* ===================================
   5. LAYOUT DASHBOARD MOBILE
   =================================== */
.dashboard-2025,
.dashboard-layout,
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

@media (min-width: 768px) {
  .dashboard-2025,
  .dashboard-layout {
    flex-direction: row;
  }
}

.main-content,
.dashboard-main,
.content-2025 {
  flex: 1;
  width: 100%;
  padding: 1rem;
  margin: 0;
}

@media (min-width: 768px) {
  .main-content,
  .dashboard-main {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 2rem;
  }
}

/* ===================================
   6. GRIDS MOBILE
   =================================== */
.grid,
.stats-grid,
.documents-grid,
.forms-grid,
.analytics-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  .grid-sm-2,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-md-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-lg-4,
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .documents-grid,
  .forms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===================================
   7. CARDS MOBILE
   =================================== */
.card,
.stat-card,
.stat-card-2025,
.document-card,
.metric-card {
  width: 100%;
  padding: 1rem;
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .card,
  .stat-card,
  .stat-card-2025 {
    padding: 1.5rem;
  }
}

/* ===================================
   8. BUTTONS MOBILE
   =================================== */
.btn,
.btn-primary,
.btn-secondary,
.action-btn-2025 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

@media (min-width: 640px) {
  .btn,
  .btn-primary,
  .btn-secondary {
    width: auto;
  }
}

.btn-primary,
.action-btn-2025.primary {
  background: linear-gradient(135deg, #0A4D8F 0%, #6366F1 100%);
  color: white;
}

.btn-secondary {
  background: white;
  color: #0A4D8F;
  border: 2px solid #0A4D8F;
}

/* ===================================
   9. FORMS MOBILE
   =================================== */
.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.938rem;
}

.form-input,
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 16px; /* Previne zoom no iOS */
  border: 2px solid #e0e0e0;
  border-radius: 0.5rem;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0A4D8F;
  box-shadow: 0 0 0 3px rgba(10, 77, 143, 0.1);
}

/* ===================================
   10. TABLES MOBILE
   =================================== */
.table-wrapper,
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

.table,
.data-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .table,
  .data-table {
    font-size: 1rem;
    min-width: auto;
  }
  
  .table th,
  .table td {
    padding: 1rem;
  }
}

/* ===================================
   11. MODALS MOBILE
   =================================== */
.modal,
.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  z-index: 2000;
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 1rem;
}

@media (min-width: 640px) {
  .modal,
  .modal-content {
    width: 90%;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .modal,
  .modal-content {
    width: auto;
    min-width: 500px;
  }
}

/* ===================================
   12. HERO SECTION MOBILE
   =================================== */
.hero-section,
.hero-2025 {
  padding: 2rem 1rem;
  text-align: center;
}

.hero-title {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .hero-section,
  .hero-2025 {
    padding: 4rem 2rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* ===================================
   13. UTILITIES MOBILE
   =================================== */
.hide-mobile {
  display: none !important;
}

.show-mobile {
  display: block !important;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block !important;
  }
  
  .show-mobile {
    display: none !important;
  }
}

.flex-mobile-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .flex-mobile-column {
    flex-direction: row;
    align-items: center;
  }
}

/* ===================================
   14. TOUCH OPTIMIZATIONS
   =================================== */
@media (hover: none) and (pointer: coarse) {
  /* Botões maiores para toque */
  .btn,
  button,
  .nav-link,
  .nav-item-2025 {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Previne zoom no iOS */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  
  /* Remove hover em touch devices */
  .btn:hover,
  .card:hover {
    transform: none;
  }
}

/* ===================================
   15. IMAGES & MEDIA MOBILE
   =================================== */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================
   16. SPACING MOBILE
   =================================== */
.section {
  padding: 2rem 1rem;
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 2rem;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 6rem 2rem;
  }
}

/* ===================================
   17. HEADER ACTIONS MOBILE
   =================================== */
.section-actions,
.header-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .section-actions,
  .header-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box,
.filter-dropdown {
  width: 100%;
}

@media (min-width: 768px) {
  .search-box {
    flex: 1;
    max-width: 400px;
  }
  
  .filter-dropdown {
    width: auto;
  }
}

/* ===================================
   18. ACCESSIBILITY
   =================================== */
:focus-visible {
  outline: 3px solid #0A4D8F;
  outline-offset: 2px;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================
   19. CRITICAL MOBILE FIXES
   =================================== */

/* Previne scroll horizontal */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* Fix para iOS Safari */
body {
  -webkit-overflow-scrolling: touch;
}

/* Fix para inputs no iOS */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Fix para select no mobile */
select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="%23333" d="M6 8L0 0h12z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

/* ===================================
   20. LOADING STATES MOBILE
   =================================== */
.loading-screen,
.loading-screen-2025 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  z-index: 9999;
}

/* ===================================
   FIM - MOBILE-FIRST RESPONSIVE
   =================================== */







