:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #00b2a1;
  --blue-soft: #e6f9f8;
  --brand: #00b2a1;
  --brand-dark: #009b8b;
  --brand-50: #e6f9f8;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --orange: #d97706;
  --orange-soft: #fffbeb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.05);
  --sidebar-w: 220px;
  --header-h: 72px;
  --radius: 14px;
  font-family: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 5;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}
.side-brand {
  padding: 0.2rem 0.55rem 0.95rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
}
.skip-link:focus {
  left: 0.75rem;
}
.nav-toggle,
.nav-close {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink);
}
.nav-backdrop {
  display: none;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn:focus-visible,
.chip:focus-visible,
.side-link:focus-visible,
.nav-toggle:focus-visible,
.nav-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.sync-live { color: var(--orange); }
.hide-sm { display: inline-flex; }
.nowrap { white-space: nowrap; }
.name-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.empty-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: #fafbfc;
  z-index: 1;
  box-shadow: inset 0 -1px 0 var(--line);
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.brand-lockup.center {
  justify-content: center;
  width: 100%;
}
.brand-lockup.lg .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}
.brand-lockup.lg .brand-text {
  font-size: 1.2rem;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex: 0 0 auto;
}
.brand-text {
  font-weight: 700;
  font-size: 1rem;
  color: #0f3d2e;
  letter-spacing: -0.02em;
}
.user-chip {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.host-cell {
  max-width: 24rem;
}
.host-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin-bottom: 0.25rem;
}
.host-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}
.actions-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 12rem;
}
.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.kpi-inline-fail {
  font-size: 0.7em;
  font-weight: 600;
  color: var(--red);
  margin-left: 0.15rem;
}
.connections-table .status-cell {
  max-width: 14rem;
}
.form-section {
  padding-top: 0.35rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.form-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.form-section-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.connection-form .form-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
}
.panel .connection-form {
  padding: 0.25rem 0.15rem 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
  white-space: nowrap;
}
.empty-panel.centered {
  place-items: center;
  text-align: center;
  width: 100%;
  padding: 2rem 1rem;
}
.side-section {
  margin: 1rem 0.65rem 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  color: #374151;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-link:hover { background: #f9fafb; }
.side-link.active {
  background: var(--blue-soft);
  color: var(--brand-dark);
}
.side-link.disabled { opacity: 0.45; cursor: not-allowed; }
.side-ico { width: 1.1rem; text-align: center; opacity: 0.9; }

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand-block { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.brand-title { font-weight: 700; font-size: 1.05rem; }
.brand-sub { color: var(--muted); font-size: 0.82rem; }
.header-actions { display: flex; gap: 0.55rem; align-items: center; flex-wrap: nowrap; }
@media (max-width: 900px) {
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
}
.inline { display: inline; margin: 0; }

.content {
  padding: 1.25rem 1.5rem 3rem;
  width: min(1280px, 100%);
  margin: 0 auto;
}
.page-head {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap;
}
.page-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

.btn, .chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover, .chip:hover { background: #f9fafb; }
.btn.primary, .chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger-btn {
  color: var(--red);
  border-color: #fecaca;
}
.btn.danger-btn:hover:not(:disabled) {
  background: var(--red-soft);
  border-color: var(--red);
}
.btn.small {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}
.empty-state {
  display: grid;
  gap: 0.55rem;
  place-items: center;
  text-align: center;
  padding: 1.75rem 1rem;
}
.empty-state strong {
  font-size: 1rem;
}
.empty-state p { margin: 0; max-width: 36rem; }
.empty-state code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.empty-page {
  min-height: 40vh;
  display: grid;
  place-items: center;
}
.detail-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-danger { color: var(--red); font-weight: 600; }
.text-warn { color: var(--orange); font-weight: 600; }
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
}
.mono-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  word-break: break-all;
}
.inline-form {
  display: inline;
  margin: 0;
}
.range-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: #fff;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  max-width: 100%;
}
.range-switch .chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.domain-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: sticky;
  top: calc(var(--header-h) - 4px);
  z-index: 8;
  background: linear-gradient(var(--bg) 70%, rgba(243, 245, 247, 0));
  /* Hint that more tabs scroll horizontally */
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.5rem), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 1.5rem), transparent 100%);
}
.domain-tabs .chip {
  flex: 0 0 auto;
  white-space: nowrap;
}
.mono-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 500;
}

.volume-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 0.5rem 0.25rem 1.5rem;
  overflow-x: auto;
}
.volume-bar {
  flex: 1 0 8px;
  min-width: 6px;
  max-width: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.volume-stack {
  display: flex;
  flex-direction: column-reverse;
  height: 100%;
  width: 100%;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  background: #f3f4f6;
}
.vol-read { display: block; width: 100%; background: var(--brand); min-height: 0; }
.vol-write { display: block; width: 100%; background: #0f766e; min-height: 0; }
.vol-query { display: block; width: 100%; background: var(--brand); min-height: 0; border-radius: 2px 2px 0 0; }
.volume-label {
  position: absolute;
  bottom: -1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}
.volume-legend {
  display: flex;
  gap: 1rem;
  padding: 0 0.5rem 0.75rem;
  font-size: 0.82rem;
}
.volume-legend .swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}
.volume-legend .swatch.read { background: var(--brand); }
.volume-legend .swatch.write { background: #0f766e; }
.volume-legend .swatch.query { background: var(--brand); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pill.kind-read { background: var(--brand-50); color: var(--brand-dark); }
.pill.kind-write { background: #ecfdf5; color: #047857; }
.pill.kind-other { background: #f3f4f6; color: #4b5563; }

.kpi-delta.warn { color: var(--orange); }

.badge.success,
.badge.succeeded,
.badge.green,
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.failed,
.badge.error,
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.running,
.badge.processing,
.badge.pending,
.badge.yellow { background: var(--orange-soft); color: var(--orange); }
.badge.unknown { background: #f3f4f6; color: #4b5563; }
.text-danger { color: var(--red); }

.filter-bar {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px) minmax(140px, 180px) auto auto;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: center;
}
.filter-bar.ingestion-filters {
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(130px, 0.85fr) auto auto;
  align-items: center;
}
.crumb {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.crumb-sep { color: #c4c9d2; }
.share-cell {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 110px;
}
.share-cell .meter { width: 100%; height: 8px; }
.kpi-value-sm { font-size: 1.25rem !important; }
.mono-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}
.filter-bar .search,
.filter-bar select,
.stack input,
.form-grid input,
.form-grid select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  color: var(--ink);
}
.filter-bar select,
.form-grid select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4 0.3L6 4.9 10.6.3l1.1 1.1L6 7.1.3 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}
.filter-bar .search { width: 100%; }
.filter-bar .search:focus,
.filter-bar select:focus,
.form-grid input:focus,
.sutra-login-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 178, 161, 0.18);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.kpi-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card, .card, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi-card { padding: 1rem 1.05rem; }
.kpi-label { color: var(--muted); font-size: 0.84rem; margin-bottom: 0.35rem; }
.kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.kpi-value.danger { color: var(--red); }
.kpi-value.warn { color: var(--orange); }
.kpi-delta { margin-top: 0.4rem; font-size: 0.82rem; font-weight: 500; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta.neutral { color: var(--muted); font-weight: 450; }

.mid-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.card { padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card-head {
  display: flex; justify-content: space-between; gap: 1rem;
  align-items: flex-start; margin-bottom: 0.85rem;
}
.live-pill {
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.text-link { color: var(--blue); font-weight: 600; font-size: 0.88rem; }
.text-link:hover { text-decoration: underline; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.legend-item .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.legend-item .swatch.primary { background: #00b2a1; }
.legend-item .swatch.secondary { background: #80dfdc; }

.chart-frame {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.35rem;
  min-height: 220px;
  align-items: stretch;
}
.chart-frame.compact,
.chart-frame.dense { min-height: 220px; }
.chart-y {
  position: relative;
  height: 160px;
  margin-top: 0.15rem;
}
.y-tick {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(50%);
  text-align: right;
  padding-right: 0.35rem;
}
.y-tick span {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.chart-plot {
  position: relative;
  min-width: 0;
}
.chart-grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.15rem;
  height: 160px;
  pointer-events: none;
}
.grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #e8ebf0;
}
.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 190px;
  padding-top: 0.15rem;
  position: relative;
  z-index: 1;
}
.chart-frame.compact .chart { gap: 0.2rem; }
.chart-frame.dense .chart { gap: 0.1rem; }
.chart-card .empty-panel { width: 100%; min-height: 160px; }
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.bar-stack {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  background: linear-gradient(180deg, transparent, rgba(0, 178, 161, 0.04));
  border-radius: 8px 8px 0 0;
}
.bar-stack.stacked {
  /* Both series grow from baseline (overlay), not flex-stack — avoids floating bars. */
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 12%;
}
.chart-frame.dense .bar-stack.stacked { padding: 0 8%; }
.bar-stack.stacked .bar {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  width: auto;
}
.bar {
  width: 100%;
  border-radius: 4px 4px 1px 1px;
  min-height: 0;
  transition: height 0.2s ease;
}
.bar-stack.stacked .bar.primary {
  z-index: 2;
  border-radius: 4px 4px 2px 2px;
}
.bar-stack.stacked .bar.secondary {
  z-index: 1;
  opacity: 0.55;
  border-radius: 4px 4px 2px 2px;
}
.bar-stack.stacked .bar.primary:first-child,
.bar-stack.stacked .bar.secondary:last-child { border-radius: 4px 4px 2px 2px; }
.bar.primary { background: #00b2a1; }
.bar.secondary { background: #80dfdc; }
.bar.empty { min-height: 0; background: transparent; height: 0 !important; }
.bar-label {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.1;
  min-height: 1em;
  font-variant-numeric: tabular-nums;
}
.chart-frame.compact .bar-label,
.chart-frame.dense .bar-label { font-size: 0.62rem; }

.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  max-height: 320px;
  overflow: auto;
}
.attention-list li { display: flex; gap: 0.7rem; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 0.4rem; flex: 0 0 auto;
}
.dot.red { background: var(--red); }
.dot.yellow { background: var(--orange); }
.dot.green { background: var(--green); }
.attention-body { min-width: 0; }
.attention-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.tag {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid var(--line);
}
.tag.fail { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.tag.warn { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.tag.ok { background: #f9fafb; color: #6b7280; }
.tag-row.compact { margin-top: 0; gap: 0.3rem; }
.tag-row.compact .tag {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-filters { margin-bottom: 1rem; }
.matrix-table .name-cell .small { margin-top: 0.15rem; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; color: var(--muted); font-size: 0.78rem;
  font-weight: 600; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 0.85rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: #f3f9f8; }

.customer-cell { display: flex; gap: 0.7rem; align-items: center; }
.link-row { color: inherit; }
.link-row:hover strong { color: var(--brand-dark); }
.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: #e6f9f8; color: #005f56;
  display: grid; place-items: center; font-weight: 700; font-size: 0.8rem;
  flex: 0 0 auto;
}
.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: -0.15rem 0 1rem;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 500;
}
.status-chip strong { font-variant-numeric: tabular-nums; }
.status-chip:hover { background: #f9fafb; }
.status-chip.active { background: #111827; color: #fff; border-color: #111827; }
.status-chip.good strong { color: var(--green); }
.status-chip.warn strong { color: var(--orange); }
.status-chip.bad strong { color: var(--red); }
.status-chip.active strong { color: inherit; }
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.pager .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
a.attention-title {
  color: inherit;
  text-decoration: none;
  display: block;
}
a.attention-title:hover { color: var(--brand-dark); }
.attention-note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ready-cell { display: grid; gap: 0.35rem; min-width: 110px; }
.meter {
  height: 7px; background: #e5e7eb; border-radius: 999px; overflow: hidden;
}
.meter > span { display: block; height: 100%; border-radius: inherit; }
.meter .good { background: #34d399; }
.meter .warn { background: #fbbf24; }
.meter .bad { background: #f87171; }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; padding: 0.25rem 0.65rem;
  font-size: 0.78rem; font-weight: 600;
  white-space: nowrap;
}
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--orange-soft); color: var(--orange); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.muted-pill { background: #f3f4f6; color: #6b7280; }
.dot-inline::before { content: "●"; }

.alert-banner {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.matrix-list { display: grid; gap: 0.75rem; }
.matrix-row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.matrix-row:hover { border-color: #80dfdc; background: #f3fcfb; }
.matrix-main { min-width: 0; flex: 1; }
.matrix-title { font-weight: 650; margin-bottom: 0.2rem; }

.empty-panel {
  display: grid;
  gap: 0.75rem;
  place-items: start;
  padding: 1.25rem 0.25rem;
}
.empty-panel p { margin: 0; }

.demo-flag {
  position: fixed; right: 1rem; bottom: 1rem;
  color: var(--muted); font-size: 0.78rem; background: rgba(255,255,255,0.9);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.7rem;
  z-index: 30;
}

.auth-body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 178, 161, 0.18), transparent 55%),
    linear-gradient(180deg, #e6f9f8 0%, #f3f5f7 42%, #f3f5f7 100%);
  min-height: 100vh;
}
.banner {
  padding: 0.75rem 0.9rem; border-radius: 10px; margin-bottom: 0.85rem;
  border: 1px solid var(--line);
}
.banner.error { background: var(--red-soft); color: var(--red); }
.banner.warn { background: var(--orange-soft); color: var(--orange); }
.banner.ok { background: var(--green-soft); color: var(--green); }
.banner code {
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.sutra-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.sutra-login-shell {
  width: min(26rem, 100%);
}
.sutra-login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 1.1rem;
  box-shadow: 0 18px 48px rgba(15, 61, 46, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 2rem 1.75rem 1.5rem;
  backdrop-filter: blur(8px);
}
.sutra-login-brand {
  margin-bottom: 1.35rem;
  text-align: center;
}
.sutra-logo {
  height: 2.25rem;
  width: auto;
  max-width: 160px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}
.sutra-logo.login {
  height: 2.55rem;
  max-width: 190px;
}
.sutra-logo.side {
  height: 1.55rem;
  max-width: 140px;
  margin: 0;
}
.brand-lockup .sutra-logo.side {
  flex: 0 1 auto;
}
.sutra-login-product {
  margin: 0.85rem 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #0f3d2e;
}
.sutra-login-brand h1 {
  margin: 1.15rem 0 0.3rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}
.sutra-login-lead {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #6b7280;
}
.sutra-login-form { display: grid; gap: 0.85rem; }
.sutra-login-form label { display: grid; gap: 0.4rem; }
.sutra-login-form label span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #374151;
}
.sutra-login-form input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sutra-login-form input::placeholder { color: #9ca3af; }
.sutra-login-form input[aria-invalid="true"] {
  border-color: #fca5a5;
  background: #fffafa;
}
.sutra-login-password {
  position: relative;
  display: grid;
}
.sutra-login-password input {
  padding-right: 3.6rem;
}
.sutra-login-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
}
.sutra-login-eye:hover {
  color: var(--brand-dark);
  background: var(--brand-50);
}
.sutra-login-error {
  margin-bottom: 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  white-space: pre-wrap;
}
.sutra-login-btn {
  width: 100%;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  margin-top: 0.2rem;
  background: #00b2a1;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.sutra-login-btn:hover:not(:disabled) { background: #009b8b; }
.sutra-login-btn:active:not(:disabled) { transform: translateY(1px); }
.sutra-login-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.sutra-login-footer {
  margin: 1.35rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid #f3f4f6;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}

@media (max-width: 480px) {
  .sutra-login { padding: 1.5rem 0.85rem; }
  .sutra-login-card { padding: 1.5rem 1.15rem 1.25rem; border-radius: 0.9rem; }
}

[x-cloak] { display: none !important; }

.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
}
.form-grid label { display: grid; gap: 0.35rem; font-weight: 500; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: flex !important; align-items: center; gap: 0.5rem; }
.actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0.2rem 0 0; }
.list { margin: 0; padding-left: 1.1rem; }
.nested { display: grid; gap: 0.45rem; }
.check-row { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 1100px) {
  .kpi-row, .kpi-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mid-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .search { grid-column: 1 / -1; }
  .filter-bar.ingestion-filters {
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar.ingestion-filters .search { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-close { display: inline-grid; place-items: center; }
  .hide-sm { display: none !important; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
    z-index: 40;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 88vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    z-index: 50;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .side-nav { flex-direction: column; flex-wrap: nowrap; }
  .side-section { width: 100%; margin-top: 0.75rem; }
  .app-header { position: sticky; }
  .brand-sub { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .domain-tabs { top: 0; }
  .header-actions .btn { padding: 0.45rem 0.7rem; font-size: 0.82rem; }
  .kpi-row, .kpi-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.nav-open { overflow: hidden; }
@media (max-width: 520px) {
  .kpi-row, .kpi-row.four { grid-template-columns: 1fr; }
  .range-switch { width: 100%; }
  .range-switch .chip { flex: 1 1 auto; text-align: center; }
  .page-head { flex-direction: column; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .actions { width: 100%; }
  .form-actions .actions .btn { flex: 1; justify-content: center; text-align: center; }
  .header-actions { gap: 0.35rem; }
}
