/* ============================================
   ESTILOS GENERALES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f4feff;
}

.login-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

.login-box {
  background: #1c3c49;
  border-radius: 25px;
  box-shadow: 0 15px 40px rgba(28, 60, 73, 0.3);
  overflow: visible;
  padding: 40px;
  position: relative;
}

.login-header {
  background: transparent;
  color: white;
  padding: 0;
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  color: white;
  position: relative;
}

.login-logo-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-container svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.login-isotipo {
  position: relative;
  width: 50px;
  height: 50px;
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Logo en esquina superior izquierda del login */
.login-box {
  position: relative;
}

.login-page-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.login-page-logo img {
  height: 55px;
  width: auto;
}

@media (max-width: 768px) {
  .login-page-logo {
    top: 10px;
    left: 10px;
  }
  
  .login-page-logo img {
    height: 35px;
  }
}

.login-header h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.login-header p {
  font-size: 14px;
  opacity: 0.9;
}

.login-form {
  padding: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.login-form {
  padding: 0;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group input {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  background: white;
  color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group input::placeholder {
  color: #999;
}

.form-group .input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 18px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2c5aa0;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #00bcd4;
  color: black;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 25px;
  padding: 15px 30px;
  box-shadow: 0 8px 25px rgba(0, 188, 212, 0.4);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 188, 212, 0.5);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.error-message {
  margin-top: 15px;
  padding: 12px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  font-size: 14px;
}

/* ============================================
   FOOTER DE PÁGINA
   ============================================ */

.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(28, 60, 73, 0.1);
  padding: 15px;
  text-align: center;
  color: #1c3c49;
  font-size: 14px;
  border-top: 1px solid rgba(28, 60, 73, 0.2);
}

.page-footer p {
  margin: 0;
  font-weight: 500;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  background: white;
  color: #333;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e0e0e0;
}

.header h1 {
  font-size: 20px;
}

.header-left img {
  max-height: 45px;
  width: auto;
  object-fit: contain;
}

.header-right {
  display: flex;
  gap: 15px;
  align-items: center;
}

.user-info {
  font-size: 14px;
  background: #f8f9fa;
  color: #333;
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background: #1c3c49;
  border-right: 1px solid #1c3c49;
  overflow-y: auto;
}

.nav-menu {
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 25px;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: #00bcd4;
  font-weight: 600;
}

.nav-item span {
  font-size: 20px;
}

.content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: #f4feff;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.content h2 {
  color: #1c3c49;
  margin-bottom: 25px;
  font-size: 28px;
  font-weight: 700;
}

.content h3 {
  color: #1c3c49;
  margin-bottom: 15px;
  margin-top: 30px;
  font-size: 20px;
  font-weight: 600;
}

.form-card,
.card {
  background: white;
  color: #1c3c49;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(28, 60, 73, 0.2);
  margin-bottom: 20px;
  border: 1px solid #e0f7fa;
}

.form-card label,
.card label {
  color: #1c3c49;
  font-weight: 600;
}

.form-card input,
.form-card select,
.form-card textarea,
.card input,
.card select,
.card textarea {
  background: white;
  color: #333;
  border: 1px solid #ddd;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: #00bcd4;
  box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: white;
  color: #333;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #2c5aa0;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.text-muted {
  color: #666;
  font-size: 14px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.spacer {
  height: 30px;
}

/* ============================================
   TABLAS
   ============================================ */

.table-container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(28, 60, 73, 0.2);
  overflow: hidden;
  border: 1px solid #e0f7fa;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f4feff;
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #1c3c49;
  border-bottom: 2px solid #00bcd4;
  font-size: 14px;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid #f0f8ff;
  font-size: 14px;
  color: #1c3c49;
}

.data-table tbody tr:hover {
  background: #f4feff;
}

.text-center {
  text-align: center;
}

/* ============================================
   BÚSQUEDA DE PACIENTES
   ============================================ */

.search-results {
  position: relative;
  margin-top: 5px;
  background: white;
  border: 1px solid #00bcd4;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0, 188, 212, 0.2);
}

.search-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  color: #333;
}

.search-item:hover {
  background: #e0f7fa;
}

.search-item:last-child {
  border-bottom: none;
}

.selected-info {
  margin-top: 10px;
}

.alert {
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.alert-info {
  background: rgba(0, 188, 212, 0.1);
  color: #1c3c49;
  border: 1px solid #00bcd4;
}

/* ============================================
   ESTADOS Y BADGES
   ============================================ */

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-confirmed {
  background: #d1ecf1;
  color: #0c5460;
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* ============================================
   ROLES
   ============================================ */

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge-assistant {
  background: #d1ecf1;
  color: #0c5460;
}

.role-badge-doctor {
  background: #d4edda;
  color: #155724;
}

.role-badge-admin {
  background: #f8d7da;
  color: #721c24;
}

.role-select {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 5px;
}

/* ============================================
   HISTORIAS CLÍNICAS
   ============================================ */

.patient-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 14px;
}

.patient-info-grid .full-width {
  grid-column: 1 / -1;
}

.consultation-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}

.consultation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

.consultation-header h4 {
  color: #2c5aa0;
  margin: 0;
}

.consultation-header span {
  color: #6c757d;
  font-size: 13px;
}

.consultation-body p {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.consultation-body p:last-child {
  margin-bottom: 0;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(28, 60, 73, 0.2);
  text-align: center;
  transition: transform 0.3s;
  color: #1c3c49;
  border: 1px solid #e0f7fa;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 40px;
  margin-bottom: 10px;
  color: #00bcd4;
}

.stat-value {
  font-size: 36px;
  font-weight: bold;
  color: #00bcd4;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 14px;
  color: #1c3c49;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================
   TARJETAS PRINCIPALES (ESTILO REFERENCIA)
   ============================================ */

.main-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.main-card {
  background: linear-gradient(135deg, #2c5aa0 0%, #4a9eff 100%);
  color: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(44, 90, 160, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.main-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(44, 90, 160, 0.4);
}

.main-card-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.9;
}

.main-card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.main-card-description {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

.main-card-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 15px;
  cursor: pointer;
  transition: all 0.3s;
}

.main-card-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MÉTRICAS MODERNAS
   ============================================ */

.metrics-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.metric-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  border-left: 4px solid #2c5aa0;
}

.metric-number {
  font-size: 32px;
  font-weight: bold;
  color: #2c5aa0;
  margin-bottom: 5px;
}

.metric-label {
  font-size: 14px;
  color: #6c757d;
  text-transform: uppercase;
  font-weight: 600;
}

/* ============================================
   WELCOME SECTION
   ============================================ */

.welcome-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-text h2 {
  color: #333;
  font-size: 28px;
  margin-bottom: 10px;
}

.welcome-text p {
  color: #6c757d;
  font-size: 16px;
}

.welcome-button {
  background: linear-gradient(135deg, #2c5aa0 0%, #4a9eff 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.welcome-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(44, 90, 160, 0.3);
}

/* ============================================
   MODAL DE CÓDIGO QR
   ============================================ */

.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.qr-modal-content {
  background: white;
  border-radius: 15px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.qr-modal-header {
  background: #1c3c49;
  color: white;
  padding: 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qr-modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.qr-modal-body {
  padding: 30px;
}

.qr-code-display {
  background: #f4feff;
  border: 2px solid #e0f7fa;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.qr-code-image {
  width: 200px;
  height: 200px;
  margin: 0 auto 15px auto;
  display: block;
  border: 2px solid #00bcd4;
  border-radius: 10px;
  background: white;
  padding: 10px;
}

.qr-code-text {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  color: #1c3c49;
  word-break: break-all;
  background: white;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.qr-instructions {
  background: #e0f7fa;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.qr-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.qr-actions .btn {
  padding: 12px 20px;
  font-size: 14px;
}

/* Estilos para antecedentes médicos */
.medical-section {
  background: #f8f9fa;
  border: 1px solid #e0f7fa;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.medical-section h4 {
  color: #1c3c49;
  margin-bottom: 15px;
  font-size: 1.2rem;
  border-bottom: 2px solid #00bcd4;
  padding-bottom: 8px;
}

.section-content {
  margin-bottom: 15px;
}

.section-content p {
  margin-bottom: 8px;
  color: #333;
  line-height: 1.5;
}

/* ============================================
   COMBOBOX CON BÚSQUEDA
   ============================================ */

.combobox-container {
  position: relative;
  width: 100%;
}

.combobox-input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: white;
  color: #333;
  transition: border-color 0.3s;
}

.combobox-input:focus {
  outline: none;
  border-color: #2c5aa0;
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.combobox-input.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.combobox-input::placeholder {
  color: #999;
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: -1px;
}

.combobox-dropdown-item {
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.combobox-dropdown-item:last-child {
  border-bottom: none;
}

.combobox-dropdown-item:hover {
  background-color: #f5f5f5;
}

.combobox-dropdown-item.selected {
  background-color: #e3f2fd;
  font-weight: 600;
}

.combobox-dropdown-item.empty {
  padding: 15px;
  text-align: center;
  color: #999;
  font-style: italic;
  cursor: default;
}

.combobox-dropdown-item.empty:hover {
  background-color: white;
}

/* Scrollbar personalizado para el dropdown */
.combobox-dropdown::-webkit-scrollbar {
  width: 8px;
}

.combobox-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.combobox-dropdown::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.combobox-dropdown::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.section-content strong {
  color: #1c3c49;
  font-weight: 600;
}

.section-meta {
  text-align: right;
  color: #666;
  font-style: italic;
}

.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-info {
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid #00bcd4;
  color: #1c3c49;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid #dc3545;
  color: #dc3545;
}

.text-muted {
  color: #666;
  font-style: italic;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Login Page */
  .login-container {
    max-width: 500px;
  }
  
  .login-box {
    padding: 35px;
  }
  
  /* Dashboard - Mantener sidebar visible pero más estrecho */
  .dashboard {
    height: 100vh;
    overflow: hidden;
  }
  
  .sidebar {
    width: 180px;
    min-width: 180px;
  }
  
  .nav-item {
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .nav-item span {
    font-size: 18px;
  }
  
  .content {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .header {
    padding: 12px 20px;
  }
  
  .header h1 {
    font-size: 18px;
  }
  
  .header-left img {
    max-height: 40px;
  }
  
  /* Formularios */
  .form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  
  /* Tablas - Scroll horizontal suave */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  
  .data-table {
    min-width: 700px;
    font-size: 13px;
  }
  
  .data-table th,
  .data-table td {
    padding: 12px 10px;
  }
  
  /* Grids */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  
  .main-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  
  .metrics-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .patient-info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Cards */
  .form-card,
  .card {
    padding: 20px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-value {
    font-size: 32px;
  }
  
  .stat-icon {
    font-size: 36px;
  }
  
  /* Modal */
  .qr-modal-content {
    max-width: 600px;
    width: 90%;
  }
  
  /* Welcome section */
  .welcome-section {
    padding: 25px;
  }
  
  .welcome-text h2 {
    font-size: 24px;
  }
  
  /* Content headings */
  .content h2 {
    font-size: 24px;
  }
  
  .content h3 {
    font-size: 19px;
  }
}

/* Móviles y tablets pequeñas */
@media (max-width: 768px) {
  /* Login Page */
  .login-page {
    padding: 10px;
  }
  
  .login-container {
    max-width: 100%;
    padding: 10px;
  }
  
  .login-box {
    padding: 25px 20px;
    border-radius: 15px;
  }
  
  .login-header h1 {
    font-size: 20px;
  }
  
  .login-header p {
    font-size: 12px;
  }
  
  .login-logo {
    width: 60px;
    height: 60px;
    font-size: 12px;
  }
  
  .form-group input {
    padding: 12px 15px 12px 45px;
    font-size: 16px; /* Evita zoom en iOS */
  }
  
  .btn-primary {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  /* Logo GMedix en esquina */
  .login-page > div[style*="position: fixed"] {
    top: 10px !important;
    left: 10px !important;
  }
  
  .login-page > div[style*="position: fixed"] img {
    height: 35px !important;
  }
  
  /* Footer */
  .page-footer {
    padding: 10px;
    font-size: 12px;
  }
  
  /* Dashboard */
  .dashboard {
    height: auto;
    min-height: 100vh;
  }
  
  .header {
    padding: 10px 15px;
    flex-wrap: wrap;
  }
  
  .header-left img {
    max-height: 35px;
  }
  
  .header h1 {
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
  }
  
  .user-info {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .btn {
    font-size: 12px;
    padding: 8px 16px;
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: 60px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .nav-menu {
    display: flex;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .nav-item {
    padding: 10px 15px;
    min-width: auto;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .nav-item.active {
    border-left: none;
    border-bottom-color: #00bcd4;
  }
  
  .nav-item span {
    font-size: 18px;
  }
  
  .content {
    padding: 15px;
  }
  
  .content h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }
  
  .content h3 {
    font-size: 18px;
  }
  
  /* Formularios */
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .form-card,
  .card {
    padding: 15px;
    border-radius: 10px;
  }
  
  .form-control {
    font-size: 16px; /* Evita zoom en iOS */
    padding: 12px 15px;
  }
  
  /* Tablas */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  /* Grids */
  .patient-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .main-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .metrics-container {
    grid-template-columns: 1fr;
  }
  
  .welcome-section {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 20px;
  }
  
  .welcome-text h2 {
    font-size: 22px;
  }
  
  .welcome-text p {
    font-size: 14px;
  }
  
  /* Cards */
  .stat-card {
    padding: 20px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .main-card {
    padding: 20px;
  }
  
  .main-card-icon {
    font-size: 36px;
  }
  
  .main-card-title {
    font-size: 18px;
  }
  
  /* Modal */
  .qr-modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .qr-modal-header {
    padding: 15px;
  }
  
  .qr-modal-header h2 {
    font-size: 18px;
  }
  
  .qr-modal-body {
    padding: 20px;
  }
  
  .qr-code-image {
    width: 150px;
    height: 150px;
  }
  
  /* Search */
  .search-results {
    max-height: 150px;
  }
  
  /* Combobox */
  .combobox-dropdown {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 20px 15px;
  }
  
  .login-header h1 {
    font-size: 18px;
  }
  
  .content {
    padding: 10px;
  }
  
  .content h2 {
    font-size: 20px;
  }
  
  .header-right {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .btn-block {
    width: 100%;
  }
  
  .nav-item span {
    font-size: 18px;
  }
  
  .nav-item {
    font-size: 13px;
    padding: 8px 12px;
  }
}

