:root {
  --sidebar-bg: #1e2330;
  --sidebar-hover: #2a3042;
  --sidebar-active: #4f46e5;
  --sidebar-text: #9aa3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 240px;
  --bg: #f0f2f7;
  --surface: #ffffff;
  --border: #e2e6ef;
  --text: #1a1d2e;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

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

body {
  min-height: 100vh;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

.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;
}

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.sidebar > * { flex-shrink: 0; }

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
}

.sidebar-logo .logo-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
}

.nav-section {
  padding: 12px 0 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 0 16px 6px;
}

.nav-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.nav-menu li a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-menu li.active a {
  background: rgba(79,70,229,.15);
  color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-active);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sidebar-hover);
}

.user-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-label { font-size: 11px; color: var(--sidebar-text); }

.btn-logout {
  display: block;
  width: 100%;
  text-align: center;
  padding: 7px;
  background: rgba(255,255,255,.06);
  color: var(--sidebar-text);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.15); color: #ef4444; }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content-wrapper {
  padding: 28px 32px;
  flex: 1;
}

/* MCP chat */
.mcp-chat-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #f7f8fa;
}

.mcp-context-bar {
  min-height: 54px;
  padding: 8px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mcp-context-bar label { display: flex; align-items: center; gap: 7px; }
.mcp-context-bar label span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.mcp-context-bar select {
  min-width: 150px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.mcp-chat-header {
  min-height: 76px;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mcp-readonly-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}

.mcp-readonly-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.mcp-conversation {
  min-height: 0;
  overflow-y: auto;
  padding: 28px max(24px, calc((100% - 820px) / 2));
}

.mcp-empty-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.mcp-empty-state[hidden] { display: none; }
.mcp-empty-state h2 { font-size: 18px; font-weight: 650; }

.mcp-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.mcp-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  width: min(100%, 420px);
}

.mcp-prompts button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.mcp-prompts button:hover { border-color: #94a3b8; background: #f8fafc; }
.mcp-messages { display: flex; flex-direction: column; gap: 14px; }

.mcp-message {
  width: fit-content;
  max-width: min(78%, 680px);
  padding: 11px 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mcp-message small { display: block; margin-top: 8px; color: var(--text-muted); font-size: 11px; }
.mcp-message-user { align-self: flex-end; background: #172033; color: #fff; }
.mcp-message-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.mcp-message-notice { align-self: flex-start; max-width: 100%; font-size: 12px; }
.mcp-message-warning { background: #fffbeb; color: #854d0e; border: 1px solid #fde68a; }
.mcp-message-loading { color: var(--text-muted); }

.mcp-composer {
  margin: 14px auto 22px;
  width: min(calc(100% - 48px), 820px);
  min-height: 54px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mcp-composer textarea {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 8px 0;
  font: inherit;
  background: transparent;
}

.mcp-send {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 21px;
  cursor: pointer;
}

.mcp-send:disabled { opacity: .45; cursor: wait; }

@media (max-width: 760px) {
  .mcp-chat-header { padding: 14px 18px; }
  .mcp-readonly-status { display: none; }
  .mcp-conversation { padding: 20px 16px; }
  .mcp-composer { width: calc(100% - 32px); margin-bottom: 16px; }
  .mcp-message { max-width: 90%; }
  .mcp-prompts { grid-template-columns: 1fr; }
  .mcp-context-bar { padding: 8px 16px; align-items: stretch; }
  .mcp-context-bar label { flex: 1; flex-direction: column; align-items: stretch; gap: 2px; }
  .mcp-context-bar select { min-width: 0; width: 100%; }
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-body { padding: 20px; }

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Tables ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: #f8f9fc;
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8f9fc; }

tbody td {
  padding: 11px 14px;
  vertical-align: middle;
}

.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f3f4f6; color: #374151; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }

.role-badge-manager { background: #ede9fe; color: #5b21b6; }
.role-badge-devops  { background: #dbeafe; color: #1e40af; }
.role-badge-dev     { background: #dcfce7; color: #166534; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }

.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }

.btn-ghost { background: transparent; color: var(--accent); padding: 6px 10px; }
.btn-ghost:hover { background: #ede9fe; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Flash messages ── */
.flash-container {
  margin-bottom: 20px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.flash-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.modal-overlay [hidden] { display: none !important; }
.flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.flash-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Placeholder badge ── */
.v2-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8f9fc;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  cursor: not-allowed;
}

.v2-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Cloud cards ── */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cloud-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cloud-icon {
  font-size: 28px;
  width: 44px;
  text-align: center;
}

.cloud-name { font-weight: 700; font-size: 15px; }
.cloud-status { font-size: 12px; color: var(--text-muted); }

/* ── Log viewer ── */
.log-line {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 180px 60px 120px 1fr;
  gap: 12px;
  align-items: start;
}

.log-line:hover { background: #f8f9fc; }
.log-ts { color: var(--text-muted); }
.log-level-INFO  { color: var(--info); font-weight: 600; }
.log-level-WARN  { color: var(--warning); font-weight: 600; }
.log-level-ERROR { color: var(--danger); font-weight: 600; }
.log-service { color: var(--accent); }

/* ── Metrics ── */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.metric-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 12px; }
.metric-value { font-size: 36px; font-weight: 800; color: var(--text); line-height: 1; }
.metric-unit { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ── ArgoCD status ── */
.status-synced     { color: var(--success); }
.status-outofsync  { color: var(--warning); }
.status-healthy    { color: var(--success); }
.status-degraded   { color: var(--danger); }
.status-progressing { color: var(--info); }

/* ── Doc layout ── */
.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
}

.doc-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  padding: 8px 0;
}

.doc-sidebar a {
  display: block;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background .1s, color .1s;
}

.doc-sidebar a:hover { background: var(--bg); color: var(--accent); }
.doc-sidebar a.active { background: #ede9fe; color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.doc-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 40px;
  overflow-y: auto;
  line-height: 1.7;
}

.doc-content h1 { font-size: 26px; margin-bottom: 16px; }
.doc-content h2 { font-size: 20px; margin-top: 32px; margin-bottom: 12px; }
.doc-content h3 { font-size: 16px; margin-top: 24px; margin-bottom: 8px; }
.doc-content p  { margin-bottom: 12px; }
.doc-content ul, .doc-content ol { margin-left: 20px; margin-bottom: 12px; }
.doc-content li { margin-bottom: 4px; }
.doc-content code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: monospace; }
.doc-content pre { background: #1e2330; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 16px; }
.doc-content pre code { background: none; color: inherit; padding: 0; }
.doc-content blockquote { border-left: 4px solid var(--border); padding-left: 16px; color: var(--text-muted); margin-bottom: 12px; }
.doc-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.doc-content table th { background: #f8f9fc; padding: 8px 12px; text-align: left; border: 1px solid var(--border); }
.doc-content table td { padding: 8px 12px; border: 1px solid var(--border); }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2330 0%, #2a3042 100%);
}

.login-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.login-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.btn-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #24292e;
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #444d56;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn-github:hover { background: #3a3f45; color: #fff; }

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Error page ── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.error-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  max-width: 480px;
}

.error-code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 12px; }
.error-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.error-message { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Inline form ── */
.inline-form { display: inline; }
.actions-cell { display: flex; gap: 6px; align-items: center; }

/* ── Scale control ── */
.scale-form { display: flex; align-items: center; gap: 6px; }
.scale-form input[type="number"] { width: 60px; padding: 4px 8px; }

/* ── Utility ── */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-8 { gap: 32px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; gap: 8px; }

/* Slash command palette */
.mcp-command-menu { background: var(--bg-secondary, #fff); border: 1px solid #d9e1e8; border-radius: 12px; padding: 8px; margin-bottom: 10px; }
.mcp-command-menu[hidden], .mcp-command-menu button[hidden] { display: none; }
.mcp-command-menu button { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: inherit; }
.mcp-command-menu button:hover, .mcp-command-menu button[aria-selected="true"] { background: #eef4ff; color: #183b69; }
.mcp-command-menu button strong { min-width: 120px; }
.mcp-command-menu button span, .mcp-command-menu p { font-size: 13px; }
.mcp-command-menu p { margin: 8px 12px; color: #64748b; }
.mcp-message { white-space: pre-wrap; }

/* Structured MCP evidence stays readable independently of the generated answer. */
.mcp-tool-result { margin: 12px 0 20px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.mcp-tool-result h3 { margin: 0 0 12px; font-size: 14px; }
.mcp-tool-result table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mcp-tool-result th, .mcp-tool-result td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.mcp-tool-result small, .mcp-tool-result p { color: var(--text-muted); font-size: 12px; }

/* Keep modal actions reachable on short screens and when the browser is zoomed. */
.modal-overlay { padding: 16px; overflow-y: auto; }
.modal-overlay > div {
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  flex-shrink: 0;
}

/* Petite icône « i » avec info-bulle au survol ou au focus (formulaire de déploiement). */
.info-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid var(--text-muted, #888); color: var(--text-muted, #888); font-size: 11px; font-style: italic;
  font-weight: 600; cursor: help; }
.info-tip .info-tip-text { display: none; position: absolute; left: -8px; bottom: 24px; z-index: 20; width: 320px; padding: 10px 12px;
  border-radius: 6px; background: var(--bg-card, #fff); color: var(--text-primary, #111); border: 1px solid var(--border, #ddd);
  box-shadow: 0 4px 16px rgba(0,0,0,.15); font-size: 12px; font-style: normal; font-weight: 400; line-height: 1.45; }
.info-tip:hover .info-tip-text, .info-tip:focus .info-tip-text { display: block; }

/* ── Observabilité : onglets + filtres ── */
.obs-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.obs-tab { padding: 8px 14px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 13.5px; }
.obs-tab:hover { color: var(--text); }
.obs-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.obs-filters { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; margin-bottom: 20px; }
.obs-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.obs-filters select { min-width: 180px; }
.obs-log-message { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.obs-log-line { grid-template-columns: 160px 56px minmax(120px, 190px) 96px 1fr; }
/* Une source inconnue peut avoir un nom long : le badge ne déborde jamais sur le message. */
.obs-log-line .badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.obs-log-head { font-family: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); background: var(--bg, #f8f9fc); }
.obs-custom { gap: 10px; align-items: flex-end; }
.obs-search input { min-width: 260px; }
.obs-th-help { cursor: help; border-bottom: 1px dotted currentColor; }
.obs-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
