:root {
  color-scheme: light;
  --paper: #faf7f0;
  --paper-strong: #fffdf8;
  --ink: #18302e;
  --muted: #657572;
  --line: #d9ded7;
  --teal: #0f6b65;
  --teal-dark: #084c48;
  --teal-soft: #dcece8;
  --amber: #b96d18;
  --red: #b1483e;
  --shadow: 0 16px 40px rgba(24, 48, 46, 0.08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 6% 0%, rgba(15, 107, 101, 0.09), transparent 28rem),
    var(--paper);
  color: var(--ink);
  line-height: 1.62;
}

a { color: var(--teal-dark); }
a:hover { color: var(--teal); }
button, input { font: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: .6rem .8rem;
  background: var(--ink);
  color: white;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(24, 48, 46, 0.13);
  background: rgba(250, 247, 240, 0.93);
  backdrop-filter: blur(15px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 2rem));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 10px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: .78rem;
  letter-spacing: .04em;
}

.nav-links { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.nav-links a {
  padding: .46rem .68rem;
  border-radius: 8px;
  color: #435957;
  text-decoration: none;
  font-size: .9rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-dark); }

.shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 5rem; }
.shell.narrow { width: min(760px, calc(100% - 2rem)); }

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: .13em;
}

h1, h2, h3 { line-height: 1.16; letter-spacing: -.035em; }
h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 5rem); max-width: 900px; }
h2 { margin: 0 0 1rem; font-size: clamp(1.55rem, 3vw, 2.35rem); }
h3 { margin: 0 0 .5rem; font-size: 1.14rem; }

.hero { padding: 4.6rem 0 3.1rem; }
.hero-copy { max-width: 780px; margin: 1.25rem 0 0; color: #4c605e; font-size: 1.08rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .66rem 1rem;
  border: 1px solid var(--teal-dark);
  border-radius: 10px;
  background: var(--teal-dark);
  color: white;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--teal); color: white; }
.button.secondary { background: transparent; color: var(--teal-dark); }
.button.secondary:hover { background: var(--teal-soft); }
.button.small { min-height: 34px; padding: .42rem .72rem; font-size: .88rem; }

.notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin: 0 0 2rem;
  padding: .9rem 1rem;
  border: 1px solid #c4d8d4;
  border-radius: 12px;
  background: #edf5f2;
  color: #355652;
}
.notice strong { color: var(--teal-dark); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { padding: 1.25rem; background: var(--paper-strong); }
.metric-value { display: block; color: var(--teal-dark); font-size: 1.85rem; font-weight: 780; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-label { display: block; margin-top: .45rem; color: var(--muted); font-size: .84rem; }

.section { margin-top: 4rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-heading p { max-width: 620px; margin: 0; color: var(--muted); }

.system-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.system-card {
  min-height: 252px;
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .82);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}
.system-card:hover { border-color: #9bb8b2; box-shadow: var(--shadow); transform: translateY(-2px); transition: .18s ease; }
.system-card .meta, .data-meta { color: var(--muted); font-size: .84rem; }
.system-card p { color: #4d605e; }
.system-card footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.stack-tag, .status-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: .22rem .52rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: .74rem;
  font-weight: 700;
}
.status-tag.amber { background: #f5e7d2; color: #7c490f; }
.status-tag.red { background: #f2dfdc; color: #78322b; }

.data-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 1.3rem; align-items: start; }
.sidebar, .panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .88);
}
.sidebar { position: sticky; top: 88px; padding: .75rem; }
.sidebar a { display: block; padding: .62rem .7rem; border-radius: 8px; text-decoration: none; color: #405653; font-size: .9rem; }
.sidebar a:hover, .sidebar a.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 680; }
.panel { overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel-header h1, .panel-header h2 { margin: 0; font-size: 1.45rem; }
.panel-body { padding: 1.2rem; }

.data-list { display: grid; gap: .75rem; }
.data-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; text-decoration: none; color: var(--ink); }
.data-card:hover { border-color: #92b2ac; color: var(--ink); }
.data-card p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.data-card strong { font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .78rem .7rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: #f3f7f4; }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1rem; }
.detail-item { padding: .9rem; border: 1px solid var(--line); border-radius: 10px; background: #f8f8f2; }
.detail-item span { display: block; color: var(--muted); font-size: .75rem; }
.detail-item strong { display: block; margin-top: .2rem; }

.empty, .loading, .error { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.error { color: var(--red); }
.pagination { display: flex; gap: .6rem; align-items: center; justify-content: center; margin-top: 1.2rem; }

.login-layout { display: grid; grid-template-columns: 1.1fr .9fr; min-height: calc(100vh - 68px); }
.login-story { padding: clamp(2rem, 8vw, 7rem); background: var(--teal-dark); color: #f7fbf8; }
.login-story h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); }
.login-story p { max-width: 620px; color: #cfe0dc; }
.login-panel { display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(430px, 100%); padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: var(--shadow); }
.field { display: grid; gap: .35rem; margin: 1rem 0; }
.field label { color: #435957; font-size: .86rem; font-weight: 650; }
.field input { width: 100%; padding: .72rem .8rem; border: 1px solid #b7c3bf; border-radius: 9px; background: white; color: var(--ink); }
.field input:focus { outline: 3px solid rgba(15, 107, 101, .18); border-color: var(--teal); }
.login-card .button { width: 100%; }
.form-status { min-height: 1.5rem; margin: .8rem 0 0; color: var(--teal-dark); font-size: .86rem; }

.business-spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.business-spec article { padding: 1.15rem; border-left: 3px solid var(--teal); background: rgba(255,253,248,.7); }
.business-spec p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }

.site-footer { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .system-grid, .login-layout { grid-template-columns: 1fr; }
  .data-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: flex; overflow-x: auto; }
  .sidebar a { white-space: nowrap; }
  .business-spec { grid-template-columns: 1fr; }
  .login-story { min-height: 40vh; }
}

@media (max-width: 620px) {
  .topbar-inner { align-items: flex-start; padding: .7rem 0; }
  .nav-links { justify-content: flex-end; }
  .nav-links a:not(.keep-mobile) { display: none; }
  .shell { padding-top: 1.5rem; }
  .hero { padding-top: 2.6rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .system-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .data-card { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
