/* Tepplo Operational Console Design System (`public/console.css`)
   Modern neutral zinc/slate palette · crisp 1px hairlines · tabular numerals · light & dark themes */

:root {
  --bg-rail: #fafafa;
  --bg-canvas: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-hover: rgba(9, 9, 11, 0.04);
  --bg-active: rgba(9, 9, 11, 0.065);
  --bg-code: #0c0c0e;
  --bg-code-row: rgba(255, 255, 255, 0.03);

  --border: rgba(9, 9, 11, 0.085);
  --border-strong: rgba(9, 9, 11, 0.14);
  --border-focus: #18181b;

  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-code: #e4e4e7;

  --accent-primary: #18181b;
  --accent-primary-hover: #27272a;
  --accent-primary-fg: #ffffff;

  --brand: #ea580c;
  --brand-soft: rgba(234, 88, 12, 0.1);
  --brand-fg: #c2410c;

  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.11);
  --ok-fg: #047857;

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --danger-fg: #b91c1c;

  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.1);
  --info-fg: #1d4ed8;

  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-fg: #b45309;

  --shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-sm: 0 2px 8px -2px rgba(9, 9, 11, 0.06), 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 20px 44px -12px rgba(9, 9, 11, 0.18), 0 4px 12px -4px rgba(9, 9, 11, 0.08);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

body.dark {
  --bg-rail: #09090b;
  --bg-canvas: #0f0f12;
  --bg-surface: #141418;
  --bg-subtle: #1c1c21;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --bg-active: rgba(255, 255, 255, 0.085);
  --bg-code: #09090b;
  --bg-code-row: rgba(255, 255, 255, 0.025);

  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-focus: #e4e4e7;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-code: #e4e4e7;

  --accent-primary: #fafafa;
  --accent-primary-hover: #e4e4e7;
  --accent-primary-fg: #09090b;

  --brand-soft: rgba(234, 88, 12, 0.18);
  --brand-fg: #fb923c;

  --ok-soft: rgba(16, 185, 129, 0.16);
  --ok-fg: #34d399;

  --danger-soft: rgba(239, 68, 68, 0.16);
  --danger-fg: #f87171;

  --info-soft: rgba(59, 130, 246, 0.16);
  --info-fg: #60a5fa;

  --warn-soft: rgba(245, 158, 11, 0.16);
  --warn-fg: #fbbf24;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.65);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-rail);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

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

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* Pulse indicator */
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
  flex-shrink: 0;
}

.status-dot.live {
  animation: pulseRing 2.4s infinite;
}

.status-dot.connecting {
  background: var(--warn);
}

/* ============================================================================
   APP SHELL (Linear / Vercel / Resend inspired inset layout)
   ============================================================================ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--bg-rail);
}

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

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-rail);
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Org Switcher */
.org-wrap {
  position: relative;
}

.org-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}

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

.org-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.org-mark.brand-tint {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

body.dark .org-mark:not(.brand-tint) {
  background: linear-gradient(135deg, #27272a 0%, #3f3f46 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.org-meta {
  flex: 1;
  min-width: 0;
}

.org-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  line-height: 1.25;
}

.org-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.org-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.org-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-lg);
}

.org-menu-label {
  padding: 5px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.org-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.1s ease;
}

.org-menu-item:hover {
  background: var(--bg-hover);
}

.org-menu-item.active {
  background: var(--bg-active);
  font-weight: 550;
}

.org-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.org-menu-create {
  color: var(--text-secondary);
  font-weight: 500;
}

.org-menu-create:hover {
  color: var(--text-primary);
}

/* Sidebar Navigation */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  padding: 0 9px 5px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 560;
}

.nav-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.72;
  flex-shrink: 0;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0 5px;
  border-radius: 5px;
}

.nav-count.has-items {
  background: var(--brand-soft);
  color: var(--brand-fg);
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 12px;
}

.stream-card-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stream-card-text {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  font-weight: 500;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 2px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-text {
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

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

/* ============================================================================
   MAIN CANVAS & TOPBAR
   ============================================================================ */
.main-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-canvas);
}

.topbar {
  height: 52px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-canvas);
  position: sticky;
  top: 0;
  z-index: 30;
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.breadcrumb-org {
  color: var(--text-secondary);
  font-weight: 500;
}

.breadcrumb-sep {
  opacity: 0.45;
}

.breadcrumb-page {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-rail);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.canvas-body {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 28px 56px;
  flex: 1;
}

@media (max-width: 640px) {
  .canvas-body {
    padding: 20px 16px 40px;
  }
}

/* ============================================================================
   BUTTONS, INPUTS, BADGES, CARDS, TABLES
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 520;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--accent-primary-fg);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-lg {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

.input, .select {
  height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

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

.input:focus, .select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

body.dark .input:focus, body.dark .select:focus {
  box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.1);
}

/* Page Header */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.page-title {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.25;
}

.page-desc {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-secondary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* KPI Strip (Real Numbers Only) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  margin-bottom: 22px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }
}

.kpi-cell {
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-cell + .kpi-cell {
  border-left: 1px solid var(--border);
}

@media (max-width: 640px) {
  .kpi-cell + .kpi-cell {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Cards & Panels */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
}

.panel-pad {
  padding: 18px 20px;
}

.panel-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-rail);
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.badge-rose { background: var(--danger-soft); color: var(--danger-fg); }
.badge-green { background: var(--ok-soft); color: var(--ok-fg); }
.badge-blue { background: var(--info-soft); color: var(--info-fg); }
.badge-peach { background: var(--brand-soft); color: var(--brand-fg); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

/* Empty State (Crisp Resend / Linear Operational Style) */
.empty-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 40px 24px 34px;
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-rail);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
}

.empty-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.empty-desc {
  margin: 6px auto 0;
  max-width: 440px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.endpoint-bar {
  margin: 20px auto 0;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-rail);
  text-align: left;
}

.endpoint-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-method {
  color: var(--ok-fg);
  font-weight: 600;
  margin-right: 6px;
}

.empty-links {
  margin: 18px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Story Inbox List */
.inbox-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
}

.inbox-row {
  padding: 15px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}

.inbox-row:last-child {
  border-bottom: none;
}

.inbox-row:hover {
  background: var(--bg-hover);
}

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

.inbox-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.inbox-title {
  font-size: 14px;
  font-weight: 560;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.inbox-body {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.inbox-time {
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.inbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* Segmented Filter Pills */
.seg-group {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-rail);
  gap: 2px;
}

.seg-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 560;
  box-shadow: var(--shadow-xs);
}

/* Data Tables (Businesses & Team) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-muted);
  background: var(--bg-rail);
  border-bottom: 1px solid var(--border);
}

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

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

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

/* Capsule Waterfall */
.capsule-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.capsule-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-rail);
}

.capsule-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

/* Code / DSN Block */
.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  color: var(--text-code);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  word-break: break-all;
}

/* Terminal Logs Explorer */
.logs-shell {
  border-radius: var(--radius-lg);
  background: var(--bg-code);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-code);
  overflow: hidden;
}

.logs-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.logs-list {
  max-height: 540px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.1s ease;
}

.log-row:hover {
  background: var(--bg-code-row);
}

.log-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-ts {
  color: #71717a;
}

.log-name {
  color: #fb923c;
  font-weight: 500;
}

.log-meta {
  margin-top: 3px;
  color: #a1a1aa;
  font-size: 11.5px;
}

.log-trail {
  margin-top: 3px;
  color: #34d399;
  font-size: 11.5px;
}

.log-json {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 11.5px;
}

/* Pending Invite Alert Banner */
.invite-alert {
  margin: 14px 28px 0;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-rail);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 9, 11, 0.48);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-err {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--danger-fg);
}

.form-ok {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ok-fg);
}
