:root { 
    --bg: #2b2b2b;          /* Фон за холстом */
    --panel: #3c3f41;       /* Основной цвет панелей */
    --panel-light: #4e5254; /* Цвет кнопок */
    --accent: #3498db; 
    --vcc: #ff4d4d; 
    --gnd: #1a1a1a; 
    --multiple: #00e5ff;
    --text: #e0e0e0;
    --border: #1a1a1a;      /* Разделители */
}

/* Базовые настройки для предотвращения смещений */
* { box-sizing: border-box; }

body, html { 
    margin: 0; 
    height: 100%; 
    width: 100%;
    overflow: hidden; 
    background: var(--bg); 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    color: var(--text); 
    display: flex;
    flex-direction: column;
}

/* ВЕРХНЯЯ ПАНЕЛЬ */
.topbar {
    height: 50px;
    min-height: 50px;
    background: var(--panel);
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo {
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
    font-size: 18px;
}

.status-info {
    font-size: 12px;
    color: #888;
}

/* МАКЕТ ПРИЛОЖЕНИЯ */
.app { 
    display: flex; 
    flex: 1; 
    height: calc(100vh - 50px); /* Занимает всё под шапкой */
    overflow: hidden;
}

/* САЙДБАРЫ */
.sidebar { 
    width: 230px; 
    min-width: 230px;
    background: var(--panel); 
    display: flex; 
    flex-direction: column; 
    padding: 15px; 
    gap: 10px; 
    z-index: 10; 
    overflow-y: auto;
}

.sidebar.left { border-right: 1px solid #1a1a1a; }
.sidebar.right { border-left: 1px solid #1a1a1a; width: 250px; font-size: 13px; }

.sidebar h3 { font-size: 14px; margin: 0; color: var(--accent); border-bottom: 1px solid #555; padding-bottom: 5px; text-transform: uppercase; }
.sidebar h4 { font-size: 11px; margin: 10px 0 5px 0; color: #999; text-transform: uppercase; }

/* КНОПКИ */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.comp-btn, button { 
    padding: 10px; 
    cursor: pointer; 
    border: 1px solid #2a2a2a; 
    border-radius: 6px; 
    background: var(--panel-light); 
    font-size: 11px; 
    color: #fff;
    text-align: center; 
    transition: 0.2s; 
}

.comp-btn:hover, button:hover { border-color: var(--accent); background: #5c6164; }
.btn-main { background: #2980b9; border: none; font-weight: bold; width: 100%; text-transform: uppercase; }
.btn-main:hover { background: #3498db; }

hr { border: 0; border-top: 1px solid #555; width: 100%; margin: 5px 0; }

/* ЛЕГЕНДА */
.legend-group p { margin: 5px 0; line-height: 1.4; color: #bbb; display: flex; align-items: center; }
.legend-group span { color: #fff; font-weight: bold; width: 55px; display: inline-block; font-size: 11px; }

/* ЦЕНТРАЛЬНАЯ ОБЛАСТЬ */
.workspace { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: #333; 
    overflow: auto; 
    position: relative;
    padding: 40px;
}

canvas { 
    background: #1a4d1a; 
    border: 10px solid #3d2b1f; 
    cursor: crosshair; 
    box-shadow: 0 0 40px rgba(0,0,0,0.5); 
    flex-shrink: 0; /* Чтобы плата не сжималась */
}

/* ТУЛТИП (Принудительно темный) */
#tooltip { 
    position: fixed; 
    pointer-events: none; 
    background: rgba(20, 20, 20, 0.98) !important; /* Угольно-черный */
    color: #ffffff !important;                   /* Чисто белый текст */
    padding: 12px; 
    border: 1px solid var(--accent); 
    border-radius: 6px; 
    display: none; 
    z-index: 1000; 
    font-size: 12px; 
    min-width: 140px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.5); 
}

/* МОДАЛЬНОЕ ОКНО */
.modal-ov { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.8); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 200; 
    backdrop-filter: blur(4px); 
}

.modal { 
    background: var(--panel); 
    padding: 25px; 
    border-radius: 10px; 
    width: 300px; 
    border: 1px solid #1a1a1a; 
}

.modal input { 
    width: 100%; 
    padding: 10px; 
    margin: 10px 0; 
    background: #252525; 
    border: 1px solid #1a1a1a; 
    color: #fff; 
    border-radius: 4px; 
}

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
