:root {
  --forest-900: #0b3b32;
  --forest-800: #10493d;
  --forest-700: #176253;
  --mint: #4fdcbd;
  --mint-soft: #e6f9f4;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #182520;
  --muted: #6d7b75;
  --subtle: #94a09b;
  --line: #e0e8e4;
  --line-strong: #d1dcd7;
  --violet: #7567d8;
  --violet-soft: #efedff;
  --sky: #3c8dc8;
  --sky-soft: #eaf5fc;
  --warning: #b17716;
  --warning-soft: #fff6df;
  --shadow: 0 8px 30px rgba(23, 48, 39, .06);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--canvas); }
body { min-height: 100vh; margin: 0; background: var(--canvas); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { display: block; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 244px; display: flex; flex-direction: column; padding: 24px 18px 20px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 6px 25px; }
.brand-row img { width: 40px; height: 40px; border-radius: 12px; }
.brand-row strong, .brand-row span { display: block; }
.brand-row strong { color: var(--forest-900); font-size: .84rem; font-weight: 750; letter-spacing: .17em; }
.brand-row span { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.sidebar-close { display: none; margin-left: auto; }

.primary-nav { display: grid; gap: 5px; }
.nav-label { margin: 5px 12px 7px; color: var(--subtle); font-size: .64rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.nav-item { min-height: 43px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 11px; padding: 0 11px; border-radius: 10px; color: #53635d; font-size: .79rem; font-weight: 520; text-decoration: none; transition: color .16s ease, background .16s ease; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:first-of-type svg { fill: currentColor; stroke: none; }
.nav-item:hover { color: var(--forest-900); background: #f1f6f4; }
.nav-item.is-active { color: var(--forest-900); background: var(--mint-soft); font-weight: 650; }
.nav-item b { min-width: 22px; padding: 3px 6px; border-radius: 999px; background: rgba(11, 59, 50, .07); color: var(--forest-700); font-size: .64rem; text-align: center; }

.sidebar-status { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.status-light { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #2abe78; box-shadow: 0 0 0 4px rgba(42, 190, 120, .11); }
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: .71rem; font-weight: 650; }
.sidebar-status small { margin-top: 4px; color: var(--muted); font-size: .61rem; }
.sidebar-version { margin: 12px 4px 0; color: var(--subtle); font-size: .61rem; text-align: center; }
.sidebar-backdrop { display: none; }

.workspace { min-height: 100vh; display: flex; flex-direction: column; margin-left: 244px; }
.topbar { position: sticky; z-index: 30; top: 0; min-height: 72px; display: flex; align-items: center; gap: 18px; padding: 0 clamp(24px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .91); backdrop-filter: blur(18px); }
.menu-button { display: none; }
.global-search { width: min(410px, 45vw); min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.global-search:focus-within { border-color: #90cdbf; background: var(--surface); box-shadow: 0 0 0 3px rgba(79, 220, 189, .13); }
.global-search svg { width: 17px; height: 17px; fill: none; stroke: var(--subtle); stroke-width: 1.8; stroke-linecap: round; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .78rem; }
.global-search input::placeholder { color: #99a59f; }
.global-search kbd { min-width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--subtle); font-size: .65rem; box-shadow: 0 1px 1px rgba(18, 37, 31, .04); }
.topbar-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.icon-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #5c6b65; cursor: pointer; transition: color .16s ease, background .16s ease; }
.icon-button:hover { color: var(--forest-900); background: #eff4f2; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-button > span { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 2px solid var(--surface); border-radius: 50%; background: #eb685e; }
.profile-button { min-height: 40px; display: flex; align-items: center; gap: 7px; margin-left: 6px; padding: 3px 8px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.profile-button > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--forest-900); color: #fff; font-size: .69rem; font-weight: 700; }
.profile-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.content { width: min(1180px, calc(100% - 64px)); flex: 1; margin: 0 auto; padding: 38px 0 72px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--subtle); font-size: .69rem; }
.breadcrumbs i { font-style: normal; }
.breadcrumbs strong { color: #52615b; font-weight: 560; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.page-heading h1 { margin: 0; color: var(--text); font-size: clamp(2rem, 4vw, 2.65rem); line-height: 1.05; letter-spacing: -.045em; }
.page-heading p { margin: 10px 0 0; color: var(--muted); font-size: .86rem; }
.page-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .69rem; white-space: nowrap; }
.page-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.page-badge b { color: var(--text); }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 32px; }
.summary-card { min-height: 126px; display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 3px 15px rgba(19, 45, 36, .025); }
.summary-icon { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; }
.summary-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.summary-icon.mint { background: var(--mint-soft); color: var(--forest-700); }
.summary-icon.violet { background: var(--violet-soft); color: var(--violet); }
.summary-icon.sky { background: var(--sky-soft); color: var(--sky); }
.summary-card span, .summary-card strong, .summary-card small { display: block; }
.summary-card div > span { color: var(--muted); font-size: .71rem; font-weight: 550; }
.summary-card strong { margin-top: 5px; font-size: 1.5rem; letter-spacing: -.04em; }
.summary-card small { margin-top: 3px; color: var(--subtle); font-size: .63rem; }

.systems-section { margin-top: 46px; scroll-margin-top: 96px; }
.systems-toolbar { min-height: 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.systems-toolbar h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.025em; }
.systems-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: .68rem; }
.filter-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #edf2f0; }
.filter-tab { min-height: 31px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 550; cursor: pointer; }
.filter-tab:hover { color: var(--forest-900); }
.filter-tab.is-active { background: var(--surface); color: var(--forest-900); box-shadow: 0 1px 4px rgba(24, 52, 43, .1); font-weight: 650; }
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.system-card { --accent: var(--mint); min-height: 262px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 3px 15px rgba(19, 45, 36, .025); animation: card-in .3s both; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.system-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.system-card.is-roadmap { background: rgba(255, 255, 255, .72); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.module-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, white); color: var(--accent); font-size: .67rem; font-weight: 750; letter-spacing: .03em; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .61rem; font-weight: 650; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.status-pill.live { background: var(--mint-soft); color: var(--forest-700); }
.status-pill.live::before { background: #27b77b; }
.status-pill.pilot { background: var(--warning-soft); color: var(--warning); }
.status-pill.pilot::before { background: #e1a738; }
.status-pill.development { background: var(--violet-soft); color: var(--violet); }
.status-pill.development::before { background: var(--violet); }
.card-category { margin: 18px 0 5px; color: var(--subtle); font-size: .61rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.system-card h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.025em; }
.module-name { margin: 5px 0 0; color: #42534c; font-size: .75rem; font-weight: 560; }
.module-description { max-width: 470px; margin: 11px 0 20px; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.module-path { min-width: 0; overflow: hidden; color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.open-link { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 0 11px; border-radius: 8px; background: var(--forest-900); color: #fff; font-size: .65rem; font-weight: 650; text-decoration: none; transition: background .16s ease, transform .16s ease; }
.open-link:hover { background: var(--forest-800); }
.open-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.unavailable { color: var(--subtle); font-size: .65rem; font-weight: 550; }
.empty-state { padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: 15px; background: rgba(255, 255, 255, .55); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin: 0 auto 13px; fill: none; stroke: var(--subtle); stroke-width: 1.6; stroke-linecap: round; }
.empty-state h3 { margin: 0; font-size: .92rem; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: .72rem; }

.footer { width: min(1180px, calc(100% - 64px)); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; border-top: 1px solid var(--line); color: var(--subtle); font-size: .64rem; }
.footer p { margin: 0; }
.noscript { position: fixed; z-index: 100; right: 18px; bottom: 18px; left: 18px; margin: 0; padding: 14px; border-radius: 10px; background: #fff4d9; color: #684b12; text-align: center; }

@keyframes card-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 1040px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-card { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (max-width: 820px) {
  body.menu-open { overflow: hidden; }
  .sidebar { width: min(290px, calc(100vw - 48px)); transform: translateX(-105%); box-shadow: 22px 0 60px rgba(19, 45, 36, .18); transition: transform .22s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(10, 31, 25, .36); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.menu-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .workspace { margin-left: 0; }
  .menu-button { display: grid; }
  .content, .footer { width: min(100% - 36px, 1180px); }
  .topbar { padding-inline: 18px; }
  .global-search { width: min(430px, 100%); }
  .system-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { min-height: 66px; gap: 8px; }
  .global-search { min-height: 38px; }
  .global-search kbd, .topbar-actions > .icon-button:first-child { display: none; }
  .profile-button { margin-left: 0; padding-right: 3px; }
  .profile-button svg { display: none; }
  .content { padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .summary-card { min-height: 100px; align-items: center; flex-direction: row; }
  .systems-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-tabs { width: 100%; }
  .filter-tab { flex: 1; padding-inline: 8px; }
  .system-card { min-height: 270px; }
  .footer { min-height: 90px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
}
