:root {
  --bg-top: #f6efe3;
  --bg-bottom: #dbe6d2;
  --ink: #1b2a20;
  --muted: #57645c;
  --panel: rgba(255, 251, 244, 0.84);
  --panel-strong: rgba(255, 247, 237, 0.96);
  --line: rgba(27, 42, 32, 0.1);
  --accent: #e7732f;
  --accent-deep: #bf5422;
  --mint: #2f7c66;
  --shadow: 0 22px 60px rgba(48, 63, 53, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(231, 115, 47, 0.24), transparent 28%),
    radial-gradient(circle at right 18%, rgba(47, 124, 102, 0.18), transparent 26%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(27, 42, 32, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 42, 32, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 30px 32px;
  background: linear-gradient(135deg, rgba(255, 248, 237, 0.88), rgba(252, 243, 227, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.08;
}

.hero-copy {
  max-width: 62ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.app-picker {
  display: grid;
  gap: 8px;
  min-width: 240px;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-picker span {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select,
button {
  border: 1px solid rgba(27, 42, 32, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

select {
  min-height: 48px;
  padding: 0 14px;
}

.refresh-button {
  min-height: 48px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), #ef9259);
  color: #fff7f1;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

.metrics-panel {
  grid-column: span 5;
}

.timeline-panel {
  grid-column: span 7;
}

.app-list-panel,
.requests-panel,
.recommendations-panel {
  grid-column: span 4;
}

.detail-panel {
  grid-column: span 12;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.95), rgba(248, 241, 230, 0.86));
  border: 1px solid var(--line);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.7rem;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 180px;
}

.timeline-bar {
  display: grid;
  gap: 8px;
  align-items: end;
}

.timeline-bar-fill {
  min-height: 10px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--mint), #91c5b8);
}

.timeline-bar-label {
  color: var(--muted);
  font-size: 0.72rem;
  transform: rotate(-28deg);
  transform-origin: left top;
  white-space: nowrap;
}

.timeline-bar-count {
  font-size: 0.72rem;
  color: var(--ink);
  font-weight: 700;
}

.path-list,
.stack-list {
  display: grid;
  gap: 10px;
}

.path-item,
.stack-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.path-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.stack-card h3 {
  font-size: 1rem;
}

.meta-line {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(231, 115, 47, 0.1);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.mint {
  background: rgba(47, 124, 102, 0.12);
  color: var(--mint);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.detail-column {
  display: grid;
  gap: 16px;
}

.detail-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.detail-card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(27, 42, 32, 0.12);
}

.mini-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.empty-state {
  padding: 36px;
  border-radius: 18px;
  border: 1px dashed rgba(27, 42, 32, 0.18);
  color: var(--muted);
  text-align: center;
}

.status-code {
  min-width: 46px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
}

.status-code.ok {
  background: rgba(47, 124, 102, 0.14);
  color: var(--mint);
}

.status-code.warn {
  background: rgba(231, 115, 47, 0.14);
  color: var(--accent-deep);
}

@media (max-width: 1120px) {
  .metrics-panel,
  .timeline-panel,
  .app-list-panel,
  .requests-panel,
  .recommendations-panel,
  .detail-panel {
    grid-column: span 12;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 18px;
  }

  .hero {
    padding: 24px 20px;
    border-radius: 22px;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
