/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Header sticky */
header.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--pico-background-color);
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 0;
}

header.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

header.navbar .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

header.navbar .logo .logo-image {
  height: 40px;
  width: auto;
  display: block;
}

header.navbar .nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

header.navbar .nav-actions span {
  color: var(--pico-muted-color);
}

header.navbar .nav-actions button {
  margin: 0;
  padding: 0.5rem 1rem;
}

/* Sidebar menu */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: var(--pico-background-color);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 2000;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.sidebar.open {
  right: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sidebar-header h3 {
  margin: 0;
}

.sidebar-header button {
  padding: 0.5rem;
  margin: 0;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav ul li {
  margin-bottom: 0.5rem;
}

.sidebar nav ul li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--pico-color);
  text-decoration: none;
  border-radius: var(--pico-border-radius);
  transition: background-color 0.2s ease;
}

.sidebar nav ul li a:hover {
  background-color: var(--pico-primary-hover);
  color: var(--pico-primary-inverse);
}

.sidebar nav ul li a i {
  width: 1.5rem;
  text-align: center;
}

/* Main content */
main.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Flash Messages */
.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.flash-message.flash-show {
  opacity: 1;
  transform: translateX(0);
}

.flash-message.flash-hide {
  opacity: 0;
  transform: translateX(100%);
}

.flash-notice {
  background-color: #10b981;
  color: white;
  border-left: 4px solid #059669;
}

.flash-alert {
  background-color: #ef4444;
  color: white;
  border-left: 4px solid #dc2626;
}

.flash-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.flash-content i {
  font-size: 1.25rem;
}

.flash-content span {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
}

.flash-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  font-size: 1rem;
  margin: 0;
  width: auto;
  height: auto;
}

.flash-close:hover {
  opacity: 1;
  background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
  .flash-container {
    left: 20px;
    right: 20px;
    max-width: calc(100% - 40px);
  }
}

/* Authentication Pages */
.auth-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--pico-card-background-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  width: 100%;
  max-width: 600px;
  border: 1px solid var(--pico-muted-border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .auth-logo {
  display: block;
  max-width: 200px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.auth-header i {
  font-size: 3rem;
  color: var(--pico-primary);
  margin-bottom: 1rem;
  display: block;
}

.auth-header h2 {
  margin: 0 0 0.5rem 0;
  color: var(--pico-color);
  font-size: 1.75rem;
}

.auth-header p {
  margin: 0;
  color: var(--pico-muted-color);
  font-size: 0.95rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 1.5rem;
}

.auth-form .form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--pico-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-form .form-group label i {
  color: var(--pico-primary);
  font-size: 1rem;
}

.auth-form .form-group input[type="email"],
.auth-form .form-group input[type="password"],
.auth-form .form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--pico-background-color);
  color: var(--pico-color);
}

.auth-form .form-group input:focus {
  outline: none;
  border-color: var(--pico-primary);
  box-shadow: 0 0 0 3px var(--pico-primary-focus);
}

.auth-form .form-group-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.auth-form .form-group-checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0;
}

.auth-form .form-group-checkbox input[type="checkbox"] {
  margin: 0;
  width: auto;
}

.auth-form .form-group-checkbox span {
  color: var(--pico-color);
  font-size: 0.9rem;
}

.auth-form .form-actions {
  margin-top: 2rem;
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  margin: 0;
}

.auth-form .btn-primary:hover {
  background: var(--pico-primary-hover);
  transform: translateY(-1px);
}

.auth-form .btn-primary:active {
  transform: translateY(0);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pico-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  padding: 0.5rem;
}

.auth-link:hover {
  color: var(--pico-primary-hover);
  text-decoration: underline;
}

.auth-link i {
  font-size: 0.85rem;
}

.auth-divider {
  margin: 1.5rem 0;
  text-align: center;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--pico-muted-border-color);
}

.auth-divider span {
  position: relative;
  background: var(--pico-card-background-color);
  padding: 0 1rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--pico-primary);
  border: 2px solid var(--pico-primary);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  margin: 0;
}

.btn-secondary:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary i {
  font-size: 0.9rem;
}

/* Responsive Auth Pages */
@media (max-width: 768px) {
  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .auth-header h2 {
    font-size: 1.5rem;
  }

  .auth-header i {
    font-size: 2.5rem;
  }

  .auth-header .auth-logo {
    max-width: 150px;
  }
}

/* Responsive Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

figure.table-container {
  margin: 0;
  padding: 0;
}

/* Table styling improvements */
table[role="grid"] {
  min-width: 100%;
  white-space: nowrap;
}

table[role="grid"] th {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

table[role="grid"] td {
  vertical-align: middle;
}

/* Make tables more mobile-friendly */
@media (max-width: 768px) {
  table[role="grid"] {
    font-size: 0.875rem;
  }

  table[role="grid"] th,
  table[role="grid"] td {
    padding: 0.5rem;
  }

  /* Stack action buttons vertically on mobile */
  table[role="grid"] td:last-child {
    white-space: normal;
  }

  table[role="grid"] td:last-child a,
  table[role="grid"] td:last-child button {
    display: block;
    width: 100%;
    margin-bottom: 0.25rem;
  }

  table[role="grid"] td:last-child a:last-child,
  table[role="grid"] td:last-child button:last-child {
    margin-bottom: 0;
  }
}

/* Utility classes */
.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

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

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge.bg-primary {
  background-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

.badge.bg-success {
  background-color: #10b981;
  color: white;
}

.badge.bg-secondary {
  background-color: var(--pico-muted-color);
  color: white;
}

/* Alert styles */
.alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

.alert.alert-info {
  background-color: var(--pico-primary-focus);
  border-color: var(--pico-primary);
  color: var(--pico-color);
}

/* Button size variants */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-info {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

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

/* Filter Form Styles */
details[open] summary {
  margin-bottom: 1rem;
}

details summary i {
  margin-right: 0.5rem;
}

details[open] summary i.fa-filter {
  color: var(--pico-primary);
}

/* Responsive filter form */
@media (max-width: 768px) {
  details summary {
    font-size: 0.95rem;
  }
}

/* =====================================================
   DASHBOARD STYLES - Sistema de diseño para módulos
   ===================================================== */

/* Fondo principal del módulo */
.module-wrapper {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: calc(100vh - 60px);
  margin: -2rem calc(-1 * (50vw - 50%));
  padding: 2rem calc(50vw - 50%);
}

/* Card principal del dashboard */
.dashboard-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  padding: 0;
  overflow: hidden;
}

/* Header del dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to bottom, #fafbfc, #ffffff);
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-header-left {
  flex: 1;
  min-width: 200px;
}

.dashboard-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.dashboard-header-left p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.dashboard-header-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-header-right .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0;
  white-space: nowrap;
}

.dashboard-header-right .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.dashboard-header-right .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.dashboard-header-right .btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.dashboard-header-right .btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Sección de filtros */
.dashboard-filters {
  padding: 0.75rem 2rem;
  background: #ffffff;
}

.filter-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 200px;
  max-width: 300px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group input,
.filter-group select {
  height: 38px;
  padding: 0 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin: 0;
  box-sizing: border-box;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group input::placeholder {
  color: #9ca3af;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.filter-actions .btn {
  height: 38px;
  padding: 0 1rem;
  font-size: 0.875rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  text-decoration: none;
}

.filter-actions .btn-search {
  background: #3b82f6;
  color: white;
  border: none;
}

.filter-actions .btn-search:hover {
  background: #2563eb;
}

.filter-actions .btn-clear {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.filter-actions .btn-clear:hover {
  background: #f3f4f6;
}

/* Contenido principal / Tabla */
.dashboard-content {
  padding: 1rem 2rem 1.5rem;
}

/* Estilos de tabla mejorados para dashboard */
.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dashboard-table thead th {
  background: #f9fafb;
  padding: 0.875rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.dashboard-table tbody tr {
  transition: background-color 0.15s ease;
}

.dashboard-table tbody tr:hover {
  background: #f9fafb;
}

.dashboard-table tbody td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badge/Tag para claves */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.tag-primary {
  background: #dbeafe;
  color: #1e40af;
}

.tag-success {
  background: #dcfce7;
  color: #166534;
}

.tag-warning {
  background: #fef3c7;
  color: #92400e;
}

.tag-neutral {
  background: #f3f4f6;
  color: #374151;
}

/* Botones de acción en tabla */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0;
  border: none;
  cursor: pointer;
}

.action-btn i {
  font-size: 0.75rem;
}

.action-btn-view {
  background: #eff6ff;
  color: #2563eb;
}

.action-btn-view:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

.action-btn-edit {
  background: #fef3c7;
  color: #d97706;
}

.action-btn-edit:hover {
  background: #fde68a;
  color: #b45309;
}

.action-btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.action-btn-delete:hover {
  background: #fecaca;
  color: #b91c1c;
}

/* Estado vacío */
.dashboard-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.dashboard-empty-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.dashboard-empty h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.dashboard-empty p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1.5rem 0;
}

/* =====================================================
   MODAL STYLES
   ===================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease;
}

/* Modal sizes */
.modal-container.modal-sm {
  max-width: 400px;
}

.modal-container.modal-md {
  max-width: 600px;
}

.modal-container.modal-lg {
  max-width: 800px;
}

.modal-container.modal-xl {
  max-width: 1140px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h2 i {
  color: #3b82f6;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 0;
  width: 32px;
  height: 32px;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* Form styles dentro del modal */
.modal-form .form-group {
  margin-bottom: 1.25rem;
}

.modal-form .form-group:last-of-type {
  margin-bottom: 0;
}

.modal-form .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.modal-form .form-control {
  width: 100%;
  height: 42px;
  padding: 0 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.modal-form .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-form .form-control::placeholder {
  color: #9ca3af;
}

.modal-form .form-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.375rem;
}

.modal-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.modal-form .btn {
  height: 40px;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  text-decoration: none;
  box-sizing: border-box;
}

.modal-form .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.modal-form .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.modal-form .btn-cancel {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.modal-form .btn-cancel:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Error styles en modal */
.modal-form .form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.modal-form .form-errors h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #dc2626;
  margin: 0 0 0.5rem 0;
}

.modal-form .form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.modal-form .form-errors li {
  font-size: 0.8125rem;
  color: #b91c1c;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .modal-container {
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
    animation: slideUp 0.3s ease;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .modal-form .form-actions {
    flex-direction: column-reverse;
  }

  .modal-form .btn {
    width: 100%;
  }
}

/* Responsive Dashboard */
@media (max-width: 768px) {
  .module-wrapper {
    margin: -2rem calc(-1 * (50vw - 50%));
    padding: 1rem;
  }

  .dashboard-card {
    border-radius: 12px;
  }

  .dashboard-header {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }

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

  .dashboard-header-right {
    justify-content: stretch;
  }

  .dashboard-header-right .btn {
    flex: 1;
    justify-content: center;
  }

  .dashboard-filters {
    padding: 1rem 1.25rem;
  }

  .filter-form {
    flex-direction: column;
  }

  .filter-group {
    max-width: none;
  }

  .dashboard-content {
    padding: 1rem 1.25rem;
  }

  .dashboard-table thead {
    display: none;
  }

  .dashboard-table tbody tr {
    display: block;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  .dashboard-table tbody tr:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .dashboard-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .dashboard-table tbody td:last-child {
    border-bottom: none;
    padding-top: 0.75rem;
    justify-content: flex-start;
  }

  .dashboard-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
  }

  .action-buttons {
    width: 100%;
  }

  .action-btn {
    flex: 1;
    justify-content: center;
  }
}

/* =====================================================
   DETAIL VIEW STYLES - Vista de detalle tipo Dashboard
   ===================================================== */

/* Enlace de regreso */
.back-link {
  margin-bottom: 1rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: #374151;
}

.back-link a i {
  font-size: 0.75rem;
}

/* Contenedor principal de detalle (caja grande) */
.detail-container {
  background: white;
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.detail-container-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to bottom, #fafbfc, #ffffff);
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-header-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.detail-header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.detail-header-actions {
  display: flex;
  gap: 0.75rem;
}

.detail-container-body {
  padding: 1.5rem 2rem 2rem;
  background: #f8fafc;
}

/* Grid de Widgets (dentro del contenedor) */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Widget interno (dentro de la caja grande) */
.widget-inner {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.widget-inner-full {
  grid-column: 1 / -1;
}

.widget-inner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.widget-inner-header h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-inner-header h3 i {
  color: #6b7280;
  font-size: 0.875rem;
}

.widget-inner-body {
  padding: 1rem;
}

/* Danger section (dentro del contenedor) */
.danger-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.danger-section-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
}

.danger-section-icon {
  width: 36px;
  height: 36px;
  background: #fee2e2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1rem;
  flex-shrink: 0;
}

.danger-section-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 0.125rem;
}

.danger-section-text p {
  font-size: 0.75rem;
  color: #b91c1c;
  margin: 0;
}

/* Info List dentro de widget */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.info-label {
  font-size: 0.8125rem;
  color: #6b7280;
}

.info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
}

.info-value.muted {
  color: #6b7280;
  font-weight: 400;
  font-size: 0.8125rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: #dbeafe;
  color: #2563eb;
}

.stat-icon-green {
  background: #dcfce7;
  color: #16a34a;
}

.stat-icon-purple {
  background: #f3e8ff;
  color: #9333ea;
}

.stat-icon-orange {
  background: #ffedd5;
  color: #ea580c;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

/* Address List */
.address-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.address-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.address-card:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.address-icon {
  width: 36px;
  height: 36px;
  background: #dbeafe;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  flex-shrink: 0;
}

.address-content {
  flex: 1;
  min-width: 0;
}

.address-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.address-content p {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.address-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
}

.empty-state i {
  font-size: 2.5rem;
  color: #d1d5db;
  margin-bottom: 0.75rem;
  display: block;
}

.empty-state p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1rem 0;
}

.empty-state-sm {
  padding: 1.5rem;
}

.empty-state-sm i {
  font-size: 1.75rem;
}

.empty-state-sm p {
  margin-bottom: 0;
}

/* Danger Card */
.danger-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.danger-card-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.danger-card-icon {
  width: 40px;
  height: 40px;
  background: #fee2e2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.danger-card-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 0.125rem;
}

.danger-card-text p {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0;
}

/* Botón pequeño */
.btn-sm {
  height: 32px !important;
  padding: 0 0.75rem !important;
  font-size: 0.8125rem !important;
}

/* Botón outline */
.btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botón de peligro */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  text-decoration: none;
}

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

.card-section-danger .card-section-header {
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
}

.card-section-danger .card-section-header h2 {
  color: #991b1b;
}

.card-section-danger .card-section-header h2 i {
  color: #dc2626;
}

.card-section-danger .card-section-body {
  background: #fef2f2;
}

/* Zona de peligro layout */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.danger-zone-text {
  flex: 1;
  min-width: 200px;
}

.danger-zone-text strong {
  display: block;
  font-size: 0.9375rem;
  color: #991b1b;
  margin-bottom: 0.25rem;
}

.danger-zone-text p {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0;
  line-height: 1.5;
}

/* Botón de peligro */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  text-decoration: none;
}

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

/* Sección de información (legacy - para compatibilidad) */
.detail-section {
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.detail-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-section-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-section-header h2 i {
  color: #6b7280;
}

.detail-section-body {
  padding: 1.5rem;
}

/* Grid de campos */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-field-value {
  font-size: 1rem;
  color: #1f2937;
  font-weight: 500;
}

.detail-field-value.large {
  font-size: 1.25rem;
  font-weight: 600;
}

.detail-field-value.muted {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 400;
}

/* Lista de items relacionados */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  gap: 1rem;
  transition: all 0.2s ease;
}

.detail-list-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.detail-list-item-content {
  flex: 1;
  min-width: 0;
}

.detail-list-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-list-item-title i {
  color: #3b82f6;
}

.detail-list-item-text {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.detail-list-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Acciones de la vista detalle */
.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0;
  cursor: pointer;
  border: none;
}

.detail-actions .btn-back {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.detail-actions .btn-back:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.detail-actions .btn-edit {
  background: #fef3c7;
  color: #92400e;
}

.detail-actions .btn-edit:hover {
  background: #fde68a;
  color: #78350f;
}

.detail-actions .btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.detail-actions .btn-delete:hover {
  background: #fecaca;
  color: #b91c1c;
}

/* Footer con acciones peligrosas */
.detail-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.detail-footer-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-footer-warning-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-footer-warning-text i {
  color: #dc2626;
  font-size: 1.25rem;
}

.detail-footer-warning-text span {
  font-size: 0.875rem;
  color: #991b1b;
}

/* Responsive Detail - Dashboard Widgets */
@media (max-width: 768px) {
  /* Contenedor principal */
  .detail-container {
    border-radius: 12px;
  }

  .detail-container-header {
    padding: 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }

  .detail-header-info {
    flex-direction: column;
    text-align: center;
  }

  .detail-header-icon {
    margin: 0 auto;
  }

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

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

  .detail-header-actions {
    justify-content: center;
    width: 100%;
  }

  .detail-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .detail-container-body {
    padding: 1rem;
  }

  /* Grid de widgets */
  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .widget-inner-header {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .widget-inner-header .btn {
    width: 100%;
    justify-content: center;
  }

  .widget-inner-body {
    padding: 0.875rem;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.5rem;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  /* Address card */
  .address-card {
    flex-direction: column;
    align-items: stretch;
  }

  .address-icon {
    display: none;
  }

  .address-actions {
    margin-top: 0.75rem;
    justify-content: flex-start;
  }

  .address-actions .action-btn {
    flex: 1;
    justify-content: center;
  }

  /* Danger section */
  .danger-section {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .danger-section-content {
    flex-direction: column;
    text-align: center;
  }

  .danger-section .btn-danger {
    width: 100%;
    justify-content: center;
  }

  /* Empty state */
  .empty-state {
    padding: 1.25rem;
  }

  /* Legacy styles */
  .detail-section-header {
    padding: 0.875rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .detail-section-body {
    padding: 1rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .detail-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-list-item-actions {
    margin-top: 0.75rem;
  }

  .detail-list-item-actions .action-btn {
    flex: 1;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .detail-footer-warning {
    flex-direction: column;
    text-align: center;
  }
}

/* Custom alignment for info list in hospital show view */
.info-list.info-list--aligned-left .info-item {
  justify-content: flex-start;
  gap: 0;
  align-items: flex-start;
}

.info-list.info-list--aligned-left .info-label {
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
}

.info-list.info-list--aligned-left .info-value {
  text-align: left;
  word-break: break-word; /* For long addresses */
}

/* =====================================================
   FORM PAGE STYLES - Formularios de página completa
   ===================================================== */

/* Contenedor del formulario */
.form-container {
  width: 100%;
}

/* Grid de 3 columnas para primera fila (Fecha, Paciente, Médico) */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Grid de 2 columnas para segunda fila (Hospital, Procedimiento) */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Form group para formularios de página */
.dashboard-content .form-group {
  margin-bottom: 0;
}

/* Form group que ocupa el ancho completo */
.dashboard-content .form-group-full {
  grid-column: 1 / -1;
}

.dashboard-content .form-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.dashboard-content .form-control {
  width: 100%;
  height: 42px;
  padding: 0 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9375rem;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  color: #1f2937;
}

.dashboard-content .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dashboard-content .form-control:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.dashboard-content .form-control::placeholder {
  color: #9ca3af;
}

.dashboard-content .form-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.375rem;
  display: block;
}

.dashboard-content .required {
  color: #dc2626;
  margin-left: 0.125rem;
  display: inline;
}

.dashboard-content .form-label-row {
  display: block;
  margin-bottom: 0.5rem;
}

/* Form actions para formularios de página */
.dashboard-content .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.dashboard-content .form-actions .btn {
  height: 42px;
  padding: 0 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  text-decoration: none;
  box-sizing: border-box;
  border: none;
}

.dashboard-content .form-actions .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.dashboard-content .form-actions .btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.dashboard-content .form-actions .btn-cancel {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.dashboard-content .form-actions .btn-cancel:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Error messages para formularios de página */
.dashboard-content .form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.dashboard-content .form-errors-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-content .form-errors-header i {
  color: #dc2626;
  font-size: 1.125rem;
}

.dashboard-content .form-errors-header strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: #dc2626;
}

.dashboard-content .form-errors-list {
  margin: 0;
  padding-left: 1.5rem;
}

.dashboard-content .form-errors-list li {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin-bottom: 0.25rem;
}

.dashboard-content .form-errors-list li:last-child {
  margin-bottom: 0;
}

/* Campo con botón al lado (ej: select + botón agregar) */
.form-field-with-button {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.form-field-with-button .form-control {
  flex: 1;
}

.btn-add-item {
  height: 42px;
  padding: 0 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-add-item:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-add-item:active {
  transform: translateY(0);
}

.btn-add-item i {
  font-size: 0.75rem;
}

/* Responsive form */
@media (max-width: 768px) {
  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-content .form-group {
    margin-bottom: 1rem;
  }

  .dashboard-content .form-actions {
    flex-direction: column-reverse;
  }

  .dashboard-content .form-actions .btn {
    width: 100%;
  }

  .form-field-with-button {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add-item {
    width: 100%;
  }
}

/* ============================================
   DASHBOARD WELCOME - Floating Widgets
   ============================================ */

.dashboard-welcome {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.welcome-header {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.welcome-header h1 i {
  color: #3b82f6;
  margin-right: 0.75rem;
}

.welcome-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
}

/* Grid de widgets flotantes */
.stats-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Widget base */
.stat-widget {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.stat-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-widget::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.1;
  transform: translate(30%, -30%);
}

/* Icono del widget */
.stat-widget-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.stat-widget-content {
  flex: 1;
}

.stat-widget-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-widget-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.stat-widget-sublabel {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Colores de widgets */
.stat-widget-blue .stat-widget-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.stat-widget-blue .stat-widget-value {
  color: #3b82f6;
}

.stat-widget-blue::before {
  background: #3b82f6;
}

.stat-widget-green .stat-widget-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.stat-widget-green .stat-widget-value {
  color: #10b981;
}

.stat-widget-green::before {
  background: #10b981;
}

.stat-widget-purple .stat-widget-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.stat-widget-purple .stat-widget-value {
  color: #8b5cf6;
}

.stat-widget-purple::before {
  background: #8b5cf6;
}

.stat-widget-orange .stat-widget-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.stat-widget-orange .stat-widget-value {
  color: #f59e0b;
}

.stat-widget-orange::before {
  background: #f59e0b;
}

.stat-widget-red .stat-widget-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stat-widget-red .stat-widget-value {
  color: #ef4444;
}

.stat-widget-red::before {
  background: #ef4444;
}

.stat-widget-indigo .stat-widget-icon {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.stat-widget-indigo .stat-widget-value {
  color: #6366f1;
}

.stat-widget-indigo::before {
  background: #6366f1;
}

/* Widget grande con breakdown */
.stat-widget-large {
  grid-column: span 2;
  flex-direction: column;
  align-items: stretch;
}

.stat-widget-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.stat-widget-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.breakdown-item:hover {
  background: #f3f4f6;
}

.breakdown-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  background: white;
  color: #6366f1;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.breakdown-icon-orange {
  color: #f59e0b;
}

.breakdown-label {
  flex: 1;
  font-weight: 500;
  color: #374151;
}

.breakdown-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #6366f1;
}

.breakdown-value-orange {
  color: #f59e0b;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .stat-widget-large {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .dashboard-welcome {
    padding: 1rem;
  }

  .welcome-header h1 {
    font-size: 2rem;
  }

  .stats-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-widget {
    padding: 1.25rem;
  }

  .stat-widget-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .stat-widget-value {
    font-size: 1.75rem;
  }
}

/* ===========================================
   Reloj Checador - Time Records
   =========================================== */

/* Boton Check In/Out en header */
.btn-checador {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-checador.checked-out {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.btn-checador.checked-out:hover {
  background: #bbf7d0;
}

.btn-checador.checked-in {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.btn-checador.checked-in:hover {
  background: #fde68a;
}

/* Geolocation Status in Modal */
.geolocation-status {
  margin-bottom: 1.5rem;
}

.geolocation-loading,
.geolocation-success,
.geolocation-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
}

.geolocation-loading {
  background: #f0f9ff;
  border: 1px dashed #0ea5e9;
}

.geolocation-loading i {
  font-size: 2rem;
  color: #0ea5e9;
  margin-bottom: 0.75rem;
}

.geolocation-loading p {
  margin: 0;
  color: #0369a1;
}

.geolocation-loading .text-muted {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.geolocation-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.geolocation-success i {
  font-size: 2rem;
  color: #22c55e;
  margin-bottom: 0.75rem;
}

.geolocation-success p {
  margin: 0;
  color: #166534;
}

.geolocation-success .coordinates {
  font-family: monospace;
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.5rem;
  background: #e2e8f0;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

.geolocation-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.geolocation-error i {
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 0.75rem;
}

.geolocation-error p {
  margin: 0 0 1rem 0;
  color: #991b1b;
}

/* Check-in Info Display */
.checkin-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.checkin-info .info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

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

.checkin-info .info-label {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
}

.checkin-info .info-value {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 600;
}

/* ===========================================
   Attendance Calendar
   =========================================== */

.attendance-calendar {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.calendar-month {
  flex: 1;
  min-width: 250px;
  max-width: 320px;
}

.calendar-month-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1rem 0;
  text-align: center;
}

.calendar-grid {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-header span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  padding: 4px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.calendar-day-empty {
  background: transparent;
}

.day-number {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Estados del día */
.day-complete {
  background: #dcfce7;
  color: #166534;
}

.day-partial {
  background: #fef3c7;
  color: #92400e;
}

.day-none {
  background: #f1f5f9;
  color: #94a3b8;
}

.day-future {
  background: transparent;
  color: #cbd5e1;
}

.day-today {
  box-shadow: 0 0 0 2px #6366f1;
}

.day-clickable {
  cursor: pointer;
  text-decoration: none;
}

.day-clickable:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Leyenda del calendario */
.calendar-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #64748b;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-complete {
  background: #dcfce7;
  border: 1px solid #86efac;
}

.legend-partial {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.legend-none {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* ===========================================
   Current Status Card (User Show)
   =========================================== */

.current-status-card {
  text-align: center;
  padding: 1.5rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.status-checked-in {
  background: #dcfce7;
  color: #166534;
}

.status-checked-in i {
  color: #22c55e;
}

.status-checked-out {
  background: #f1f5f9;
  color: #64748b;
}

.status-checked-out i {
  color: #94a3b8;
}

.status-detail {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.5rem 0;
}

.status-coords {
  font-family: monospace;
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0;
}

.status-coords i {
  margin-right: 0.25rem;
}

/* ===========================================
   Time Record Modal (Show)
   =========================================== */

.modal-container-lg {
  max-width: 700px;
}

.time-record-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: #1e293b;
}

.time-record-user-info i {
  color: #6366f1;
}

.time-records-day {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.time-record-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.record-check-in {
  border-left: 4px solid #22c55e;
}

.record-check-out {
  border-left: 4px solid #f59e0b;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.record-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.record-check-in .record-type {
  color: #166534;
}

.record-check-in .record-type i {
  color: #22c55e;
}

.record-check-out .record-type {
  color: #92400e;
}

.record-check-out .record-type i {
  color: #f59e0b;
}

.record-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #64748b;
}

.record-location {
  padding: 1rem;
}

.record-coords {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: monospace;
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.record-coords i {
  color: #ef4444;
}

.record-map {
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
}

.record-map-link {
  text-align: center;
}

.record-no-location {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

.record-no-location i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.time-record-summary {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-size: 0.875rem;
  color: #166534;
}

.summary-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #166534;
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .attendance-calendar {
    flex-direction: column;
    align-items: center;
  }
  
  .calendar-month {
    width: 100%;
    max-width: 100%;
  }
  
  .calendar-legend {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===========================================
   Utility Classes
   =========================================== */

.hidden {
  display: none !important;
}
