:root {
  --primary-color: #0F2040; /* Deep Institutional Blue */
  --primary-hover: #1A365D;
  --accent-color: #E2E8F0;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --bg-color: #F8FAFC;
  --card-bg: #FFFFFF;
  --danger-color: #EF4444;
  --success-color: #10B981;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

a {
  color: var(--primary-hover);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Layout - Auth Pages */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
}

.auth-card {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.5s ease-out;
}

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

.auth-logo {
  max-width: 120px;
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

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

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #fff;
  transition: var(--transition);
  color: var(--text-main);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(15, 32, 64, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  width: 100%;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  max-width: 160px;
  margin-bottom: 1rem;
}

.sidebar-nav {
  padding: 1.5rem 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  gap: 1rem;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--bg-color);
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  overflow-y: auto;
}

.topbar {
  background-color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.logout-btn {
  color: var(--danger-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.logout-btn:hover {
  text-decoration: underline;
}

.content-wrapper {
  padding: 2rem;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

/* Dashboard - ID Card Redesign (Credit Card Size) */
.id-card-wrapper {
  display: flex;
  justify-content: center;
  perspective: 1000px;
  width: 100%;
  overflow: hidden;
  align-items: flex-start;
}

.id-card-scaler {
  transform-origin: top center;
  transition: transform 0.3s ease;
}

.id-card {
  width: 420px;
  height: 666px;
  flex-shrink: 0;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease;
}

.id-card:hover {
  transform: translateY(-5px) rotateX(2deg) rotateY(2deg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2), 0 10px 20px rgba(0, 0, 0, 0.05);
}

.id-card-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1.2rem 1.5rem;
  text-align: left;
  position: relative;
  height: 22%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.id-card-logo {
  max-width: 160px; /* Logo escalado */
  /* filter: brightness(0) invert(1); -> REMOVIDO PARA MOSTRAR COLORES ORIGINALES */
  position: relative;
  z-index: 10;
}

.id-card-body {
  padding: 2.5rem 2rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.id-photo {
  width: 150px;
  height: 175px;
  border-radius: 12px;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--shadow-sm);
  margin-top: -85px;
  margin-bottom: 1.5rem;
  background-color: white;
  z-index: 3;
  position: relative;
}

.id-name {
  font-size: 1.9rem; /* Mucho más grande */
  font-weight: 800; /* Extra bold */
  color: var(--text-color);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.id-career {
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.id-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: auto;
}

.id-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.15rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.15);
}

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

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
}

.id-footer {
  background-color: var(--secondary-color);
  color: white;
  text-align: center;
  padding: 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Alerts and Messages */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-danger {
  background-color: #FEF2F2;
  color: var(--danger-color);
  border: 1px solid #FCA5A5;
}

.alert-success {
  background-color: #ECFDF5;
  color: var(--success-color);
  border: 1px solid #6EE7B7;
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
  }
  .sidebar-header {
    padding: 1rem;
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }
  .nav-item {
    padding: 1rem;
    white-space: nowrap;
  }
  .content-wrapper {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .id-card-scaler {
    transform: scale(0.85);
    margin-bottom: -100px;
  }
}

@media (max-width: 480px) {
  .id-card-scaler {
    transform: scale(0.75);
    margin-bottom: -166px;
  }
}

@media (max-width: 400px) {
  .id-card-scaler {
    transform: scale(0.65);
    margin-bottom: -233px;
  }
}

@media (max-width: 340px) {
  .id-card-scaler {
    transform: scale(0.55);
    margin-bottom: -300px;
  }
}

/* Admin Styles */
.admin-badge {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  display: inline-block;
  margin-left: 0.5rem;
}

.admin-nav-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.admin-nav-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Biblioteca Digital Bookshelf */
.bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 3rem 2rem;
  padding: 2rem 0;
}

.book-container {
  perspective: 1500px;
  display: flex;
  justify-content: center;
}

.book {
  width: 180px;
  height: 250px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  box-shadow: 5px 5px 20px rgba(0,0,0,0.15);
  border-radius: 2px 6px 6px 2px;
}

.book:hover {
  transform: rotateY(15deg) translateZ(10px);
  box-shadow: 8px 8px 25px rgba(0,0,0,0.2);
}

.book-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2px 6px 6px 2px;
  background-color: var(--primary-color);
  color: white;
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  box-shadow: inset 4px 0 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  backface-visibility: hidden;
}

.book:hover .book-cover {
  transform: rotateY(-130deg);
  box-shadow: inset 4px 0 10px rgba(0,0,0,0.1), 10px 0 20px rgba(0,0,0,0.3);
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: linear-gradient(to right, rgba(255,255,255,0.2), rgba(0,0,0,0.1), rgba(255,255,255,0.1));
  border-radius: 2px 0 0 2px;
}

.book-title {
  margin-top: 1rem;
}

.book-title h4 {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: white;
}

.book-title p {
  font-size: 0.8rem;
  opacity: 0.8;
}

.book-pages {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  right: 3px;
  background-color: #f9f9f9;
  border-radius: 2px 4px 4px 2px;
  z-index: 1;
  box-shadow: inset -2px 0 5px rgba(0,0,0,0.05);
  border: 1px solid #e0e0e0;
  border-left: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, #f0f0f0 2px, #f0f0f0 4px);
}

.book-content {
  background: white;
  width: 90%;
  height: 90%;
  padding: 1rem;
  border-radius: 2px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
