:root {
  --ubb-blue: #003366;
  --ubb-blue-dark: #002244;
  --ubb-blue-light: #004d99;
  --ubb-gold: #f4a900;
  --ubb-gold-dark: #d99200;
  --ubb-gold-light: #fcd34d;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Institutional Header & Sidebar */
.bg-ubb-blue {
  background-color: var(--ubb-blue);
}
.bg-ubb-dark {
  background-color: var(--ubb-blue-dark);
}
.bg-ubb-gold {
  background-color: var(--ubb-gold);
}
.text-ubb-blue {
  color: var(--ubb-blue);
}
.text-ubb-gold {
  color: var(--ubb-gold);
}
.border-ubb-gold {
  border-color: var(--ubb-gold);
}

/* Calendar Grid Styles (Lunes a Domingo) */
.calendar-container {
  display: grid;
  grid-template-columns: 75px repeat(7, minmax(145px, 1fr));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.calendar-header-cell {
  background: #f8fafc;
  padding: 12px 8px;
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.calendar-header-cell.today {
  background: #eff6ff;
  border-bottom: 3px solid var(--ubb-blue);
  color: var(--ubb-blue);
}

.time-col {
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding-top: 10px;
}

.calendar-day-col {
  position: relative;
  border-right: 1px solid var(--border-color);
  min-height: 840px; /* 14 slots of 1 hour approx */
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 59px,
    #f1f5f9 59px,
    #f1f5f9 60px
  );
}

.calendar-day-col:last-child {
  border-right: none;
}

/* Event Card inside Calendar */
.event-card {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 5;
  border-left: 4px solid;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

/* Event Category Colors */
.cat-docencia {
  background-color: #e0f2fe;
  border-left-color: #0284c7;
  color: #0369a1;
}

.cat-seleccion {
  background-color: #fef3c7;
  border-left-color: #d97706;
  color: #92400e;
}

.cat-taller {
  background-color: #dcfce7;
  border-left-color: #16a34a;
  color: #166534;
}

.cat-torneo {
  background-color: #fae8ff;
  border-left-color: #a855f7;
  color: #7e22ce;
}

.cat-libre {
  background-color: #f3f4f6;
  border-left-color: #6b7280;
  color: #374151;
}

.cat-mantenimiento {
  background-color: #fee2e2;
  border-left-color: #dc2626;
  color: #991b1b;
}

.cat-externo {
  background-color: #ffedd5;
  border-left-color: #ea580c;
  color: #9a3412;
}

/* Modals */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

/* Role Badges */
.badge-role-admin {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.badge-role-jefe {
  background-color: #e0e7ff;
  color: #3730a3;
  border: 1px solid #a5b4fc;
}
.badge-role-recinto {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.badge-role-encargado {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.badge-role-auxiliar {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* Animation utilities */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Status Indicators */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.disponible { background-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot.mantenimiento { background-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.status-dot.reservado { background-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.status-dot.inactivo { background-color: #9ca3af; box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2); }
