:root {
  --ca-header-blue: #213a95;
  --ca-header-blue-dark: #1b327f;
  --ca-header-black: #191919;
  --ca-header-muted: #64748b;
  --ca-header-border: #e2e8f0;
}

.ca-app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--ca-header-border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

.ca-app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: 100%;
  max-width: none;
  min-height: 64px;
  margin: 0;
  padding: 8px 16px;
}

.ca-header-left,
.ca-header-right,
.ca-header-nav {
  display: flex;
  align-items: center;
}

.ca-header-left {
  min-width: 0;
  gap: 18px;
}

.ca-header-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 46px;
  padding-right: 18px;
  border-right: 1px solid var(--ca-header-border);
  text-decoration: none;
}

.ca-header-brand img {
  display: block;
  width: 96px;
  max-height: 43px;
  object-fit: contain;
}

.ca-header-nav {
  min-width: 0;
  gap: 4px;
}

.ca-header-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.ca-header-nav-link:hover {
  background: #f4f6fb;
  color: var(--ca-header-blue);
}

.ca-header-right {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 10px;
}

.ca-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.13);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.ca-header-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
}

.ca-header-action--primary {
  border-color: #2563eb;
  background: #2563eb;
}

.ca-header-action--primary:hover {
  background: #1d4ed8;
}

.ca-header-action--secondary {
  border-color: #7c3aed;
  background: #7c3aed;
}

.ca-header-action--secondary:hover {
  background: #6d28d9;
}

.ca-user-menu {
  position: relative;
  margin-left: 2px;
}

.ca-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d6deef;
  border-radius: 14px;
  background: #f8faff;
  color: var(--ca-header-blue);
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.06);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.ca-user-menu-trigger:hover,
.ca-user-menu-trigger[aria-expanded="true"] {
  border-color: rgba(33, 58, 149, 0.35);
  background: #eef2fb;
  box-shadow: 0 5px 14px rgba(33, 58, 149, 0.12);
}

.ca-user-menu-trigger svg {
  width: 21px;
  height: 21px;
}

.ca-user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  overflow: hidden;
  border: 1px solid #dce3f1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}

.ca-user-menu-panel[hidden] {
  display: none;
}

.ca-user-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background:
    linear-gradient(
      135deg,
      #f8faff 0%,
      #eef2fb 100%
    );
}

.ca-user-menu-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--ca-header-blue);
  color: #ffffff;
}

.ca-user-menu-avatar svg {
  width: 19px;
  height: 19px;
}

.ca-user-menu-user {
  min-width: 0;
}

.ca-user-menu-name {
  overflow: hidden;
  margin: 0;
  color: var(--ca-header-black);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-user-menu-subtitle {
  margin: 3px 0 0;
  color: var(--ca-header-muted);
  font-size: 12px;
}

.ca-user-menu-list {
  padding: 8px;
}

.ca-user-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.ca-user-menu-item:hover {
  background: #f4f6fb;
  color: var(--ca-header-blue);
}

.ca-user-menu-item--danger {
  color: #b42318;
}

.ca-user-menu-item--danger:hover {
  background: #fff1f0;
  color: #9f1c14;
}

.ca-user-menu-version {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ca-user-menu-separator {
  height: 1px;
  margin: 6px 8px;
  background: #edf0f5;
}

.ca-user-menu-form {
  margin: 0;
}

@media (max-width: 1050px) {
  .ca-header-brand {
    width: 96px;
  }

  .ca-header-brand img {
    width: 82px;
  }

  .ca-header-nav-link {
    padding: 0 8px;
  }

  .ca-header-action {
    padding: 0 12px;
  }
}

@media (max-width: 850px) {
  .ca-app-header-inner {
    flex-wrap: wrap;
  }

  .ca-header-left {
    width: 100%;
  }

  .ca-header-right {
    width: 100%;
  }
}