:root {
  --navy-950: #10243f;
  --navy-900: #183459;
  --navy-800: #284c78;
  --navy-700: #3b5f8e;
  --sky-100: #eef4fb;
  --sky-200: #dde8f4;
  --sky-300: #c8d8ea;
  --card: #ffffff;
  --text: #132238;
  --muted: #5f6f84;
  --line: #d8e1ed;
  --warning: #f59e0b;
  --warning-bg: #fff3d6;
  --success: #16a34a;
  --success-bg: #ddf8e8;
  --danger: #ef4444;
  --danger-bg: #ffe2e2;
  --info: #5b5cf0;
  --info-bg: #ececff;
  --shadow: 0 14px 30px rgba(16, 36, 63, 0.08);
  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --radius-sm: 0.8rem;
}

* {
  box-sizing: border-box;
}

/* Enforce HTML `hidden` even when author CSS sets display values. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background-color: #eef2f7;
  background-image:
    radial-gradient(900px 520px at 18% 0%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 60%),
    radial-gradient(900px 520px at 92% 10%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 55%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: auto;
  z-index: 9999;
}

.auth-card {
  width: min(28rem, 100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.auth-title {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.4rem;
}

.auth-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 0.6rem;
}

.auth-label {
  font-weight: 800;
  color: var(--navy-700);
  letter-spacing: 0.03em;
}

.auth-input {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  padding: 0.9rem 0.95rem;
  background: #fff;
  font-weight: 800;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(91, 92, 240, 0.45);
  box-shadow: 0 0 0 4px rgba(91, 92, 240, 0.12);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.auth-error {
  margin: 0.4rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid #f5b8b8;
  background: var(--danger-bg);
  color: #a32020;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #eaf3ff;
  padding: 1.4rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.2rem 0.35rem 1.2rem;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: rgba(255, 208, 48, 0.18);
  border: 1px solid rgba(255, 208, 48, 0.35);
  color: #ffd24c;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

.brand-name,
.brand-tag,
.eyebrow,
.mini-label,
.section-label {
  margin: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-name span {
  color: #ffd24c;
}

.brand-tag {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: rgba(234, 243, 255, 0.7);
}

.sidebar-subhead {
  padding: 0.1rem 0.35rem 1.05rem;
  display: grid;
  gap: 0.45rem;
}

.source-select {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #eaf3ff;
  padding: 0.7rem 0.8rem;
  font-weight: 800;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.nav-link {
  border: 0;
  border-radius: 0.95rem;
  background: transparent;
  color: rgba(234, 243, 255, 0.82);
  text-align: left;
  padding: 0.75rem 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.nav-label {
  flex: 1 1 auto;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-link.is-active {
  background: rgba(255, 208, 48, 0.12);
  color: #fff4c7;
  box-shadow: inset 3px 0 0 #ffd24c;
}

.nav-link.is-active .nav-icon {
  background: rgba(255, 208, 48, 0.14);
  border-color: rgba(255, 208, 48, 0.28);
}

.sidebar-foot {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  background: rgba(15, 173, 104, 0.15);
  color: #a7f3d0;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: #22c55e;
}

.main-panel {
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.pill-canonical {
  background: #ffd24c;
  color: #533500;
}

.pill-environment {
  background: #eef4fb;
  color: #244972;
  border-color: var(--sky-300);
}

.button {
  border-radius: 0.9rem;
  border: 0;
  padding: 0.85rem 1.05rem;
  font-weight: 800;
}

.button-primary {
  background: #ffd24c;
  color: #362400;
}

.button-secondary {
  background: #eff4fb;
  color: #244972;
  border: 1px solid var(--line);
}

.button-ghost {
  background: transparent;
  color: #27527f;
  border: 1px solid var(--line);
}

.button-success {
  background: #10965d;
  color: #fff;
}

.button-danger {
  background: transparent;
  color: #c72b2b;
  border: 1px solid #f1baba;
}

.global-banner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.global-banner.is-stale {
  background: #fff7f7;
}

.global-banner__body {
  display: grid;
  gap: 0.75rem;
}

.global-banner__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.global-banner__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.global-banner__copy {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.global-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.screen {
  display: none;
  gap: 1rem;
}

.screen.is-active {
  display: grid;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.card-header,
.split-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.card-title {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
}

.card-copy,
.muted {
  color: var(--muted);
}

.hero-card {
  background: #fff;
  border-left: 6px solid var(--warning);
}

.hero-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.1rem 0 0.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.grid-3,
.grid-4,
.grid-2 {
  display: grid;
  gap: 1rem;
}

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

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

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

.action-card,
.stat-card,
.issue-card,
.item-card,
.channel-card,
.section-card {
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.mini-label,
.section-label {
  color: var(--navy-700);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.78rem;
  font-weight: 800;
}

.action-card h3,
.issue-card h3,
.item-card h3,
.channel-card h3,
.section-card h3 {
  margin: 0.55rem 0 0.45rem;
  font-size: 1.05rem;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-top: 0.55rem;
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.strip-item {
  font-size: 0.96rem;
  color: var(--muted);
  font-weight: 700;
}

.strip-item strong {
  color: var(--text);
}

.issue-list,
.simple-list,
.timeline,
.meta-list {
  display: grid;
  gap: 0.85rem;
}

.issue-row,
.inbox-row,
.queue-row,
.timeline-row,
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.issue-row:first-child,
.inbox-row:first-child,
.queue-row:first-child,
.timeline-row:first-child,
.meta-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.status-chip.ok {
  background: var(--success-bg);
  color: #0d6b39;
  border-color: #a8efc3;
}

.status-chip.warn,
.status-chip.stale {
  background: var(--warning-bg);
  color: #8a5700;
  border-color: #ffd48d;
}

.status-chip.critical,
.status-chip.unavailable {
  background: var(--danger-bg);
  color: #a32020;
  border-color: #f5b8b8;
}

.status-chip.pending,
.status-chip.awaiting,
.status-chip.info {
  background: var(--info-bg);
  color: #4b46c8;
  border-color: #c8c6ff;
}

.status-chip.open {
  background: #eef4fb;
  color: #365980;
  border-color: var(--sky-300);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

.right-rail {
  display: grid;
  gap: 1rem;
}

.preview-card {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.preview-card pre,
.code-block {
  background: #0f172a;
  color: #ecfeff;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  overflow-x: auto;
  font-size: 0.9rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.empty-state {
  border: 1px dashed var(--sky-300);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  padding: 1.2rem;
}

.tiny {
  font-size: 0.82rem;
}

.two-up {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-bottom: 0.9rem;
  }

  .sidebar-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .sidebar-foot {
    display: none;
  }

  .main-panel {
    padding: 1rem;
  }

  .topbar,
  .split-layout,
  .two-up,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .hero-card h2 {
    font-size: 2rem;
  }
}

