/* Admin Layout Styles
 * ========================================================================== */

/* Layout structure — vertical stack: masthead → subhead → content */
.admin-layout {
  background: var(--color-bg--canvas);
}

.admin-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Masthead — top-level navigation
 * -------------------------------------------------------------------------- */

.masthead {
  background: var(--color-bg--surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding-inline: 1.5rem;
  height: 3.25rem;
}

.masthead__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.masthead__logo-mark {
  width: 24px;
  height: 24px;
  fill: var(--color-primary);
}

.masthead__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.masthead__link {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: oklch(0.5 0.01 60);
  text-decoration: none;
  border-radius: var(--radius-2, 6px);
  transition: background 0.15s, color 0.15s;
}

.masthead__link:hover {
  background: oklch(0.93 0.005 60);
  color: oklch(0.3 0.01 60);
}

.masthead__link[aria-current="true"],
.masthead__link--active {
  background: oklch(0.92 0.01 60);
  color: oklch(0.25 0.01 60);
  font-weight: 600;
}

.masthead__link--icon {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.5rem;
}

.masthead__link--icon svg {
  width: 18px;
  height: 18px;
}

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

.masthead__avatar {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Subhead — section-level navigation
 * -------------------------------------------------------------------------- */

.subhead {
  background: var(--color-bg--surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.subhead__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 80rem;
  margin: 0 auto;
  box-sizing: border-box;
  padding-inline: 1.5rem;
  height: 2.5rem;
}

.subhead__link {
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
  color: oklch(0.5 0.01 60);
  text-decoration: none;
  border-radius: var(--radius-2, 6px);
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.subhead__link:hover {
  background: oklch(0.93 0.005 60);
  color: oklch(0.3 0.01 60);
}

.subhead__link--active {
  color: oklch(0.25 0.01 60);
  font-weight: 600;
}

.subhead__link--active::after {
  content: "";
  position: absolute;
  bottom: -0.55rem;
  left: 0.65rem;
  right: 0.65rem;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* Content area
 * -------------------------------------------------------------------------- */

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1rem 0;
  background: var(--color-bg--canvas);
  display: flex;
  flex-direction: column;
}


@media (min-width: 48em) {
  .admin-content {
    padding: 3rem 2rem 0;
  }
}

/* Panel nav — breadcrumb tab above the panel
 * -------------------------------------------------------------------------- */

.panel-nav {
  width: 100%;
  max-width: 1008px;
  margin: 0 auto;
  background: var(--color-bg--surface);
  border: none;
  border-radius: 6px 6px 0 0;
  box-shadow:
    0 -1px 3px oklch(0.5 0.03 70 / 0.08),
    0 -4px 12px oklch(0.5 0.03 70 / 0.06),
    0 -8px 24px oklch(0.5 0.03 70 / 0.04);
  box-sizing: border-box;
  padding: 0.4rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: oklch(0.4 0.01 60);
  position: relative;
  z-index: 1;
}

.panel-nav__link {
  color: oklch(0.55 0.15 250);
  text-decoration: none;
}

.panel-nav__link:hover {
  text-decoration: underline;
}

.panel-nav__separator {
  margin: 0 0.15rem;
  color: oklch(0.6 0.01 60);
}

.panel-nav__current {
  color: oklch(0.45 0.01 60);
}


/* Mobile — collapse masthead nav
 * -------------------------------------------------------------------------- */

@media (max-width: 48em) {
  .masthead__inner {
    padding-inline: 1rem;
    height: 3rem;
    gap: 1rem;
  }

  .masthead__nav {
    gap: 0;
  }

  .masthead__link {
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
  }

  .subhead__inner {
    padding-inline: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .subhead__link {
    white-space: nowrap;
  }
}

/* Activity Timeline - Centered alternating timeline
 * -------------------------------------------------------------------------- */

.activity-timeline {
  position: relative;
  padding: 2rem 0;
}

.activity-timeline__line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.activity-timeline__day {
  position: relative;
  margin-bottom: 1.5rem;
}

.activity-timeline__day:last-child {
  margin-bottom: 0;
}

/* Date marker badge - centered on line */
.activity-timeline__marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.activity-timeline__date-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--color-tertiary);
  color: white;
  border-radius: 1rem;
  font-size: var(--font-size-x-small);
  font-weight: 600;
  white-space: nowrap;
}

/* Events container */
.activity-timeline__events {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.25rem;
}

/* Left side - events take left half */
.activity-timeline__day--left .activity-timeline__events {
  width: calc(50% - 3rem);
  margin-right: auto;
  padding-right: 1rem;
}

/* Right side - events take right half */
.activity-timeline__day--right .activity-timeline__events {
  width: calc(50% - 3rem);
  margin-left: auto;
  padding-left: 1rem;
}

/* Individual event row */
.activity-timeline__event {
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--color-border--light);
}

.activity-timeline__event:last-child {
  border-bottom: none;
}

.activity-timeline__event-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Left side - align content to the right */
.activity-timeline__day--left .activity-timeline__event-row {
  flex-direction: row-reverse;
  text-align: right;
}

.activity-timeline__time {
  font-size: var(--font-size-x-small);
  color: var(--color-ink--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.activity-timeline__link {
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
}

.activity-timeline__link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.activity-timeline__link--discarded {
  color: var(--color-ink--muted);
  text-decoration: line-through;
}

.activity-timeline__type {
  font-size: var(--font-size-x-small);
  color: var(--color-ink--muted);
}

.activity-timeline__user {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-x-small);
  color: var(--color-ink--muted);
  margin-left: auto;
}

.activity-timeline__user .avatar {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.65rem;
}

.activity-timeline__day--left .activity-timeline__user {
  margin-left: 0;
  margin-right: auto;
}

/* Small chip variant */
.chip--small {
  font-size: var(--font-size-x-small);
  padding: 0.125rem 0.5rem;
}

/* Responsive - stack timeline on mobile */
@media (max-width: 48em) {
  .activity-timeline__line {
    left: 1rem;
  }

  .activity-timeline__marker {
    left: 1rem;
    transform: translateX(-50%);
  }

  .activity-timeline__day--left .activity-timeline__events,
  .activity-timeline__day--right .activity-timeline__events {
    width: calc(100% - 3rem);
    margin-left: 2.5rem;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .activity-timeline__day--left .activity-timeline__event-row {
    flex-direction: row;
    text-align: left;
  }

  .activity-timeline__day--left .activity-timeline__user {
    margin-left: auto;
    margin-right: 0;
  }
}

/* Dark mode adjustments
 * -------------------------------------------------------------------------- */

[data-color-scheme="dark"] {
  .masthead {
    background: var(--color-bg--overlay);
  }

  .masthead__logo-mark {
    fill: white;
  }

  .masthead__link {
    color: oklch(0.65 0.01 60);
  }

  .masthead__link:hover {
    background: oklch(0.25 0.005 60);
    color: oklch(0.85 0.01 60);
  }

  .masthead__link[aria-current="true"],
  .masthead__link--active {
    background: oklch(0.25 0.01 60);
    color: oklch(0.9 0.01 60);
  }

  .subhead {
    background: var(--color-bg--overlay);
  }

  .subhead__link {
    color: oklch(0.65 0.01 60);
  }

  .subhead__link:hover {
    background: oklch(0.25 0.005 60);
    color: oklch(0.85 0.01 60);
  }

  .subhead__link--active {
    color: oklch(0.9 0.01 60);
  }

  .admin-content {
    background: var(--color-bg--canvas);
  }

  .panel-nav {
    background: var(--color-bg--surface);
    border-color: oklch(0.4 0.01 60 / 0.35);
    border-bottom-color: oklch(0.3 0.005 60 / 0.5);
    color: oklch(0.7 0.01 60);
  }

  .panel-nav__link {
    color: oklch(0.7 0.15 250);
  }

  .panel-nav__separator {
    color: oklch(0.5 0.01 60);
  }

  .panel-nav__current {
    color: oklch(0.75 0.01 60);
  }

}
