/* === App Header (v2) === */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-card);
  border-bottom: var(--border-subtle);
}

.app-header-accent {
  height: 3px;
  background: var(--gradient-signature);
}

.app-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  height: 56px;
  gap: var(--space-4);
}

.app-logo {
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.app-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.app-logo:hover {
  opacity: 0.8;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-6);
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-input);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.app-nav-link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-input);
}

.app-nav-link.active {
  color: var(--color-secondary-teal);
  background: rgba(0, 160, 155, 0.08);
}

.app-profile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  flex-shrink: 0;
}

.app-profile-name {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.app-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-secondary-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family);
}

.app-profile:hover .app-profile-name {
  color: var(--color-text-primary);
}

/* === Landing (v2) === */
.landing-welcome {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
}

.landing-welcome h1 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
  margin-bottom: var(--space-2);
}

.landing-welcome p {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* === Tool section heading (v2) === */
.tool-heading {
  text-align: center;
  padding: var(--space-6) 0 var(--space-3);
}

.tool-heading h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
  margin-bottom: var(--space-1);
}

.tool-heading p {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
}

/* Mobile: app header */
@media (max-width: 600px) {
  .app-header-inner {
    gap: var(--space-2);
    padding: 0 var(--space-2);
  }
  .app-nav {
    margin-left: var(--space-2);
    gap: 0;
  }
  .app-nav-link {
    font-size: var(--font-size-label);
    padding: var(--space-1) var(--space-1);
  }
  .app-profile-name {
    display: none;
  }
  .app-saved-link .app-saved-label {
    display: none;
  }
}



/* === Global Navigation === */
.global-nav {
  background: var(--color-bg-card);
  border-bottom: var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.global-nav-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  height: 48px;
}

.nav-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-bg-input);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-left: auto;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  padding: 0;
  font-family: var(--font-family);
}

.nav-profile:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-input);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: default;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-link.active {
  color: var(--color-text-heading);
  background: var(--color-bg-input);
}

.nav-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-badge {
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  background: var(--color-bg-input);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}


/* === Header divider + secondary link === */
.app-header-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

.app-secondary-link {
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-input);
  transition: color 0.15s, background 0.15s;
}

.app-secondary-link:hover {
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.06);
}


/* === Dropdown menus (Rådgivning + Profil) === */
.app-dropdown {
  position: relative;
}

/* Sparat-länk + profil: högerställda */
.app-saved-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary-teal);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1) 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
  background: rgba(0, 160, 155, 0.07);
  border: 1px solid rgba(0, 160, 155, 0.15);
}

.app-saved-link:hover {
  color: var(--color-secondary-teal);
  background: rgba(0, 160, 155, 0.12);
  border-color: rgba(0, 160, 155, 0.25);
}

#profileDropdown {
  /* margin-left: auto moved to .app-saved-link */
}

.app-dropdown-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform 0.2s;
  vertical-align: middle;
  margin-left: 2px;
}

.app-dropdown.open .app-dropdown-chevron {
  transform: rotate(180deg);
}

.app-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}

.app-dropdown-menu--right {
  left: auto;
  right: 0;
}

.app-dropdown.open .app-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.app-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.app-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: background 0.1s;
  cursor: pointer;
}

.app-dropdown-item:hover {
  background: var(--color-bg-input);
}

.app-dropdown-item--simple {
  align-items: center;
}

.app-dropdown-item--danger .app-dropdown-label {
  color: #c0392b;
}

.app-dropdown-item--danger:hover {
  background: rgba(192, 57, 43, 0.06);
}

.app-dropdown-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  line-height: 1.4;
}

.app-dropdown-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-dropdown-label {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.app-dropdown-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.app-dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 10px 12px;
  opacity: 0.7;
}

.app-dropdown-header {
  padding: 12px 16px 8px;
}

.app-dropdown-user-name {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
}

.app-dropdown-user-email {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 1px;
}

/* Update the secondary link to look like a button trigger */
.app-dropdown .app-secondary-link {
  background: none;
  border: none;
  font-family: var(--font-family);
  cursor: pointer;
}

/* Update profile to be a button */
.app-dropdown .app-profile {
  border: none;
  background: none;
  font-family: var(--font-family);
}
/* Active state for Verktyg trigger when a tool is active */
.app-secondary-link--active {
  color: var(--color-secondary-teal) !important;
}

/* Active state for tool items in Verktyg dropdown */
.app-dropdown-item--active {
  background: rgba(0, 160, 155, 0.06);
}

.app-dropdown-item--active .app-dropdown-label {
  color: var(--color-secondary-teal);
}

.app-dropdown-item--active .app-dropdown-icon {
  opacity: 1;
}

