/* ... (сохраняем старые переменные :root) ... */
:root {
  --bg-dark: #121214;
  --bg-card: #1a1a1e;
  --accent: #00e676;
  --accent-blue: #2979ff;
  --accent-error: #ff1744;
  --text-main: #e0e0e6;
  --text-muted: #757580;
  --border: #2a2a32;
  --pink: pink;
  --blue: #3b89ff;
  --purple: purple;
  --red: red;
  --yellow: yellow;
  --green: #00e676;
}

/* Универсальное правило для всех элементов */
*, *::before, *::after {
  box-sizing: border-box;
}

.red{
    color: var(--red);
}
.yellow{
    color: var(--yellow);
}
.pink{
    color: var(--pink);
}
.blue{
    color: var(--blue);
}
.green{
    color: var(--green);
}
.purple{
    color: var(--purple);
}
.grey{
    color: var(--text-muted);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: sans-serif;
  margin: 0; padding: 20px;
  display: flex; flex-direction: column;
  height: 100vh; box-sizing: border-box;
}


.block{
    margin-bottom: 10px; padding: 10px; background: #2d2d38; border-radius: 4px;
}

.legend{
    margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted); line-height: 1.6;
}

.dashboard {
  display: grid;
  /* ТРЕТЬЯ КОЛОНКА: 280px (сайб) | 350px (контроль) | 1fr (канвас) */
  grid-template-columns: 400px  1fr 300px;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.sidebar, .control-panel, .canvas-side {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-height: 0;
}

.widget-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Контрольная панель */
.operation-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
}

.form-select, .form-input {
    width: 100%;
    background: #2d2d38;
    border: 1px solid var(--border);
    color: white;
    padding: 8px;
    border-radius: 4px;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.form-col { flex: 1; }

.form-sublabel {
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
}

/* JSON окно */
.figC {
    flex: 1;
    margin-top: 10px;
    background: #0d0d0f;
    color: #00ff77;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid var(--border);
    overflow: auto;
    white-space: pre;
    border-radius: 4px;
}

/* Canvas */
.canvas-side {
    padding: 0;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    margin: 10px;
    border-radius: 4px;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 100%;
}

.canvas-title {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
}

/* Статистика */
.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}
.success { color: var(--accent); }
.error { color: var(--accent-error); }
