/* ==========================================================================
   OBLIVET — header, navigation, shared layout, cards, and panels
   ========================================================================== */

/* --------------------------------------------------------------------------
   3. Header & primary navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  background: rgba(5, 5, 5, 0.7);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(5, 5, 5, 0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--white);
  transition: transform 0.7s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(80deg);
}

.primary-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 450;
  letter-spacing: -0.01em;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.is-active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   4. Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease),
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--white);
  color: #050505;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 8px 26px rgba(255, 255, 255, 0.07);
}

.btn--primary:hover {
  background: #e2e2e2;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 10px 32px rgba(255, 255, 255, 0.1);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
}

.btn--ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
}

.btn--small {
  min-height: 32px;
  padding: 7px 13px;
  font-size: 11.5px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.text-link {
  position: relative;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 450;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.text-link:hover {
  color: var(--white);
}

.text-link:hover::after {
  opacity: 0.5;
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   5. Layout, page headers
   -------------------------------------------------------------------------- */
main {
  position: relative;
  z-index: 1;
}

.page-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(38px, 6vw, 68px) var(--page-pad) 56px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
  animation: page-in 0.55s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.page-head-copy {
  max-width: 680px;
}

.page-title {
  margin-top: 12px;
  color: var(--white);
  font-size: clamp(34px, 4.6vw, 50px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
  outline: none;
}

.page-sub {
  max-width: 540px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -0.005em;
  line-height: 1.55;
}

.page-head-aside {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding-bottom: 4px;
}

.page-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.month-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   6. Summary stat cards
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.045), transparent 55%),
    linear-gradient(180deg, #0a0a0a 0%, #070707 100%);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 40px;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.7), transparent);
  opacity: 0.5;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.stat-card:active {
  transform: translateY(0);
}

.stat-card:focus-visible {
  outline-offset: 4px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.stat-index {
  color: var(--muted-dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.stat-value {
  color: var(--white);
  font-size: clamp(25px, 2.6vw, 33px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted-dim);
  font-size: 11px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.stat-foot-main {
  color: var(--text-soft);
  font-weight: 500;
}

.stat-foot-sub {
  letter-spacing: 0.002em;
}

/* --------------------------------------------------------------------------
   7. Panels & shared chart furniture
   -------------------------------------------------------------------------- */
.panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.007)),
    var(--panel);
  transition: border-color 0.3s var(--ease);
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-title {
  margin-top: 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.panel-footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.panel-footline strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 2px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot--white {
  background: var(--white);
}

.legend-dot--gray {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
}

.progress {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #171717;
}

.progress > span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, #8f8f8f, #ffffff);
  transition: width 0.7s var(--ease);
}

.progress--lg {
  height: 5px;
}

.progress--xl {
  height: 6px;
}

.progress.is-over > span {
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0 4px,
    rgba(255, 255, 255, 0.22) 4px 8px
  );
}

/* Masthead chip used in empty states / error hints */
.warning-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
}
