/* Admin Console Styles
 * Uses design tokens from tokens.css — do NOT redefine brand colors here.
 * Semantic variable mapping bridges --minxi-* tokens to app-level names.
 */

:root {
  /* === Semantic mapping from minxi design tokens === */
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 56px;

  /* Typography */
  --font-family: var(--minxi-font-family-sans);
  --font-mono: var(--minxi-font-family-mono);
  --font-size-xs: var(--minxi-font-size-xs);
  --font-size-sm: var(--minxi-font-size-sm);
  --font-size-base: var(--minxi-font-size-md);
  --font-size-lg: var(--minxi-font-size-lg);
  --font-size-xl: var(--minxi-font-size-xl);
  --font-size-2xl: var(--minxi-font-size-2xl);
  --font-weight-medium: var(--minxi-font-weight-medium);
  --font-weight-semibold: var(--minxi-font-weight-semibold);
  --font-weight-bold: var(--minxi-font-weight-bold);

  /* Dark theme (admin console is always dark) */
  --background-start: #0a0014;
  --background-end: #0d0a1a;
  --primary-surface: rgba(255, 255, 255, 0.04);
  --secondary-surface: rgba(255, 255, 255, 0.06);
  --text-primary: #f0eef5;
  --text-secondary: #a09cb0;
  --text-on-accent: #ffffff;
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-primary: var(--minxi-color-primary-400);
  --accent-gradient: linear-gradient(135deg, var(--minxi-color-primary-500), var(--minxi-color-primary-400));
  --glow-color: rgba(99, 102, 241, 0.15);

  /* Radii */
  --radius-md: var(--minxi-radius-md);
  --radius-lg: var(--minxi-radius-lg);

  /* Transitions */
  --transition-fast: var(--minxi-transition-fast);
  --transition-base: var(--minxi-transition-normal);

  /* Status colors */
  --color-danger: var(--minxi-color-error-500);
  --color-success: var(--minxi-color-success-500);
  --color-warning: var(--minxi-color-warning-500);
}

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

body {
  font-family: var(--font-family);
  background: linear-gradient(180deg, var(--background-start), var(--background-end));
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Login container */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-form {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  transition: box-shadow var(--transition-base);
}

.login-form:hover {
  box-shadow: 0 0 24px var(--glow-color);
}

.login-form h2 {
  margin: 0 0 0.5rem;
  font-size: var(--font-size-2xl);
  text-align: center;
  color: var(--accent-primary);
}

.login-form .subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
}

.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group select option {
  background: var(--background-start);
  color: var(--text-primary);
}

.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  outline: none;
  resize: vertical;
  min-height: 4rem;
  color-scheme: dark;
}

.form-group textarea:focus {
  border-color: var(--accent-primary);
}

.required {
  color: var(--accent-primary);
  font-weight: 600;
}

.btn-primary {
  padding: 0.5rem 1.5rem;
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  color: var(--color-danger);
  font-size: var(--font-size-sm);
  margin-top: 1rem;
  text-align: center;
  min-height: 1.25rem;
}

/* App shell layout */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent-primary);
}

.sidebar-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-menu {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
}

.nav-item {
  margin: 0;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  border-left: 3px solid transparent;
}

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

.nav-item a.active {
  color: var(--accent-primary);
  background: var(--secondary-surface);
  border-left-color: var(--accent-primary);
}

.nav-item .nav-icon {
  width: 1.25rem;
  text-align: center;
  font-size: var(--font-size-base);
}

.nav-section-label {
  padding: 1rem 1.5rem 0.5rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
}

/* Top-level standalone nav item (Dashboard) */
.nav-item-top {
  margin-bottom: 0.25rem;
}

.nav-item-top a {
  font-weight: var(--font-weight-semibold);
}

/* Collapsible navigation category sections */
.nav-category-section {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem 0.375rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-category-header:hover {
  background: var(--secondary-surface);
}

.nav-category-header:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
  border-radius: 2px;
}

.nav-category-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
}

.nav-category-expanded .nav-category-label {
  color: var(--accent-primary);
}

.nav-category-chevron {
  font-size: 0.625rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  line-height: 1;
}

.nav-category-expanded .nav-category-chevron {
  transform: rotate(90deg);
  color: var(--accent-primary);
}

.nav-category-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.nav-category-expanded .nav-category-items {
  max-height: 500px;
  opacity: 1;
}

.nav-category-collapsed .nav-category-items {
  max-height: 0;
  opacity: 0;
}

.nav-category-items .nav-item a {
  padding-left: 2rem;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.user-info {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

.user-info .user-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.user-info .user-role {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* When the staff profile has loaded, paintUserInfo() wraps the
 * avatar+name+role block in an anchor pointing to the caller's own
 * /internal/users/staff/<profileId> page. Reset native anchor
 * styling (no underline, inherit colour) and add a subtle hover
 * affordance so the click target is discoverable without being
 * loud. */
.user-info-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  padding: 0.25rem 0.4rem;
  margin: -0.25rem -0.4rem 0.5rem;
  transition: background var(--transition-fast);
}
.user-info-link:hover,
.user-info-link:focus-visible {
  background: rgba(168, 85, 247, 0.08);
  outline: none;
}
.user-info-link:focus-visible {
  outline: 2px solid var(--accent-primary, #a855f7);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Read-only mode (lib/permissions.js)
 * ------------------------------------------------------------------
 * Applied to #main-content when the active route is readable but not
 * writable for the current scope set. Visual cues help staff
 * understand why controls aren't responsive — without this, a
 * disabled button looks like a frontend bug.
 * ------------------------------------------------------------------ */
#main-content.read-only {
  position: relative;
}
#main-content.read-only::before {
  content: "Read-only — your scope set doesn't grant write access here";
  position: sticky;
  top: 0;
  z-index: 5;
  display: block;
  background: rgba(251, 191, 36, 0.08);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--color-warning, #fbbf24);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.02em;
  padding: 0.4rem 1rem;
  text-align: center;
}
#main-content.read-only [data-perm-disabled="1"] {
  opacity: 0.55;
  filter: saturate(0.7);
  cursor: not-allowed !important;
}
[data-perm-hidden="1"] {
  display: none !important;
}

/* ---------------------------------------------------------------- *
 * Help overlay — bottom-left "?" button opens this. Shows the
 * read-only procedures library tree + viewer. Authoring lives at
 * Internal -> Procedures (the help overlay is strictly read-only).
 * ---------------------------------------------------------------- */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.help-overlay-panel {
  background: var(--bg-secondary, #161b22);
  color: var(--text-primary);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 0.6rem);
  width: min(1280px, 96vw);
  height: min(900px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transition: width 0.18s ease, height 0.18s ease, border-radius 0.18s ease;
}
.help-overlay.help-overlay-fullscreen {
  padding: 0;
}
.help-overlay-fullscreen .help-overlay-panel {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
}
.help-overlay-tree-search {
  display: block;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  color: var(--text-primary);
  padding: 0.4rem 0.6rem;
  border-radius: 0.35rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}
.help-overlay-tree-search:focus {
  outline: none;
  border-color: var(--color-primary, #818cf8);
}
.help-overlay-tree .help-tree-section-empty {
  display: none;
}
.help-overlay-tree li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.help-overlay-tree li > a {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}
.help-overlay-tree li.help-tree-active a {
  background: rgba(99,102,241,0.15);
  border-left: 3px solid var(--color-primary, #818cf8);
}
.help-overlay-tree mark {
  background: rgba(250,204,21,0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.help-tree-pin {
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.95rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.help-tree-pin:hover {
  color: #facc15;
  background: rgba(250,204,21,0.08);
}
.help-tree-pin.is-pinned {
  color: #facc15;
}
.help-tree-entry-title {
  display: block;
}
.help-tree-entry-section {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.05rem;
}
.help-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.02);
}
.help-overlay-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--font-weight-semibold, 600);
  letter-spacing: 0.01em;
}
.help-overlay-close,
.help-overlay-fs {
  background: transparent;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  color: var(--text-secondary);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.help-overlay-fs {
  font-size: 0.95rem; /* the ⤢/⤡ glyphs render slightly larger than × */
}
.help-overlay-close:hover,
.help-overlay-fs:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.08);
}
.help-overlay-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}
/* Narrow device / phone — the side-by-side 280px + 1fr layout
 * collapses the viewer to nothing. Stack vertically: tree on top
 * (capped at 35vh + own scroll), viewer below taking the rest.
 * Triggers below the smallest tablet width so phones in portrait
 * AND landscape both get the stacked layout. */
@media (max-width: 720px) {
  .help-overlay-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, auto) 1fr;
  }
  .help-overlay-tree {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    max-height: 35vh;
  }
  /* Compact-mode panel on phones is essentially full-bleed already
   * (96vw × 92vh) — no point rounding the corners or adding a
   * surrounding gap; staff just want the procedure on screen. */
  .help-overlay-panel {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
    max-height: 100vh;
  }
}
.help-overlay-tree {
  border-right: 1px solid var(--border-color, rgba(255,255,255,0.08));
  overflow-y: auto;
  padding: 0.75rem;
  font-size: 0.875rem;
  background: rgba(255,255,255,0.01);
}
.help-overlay-tree h3 {
  margin: 0.75rem 0 0.4rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-medium, 500);
}
.help-overlay-tree h3:first-child {
  margin-top: 0;
}
.help-overlay-tree ul {
  list-style: none;
  margin: 0 0 0.75rem 0;
  padding: 0;
}
.help-overlay-tree li {
  margin: 0.1rem 0;
}
.help-overlay-tree a {
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm, 0.3rem);
  transition: background var(--transition-fast);
}
.help-overlay-tree a:hover {
  background: rgba(168, 85, 247, 0.08);
  color: var(--accent-primary, #a855f7);
}
.help-overlay-viewer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden; /* doc-host owns scroll via __MinxiDocsRenderer.mountIframe */
}
.help-overlay-viewer h2 {
  margin-top: 0;
  font-size: 1.25rem;
}
.help-overlay-viewer .docs-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.help-overlay-doc-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}
.help-overlay-doc-header h2 {
  margin: 0;
}
.help-overlay-doc-host {
  flex: 1;
  min-height: 0;
  overflow-y: auto; /* mountIframe sets this too, belt-and-braces */
  background: var(--surface-base, #0c0717);
}

/* ---------------------------------------------------------------- *
 * Internal Assistant — top-right floating trigger + slide-out panel.
 * Grounded in the procedures library + staff identity (see
 * worker/internal_assistant.chat). Strictly internal: no customer
 * data, no codebase research surface.
 * ---------------------------------------------------------------- */
.assistant-trigger {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.06));
  color: var(--accent-primary, #a855f7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.assistant-trigger:hover {
  transform: translateY(-1px);
  border-color: var(--accent-primary, #a855f7);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.32);
}
.assistant-trigger:focus-visible {
  outline: 2px solid var(--accent-primary, #a855f7);
  outline-offset: 2px;
}
.assistant-trigger .assistant-trigger-glyph {
  position: relative;
  z-index: 2;
  font-weight: 600;
  letter-spacing: 0;
}
.assistant-trigger .assistant-trigger-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.18);
  opacity: 0;
  animation: assistant-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes assistant-pulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.assistant-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: var(--bg-secondary, #161b22);
  border-left: 1px solid var(--border-color, rgba(255,255,255,0.08));
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
}
.assistant-panel.is-open {
  transform: translateX(0);
}
.assistant-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.02);
}
.assistant-panel-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: var(--font-weight-semibold, 600);
  font-size: 0.95rem;
}
.assistant-panel-subtitle {
  font-weight: var(--font-weight-regular, 400);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}
.assistant-panel-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-primary, #a855f7);
  font-size: 0.85rem;
  align-self: center;
  position: relative;
  transition: box-shadow 0.3s ease;
}
/* Pulse the panel header glyph + a thin border ring while Min is
 * thinking, so the panel stays "alive" between turns even before
 * any text streams in. */
.assistant-panel.is-busy .assistant-panel-glyph {
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.55);
  animation: assistant-glyph-pulse 1.4s ease-out infinite;
}
@keyframes assistant-glyph-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(168, 85, 247, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(168, 85, 247, 0);    }
}

/* Inline "Min is thinking…" indicator — shown in the message body
 * when a turn is in flight but no streaming events have arrived yet
 * (e.g. while the worker boots the agentic loop, fetches the MCP
 * tool list, or is mid-request waiting for Anthropic). */
.assistant-thinking {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}
.assistant-thinking-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-primary, #a855f7);
  font-size: 0.75rem;
  font-weight: 500;
}
.assistant-thinking-dots {
  display: inline-flex;
  gap: 3px;
}
.assistant-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary, #a855f7);
  opacity: 0.45;
  animation: assistant-thinking-dot 1.2s ease-in-out infinite;
}
.assistant-thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.assistant-thinking-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-thinking-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}
.assistant-thinking-label {
  font-style: italic;
}
.assistant-trigger .assistant-trigger-glyph {
  /* Override base: 敏 (Min) needs slightly different sizing to look right
     compared to the original ✦ glyph. */
  font-size: 1rem;
  font-weight: 500;
}
.assistant-panel-close {
  background: transparent;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  color: var(--text-secondary);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.assistant-panel-close:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.08);
}
.assistant-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.assistant-empty {
  color: var(--text-tertiary);
  padding: 1.5rem 0.5rem;
}
.assistant-empty p {
  margin: 0 0 0.5rem 0;
}
.assistant-empty-hint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 0.75rem;
}
.assistant-msg {
  margin-bottom: 1rem;
}
.assistant-msg-role {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
  font-weight: var(--font-weight-medium, 500);
}
.assistant-msg.is-user .assistant-msg-role {
  color: var(--accent-primary, #a855f7);
}
.assistant-msg-body {
  color: var(--text-primary);
}
.assistant-msg-body p {
  margin: 0 0 0.5rem 0;
}
.assistant-msg-body p:last-child {
  margin-bottom: 0;
}
.assistant-msg.is-user .assistant-msg-body {
  color: var(--text-secondary);
}
.assistant-code {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm, 0.3rem);
  padding: 0.5rem 0.6rem;
  margin: 0.4rem 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-x: auto;
}
.assistant-code code {
  background: transparent !important;
  padding: 0 !important;
  font-family: inherit;
  color: var(--text-primary);
}
.assistant-inline-code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.85em;
}
/* Tool-call badge — Min calling an MCP tool. Renders inline within an
 * assistant message body alongside text segments. The whole badge is
 * a <details> — collapsed by default. The summary stays one line
 * (glyph · name · status pill); expand to see args + result. */
.assistant-tool-badge {
  margin: 0.5rem 0;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: var(--radius-md, 0.4rem);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  overflow: hidden;
}
.assistant-tool-badge.is-running {
  border-color: rgba(168, 85, 247, 0.35);
}
.assistant-tool-badge.is-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.04);
}
.assistant-tool-badge.is-empty {
  /* No args + no result yet — disable the open affordance.
   * <details> without a clickable summary cursor keeps the UI calm. */
}
.assistant-tool-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.assistant-tool-head::-webkit-details-marker { display: none; }
.assistant-tool-head::marker { content: ""; }
.assistant-tool-badge.is-empty .assistant-tool-head {
  cursor: default;
}
.assistant-tool-head::before {
  content: "▸";
  display: inline-block;
  width: 0.75em;
  font-size: 0.7em;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}
.assistant-tool-badge[open] > .assistant-tool-head::before {
  transform: rotate(90deg);
}
.assistant-tool-badge.is-empty > .assistant-tool-head::before {
  visibility: hidden;
}
.assistant-tool-glyph {
  color: var(--accent-primary, #a855f7);
  opacity: 0.8;
}
.assistant-tool-name {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.85em;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium, 500);
}
.assistant-tool-status {
  margin-left: auto;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}
.assistant-tool-badge.is-running .assistant-tool-status {
  color: var(--accent-primary, #a855f7);
}
.assistant-tool-badge.is-error .assistant-tool-status {
  color: var(--color-danger, #f87171);
}
.assistant-tool-body {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.15);
}
.assistant-tool-section {
  margin-bottom: 0.6rem;
}
.assistant-tool-section:last-child {
  margin-bottom: 0;
}
.assistant-tool-section-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
  font-weight: var(--font-weight-medium, 500);
}
.assistant-tool-section pre {
  margin: 0;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm, 0.3rem);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 18em;
  overflow-y: auto;
  color: var(--text-secondary);
}
.assistant-panel-form {
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.01);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.assistant-panel-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  color: var(--text-primary);
  border-radius: var(--radius-md, 0.4rem);
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  max-height: 200px;
  transition: border-color var(--transition-fast);
}
.assistant-panel-input:focus {
  outline: none;
  border-color: var(--accent-primary, #a855f7);
}
.assistant-panel-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.assistant-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.assistant-panel-hint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}
.assistant-panel-send {
  background: var(--accent-primary, #a855f7);
  border: none;
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md, 0.4rem);
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium, 500);
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.assistant-panel-send:hover:not(:disabled) {
  opacity: 0.9;
}
.assistant-panel-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Header controls (Safe Mode + Fullscreen + Close) -------------------
 * The right-hand cluster in the panel header. Pills sit next to the close
 * button and reflect persisted state via aria-pressed. */
.assistant-panel-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.assistant-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  height: 26px;
  background: transparent;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  color: var(--text-tertiary);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast),
              background var(--transition-fast);
}
.assistant-panel-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary, #a855f7);
}
.assistant-panel-toggle[data-fullscreen] {
  width: 26px;
  padding: 0;
  justify-content: center;
}
.assistant-panel-toggle .assistant-toggle-glyph {
  font-size: 0.85rem;
  line-height: 1;
}
.assistant-panel-toggle .assistant-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  box-shadow: 0 0 0 0 transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.assistant-panel-toggle.is-on {
  color: #4ade80; /* green-400 */
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}
.assistant-panel-toggle.is-on .assistant-toggle-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

/* ---- Fullscreen overlay mode --------------------------------------------
 * IMPORTANT: every overlay rule is scoped under `.is-open.is-fullscreen`
 * (not just `.is-fullscreen`). When close() drops `is-open`, the
 * overrides fall away and the base `transform: translateX(100%)` slides
 * the panel offscreen — otherwise the close button would appear to do
 * nothing because `.is-fullscreen { transform: none }` would keep the
 * panel visible. */
.assistant-panel.is-open.is-fullscreen {
  /* Fill the viewport with a centred max-width modal-like surface. */
  top: 4vh;
  right: 4vw;
  bottom: 4vh;
  left: 4vw;
  width: auto;
  height: auto;
  max-width: 1100px;
  margin: 0 auto;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 0.6rem);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 9999px rgba(0, 0, 0, 0.55);
  /* Reset the slide-in transform so the overlay just appears in place. */
  transform: none;
}
.assistant-panel.is-open.is-fullscreen .assistant-panel-body {
  font-size: 0.95rem;
  padding: 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.assistant-panel.is-open.is-fullscreen .assistant-panel-form {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
/* Keep the header controls (close + toggles) reliably clickable in the
 * wider overlay — the controls cluster never shrinks below its content. */
.assistant-panel-controls {
  flex-shrink: 0;
}
.assistant-panel-controls .assistant-toggle-label {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .assistant-panel.is-open.is-fullscreen {
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: 0;
    max-width: none;
  }
}

/* ---- Dry-run flagging on tool badges ----------------------------------- */
.assistant-tool-badge.is-dryrun {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.05);
}
.assistant-tool-badge.is-dryrun .assistant-tool-status {
  color: #4ade80;
  font-weight: var(--font-weight-medium, 500);
}
.assistant-tool-badge.is-dryrun .assistant-tool-glyph {
  color: #4ade80;
}

/* ---- Markdown content (rendered by marked.esm) -------------------------- */
.assistant-msg-body h1,
.assistant-msg-body h2,
.assistant-msg-body h3,
.assistant-msg-body h4 {
  margin: 0.8em 0 0.35em 0;
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.3;
  color: var(--text-primary);
}
.assistant-msg-body h1 { font-size: 1.1rem; }
.assistant-msg-body h2 { font-size: 1.0rem; }
.assistant-msg-body h3 { font-size: 0.95rem; }
.assistant-msg-body h4 { font-size: 0.9rem; }
.assistant-msg-body ul,
.assistant-msg-body ol {
  margin: 0.4em 0 0.6em 0;
  padding-left: 1.4em;
}
.assistant-msg-body li {
  margin: 0.15em 0;
}
.assistant-msg-body li > p {
  margin: 0;
}
.assistant-msg-body a {
  color: var(--accent-primary, #a855f7);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.assistant-msg-body a:hover {
  color: var(--accent-secondary, #c084fc);
}
.assistant-msg-body blockquote {
  margin: 0.5em 0;
  padding: 0.4em 0.8em;
  border-left: 3px solid var(--accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.06);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm, 0.3rem) var(--radius-sm, 0.3rem) 0;
}
.assistant-msg-body hr {
  margin: 0.8em 0;
  border: 0;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.assistant-msg-body table {
  border-collapse: collapse;
  margin: 0.5em 0;
  font-size: 0.85em;
  width: 100%;
}
.assistant-msg-body th,
.assistant-msg-body td {
  padding: 0.35em 0.6em;
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  text-align: left;
  vertical-align: top;
}
.assistant-msg-body th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: var(--font-weight-semibold, 600);
}
/* marked emits <pre><code> for fenced code blocks — match the existing
 * .assistant-code styling so plaintext-fallback output and marked output
 * look identical. */
.assistant-msg-body pre {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm, 0.3rem);
  padding: 0.5rem 0.6rem;
  margin: 0.4rem 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-x: auto;
}
.assistant-msg-body pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
  color: var(--text-primary);
}
.assistant-msg-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.85em;
}

#main-content.read-only button[data-perm-disabled="1"]:hover,
#main-content.read-only input[data-perm-disabled="1"]:hover,
#main-content.read-only select[data-perm-disabled="1"]:hover,
#main-content.read-only textarea[data-perm-disabled="1"]:hover {
  /* no hover effect on disabled controls */
  filter: saturate(0.7);
}

/* Sidebar footer "Docs" trigger — sits between #user-info and #logout-btn,
 * matches the visual weight of .btn-logout (full-width row, soft border,
 * hover highlight). The "?" glyph is a coloured chip; the right edge shows
 * the keyboard shortcut hint (also "?"). Click → opens the help-overlay
 * (lib/help-overlay.js). */
.help-icon-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.help-icon-trigger:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.06);
}
.help-icon-trigger:focus-visible {
  outline: 2px solid var(--accent-primary, #a855f7);
  outline-offset: 2px;
}
.help-icon-trigger .help-icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-primary, #a855f7);
  font-weight: 600;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.help-icon-trigger .help-icon-label {
  flex: 1;
  text-align: left;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.01em;
}
.help-icon-trigger .help-icon-shortcut {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  flex-shrink: 0;
}

/* Sidebar footer "Workspace" trigger — sits between #help-trigger
 * and #logout-btn. Opens workspace.minxi.ai in a new tab; the bare
 * workspace domain runs its own switcher (greets the caller by name
 * and lists the orgs they belong to with a 5-second auto-route to
 * their default — typically their Personal org). Matches
 * .help-icon-trigger's silhouette so the three footer rows read as
 * a coherent stack. The glyph is "↗" to signal "opens elsewhere"
 * since this is a cross-domain navigation, not an in-page action. */
.workspace-icon-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.workspace-icon-trigger:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.06);
}
.workspace-icon-trigger:focus-visible {
  outline: 2px solid var(--accent-primary, #a855f7);
  outline-offset: 2px;
}
.workspace-icon-trigger .workspace-icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-primary, #a855f7);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}
.workspace-icon-trigger .workspace-icon-label {
  flex: 1;
  text-align: left;
  font-weight: var(--font-weight-medium, 500);
  letter-spacing: 0.01em;
}

.btn-logout {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

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

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  height: 100vh;
  overflow-y: auto;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  margin: 0 0 0.25rem;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.page-header .page-description {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* Dashboard cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: rgba(255, 192, 203, 0.4);
  box-shadow: 0 0 24px var(--glow-color);
}

.card-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

.card-value {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

/* Status indicators */
.status-healthy {
  color: var(--color-success);
}

.status-warning {
  color: var(--color-warning);
}

.status-error {
  color: var(--color-danger);
}

.status-error-pulse {
  color: var(--color-danger);
  animation: pulse-danger 2s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-info {
  color: var(--color-info, #60a5fa);
}

/* Data table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  min-width: 600px;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Loading state */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

.filter-select {
  padding: 0.5rem 0.75rem;
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.filter-select option {
  background: var(--background-start);
  color: var(--text-primary);
}

.filter-select:focus {
  border-color: var(--accent-primary);
}

.search-group {
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-primary);
}

/* Card header row */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-header-row .card-title {
  margin-bottom: 0;
}

/* Buttons */
.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}

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

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

.btn-action:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

/* AI Suggest inline status */
/* Server type icons */
.st-icon {
  border-radius: var(--radius-sm, 4px);
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px;
}

.st-icon-sm {
  width: 20px;
  height: 20px;
}

.st-icon-md {
  width: 28px;
  height: 28px;
}

.st-icon-lg {
  width: 36px;
  height: 36px;
}

.st-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 4px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}

.st-icon-fallback.st-icon-lg {
  font-size: var(--font-size-base);
}

.suggest-status {
  margin-left: 0.75rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  transition: opacity 0.15s ease, color 0.3s ease;
  opacity: 1;
}

.suggest-status.suggest-fade-out {
  opacity: 0;
}

.suggest-status.suggest-ok {
  color: var(--accent-primary, #34d399);
}

.suggest-status.suggest-warn {
  color: var(--warning, #fbbf24);
}

.suggest-status.suggest-fail {
  color: var(--danger, #f87171);
}

.suggest-status.suggest-thinking {
  color: var(--text-secondary);
  font-style: italic;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
  font-family: var(--font-family);
}

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

.btn-danger {
  padding: 0.5rem 1.5rem;
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
}

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

.btn-danger-permanent {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-warning {
  padding: 0.5rem 1.5rem;
  background: transparent;
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
}

.btn-warning:hover {
  background: var(--color-warning);
  color: white;
}

.btn-success {
  padding: 0.5rem 1.5rem;
  background: transparent;
  color: #4ade80;
  border: 1px solid #4ade80;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
}

.btn-success:hover {
  background: #4ade80;
  color: #0f172a;
}

.btn-save {
  width: auto;
  padding: 0.5rem 1.5rem;
}

.btn-back {
  padding: 0.375rem 0.75rem;
  font-size: var(--font-size-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: capitalize;
}

.badge-pricing { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-allocations { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-thresholds { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-features { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-default { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-cloud { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-robotics { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-iot { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-custom { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-plan-free { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-plan-starter { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-plan-professional { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-plan-enterprise { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-plan-business { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-plan-agency { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-tier-basic { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-tier-standard { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-tier-premium { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-tier-enterprise { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Staff role badges */
.badge-role-core_admin { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-role-operations { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-role-support { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-role-finance { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-role-marketing { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-role-unknown { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Status badges (active/inactive) */
.badge-active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-inactive { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Catalog addon badges (audit-03e batch 25) — used in the orgs listing
 * Catalog column and the detail page at-a-glance strip. Colors echo the
 * legacy badge-plan-* palette for visual consistency. */
.badge-addon-enterprise { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-addon-agency     { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-addon-developer  { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* Activity tags — mirrors the listing's ?activity= filter buckets so the
 * detail header can surface the same classification. */
.badge-activity-active { background: rgba(34, 197, 94, 0.15);  color: #4ade80; }
.badge-activity-idle   { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-activity-new    { background: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
.badge-activity-empty  { background: rgba(239, 68, 68, 0.15);   color: #f87171; }

/* Detail card (staff detail, etc.) */
.detail-card {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 600px;
}

.detail-row {
  display: flex;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

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

.detail-label {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.detail-value {
  flex: 1;
  color: var(--text-primary);
}

.detail-mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  max-width: 600px;
}

.detail-actions .btn-primary,
.detail-actions .btn-danger,
.detail-actions .btn-success {
  width: auto;
  padding: 0.5rem 1.5rem;
}

/* Form card (inline forms on dedicated pages) */
.form-card {
  max-width: 500px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
  width: auto;
  padding: 0.5rem 1.5rem;
}

/* Clickable table rows */
.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: capitalize;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.modal-content {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Dialog system — animations and variants */
.dialog-overlay {
  /* Confirmation / alert dialogs ALWAYS sit above any other modal
     (page-level detail modals, picker modals, social-compose previews,
     etc.). Without this they inherit `.modal { z-index:100 }` and end
     up behind larger detail sheets that use a higher inline z-index. */
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.15s ease;
  backdrop-filter: blur(2px);
}

.dialog-overlay.dialog-visible {
  opacity: 1;
}

.dialog-overlay.dialog-closing {
  opacity: 0;
}

.dialog-content {
  transform: scale(0.95) translateY(8px);
  transition: transform 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.dialog-visible .dialog-content {
  transform: scale(1) translateY(0);
}

.dialog-closing .dialog-content {
  transform: scale(0.95) translateY(8px);
}

.dialog-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.dialog-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Variant colors */
.dialog-danger .dialog-icon { color: var(--danger, #e74c3c); }
.dialog-danger .dialog-header { border-bottom-color: rgba(231, 76, 60, 0.3); }

.dialog-warning .dialog-icon { color: var(--warning, #f0ad4e); }
.dialog-warning .dialog-header { border-bottom-color: rgba(240, 173, 78, 0.3); }

.dialog-success .dialog-icon { color: var(--success, #27ae60); }
.dialog-success .dialog-header { border-bottom-color: rgba(39, 174, 96, 0.3); }

.dialog-info .dialog-icon { color: var(--accent-primary, #3b82f6); }

.dialog-message {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Type-to-confirm field */
.dialog-confirm-field {
  margin-top: 1.25rem;
}

.dialog-confirm-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.dialog-confirm-label strong {
  color: var(--danger, #e74c3c);
  font-family: monospace;
  letter-spacing: 0.5px;
}

.dialog-confirm-input {
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 420px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md, 8px);
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  transform: translateX(calc(100% + 1rem));
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-leaving {
  transform: translateX(calc(100% + 1rem));
  opacity: 0;
}

.toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toast-success { border-left: 3px solid var(--success, #27ae60); }
.toast-success .toast-icon { color: var(--success, #27ae60); }

.toast-error { border-left: 3px solid var(--danger, #e74c3c); }
.toast-error .toast-icon { color: var(--danger, #e74c3c); }

.toast-warning { border-left: 3px solid var(--warning, #f0ad4e); }
.toast-warning .toast-icon { color: var(--warning, #f0ad4e); }

.toast-info { border-left: 3px solid var(--accent-primary, #3b82f6); }
.toast-info .toast-icon { color: var(--accent-primary, #3b82f6); }

.toast-text {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.125rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

/* Form inputs inside modals */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

/* Audit-03e batch 28 — outer org-detail tab strip stays visible while
 * scrolling long content (Ledger pages, Recipes lists). Sticky requires
 * a solid background so content doesn't bleed through. */
.tab-bar.tab-bar-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--primary-bg, #0f1115);
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Audit-03e batch 28 — segmented control variant for second-level tabs
 * inside an outer .tab-bar (e.g. Wallets sub-views: Summary / Ledger /
 * Reserves / Withdrawals inside the Wallets tab of the org detail page).
 * Visually distinct from the underline-style outer tabs so the hierarchy
 * is unambiguous. */
.tab-bar.tab-bar-segmented {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  background: var(--surface-hover, rgba(255, 255, 255, 0.02));
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-bar.tab-bar-segmented .tab-btn {
  padding: 0.4rem 0.9rem;
  border-bottom: none;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.tab-bar.tab-bar-segmented .tab-btn:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.04));
}

.tab-bar.tab-bar-segmented .tab-btn.active {
  background: var(--accent-primary);
  color: var(--bg-on-accent, #0f1115);
  border-bottom-color: transparent;
}

/* Config specific */
.config-key {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.config-value {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  transition: color var(--transition-fast);
}

.config-value:hover {
  color: var(--accent-primary);
}

/* Config page — collapsible sections */
.config-section {
  margin-bottom: 0.5rem;
  padding: 0;
}

.config-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.config-section-header:hover {
  background: var(--secondary-surface);
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.config-section-chevron {
  font-size: 0.625rem;
  color: var(--text-secondary);
  width: 1rem;
  text-align: center;
}

.config-section-icon {
  font-size: 1rem;
}

.config-section-body {
  border-top: 1px solid var(--border-color);
}

/* Config entry row */
.config-entry {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) minmax(120px, 2fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.config-entry:last-child {
  border-bottom: none;
}

.config-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

.config-entry-key {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.config-key-prefix {
  color: var(--text-secondary);
}

.config-key-name {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.config-entry-value {
  min-width: 0;
}

.config-entry-meta {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-entry-actions {
  text-align: right;
}

/* Unset config entries */
.config-entry-unset {
  opacity: 0.65;
}

.config-entry-unset:hover {
  opacity: 1;
}

.config-value-unset {
  font-style: italic;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  cursor: default;
}

.config-key-desc {
  display: block;
  font-family: var(--font-sans, sans-serif);
  font-size: 0.625rem;
  font-weight: normal;
  color: var(--text-secondary);
  margin-top: 0.125rem;
  opacity: 0.8;
}

.config-hint {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

/* Audit trail table */
.config-audit-table {
  table-layout: auto;
}

.config-audit-table th:nth-child(1) { width: 120px; white-space: nowrap; }
.config-audit-table th:nth-child(2) { width: 120px; }
.config-audit-table th:nth-child(3) { width: 220px; }
.config-audit-table th:nth-child(4) { }

.config-audit-user {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-xs);
}

.config-audit-row {
  cursor: default;
}

.config-audit-reason-cell {
  overflow: hidden;
}

.config-audit-reason {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  display: inline;
  margin-right: 0.5rem;
}

.config-audit-detail-toggle {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  opacity: 0.6;
  vertical-align: middle;
}

.config-audit-detail-toggle:hover {
  opacity: 1;
}

.config-audit-detail-row > td {
  padding: 0 1rem 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.015);
}

.config-audit-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  max-width: 700px;
}

.config-audit-val-group {
  min-width: 0;
}

.config-audit-val-label {
  display: block;
  font-size: 0.625rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.config-audit-val-pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Value popover */
.config-popover {
  position: absolute;
  z-index: 1000;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  min-width: 200px;
}

.config-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.config-popover-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.config-popover-close:hover {
  color: var(--text-primary);
}

.config-popover-content {
  padding: 0.75rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* Type badge in edit modal */
.config-type-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-md);
  font-size: 0.625rem;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  vertical-align: middle;
  margin-left: 0.375rem;
}

/* Toggle switch */
.config-toggle {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0;
  margin-bottom: 0;
}

.config-toggle input {
  display: none;
}

.config-toggle-slider {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.config-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.config-toggle input:checked + .config-toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.config-toggle input:checked + .config-toggle-slider::after {
  transform: translateX(18px);
  background: white;
}

.config-toggle-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* JSON editor */
.config-json-editor {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  line-height: 1.6;
  min-height: 120px;
  tab-size: 2;
}

/* Validation message */
.config-validation-msg {
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
}

/* Config audit header with search */
.config-audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
}

/* Config pagination */
.config-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.config-pagination-info {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  min-width: 80px;
  text-align: center;
}

/* Config mini-form for structured objects */
.config-fields-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-field-row {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  gap: 0.5rem;
  align-items: center;
}

.config-field-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-align: right;
  padding-right: 0.25rem;
}

.config-field-input {
  padding: 0.5rem 0.75rem;
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  transition: border-color var(--transition-fast);
}

.config-field-input:focus {
  border-color: var(--accent-primary);
  outline: none;
}

.config-field-input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

/* Inline structured value display */
.config-value-fields {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 200px;
  overflow: hidden;
}

.config-value-chip {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.config-value-chip-key {
  color: var(--text-secondary);
}

.config-value-chip-val {
  color: var(--text-primary);
}

/* Detail sections */
.detail-section {
  margin-top: 1.5rem;
}

.form-section {
  padding: 0.5rem 0;
}

/* Danger zone */
.card-danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.danger-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Note composer */
.note-composer {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.note-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.note-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.note-input:disabled {
  opacity: 0.6;
}

.note-composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.note-hint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary, var(--text-secondary));
}

/* Notes */
.note-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.note-item:last-child {
  border-bottom: none;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

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

.note-date {
  color: var(--text-secondary);
}


.note-actions {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.note-item:hover .note-actions {
  opacity: 1;
}

.note-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-size-xs);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.note-action-btn:hover {
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
}

.note-action-delete:hover {
  color: var(--danger, #e74c3c);
  background: rgba(231, 76, 60, 0.1);
}

.note-body {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.note-editing {
  white-space: normal;
}

.note-edit-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
  box-sizing: border-box;
}

.note-edit-input:focus {
  outline: none;
}

.note-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Links */
.link-text {
  color: var(--accent-primary);
  text-decoration: none;
  cursor: pointer;
}

.link-text:hover {
  text-decoration: underline;
}

/* Cell subtitle */
.cell-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* SQL preview */
.sql-section {
  margin-bottom: 1.5rem;
}

.sql-section h4 {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.sql-preview {
  background: var(--background-start);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Warning text */
.text-warning {
  color: var(--color-warning);
  font-size: var(--font-size-sm);
  margin-top: 0.5rem;
}

/* Deploy + Error item styles are in the Monitoring Page section below */

/* Data table hover */
.data-table tbody tr:hover {
  background: var(--secondary-surface);
}

/* Row selection */
.data-table tbody tr.row-selected {
  background: rgba(var(--minxi-accent-primary-rgb, 139, 92, 246), 0.12);
}

.data-table tbody tr.row-selected:hover {
  background: rgba(var(--minxi-accent-primary-rgb, 139, 92, 246), 0.18);
}

.data-table tbody tr.org-row {
  cursor: pointer;
}

/* Checkbox column */
.th-checkbox,
.td-checkbox {
  width: 40px;
  text-align: center;
}

.td-checkbox input[type="checkbox"],
.th-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent-primary);
}

/* Sortable column headers */
.th-sortable {
  cursor: pointer;
  user-select: none;
}

.th-sortable:hover {
  color: var(--text-primary);
}

.sort-icon {
  margin-left: 0.25rem;
  font-size: var(--font-size-xs);
}

.sort-icon.sort-inactive {
  opacity: 0.3;
}

.sort-icon.sort-active {
  opacity: 1;
  color: var(--accent-primary);
}

/* Bulk actions bar */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  margin-bottom: 0.75rem;
  background: rgba(var(--minxi-accent-primary-rgb, 139, 92, 246), 0.1);
  border: 1px solid rgba(var(--minxi-accent-primary-rgb, 139, 92, 246), 0.3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.bulk-count {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-right: 0.5rem;
}

/* Table info (row count) */
.table-info {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Pagination bar */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.pagination-ellipsis {
  padding: 0 0.25rem;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.pagination-info {
  margin-left: 1rem;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Disabled button */
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* SSE connection indicator */
.sse-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.sse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: inline-block;
}

.sse-indicator.sse-connected {
  background: var(--color-success);
  box-shadow: 0 0 4px var(--color-success);
}

.sse-indicator.sse-connecting,
.sse-indicator.sse-reconnecting {
  background: var(--color-warning);
  animation: sse-pulse 1.5s ease-in-out infinite;
}

.sse-indicator.sse-disconnected {
  background: var(--text-secondary);
}

@keyframes sse-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Keyboard shortcuts help */
.kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  background: var(--secondary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  line-height: 1.4;
}

.shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.shortcuts-panel {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.shortcuts-panel h3 {
  margin: 0 0 1rem;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.shortcut-keys {
  display: flex;
  gap: 0.25rem;
}

.shortcut-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.shortcuts-section-title {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Skip to content link (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  padding: 0.75rem 1.5rem;
  z-index: 300;
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible styles (accessibility) */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

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

/* High contrast mode support */
@media (forced-colors: active) {
  .status-badge,
  .badge {
    border: 1px solid currentColor;
  }

  .sse-indicator {
    border: 1px solid currentColor;
  }

  .nav-item a.active {
    border-left-color: Highlight;
  }
}

/* === Monitoring Page === */

/* Two-column grid for monitoring panels */
.mon-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Metrics mini-cards grid (database metrics) */
.mon-metrics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.mon-metric,
.mon-metric-card {
  flex: 1 1 160px;
  max-width: 220px;
  background: var(--secondary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: center;
}

.mon-metric-value {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.mon-metric-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Section labels inside cards */
.mon-section-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  margin: 1rem 0 0.5rem;
}

/* Compact table variant */
.mon-compact-table {
  min-width: auto;
  font-size: var(--font-size-xs);
}

.mon-compact-table th,
.mon-compact-table td {
  padding: 0.5rem 0.6rem;
}

/* Service type badges */
.mon-badge-type-web {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.mon-badge-type-worker {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* Service status badges */
.mon-badge-status-healthy {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.mon-badge-status-degraded {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.mon-badge-status-down {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.mon-badge-status-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* Error severity badges */
.mon-badge-severity-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.mon-badge-severity-error {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.mon-badge-severity-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.mon-badge-severity-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Queue failure items */
.mon-failure-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.mon-failure-item:last-child {
  border-bottom: none;
}

.mon-failure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.mon-failure-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

/* Deploy items */
.deploy-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
}

.deploy-item:last-child {
  border-bottom: none;
}

.deploy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deploy-service {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.deploy-meta {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Queue accordion groups */
.queue-accordion {
  margin-bottom: 0.5rem;
}
.queue-accordion-btn {
  width: 100%;
  text-align: left;
  background: var(--secondary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: background 0.15s;
}
.queue-accordion-btn:hover {
  background: var(--hover-bg, rgba(255,255,255,0.05));
}
.queue-accordion-arrow {
  font-size: 0.65rem;
  color: var(--text-secondary);
  transition: transform 0.15s;
  display: inline-block;
  width: 0.75rem;
}
.queue-accordion-summary {
  margin-left: auto;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: normal;
}
.queue-accordion-body {
  padding: 0.25rem 0 0;
}
.mon-badge-queue {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  background: var(--secondary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Error items */
.error-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-color);
}

.error-item:last-child {
  border-bottom: none;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.error-service {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.error-time {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-left: auto;
}

.error-message {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 0.25rem;
  word-break: break-word;
}

/* Koyeb Infrastructure */
.koyeb-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.koyeb-service-card {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: box-shadow var(--transition-fast);
}

.koyeb-service-card:hover {
  box-shadow: 0 0 12px var(--glow-color);
}

.koyeb-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.koyeb-service-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.koyeb-badges {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.koyeb-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: var(--font-size-sm);
}

.koyeb-info-label {
  color: var(--text-secondary);
}

.koyeb-info-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.koyeb-metrics-btn {
  margin-top: 0.75rem;
  width: 100%;
}

.koyeb-metrics {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.koyeb-period-selector {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.koyeb-period-btn {
  padding: 0.375rem 1rem;
  font-size: var(--font-size-xs);
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.koyeb-period-btn:last-child {
  border-right: none;
}

.koyeb-period-btn:hover {
  background: var(--secondary-surface);
  color: var(--text-primary);
}

.koyeb-period-active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.koyeb-period-active:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.mon-badge-status-starting {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.mon-badge-status-paused {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

/* Sleeping = scale-to-zero idle, a healthy state. Slightly cooler
   tone than HEALTHY so staff can tell them apart at a glance. */
.mon-badge-status-sleeping {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
}

/* External Services */
.ext-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ext-service-card {
  background: var(--primary-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: box-shadow var(--transition-fast);
}

.ext-service-card:hover {
  box-shadow: 0 0 12px var(--glow-color);
}

.ext-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ext-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ext-dot-healthy {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.ext-dot-inactive {
  background: #6b7280;
}

.ext-dot-warning {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
}

.ext-dot-down {
  background: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
}

.ext-card-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  display: block;
}

.ext-card-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  display: block;
}

.ext-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.ext-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
}

.ext-metric-label {
  color: var(--text-secondary);
}

.ext-metric-value {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.ext-metric-danger {
  color: var(--color-danger);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .main-content {
    margin-left: 0;
  }

  .app-shell {
    flex-direction: column;
  }

  .mon-two-col {
    grid-template-columns: 1fr;
  }

  .koyeb-services-grid {
    grid-template-columns: 1fr;
  }

  .ext-services-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .ext-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
