/* Estilos Globales - Todas las páginas */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Botones principales */
.btn-primary {
  background-color: #a41f3a;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #71202f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(164, 31, 58, 0.3);
}

.btn-secondary {
  background-color: #71202f;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #a41f3a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(113, 32, 47, 0.3);
}

/* Header fijo */
.app-header {
  background: linear-gradient(135deg, #a41f3a 0%, #71202f 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

/* Sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  margin: 0.25rem 0.75rem;
  color: #4b5563;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  border-radius: 0.5rem;
  position: relative;
  background-color: transparent;
}

.sidebar-item i {
  margin-right: 0.75rem;
  transition: all 0.3s ease;
  width: 20px;
  text-align: center;
}

.sidebar-item svg {
  margin-right: 0.75rem;
  transition: all 0.3s ease;
}

.sidebar-item:hover {
  background-color: #f3f4f6;
  color: #1f2937;
  transform: translateX(4px);
}

.sidebar-item:hover svg,
.sidebar-item:hover i {
  transform: scale(1.1);
}

.sidebar-item.active {
  background: linear-gradient(135deg, #a41f3a 0%, #71202f 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(164, 31, 58, 0.3);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background-color: #71202f;
  border-radius: 0 4px 4px 0;
}

/* Sidebar colapsable */
.sidebar {
  width: 256px;
  transition: all 0.3s ease;
  background-color: white;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding-top: 5rem;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  border-right: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .sidebar-item span {
  display: none;
}

.sidebar.collapsed .user-info-content {
  display: none;
}

.sidebar.collapsed .user-avatar {
  display: none;
}

.sidebar.collapsed .toggle-sidebar-btn {
  width: 100%;
  margin: 0;
}

.sidebar.collapsed .user-avatar-text {
  margin: 0 auto;
}

/* Usuario en sidebar */
.sidebar-user-info {
  margin-top: auto;
  padding: 1.5rem 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar.collapsed .sidebar-user-info {
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a41f3a 0%, #71202f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-info-content {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: #6b7280;
}

.toggle-sidebar-btn {
  background-color: #f3f4f6;
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.sidebar.collapsed .toggle-sidebar-btn {
  width: 100%;
  height: 40px;
  margin: 0;
}

.toggle-sidebar-btn:hover {
  background-color: #a41f3a;
  color: white;
}

/* Botón flotante para abrir sidebar colapsado - NO USADO */
.open-sidebar-btn {
  display: none !important;
}

/* Ajuste del contenido principal */
.main-content {
  margin-left: 256px;
  transition: all 0.3s ease;
  flex: 1;
  padding: 2rem;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 80px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Table styles */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.custom-table thead {
  background: linear-gradient(135deg, #a41f3a 0%, #71202f 100%);
  color: white;
}

.custom-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.custom-table tbody tr {
  transition: all 0.2s ease;
}

.custom-table tbody tr:hover {
  background-color: #f9fafb;
  transform: scale(1.001);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-table tbody tr.bg-gray-100 {
  background-color: #f3f4f6;
}

.custom-table tbody tr.bg-yellow-50 {
  background-color: #fefce8;
}

.custom-table tbody tr.bg-gray-100:hover {
  background-color: #e5e7eb;
}

.custom-table tbody tr.bg-yellow-50:hover {
  background-color: #fef9c3;
}

/* Inputs */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #a41f3a;
}

/* Tablas responsive */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table-container::-webkit-scrollbar {
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #a41f3a;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #71202f;
}

/* Cards con animación */
.stat-card {
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #a41f3a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #71202f;
}
