/* ==========================================================================
   ZeroChat Header & Navigation - Barra Superior estilo ChatGPT & Gemini
   ========================================================================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height, 3.5rem);
  min-height: calc(var(--header-height, 3.5rem) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 1rem 0 1rem;
  border-bottom: none;
  background-color: var(--bg-app);
  position: relative;
  z-index: var(--z-header, 100);
  flex-shrink: 0;
  user-select: none;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1;
}

.header-left {
  flex: 0 0 auto;
  justify-content: flex-start;
  min-width: 0;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: min(320px, calc(100% - 100px));
  z-index: 2;
}

.header-right {
  flex: 0 0 auto;
  justify-content: flex-end;
  min-width: 0;
  margin-left: auto;
}

/* Botón de alternancia de barra lateral (Sidebar Toggle) */
.btn-header-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-header-icon .ui-icon {
  width: 22px;
  height: 22px;
}

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

.btn-header-icon:active {
  transform: scale(0.96);
}

.btn-header-icon.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-header-icon.btn-debug-toggle.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}


