/* ===== MOBILE FIRST — KobanaoSystem ===== */

/* BASE: aplica siempre (móvil primero) */

/* Evitar zoom en iOS al enfocar inputs */
body:not(.login-page) input,
body:not(.login-page) select,
body:not(.login-page) textarea {
  font-size: 16px !important;
}

/* Botones táctiles con altura mínima */
body:not(.login-page) button,
.card-btn, .btn-sm, .btn-primary,
.btn-outline, .btn-danger, .btn-submit,
.btn-cancel, .logout-btn {
  min-height: 44px;
  cursor: pointer;
}

/* Contenedores principales */
.dashboard-container,
.form-container {
  padding: 0 0.75rem;
  max-width: 100%;
  box-sizing: border-box;
}

/* Header nav en móvil */
.dashboard-nav {
  padding: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-title {
  font-size: 1rem;
}

/* Grid de dashboard: 1 columna en móvil */
.dashboard-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem 0.75rem;
}

/* Cards del dashboard */
.dashboard-card {
  width: 100%;
  box-sizing: border-box;
}

/* Page headers apilados en móvil */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  font-size: 1.4rem;
  margin: 0;
}

/* Controles de búsqueda apilados */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.search-box {
  width: 100%;
  min-width: unset;
}

.search-box input {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
}

.filters {
  width: 100%;
}

.filters select {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
}

.add-conquistador-btn {
  width: 100%;
  justify-content: center;
}

/* Acciones de cards apiladas */
.card-actions {
  flex-direction: column;
  gap: 0.5rem;
}

.btn-sm {
  width: 100%;
  text-align: center;
}

/* Formularios */
.form-card {
  padding: 1.25rem;
}

.form-actions {
  flex-direction: column;
  gap: 0.75rem;
}

.btn-submit, .btn-cancel {
  width: 100%;
}

/* Profile */
.profile-header {
  flex-direction: column;
  text-align: center;
}

.profile-avatar {
  margin-right: 0;
  margin-bottom: 0.75rem;
}

.profile-actions {
  flex-direction: column;
}

.info-grid {
  grid-template-columns: 1fr;
}

/* ===== DESKTOP (>=640px) ===== */
@media (min-width: 640px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: 1.5rem;
  }

  .controls {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1;
    min-width: 200px;
  }

  .filters {
    width: auto;
  }

  .filters select {
    width: auto;
  }

  .add-conquistador-btn {
    width: auto;
  }

  .card-actions {
    flex-direction: row;
  }

  .btn-sm {
    width: auto;
  }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .btn-submit, .btn-cancel {
    width: auto;
    min-width: 140px;
  }

  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .profile-header {
    flex-direction: row;
    text-align: left;
  }

  .profile-avatar {
    margin-right: 1.5rem;
    margin-bottom: 0;
  }

  .profile-actions {
    flex-direction: row;
  }

  .info-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}
