.global-header {
  height: 56px;
  background: var(--color-header, #111827);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  box-sizing: border-box;
}

.global-header * {
  box-sizing: border-box;
}

.global-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.global-header .brand {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.global-header .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.global-header .nav-links::-webkit-scrollbar {
  display: none;
}

.global-header .nav-link {
  color: var(--color-text-muted, var(--color-text-muted, #9ca3af));
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.global-header .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.global-header .nav-link.active {
  color: #60a5fa;
  background: rgba(37,99,235,0.2);
  font-weight: 700;
}

.global-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex-shrink: 0;
}

.global-header .user-pill {
  font-size: 12px;
  background: #1f2937;
  color: #93c5fd;
  border: 1px solid #374151;
  padding: 4px 10px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.global-header .menu-toggle {
  background: #1f2937;
  color: #fff;
  border: 1px solid #374151;
  border-radius: 9px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  transition: background 0.15s;
}

.global-header .menu-toggle:hover {
  background: #374151;
}

.global-header .menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  background: #ffffff;
  color: #111827;
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.28);
  min-width: 260px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 10000;
  border: 1px solid #e5e7eb;
}

.global-header .menu-dropdown.open {
  display: block;
}

.global-header .menu-dropdown .user-header {
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.global-header .menu-dropdown .user-header b {
  display: block;
  font-size: 14px;
  color: #111827;
}

.global-header .menu-dropdown .user-header span {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.global-header .menu-dropdown a, 
.global-header .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: #fff;
  border: 0;
  text-decoration: none;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}

.global-header .menu-dropdown a:hover, 
.global-header .menu-dropdown button:hover {
  background: #f3f4f6;
}

.global-header .menu-dropdown a.active {
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
}

.global-header .menu-dropdown .logout-btn {
  color: var(--color-danger, var(--color-danger, #dc2626));
  font-weight: 700;
  border-bottom: 0;
}

@media (max-width: 1400px) {
  .global-header .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .global-header .user-pill {
    display: none;
  }
}

/* Global Login Overlay & Modal */
.global-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.global-login-overlay.active {
  display: flex !important;
}
.global-login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  box-sizing: border-box;
}
.global-login-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}
.global-login-card p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}
.global-login-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}
.global-login-card input {
  width: 100%;
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  margin-bottom: 14px;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
  font-family: inherit;
}
.global-login-card input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.global-login-card button[type="submit"] {
  width: 100%;
  height: 44px;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}
.global-login-card button[type="submit"]:hover {
  background: var(--color-primary-dark, #1d4ed8);
}
.global-login-card .global-login-error {
  color: var(--color-danger, #dc2626);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
  background: #fee2e2;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #fca5a5;
}
