:root {
  --bg: #071017;
  --bg-deep: #03070b;
  --panel: rgba(9, 18, 28, 0.82);
  --panel-strong: rgba(16, 24, 36, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eff8ff;
  --muted: #96a9bb;
  --brand: #10b981;
  --brand-soft: #4ce4b2;
  --accent: #ffb24c;
  --danger: #ff6b6b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.15), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 178, 76, 0.12), transparent 24%),
    linear-gradient(180deg, #0b121a 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 80%);
}

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

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95em;
}

.portal-shell {
  width: min(calc(100% - 32px), 1240px);
  margin: 0 auto;
  padding: 20px 0 72px;
}

.portal-language-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.portal-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
}

.portal-language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.portal-language-option.is-active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(76, 228, 178, 0.18));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(76, 228, 178, 0.2);
}

.portal-header,
.panel,
.login-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.portal-brand {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.portal-subtitle,
.lead,
.card-copy,
.muted-copy,
.stat-detail,
.event-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-subtitle {
  margin-top: 6px;
  font-size: 0.95rem;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.org-switcher select,
.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.org-switcher select {
  min-width: 240px;
}

.text-link {
  color: var(--brand-soft);
  font-weight: 600;
}

.user-chip,
.meta-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
  color: #04110a;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

.button-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.portal-main {
  padding-top: 28px;
}

.eyebrow,
.card-kicker,
.stat-label {
  margin: 0 0 14px;
  color: var(--brand-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 0.98;
}

h3 {
  font-size: 1.1rem;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
  align-items: center;
  gap: 40px;
  min-height: calc(100vh - 220px);
}

.login-copy {
  max-width: 58ch;
}

.lead {
  margin-top: 22px;
  font-size: 1.08rem;
}

.bullet-list {
  margin: 28px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.login-card {
  padding: 28px;
  border-radius: var(--radius-lg);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.form-error {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 107, 107, 0.28);
  border-radius: 14px;
  background: rgba(255, 107, 107, 0.08);
  color: #ffd0d0;
}

.page-intro,
.dashboard-grid,
.site-grid,
.stat-grid {
  display: grid;
  gap: 20px;
}

.page-intro {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 24px;
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.stat-value {
  display: block;
  margin-bottom: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.5rem;
  letter-spacing: -0.05em;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  margin-bottom: 20px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

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

.trend-list,
.event-list {
  display: grid;
  gap: 14px;
}

.trend-row,
.event-row {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.trend-row:first-child,
.event-row:first-child {
  border-top: none;
  padding-top: 0;
}

.trend-row {
  grid-template-columns: 76px minmax(0, 1fr) 110px;
  align-items: center;
}

.trend-meta {
  display: grid;
  gap: 4px;
}

.trend-meta span {
  font-weight: 700;
}

.trend-meta small,
.trend-values small,
.event-meta small {
  color: var(--muted);
}

.trend-bars {
  display: grid;
  gap: 8px;
}

.trend-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.trend-track-secondary {
  height: 6px;
}

.trend-bar {
  height: 100%;
  border-radius: inherit;
}

.trend-bar-main {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), var(--brand-soft));
}

.trend-bar-accent {
  background: linear-gradient(90deg, rgba(255, 178, 76, 0.18), var(--accent));
}

.trend-values,
.event-meta {
  text-align: right;
}

.event-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.event-row strong {
  display: block;
  margin-bottom: 4px;
}

.site-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.site-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.site-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.site-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
}

.site-metrics dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-metrics dd {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.status-pill.is-live {
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.12);
  color: #9cffcc;
}

.status-pill.is-idle {
  border-color: rgba(255, 178, 76, 0.2);
  background: rgba(255, 178, 76, 0.08);
  color: #ffd3a0;
}

.panel-note {
  margin-top: 20px;
}

.empty-state {
  max-width: 760px;
  padding: 40px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .page-intro,
  .dashboard-grid,
  .login-layout,
  .stat-grid,
  .site-grid {
    grid-template-columns: 1fr;
  }

  .portal-language-bar,
  .portal-header {
    border-radius: 32px;
  }

  .portal-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .intro-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .portal-shell {
    width: min(calc(100% - 20px), 1240px);
  }

  .portal-language-bar,
  .portal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-language-bar {
    margin-bottom: 16px;
  }

  .portal-header {
    border-radius: 24px;
  }

  .portal-language-switch {
    width: 100%;
  }

  .portal-language-option {
    flex: 1 1 0;
  }

  .trend-row,
  .event-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .trend-values,
  .event-meta {
    text-align: left;
  }

  .org-switcher,
  .org-switcher select,
  .button {
    width: 100%;
  }
}
