/*
layouts.css — Sidebar, Topbar y estructura del dashboard*/

/* --- Contenedor principal del layout autenticado --- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background-color: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #334155;
}

.sidebar__logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.sidebar__logo-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

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

.sidebar__section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 1rem 1.25rem 0.5rem;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.sidebar__nav-item:hover,
.sidebar__nav-item--active {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar__nav-item--active {
  border-left: 3px solid #2563eb;
}

.sidebar__nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #334155;
}

/* TOPBAR*/
.topbar {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 240px;
  right: 0;
  z-index: 90;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.topbar__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.topbar__user-role {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* MAIN CONTENT AREA*/
.main-content {
  margin-left: 240px;
  padding-top: 64px;
  flex: 1;
  min-height: 100vh;
  background-color: #f8fafc;
}

.page-body {
  padding: 2rem;
}

/* PAGE HEADER (título + acciones)*/
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.page-header__subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* LOGIN LAYOUT (Split-panel)*/
.login-wrapper {
  min-height: 100vh;
  display: flex;
  background-color: #f1f5f9;
}

/* Columna izquierda (Brand Panel) */
.login-brand-panel {
  flex: 1.1;
  background: linear-gradient(135deg, #1e355e 0%, #11203d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #ffffff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Efectos de fondo*/
.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-brand-panel__icon {
  margin-bottom: 2rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
  border-radius: 50%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.login-brand-panel__icon:hover {
  transform: rotate(-15deg) scale(1.05);
}

.login-brand-panel__icon svg {
  width: 64px;
  height: 64px;
}

.login-brand-panel__title {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.login-brand-panel__subtitle {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 340px;
  line-height: 1.6;
  font-weight: 400;
}

/* Columna derecha (Form Panel) */
.login-form-panel {
  flex: 0.9;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-form-card {
  width: 100%;
  max-width: 400px;
}

.login-form-card__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1e355e;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-form-card__subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 2rem;
}

/* Estilos de Formulario de Login Específicos */
.login-form__group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.login-form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-form__input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: #1e293b;
  background-color: #ffffff;
  transition: all 0.2s ease;
}

.login-form__input:focus {
  outline: none;
  border-color: #1e355e;
  box-shadow: 0 0 0 3px rgba(30, 53, 94, 0.15);
}

.login-form__input::placeholder {
  color: #94a3b8;
}

.login-form__button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background-color: #2b347c;
  /* Botón azul-índigo del prototipo */
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(43, 52, 124, 0.2), 0 2px 4px -1px rgba(43, 52, 124, 0.1);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.login-form__button:hover:not(:disabled) {
  background-color: #20275d;
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(43, 52, 124, 0.3), 0 3px 6px -1px rgba(43, 52, 124, 0.15);
}

.login-form__button:active:not(:disabled) {
  transform: translateY(0);
}

.login-form__button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-alert {
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* Responsividad */
@media (max-width: 860px) {
  .login-wrapper {
    flex-direction: column;
  }

  .login-brand-panel {
    flex: none;
    padding: 3rem 1.5rem;
  }

  .login-brand-panel__icon {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .login-brand-panel__icon svg {
    width: 48px;
    height: 48px;
  }

  .login-brand-panel__title {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
  }

  .login-brand-panel__subtitle {
    font-size: 1rem;
  }

  .login-form-panel {
    flex: 1;
    padding: 2.5rem 1.5rem;
    align-items: flex-start;
  }

  .login-form-card {
    margin-top: 1rem;
  }
}