/* Тёмная тема в стиле операторского дашборда (webapp.py) */
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px 16px;
  background: #0f141a; color: #cfd8e3;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}
.c { max-width: 1080px; margin: 0 auto; }
h1 { font-size: 1.5em; color: #e8eef5; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 1.05em; color: #e8eef5; font-weight: 600; margin: 18px 0 10px; }
.sub { color: #667788; font-size: .9em; margin: 0 0 18px; }
.hint { color: #667788; font-size: .85em; margin: 8px 0 12px; }

/* Вкладки */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #223040; padding-bottom: 8px; margin-bottom: 16px; }
.tab {
  background: #16202a; color: #8899aa; border: 1px solid #223040;
  border-radius: 8px 8px 0 0; padding: 8px 16px; cursor: pointer; font-size: .95em;
}
.tab:hover { color: #cfd8e3; }
.tab.active { background: #1d2c3b; color: #5a9fd4; border-bottom-color: #1d2c3b; }
.panel { display: none; }
.panel.active { display: block; }

/* Карточки и формы */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
/*.stack — одна колонка во всю ширину (карточки голосов в «Приветствиях») */
.cards.stack { grid-template-columns: 1fr; }
.card {
  background: #16202a; border: 1px solid #223040; border-radius: 10px; padding: 14px 16px;
}
.card h3 { margin: 0 0 10px; font-size: 1em; color: #e8eef5; display: flex; justify-content: space-between; align-items: center; }
label { display: block; margin: 8px 0 3px; color: #8899aa; font-size: .85em; }
input[type=text], select, textarea {
  width: 100%; background: #0f141a; color: #cfd8e3;
  border: 1px solid #2a3a4a; border-radius: 6px; padding: 7px 10px; font-size: .95em;
}
textarea { min-height: 74px; resize: vertical; font-family: inherit; }
textarea.mono { font-family: Consolas, monospace; font-size: .85em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #5a9fd4; }
input[type=range] { width: 100%; accent-color: #5a9fd4; }

/* Кнопки */
button {
  background: #223040; color: #cfd8e3; border: 1px solid #2a3a4a;
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: .95em;
}
button:hover { background: #2a3a4a; }
button.primary { background: #1d3a52; border-color: #2a5f8a; color: #9fd0ff; }
button.primary:hover { background: #245072; }
button.danger { background: #3a1d22; border-color: #6a2a33; color: #ff9fa8; }
button.danger:hover { background: #52242c; }
button.small { padding: 3px 10px; font-size: .82em; border-radius: 6px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.status { font-size: .88em; color: #8899aa; }
.status.ok { color: #00d4aa; }
.status.err { color: #e74c3c; }

/* Бейджи */
.badge { font-size: .75em; padding: 2px 8px; border-radius: 10px; background: #223040; color: #8899aa; }
.badge.ok { background: #103328; color: #00d4aa; }
.badge.warn { background: #3a2f10; color: #f39c12; }
.badge.out { background: #1d3a52; color: #9fd0ff; }
.badge.in { background: #2d1d3a; color: #c79fff; }

/* Список + форма (сценарии/компании) */
.split { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .item {
  background: #16202a; border: 1px solid #223040; border-radius: 8px;
  padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.list .item:hover { border-color: #2a3a4a; }
.list .item.active { border-color: #5a9fd4; background: #1d2c3b; }
.list .item .key { font-weight: 600; color: #e8eef5; }
.list .add { border-style: dashed; color: #8899aa; text-align: center; }
.form .card { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.row label { margin: 0; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* YAML */
#yamlText {
  width: 100%; min-height: 480px; font-family: Consolas, monospace; font-size: .85em;
  background: #0f141a; color: #cfd8e3; border: 1px solid #2a3a4a; border-radius: 8px; padding: 12px;
}
