body {
  padding-top: 0;
}

.global-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 24px;
  min-height: 62px;
  overflow-x: auto;
  background: linear-gradient(
    135deg,
    var(--accent-dark) 0%,
    var(--accent) 60%,
    var(--accent-light) 100%
  );
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

.global-header .gh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.global-header .gh-brand-icon {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.global-header .gh-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--surface);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.global-header .gh-brand-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.global-header .gh-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.global-header .gh-page-title {
  flex: 1 1 auto;
  min-width: 0;
}

.global-header .gh-page-title h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--surface);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.global-header .gh-page-title .gh-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.3;
}

.global-header .gh-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: var(--surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.18s,
    border-color 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.global-header .gh-back-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
}

.global-header .gh-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}

.global-header .gh-nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.global-header .gh-nav-link:hover,
.global-header .gh-nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--surface);
}

.global-header .gh-user-menu {
  position: relative;
  flex-shrink: 0;
}

.global-header .gh-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.global-header .gh-user-chip:hover {
  background: rgba(255, 255, 255, 0.22);
}

.global-header .gh-user-avatar {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--surface);
  letter-spacing: 0.02em;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.global-header .gh-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--surface);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-header .gh-user-caret {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 2px;
}

.global-header .gh-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 2000;
}

.global-header .gh-user-dropdown.open {
  display: block;
  animation: gh-dropdown-in 0.15s ease;
}

@keyframes gh-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.global-header .gh-dropdown-user-info {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.global-header .gh-dropdown-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.global-header .gh-dropdown-user-role {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.global-header .gh-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.13s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.global-header .gh-dropdown-item:hover {
  background: var(--surface-alt);
  color: var(--accent-dark);
}

.global-header .gh-dropdown-item i {
  width: 14px;
  text-align: center;
  color: var(--accent);
  font-size: 12px;
}

.global-header .gh-dropdown-item.logout {
  color: var(--danger);
  border-top: 1px solid var(--border);
}

.global-header .gh-dropdown-item.logout i {
  color: var(--danger);
}

.global-header .gh-dropdown-item.logout:hover {
  background: var(--danger);
  opacity: 0.1;
}

.global-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: linear-gradient(
    135deg,
    var(--accent-dark) 0%,
    var(--accent) 100%
  );
  margin-top: auto;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  flex-wrap: wrap;
}

.global-footer .gf-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}

.global-footer .gf-copy strong {
  color: var(--surface);
  font-weight: 600;
}

.global-footer .gf-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.global-footer .gf-link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.14s;
}

.global-footer .gf-link:hover {
  color: var(--surface);
}

.global-footer .gf-link i {
  font-size: 11px;
}

.global-footer .gf-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
}

.global-footer .gf-version {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

/* Keep long navigation usable without displaying a scrollbar. */
.sidebar-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 640px) {
  .global-header {
    padding: 0 14px;
    min-height: 56px;
    gap: 10px;
  }

  .global-header .gh-nav {
    display: none;
  }

  .global-header .gh-brand-sub {
    display: none;
  }

  .global-header .gh-page-title h1 {
    font-size: 13px;
  }

  .global-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }
}
body.gh-page {
  padding-top: 0 !important;
}

.global-header {
  border-radius: 0;
  width: 100%;
  box-sizing: border-box;
}

.gh-user-dropdown.open {
  position: fixed;
}

body.gh-outside-card {
  padding: 0 !important;
}

body:has(.global-header) .container,
body:has(.global-header) .shell,
body.gh-page .container,
body.gh-page .shell,
body.gh-outside-card .container,
body.gh-outside-card .shell {
  margin: calc(62px + 20px) auto 20px !important;
  max-width: 1500px;
}

body.gh-page .global-footer,
body.gh-outside-card .global-footer {
  margin-top: 0;
}

/* SIDEBAR PAGES: Match global-header style */
.dashboard-header {
  background: linear-gradient(
    135deg,
    var(--accent-dark) 0%,
    var(--accent) 60%,
    var(--accent-light) 100%
  ) !important;
  padding: 0 24px !important;
  height: 62px !important;
  border-bottom: none !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
  gap: 16px !important;
  align-items: center !important;
}

.dashboard-header h1,
.dashboard-header .header-title h1 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--surface) !important;
  letter-spacing: 0.02em !important;
}

.dashboard-header .subtitle,
.dashboard-header .header-title .subtitle {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  margin-top: 0 !important;
}

.dashboard-header .header-title {
  flex: 1 !important;
  min-width: 0 !important;
}

.top-bar {
  background: linear-gradient(
    135deg,
    var(--accent-dark) 0%,
    var(--accent) 60%,
    var(--accent-light) 100%
  ) !important;
  padding: 0 24px !important;
  height: 62px !important;
  border-bottom: none !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.top-bar h1,
.top-bar-title h1 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--surface) !important;
  letter-spacing: 0.02em !important;
  margin: 0 !important;
}

.top-bar .subtitle,
.top-bar-title .subtitle {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  margin-top: 0 !important;
}

.top-bar-title {
  flex: 1 !important;
  min-width: 0 !important;
}

.dashboard-header .sidebar-toggle,
.top-bar .sidebar-toggle {
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 8px !important;
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0 !important;
}

.dashboard-header .sidebar-toggle .toggle-bar,
.top-bar .sidebar-toggle .bar {
  background: var(--surface) !important;
  height: 2px !important;
}

.dashboard-header .user-menu,
.top-bar .user-menu {
  flex-shrink: 0 !important;
}

.dashboard-header .user-badge,
.top-bar .user-chip {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 22px !important;
  padding: 5px 14px !important;
  color: var(--surface) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.dashboard-header .user-dropdown,
.top-bar .user-dropdown {
  border-radius: 10px !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid var(--border) !important;
  overflow: hidden !important;
  min-width: 180px !important;
}

.dashboard-header .dropdown-item,
.top-bar .dd-item {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
}

.dashboard-header .dropdown-item:hover,
.top-bar .dd-item:hover {
  background: var(--surface-alt) !important;
  color: var(--accent-dark) !important;
}

.dashboard-header .dropdown-item i,
.top-bar .dd-item i {
  color: var(--accent) !important;
  width: 14px !important;
  text-align: center !important;
}

.main-content .global-footer,
.sidebar-footer-global {
  margin-top: auto;
  border-radius: 0 0 17px 0;
}
