:root {
  --ink: #182326;
  --muted: #667579;
  --line: #dce3e1;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --petrol: #376f6a;
  --petrol-dark: #25534f;
  --lime: #d6df35;
  --blue: #376d9a;
  --amber: #9a6b13;
  --danger: #9d3e3e;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--lime);
  color: var(--petrol-dark);
  font-weight: 800;
  transform: rotate(-7deg);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { color: var(--petrol); font-size: 23px; font-weight: 680; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 4px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.environment {
  color: var(--amber);
  background: #fff7df;
  border: 1px solid #ead8a9;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.app-shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar {
  background: #20302f;
  color: #dfe9e7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 14px 18px;
}
.sidebar nav { display: grid; gap: 4px; }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b9c8c5;
  height: 42px;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: white; background: #2b3e3c; }
.nav-item.active { color: white; background: #2b3e3c; border-left-color: var(--lime); }
.sidebar-account { border-top: 1px solid #40514f; padding: 16px 8px 0; display: flex; gap: 10px; align-items: center; }
.sidebar-account > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sidebar-account strong { color: white; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account small { color: #9fb0ad; font-size: 11px; margin-top: 3px; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; background: var(--lime); color: #1f3430; font-weight: 800; border-radius: 50%; }
.workspace { min-width: 0; padding: 34px clamp(20px, 4vw, 56px) 64px; overflow: hidden; }
.view { display: none; animation: view-in .22s ease-out; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-head { min-height: 64px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 3px 0 0; font-size: 30px; font-weight: 660; }
.page-head p:not(.eyebrow) { color: var(--muted); margin: 7px 0 0; max-width: 660px; }
.eyebrow { margin: 0; color: var(--petrol); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.button.primary { background: var(--petrol); color: white; }
.button.primary:hover { background: var(--petrol-dark); }
.button.secondary { background: white; border-color: #bfcac8; color: var(--ink); }
.button.secondary:hover { border-color: var(--petrol); color: var(--petrol); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.wide { width: 100%; }
.text-action { border: 0; color: var(--petrol); background: transparent; cursor: pointer; font-weight: 750; }
.metric-strip {
  background: var(--surface);
  border-top: 3px solid var(--petrol);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 32px;
}
.metric-strip div { padding: 20px 22px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip span { display: block; font-size: 23px; font-weight: 680; }
.metric-strip small { display: block; color: var(--muted); margin-top: 4px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 36px; }
.panel, .activity { min-width: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.section-head h2, .activity h2, .flow-band h2, .order-panel h2, .repo-section h2, .billing-grid h2, .api-contract h2, .auth-boundary h2 { margin: 0; font-size: 18px; }
.section-head p, .connection-state p, .note { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.plant-line { display: grid; grid-template-columns: minmax(160px, 1fr) 150px 120px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); gap: 16px; }
.plant-line strong, td strong { display: block; }
.plant-line small, td small { display: block; color: var(--muted); margin-top: 3px; }
.activity { border-left: 1px solid var(--line); padding-left: 28px; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 18px; border-left: 1px solid #bdcac7; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; background: var(--petrol); border-radius: 50%; }
.timeline time, .timeline span { display: block; color: var(--muted); font-size: 11px; }
.timeline strong { display: block; margin: 4px 0; font-size: 13px; }
.flow-band { margin-top: 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 28px; align-items: center; }
.flow-band > p { color: var(--muted); font-size: 13px; margin: 0; }
.flow-track { display: flex; align-items: center; }
.flow-track span { padding: 8px 10px; background: white; border: 1px solid var(--line); font-size: 12px; font-weight: 750; white-space: nowrap; }
.flow-track i { height: 1px; background: var(--petrol); flex: 1; min-width: 10px; }
.status { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status.available { background: #e7f4ef; color: #236b57; }
.status.review { background: #fff3d7; color: #855d13; }
.status.neutral { background: #e9eef0; color: #52666b; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th { padding: 12px 15px; color: var(--muted); font-size: 11px; text-align: left; text-transform: uppercase; background: #f8faf9; border-bottom: 1px solid var(--line); }
td { padding: 15px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.module-list { background: white; border: 1px solid var(--line); overflow: hidden; }
.module-header, .module-row { display: grid; grid-template-columns: minmax(240px, 1.8fr) 112px 100px 110px 58px; gap: 12px; align-items: center; }
.module-header { padding: 11px 14px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; background: #f8faf9; border-bottom: 1px solid var(--line); }
.module-row { min-height: 69px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.module-row:last-child { border-bottom: 0; }
.module-row:hover { background: #f8fbfa; }
.module-row > span:first-child { display: grid; grid-template-columns: 20px 1fr; align-items: center; }
.module-row > span:first-child small { grid-column: 2; color: var(--muted); margin-top: 3px; }
.module-check { width: 16px; height: 16px; accent-color: var(--petrol); }
.qty { width: 52px; height: 34px; border: 1px solid #c8d2d0; border-radius: 4px; padding: 0 6px; }
.order-panel { background: #20302f; color: white; padding: 22px; position: sticky; top: 92px; border-radius: var(--radius); }

.order-panel .eyebrow { color: var(--lime); }
.order-panel h2 { margin: 4px 0 20px; }
.order-panel label, dialog label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; margin: 0 0 16px; }
.order-panel select, dialog input, dialog select { width: 100%; height: 40px; border: 1px solid #c9d3d1; border-radius: 4px; padding: 0 10px; background: white; color: var(--ink); }
.order-items { min-height: 72px; border-top: 1px solid #40514f; border-bottom: 1px solid #40514f; padding: 12px 0; margin: 6px 0 14px; }
.order-items p { color: #aebebb; font-size: 12px; margin: 0; }
.order-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin: 7px 0; }
.order-panel dl { margin: 0 0 16px; }
.order-panel dl div { display: flex; justify-content: space-between; margin: 8px 0; }
.order-panel dt { color: #b7c5c2; font-size: 12px; }
.order-panel dd { margin: 0; font-weight: 800; }
.order-panel > small { display: block; color: #aebebb; line-height: 1.5; margin-top: 13px; }
.repo-section { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 26px; }
.repo-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.repo-grid > div { min-height: 98px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; background: white; }
.repo-grid code { color: var(--petrol); font-size: 11px; }
.repo-grid span { color: var(--muted); font-size: 11px; }
.system-license { margin-top: 28px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.system-license h2 { margin: 3px 0 5px; }
.system-license p:not(.eyebrow) { color: var(--muted); margin: 0; max-width: 650px; }
.system-license > strong { font-size: 22px; color: var(--petrol-dark); white-space: nowrap; }
.system-license > strong small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; text-align: right; }
.forecast-layout, .billing-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 42px; }
.connection-panel { background: white; border-top: 3px solid var(--petrol); padding: 22px; }
.connection-panel label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; }
.connection-panel select { height: 40px; border: 1px solid #c9d3d1; padding: 0 10px; background: white; }
.connection-state { display: flex; gap: 12px; align-items: center; padding: 22px 0; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.signal { width: 12px; height: 12px; border-radius: 50%; background: #27966f; box-shadow: 0 0 0 5px #dff3eb; }
.connection-panel dl, .detail-list { margin: 0 0 22px; }
.connection-panel dl div, .detail-list div { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 11px 0; }
.connection-panel dt, .detail-list dt { color: var(--muted); }
.connection-panel dd, .detail-list dd { margin: 0; font-weight: 700; }
.api-contract { padding-top: 3px; }
.api-contract > h2 { margin: 4px 0 22px; }
.api-contract ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.api-contract li { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.api-contract li > span { color: var(--petrol); font-weight: 800; }
.api-contract strong, .api-contract code { display: block; }
.api-contract code { color: var(--muted); margin-top: 6px; font-size: 12px; }
.billing-grid > section { background: white; border-top: 3px solid var(--petrol); padding: 22px; }
.billing-grid h2 { margin-bottom: 18px; }
.provider-row { min-height: 58px; display: grid; grid-template-columns: 90px 1fr auto; align-items: center; border-top: 1px solid var(--line); gap: 12px; }
.provider-row:last-of-type { border-bottom: 1px solid var(--line); }
.provider-row span { color: var(--muted); font-size: 12px; }
.provider-row em { color: var(--muted); font-size: 11px; font-style: normal; }
.active-provider em { color: #236b57; font-weight: 800; }
.note { line-height: 1.55; }
.auth-boundary { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.auth-boundary h2 { margin-bottom: 5px; }
.auth-boundary p { color: var(--muted); margin: 0; max-width: 700px; }
dialog { width: min(520px, calc(100% - 28px)); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 20px 70px rgb(20 32 34 / 24%); }
dialog::backdrop { background: rgb(16 28 29 / 55%); }
dialog form { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.dialog-head h2 { margin: 4px 0 0; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); background: white; border-radius: 50%; cursor: pointer; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.integration-warning { border-left: 4px solid var(--amber); background: #fff8e7; padding: 13px 15px; margin-top: 18px; }
.integration-warning p { color: #6f5a32; margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; background: #20302f; color: white; padding: 12px 16px; border-radius: 6px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .workspace { padding-left: 28px; padding-right: 28px; }
  .overview-grid, .forecast-layout, .billing-grid { grid-template-columns: 1fr; }
  .activity { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .order-panel { position: static; }
  .repo-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-band { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 14px; }
  .environment { display: none; }
  .top-actions .button { padding: 0 10px; }
  .brand small { display: none; }
  .app-shell { display: block; min-height: calc(100vh - 62px); }
  .sidebar { padding: 8px 10px; overflow-x: auto; position: sticky; top: 62px; z-index: 15; }
  .sidebar nav { display: flex; min-width: max-content; }
  .nav-item { height: 38px; padding: 0 11px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: 0; border-bottom-color: var(--lime); }
  .sidebar-account { display: none; }
  .workspace { padding: 24px 16px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-head h1 { font-size: 26px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .metric-strip div { padding: 16px; border-bottom: 1px solid var(--line); }
  .plant-line { grid-template-columns: 1fr auto; }
  .plant-line > span:nth-child(2) { display: none; }
  .repo-grid { grid-template-columns: 1fr; }
  .module-list { overflow-x: auto; }
  .module-header, .module-row { min-width: 760px; }
  .system-license, .auth-boundary { align-items: flex-start; flex-direction: column; }
  .system-license > strong small { text-align: left; }
  .forecast-layout, .billing-grid { gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
