@import url('https://googleapis.com'); 

/* ==========================================================================
   БАЗОВЫЕ СИСТЕМНЫЕ СТИЛИ (ВАША ОРИГИНАЛЬНАЯ ОСНОВА)
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
} 

body { 
    background-color: #e5e7eb; 
    font-family: 'Roboto', sans-serif; 
    color: #1f2937; 
    line-height: 1.4; 
} 

/* ХЕДЕР 60px */ 
.site-header { 
    height: 60px; 
    padding: 0 40px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #e5e7eb; 
    border-bottom: 1px solid #d1d5db; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
} 

.site-content { 
    padding: 40px; 
    width: 100%; 
} 

.header-menu { 
    display: flex; 
    gap: 25px; 
    align-items: center; 
} 

.header-menu a { 
    color: #4b5563; 
    text-decoration: none; 
    font-size: 18px; 
    font-weight: 500; 
    padding-bottom: 5px; 
    border-bottom: 2px solid transparent; 
} 

.header-menu a.active { 
    color: #0056b3; 
    border-bottom-color: #0056b3; 
} 

/* ФОРМА АВТОРИЗАЦИИ */ 
.header-auth { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
} 

.auth-form { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
} 

.auth-form input { 
    height: 30px; 
    padding: 0 10px; 
    border: 1px solid #cbd5e1; 
    border-radius: 2px; 
    font-size: 12px; 
} 

/* КНОПКИ */ 
.btn-unit { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    height: 32px; 
    padding: 0 16px; 
    font-size: 11px; 
    text-transform: uppercase; 
    background: #475569; 
    color: #fff !important; 
    cursor: pointer; 
    border-radius: 2px; 
    text-decoration: none; 
    border: none; 
} 

.btn-unit:hover { 
    background: #334155; 
} 

.btn-delete { 
    color: #dc2626 !important; 
    background: transparent; 
    border: 1px solid #fecaca !important; 
    height: 24px; 
    padding: 0 8px; 
    min-width: auto; 
    font-size: 10px; 
} 

/* ТАБЛИЦЫ */ 
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 30px; 
    background: transparent; 
    table-layout: fixed; 
} 

th { 
    padding: 12px 10px; 
    border-bottom: 1px solid #cbd5e1; 
    text-align: left; 
    font-size: 11px; 
    color: #64748b; 
    text-transform: uppercase; 
} 

td { 
    padding: 10px 10px; 
    border-bottom: 1px solid #d1d5db; 
    vertical-align: middle; 
    font-size: 13px; 
}

.table-hover tbody tr:hover { 
    background-color: rgba(0,0,0,0.03); 
} 

/* ИНПУТЫ */ 
input[type="text"], input[type="number"], select, textarea { 
    border: 1px solid #cbd5e1; 
    border-radius: 2px; 
    padding: 0 10px; 
    height: 32px; 
    font-size: 13px; 
    background: #fff; 
    outline: none; 
    width: 100%; 
} 

input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
} 

input[type=number] { 
    -moz-appearance: textfield; 
} 

/* РЕДАКТОР (ТКАЧЪ И ОБРАЗНИКЪ) */ 
.editor-frame { 
    display: flex; 
    height: 400px; 
    border: 1px solid #cbd5e1; 
    background: #fff; 
    margin: 30px 0 25px 0; 
    overflow: hidden; 
    resize: vertical; 
} 

.tkach-numbers { 
    width: 60px; 
    background: #f1f5f9; 
    border-right: 1px solid #cbd5e1; 
    text-align: right; 
    color: #94a3b8; 
    font-family: monospace; 
    font-size: 13px; 
    line-height: 21px; 
    flex-shrink: 0; 
    overflow-y: hidden;
} 

.tkach-textarea { 
    flex: 1; 
    border: none; 
    padding: 30px 10px 10px 10px; 
    font-family: monospace; 
    font-size: 14px; 
    line-height: 21px; 
    outline: none; 
    white-space: pre-wrap; 
    word-wrap: break-word; 
    overflow-x: hidden; 
    overflow-y: auto; 
    height: 100%; 
} 

.goto-input-small { 
    width: 100%; 
    height: 25px; 
    border: none; 
    border-bottom: 1px solid #cbd5e1; 
    font-size: 10px; 
    text-align: center; 
    margin-bottom: 5px; 
    background: #fff; 
} 

/* ПАНЕЛИ И КАРТОЧКИ */ 
.section-block { 
    margin-top: 40px; 
    width: 100%; 
} 

.add-panel { 
    background: rgba(255,255,255,0.4); 
    border: 1px solid #cbd5e1; 
    padding: 20px; 
    margin-top: 15px; 
} 

.upload-panel { 
    background: rgba(255,255,255,0.5); 
    border: 1px solid #cbd5e1; 
    padding: 15px; 
    margin: 20px 0; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
} 

.card-item { 
    background: #fff; 
    border: 1px solid #cbd5e1; 
    padding: 12px; 
    margin-bottom: 10px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-size: 14px; 
} 

.card-img-box { 
    width: 80px; 
    height: 80px; 
    background: #ccc; 
    border: 1px solid #cbd5e1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
    flex-shrink: 0; 
    overflow: hidden; 
} 

.card-img-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
} 

.flex-between { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
} 

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

.hidden { 
    display: none !important; 
} 

.mb-25 { 
    margin-bottom: 25px !important; 
}

/* ==========================================================================
   ИЗОЛИРОВАННЫЙ БЛОК СТИЛЕЙ ДЛЯ МОДУЛЯ «ЛИКЪ» И ИНТЕРАКТИВНОГО ЧЕРЧЕНИЯ
   ========================================================================== */
.lik-source-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lik-main-block {
    display: flex;
    height: 333px;
    width: 100%;
    gap: 0px;
    margin-bottom: 40px;
    align-items: stretch;
}

.lik-passport-box {
    width: 333px;
    height: 333px;
    background: #0f172a;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 2px 0 0 2px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
}

.lik-media-frame {
    width: 270px;
    height: 270px;
    position: absolute;
    top: 15px;
    left: 31px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: transparent;
}

.lik-media-frame img, .lik-media-frame canvas {
    width: 270px !important;
    height: 270px !important;
    object-fit: contain;
    display: none;
    margin: 0;
    padding: 0;
}

.lik-media-frame .view-active {
    display: block !important;
}

.lik-media-tabs {
    width: 100%;
    height: 32px;
    display: flex;
    background: #1e293b;
    border-top: 1px solid #cbd5e1;
    margin: 0;
    padding: 0;
}

.lik-media-tab-btn {
    flex: 1;
    height: 32px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    border-right: 1px solid #334155;
    margin: 0;
    padding: 0;
}

.lik-media-tab-btn:last-child {
    border-right: none;
}

.lik-media-tab-btn.active {
    background: #fff;
    color: #0f172a;
}

.lik-info-box {
    flex: 1;
    height: 333px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0 2px 2px 0;
    box-sizing: border-box;
}

.lik-tabs-header {
    height: 48px;
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    margin: 0;
    padding: 0;
}

.lik-tab-btn {
    height: 47px;
    padding: 0 25px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    color: #64748b;
    background: transparent;
    border: none;
    border-right: 1px solid #cbd5e1;
    cursor: pointer;
    outline: none;
}

.lik-tab-btn.active {
    background: #fff;
    color: #0056b3;
    font-weight: 600;
    border-bottom: 2px solid #0056b3;
}

.lik-tabs-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
}

.lik-tab-panel {
    display: none;
}

.lik-tab-panel.active {
    display: block;
}

/* СТИЛИ ОКОН ЧЕРЧЕНИЯ И ЛУПЫ-ПОДСКАЗКИ */
.vector-preview-frame {
    position: relative;
    width: 120px;
    height: 120px;
    background: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#js-pre {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

#js-pre img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#js-pre-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
}

/* Окно лупы-линзы 4-кратного увеличения */
.zoom-lens-container {
    position: absolute;
    width: 90px;
    height: 90px;
    border: 2px solid #38bdf8;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    overflow: hidden;
    pointer-events: none; /* Пропускает клики сквозь себя на основной холст */
    display: none;
    z-index: 50;
    background: #0f172a;
}

#js-zoom-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated; /* Предотвращает размытие пикселей при увеличении */
}

.manual-vector-toolbar {
    display: none;
    width: 120px;
    margin-top: 8px;
}

.manual-vector-toolbar .btn-delete {
    width: 100%;
    height: 24px;
    font-size: 9px;
    letter-spacing: 0.5px;
    background: #ef4444;
    color: #fff !important;
    border: none !important;
}
/* --- ПАНЕЛЬ ИНСТРУМЕНТОВ ДЛЯ ОКРУЖНОСТЕЙ И ДУГ --- */
.lik-toolbar-row {
    display: flex;
    gap: 8px;
    width: 240px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-tool {
    flex: 1;
    min-width: 50px;
    height: 24px;
    font-size: 9px;
    text-transform: uppercase;
    background: #475569;
    color: #fff !important;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease;
}

.btn-tool:hover {
    background: #334155;
}

.btn-tool.active {
    background: #0284c7; /* Подсветка активного инструмента */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.radio-toolbar-box {
    width: 240px;
    background: #1e293b;
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radio-toolbar-box span {
    color: #94a3b8;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 600;
}
/* --- СТИЛИ ИНТЕРФЕКТИВНОГО ГЕОМЕТРИЧЕСКОГО ЧЕРЧЕНИЯ В ОБРАЗНИКЕ (240x240) --- */
.vector-preview-frame {
    position: relative;
    width: 240px;
    height: 240px;
    background: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#js-pre {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

#js-pre img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#js-pre-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
}

/* Расширенный тулбар управления геометрическими примитивами */
.manual-vector-toolbar {
    display: none; /* Управляется через JS после кропа */
    width: 240px;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: #1e293b;
    border-radius: 2px;
    box-sizing: border-box;
}

.tool-group-title {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tool-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    margin-bottom: 4px;
}

/* Кнопки инструментов */
.btn-tool {
    height: 24px;
    background: #334155;
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid #475569;
    border-radius: 2px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s ease;
}

.btn-tool:hover {
    background: #475569;
    color: #fff;
}

.btn-tool.active {
    background: #0284c7;
    color: #fff;
    border-color: #38bdf8;
    font-weight: 600;
}

.manual-vector-toolbar .btn-delete {
    width: 100%;
    height: 26px;
    font-size: 10px;
    letter-spacing: 0.5px;
    background: #ef4444;
    color: #fff !important;
    border: none !important;
    text-transform: uppercase;
    margin-top: 4px;
}

.manual-vector-toolbar .btn-delete:hover {
    background: #dc2626;
}
