:root {
  --bg: #f4efe6;
  --surface: #fffaf2;
  --surface-strong: #f2e6d6;
  --text: #1f1a17;
  --muted: #6d645b;
  --accent: #8a2f1d;
  --accent-dark: #602012;
  --line: #d8c8b4;
  --shadow: 0 18px 40px rgba(73, 42, 18, 0.12);
  --radius: 20px;
}

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

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

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

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

.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: 30;
  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.92);
  backdrop-filter: blur(12px);
}

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

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

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

.bot-item.active,
.bot-item:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

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

.content {
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(242,230,214,0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.notification-head h4 {
  margin: 0;
}

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

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

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

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

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

.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: 480px;
  overflow: auto;
  background: #191613;
  color: #f1e9db;
  border-radius: 14px;
  padding: 16px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .mention-picker { grid-template-columns: 1fr; }
}
