/* ──────────────────────────────────────────────────────────
   IT Support Portal — Layout: Header, Footer, Search
   ────────────────────────────────────────────────────────── */

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  height: 60px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex; align-items: center; gap: 2px;
  height: 100%;
}
.header__logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text);
  padding: 6px 10px; border-radius: var(--r); margin-right: 8px; flex-shrink: 0;
  transition: background var(--t);
}
.header__logo:hover { background: var(--surface-2); }
.header__logo-icon { color: var(--blue); display: flex; }

.header__nav { display: flex; align-items: center; gap: 1px; flex: 1; }
.header__nav-link {
  padding: 6px 11px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.header__nav-link:hover           { background: var(--surface-2); color: var(--text); }
.header__nav-link--active         { color: var(--blue); background: var(--blue-50); }

.header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.header__search-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); color: var(--text-2);
  transition: background var(--t), color var(--t);
}
.header__search-toggle:hover { background: var(--surface-2); color: var(--text); }

.mobile-nav-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-2);
  background: var(--surface);
}

.mobile-nav-toggle span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.mobile-nav-toggle em {
  margin-left: 4px;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.mobile-nav-toggle--active {
  color: var(--blue);
  background: var(--blue-50);
}

.mobile-nav-panel {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  display: grid;
  gap: 4px;
  padding: 10px 16px 14px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.mobile-nav-panel[hidden] {
  display: none;
}

.mobile-nav-panel__link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.mobile-nav-panel__link--active {
  color: var(--blue);
  background: var(--blue-50);
}

/* ── Auth user chip ── */
.auth-user {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 5px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
}
.auth-user__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; letter-spacing: .02em;
}
.auth-user__name   { font-size: 13px; font-weight: 500; color: var(--text); }
.auth-user__logout {
  padding: 2px 8px; border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-3);
  transition: background var(--t), color var(--t); cursor: pointer;
}
.auth-user__logout:hover { background: var(--red-50); color: var(--red); }

/* ── Search overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 24px 0;
  animation: fadeIn .15s ease;
}
.search-overlay[hidden] { display: none; }

.search-overlay__inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px;
  overflow: hidden;
}
.search-overlay__box {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-overlay__icon  { color: var(--text-3); flex-shrink: 0; }
.search-overlay__input {
  flex: 1; font-size: 16px; color: var(--text);
  border: none; outline: none; background: transparent;
}
.search-overlay__input::placeholder { color: var(--text-3); }
.search-overlay__close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); flex-shrink: 0;
  transition: background var(--t); cursor: pointer;
}
.search-overlay__close:hover { background: var(--surface-2); color: var(--text); }
.search-overlay__results { max-height: 400px; overflow-y: auto; }

.search-result-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }
.search-result-item__type  {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--blue);
}
.search-result-item__title   { font-size: 14px; font-weight: 500; color: var(--text); }
.search-result-item__snippet { font-size: 13px; color: var(--text-3); }

.empty-state            { text-align: center; padding: 32px; color: var(--text-3); font-size: 14px; }
.empty-state__title     { font-size: 15px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.empty-state__text      { font-size: 14px; }

/* ── Page structure ── */
.main   { min-height: calc(100vh - 60px - 53px); }
.footer {
  height: 53px; display: flex; align-items: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer__inner { display: flex; align-items: center; justify-content: space-between; }
.footer__text  { font-size: 13px; color: var(--text-3); }

/* ── Page header (shared) ── */
.page-header    { margin-bottom: 28px; padding-top: 36px; }
.page-header__title    { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.page-header__subtitle { font-size: 15px; color: var(--text-2); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header__nav { display: none; }
  .container   { padding: 0 16px; }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .auth-user {
    padding-right: 5px;
  }

  .auth-user__name,
  .auth-user__logout,
  .header__user {
    display: none;
  }

  .footer {
    height: auto;
    min-height: 53px;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

@media (max-width: 420px) {
  .mobile-nav-toggle em {
    display: none;
  }
}
