/* ==========================================================================
   Floci Multi-Cloud Sandbox — application design system
   Cohesive dark theme, IBM Plex Sans / IBM Plex Mono, compact enterprise density.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — layered from the page floor upward */
  --bg: #0a0c10;
  --bg-chrome: #0e1116;
  --surface: #12161c;
  --surface-2: #171d24;
  --surface-3: #1e2630;
  --surface-inset: #0c0f14;

  /* Lines */
  --border: #1f2732;
  --border-2: #2a3441;
  --border-3: #3a4756;

  /* Type */
  --text: #e9edf3;
  --text-2: #a3aebd;
  --text-3: #6d7a8a;
  --text-4: #4d5866;

  /* Brand + semantics */
  --accent: #4d8dff;
  --accent-hi: #7ba8ff;
  --accent-dim: rgba(77, 141, 255, 0.14);
  --accent-line: rgba(77, 141, 255, 0.38);

  --ok: #3fcf8e;
  --ok-dim: rgba(63, 207, 142, 0.13);
  --warn: #e0b23f;
  --warn-dim: rgba(224, 178, 63, 0.13);
  --danger: #f2555a;
  --danger-hi: #ff7276;
  --danger-dim: rgba(242, 85, 90, 0.13);
  --danger-line: rgba(242, 85, 90, 0.4);
  --neutral-dim: rgba(163, 174, 189, 0.1);

  --aws: #ff9f45;
  --aws-dim: rgba(255, 159, 69, 0.13);
  --azure: #4aa3ff;
  --azure-dim: rgba(74, 163, 255, 0.13);
  --gcp: #a78bfa;
  --gcp-dim: rgba(167, 139, 250, 0.13);
  --oci: #e8739e;
  --oci-dim: rgba(232, 115, 158, 0.13);

  /* Metrics */
  --sidebar-w: 232px;
  --topbar-h: 52px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 4px 12px rgba(0, 0, 0, 0.5);

  --font: "IBM Plex Sans", ui-sans-serif, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: var(--accent-hi);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  display: block;
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-3);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. Shell layout
   -------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  height: 100vh;
  transition: grid-template-columns 180ms var(--ease);
}

.app.is-collapsed {
  --sidebar-w: 56px;
}

/* --------------------------------------------------------------------------
   4. Top bar
   -------------------------------------------------------------------------- */

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 0;
  background: var(--bg-chrome);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  width: var(--sidebar-w);
  min-width: 0;
  padding-left: 14px;
  height: 100%;
  flex: none;
  transition: width 180ms var(--ease);
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #05070a;
  background: linear-gradient(150deg, #8fb6ff, var(--accent) 62%, #2f6ce0);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09) inset, 0 2px 8px rgba(77, 141, 255, 0.28);
}

.brand-text {
  min-width: 0;
  line-height: 1.15;
}

.brand-text b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
}

.brand-text span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
}

.app.is-collapsed .brand-text {
  display: none;
}

/* Search */
.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 520px;
}

.search__field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 10px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}

.search__field:hover {
  border-color: var(--border-2);
}

.search__field:focus-within {
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search__field svg {
  color: var(--text-4);
}

.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.search__input::placeholder {
  color: var(--text-4);
}

kbd {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
  white-space: nowrap;
}

.search__results {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  display: none;
}

.search__results.is-open {
  display: block;
}

.search__group-label {
  padding: 7px 9px 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-4);
}

.search__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-2);
  transition: background 100ms;
}

.search__item:hover,
.search__item.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.search__item-main {
  min-width: 0;
  flex: 1;
}

.search__item-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.search__item-meta {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-3);
  font-family: var(--mono);
}

.search__empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* Top bar actions */
/* Cloud / environment switcher — scopes every view to one provider */
.cloud-switch {
  flex: none;
}

.cloud-switch select {
  height: 32px;
  min-width: 152px;
  background: var(--surface-inset);
  color: var(--text-2);
}

.cloud-switch.is-scoped select {
  border-color: var(--accent-line);
  background: var(--accent-dim);
  color: var(--text);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.avatar {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #06090e;
  background: linear-gradient(145deg, #9dc0ff, #5b93f0);
}

.avatar--lg {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px 3px 3px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-2);
  transition: background 120ms, border-color 120ms;
}

.user-trigger:hover,
.user-trigger[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.user-trigger__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  max-width: 140px;
}

/* --------------------------------------------------------------------------
   5. Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-chrome);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px;
}

.nav-label {
  padding: 10px 8px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 450;
  text-align: left;
  position: relative;
  transition: background 110ms, color 110ms;
}

.nav__item svg {
  color: var(--text-3);
  transition: color 110ms;
}

.nav__item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav__item:hover svg {
  color: var(--text-2);
}

.nav__item.is-active {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 550;
}

.nav__item.is-active svg {
  color: var(--accent);
}

.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.nav__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.nav__count {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 16px;
}

.nav__item.is-active .nav__count {
  color: var(--text-2);
  border-color: var(--border-2);
}

.sidebar__footer {
  flex: none;
  border-top: 1px solid var(--border);
  padding: 8px;
}

.env-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.env-chip__text {
  min-width: 0;
  line-height: 1.25;
}

.env-chip__text b {
  display: block;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}

.env-chip__text span {
  display: block;
  font-size: 10px;
  color: var(--text-4);
  white-space: nowrap;
}

.collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 12.5px;
  transition: background 110ms, color 110ms;
}

.collapse-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.collapse-btn svg {
  transition: transform 180ms var(--ease);
}

/* Collapsed state */
.app.is-collapsed .nav__item,
.app.is-collapsed .collapse-btn,
.app.is-collapsed .env-chip {
  justify-content: center;
  padding: 0;
  gap: 0;
}

.app.is-collapsed .env-chip {
  padding: 7px 0;
}

.app.is-collapsed .nav__label,
.app.is-collapsed .nav__count,
.app.is-collapsed .nav-label,
.app.is-collapsed .env-chip__text,
.app.is-collapsed .collapse-btn span {
  display: none;
}

.app.is-collapsed .collapse-btn svg {
  transform: rotate(180deg);
}

/* Tooltip for collapsed nav */
.app.is-collapsed .nav__item::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 110ms;
  z-index: 60;
}

.app.is-collapsed .nav__item:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   6. Main region
   -------------------------------------------------------------------------- */

.main {
  grid-row: 2;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg);
  background-image:
    radial-gradient(900px 380px at 12% -8%, rgba(77, 141, 255, 0.07), transparent 62%),
    radial-gradient(700px 320px at 96% -12%, rgba(63, 207, 142, 0.045), transparent 58%);
  background-repeat: no-repeat;
}

.view {
  display: none;
  padding: 22px 26px 48px;
  max-width: 1560px;
}

.view.is-active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head__text {
  min-width: 0;
  flex: 1;
}

.page-head h1 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.024em;
  color: var(--text);
}

.page-head p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
  max-width: 78ch;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-top: 2px;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 7px;
}

.section {
  margin-top: 22px;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.section__head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--text);
}

.section__head .spacer {
  flex: 1;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 110ms, border-color 110ms, color 110ms, box-shadow 110ms, transform 60ms;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-3);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn svg {
  color: var(--text-3);
}

.btn:hover svg {
  color: var(--text-2);
}

.btn--primary {
  background: var(--accent);
  border-color: #3a76e0;
  color: #04070d;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--primary:hover {
  background: var(--accent-hi);
  border-color: #6698ff;
}

.btn--primary svg,
.btn--primary:hover svg {
  color: #04070d;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn--danger {
  background: var(--danger);
  border-color: #cf4247;
  color: #180405;
  font-weight: 600;
}

.btn--danger:hover {
  background: var(--danger-hi);
  border-color: var(--danger-hi);
}

.btn--danger svg,
.btn--danger:hover svg {
  color: #180405;
}

.btn--sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.btn--lg {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 30px;
  padding: 0;
}

.btn--icon.btn--sm {
  width: 26px;
}

.btn.is-busy {
  color: transparent;
  position: relative;
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--text-2);
  animation: spin 620ms linear infinite;
}

.btn--primary.is-busy::after,
.btn--danger.is-busy::after {
  color: #04070d;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   8. Cards + panels
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
}

.panel__head h3 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.panel__head .spacer {
  flex: 1;
}

.panel__body {
  padding: 14px;
}

.panel__body--flush {
  padding: 0;
}

.panel__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-inset);
}

/* Metric cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}

.metric {
  position: relative;
  padding: 13px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 130ms, background 130ms;
}

.metric:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.metric::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--metric-tone, var(--border-3)), transparent);
  opacity: 0.7;
}

.metric__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--text-3);
}

.metric__label svg {
  color: var(--metric-tone, var(--text-4));
}

.metric__value {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric__sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-4);
}

/* Key/value list */
.kv {
  display: grid;
  grid-template-columns: minmax(112px, auto) 1fr;
  gap: 0;
}

.kv > dt {
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.kv > dd {
  margin: 0;
  padding: 7px 0 7px 14px;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv > dt:last-of-type,
.kv > dd:last-of-type {
  border-bottom: 0;
}

/* Distribution bars */
.dist {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dist__row {
  display: grid;
  grid-template-columns: 152px 1fr 38px;
  align-items: center;
  gap: 10px;
}

.dist__name {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dist__track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dist__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--bar-tone, var(--accent));
  transition: width 400ms var(--ease);
}

.dist__value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Split bar (AWS vs Azure) */
.split-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-inset);
  border: 1px solid var(--border);
}

.split-bar__seg {
  display: block;
  height: 100%;
  transition: width 400ms var(--ease);
}

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.split-legend__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   9. Badges + status
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--neutral-dim);
  color: var(--text-2);
  border-color: var(--border-2);
}

.badge--aws {
  background: var(--aws-dim);
  color: var(--aws);
  border-color: rgba(255, 159, 69, 0.26);
}

.badge--azure {
  background: var(--azure-dim);
  color: var(--azure);
  border-color: rgba(74, 163, 255, 0.26);
}

.badge--gcp {
  background: var(--gcp-dim);
  color: var(--gcp);
  border-color: rgba(167, 139, 250, 0.26);
}

.badge--oci {
  background: var(--oci-dim);
  color: var(--oci);
  border-color: rgba(232, 115, 158, 0.26);
}

.badge--ok {
  background: var(--ok-dim);
  color: var(--ok);
  border-color: rgba(63, 207, 142, 0.26);
}

.badge--warn {
  background: var(--warn-dim);
  color: var(--warn);
  border-color: rgba(224, 178, 63, 0.26);
}

.badge--danger {
  background: var(--danger-dim);
  color: var(--danger-hi);
  border-color: var(--danger-line);
}

.badge--accent {
  background: var(--accent-dim);
  color: var(--accent-hi);
  border-color: var(--accent-line);
}

.badge--quiet {
  background: transparent;
  color: var(--text-3);
  border-color: var(--border);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--neutral-dim);
}

.status--ok .status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-dim);
}

.status--warn .status__dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-dim);
}

.status--danger .status__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

.status--ok.is-live .status__dot {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--ok-dim);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(63, 207, 142, 0.05);
  }
}

/* --------------------------------------------------------------------------
   10. Toolbar / filters
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-inset);
}

.toolbar .spacer {
  flex: 1;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 120ms, box-shadow 120ms;
}

.field-inline:hover {
  border-color: var(--border-2);
}

.field-inline:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.field-inline svg {
  color: var(--text-4);
}

.field-inline input {
  border: 0;
  background: none;
  outline: none;
  font-size: 12.5px;
  width: 190px;
  min-width: 0;
}

.field-inline input::placeholder {
  color: var(--text-4);
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select select {
  appearance: none;
  height: 30px;
  padding: 0 26px 0 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms;
}

.select select:hover {
  border-color: var(--border-2);
}

.select select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.select::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.select option {
  background: var(--surface-2);
  color: var(--text);
}

.result-count {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   11. Data table
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
  font-weight: 550;
  white-space: nowrap;
}

table.data thead th .th-inner {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

table.data thead th button.th-inner {
  width: 100%;
  transition: color 110ms, background 110ms;
}

table.data thead th button.th-inner:hover {
  color: var(--text);
  background: var(--surface-3);
}

.th-sort {
  opacity: 0;
  color: var(--accent);
  transition: opacity 110ms;
}

table.data thead th button.th-inner:hover .th-sort {
  opacity: 0.45;
}

table.data thead th.is-sorted .th-inner {
  color: var(--text);
}

table.data thead th.is-sorted .th-sort {
  opacity: 1;
}

table.data tbody tr {
  cursor: pointer;
  transition: background 90ms;
}

table.data tbody tr:hover {
  background: var(--surface-2);
}

table.data tbody tr.is-selected {
  background: var(--accent-dim);
}

table.data tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cell-name__icon {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-3);
}

.cell-name__text {
  min-width: 0;
}

.cell-name__title {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-name__id {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.col-actions {
  width: 44px;
  text-align: right;
}

.col-actions .th-inner {
  justify-content: flex-end;
}

.row-menu-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-3);
  transition: background 110ms, color 110ms, border-color 110ms;
}

.row-menu-btn:hover,
.row-menu-btn[aria-expanded="true"] {
  background: var(--surface-3);
  border-color: var(--border-2);
  color: var(--text);
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-inset);
}

.pager .spacer {
  flex: 1;
}

.pager__info {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.pager__pages {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  transition: background 110ms, color 110ms, border-color 110ms;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}

.page-btn.is-active {
  background: var(--surface-3);
  border-color: var(--border-3);
  color: var(--text);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-ellipsis {
  padding: 0 3px;
  color: var(--text-4);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   12. Dropdown menus
   -------------------------------------------------------------------------- */

.menu {
  position: fixed;
  z-index: 300;
  min-width: 190px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: menu-in 110ms var(--ease);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
}

.menu__label {
  padding: 6px 9px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-4);
}

.menu__header {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.menu__header b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.menu__header span {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
  text-align: left;
  transition: background 100ms, color 100ms;
}

.menu__item svg {
  color: var(--text-4);
}

.menu__item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.menu__item:hover svg {
  color: var(--text-2);
}

.menu__item--danger {
  color: var(--danger-hi);
}

.menu__item--danger svg {
  color: var(--danger);
}

.menu__item--danger:hover {
  background: var(--danger-dim);
  color: var(--danger-hi);
}

.menu__item--danger:hover svg {
  color: var(--danger-hi);
}

.menu__sep {
  height: 1px;
  margin: 4px -1px;
  background: var(--border);
}

/* --------------------------------------------------------------------------
   13. Drawer
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}

.scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  width: min(560px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 240ms var(--ease);
}

.drawer.is-open {
  transform: none;
}

.drawer__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-chrome);
}

.drawer__head-text {
  flex: 1;
  min-width: 0;
}

.drawer__eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

.drawer__title {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.drawer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.drawer__foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-chrome);
}

.drawer__foot .spacer {
  flex: 1;
}

.icon-btn {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-3);
  transition: background 110ms, color 110ms, border-color 110ms;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}

/* Drawer subsections */
.drawer-section + .drawer-section {
  margin-top: 18px;
}

.drawer-section__title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 8px;
}

.code-block {
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-inset);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
}

.tag b {
  padding: 2px 6px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

.tag span {
  padding: 2px 6px;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   14. Forms (create wizard)
   -------------------------------------------------------------------------- */

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-inset);
  flex: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-4);
}

.step__num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--border-2);
  color: var(--text-4);
  background: var(--surface);
}

.step.is-active {
  color: var(--text);
  font-weight: 550;
}

.step.is-active .step__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #04070d;
}

.step.is-done .step__num {
  background: var(--ok-dim);
  border-color: rgba(63, 207, 142, 0.4);
  color: var(--ok);
}

.step.is-done {
  color: var(--text-2);
}

.step__line {
  width: 18px;
  height: 1px;
  background: var(--border-2);
}

.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  margin-bottom: 5px;
}

.field__req {
  color: var(--danger);
  font-size: 11px;
}

.field__optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-4);
}

.input,
.textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: var(--surface-inset);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}

.textarea {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
}

.input::placeholder {
  color: var(--text-4);
}

.input:hover,
.textarea:hover {
  border-color: var(--border-3);
}

.input:focus,
.textarea:focus {
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input.is-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.input:disabled,
.select--block select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.select--block {
  display: block;
  width: 100%;
}

.select--block select {
  width: 100%;
  height: 32px;
  background: var(--surface-inset);
  border-color: var(--border-2);
  font-size: 13px;
}

.select--block::after {
  top: 50%;
  margin-top: -5px;
}

.field__help {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-4);
  line-height: 1.45;
}

.field__error {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--danger-hi);
}

.field.has-error .input,
.field.has-error select {
  border-color: var(--danger-line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

/* Catalog picker */
.catalog-group + .catalog-group {
  margin-top: 18px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.catalog-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 120ms, background 120ms, transform 80ms;
}

.catalog-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-3);
}

.catalog-card:active {
  transform: translateY(0.5px);
}

.catalog-card.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.catalog-card__icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-3);
}

.catalog-card__text {
  min-width: 0;
}

.catalog-card__text b {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
}

.catalog-card__text span {
  display: block;
  font-size: 11px;
  color: var(--text-4);
}

/* Notes / callouts */
.note {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.note svg {
  margin-top: 2px;
  color: var(--text-3);
}

.note--accent {
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.note--accent svg {
  color: var(--accent-hi);
}

.note--warn {
  border-color: rgba(224, 178, 63, 0.32);
  background: var(--warn-dim);
}

.note--warn svg {
  color: var(--warn);
}

.note--danger {
  border-color: var(--danger-line);
  background: var(--danger-dim);
}

.note--danger svg {
  color: var(--danger-hi);
}

.note b {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   15. Modal
   -------------------------------------------------------------------------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.68);
  backdrop-filter: blur(3px);
}

.modal-layer.is-open {
  display: flex;
}

.modal {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 170ms var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.modal__body {
  display: flex;
  gap: 13px;
  padding: 18px;
}

.modal__icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--danger-dim);
  border: 1px solid var(--danger-line);
  color: var(--danger-hi);
}

.modal__icon--neutral {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-hi);
}

.modal__text {
  min-width: 0;
}

.modal__text h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.modal__text p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.modal__detail {
  margin-top: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-chrome);
}

/* --------------------------------------------------------------------------
   16. Toasts
   -------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(370px, calc(100vw - 36px));
  pointer-events: none;
  transition: right 240ms var(--ease);
}

/* Keep toasts clear of the right drawer so they never cover its footer actions. */
.toasts.is-shifted {
  right: calc(min(560px, 100vw) + 18px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 200ms var(--ease);
}

.toast.is-leaving {
  animation: toast-out 160ms var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

.toast--success {
  border-left-color: var(--ok);
}

.toast--success .toast__icon {
  color: var(--ok);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--error .toast__icon {
  color: var(--danger-hi);
}

.toast--info {
  border-left-color: var(--accent);
}

.toast--info .toast__icon {
  color: var(--accent-hi);
}

.toast__icon {
  margin-top: 1px;
  color: var(--text-3);
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.toast__msg {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   17. Activity feed
   -------------------------------------------------------------------------- */

.feed {
  display: flex;
  flex-direction: column;
}

.feed__item {
  display: flex;
  gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 100ms;
}

.feed__item:hover {
  background: var(--surface-2);
}

.feed__item:last-child {
  border-bottom: 0;
}

.feed__rail {
  position: relative;
  flex: none;
  width: 22px;
  display: flex;
  justify-content: center;
}

.feed__marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  z-index: 1;
}

.feed__item:not(:last-child) .feed__rail::after {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -13px;
  width: 1px;
  background: var(--border);
}

.feed__marker--create {
  background: var(--ok-dim);
  border-color: rgba(63, 207, 142, 0.3);
  color: var(--ok);
}

.feed__marker--delete {
  background: var(--danger-dim);
  border-color: var(--danger-line);
  color: var(--danger-hi);
}

.feed__marker--auth {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-hi);
}

.feed__body {
  flex: 1;
  min-width: 0;
}

.feed__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text);
}

.feed__title b {
  font-weight: 550;
}

.feed__sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-4);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.feed__time {
  flex: none;
  font-size: 11.5px;
  color: var(--text-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   18. Integration + infrastructure cards
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.integration {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 130ms;
}

.integration:hover {
  border-color: var(--border-2);
}

.integration__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
}

.cloud-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid;
}

.cloud-mark--aws {
  background: var(--aws-dim);
  border-color: rgba(255, 159, 69, 0.3);
  color: var(--aws);
}

.cloud-mark--azure {
  background: var(--azure-dim);
  border-color: rgba(74, 163, 255, 0.3);
  color: var(--azure);
}

.cloud-mark--gcp {
  background: var(--gcp-dim);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--gcp);
}

.cloud-mark--oci {
  background: var(--oci-dim);
  border-color: rgba(232, 115, 158, 0.3);
  color: var(--oci);
}

.integration__title {
  flex: 1;
  min-width: 0;
}

.integration__title h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}

.integration__title p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}

.integration__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-inset);
}

.integration__stat {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}

.integration__stat:last-child {
  border-right: 0;
}

.integration__stat dt {
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
}

.integration__stat dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration__stat dd.is-text {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
}

.integration__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 15px;
  margin-top: auto;
}

/* Environment health rows */
.env-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

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

.env-row__text {
  flex: 1;
  min-width: 0;
}

.env-row__text b {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
}

.env-row__text span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-4);
}

.env-row__count {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Topology tree — parent/child rows inside an infrastructure card */
.tree {
  padding: 5px 0 7px;
}

.tree__section {
  padding: 11px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

/* Icon and name keep their natural width; the provider ID takes what is left over. */
.tree__node {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px calc(14px + var(--tree-depth, 0) * 15px);
  cursor: pointer;
  transition: background 110ms;
}

.tree__node:hover {
  background: var(--surface-2);
}

.tree__node.is-nested::before {
  content: "";
  position: absolute;
  left: calc(19px + (var(--tree-depth) - 1) * 15px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-2);
}

.tree__icon {
  color: var(--text-3);
}

.tree__name {
  font-size: 12.5px;
  color: var(--text);
}

.tree__type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-4);
}

.tree__id {
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
}

/* --------------------------------------------------------------------------
   19. Empty / loading states
   -------------------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 46px 24px;
  gap: 4px;
}

.empty__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-4);
  margin-bottom: 8px;
}

.empty h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.empty p {
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 44ch;
}

.empty__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.skeleton {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -300% 0;
  }
}

.skeleton-rows {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.skeleton-rows .skeleton {
  height: 13px;
}

.loading-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 26px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--text-3);
}

.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border-3);
  border-top-color: var(--accent);
  animation: spin 620ms linear infinite;
}

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .app {
    --sidebar-w: 56px;
  }

  .app .brand-text,
  .app .nav__label,
  .app .nav__count,
  .app .nav-label,
  .app .env-chip__text,
  .app .collapse-btn span {
    display: none;
  }

  .app .nav__item,
  .app .collapse-btn,
  .app .env-chip {
    justify-content: center;
    padding: 0;
    gap: 0;
  }

  .app .nav__item:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 60;
  }

  .collapse-btn {
    display: none;
  }
}

@media (max-width: 860px) {
  .view {
    padding: 16px 14px 40px;
  }

  .user-trigger__name {
    display: none;
  }

  .search {
    max-width: none;
  }

  .search__field kbd {
    display: none;
  }

  .cloud-switch select {
    min-width: 0;
    width: 108px;
  }

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

  .page-head {
    flex-direction: column;
    gap: 12px;
  }

  .page-head__actions {
    width: 100%;
  }

  .drawer {
    width: 100vw;
  }

  .toasts.is-shifted {
    right: 18px;
    bottom: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   21. Auth pages (login / signup) — share the same token system
   -------------------------------------------------------------------------- */

body.auth {
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  background:
    radial-gradient(900px 460px at 18% -6%, rgba(77, 141, 255, 0.1), transparent 60%),
    radial-gradient(760px 420px at 88% 6%, rgba(63, 207, 142, 0.06), transparent 58%),
    var(--bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 42px 44px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.auth-pitch h2 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 15ch;
}

.auth-pitch p {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-3);
  max-width: 46ch;
}

.auth-points {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}

.auth-points svg {
  margin-top: 2px;
  color: var(--ok);
}

.auth-foot {
  font-size: 11.5px;
  color: var(--text-4);
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.auth-card {
  width: min(392px, 100%);
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.024em;
}

.auth-card > p.sub {
  margin-top: 6px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
}

.auth-card .field__label {
  font-size: 12.5px;
}

.auth-card .input {
  height: 36px;
}

.auth-card .btn {
  margin-top: 4px;
}

.auth-msg {
  display: none;
  margin-top: 14px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
}

.auth-msg.is-visible {
  display: block;
}

.auth-msg.is-error {
  border-color: var(--danger-line);
  background: var(--danger-dim);
  color: var(--danger-hi);
}

.auth-alt {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
  }
}
