:root {
  --brand: #39ff14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #ffffff;
  color: #171717;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

/* Header shell */

.header {
  width: 100%;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
}

.header__inner {
  width: 100%;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .header__inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .header__inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Row 1 */

.header__row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 4rem;
}

.header__left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .header__left {
    gap: 0.75rem;
  }
}

.header__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header__mark {
  height: 1.625rem;
  width: auto;
  display: block;
}

.header__divider {
  display: none;
  flex-shrink: 0;
  width: 1px;
  height: 1.5rem;
  background: #e5e5e5;
}

@media (min-width: 640px) {
  .header__divider {
    display: block;
  }
}

/* Dropdown shell (shared) */

.header__dropdown {
  position: relative;
  min-width: 0;
  flex-shrink: 0;
}

.header__panel {
  position: absolute;
  top: 100%;
  z-index: 30;
  margin-top: 0.5rem;
  max-width: calc(100vw - 2rem);
  border-radius: 0.75rem;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  padding: 0.375rem;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  transform-origin: top left;
}

.header__panel--right {
  right: 0;
  left: auto;
  transform-origin: top right;
}

@media (prefers-reduced-motion: no-preference) {
  .header__panel {
    animation: header08-dropdown 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes header08-dropdown {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.header__menu-divider {
  margin: 0.375rem 0;
  border-top: 1px solid #e5e5e5;
}

.header__chevron {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: #737373;
  transition: transform 200ms ease;
}

.header__dropdown[data-open="true"] .header__chevron {
  transform: rotate(180deg);
}

/* Chip / avatar */

.header__chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}

.header__chip--sm {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.625rem;
}

.bg-emerald {
  background: #10b981;
}

.bg-blue {
  background: #3b82f6;
}

.bg-neutral {
  background: #404040;
}

/* Workspace switcher */

.header__workspace-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 10rem;
  border: none;
  background: none;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
  transition: background-color 150ms ease;
}

@media (min-width: 640px) {
  .header__workspace-trigger {
    max-width: none;
  }
}

.header__workspace-trigger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__workspace-trigger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.header__workspace-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__panel--workspace {
  width: 18rem;
  left: 0;
}

.header__workspace-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  text-align: left;
  transition: background-color 150ms ease;
}

.header__workspace-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__workspace-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.header__workspace-item-body {
  flex: 1;
  min-width: 0;
}

.header__workspace-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
}

.header__workspace-item-plan {
  display: block;
  font-size: 0.75rem;
  color: #737373;
}

.header__check {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #178a00;
  display: none;
}

.header__workspace-item[aria-current="true"] .header__check {
  display: block;
}

.header__workspace-create {
  display: block;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
  transition: background-color 150ms ease;
}

.header__workspace-create:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__workspace-create:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Search */

.header__search {
  display: none;
  position: relative;
  flex: 1;
  max-width: 24rem;
}

@media (min-width: 640px) {
  .header__search {
    display: block;
  }
}

.header__search-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #a3a3a3;
  pointer-events: none;
}

.header__search-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.header__search-input {
  width: 100%;
  height: 2.25rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  padding: 0 0.75rem 0 2.25rem;
  font-size: 0.875rem;
  color: #000000;
}

.header__search-input::placeholder {
  color: #a3a3a3;
}

.header__search-input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: #a3a3a3;
}

/* Mobile search overlay */

.header__mobile-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 4rem;
}

@media (min-width: 640px) {
  .header__mobile-search {
    display: none !important;
  }
}

.header__mobile-search .header__search-icon {
  position: absolute;
  left: 0.75rem;
}

.header__mobile-search .header__search-input {
  flex: 1;
  padding-left: 2.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  .header__mobile-search {
    animation: header08-dropdown 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: top;
  }
}

/* Actions */

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .header__actions {
    gap: 0.5rem;
  }
}

.header__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: none;
  color: #404040;
  transition: background-color 150ms ease;
}

.header__icon-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.header__icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__icon-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.header__mobile-search-btn {
  display: inline-flex;
}

@media (min-width: 640px) {
  .header__mobile-search-btn {
    display: none;
  }
}

.header__bell {
  position: relative;
}

.header__bell svg {
  width: 1.25rem;
  height: 1.25rem;
}

.header__badge {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  display: flex;
  min-width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand);
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: #000000;
  box-shadow: 0 0 0 2px #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
  .header__badge {
    animation: header08-badge-pulse 500ms ease-out 1;
  }
}

@keyframes header08-badge-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Notifications panel */

.header__panel--notifications {
  width: 20rem;
}

.header__panel-title {
  margin: 0;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #737373;
}

.header__notification {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border-radius: 0.5rem;
  padding: 0.625rem;
  transition: background-color 150ms ease;
}

.header__notification:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__notification:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.header__notification-dot {
  margin-top: 0.375rem;
  width: 0.375rem;
  height: 0.375rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: transparent;
}

.header__notification-dot--unread {
  background: var(--brand);
}

.header__notification-body {
  min-width: 0;
  flex: 1;
}

.header__notification-title {
  display: block;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #000000;
}

.header__notification-time {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: #737373;
}

/* Profile */

.header__avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: #000000;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  transition: transform 150ms ease;
}

.header__avatar-btn:hover {
  transform: scale(1.05);
}

.header__avatar-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.header__panel--profile {
  width: 14rem;
}

.header__profile-info {
  padding: 0.5rem 0.625rem;
}

.header__profile-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
}

.header__profile-email {
  margin: 0.125rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: #737373;
}

.header__profile-item {
  display: block;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #000000;
  transition: background-color 150ms ease;
}

.header__profile-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header__profile-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.header__profile-item--danger {
  color: #dc2626;
}

.header__profile-item--danger:hover {
  background: #fef2f2;
}

/* Row 2 — tabs */

.header__tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: -1px;
  padding: 0.375rem 0;
  border-top: 1px solid #e5e5e5;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.header__tabs::-webkit-scrollbar {
  display: none;
}

.header__tab {
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: 0.375rem;
  border-bottom: 2px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #737373;
  transition: color 150ms ease;
}

.header__tab:hover {
  color: #000000;
}

.header__tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.header__tab--active {
  border-bottom-color: var(--brand);
  font-weight: 600;
  color: #000000;
}
