/* ── Design System EVA Technology Portal ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Fondos (Modo Oscuro Exclusivo) */
  --bg-base:        #090c15;
  --bg-surface:     #0f131f;
  --bg-surface-2:   #161b28;
  --bg-sidebar:     #0e1118;

  /* Bordes */
  --border:         #1e2538;
  --border-strong:  #2a3248;

  /* Textos */
  --text-primary:   #e8eaf2;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  /* Accent principal */
  --accent:         #276cb3;
  --accent-dark:    #1d5a9a;
  --accent-light:   #38bdf8;
  --accent-subtle:  rgba(39, 108, 179, 0.12);
  --accent-border:  rgba(39, 108, 179, 0.4);

  /* Sombras */
  --shadow-offset:  3px 3px 0 var(--border-strong);
  --shadow-card:    0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-hover:   4px 4px 0 var(--border-strong);

  /* Radios de Borde */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  16px;

  /* Colores Semánticos */
  --color-success:        #22c55e;
  --color-success-subtle: rgba(34, 197, 94, 0.12);
  --color-warning:        #f59e0b;
  --color-warning-subtle: rgba(245, 158, 11, 0.12);
  --color-danger:         #ef4444;
  --color-danger-subtle:  rgba(239, 68, 68, 0.12);

  /* Tipografía */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Preloader Ripple (Desactivado para transición instantánea sin parpadeo) */
.preloader {
  display: none !important;
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.lds-ripple {
  width: 80px;
  height: 80px;
  position: relative;
}
.lds-ripple div {
  position: absolute;
  border: 4px solid var(--accent);
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes lds-ripple {
  0%   { top: 36px; left: 36px; width: 0;    height: 0;    opacity: 1; }
  100% { top: 0;    left: 0;    width: 72px; height: 72px; opacity: 0; }
}

/* ── Pantalla de Login Institucional (Composición Equilibrada) ── */
.login-page-bg {
  min-height: 100vh;
  width: 100%;
  background-color: #080c14 !important;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 65% 50%, rgba(39, 108, 179, 0.18) 0%, transparent 65%);
  background-size: 24px 24px, 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-grid-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 80px;
  width: 100%;
  max-width: 1050px;
}

/* Columna Izquierda (Marca & Checklist en caja equilibrada) */
.login-left-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 440px;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Logo ajustado ignorando márgenes transparentes de la imagen */
.login-logo-img {
  width: 384px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin-top: -30px;
  margin-bottom: -40px;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
}

.login-feature-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-left: 2px;
  margin-top: 0;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cbd5e1;
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.login-check-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #38bdf8;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

/* Columna Derecha (Card de Login) */
.login-card-container {
  width: 420px;
  max-width: 100%;
  background: #0e121d;
  border: 1px solid #1e2638;
  border-radius: 16px;
  padding: 36px 34px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.login-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 24px 0;
  letter-spacing: -0.02em;
}

.login-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px; /* Pegado directamente arriba del cuadro de entrada */
}

.input-relative {
  position: relative;
  width: 100%;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 15px;
  pointer-events: none;
}

.input-icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.input-icon-right:hover {
  color: #38bdf8;
}

.login-input {
  width: 100%;
  height: 46px;
  background: #e9f0f8 !important;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 42px;
  color: #0f172a !important;
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}
.login-input:focus {
  border-color: #276cb3;
  box-shadow: 0 0 0 3px rgba(39, 108, 179, 0.25);
  background: #ffffff !important;
}
.login-input::placeholder {
  color: #94a3b8;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 0.8rem;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.login-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #334155;
  background: #0f172a;
  accent-color: #276cb3;
  cursor: pointer;
}

.login-forgot-link {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.login-forgot-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.login-btn-submit {
  width: 100%;
  height: 46px;
  background: #276cb3;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(39, 108, 179, 0.4);
  transition: all 0.15s ease;
}
.login-btn-submit:hover {
  background: #2b77c4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(39, 108, 179, 0.5);
}
.login-btn-submit:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(39, 108, 179, 0.3);
}

.login-support-link {
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.login-support-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* Responsivo para Móvil */
@media (max-width: 860px) {
  .login-grid-wrapper {
    flex-direction: column;
    gap: 40px;
  }
  .login-left-brand {
    align-items: center;
    text-align: center;
  }
  .login-logo-img {
    margin-bottom: 24px;
  }
}

/* ── Layout Shell Principal (Dashboard, Tickets, etc.) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff !important;
  border: 1.5px solid var(--accent-dark);
  border-radius: var(--radius-md);
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-offset);
  transition: all 0.15s ease;
}
.btn-primary:hover {
  background: #2b77c4;
  box-shadow: var(--shadow-hover);
  transform: translate(-1px, -1px);
}
.btn-primary:active {
  transform: translate(1px, 1px);
}

/* Sidebar Fijo */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 225px;
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: width 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-header-text,
.sidebar.collapsed .sidebar-footer-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.1s ease, color 0.1s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: none !important;
}
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent-light) !important;
  font-weight: 700;
  border-color: var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: none;
}

.app-header {
  position: fixed;
  top: 0;
  left: 225px;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: left 0.3s ease;
}
.sidebar.collapsed ~ .app-header { left: 70px; }

.main-content {
  margin-left: 225px;
  width: calc(100% - 225px);
  min-height: 100vh;
  padding: 24px;
  padding-top: 84px;
  transition: margin-left 0.3s ease, width 0.3s ease;
}
.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
  width: calc(100% - 70px);
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.header-icon-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-light);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: all 0.15s ease;
}
.user-profile-badge:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-offset);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  object-fit: cover;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .app-header { left: 0 !important; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
}

.mobile-bottom-nav { display: none; }
@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    z-index: 95;
    align-items: center;
    justify-content: space-around;
    padding: 0 12px;
  }
  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
  }
  .mobile-nav-link.active { color: var(--accent-light); }
  .mobile-fab-cta {
    position: relative;
    top: -16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(39, 108, 179, 0.5);
    border: 3px solid var(--bg-sidebar);
    cursor: pointer;
  }
}
