@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  --header-height: 80px;
  --sidebar-width: 280px;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #06b6d4;
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #000000;
  --bg-header: #000000;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
  height: 100%;
  width: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  padding-left: var(--sidebar-width);
  padding-top: var(--header-height);
  background: var(--bg-body);
  transition: var(--transition);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Navegacion */

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3rem;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-logo-link {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}
.header-logo-link:hover {
  transform: scale(1.08);
}

.header-logo {
  max-height: 55px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.2));
}

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

.header-button {
  padding: 0.875rem 2rem;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  color: var(--text-white);
}

.header-button-primary {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}
.header-button-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6);
}

.header-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white) !important;
  border-color: rgba(255, 255, 255, 0.2);
}
.header-button-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* --- Mobile Menu Toggle --- */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 0.44rem;
  left: 0.75rem;
  z-index: 1002;
  background: rgba(2, 2, 2, 0.9);
  border: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 13, 14, 0.3);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 3px;
  background-color: var(--text-white);
  border-radius: 3px;
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: rgba(59, 130, 246, 1);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Fixed X icon transformation for close button */
.mobile-menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* --- Sidebar --- */
.vertical-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: var(--transition);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0;
}

.menu-content::-webkit-scrollbar {
  width: 10px;
}
.menu-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
.menu-content::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 6px;
}
.menu-content::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

.menu-section {
  margin-bottom: 0.5rem;
}

.menu-section-title {
  width: 100%;
  padding: 1.25rem 2rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  border-left: 4px solid transparent;
}
.menu-section-title:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary-light);
  padding-left: 2.25rem;
  border-left-color: var(--color-primary);
}

.menu-arrow {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
  color: var(--color-primary);
  font-size: 0.875rem;
}
.menu-section.open .menu-arrow {
  transform: rotate(180deg);
  color: var(--color-primary-light);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-section.open .menu-list {
  max-height: 800px;
}

.menu-list li {
  margin: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 1.125rem 2rem 1.125rem 3.5rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.9375rem;
  font-weight: 500;
  border-left: 4px solid transparent;
  position: relative;
}
.menu-item::before {
  content: "";
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #64748b;
  border-radius: 50%;
  transition: var(--transition);
  display: none !important;
}
.menu-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text-white);
  padding-left: 3.75rem;
  border-left-color: var(--color-primary);
}
.menu-item:hover::before {
  background: var(--color-primary);
  transform: translateY(-50%) scale(1.5);
  box-shadow: 0 0 12px var(--color-primary);
}

.content-wrapper {
  padding: 3rem 3.5rem;
  margin: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.content-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* ==========================
   COMPONENTS: TABLES
   ========================== */
.table-custom {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.table-custom thead {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.table-custom thead th {
  color: var(--text-white);
  font-weight: 800;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1.75rem 1.5rem;
  border: none;
  text-align: left;
}

.table-custom thead th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: var(--transition);
}

.table-custom thead th.sortable:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* Making sort indicator inline with text */
.table-custom thead th.sortable a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.table-custom thead th.sortable .sort-indicator {
  display: inline-block;
  font-size: 0.875rem;
  opacity: 1;
  transition: var(--transition);
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
}

.table-custom thead th.sortable:hover .sort-indicator {
  color: rgba(255, 255, 255, 0.7);
}

.table-custom thead th.sortable.active .sort-indicator {
  opacity: 1;
  color: var(--color-primary-light);
}

.table-custom thead th.sortable .sort-indicator::after {
  content: "↕";
  opacity: 0;
  transition: var(--transition);
}

.table-custom thead th.sortable:hover .sort-indicator::after {
  opacity: 1;
}

.table-custom thead th.sortable .sort-indicator.asc::after {
  content: "↑";
  opacity: 1;
}

.table-custom thead th.sortable .sort-indicator.desc::after {
  content: "↓";
  opacity: 1;
}

.table-custom tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.table-custom tbody tr:hover {
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
  transform: translateX(8px);
  box-shadow: var(--shadow-sm);
}
.table-custom tbody tr:last-child {
  border-bottom: none;
}

.table-custom tbody td {
  padding: 1.5rem 1.5rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  vertical-align: middle;
  font-weight: 500;
}

.table-custom tbody td.action-buttons {
  padding: 0.75rem 1rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.table-custom tbody td.action-buttons .btn {
  padding: 0.5rem 1rem;
  min-width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  margin: 0 0.25rem;
  font-size: 0.875rem;
}

/* Fixed Estado column - centered text */
.table-custom tbody td.estado-column {
  text-align: center;
  font-weight: 600;
  padding: 1.5rem 1.5rem;
  vertical-align: middle;
}

.table-custom tbody td.estado-column .badge {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
  font-size: 0.875rem;
}

.table-custom tbody td.estado-column .badge.activo {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
}

.table-custom tbody td.estado-column .badge.inactivo {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.table-custom tbody td.profile-column {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  text-align: center;
}

.profile-icons-container {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.profile-icons {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.profile-icon {
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.profile-icon.active {
  color: #10b981;
}

.profile-icon.active.alerta {
  color: #f59e0b;
  animation: pulse 2s infinite;
}

.profile-icon.active.vencido {
  color: #ef4444;
}

.profile-icon.inactive {
  color: #cbd5e1;
  opacity: 0.5;
}

.profile-icon:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.form-control,
.form-select,
.textarea-custom {
  border-radius: var(--border-radius-sm);
  border: 2px solid #e2e8f0;
  transition: var(--transition);
  font-size: 0.9375rem;
  padding: 0.875rem 1.25rem;
  font-weight: 500;
  background: var(--bg-card);
}
.form-control:focus,
.form-select:focus,
.textarea-custom:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.form-label {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-custom {
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  transition: var(--transition);
  border: 2px solid transparent;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  padding: 0.875rem 1.75rem;
  text-transform: uppercase;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}
.btn-primary-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5);
}

.btn-success-custom {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
.btn-success-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.5);
}

.btn-danger-custom {
  background: linear-gradient(135deg, var(--color-danger) 0%, #dc2626 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}
.btn-danger-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.5);
}

.btn-warning-custom {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}
.btn-warning-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.5);
}

.btn-info-custom {
  background: linear-gradient(135deg, var(--color-info) 0%, #0891b2 100%);
  color: var(--text-white) !important;
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.4);
}
.btn-info-custom:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(8, 145, 178, 0.5);
}

.alert-custom {
  border-radius: var(--border-radius-sm);
  border-left: 6px solid;
  box-shadow: var(--shadow-md);
  font-weight: 600;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.alert-info-custom {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left-color: var(--color-primary);
  color: #1e40af;
}
.alert-success-custom {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left-color: var(--color-success);
  color: #166534;
}
.alert-danger-custom {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left-color: var(--color-danger);
  color: #991b1b;
}
.alert-warning-custom {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: var(--color-warning);
  color: #92400e;
}

/* MODALS */

/* General Modal */
.modal-custom {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-custom.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-custom-content {
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUpFade 0.4s ease;
  overflow: hidden;
}

.modal-custom-header {
  padding: 20px 20px 15px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
}

.modal-custom-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.modal-exito-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s;
}
.modal-exito-close:hover {
  color: #333;
}

.modal-custom-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
}

.modal-custom-footer {
  padding: 15px 20px;
  border-top: 1px solid #e5e5e5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8f9fa;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.modal-custom-footer .btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

/* Success Modal */
.modal-exito {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}
.modal-exito.is-active {
  display: flex !important;
}

.modal-exito-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUpFade 0.4s ease;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-exito-header {
  padding: 2rem 2rem 1rem 2rem;
  text-align: center;
}

.modal-exito-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem auto;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}
@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}
.modal-exito-icon i {
  font-size: 2.5rem;
  color: white;
}

.modal-exito-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.modal-exito-body {
  padding: 0 2rem 2rem 2rem;
}

.modal-exito-servicio {
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 1.5rem;
}

.modal-exito-detalles {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.modal-exito-detalle {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.modal-exito-detalle:last-child {
  border-bottom: none;
}

.modal-exito-detalle-label {
  font-weight: 600;
  color: #64748b;
  font-size: 0.875rem;
}
.modal-exito-detalle-valor {
  font-weight: 500;
  color: #1e293b;
  font-size: 0.875rem;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.modal-exito-acciones {
  display: flex;
  gap: 0.75rem;
}

.btn-exito {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-exito-copiar {
  background: #3b82f6;
  color: white;
}
.btn-exito-copiar:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-exito-notificar {
  background: #25d366;
  color: white;
}
.btn-exito-notificar:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ESTADISTICAS */

.stats-header {
  margin-bottom: 2rem;
}

.stats-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.stats-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.stats-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.stats-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.kpi-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.kpi-primary .kpi-icon {
  background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
}

.kpi-success .kpi-icon {
  background: linear-gradient(135deg, #2ed573 0%, #7bed9f 100%);
}

.kpi-info .kpi-icon {
  background: linear-gradient(135deg, #5352ed 0%, #3742fa 100%);
}

.kpi-warning .kpi-icon {
  background: linear-gradient(135deg, #ffa502 0%, #ff6348 100%);
}

.kpi-content {
  flex: 1;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.kpi-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.chart-card:hover {
  box-shadow: var(--shadow-lg);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.chart-title i {
  color: var(--color-primary);
}

.chart-total {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chart-total strong {
  color: var(--text-primary);
  font-weight: 700;
}

.chart-body {
  position: relative;
  height: 300px;
}

.stats-summary {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.summary-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.summary-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.summary-icon.bg-danger {
  background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
}

.summary-icon.bg-success {
  background: linear-gradient(135deg, #2ed573 0%, #7bed9f 100%);
}

.summary-icon.bg-info {
  background: linear-gradient(135deg, #5352ed 0%, #3742fa 100%);
}

.summary-content {
  flex: 1;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stats-activity {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.activity-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-title i {
  color: var(--color-primary);
}

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

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
  background: var(--color-primary);
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.activity-text strong {
  font-weight: 700;
  color: var(--color-primary);
}

.activity-time {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.activity-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.activity-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.activity-empty p {
  font-size: 0.9375rem;
  margin: 0;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: var(--transition);
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--text-primary);
}

.pagination a:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pagination a.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #000000 0%, #764ba2 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  25% {
    transform: translateY(-100px) translateX(50px) scale(1.1);
  }
  50% {
    transform: translateY(-200px) translateX(-50px) scale(0.9);
  }
  75% {
    transform: translateY(-100px) translateX(100px) scale(1.05);
  }
}

.login-box {
  background: rgb(75, 35, 91);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(125, 25, 54, 0.3);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
  animation: slideUpFade 0.6s ease;
}

.login-logo {
  display: block;
  margin: 0 auto 2rem;
  max-width: 120px;
  height: auto;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.btn-login {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.social-login {
  margin-top: 2rem;
  text-align: center;
}

.social-login p {
  color: #64748b;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.whatsapp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.whatsapp-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

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

/* ==========================
   RESPONSIVE DESIGN
   ========================== */
@media screen and (max-width: 1024px) {
  :root {
    --header-height: 70px;
  }

  body {
    padding-left: 0;
  }

  .vertical-menu {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 300px;
    transform: translateX(-100%);
    z-index: 1001;
  }

  .vertical-menu.is-active {
    transform: translateX(0);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .menu-overlay {
    display: block;
  }

  .content-wrapper {
    margin: 1.5rem;
    padding: 2rem;
  }

  .stats-charts {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --header-height: 65px;
  }

  body {
    padding-left: 0;
    padding-top: var(--header-height);
  }

  .top-header {
    padding: 0.75rem 1rem;
    height: var(--header-height);
    flex-wrap: nowrap;
  }

  .header-left {
    margin-left: 60px;
  }

  .header-logo {
    height: 40px;
  }

  .header-right {
    gap: 0.5rem;
  }

  .header-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  .header-button i {
    font-size: 1.125rem;
    margin: 0;
  }

  .header-button span {
    display: none;
  }

  .header-button-primary {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  }

  .header-button-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
  }

  .vertical-menu {
    width: 280px;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
  }

  .vertical-menu.is-active {
    transform: translateX(0);
  }

  .main-content {
    padding: 0;
  }

  .content-wrapper {
    margin: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
  }

  .page-title {
    font-size: 1.75rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .table-custom thead th {
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
  }

  .table-custom tbody td {
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
  }

  .table-custom tbody td.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-custom tbody td.action-buttons .btn {
    flex-shrink: 0;
    min-width: 80px;
  }

  .profile-icons-container {
    display: inline-flex;
    justify-content: center;
  }

  .profile-icons {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .profile-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .modal-exito-acciones {
    flex-direction: column;
    gap: 0.625rem;
  }

  /* Stack modal buttons vertically on mobile */
  .modal-custom-footer {
    flex-direction: column;
    gap: 0.75rem;
    padding: 15px;
  }

  .modal-custom-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .modal-custom-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-custom-body {
    padding: 15px;
  }

  .modal-custom-header {
    padding: 15px;
  }

  .login-container {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .login-box {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }

  .stats-filters {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
  }

  .stats-kpis {
    grid-template-columns: 1fr;
  }

  .stats-charts {
    grid-template-columns: 1fr;
  }

  .chart-body {
    height: 250px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-item {
    padding: 1rem;
  }

  .summary-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .summary-value {
    font-size: 1.25rem;
  }
}

@media screen and (max-width: 480px) {
  .header-left {
    margin-left: 55px;
  }

  .header-logo {
    height: 35px;
  }

  .content-wrapper {
    margin: 0.75rem;
    padding: 1.25rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .pagination a,
  .pagination span {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }
}

@media print {
  .vertical-menu,
  .mobile-menu-toggle,
  .menu-overlay,
  .header-button,
  .btn-custom,
  .action-buttons {
    display: none !important;
  }

  body {
    padding: 0;
    background: white;
  }

  .content-wrapper {
    margin: 0;
    padding: 1rem;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .table-custom {
    page-break-inside: avoid;
  }
}

.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media screen and (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

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

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
  .btn-custom,
  .header-button,
  .menu-item,
  .pagination a,
  .pagination span {
    min-height: 44px;
    min-width: 44px;
  }

  .table-custom tbody td.action-buttons .btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ACS */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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