/**
 * Layout – Header & Footer (05.11.01)
 * Sticky header, footer dark.
 */

/* ---------- HEADER ---------- */
.volet-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.volet-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-header);
}

[data-theme="dark"] .volet-header {
  background: rgba(30, 41, 59, 0.85);
}

[data-theme="dark"] .volet-header.is-scrolled {
  background: rgba(30, 41, 59, 0.92);
}

.volet-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-width: 0;
}

/* App v2: ô tìm kiếm pill (mobile user) — ẩn trên desktop */
.volet-header-search-pill {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-surface));
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: background var(--duration-fast);
}
.volet-header-search-pill:hover {
  background: color-mix(in srgb, var(--color-text) 12%, var(--color-surface));
  color: var(--color-text);
}
.volet-header-search-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 991px) {
  .volet-header-inner--shell-user .volet-header-search-pill,
  .volet-header-inner--shell-business .volet-header-search-pill {
    display: flex;
  }
  .volet-header-inner--shell-user .volet-header-logo,
  .volet-header-inner--shell-business .volet-header-logo {
    display: none;
  }
  .volet-header-inner--shell-user .volet-header-hamburger-wrap,
  .volet-header-inner--shell-business .volet-header-hamburger-wrap {
    order: 0;
  }
  .volet-header-inner--shell-user .volet-header-search-pill,
  .volet-header-inner--shell-business .volet-header-search-pill {
    order: 1;
  }
  .volet-header-inner--shell-user .volet-header-actions-mobile,
  .volet-header-inner--shell-business .volet-header-actions-mobile {
    order: 2;
  }
}
@media (min-width: 992px) {
  .volet-header-search-pill {
    display: none !important;
  }
}

.volet-header-logo {
  flex-shrink: 0;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 6px 10px;
  margin: -6px -10px;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: opacity var(--duration-fast);
}

/* Logo full (icon + name): desktop/tablet – 64px source hiển thị 32px cho nét 2x */
.volet-header-logo-full {
  display: none;
  align-items: center;
  gap: 0;
}
.volet-header-logo-name-img {
  height: 32px;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* Logo compact (square icon + text): mobile */
.volet-header-logo-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.volet-header-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/* 05.11.24: logo light/dark by theme */
.volet-logo-dark {
  display: none;
}
[data-theme="dark"] .volet-logo-light {
  display: none;
}
[data-theme="dark"] .volet-logo-dark {
  display: block;
}

/* Header: desktop từ 992px trở lên; dưới 992px dùng hamburger + logo compact */
@media (min-width: 992px) {
  .volet-header-logo-full {
    display: inline-flex;
  }
  .volet-header-logo-compact {
    display: none;
  }
}

@media (max-width: 991px) {
  /* Không dùng overflow-x: hidden ở header — sẽ cắt mất nút hamburger bên phải */
  .volet-header-inner {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    max-width: 100%;
  }
  .volet-header-logo-full {
    display: none;
  }
  .volet-header-logo-compact {
    display: inline-flex;
    min-width: 0;
    flex-shrink: 1;
  }
  .volet-header-logo {
    min-width: 0;
    flex-shrink: 1;
  }
  .volet-header-logo-compact .volet-header-logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .volet-header-actions-mobile {
    min-width: 0;
    flex-shrink: 1;
  }
  .volet-header-nav,
  .volet-header-actions {
    display: none !important;
  }
  /* Ép hamburger và icon 3 vạch luôn hiển thị trên mobile */
  .volet-header .volet-header-hamburger,
  .volet-header .volet-header-hamburger .volet-header-hamburger-bar {
    visibility: visible !important;
    opacity: 1 !important;
  }
  /* Ẩn header khi scroll xuống (mobile), spec 05.11.01.02 PHẦN E */
  .volet-header {
    transition: transform 0.2s ease-out;
  }
  .volet-header.volet-header-hidden {
    transform: translateY(-100%);
  }
}

/* Màn rất nhỏ (≤360px): giảm padding header, spec 05.11.01.02 PHẦN E */
@media (max-width: 360px) {
  .volet-header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Hamburger: mặc định hiện (mobile-first), ẩn trên desktop; không cho co nhỏ */
.volet-header .volet-header-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 -6px 0 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  transition: background var(--duration-fast);
}
/* Wrapper hamburger: giữ chỗ 44px, không co; ẩn trên desktop */
.volet-header-hamburger-wrap {
  flex-shrink: 0;
  width: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 992px) {
  .volet-header-hamburger-wrap {
    display: none !important;
  }
  .volet-header .volet-header-hamburger {
    display: none !important;
  }
  .volet-header-actions-mobile {
    display: none !important;
  }
}

/* Trên mobile: hiện Hỗ trợ + Đăng nhập cạnh hamburger (khi chưa đăng nhập) */
.volet-header-actions-mobile {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
@media (max-width: 991px) {
  .volet-header-actions-mobile:not(:empty) {
    display: flex;
  }
}
.volet-header-actions-mobile .volet-btn {
  white-space: nowrap;
}

/* Icon-only actions on mobile header (Sàn, Ví, QR, Khoá) */
.volet-header-mobile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.volet-header-mobile-icon:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}
.volet-header-mobile-icon svg {
  flex-shrink: 0;
}
.volet-header-mobile-key {
  position: relative;
}
.volet-header-mobile-key-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--color-primary);
  border-radius: 8px;
}

/* Badge thông báo chưa đọc (mobile header), spec 05.11.01.02 PHẦN E */
.volet-header-notification-wrap {
  position: relative;
  display: inline-flex;
}
.volet-header-notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--color-error, #dc2626);
  border-radius: 8px;
  display: none;
}
.volet-header-notification-badge.is-visible {
  display: block;
}

.volet-header-hamburger:hover {
  background: var(--color-primary-50);
}
.volet-header-hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--duration-normal) var(--ease-out);
}
.volet-header-hamburger[aria-expanded="true"] .volet-header-hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.volet-header-hamburger[aria-expanded="true"] .volet-header-hamburger-bar:nth-child(2) {
  opacity: 0;
}
.volet-header-hamburger[aria-expanded="true"] .volet-header-hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer overlay + panel (mobile): hiệu ứng trượt mềm */
.volet-header-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), pointer-events 0s linear 0.3s;
}
.volet-header-drawer-overlay.is-visible {
  pointer-events: auto;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.volet-header-drawer-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: calc(100% - 48px);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 201;
  overflow-y: auto;
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), pointer-events 0s linear 0.3s;
}
.volet-header-drawer-panel.is-visible {
  pointer-events: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.volet-header-drawer-inner {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
/* Đỉnh drawer: logo + nút đóng */
.volet-header-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.volet-header-drawer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: opacity var(--duration-fast);
}
.volet-header-drawer-logo:hover {
  opacity: 0.9;
}
.volet-header-drawer-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.volet-header-drawer-logo .volet-logo-dark {
  display: none;
}
[data-theme="dark"] .volet-header-drawer-logo .volet-logo-light {
  display: none;
}
[data-theme="dark"] .volet-header-drawer-logo .volet-logo-dark {
  display: block;
}
.volet-header-drawer-logo-text {
  letter-spacing: 0.02em;
}
.volet-header-drawer-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.volet-header-drawer-close:hover {
  background: var(--color-surface-2);
}
.volet-header-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.volet-header-drawer-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.volet-header-drawer-nav a:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}
.volet-header-drawer-nav a.volet-drawer-item-highlight {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.volet-header-drawer-nav a.volet-drawer-item-highlight:hover {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.volet-drawer-section-label {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-2);
}
.volet-drawer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-2);
}
.volet-header-drawer-nav a:hover .volet-drawer-icon {
  color: var(--color-text);
}
.volet-drawer-icon svg {
  width: 20px;
  height: 20px;
}
.volet-header-drawer-lang {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-sm);
}
.volet-header-drawer-lang .volet-drawer-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}
.volet-header-drawer-lang .volet-lang-switcher {
  margin: 0;
}
.volet-header-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}
.volet-header-drawer-actions .volet-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: flex-start;
  width: 100%;
}

@media (max-width: 991px) {
  /* Trên mobile: drawer/overlay mặc định display:none (ẩn khi load). Chỉ hiện khi có .is-open (bấm menu). */
  .volet-header-drawer-overlay.is-open,
  .volet-header-drawer-panel.is-open {
    display: block;
  }
  .volet-header-drawer-overlay.is-open {
    opacity: 0;
    pointer-events: none;
  }
  .volet-header-drawer-overlay.is-open.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .volet-header-drawer-panel.is-open {
    transform: translateX(-100%);
    pointer-events: none;
  }
  .volet-header-drawer-panel.is-open.is-visible {
    transform: translateX(0);
    pointer-events: auto;
  }
}

body.volet-header-drawer-open {
  overflow: hidden;
}

.volet-header-logo-text {
  line-height: 1;
  display: inline-flex;
  gap: 0;
}

.volet-logo-char {
  color: var(--color-text);
}

.volet-logo-char-v { color: var(--logo-v); }
.volet-logo-char-o { color: var(--logo-o); }
.volet-logo-char-l { color: var(--logo-l); }
.volet-logo-char-e { color: var(--logo-e); }
.volet-logo-char-t { color: var(--logo-t); }

.volet-header-logo:hover {
  opacity: 0.92;
}

.volet-header-logo:active {
  opacity: 0.85;
}

.volet-header-nav {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.volet-header-nav::-webkit-scrollbar {
  display: none;
}

.volet-header-nav a {
  flex-shrink: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast), color var(--duration-fast);
}

.volet-header-nav a:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}

.volet-header-nav-sep {
  flex-shrink: 0;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Nav item phê duyệt DN (admin): icon + badge, nổi bật khi có chờ duyệt */
.volet-header-nav-approval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.volet-header-nav-approval .volet-icon-approval {
  display: block;
  flex-shrink: 0;
  color: var(--color-text-2);
}
.volet-header-nav-approval-pending .volet-icon-approval {
  color: var(--color-warning);
}
.volet-header-approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--color-warning);
  border-radius: 9px;
}

/* ---------- NAV DROPDOWN (Doanh nghiệp) ---------- */
.volet-header-nav-dropdown {
  position: relative;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.volet-header-nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 12px;
  height: 100%;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  overflow: visible;
  transition: background var(--duration-fast), color var(--duration-fast);
}

/* Icon trong trigger: block + flex-shrink 0 để không bị line-height cắt mất nửa icon */
.volet-header-nav-dropdown-trigger svg,
.volet-header-nav-dropdown-trigger .volet-nav-icon {
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}

.volet-header-nav-dropdown-trigger:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}

.volet-header-nav-dropdown .volet-dropdown-chevron {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-text-2);
  transition: transform var(--duration-fast) var(--ease-out);
}

/* Nút Doanh nghiệp / Menu DN: chỉ icon + chevron, không chữ */
.volet-header-nav-trigger-icon-only {
  padding-left: 10px;
  padding-right: 10px;
}

/* Link Cá nhân (trang Business): chỉ icon */
.volet-header-nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.volet-header-nav-dropdown.is-open .volet-dropdown-chevron {
  transform: rotate(180deg);
}

.volet-header-nav-dropdown-panel {
  position: fixed;
  margin-top: var(--space-xs);
  min-width: 180px;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: 110;
  display: none;
}

.volet-header-nav-dropdown.is-open .volet-header-nav-dropdown-panel {
  display: block;
}

/* Dropdown Doanh nghiệp render ngoài header (portal): fixed + z-index cao để không bị nội dung che */
.volet-header-nav-dropdown-panel-portal {
  position: fixed;
  z-index: 9999;
  display: none;
  margin-top: var(--space-xs);
  min-width: 180px;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
}
.volet-header-nav-dropdown-panel-portal.is-open {
  display: block;
}
/* Danh sách doanh nghiệp trong dropdown: scroll riêng khi nhiều DN */
.volet-header-nav-dropdown-section {
  max-height: 240px;
  overflow-y: auto;
}

.volet-header-nav-dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
  text-align: left;
}

.volet-header-nav-dropdown-item:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.volet-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* KEY_SYSTEM 13 §1: icon Khoá + số Khoá (trang User) */
.volet-header-key-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.volet-header-key-indicator:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}
.volet-header-key-indicator .volet-icon-key {
  display: block;
  flex-shrink: 0;
  color: var(--color-text-2);
}
.volet-header-key-count {
  min-width: 1.25em;
  text-align: center;
}

/* Admin: icon phê duyệt xác minh doanh nghiệp (shield-check) + badge số chờ duyệt */
.volet-header-approval-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.volet-header-approval-indicator:hover {
  background: var(--color-primary-50);
  color: var(--color-text);
}
.volet-header-approval-indicator .volet-icon-approval {
  display: block;
  flex-shrink: 0;
  color: var(--color-text-2);
}
.volet-header-approval-count {
  min-width: 1.25em;
  text-align: center;
}

/* Badge phê duyệt trên mobile: dùng màu warning (cam) thay vì đỏ */
.volet-header-approval-wrap .volet-header-notification-badge {
  background: var(--color-warning);
}
.volet-header-approval-wrap .volet-header-notification-badge.is-visible {
  color: #fff;
}

/* ---------- USER MENU (dropdown) ---------- */
.volet-user-menu {
  position: relative;
}

.volet-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.volet-user-menu-icon {
  flex-shrink: 0;
  color: var(--color-text-2);
}

.volet-user-menu .volet-dropdown-chevron {
  flex-shrink: 0;
  color: var(--color-text-2);
  transition: transform var(--duration-fast) var(--ease-out);
}

.volet-user-menu.is-open .volet-dropdown-chevron {
  transform: rotate(180deg);
}

.volet-user-menu-label {
  white-space: nowrap;
}

.volet-user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-xs);
  min-width: 200px;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: 110;
  display: none;
}

.volet-user-menu.is-open .volet-user-menu-dropdown {
  display: block;
}

/* User menu dropdown render ngoài header (portal): fixed + z-index cao để không bị nội dung che */
.volet-user-menu-dropdown-portal {
  position: fixed;
  z-index: 9999;
  display: none;
  margin-top: var(--space-xs);
  min-width: 200px;
  padding: var(--space-xs);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
}
.volet-user-menu-dropdown-portal.is-open {
  display: block;
}

.volet-user-menu-item {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-body-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
}

.volet-user-menu-item:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.volet-user-menu-divider {
  height: 1px;
  margin: var(--space-xs) 0;
  background: var(--color-border);
}

.volet-user-menu-item-logout {
  color: var(--color-error);
}

.volet-user-menu-item-logout:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* ---------- INDUSTRY CARDS (08.08) ---------- */
.volet-industry-card {
  transition: border-color var(--duration-fast), background-color var(--duration-fast),
    box-shadow var(--duration-fast) var(--ease-out);
}
.volet-industry-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .volet-industry-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.volet-industry-card-icon {
  line-height: 1;
  opacity: 0.95;
}

/* Ngành phụ – cards nhỏ (08.08) */
.volet-secondary-card {
  transition: border-color var(--duration-fast), background-color var(--duration-fast),
    box-shadow var(--duration-fast) var(--ease-out);
}
.volet-secondary-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .volet-secondary-card:hover {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}
.volet-secondary-card-icon {
  line-height: 1;
  opacity: 0.95;
}

/* ---------- BOTTOM NAV MOBILE (05.11.01.02 + app v2 FAB 5 slot) ---------- */
.volet-bottom-nav,
.volet-bottom-nav-spacer {
  display: none;
}

@media (max-width: 991px) {
  .volet-bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .volet-bottom-nav-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 56px;
    height: auto;
    padding-bottom: 4px;
    max-width: 100%;
  }
  .volet-bottom-nav-inner--five .volet-bottom-nav-item:not(.volet-bottom-nav-item--fab) {
    flex: 1 1 0;
    min-width: 0;
  }
  .volet-bottom-nav-fab-slot {
    flex: 0 0 76px;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 2px;
  }
  .volet-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    min-width: 0;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-text-2);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color var(--duration-fast), background var(--duration-fast);
  }
  .volet-bottom-nav-item--fab {
    padding-top: 0;
    gap: 2px;
    width: 100%;
    align-items: center;
  }
  .volet-bottom-nav-fab-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-text-2);
    border: 1px solid color-mix(in srgb, var(--color-text-2) 35%, transparent);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  }
  .volet-bottom-nav-item--fab.is-active .volet-bottom-nav-fab-circle,
  .volet-bottom-nav-item--fab.volet-bottom-nav-item--fab-business.is-active .volet-bottom-nav-fab-circle {
    background: var(--color-primary);
    color: var(--color-primary-contrast, #fff);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 35%, transparent);
  }
  .volet-bottom-nav-item:hover {
    color: var(--color-primary);
    background: transparent;
  }
  .volet-bottom-nav-item.is-active {
    color: var(--color-primary);
    font-weight: 600;
  }
  .volet-bottom-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }
  .volet-bottom-nav-icon--round {
    border-radius: 50%;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-text-2) 12%, transparent);
  }
  .volet-bottom-nav-business-logo {
    width: 24px;
    height: 24px;
    object-fit: cover;
    display: block;
  }
  .volet-bottom-nav-item--business-logo.is-active .volet-bottom-nav-icon--round {
    box-shadow: 0 0 0 2px var(--color-primary);
  }
  .volet-bottom-nav-icon-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-primary-contrast, #fff);
  }
  .volet-bottom-nav-item-center .volet-bottom-nav-icon-plus {
    margin-bottom: 0;
  }
  .volet-bottom-nav-item-center {
    flex: 1;
    max-width: 72px;
  }
  .volet-bottom-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
  }
  /* Spacer để footer không bị bottom nav che — cao hơn khi có FAB */
  .volet-bottom-nav-spacer {
    display: block;
    height: calc(68px + env(safe-area-inset-bottom, 0));
    flex-shrink: 0;
  }
}

@media (min-width: 992px) {
  .volet-bottom-nav,
  .volet-bottom-nav-spacer {
    display: none !important;
  }
}


/* ---------- FOOTER ---------- */
/* Footer theo theme: sáng/tối giống header (05.11.01.02). */
.volet-footer {
  margin-top: auto;
  background: var(--color-footer-bg);
  color: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
}

/* Theme sáng: footer nền sáng, chữ tối, logo dark (xanh/cam). */
[data-theme="light"] .volet-footer {
  background: var(--color-surface-2);
  color: var(--color-text);
}
[data-theme="light"] .volet-footer-top {
  border-bottom-color: var(--color-border);
}
[data-theme="light"] .volet-footer-brand .slogan {
  color: var(--color-text);
}
[data-theme="light"] .volet-footer-brand .desc {
  color: var(--color-text-2);
}
[data-theme="light"] .volet-footer-col h4 {
  color: var(--color-text-2);
}
[data-theme="light"] .volet-footer-col a {
  color: var(--color-text);
}
[data-theme="light"] .volet-footer-col a:hover {
  color: var(--color-primary);
}
[data-theme="light"] .volet-footer-bottom {
  color: var(--color-text-2);
}
[data-theme="light"] .volet-footer-bottom a {
  color: var(--color-text-2);
}
[data-theme="light"] .volet-footer-bottom a:hover {
  color: var(--color-primary);
}

.volet-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px var(--container-px) 24px;
}

@media (min-width: 640px) {
  .volet-footer-inner {
    padding-top: 56px;
    padding-bottom: 32px;
  }
}

.volet-footer-top {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .volet-footer-top {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
  }
}

.volet-footer-brand {
  max-width: 280px;
}

/* Footer logo: cùng logic header – theme sáng → logo dark, theme tối → logo light */
.volet-footer-logo {
  display: inline-block;
  text-decoration: none;
  margin-bottom: var(--space-sm);
  line-height: 0;
}
.volet-footer-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}
.volet-footer-brand .volet-footer-logo .volet-logo-light {
  display: none;
}
.volet-footer-brand .volet-footer-logo .volet-logo-dark {
  display: block;
}
[data-theme="dark"] .volet-footer-brand .volet-footer-logo .volet-logo-light {
  display: block;
}
[data-theme="dark"] .volet-footer-brand .volet-footer-logo .volet-logo-dark {
  display: none;
}

.volet-footer-brand .slogan {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: var(--space-xs);
}

.volet-footer-brand .desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
}

.volet-footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  margin: 0 0 var(--space-md);
}

.volet-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.volet-footer-col a {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 2px 0;
  transition: color var(--duration-fast);
}

.volet-footer-col a:hover {
  color: #fff;
}

.volet-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.volet-footer-bottom a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.volet-footer-bottom a:hover {
  color: #fff;
}

/* Bottom sheet: Cá nhân / Hub DN (mobile) — mở bằng data-open-personal-sheet / data-open-business-hub-sheet */
@media (max-width: 991px) {
  .volet-personal-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: 210;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .volet-personal-sheet-overlay.is-open {
    display: block;
  }
  .volet-personal-sheet-overlay.is-open.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .volet-personal-sheet {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 211;
    max-height: min(88vh, 640px);
    background: var(--color-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    border-top: 1px solid var(--color-border);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }
  .volet-personal-sheet.is-open {
    display: flex;
    flex-direction: column;
  }
  .volet-personal-sheet.is-open.is-visible {
    transform: translateY(0);
  }

  .volet-personal-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
    margin: 10px auto 4px;
    flex-shrink: 0;
  }

  .volet-personal-sheet-inner {
    overflow-y: auto;
    padding: 0 0 12px;
    -webkit-overflow-scrolling: touch;
  }

  .volet-personal-sheet-title {
    margin: 8px 20px 12px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
  }

  .volet-personal-sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .volet-personal-sheet-row,
  a.volet-personal-sheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 600;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
  }
  button.volet-personal-sheet-row {
    border-radius: 0;
  }
  .volet-personal-sheet-row:hover,
  a.volet-personal-sheet-row:hover {
    background: var(--color-surface-2);
  }
  .volet-personal-sheet-row--danger,
  a.volet-personal-sheet-row--danger {
    color: var(--color-error);
  }
  .volet-personal-sheet-icon {
    width: 28px;
    text-align: center;
    flex-shrink: 0;
  }
  .volet-personal-sheet-label {
    flex: 1;
    min-width: 0;
  }
  .volet-personal-sheet-chevron {
    color: var(--color-text-2);
    font-size: 1.25rem;
    flex-shrink: 0;
  }
  .volet-personal-sheet-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--color-border);
  }
}

body.volet-account-sheet-open {
  overflow: hidden;
}

@media (min-width: 992px) {
  #volet-personal-sheet-overlay,
  #volet-personal-sheet,
  #volet-business-sheet-overlay,
  #volet-business-sheet {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .volet-settings .volet-settings-sidebar {
    display: none !important;
  }
}
