:root {
  --sidebar-width: 92px;
  --sidebar-bg-light: #f6f8fa;
  --sidebar-bg-dark: #23272f;
  --sidebar-border-light: #e5e7eb;
  --sidebar-border-dark: #23272f;
  --sidebar-icon-light: #24292f;
  --sidebar-icon-dark: #fff;
  --sidebar-icon-active: #0969da;
  --sidebar-footer-bg-light: #fff;
  --sidebar-footer-bg-dark: #23272f;
  --sidebar-logo-size: 46px;
  --sidebar-z: 200;
  --transition: 0.18s cubic-bezier(.55,.06,.68,.19);
  --font: 'Montserrat', Arial, sans-serif;
}

body {
  font-family: var(--font);
  color: #23272f;
  background: #f8fafc;
  margin: 0;
  padding: 0;
  transition: background .2s, color .2s;
}

body.theme-dark {
  background: #181a24;
  color: #e5e7eb;
}

/* Encabezado */
.main-header {
  margin-left: var(--sidebar-width);
  z-index: 101;
  transition: background .25s;
}
body.theme-dark .main-header {
  background: linear-gradient(90deg, #143f6b 0%, #4e54c8 50%, #0093e9 100%) !important;
  border-bottom: none;
}
body.theme-dark .main-header .fs-4 {
  color: #fff !important;
}
body.theme-dark .main-header label,
body.theme-dark .main-header .form-check-input {
  color: #fff !important;
}

.main-header .fs-4 {
  margin-left: 2rem;
}

/* Menú lateral */
.sidebar-github {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg-light);
  border-right: 1px solid var(--sidebar-border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: var(--sidebar-z);
  min-width: var(--sidebar-width);
  transition: background var(--transition), border-color var(--transition);
  box-shadow: none;
}
body.theme-dark .sidebar-github {
  background: var(--sidebar-bg-dark);
  border-right: 1px solid var(--sidebar-border-dark);
}

.sidebar-github__logo {
  width: var(--sidebar-logo-size);
  height: var(--sidebar-logo-size);
  margin-top: 22px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-github__logo img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%; /* LOGO REDONDO */
  box-shadow: 0 1px 4px #0969da22;
}

.sidebar-github__nav {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
}
.sidebar-github__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-github__li {
  position: relative;
}

.sidebar-github__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 92px;
  height: 46px;
  margin: 8px auto;
  color: var(--sidebar-icon-light);
  font-size: 1.3rem;
  background: none;
  border-radius: 0;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
  text-decoration: none;
  padding-left: 22px;
  box-sizing: border-box;
}
.sidebar-github__item:hover,
.sidebar-github__item:focus {
  color: var(--sidebar-icon-active);
  background: #dde8ff;
  box-shadow: 0 2px 8px #0969da22;
}
.sidebar-github__item.active,
.sidebar-github__item:active {
  color: var(--sidebar-icon-active);
  background: #dde8ff;
  box-shadow: 0 2px 8px #0969da33;
}
body.theme-dark .sidebar-github__item {
  color: var(--sidebar-icon-dark);
}
body.theme-dark .sidebar-github__item:hover,
body.theme-dark .sidebar-github__item:focus {
  color: var(--sidebar-icon-active);
  background: #23272f;
  box-shadow: 0 2px 8px #0969da44;
}
body.theme-dark .sidebar-github__item.active,
body.theme-dark .sidebar-github__item:active {
  color: var(--sidebar-icon-active);
  background: #23272f;
  box-shadow: 0 2px 8px #0969da99;
}

.sidebar-github__item i {
  display: block;
  margin: 0 auto;
  min-width: 26px;
  text-align: center;
}

/* Solo muestra el título al pasar el mouse, en desktop. Título negro (o blanco en modo oscuro), sin fondo ni animación. */
.sidebar-github__hover-title {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  white-space: nowrap;
  color: #23272f;
  font-size: 1.05rem;
  padding: 0 8px;
  border-radius: 0;
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
  background: none;
  font-weight: 700;
  letter-spacing: 1px;
  transition: opacity .18s, transform .18s;
  z-index: 15;
}
.sidebar-github__item:hover .sidebar-github__hover-title,
.sidebar-github__item:focus .sidebar-github__hover-title {
  opacity: 1;
  transform: translateY(-50%) translateX(10px);
  pointer-events: auto;
}
body.theme-dark .sidebar-github__hover-title {
  color: #fff;
}

/* Pie de menú (eliminado logout y ajustes) */
.sidebar-github__bottom {
  display: none;
}

/* En mobile/tablet nunca se muestra el título flotante */
@media (max-width: 992px) {
  .sidebar-github__hover-title {
    display: none !important;
  }
  .sidebar-github__item {
    justify-content: center;
    padding-left: 0;
  }
}
/* MOBILE SIDEBAR: logo perfectamente alineado con los iconos */
@media (max-width: 768px) {
  .sidebar-github {
    position: fixed;
    top: 0;
    left: 0;
    height: 56px;
    width: 100vw;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border-light);
    background: var(--sidebar-bg-light);
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
    z-index: 201;
  }
  body.theme-dark .sidebar-github {
    background: var(--sidebar-bg-dark);
    border-bottom: 1px solid var(--sidebar-border-dark);
  }
  .sidebar-github__logo {
    margin: 0 16px 0 0;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar-github__logo img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    display: block;
    vertical-align: middle;
  }
  .sidebar-github__nav {
    flex-direction: row;
    width: auto;
    flex-grow: 0;
    align-items: center;
    height: 46px;
  }
  .sidebar-github__list {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    height: 46px;
  }
  .sidebar-github__item {
    margin: 0 4px;
    width: 46px;
    height: 46px;
    font-size: 1.15rem;
    padding-left: 0;
    justify-content: center;
    align-items: center;
    display: flex;
  }
  .main-header,
  .main-content,
  .footer-gradient {
    margin-left: 0;
  }
}

/* Modo switch SIEMPRE visible y alineado en el header */
.mode-switch-container {
  display: flex;
  align-items: center;
}
.mode-switch {
  margin-bottom: 0;
  margin-right: 0;
  margin-left: 12px;
}
#modeToggle {
  cursor: pointer;
}
#modeLabel {
  cursor: pointer;
  font-size: 1.35rem;
  margin-left: 4px;
  vertical-align: middle;
  color: #0969da;
}
body.theme-dark #modeLabel {
  color: #f6f8fa;
}

.nosotros-titulo {
  color: #23272f; /* Color para el modo claro */
}

body.theme-dark .nosotros-titulo {
  color: #fff; /* Color para el modo oscuro */
}