:root {
  --bg: #fffdf5;
  --fg: #1e293b;
  --muted: #64748b;
  --panel: #ffffff;
  --border: #1e293b;
  --sidebar: #223f63;
  --sidebar-deep: #12233d;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --amber: #fbbf24;
  --mint: #20c997;
  --brand-aqua: #19d3c5;
  --blue: #2f80ed;
  --soft: #e2e8f0;
  --sidebar-width: 248px;
  --shadow: 5px 5px 0 var(--border);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--fg);
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 18px 18px, rgba(30, 41, 59, 0.11) 2px, transparent 2px),
    var(--bg);
  background-size: 36px 36px;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  padding: 22px 18px;
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(47, 128, 237, 0.18), transparent 42%),
    var(--sidebar);
  border-right: 2px solid var(--border);
  box-shadow: 8px 0 0 var(--sidebar-deep);
}

.sidebar-title {
  margin: 0 0 18px;
  color: #f8fafc;
  font-size: 0.86rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-nav {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.nav-item {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px 12px 18px;
  text-align: left;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  width: 8px;
  inset: -2px auto -2px -2px;
  border-radius: 8px 0 0 8px;
  background: var(--violet);
  border-right: 2px solid var(--border);
}

.nav-item:hover,
.nav-item.is-active {
  transform: translate(-1px, -1px);
  color: var(--fg);
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 4px 4px 0 var(--sidebar-deep);
}

.nav-item span {
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item strong {
  color: #bfdbfe;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.nav-item.is-active strong,
.nav-item:hover strong {
  color: var(--muted);
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px;
}

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

.eyebrow,
.detail-kicker,
.snapshot-meta span,
.preview-status {
  margin: 0 0 7px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Outfit, Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(1.75rem, 2.75vw, 2.7rem);
  line-height: 1.06;
  white-space: nowrap;
}

.brand-highlight {
  color: var(--brand-aqua);
}

.intro {
  margin: 8px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 0.98rem;
}

.snapshot-meta {
  min-width: 220px;
  padding: 13px 15px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.snapshot-meta strong {
  display: block;
  font-size: 0.95rem;
}

.workspace-shell {
  min-width: 0;
}

.dashboard-detail {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  background:
    linear-gradient(90deg, rgba(47, 128, 237, 0.08), transparent 32%),
    #ffffff;
  border-bottom: 2px solid var(--border);
}

.detail-header h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.detail-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex: 0 0 auto;
}

.detail-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  color: white;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
  background: var(--violet);
  border: 2px solid var(--border);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--border);
}

.preview-shell {
  position: relative;
  min-height: calc(100vh - 178px);
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    linear-gradient(rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    #ffffff;
  background-size: 34px 34px;
}

.preview-shell::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 0;
  width: min(360px, 42%);
  height: 10px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--mint) 50%);
  pointer-events: none;
}

.preview-status {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  margin: 0;
  padding: 8px 10px;
  color: var(--fg);
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--border);
}

.snapshot-panel,
.preview-frame {
  width: 100%;
  min-height: calc(100vh - 178px);
}

.snapshot-panel {
  display: grid;
  place-items: center;
  padding: 58px 18px 28px;
}

.snapshot-panel img {
  display: block;
  width: min(100%, 1280px);
  max-height: calc(100vh - 270px);
  object-fit: contain;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.preview-frame {
  display: block;
  border: 0;
  background: #ffffff;
}

.snapshot-fallback {
  display: grid;
  width: 100%;
  min-height: 420px;
  place-items: center;
  color: var(--fg);
  font-weight: 950;
  background:
    radial-gradient(circle at 24px 24px, rgba(139, 92, 246, 0.22) 4px, transparent 5px),
    repeating-linear-gradient(135deg, #f1f5f9 0 10px, #ffffff 10px 20px);
  background-size: 48px 48px, auto;
  border: 2px solid var(--border);
  border-radius: 8px;
}

.nav-item.accent-violet::before { background: var(--violet); }
.nav-item.accent-pink::before { background: var(--pink); }
.nav-item.accent-amber::before { background: var(--amber); }
.nav-item.accent-mint::before { background: var(--mint); }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .app-sidebar {
    right: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    min-height: 154px;
    padding: 14px 12px 12px;
    border-right: 0;
    border-bottom: 2px solid var(--border);
    box-shadow: 0 5px 0 var(--sidebar-deep);
  }

  .dashboard-nav {
    display: flex;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .nav-item {
    min-width: 178px;
    min-height: 64px;
    scroll-snap-align: start;
  }

  .nav-item:hover,
  .nav-item.is-active {
    transform: none;
    box-shadow: 3px 3px 0 var(--sidebar-deep);
  }

  .app-main {
    margin-left: 0;
    padding: 178px 10px 18px;
  }

  .topbar {
    display: block;
  }

  h1 {
    white-space: normal;
  }

  .snapshot-meta {
    margin-top: 14px;
    box-shadow: 3px 3px 0 var(--border);
  }

  .detail-header {
    display: block;
    padding: 16px;
  }

  .detail-actions {
    margin-top: 14px;
  }

  .detail-actions a {
    width: 100%;
    justify-content: center;
  }

  .preview-shell,
  .snapshot-panel,
  .preview-frame {
    min-height: 560px;
  }

  .snapshot-panel {
    padding: 58px 10px 24px;
  }

  .snapshot-panel img {
    max-height: none;
  }

  .preview-shell::after {
    width: 46%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
