/* ═══════════ VARIABLES ═══════════ */
:root {
  --igg-blue: #1A417E;
  --igg-blue-dark: #122D58;
  --igg-gold: #FDBE11;
  --igg-gold-hover: #E5AB00;
  --igg-cream: #F4F2E7;
  --igg-lion: #A3A278;
  --igg-lion-light: #C4C2A0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════ NAVBAR GLASS ═══════════ */
#navbar {
  background: rgba(18, 45, 88, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-scrolled {
  background: rgba(18, 45, 88, 0.72) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.navbar-scrolled .nav-link {
  color: white;
}

/* ═══════════ RICH TEXT EDITOR ═══════════ */
[contenteditable][placeholder]:empty:before {
  content: attr(placeholder);
  color: #9ca3af;
  pointer-events: none;
  display: block;
}

/* ═══════════ ANIMACIONES ═══════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes floatDelayed {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatDelayed 8s ease-in-out infinite;
  animation-delay: 2s;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease-out forwards;
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--igg-cream);
}

::-webkit-scrollbar-thumb {
  background: var(--igg-lion);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--igg-blue);
}

/* ═══════════ LOGIN PAGE ═══════════ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--igg-blue) 0%, var(--igg-blue-dark) 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(253, 190, 17, 0.1) 0%, transparent 70%);
  animation: float 10s ease-in-out infinite;
}

.login-card {
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}

.login-input:focus {
  outline: none;
  border-color: var(--igg-gold);
  box-shadow: 0 0 0 3px rgba(253, 190, 17, 0.15);
}

.login-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--igg-gold);
  color: var(--igg-blue);
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(253, 190, 17, 0.4);
}

.login-btn:hover {
  background: var(--igg-gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(253, 190, 17, 0.5);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════ DASHBOARD ═══════════ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--igg-cream);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--igg-blue) 0%, var(--igg-blue-dark) 100%);
  color: white;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
  z-index: 30;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: var(--igg-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--igg-blue);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0.5rem 1.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  margin-top: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-link.active {
  background: rgba(253, 190, 17, 0.1);
  color: var(--igg-gold);
  border-left-color: var(--igg-gold);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  flex: 1;
  min-height: 100vh;
}

.topbar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--igg-blue);
  font-size: 1.25rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: #6b7280;
  transition: all 0.2s;
}

.topbar-btn:hover {
  background: var(--igg-cream);
  color: var(--igg-blue);
}

.topbar-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--igg-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

.content-area {
  padding: 2rem;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--igg-blue);
  line-height: 1;
}

.stat-label {
  color: #9ca3af;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Dashboard Cards */
.dash-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.dash-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--igg-blue);
  font-size: 0.95rem;
}

.dash-card-body {
  padding: 1.5rem;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #f3f4f6;
}

.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f9fafb;
}

.data-table tr:hover {
  background: #fafaf8;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #4b5563; }

/* Buttons */
.btn-primary {
  background: var(--igg-gold);
  color: var(--igg-blue);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}
.btn-primary:hover {
  background: var(--igg-gold-hover, #d4a818);
  opacity: 0.95;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Calendar mini */
.calendar-day {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.calendar-day:hover {
  background: var(--igg-cream);
}

.calendar-day.today {
  background: var(--igg-gold);
  color: var(--igg-blue);
  font-weight: 700;
}

.calendar-day.has-event {
  position: relative;
}

.calendar-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--igg-blue);
  border-radius: 50%;
}

/* Messages */
.message-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: background 0.15s;
  cursor: pointer;
}

.message-item:hover {
  background: #fafaf8;
}

.message-item.unread {
  background: rgba(253, 190, 17, 0.05);
  border-left: 3px solid var(--igg-gold);
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Notification dropdown */
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 50;
  display: none;
}

.notification-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f9fafb;
  cursor: pointer;
  transition: background 0.15s;
}

.notification-item:hover {
  background: #fafaf8;
}

.notification-item.unread {
  background: rgba(253, 190, 17, 0.03);
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 50;
  display: none;
  overflow: hidden;
}

.user-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: var(--igg-cream);
  color: var(--igg-blue);
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 25;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

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

  .topbar {
    padding: 0.75rem 1rem;
  }

  .notification-dropdown {
    width: 300px;
    right: -4rem;
  }

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

/* ═══════════ PRINT ═══════════ */
@media print {
  .sidebar, .topbar, .chatbot-container {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }
}
