:root {
  --bg: #f6f7fb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #eef0ff;
  --surface-soft: rgba(248, 249, 255, 0.78);
  --text: #252637;
  --muted: #70758d;
  --accent: #6574f7;
  --accent-dark: #4354c9;
  --line: rgba(101, 116, 247, 0.14);
  --line-strong: rgba(101, 116, 247, 0.26);
  --shadow: 0 20px 48px rgba(45, 50, 95, 0.10);
  --radius: 18px;
  --success: #1a9b63;
  --warning: #b88213;
  --danger: #d54848;
  --info: #2e86de;
}

body[data-theme="samurai"] {
  --bg: #12081c;
  --surface: rgba(28, 14, 38, 0.82);
  --surface-strong: #301340;
  --surface-soft: rgba(24, 12, 34, 0.76);
  --text: #fff2fb;
  --muted: #cbb4da;
  --accent: #ff3ebf;
  --accent-dark: #ffd3f5;
  --line: rgba(120, 228, 255, 0.22);
  --line-strong: rgba(255, 62, 191, 0.42);
  --shadow: 0 28px 64px rgba(4, 0, 16, 0.44);
  --samurai-neon-hot: rgba(255, 62, 191, 0.98);
  --samurai-neon-warm: rgba(255, 117, 226, 0.92);
  --samurai-neon-cold: rgba(74, 234, 255, 0.92);
  --samurai-glow-hot: 0 0 20px rgba(255, 62, 191, 0.42);
  --samurai-glow-cold: 0 0 22px rgba(74, 234, 255, 0.32);
}

html[data-theme="samurai"] body {
  background:
    linear-gradient(180deg, rgba(9, 5, 18, 0.96), rgba(18, 8, 28, 0.94)),
    radial-gradient(circle at 12% 14%, rgba(255, 62, 191, 0.26), transparent 22%),
    radial-gradient(circle at 78% 10%, rgba(74, 234, 255, 0.16), transparent 18%),
    radial-gradient(circle at 82% 62%, rgba(255, 117, 226, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(74, 234, 255, 0.12), transparent 34%),
    var(--bg);
}

body[data-theme="pastel"] {
  --bg: #f5f4fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ece8f7;
  --surface-soft: rgba(255, 255, 255, 0.66);
  --text: #312d3c;
  --muted: #7a748c;
  --accent: #6b7ce8;
  --accent-dark: #4457b8;
  --line: rgba(118, 117, 156, 0.18);
  --line-strong: rgba(107, 124, 232, 0.28);
  --shadow: 0 20px 48px rgba(98, 92, 127, 0.12);
}

html[data-theme="pastel"] body {
  background:
    radial-gradient(circle at top left, rgba(107, 124, 232, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 168, 205, 0.12), transparent 32%),
    var(--bg);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(138, 47, 29, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(63, 93, 76, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.session-bar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.9);
  backdrop-filter: blur(12px);
}

html[data-theme="samurai"] .session-bar,
html[data-theme="samurai"] .sidebar {
  background:
    linear-gradient(180deg, rgba(20, 8, 30, 0.88), rgba(11, 8, 24, 0.84));
  box-shadow:
    inset 0 -1px 0 rgba(74, 234, 255, 0.12),
    inset 0 1px 0 rgba(255, 62, 191, 0.08);
}

html[data-theme="samurai"] .hero {
  background:
    linear-gradient(135deg, rgba(35, 12, 42, 0.92), rgba(20, 14, 34, 0.96)),
    radial-gradient(circle at top right, rgba(255, 62, 191, 0.16), transparent 34%);
  border: 1px solid rgba(74, 234, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 62, 191, 0.08),
    0 22px 48px rgba(0, 0, 0, 0.38),
    0 0 44px rgba(255, 62, 191, 0.12);
  animation: samuraiPanelPulse 5.2s ease-in-out infinite;
}

html[data-theme="pastel"] .session-bar,
html[data-theme="pastel"] .sidebar {
  background: rgba(247, 245, 255, 0.84);
}

html[data-theme="pastel"] .hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 235, 252, 0.94));
}

.session-bar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 8px;
}

.theme-switcher__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.theme-switcher__group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.36);
}

.theme-switcher__button {
  padding: 8px 12px;
  min-width: 88px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.theme-switcher__button:hover {
  box-shadow: none;
}

.theme-switcher__button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(61, 35, 17, 0.08);
}

html[data-theme="samurai"] .theme-switcher__group {
  border-color: rgba(74, 234, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(33, 10, 42, 0.92), rgba(15, 10, 24, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 62, 191, 0.08),
    0 0 24px rgba(74, 234, 255, 0.08);
}

html[data-theme="samurai"] .theme-switcher__button {
  color: #c7d2e6;
  transition:
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}

html[data-theme="samurai"] .theme-switcher__button:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

html[data-theme="samurai"] .theme-switcher__button.is-active {
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.22), rgba(74, 234, 255, 0.18)),
    rgba(24, 12, 34, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(74, 234, 255, 0.22),
    0 0 18px rgba(74, 234, 255, 0.18),
    0 0 28px rgba(255, 62, 191, 0.18);
  animation: samuraiButtonPulse 2.8s ease-in-out infinite;
}

.session-bar__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 47, 29, 0.08);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="samurai"] .session-badge,
html[data-theme="samurai"] .status-pill,
html[data-theme="samurai"] .directory-pill {
  border: 1px solid rgba(255, 62, 191, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.18), rgba(74, 234, 255, 0.08)),
    rgba(22, 12, 31, 0.92);
  color: #ffe6f8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 0 18px rgba(255, 62, 191, 0.12);
}

.login-shell {
  width: 100%;
  max-width: 520px;
  padding: 24px;
}

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

.login-card h1 {
  margin: 8px 0 12px;
}

.login-note {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(138, 47, 29, 0.12);
  color: var(--accent-dark);
}

.login-help {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.login-help p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: grid;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 21, 16, 0.48);
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal {
  width: min(1100px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 6px 0 0;
}

.modal-content {
  display: grid;
  gap: 20px;
}

.help-section h4 {
  margin: 0 0 12px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #fffaf2;
  background: #2e6b4f;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.error {
  background: #8a2f1d;
}

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

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.72);
  backdrop-filter: blur(12px);
}

html[data-theme="samurai"] .sidebar-shell,
html[data-theme="samurai"] .card,
html[data-theme="samurai"] .modal,
html[data-theme="samurai"] .login-card {
  border-color: rgba(74, 234, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(30, 12, 42, 0.88), rgba(20, 12, 30, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 0 0 1px rgba(255, 62, 191, 0.08),
    0 24px 56px rgba(0, 0, 0, 0.4),
    0 0 36px rgba(74, 234, 255, 0.08);
}

html[data-theme="samurai"] .card:hover,
html[data-theme="samurai"] .bot-item:hover,
html[data-theme="samurai"] .bot-item.active {
  border-color: rgba(74, 234, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 62, 191, 0.14),
    0 22px 52px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(74, 234, 255, 0.14),
    0 0 22px rgba(255, 62, 191, 0.1);
}

html[data-theme="samurai"] .section-toggle,
html[data-theme="samurai"] button,
html[data-theme="samurai"] .sidebar-action,
html[data-theme="samurai"] .bot-item__action {
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    color 0.22s ease;
}

html[data-theme="samurai"] .section-toggle:hover,
html[data-theme="samurai"] button:hover,
html[data-theme="samurai"] .sidebar-action:hover,
html[data-theme="samurai"] .bot-item__action:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 16px rgba(74, 234, 255, 0.14),
    0 0 22px rgba(255, 62, 191, 0.16);
}

html[data-theme="samurai"] .section-eyebrow,
html[data-theme="samurai"] .sidebar-list-head__label,
html[data-theme="samurai"] .theme-switcher__label,
html[data-theme="samurai"] .session-bar__label {
  color: #aaf5ff;
  text-shadow:
    0 0 12px rgba(74, 234, 255, 0.34),
    0 0 18px rgba(255, 62, 191, 0.14);
}

html[data-theme="samurai"] .brand-panel::after,
html[data-theme="samurai"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, transparent 0%, rgba(74, 234, 255, 0.06) 28%, rgba(255, 62, 191, 0.08) 48%, transparent 72%);
  opacity: 0.8;
  animation: samuraiSweep 6.4s linear infinite;
}

html[data-theme="samurai"] .brand-panel {
  background:
    linear-gradient(180deg, rgba(40, 12, 50, 0.84), rgba(18, 10, 28, 0.9));
}

html[data-theme="samurai"] .bot-item small,
html[data-theme="samurai"] .card-note,
html[data-theme="samurai"] label span {
  color: #d6c2e2;
}

html[data-theme="samurai"] input,
html[data-theme="samurai"] textarea,
html[data-theme="samurai"] select {
  background: rgba(28, 14, 40, 0.88);
  border-color: rgba(74, 234, 255, 0.12);
  color: #fff3fb;
  box-shadow: inset 0 0 0 1px rgba(255, 62, 191, 0.03);
}

html[data-theme="samurai"] input:focus,
html[data-theme="samurai"] textarea:focus,
html[data-theme="samurai"] select:focus {
  border-color: rgba(74, 234, 255, 0.38);
  box-shadow:
    0 0 0 4px rgba(74, 234, 255, 0.08),
    0 0 18px rgba(255, 62, 191, 0.12);
  background: rgba(35, 16, 46, 0.94);
}

html[data-theme="samurai"] .bot-item {
  background:
    linear-gradient(180deg, rgba(32, 12, 42, 0.8), rgba(20, 10, 30, 0.86));
}

html[data-theme="samurai"] button.primary {
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.94), rgba(132, 74, 255, 0.94));
  color: #fff7fd;
  box-shadow:
    0 0 16px rgba(255, 62, 191, 0.18),
    0 0 28px rgba(132, 74, 255, 0.12);
}

html[data-theme="samurai"] button.ghost,
html[data-theme="samurai"] .section-toggle {
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.1), rgba(74, 234, 255, 0.08));
  color: #ffe8fb;
  border-color: rgba(255, 62, 191, 0.14);
}

html[data-theme="samurai"] .hero,
html[data-theme="samurai"] .brand-panel {
  position: relative;
  overflow: hidden;
}

@keyframes samuraiPanelPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.03),
      0 0 0 1px rgba(255, 62, 191, 0.08),
      0 20px 48px rgba(0, 0, 0, 0.38),
      0 0 42px rgba(255, 62, 191, 0.12);
  }

  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.03),
      0 0 0 1px rgba(74, 234, 255, 0.18),
      0 22px 54px rgba(0, 0, 0, 0.42),
      0 0 58px rgba(74, 234, 255, 0.16),
      0 0 30px rgba(255, 62, 191, 0.14);
  }
}

@keyframes samuraiButtonPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(74, 234, 255, 0.2),
      0 0 18px rgba(74, 234, 255, 0.18),
      0 0 30px rgba(255, 62, 191, 0.18);
  }

  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 62, 191, 0.26),
      0 0 28px rgba(255, 62, 191, 0.24),
      0 0 36px rgba(74, 234, 255, 0.2);
  }
}

@keyframes samuraiSweep {
  0% {
    transform: translateX(-42%) skewX(-18deg);
    opacity: 0;
  }

  12% {
    opacity: 0.55;
  }

  40% {
    opacity: 0.18;
  }

  100% {
    transform: translateX(135%) skewX(-18deg);
    opacity: 0;
  }
}

.sidebar-shell {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.sidebar-actions .full {
  margin-top: 0;
}

.sidebar-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.sidebar-list-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-list-meta {
  font-size: 12px;
  color: var(--muted);
}

.brand-kicker, .hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.brand h1, .hero h2 {
  margin: 6px 0 10px;
}

.brand p, #bot-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.brand-panel {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,248,239,0.48));
}

.bot-list {
  display: grid;
  gap: 12px;
}

.bot-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.bot-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.bot-item__title {
  min-width: 0;
}

.bot-item__title strong {
  display: block;
}

.bot-item__log-btn {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 10px 12px;
  border-radius: 12px;
}

.bot-item.active,
.bot-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px rgba(61, 35, 17, 0.08);
}

.bot-item small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.content {
  padding: 28px;
  max-width: 1560px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(244,235,223,0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  min-width: 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-summary-rail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.cleanup-queue-summary {
  margin-top: 0;
}

.cleanup-queue-widget {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.cleanup-queue-widget__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}

.cleanup-queue-widget__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.cleanup-queue-list {
  display: grid;
  gap: 14px;
}

.cleanup-queue-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.cleanup-queue-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cleanup-queue-item__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.cleanup-queue-item__grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.cleanup-queue-item__grid strong {
  display: block;
  font-size: 14px;
}

.cleanup-queue-item__error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(138, 47, 29, 0.1);
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.monitoring-delivery-summary {
  margin-top: 0;
}

.monitoring-delivery-widget {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.monitoring-delivery-widget__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}

.monitoring-delivery-widget__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.monitoring-delivery-widget__detail {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.monitoring-delivery-list {
  display: grid;
  gap: 14px;
}

.collapsible-feed {
  display: grid;
  gap: 12px;
}

.collapsible-feed__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.collapsible-feed__head h4 {
  margin: 0 0 4px;
}

.collapsible-feed__head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.collapsible-feed__toggle {
  white-space: nowrap;
}

.collapsible-feed__body {
  overflow: auto;
  transition: max-height 0.2s ease;
}

.collapsible-feed__body.is-collapsed {
  max-height: 240px;
}

.monitoring-delivery-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.monitoring-delivery-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.monitoring-delivery-item__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.monitoring-delivery-item__grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.monitoring-delivery-item__grid strong {
  display: block;
  font-size: 14px;
}

.monitoring-ack-summary {
  margin-top: 0;
}

.monitoring-ack-widget {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.monitoring-ack-widget__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}

.monitoring-ack-widget__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.monitoring-ack-modal {
  display: grid;
  gap: 18px;
}

.monitoring-ack-modal__section h4 {
  margin: 0 0 12px;
}

.monitoring-ack-history-list {
  display: grid;
  gap: 14px;
}

.monitoring-ack-history-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.monitoring-ack-history-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.monitoring-ack-history-item__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.monitoring-ack-history-item__grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.monitoring-ack-history-item__grid strong {
  display: block;
  font-size: 14px;
}

.monitoring-dashboard-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.monitoring-dashboard-multiselect {
  display: grid;
  gap: 10px;
}

.monitoring-dashboard-multiselect__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.monitoring-dashboard-multiselect__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.monitoring-dashboard-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.monitoring-dashboard-option span {
  font-size: 14px;
  line-height: 1.35;
}

.monitoring-dashboard-form__actions {
  display: flex;
  justify-content: flex-start;
}

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

.monitoring-dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.monitoring-dashboard-table th,
.monitoring-dashboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.monitoring-dashboard-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .hero {
    flex-direction: column;
  }

  .hero-summary-rail {
    grid-template-columns: 1fr;
  }

  .bot-operational-summary {
    grid-column: 1 / -1;
  }

  .monitoring-dashboard-multiselect__list {
    grid-template-columns: 1fr;
  }
}

.grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-content: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 52px rgba(63, 39, 18, 0.1);
}

.card.wide {
  grid-column: 1 / -1;
}

.card--active {
  border-color: var(--line-strong);
  box-shadow: 0 24px 52px rgba(63, 39, 18, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 16px;
}

.card-header h3 {
  margin: 0;
}

.section-eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-collapsed {
  display: none;
}

#bot-form-section-body,
#employees-section-body,
#notifications-section-body,
#commands-section-body {
  display: grid;
  gap: 16px;
}

#bot-form-section-body.section-collapsed,
#employees-section-body.section-collapsed,
#notifications-section-body.section-collapsed,
#commands-section-body.section-collapsed {
  display: none;
}

.card-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label { display: grid; gap: 6px; font-size: 14px; }
label span { color: var(--muted); }

input, textarea, button {
  font: inherit;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(138, 47, 29, 0.36);
  box-shadow: 0 0 0 4px rgba(138, 47, 29, 0.08);
  background: #fff;
}

textarea { resize: vertical; min-height: 110px; }

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--surface-strong);
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(61, 35, 17, 0.08);
}

button.primary {
  background: var(--accent);
  color: #fff9f2;
}

button.ghost {
  background: rgba(138, 47, 29, 0.08);
  color: var(--accent-dark);
}

.section-toggle {
  position: relative;
  min-width: 136px;
  padding-right: 40px;
  border: 1px solid rgba(138, 47, 29, 0.12);
  background: rgba(138, 47, 29, 0.06);
}

.section-toggle::after {
  content: "⌃";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 13px;
  opacity: 0.8;
}

.section-toggle.is-collapsed::after {
  content: "⌄";
}

button.full { width: 100%; margin-top: 22px; }

.subsection + .subsection {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.notification-list {
  display: grid;
  gap: 16px;
}

.command-list {
  display: grid;
  gap: 12px;
}

.employee-list {
  display: grid;
  gap: 16px;
}

.employee-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.employee-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.employee-head h4 {
  margin: 0;
}

.employee-body.collapsed {
  display: none;
}

.employee-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  color: var(--muted);
}

.employee-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.employee-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 47, 29, 0.08);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

.notification-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface-soft);
}

.notification-card--summary {
  padding: 14px 16px;
}

.notification-card--summary .notification-head {
  margin-bottom: 0;
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
}

.notification-card--summary .card-note + .card-note {
  margin-top: 4px;
}

.notification-card--summary .notification-head > div:first-child {
  min-width: 0;
}

.notification-card--summary .notification-head > div:first-child .card-note {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notification-card--summary .notification-actions {
  justify-content: flex-end;
  align-self: center;
  width: 100%;
  max-width: 420px;
}

.notification-card--editor {
  padding: 18px;
}

.notification-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.notification-head h4 {
  margin: 0;
}

@media (max-width: 980px) {
  .notification-card--summary .notification-head {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .notification-card--summary .notification-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

.notification-body.collapsed {
  display: none;
}

.notification-editor-modal {
  width: min(1120px, 100%);
}

.mention-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 4px;
}

.mention-picker-head label {
  margin: 0;
}

.mention-picker-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.mention-picker-tools .ghost {
  min-height: 34px;
  padding: 7px 11px;
}

.mention-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}

.mention-option {
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.mention-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.mention-empty {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.notification-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.command-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.command-item:hover,
.notification-card:hover,
.employee-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 28px rgba(61, 35, 17, 0.07);
}

.command-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.command-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.command-item__body {
  margin-top: 10px;
  color: var(--muted);
}

.command-item__body.is-hidden {
  display: none;
}

.command-item__toggle {
  white-space: nowrap;
}

.command-intent {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
}

.command-grid {
  margin-bottom: 10px;
}

.command-grid .toggle {
  min-height: 48px;
  align-self: end;
}

.command-notification-field {
  grid-column: span 2;
}

.command-footnote {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.command-footnote strong {
  display: block;
  margin-bottom: 6px;
}

.command-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.command-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(138, 47, 29, 0.08);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.command-sql-catalog {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.command-sql-catalog__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.command-sql-catalog__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.command-sql-catalog__body.is-hidden {
  display: none;
}

.command-sql-catalog__roots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.sql-root-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
}

.sql-root-card__title {
  font-weight: 700;
  color: var(--text);
}

.sql-root-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.command-sql-catalog__views {
  margin-top: 16px;
}

.command-sql-catalog__views-title {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
}

.sql-catalog-admin {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sql-catalog-admin__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.sql-catalog-admin__body.is-hidden {
  display: none;
}

.sql-catalog-admin__subhead {
  margin: 12px 0 8px;
  font-weight: 700;
  color: var(--text);
}

.sql-catalog-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
}

.sql-access-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.sql-catalog-admin__layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
  gap: 18px;
  margin-top: 14px;
}

.sql-catalog-admin__tree,
.sql-catalog-admin__editor {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.sql-tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sql-tree {
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}

.sql-tree-level {
  display: grid;
  gap: 8px;
}

.sql-tree-level--depth-1,
.sql-tree-level--depth-2,
.sql-tree-level--depth-3,
.sql-tree-level--depth-4 {
  margin-left: 16px;
  margin-top: 8px;
}

.sql-tree-node__button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.sql-tree-node__button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(67, 78, 205, 0.18);
}

.sql-tree-node__type {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(67, 78, 205, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.sql-tree-node__name {
  font-weight: 600;
}

.sql-catalog-form__full {
  grid-column: 1 / -1;
}

.sql-catalog-form textarea {
  min-height: 90px;
  font-family: var(--font-mono, "Consolas", monospace);
}

.sql-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.sql-preview {
  margin-top: 14px;
}

.sql-preview__card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.sql-preview__title {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
}

.sql-preview__code {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(67, 78, 205, 0.06);
  color: var(--text);
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono, "Consolas", monospace);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .sql-catalog-admin__layout {
    grid-template-columns: 1fr;
  }
}

.template-helper {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.template-helper__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.template-helper__grid {
  display: grid;
  gap: 10px;
}

.template-helper__item {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.template-helper__item code {
  font-size: 13px;
}

.notification-preview__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.notification-preview__html {
  color: var(--text);
}

.notification-preview__html p,
.notification-preview__html ul,
.notification-preview__html h1,
.notification-preview__html h2,
.notification-preview__html h3 {
  margin: 0 0 10px;
}

.notification-preview__html ul {
  padding-left: 20px;
}

.notification-preview__details {
  margin-top: 12px;
}

.notification-preview__details pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.wizard-modal {
  width: min(980px, 100%);
}

.logs-modal {
  width: min(1100px, 100%);
}

.directory-modal {
  width: min(1100px, 100%);
}

.entity-form-modal {
  width: min(980px, 100%);
}

.section-detail-modal {
  width: min(1180px, 100%);
}

.section-detail-body {
  display: grid;
  gap: 18px;
}

.section-detail-body > * {
  margin: 0;
}

.profile-modal {
  width: min(860px, 100%);
}

.report-lab-modal {
  width: min(1080px, 100%);
}

.fml-monthly-modal {
  width: min(1180px, 100%);
}

.report-lab-status {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.fml-monthly-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.fml-monthly-status {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.fml-monthly-status[data-tone="success"] {
  border-color: rgba(31, 131, 98, 0.32);
}

.fml-monthly-status[data-tone="error"] {
  border-color: rgba(178, 55, 55, 0.32);
}

.fml-monthly-status[data-tone="progress"] {
  border-color: rgba(72, 99, 180, 0.32);
}

.fml-monthly-warning-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.fml-monthly-warning {
  padding: 12px 14px;
  border: 1px solid rgba(178, 55, 55, 0.24);
  border-radius: 14px;
  background: rgba(255, 243, 232, 0.78);
}

.fml-monthly-result-card {
  margin-top: 18px;
}

.fml-monthly-result {
  display: grid;
  gap: 18px;
}

.fml-monthly-source-note,
.fml-monthly-delta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fml-monthly-source-note span,
.fml-monthly-delta-list span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
}

.fml-monthly-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fml-monthly-kpi,
.fml-monthly-service-card,
.fml-monthly-change-card,
.fml-monthly-reminder {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.fml-monthly-kpi {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.fml-monthly-kpi span,
.fml-monthly-kpi small {
  color: var(--muted);
}

.fml-monthly-kpi strong {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
}

.fml-monthly-reminder {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.fml-monthly-reminder--ok {
  border-color: rgba(31, 131, 98, 0.34);
}

.fml-monthly-reminder--soft {
  border-color: rgba(218, 141, 33, 0.4);
}

.fml-monthly-reminder--strict,
.fml-monthly-reminder--toxic {
  border-color: rgba(178, 55, 55, 0.42);
}

.fml-monthly-section {
  display: grid;
  gap: 12px;
}

.fml-monthly-section h4 {
  margin: 0;
}

.fml-monthly-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.54);
}

.fml-monthly-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 100px;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.fml-monthly-table-row:first-child {
  border-top: none;
}

.fml-monthly-table-head {
  font-weight: 700;
  color: var(--muted);
  background: rgba(16, 24, 40, 0.04);
}

.fml-monthly-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fml-monthly-comparison-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.fml-monthly-comparison-card,
.fml-monthly-email-preview {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.fml-monthly-comparison-card {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.fml-monthly-comparison-card span,
.fml-monthly-comparison-card small,
.fml-monthly-email-subject span {
  color: var(--muted);
}

.fml-monthly-email-preview {
  display: grid;
  gap: 12px;
  padding: 18px;
  line-height: 1.55;
}

.fml-monthly-email-preview p {
  margin: 0;
}

.fml-monthly-email-subject {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.fml-monthly-email-block {
  display: grid;
  gap: 10px;
}

.fml-monthly-email-block h5 {
  margin: 4px 0 0;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.fml-monthly-email-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.fml-monthly-email-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 13px;
  line-height: 1.35;
}

.fml-monthly-email-table th,
.fml-monthly-email-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.fml-monthly-email-table th {
  background: rgba(16, 24, 40, 0.045);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.fml-monthly-email-table tr:last-child td {
  border-bottom: none;
}

.fml-monthly-email-table tr.is-total td {
  font-weight: 800;
  background: rgba(104, 119, 242, 0.08);
}

.fml-monthly-email-table .is-right {
  text-align: right;
  white-space: nowrap;
}

.fml-monthly-email-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fml-monthly-email-chip-list span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
}

.fml-monthly-email-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fml-monthly-email-theme-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.fml-monthly-email-theme-card > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.fml-monthly-email-theme-card > div span {
  color: var(--muted);
  font-size: 12px;
}

.fml-monthly-email-theme-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fml-monthly-email-theme-card li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

.fml-monthly-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.fml-monthly-email-actions label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
}

.fml-monthly-email-actions select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.fml-monthly-service-card,
.fml-monthly-change-card {
  padding: 14px;
}

.fml-monthly-service-card h5 {
  margin: 0 0 10px;
  font-size: 15px;
}

.fml-monthly-service-card ul,
.fml-monthly-letter-draft {
  margin: 0;
  padding-left: 20px;
}

.fml-monthly-service-card li + li,
.fml-monthly-letter-draft li + li {
  margin-top: 6px;
}

.fml-monthly-change-list {
  display: grid;
  gap: 10px;
}

.fml-monthly-change-card {
  display: grid;
  gap: 8px;
}

.fml-monthly-change-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.fml-monthly-change-card p {
  margin: 0;
}

.fml-monthly-change-card small {
  color: var(--muted);
}

.report-lab-status[data-tone="success"] {
  border-color: rgba(31, 131, 98, 0.32);
}

.report-lab-status[data-tone="error"] {
  border-color: rgba(178, 55, 55, 0.32);
}

.report-lab-warning-list,
.report-lab-last-job {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.report-lab-warning,
.report-lab-job-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.report-lab-job-card {
  display: grid;
  gap: 8px;
}

.report-lab-job-card pre {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 24, 40, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.report-lab-btn-busy,
.report-lab-btn-ready {
  position: relative;
}

.report-lab-btn-busy {
  animation: reportLabButtonBusy 1.25s ease-in-out infinite;
}

.report-lab-btn-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, 0.26) 48%, transparent 72%);
  transform: translateX(-125%);
  animation: reportLabButtonSweep 1.35s ease-in-out infinite;
  pointer-events: none;
}

.report-lab-btn-ready {
  background: rgba(31, 131, 98, 0.14);
  color: #1d6c53;
  box-shadow: 0 0 0 0 rgba(31, 131, 98, 0.24);
  animation: reportLabButtonReady 1.75s ease-in-out infinite;
}

@keyframes reportLabButtonBusy {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(99, 109, 255, 0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(99, 109, 255, 0.18);
  }
}

@keyframes reportLabButtonSweep {
  0% {
    transform: translateX(-125%);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translateX(125%);
    opacity: 0;
  }
}

@keyframes reportLabButtonReady {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(31, 131, 98, 0.24);
  }
  50% {
    transform: translateY(-1px) scale(1.015);
    box-shadow: 0 0 0 12px rgba(31, 131, 98, 0);
  }
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.profile-projects {
  display: grid;
  gap: 10px;
}

.profile-project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.profile-project-code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-dark);
}

.field-locked {
  opacity: 0.72;
}

.field-locked input,
.field-locked textarea,
.field-locked select {
  background: #f7f0e5;
}

.field-hidden {
  display: none !important;
}

.directory-form-card {
  position: static;
  top: auto;
  z-index: auto;
}

.directory-list {
  display: grid;
  gap: 14px;
}

.directory-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.directory-item__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.directory-item__meta {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.directory-stats,
.directory-people-list,
.project-chat-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.directory-stats {
  margin-top: 12px;
}

.stat-chip,
.project-chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
}

.project-chat-pill {
  border-radius: 14px;
  align-items: flex-start;
  flex-direction: column;
}

.project-chat-pill strong,
.project-chat-pill small {
  line-height: 1.2;
}

.project-chat-pill small {
  color: var(--muted);
}

.project-form-section {
  display: grid;
  gap: 12px;
}

.project-manager-picker,
.project-chat-list {
  display: grid;
  gap: 12px;
}

.project-chat-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.directory-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

html[data-theme="samurai"] .directory-item,
html[data-theme="samurai"] .project-chat-card,
html[data-theme="samurai"] .directory-empty {
  border-color: rgba(120, 228, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(47, 18, 64, 0.88), rgba(26, 12, 38, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 62, 191, 0.08),
    0 14px 36px rgba(0, 0, 0, 0.34);
}

html[data-theme="samurai"] .directory-item__meta,
html[data-theme="samurai"] .directory-empty,
html[data-theme="samurai"] .project-chat-pill small {
  color: #d9c3e8;
}

html[data-theme="samurai"] .directory-item strong,
html[data-theme="samurai"] .directory-item h3,
html[data-theme="samurai"] .project-chat-pill strong,
html[data-theme="samurai"] .project-chat-card strong,
html[data-theme="samurai"] .project-chat-card h4 {
  color: #fff3fc;
}

html[data-theme="samurai"] .stat-chip,
html[data-theme="samurai"] .project-chat-pill {
  border-color: rgba(120, 228, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.16), rgba(74, 234, 255, 0.08)),
    rgba(28, 12, 39, 0.94);
  color: #ffe9fb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 62, 191, 0.06);
}

html[data-theme="samurai"] .directory-item .ghost,
html[data-theme="samurai"] .project-chat-card .ghost,
html[data-theme="samurai"] .directory-item button.ghost {
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.18), rgba(74, 234, 255, 0.12)),
    rgba(27, 10, 39, 0.88);
  border-color: rgba(120, 228, 255, 0.2);
  color: #fff2fc;
}

html[data-theme="samurai"] .directory-item .ghost:hover,
html[data-theme="samurai"] .project-chat-card .ghost:hover,
html[data-theme="samurai"] .directory-item button.ghost:hover {
  border-color: rgba(120, 228, 255, 0.32);
  box-shadow:
    0 0 0 1px rgba(255, 62, 191, 0.12),
    0 0 18px rgba(74, 234, 255, 0.14);
}

html[data-theme="samurai"] .faq-item,
html[data-theme="samurai"] .wizard-choice,
html[data-theme="samurai"] .wizard-summary-card,
html[data-theme="samurai"] .scenario-summary,
html[data-theme="samurai"] .scenario-chip,
html[data-theme="samurai"] .mention-option,
html[data-theme="samurai"] .mention-empty,
html[data-theme="samurai"] .notification-preview,
html[data-theme="samurai"] .command-intent,
html[data-theme="samurai"] .template-helper,
html[data-theme="samurai"] .template-helper__item,
html[data-theme="samurai"] .profile-grid div,
html[data-theme="samurai"] .profile-project-item {
  border-color: rgba(120, 228, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(47, 18, 64, 0.88), rgba(26, 12, 38, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(255, 62, 191, 0.08),
    0 14px 36px rgba(0, 0, 0, 0.28);
}

html[data-theme="samurai"] .faq-item p,
html[data-theme="samurai"] .wizard-choice p,
html[data-theme="samurai"] .scenario-chip__meta,
html[data-theme="samurai"] .mention-option small,
html[data-theme="samurai"] .template-helper .card-note,
html[data-theme="samurai"] .template-helper__item,
html[data-theme="samurai"] .command-item__body,
html[data-theme="samurai"] .profile-project-item,
html[data-theme="samurai"] .profile-project-code,
html[data-theme="samurai"] .field-note {
  color: #dcc7ea;
}

html[data-theme="samurai"] .faq-item strong,
html[data-theme="samurai"] .wizard-summary-card strong,
html[data-theme="samurai"] .scenario-chip__title,
html[data-theme="samurai"] .command-intent,
html[data-theme="samurai"] .template-helper strong,
html[data-theme="samurai"] .profile-grid strong,
html[data-theme="samurai"] .profile-project-item strong {
  color: #fff3fc;
}

html[data-theme="samurai"] .command-badge {
  background:
    linear-gradient(135deg, rgba(255, 62, 191, 0.18), rgba(74, 234, 255, 0.1)),
    rgba(29, 12, 41, 0.94);
  color: #ffe8fb;
  border: 1px solid rgba(120, 228, 255, 0.18);
}

html[data-theme="samurai"] .notification-empty {
  border-color: rgba(120, 228, 255, 0.22);
  color: #d9c3e8;
  background: rgba(31, 12, 44, 0.72);
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.wizard-step {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(138, 47, 29, 0.08);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.wizard-step.active {
  background: var(--accent);
  color: #fffaf2;
}

.wizard-choice-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.wizard-choice {
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.wizard-choice p {
  margin: 6px 0 0;
  color: var(--muted);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.wizard-summary {
  display: grid;
  gap: 12px;
}

.wizard-summary-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.wizard-summary-card strong {
  display: block;
  margin-bottom: 8px;
}

.notification-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
}

.scenario-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.scenario-summary__head {
  display: grid;
  gap: 4px;
}

.scenario-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.scenario-chip {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.scenario-chip__title {
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.scenario-chip__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.danger {
  background: rgba(138, 47, 29, 0.12);
  color: var(--accent-dark);
}

.faq {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.faq-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.field-note {
  margin-top: -4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.actions { margin-top: 18px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(138, 47, 29, 0.09);
  color: var(--accent-dark);
  margin-bottom: 14px;
}

.status-pill[data-tone="success"] {
  background: rgba(46, 107, 79, 0.12);
  color: #24543f;
}

.status-pill[data-tone="warning"] {
  background: rgba(173, 112, 27, 0.14);
  color: #7c4d0a;
}

.status-pill[data-tone="error"] {
  background: rgba(138, 47, 29, 0.14);
  color: #7c2415;
}

.status-pill[data-tone="stopped"] {
  background: rgba(86, 78, 69, 0.12);
  color: #4f473f;
}

.log-output {
  margin: 0;
  min-height: 280px;
  max-height: 65vh;
  overflow: auto;
  background: #191613;
  color: #f1e9db;
  border-radius: 14px;
  padding: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Operations Cockpit shell — safe frontend-only redesign layer. */
body {
  background:
    radial-gradient(circle at 8% 4%, rgba(101, 116, 247, 0.13), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(125, 211, 252, 0.12), transparent 22%),
    linear-gradient(180deg, #fbfbff 0%, var(--bg) 48%, #f2f4fb 100%);
}

.session-bar {
  background: rgba(250, 251, 255, 0.86);
  border-bottom-color: rgba(101, 116, 247, 0.12);
}

.layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.sidebar {
  min-height: calc(100vh - 61px);
  padding: 18px 18px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 247, 255, 0.78));
  border-right-color: rgba(101, 116, 247, 0.14);
}

.sidebar-shell {
  top: 78px;
  gap: 16px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.brand-panel {
  padding: 18px;
  border-color: rgba(101, 116, 247, 0.15);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 243, 255, 0.84));
  box-shadow: 0 18px 38px rgba(65, 72, 130, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-mark__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: inset 0 0 0 1px rgba(101, 116, 247, 0.16);
}

.brand-mark__status {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(26, 155, 99, 0.10);
  color: #13784d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand h1 {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.brand p {
  font-size: 14px;
}

.sidebar-search {
  display: grid;
  gap: 8px;
}

.sidebar-search span,
.sidebar-section-title,
.sidebar-current__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

summary.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

summary.sidebar-section-title::-webkit-details-marker {
  display: none;
}

summary.sidebar-section-title::after {
  content: "⌃";
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.09);
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.sidebar-accordion:not([open]) > summary.sidebar-section-title::after {
  transform: rotate(180deg);
}

.sidebar-section-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.08);
  color: var(--accent-dark);
  letter-spacing: 0;
  font-size: 11px;
}

.sidebar-search input {
  width: 100%;
  min-height: 44px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(101, 116, 247, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.sidebar-section {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
}

.sidebar-accordion {
  overflow: hidden;
}

.sidebar-accordion[open] {
  align-content: start;
}

.sidebar-section--bots {
  gap: 12px;
}

.sidebar-list-head {
  padding-top: 0;
  border-top: 0;
}

.sidebar-list-title {
  color: var(--text);
  font-size: 13px;
}

.sidebar-list-meta {
  font-size: 11px;
}

.sidebar-nav-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #4d526b;
  box-shadow: none;
  text-align: left;
  font-size: 14px;
  font-weight: 750;
}

.sidebar-nav-item span:not(.sidebar-nav-item__icon) {
  min-width: 0;
}

.sidebar-nav-item small {
  display: none;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.sidebar-nav-item.is-active small,
.sidebar-nav-item:hover small {
  display: block;
}

.sidebar-nav-item.is-active small,
.sidebar-nav-item:hover small {
  color: #69708d;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.is-active {
  transform: none;
  border-color: rgba(101, 116, 247, 0.18);
  background: rgba(238, 240, 255, 0.9);
  color: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(65, 72, 130, 0.08);
}

.sidebar-nav-item--primary {
  color: #ffffff;
  border-color: rgba(101, 116, 247, 0.18);
  background: linear-gradient(135deg, #6574f7, #7c63f4);
  box-shadow: 0 14px 28px rgba(101, 116, 247, 0.22);
}

.sidebar-nav-item--primary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #5968ef, #7358ea);
}

.sidebar-nav-item__icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.sidebar-nav-item--primary .sidebar-nav-item__icon {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
}

.bot-list {
  gap: 8px;
}

.bot-item {
  padding: 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(101, 116, 247, 0.13);
}

.bot-item.active,
.bot-item:hover {
  background: #ffffff;
  border-color: rgba(101, 116, 247, 0.28);
  box-shadow: 0 12px 28px rgba(65, 72, 130, 0.10);
}

.bot-item__title strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.bot-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bot-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(26, 155, 99, 0.10);
}

.bot-item__log-btn {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
}

.bot-list-empty {
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(238, 240, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-current {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 255, 0.78));
}

.sidebar-current strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-current span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.sidebar-current .full {
  margin-top: 6px;
  min-height: 40px;
  border-radius: 13px;
}

.content {
  padding: 24px 30px 44px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 22px;
  align-items: flex-start;
  border-color: rgba(101, 116, 247, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 241, 255, 0.88));
  box-shadow: 0 22px 52px rgba(65, 72, 130, 0.10);
}

.hero h2 {
  font-size: 32px;
  letter-spacing: -0.045em;
}

.hero-actions {
  align-items: center;
  justify-content: flex-end;
  padding: 6px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.hero-actions button {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #4d526b;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.hero-actions button:hover {
  transform: none;
  border-color: rgba(101, 116, 247, 0.14);
  background: rgba(238, 240, 255, 0.78);
  box-shadow: none;
}

.hero-actions button[data-action="status"],
.hero-actions #open-help-btn,
.hero-actions #refresh-session-btn {
  color: var(--accent-dark);
}

/* Запустить — primary action, solid green */
.hero-actions button[data-action="start"] {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

.hero-actions button[data-action="start"]:hover {
  background: #15803d;
  border-color: #166534;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.28);
}

/* Перезапустить — secondary action, outlined amber */
.hero-actions button[data-action="restart"] {
  background: transparent;
  color: #b45309;
  border-color: #d97706;
}

.hero-actions button[data-action="restart"]:hover {
  background: #fef3c7;
  border-color: #b45309;
}

/* Остановить — destructive action, solid red */
.hero-actions button[data-action="stop"] {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

.hero-actions button[data-action="stop"]:hover {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

.bot-operational-summary {
  min-width: 0;
}

.hero-summary-rail {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.operations-widget {
  width: 100%;
  min-height: 100%;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 255, 0.70));
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.operations-widget:hover {
  transform: none;
  border-color: rgba(101, 116, 247, 0.22);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(65, 72, 130, 0.08);
}

.operations-widget__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.operations-widget__title {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.operations-widget__hint {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-widget__status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.operations-widget__status[data-tone="success"] {
  background: rgba(26, 155, 99, 0.12);
  color: #13784d;
}

.operations-widget__status[data-tone="warning"] {
  background: rgba(184, 130, 19, 0.13);
  color: #845b09;
}

.operations-widget__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.operations-widget__cell {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(101, 116, 247, 0.10);
}

.operations-widget__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operations-widget__cell strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cleanup-queue-summary,
.monitoring-delivery-summary,
.monitoring-ack-summary {
  min-width: 0;
}

.cleanup-queue-widget,
.monitoring-delivery-widget,
.monitoring-ack-widget {
  width: 100%;
  min-height: 100%;
  gap: 7px;
  padding: 14px;
  border-color: rgba(101, 116, 247, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 255, 0.70));
  box-shadow: none;
}

.cleanup-queue-widget:hover,
.monitoring-delivery-widget:hover,
.monitoring-ack-widget:hover {
  border-color: rgba(101, 116, 247, 0.22);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(65, 72, 130, 0.08);
}

.cleanup-queue-widget__title,
.monitoring-delivery-widget__title,
.monitoring-ack-widget__title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.cleanup-queue-widget__meta,
.monitoring-delivery-widget__meta,
.monitoring-delivery-widget__detail,
.monitoring-ack-widget__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Дублирующий блок убран — стили кнопок управления заданы выше */

.card {
  border-color: rgba(101, 116, 247, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(247, 248, 255, 0.78));
  box-shadow: 0 10px 26px rgba(65, 72, 130, 0.055);
}

.card:hover {
  transform: none;
  border-color: rgba(101, 116, 247, 0.18);
  box-shadow: 0 14px 32px rgba(65, 72, 130, 0.075);
}

.card-header {
  align-items: flex-start;
}

.dashboard-section-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(238, 240, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(101, 116, 247, 0.10);
}

.dashboard-metric-chip strong {
  overflow: hidden;
  max-width: 170px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric-chip[data-tone="success"] {
  background: rgba(26, 155, 99, 0.11);
  color: #13784d;
  box-shadow: inset 0 0 0 1px rgba(26, 155, 99, 0.15);
}

.dashboard-metric-chip[data-tone="warning"] {
  background: rgba(184, 130, 19, 0.12);
  color: #845b09;
  box-shadow: inset 0 0 0 1px rgba(184, 130, 19, 0.16);
}

.dashboard-metric-chip[data-tone="info"] {
  background: rgba(46, 134, 222, 0.11);
  color: #2369af;
  box-shadow: inset 0 0 0 1px rgba(46, 134, 222, 0.16);
}

.dashboard-storage {
  display: none;
}

.control-plane-workspace {
  margin-top: 16px;
}

.workspace-empty {
  padding: 26px;
  border: 1px dashed rgba(101, 116, 247, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.workspace-empty h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.workspace-layout--editor {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-main {
  min-width: 0;
}

.workspace-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.workspace-card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-mini-card,
.workspace-panel,
.workspace-context-card {
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(247, 248, 255, 0.78));
  box-shadow: 0 10px 26px rgba(65, 72, 130, 0.055);
}

.workspace-mini-card {
  min-height: 142px;
  padding: 15px;
}

.workspace-mini-card__kicker,
.workspace-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workspace-mini-card strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.workspace-mini-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.workspace-link,
.workspace-table-action,
.workspace-primary-action {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.workspace-link {
  display: inline-flex;
  margin-top: 12px;
  padding: 0;
  font-size: 13px;
}

.workspace-panel {
  overflow: hidden;
}

.workspace-panel--editor {
  min-height: 520px;
}

.workspace-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 13px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.12);
  background: rgba(255, 255, 255, 0.52);
}

.workspace-panel__head--editor {
  align-items: center;
}

.workspace-panel__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace-panel__actions:empty {
  display: none;
}

.workspace-panel__head h3 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.workspace-panel__head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace-segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 999px;
  background: rgba(238, 240, 255, 0.74);
}

.workspace-segmented span {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.workspace-segmented .active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 6px 14px rgba(65, 72, 130, 0.08);
}

.workspace-primary-action {
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 1px solid rgba(101, 116, 247, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 20px rgba(65, 72, 130, 0.06);
}

.workspace-secondary-action {
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 14px;
  background: rgba(238, 240, 255, 0.62);
  color: #4d526b;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.workspace-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.10);
  background: rgba(246, 248, 255, 0.54);
}

.workspace-section-meta span {
  display: inline-grid;
  gap: 2px;
  min-width: 118px;
  padding: 8px 11px;
  border: 1px solid rgba(101, 116, 247, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.workspace-section-meta small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-section-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-section-body-host {
  padding: 18px;
}

.workspace-layout--external {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-panel--external {
  min-height: 0;
}

.workspace-panel--external .workspace-panel__head {
  background:
    radial-gradient(circle at 100% 0, rgba(125, 211, 252, 0.10), transparent 28%),
    rgba(255, 255, 255, 0.58);
}

.workspace-inline-notice {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(218, 141, 33, 0.20);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 250, 232, 0.92), rgba(255, 255, 255, 0.72));
  color: #7b560d;
  font-size: 13px;
  line-height: 1.45;
}

.workspace-section-body-host--external {
  display: block;
  padding: 18px;
}

.workspace-embedded-surface {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.workspace-embedded-surface.modal-content,
.fml-monthly-workspace-body,
.wizard-workspace-body {
  display: grid;
  gap: 18px;
}

.workspace-embedded-surface.modal-content {
  padding: 0;
}

.workspace-section-body-host--external .wizard-workspace-body > .modal-content {
  padding: 0;
  background: transparent;
}

.workspace-section-body-host--external .fml-monthly-grid,
.workspace-section-body-host--external .fml-monthly-result-card {
  margin: 0;
}

.workspace-section-body-host--external .fml-monthly-grid {
  align-items: start;
}

.workspace-section-body-host--external .wizard-steps,
.workspace-section-body-host--external .wizard-actions {
  margin: 0;
}

.workspace-section-body-host > div {
  display: grid;
  gap: 16px;
}

.workspace-section-body-host .form-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.workspace-section-body-host .actions {
  margin-top: 4px;
}

.workspace-section-body-host .notification-list,
.workspace-section-body-host .employee-list,
.workspace-section-body-host .command-list {
  display: grid;
  gap: 12px;
}

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

.workspace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.workspace-table th,
.workspace-table td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.10);
  text-align: left;
  vertical-align: middle;
}

.workspace-table th {
  color: #7f86a3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: rgba(246, 248, 255, 0.72);
}

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

.workspace-table td > span:not(.workspace-status) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-table-action {
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.10);
  font-size: 12px;
  white-space: nowrap;
}

.workspace-section-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(238, 240, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.workspace-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 5px;
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.workspace-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
  flex: 0 0 auto;
}

.workspace-status[data-tone="success"] {
  background: #dcfce7;
  color: #166534;
}

.workspace-status[data-tone="warning"] {
  background: #fef9c3;
  color: #854d0e;
}

.workspace-status[data-tone="danger"] {
  background: #fee2e2;
  color: #991b1b;
}

.workspace-status[data-tone="info"] {
  background: #dbeafe;
  color: #1e40af;
}

.workspace-status[data-tone="neutral"] {
  background: rgba(112, 117, 141, 0.10);
  color: #62677d;
}

.workspace-context {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.workspace-context-card {
  padding: 16px;
}

.workspace-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  margin-top: 10px;
}

.workspace-kv span,
.workspace-kv strong {
  padding: 10px 0;
  border-bottom: 1px solid rgba(101, 116, 247, 0.10);
  font-size: 13px;
}

.workspace-kv span {
  color: var(--muted);
}

.workspace-kv strong {
  color: var(--text);
  text-align: right;
}

.workspace-kv span:nth-last-child(2),
.workspace-kv strong:last-child {
  border-bottom: 0;
}

.workspace-timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.workspace-timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(101, 116, 247, 0.10);
  border-radius: 15px;
  background: rgba(246, 248, 255, 0.78);
}

.workspace-timeline-item time {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.workspace-timeline-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.workspace-timeline-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-empty-row {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.workspace-monitoring-grid {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.workspace-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.workspace-health-row strong,
.workspace-health-row span:not(.workspace-status) {
  display: block;
}

.workspace-health-row strong {
  color: var(--text);
  font-size: 14px;
}

.workspace-health-row span:not(.workspace-status) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
}

.status-pill[data-tone="success"] {
  background: rgba(26, 155, 99, 0.12);
  color: #13784d;
}

.status-pill[data-tone="warning"] {
  background: rgba(184, 130, 19, 0.13);
  color: #845b09;
}

.status-pill[data-tone="error"],
.status-pill[data-tone="stopped"] {
  background: rgba(213, 72, 72, 0.12);
  color: #a33131;
}

/* Modal command layer — keeps existing IDs and handlers, improves operator readability. */
.modal-backdrop {
  padding: 28px;
  background:
    radial-gradient(circle at 14% 8%, rgba(101, 116, 247, 0.18), transparent 32%),
    rgba(24, 27, 43, 0.54);
  backdrop-filter: blur(12px) saturate(118%);
}

.modal {
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  padding: 0;
  overflow: auto;
  border-color: rgba(101, 116, 247, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 255, 0.94));
  box-shadow:
    0 34px 92px rgba(24, 27, 43, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  scrollbar-width: thin;
}

.modal::before {
  content: "";
  position: sticky;
  top: 0;
  z-index: 8;
  display: block;
  height: 4px;
  background:
    linear-gradient(90deg, rgba(101, 116, 247, 0.92), rgba(125, 211, 252, 0.72), rgba(132, 92, 246, 0.62));
  box-shadow: 0 0 26px rgba(101, 116, 247, 0.28);
}

.modal-head {
  position: sticky;
  top: 4px;
  z-index: 6;
  margin: 0;
  padding: 22px 24px 20px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.12);
  background:
    radial-gradient(circle at 0 0, rgba(101, 116, 247, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 249, 255, 0.92));
  backdrop-filter: blur(14px);
}

.modal-head::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -1px;
  left: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(101, 116, 247, 0.22), transparent);
  pointer-events: none;
}

.modal-head > div:first-child {
  min-width: 0;
}

.modal-head > div:first-child::before {
  content: "control surface";
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(101, 116, 247, 0.14);
  border-radius: 999px;
  background: rgba(238, 240, 255, 0.76);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.modal-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.modal-head .card-note {
  max-width: 760px;
  margin-top: 8px;
}

.modal-head .card-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-head button,
.modal .card-header-actions button {
  white-space: nowrap;
}

.modal-content {
  padding: 24px 24px 28px;
  gap: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(125, 211, 252, 0.08), transparent 28%),
    transparent;
}

.modal .card {
  border-color: rgba(101, 116, 247, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(65, 72, 130, 0.06);
}

.modal .card:hover {
  box-shadow: 0 16px 38px rgba(65, 72, 130, 0.09);
}

.modal .card > h4:first-child,
.modal .card-header h4,
.monitoring-ack-modal__section h4 {
  letter-spacing: -0.02em;
}

.modal .form-grid {
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.11);
  border-radius: 18px;
  background: rgba(248, 249, 255, 0.66);
}

.modal label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.modal input,
.modal textarea,
.modal select {
  border-color: rgba(101, 116, 247, 0.14);
  background: rgba(255, 255, 255, 0.94);
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  border-color: rgba(101, 116, 247, 0.46);
  box-shadow: 0 0 0 4px rgba(101, 116, 247, 0.10);
  background: #ffffff;
}

.modal input:disabled,
.modal textarea:disabled,
.modal select:disabled,
.modal input[readonly],
.modal textarea[readonly] {
  opacity: 1;
  color: #5f6687;
  -webkit-text-fill-color: #5f6687;
}

.modal input[type="file"] {
  padding: 8px;
  color: var(--muted);
}

.modal input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(101, 116, 247, 0.16);
  border-radius: 11px;
  padding: 8px 11px;
  background: rgba(238, 240, 255, 0.74);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.modal input[type="file"]::file-selector-button:hover {
  border-color: rgba(101, 116, 247, 0.30);
  background: rgba(238, 240, 255, 0.95);
}

.modal .field-locked input,
.modal .field-locked textarea,
.modal .field-locked select {
  background: rgba(238, 240, 255, 0.76);
}

.section-detail-modal,
.notification-editor-modal,
.fml-monthly-modal {
  width: min(1240px, calc(100vw - 44px));
}

.section-detail-body {
  gap: 18px;
}

.section-detail-body > .card,
.section-detail-body > .notification-card {
  margin: 0;
}

.notification-editor-modal .notification-card--editor {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.notification-editor-modal .notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(101, 116, 247, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(238, 240, 255, 0.70));
}

.notification-editor-modal .notification-head h4 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.notification-editor-modal .notification-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-editor-modal .notification-body {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.notification-editor-modal textarea[data-field="template"] {
  min-height: 190px;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.notification-editor-modal .card-note,
.section-detail-modal .card-note {
  line-height: 1.55;
}

.mention-picker-head,
.template-helper__head,
.sql-catalog-admin__head,
.command-sql-catalog__head {
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.mention-option,
.template-helper__item,
.sql-root-card,
.sql-tree-node__button,
.sql-catalog-admin__tree,
.sql-catalog-admin__editor,
.command-sql-catalog {
  border-color: rgba(101, 116, 247, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

.notification-preview {
  border-color: rgba(101, 116, 247, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 240, 255, 0.68));
}

.logs-modal .modal-content {
  gap: 14px;
}

.logs-modal .card-header {
  padding: 14px;
  border: 1px solid rgba(101, 116, 247, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.70);
}

.log-output {
  min-height: 420px;
  border: 1px solid rgba(101, 116, 247, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 0, rgba(101, 116, 247, 0.16), transparent 28%),
    #111421;
  color: #edf1ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 13px;
}

.wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid rgba(101, 116, 247, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.wizard-modal .wizard-steps {
  margin: 18px 24px 20px;
}

/* Operator states: clear empty/warning/success/error surfaces without changing runtime logic. */
.notification-empty,
.directory-empty,
.bot-list-empty,
.report-lab-status,
.fml-monthly-status,
.report-lab-warning,
.fml-monthly-warning,
.cleanup-queue-item__error {
  position: relative;
  overflow: hidden;
}

.notification-empty,
.directory-empty,
.bot-list-empty {
  padding: 18px 18px 18px 48px;
  border-style: dashed;
  border-color: rgba(101, 116, 247, 0.18);
  background:
    radial-gradient(circle at 0 0, rgba(101, 116, 247, 0.08), transparent 28%),
    repeating-linear-gradient(135deg, rgba(101, 116, 247, 0.035) 0 1px, transparent 1px 12px),
    rgba(255, 255, 255, 0.68);
  color: #69708f;
  line-height: 1.55;
}

.notification-empty::before,
.directory-empty::before,
.bot-list-empty::before {
  content: "i";
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.13);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.report-lab-status,
.fml-monthly-status {
  display: grid;
  min-height: 58px;
  align-items: center;
  padding: 15px 16px 15px 48px;
  border-color: rgba(101, 116, 247, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 249, 255, 0.74));
  color: #4f5674;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(65, 72, 130, 0.045);
}

.report-lab-status::before,
.fml-monthly-status::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.18);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.72);
}

.report-lab-status[data-tone="success"],
.fml-monthly-status[data-tone="success"] {
  border-color: rgba(26, 155, 99, 0.24);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(235, 250, 242, 0.76));
  color: #176c48;
}

.report-lab-status[data-tone="success"]::before,
.fml-monthly-status[data-tone="success"]::before {
  background: #21a36c;
}

.report-lab-status[data-tone="error"],
.fml-monthly-status[data-tone="error"] {
  border-color: rgba(213, 72, 72, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 240, 0.78));
  color: #9b2d2d;
}

.report-lab-status[data-tone="error"]::before,
.fml-monthly-status[data-tone="error"]::before {
  background: #d54848;
}

.report-lab-status[data-tone="progress"],
.fml-monthly-status[data-tone="progress"] {
  border-color: rgba(101, 116, 247, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 240, 255, 0.82));
  color: var(--accent-dark);
}

.report-lab-status[data-tone="progress"]::before,
.fml-monthly-status[data-tone="progress"]::before {
  background:
    conic-gradient(from 90deg, rgba(101, 116, 247, 0), rgba(101, 116, 247, 1));
  animation: operatorStateSpin 1.1s linear infinite;
}

.report-lab-warning,
.fml-monthly-warning,
.cleanup-queue-item__error {
  padding-left: 44px;
  border-color: rgba(218, 141, 33, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 230, 0.82));
  color: #805211;
  line-height: 1.5;
}

.report-lab-warning::before,
.fml-monthly-warning::before,
.cleanup-queue-item__error::before {
  content: "!";
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(218, 141, 33, 0.18);
  color: #805211;
  font-weight: 900;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.18), transparent 26%),
    #26324f;
  box-shadow:
    0 18px 46px rgba(24, 27, 43, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.toast.success {
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.18), transparent 26%),
    #1f7a55;
}

.toast.error {
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.18), transparent 26%),
    #a33131;
}

.toast.warning {
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.20), transparent 26%),
    #8a641a;
}

.cleanup-queue-item,
.monitoring-delivery-item,
.monitoring-ack-history-item,
.monitoring-dashboard-option,
.monitoring-dashboard-table-wrap {
  border-color: rgba(101, 116, 247, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 249, 255, 0.74));
  box-shadow: 0 10px 26px rgba(65, 72, 130, 0.045);
}

.monitoring-dashboard-table-wrap {
  border: 1px solid rgba(101, 116, 247, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.monitoring-dashboard-table th {
  background: rgba(238, 240, 255, 0.86);
  color: var(--accent-dark);
}

.monitoring-dashboard-table tbody tr:hover td {
  background: rgba(238, 240, 255, 0.42);
}

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

/* Dense operations surfaces: lists, cards, tables */
.employee-card,
.directory-item,
.notification-card,
.command-item,
.report-lab-job-card,
.fml-monthly-service-card,
.fml-monthly-change-card,
.fml-monthly-reminder,
.fml-monthly-email-preview,
.fml-monthly-email-theme-card,
.sql-root-card,
.project-chat-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(101, 116, 247, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 255, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 30px rgba(65, 72, 130, 0.055);
}

.employee-card::before,
.directory-item::before,
.notification-card::before,
.command-item::before,
.report-lab-job-card::before,
.fml-monthly-service-card::before,
.fml-monthly-change-card::before,
.sql-root-card::before,
.project-chat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(101, 116, 247, 0.78), rgba(132, 92, 246, 0.22));
  opacity: 0.74;
}

.employee-card:hover,
.directory-item:hover,
.notification-card:hover,
.command-item:hover,
.report-lab-job-card:hover,
.fml-monthly-service-card:hover,
.fml-monthly-change-card:hover,
.sql-root-card:hover,
.project-chat-card:hover {
  border-color: rgba(101, 116, 247, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 44px rgba(65, 72, 130, 0.085);
}

.employee-head,
.directory-item__head,
.notification-head,
.command-item__head,
.sql-catalog-admin__head,
.command-sql-catalog__head {
  align-items: flex-start;
}

.employee-head h4,
.notification-head h4,
.command-item__head strong,
.directory-item__head strong,
.sql-root-card__title {
  letter-spacing: -0.02em;
}

.employee-head h4,
.notification-head h4 {
  line-height: 1.18;
}

.directory-item__head .card-note,
.command-item__head .card-note {
  margin-top: 4px;
}

.employee-card .notification-actions,
.notification-card .notification-actions,
.directory-item .card-header-actions {
  gap: 8px;
}

.employee-card .notification-actions button,
.notification-card .notification-actions button,
.directory-item .card-header-actions button,
.command-item__toggle,
.fml-monthly-email-actions button,
.report-lab-job-card button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
}

.employee-details-grid,
.directory-item__meta {
  padding-top: 10px;
  border-top: 1px solid rgba(101, 116, 247, 0.10);
}

.directory-item__meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.directory-item__meta div,
.employee-details-grid div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.employee-tag,
.command-badge,
.stat-chip,
.project-chat-pill,
.fml-monthly-email-chip-list span,
.fml-monthly-source-note span {
  border: 1px solid rgba(101, 116, 247, 0.13);
  background: rgba(238, 240, 255, 0.64);
  color: var(--accent-dark);
}

.command-item__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.command-badges {
  justify-content: flex-end;
}

.command-intent,
.command-sql-catalog,
.notification-preview,
.mention-option,
.mention-empty,
.template-helper__item,
.profile-grid div,
.profile-project-item {
  border-color: rgba(101, 116, 247, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

.command-intent code,
.card-note code {
  border-radius: 8px;
  padding: 2px 5px;
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
}

.notification-card--summary {
  padding: 16px 18px;
}

.notification-card--summary .notification-head {
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
}

.notification-card--summary .notification-actions {
  max-width: 520px;
}

.notification-empty,
.directory-empty {
  border-color: rgba(101, 116, 247, 0.18);
  background:
    repeating-linear-gradient(135deg, rgba(101, 116, 247, 0.045) 0 1px, transparent 1px 12px),
    rgba(255, 255, 255, 0.66);
}

.fml-monthly-table,
.fml-monthly-email-table-wrap {
  border-color: rgba(101, 116, 247, 0.16);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(65, 72, 130, 0.045);
}

.fml-monthly-table-row {
  align-items: center;
}

.fml-monthly-table-head,
.fml-monthly-email-table th {
  background:
    linear-gradient(180deg, rgba(238, 240, 255, 0.98), rgba(248, 249, 255, 0.94));
  color: var(--accent-dark);
  font-size: 12px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.fml-monthly-email-table td {
  color: var(--text);
}

.fml-monthly-email-table tbody tr:hover td,
.fml-monthly-table-row:not(.fml-monthly-table-head):hover {
  background: rgba(238, 240, 255, 0.42);
}

.fml-monthly-email-preview {
  padding: 22px;
}

.fml-monthly-email-block {
  padding-top: 4px;
}

.fml-monthly-email-block h5 {
  color: var(--accent-dark);
}

.fml-monthly-email-theme-card > div {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.10);
}

.fml-monthly-email-theme-card li {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(101, 116, 247, 0.10);
}

.fml-monthly-email-theme-card li:last-child {
  border-bottom: none;
}

.fml-monthly-change-card {
  border-left: 0;
}

.fml-monthly-change-card small {
  line-height: 1.45;
}

.report-lab-job-card pre,
.sql-preview__code,
.notification-preview__details pre {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 0 0, rgba(101, 116, 247, 0.18), transparent 30%),
    #111421;
  color: #edf1ff;
}

.report-lab-warning {
  border-color: rgba(218, 141, 33, 0.22);
  background: rgba(255, 250, 236, 0.72);
}

.project-chat-pill {
  border-radius: 16px;
}

/* Final FML/report polish: dense analytical output without changing generated data. */
.fml-monthly-result-card {
  border-color: rgba(101, 116, 247, 0.14);
  background:
    radial-gradient(circle at 100% 0, rgba(125, 211, 252, 0.08), transparent 26%),
    rgba(255, 255, 255, 0.92);
}

.fml-monthly-result-card > .card-header {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(101, 116, 247, 0.10);
}

.fml-monthly-source-note,
.fml-monthly-delta-list {
  align-items: center;
}

.fml-monthly-source-note span,
.fml-monthly-delta-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.fml-monthly-kpi {
  min-height: 118px;
  border-color: rgba(101, 116, 247, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 255, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 30px rgba(65, 72, 130, 0.055);
}

.fml-monthly-kpi strong {
  letter-spacing: -0.055em;
}

.fml-monthly-reminder {
  border-left: 4px solid rgba(101, 116, 247, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 255, 0.78));
}

.fml-monthly-reminder--ok {
  border-left-color: #1a9b63;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(235, 250, 242, 0.78));
}

.fml-monthly-reminder--soft {
  border-left-color: #d08a21;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 232, 0.82));
}

.fml-monthly-reminder--strict,
.fml-monthly-reminder--toxic {
  border-left-color: #d54848;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 241, 0.80));
}

.fml-monthly-section {
  min-width: 0;
}

.fml-monthly-section h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.fml-monthly-section h4::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(101, 116, 247, 0.10);
}

.fml-monthly-service-card h5,
.fml-monthly-change-card strong {
  color: var(--text);
  letter-spacing: -0.015em;
}

.fml-monthly-service-card ul {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.fml-monthly-service-card li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(101, 116, 247, 0.12);
  line-height: 1.4;
}

.fml-monthly-service-card li:last-child {
  border-bottom: 0;
}

.fml-monthly-service-card li strong {
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(101, 116, 247, 0.10);
  color: var(--accent-dark);
  font-size: 12px;
  text-align: center;
}

.fml-monthly-comparison-card {
  min-height: 96px;
  align-content: center;
}

.fml-monthly-email-preview {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 253, 255, 0.92));
}

.fml-monthly-email-subject strong {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.fml-monthly-email-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  margin-right: -22px;
  margin-bottom: -22px;
  margin-left: -22px;
  padding: 14px 22px;
  border-top-color: rgba(101, 116, 247, 0.12);
  border-radius: 0 0 18px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.fml-monthly-letter-draft {
  display: grid;
  gap: 8px;
  padding: 16px 16px 16px 38px;
  border: 1px solid rgba(101, 116, 247, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

/* Theme coverage for late-added operational surfaces. */
html[data-theme="samurai"] .modal::before {
  background: linear-gradient(90deg, var(--samurai-neon-hot), var(--samurai-neon-cold), var(--samurai-neon-warm));
  box-shadow:
    0 0 20px rgba(74, 234, 255, 0.30),
    0 0 28px rgba(255, 62, 191, 0.22);
}

html[data-theme="samurai"] .modal-head,
html[data-theme="samurai"] .modal-content,
html[data-theme="samurai"] .fml-monthly-result-card,
html[data-theme="samurai"] .fml-monthly-email-actions {
  background:
    linear-gradient(180deg, rgba(35, 12, 48, 0.94), rgba(18, 8, 30, 0.92));
}

html[data-theme="samurai"] .modal-head > div:first-child::before {
  border-color: rgba(74, 234, 255, 0.22);
  background: rgba(255, 62, 191, 0.13);
  color: #f9dcff;
}

html[data-theme="samurai"] .fml-monthly-kpi,
html[data-theme="samurai"] .fml-monthly-reminder,
html[data-theme="samurai"] .fml-monthly-email-preview,
html[data-theme="samurai"] .fml-monthly-letter-draft,
html[data-theme="samurai"] .monitoring-dashboard-table-wrap {
  border-color: rgba(74, 234, 255, 0.20);
  background:
    linear-gradient(180deg, rgba(47, 18, 64, 0.88), rgba(26, 12, 38, 0.92));
}

html[data-theme="samurai"] .fml-monthly-table-head,
html[data-theme="samurai"] .fml-monthly-email-table th,
html[data-theme="samurai"] .monitoring-dashboard-table th {
  background: rgba(74, 234, 255, 0.10);
  color: #e2f8ff;
}

html[data-theme="samurai"] .fml-monthly-email-table td,
html[data-theme="samurai"] .fml-monthly-service-card li,
html[data-theme="samurai"] .fml-monthly-email-theme-card li {
  color: #f6e9fb;
  border-color: rgba(74, 234, 255, 0.12);
}

html[data-theme="samurai"] .fml-monthly-section h4::before {
  background: var(--samurai-neon-cold);
  box-shadow: 0 0 0 5px rgba(74, 234, 255, 0.10), 0 0 18px rgba(74, 234, 255, 0.22);
}

html[data-theme="pastel"] .fml-monthly-result-card,
html[data-theme="pastel"] .fml-monthly-kpi,
html[data-theme="pastel"] .fml-monthly-email-preview,
html[data-theme="pastel"] .fml-monthly-letter-draft {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 244, 255, 0.78));
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .hero-summary-rail { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-section-body-host .form-grid { grid-template-columns: 1fr; }
  .workspace-card-grid,
  .workspace-card-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mention-picker-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .mention-picker-tools {
    justify-content: flex-start;
  }
  .mention-picker { grid-template-columns: 1fr; }
  .fml-monthly-grid,
  .fml-monthly-kpis,
  .fml-monthly-service-grid,
  .fml-monthly-comparison-grid,
  .fml-monthly-email-theme-grid {
    grid-template-columns: 1fr;
  }
  .fml-monthly-table-row {
    grid-template-columns: 1fr;
  }
  .directory-item__meta,
  .command-item__head,
  .notification-card--summary .notification-head {
    grid-template-columns: 1fr;
  }
  .command-badges,
  .notification-card--summary .notification-actions {
    justify-content: flex-start;
  }
  .theme-switcher {
    width: 100%;
    justify-content: space-between;
    margin: 4px 0 0;
  }
  .theme-switcher__group {
    width: 100%;
    justify-content: space-between;
  }
  .theme-switcher__button {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 720px) {
  .session-bar {
    position: static;
    align-items: flex-start;
    padding: 14px;
  }

  .session-bar,
  .session-bar__meta,
  .theme-switcher {
    flex-wrap: wrap;
  }

  .theme-switcher {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 6px 0 0;
  }

  .theme-switcher__label {
    width: 100%;
    min-width: 0;
  }

  .theme-switcher__group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    gap: 3px;
    padding: 3px;
  }

  .workspace-card-grid,
  .workspace-card-grid--three {
    grid-template-columns: 1fr;
  }

  .workspace-panel__head,
  .workspace-health-row {
    display: grid;
  }

  .workspace-kv {
    grid-template-columns: 1fr;
  }

  .workspace-kv strong {
    padding-top: 0;
    text-align: left;
  }

  .theme-switcher__button {
    min-width: 0;
    overflow: hidden;
    padding-inline: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .layout {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 14px;
    border-right: 0;
  }

  .sidebar-shell {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .brand {
    padding: 18px;
  }

  .brand-mark {
    align-items: flex-start;
    flex-wrap: wrap;
    display: grid;
    justify-items: start;
  }

  .sidebar-list-meta {
    display: none;
  }

  .brand-mark__status {
    max-width: 100%;
    white-space: normal;
  }

  .content {
    padding: 14px;
  }

  .hero,
  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-actions,
  .card-header-actions,
  .notification-actions,
  .fml-monthly-email-actions {
    justify-content: flex-start;
  }

  .hero-actions button,
  .card-header-actions button,
  .notification-actions button,
  .fml-monthly-email-actions button {
    flex: 1 1 150px;
  }

  .modal-backdrop {
    padding: 10px;
    place-items: stretch;
  }

  .modal,
  .section-detail-modal,
  .notification-editor-modal,
  .fml-monthly-modal,
  .report-lab-modal,
  .directory-modal,
  .wizard-modal,
  .logs-modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .modal-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .modal-head .card-header-actions {
    width: 100%;
  }

  .modal-head .card-header-actions button,
  .modal-head > button {
    flex: 1 1 140px;
  }

  .modal-content {
    padding: 18px;
  }

  .fml-monthly-table,
  .fml-monthly-email-table-wrap,
  .monitoring-dashboard-table-wrap {
    margin-right: -6px;
    margin-left: -6px;
    border-radius: 14px;
  }

  .fml-monthly-email-actions {
    position: static;
    margin: 0;
    padding: 14px 0 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 460px) {
  .session-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .session-bar__meta {
    width: 100%;
    min-width: 0;
  }

  #logout-btn {
    width: fit-content;
  }

  .theme-switcher {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: calc(100vw - 28px);
    min-width: 0;
  }

  .theme-switcher__label {
    width: 100%;
  }

  .theme-switcher__group {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-basis: 100%;
    gap: 4px;
  }

  .theme-switcher__button {
    min-width: 0;
    width: 100%;
    padding: 8px 4px;
    font-size: 11px;
  }

  .brand h1,
  .hero h2 {
    font-size: 24px;
  }

  .brand,
  .brand h1,
  .brand p,
  .sidebar-section,
  .sidebar-current,
  .bot-list,
  .bot-item,
  .sidebar-nav-item {
    min-width: 0;
  }

  .brand-mark {
    display: grid;
    justify-items: start;
  }

  .brand h1,
  .brand p,
  .bot-item strong,
  .sidebar-nav-item span:last-child {
    overflow-wrap: anywhere;
  }

  .sidebar-section,
  .bot-item,
  .sidebar-current,
  .operations-widget,
  .modal .form-grid {
    border-radius: 18px;
  }

  .bot-item,
  .sidebar-nav-item {
    min-width: 0;
  }

  .bot-item__action {
    flex: 0 0 auto;
  }

  .operations-widget__grid,
  .dashboard-section-metrics {
    grid-template-columns: 1fr;
  }

  .fml-monthly-kpi {
    min-height: auto;
  }

  .fml-monthly-email-table {
    min-width: 540px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .report-lab-btn-busy,
  .report-lab-btn-ready,
  .report-lab-btn-busy::after {
    animation: none;
  }
}

body[data-role="report_operator"] .layout {
  grid-template-columns: minmax(320px, 420px);
  justify-content: center;
}

body[data-role="report_operator"] .sidebar {
  border-right: 0;
  padding: 36px 24px;
}

body[data-role="report_operator"] .sidebar-shell {
  position: static;
  top: auto;
}

body[data-role="report_operator"] .admin-shell-only {
  display: none;
}
