/* === ОСНОВНОЙ КОНТЕЙНЕР === */
.mc-app {
    max-width: 950px;
    margin: 0 auto 30px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 25px;
    box-sizing: border-box;
}

/* === ЗАГОЛОВКИ === */
.mc-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90e2;
    text-transform: uppercase;
    color: #2c3e50;
    display: flex;
    align-items: center;
}
.mc-title::before { content:''; display:inline-block; width:6px; height:6px; background:#4a90e2; border-radius:50%; margin-right:10px; }

/* === ПЛИТКИ ТИПОВ (В ОДНУ ЛИНИЮ) === */
.mc-type-grid { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 30px; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    padding-bottom: 5px; 
}
.mc-type-grid::-webkit-scrollbar { height: 4px; }
.mc-type-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.mc-tile {
    flex: 1; 
    min-width: 70px;
    background: #f8f9fa; 
    border: 1px solid #dfe3e6;
    border-radius: 6px; 
    padding: 10px 4px; 
    text-align: center; 
    cursor: pointer;
    font-size: 12px; 
    font-weight: 600; 
    transition: all 0.2s; 
    color: #555;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    white-space: nowrap;
}
.mc-tile span { 
    font-size: 22px; 
    display: block; 
    margin-bottom: 6px; 
    font-weight: 900; 
    color: #aab; 
    line-height: 1; 
}
.mc-tile:hover { border-color: #4a90e2; background: #fff; transform: translateY(-2px); box-shadow: 0 3px 10px rgba(74, 144, 226, 0.15); }
.mc-tile.active { background: #4a90e2; border-color: #4a90e2; color: #fff; }
.mc-tile.active span { color: #fff; }

/* === МАКЕТ === */
.mc-layout { display: flex; gap: 30px; align-items: stretch; }
.mc-col-left { flex: 1; min-width: 300px; display: flex; flex-direction: column; }
.mc-col-right { width: 340px; flex-shrink: 0; }
@media (max-width: 800px) { .mc-layout { flex-direction: column; } .mc-col-right { width: 100%; } }

/* === ВЫБОР СТАНДАРТА === */
.mc-std-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.mc-std-tile { padding: 6px 12px; font-size: 13px; border: 1px solid #d1d5db; border-radius: 20px; cursor: pointer; background: #fff; color: #444; transition: 0.2s; }
.mc-std-tile:hover { border-color: #4a90e2; color: #4a90e2; }
.mc-std-tile.active, .mc-std-tile.manual-btn.active { background: #4a90e2 !important; border-color: #4a90e2 !important; color: #fff !important; }
.mc-std-tile.manual-btn { background: #eff2f5; font-weight: 700; color: #555; }

/* === СПИСКИ === */
.mc-label { font-weight: 600; font-size: 14px; margin-bottom: 8px; display: block; color: #444; }
.mc-flex-grow { flex: 1; display: flex; flex-direction: column; }
.mc-select-list, .mc-cascading-wrap { width: 100%; flex: 1; min-height: 280px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff; }
.mc-cascading-wrap { display: flex; overflow: hidden; }
.mc-list-col { flex: 1; border-right: 1px solid #eee; display: flex; flex-direction: column; }
.mc-col-head { background: #f8f9fa; padding: 8px; text-align: center; font-weight: 700; font-size: 13px; border-bottom: 1px solid #eee; color: #4a90e2; }
.mc-col-body { overflow-y: auto; flex: 1; }
.mc-col-body div { padding: 6px 12px; cursor: pointer; border-bottom: 1px solid #f8f9fa; }
.mc-col-body div:hover { background: #f0f7ff; color: #4a90e2; }
.mc-col-body div.active { background: #4a90e2; color: white; }

/* === СОВРЕМЕННЫЕ ПОЛЯ ВВОДА === */
.mc-input-modern, .mc-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    color: #333;
    background: #fff;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    height: 42px; 
}
.mc-input-modern:focus, .mc-select:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}
.mc-inp-row { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; background: #f9f9f9; padding: 6px 12px; border-radius: 4px; border: 1px solid #eee; }
.mc-inp-row label { margin: 0; font-weight: 600; font-size: 13px; color: #555; white-space: nowrap; flex: 1; }
.mc-input-manual { width: 80px !important; min-width: 80px; padding: 6px 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; text-align: right; height: 34px; box-sizing: border-box; }

/* === ПАНЕЛЬ РАСЧЕТА === */
.mc-visual { height: 220px; background: #fff; border: 1px solid #e1e4e8; border-radius: 6px; margin-bottom: 20px; display: flex; align-items: center; justify-content: center; }
#profileSvg { width: 100%; height: 100%; }

.mc-calc-panel { background: #f8fafd; border: 1px solid #e1e4e8; padding: 20px; border-radius: 8px; }
.mc-form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.mc-field { flex: 1; }
.mc-field label { font-size: 13px; font-weight: 600; color: #555; display: block; margin-bottom: 6px; }
.mc-preview-stats { font-size: 13px; color: #555; margin-bottom: 15px; border-top: 1px dashed #ccc; padding-top: 10px; }
.mc-preview-stats div { margin-bottom: 5px; display: flex; justify-content: space-between; }
.mc-stat-large { font-size: 16px !important; color: #333 !important; font-weight: 600; margin-top: 5px; }

/* === КНОПКИ === */
#btnAddToList, #btnOrder {
    width: 100%; padding: 14px; border: none !important; border-radius: 6px !important;
    cursor: pointer; font-weight: 700 !important; font-size: 15px !important;
    text-transform: uppercase; text-decoration: none !important; transition: 0.2s;
    color: #ffffff !important; background-color: #4a90e2 !important;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.3) !important;
}
#btnAddToList:hover, #btnOrder:hover { background-color: #357abd !important; transform: translateY(-1px); }

.mc-actions-bottom { display: flex; gap: 15px; margin-top: 20px; align-items: stretch; }
.mc-export-group { display: flex; gap: 5px; flex: 1; }
.mc-exp-btn { flex: 1; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; font-weight: 600; color: #555; font-size: 13px; transition: all 0.2s; text-align: center; }
.mc-exp-btn:hover { background: #f0f7ff; color: #4a90e2; border-color: #4a90e2; }

/* === ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМА === */
.mc-mode-switch-wrap {
    background: #e1e8ed; padding: 4px; border-radius: 6px; display: flex;
    margin-bottom: 15px; position: relative; user-select: none;
}
.mc-mode-opt {
    flex: 1; text-align: center; padding: 8px 5px; cursor: pointer;
    font-size: 12px; font-weight: 600; color: #666; border-radius: 4px;
    transition: 0.2s; position: relative; z-index: 2;
}
.mc-mode-opt.active { background: #fff; color: #4a90e2; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* === СМЕТА === */
.mc-estimate-block { margin-top: 40px; border-top: 2px solid #eee; padding-top: 20px; }
.mc-table-responsive { overflow-x: auto; }
.mc-estimate-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mc-estimate-table th { background: #4a90e2; color: white; padding: 10px; text-align: left; }
.mc-estimate-table td { padding: 10px; border-bottom: 1px solid #eee; }
.mc-estimate-table tr:nth-child(even) { background: #f9f9f9; }
.mc-foot-row td { background: #333; color: #fff; font-weight: bold; border-top: 2px solid #000; }
.mc-del-row { color: #e74c3c; cursor: pointer; font-weight: bold; font-size: 18px; text-align: center; }

/* === МОДАЛЬНОЕ ОКНО === */
.mc-modal { 
    display: none; 
    position: fixed; 
    z-index: 99999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    backdrop-filter: blur(3px); 
    align-items: center;
    justify-content: center;
}
.mc-modal-content { 
    background: #fff; 
    padding: 30px; 
    border-radius: 12px;
    width: 380px; 
    max-width: 90%;
    position: relative; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.25); 
    animation: mcFadeIn 0.3s ease-out;
}
@keyframes mcFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.mc-close { position: absolute; right: 15px; top: 10px; font-size: 28px; cursor: pointer; color: #999; line-height: 1; }
.mc-modal-scroll { max-height: 200px; overflow-y: auto; margin-bottom: 15px; border: 1px solid #eee; padding: 10px; border-radius: 6px; background: #f9f9f9; font-size: 13px; }
.mc-modal-item { margin-bottom: 8px; border-bottom: 1px dashed #ddd; padding-bottom: 5px; }
.mc-spoiler-btn { background:none; border:none; color:#4a90e2; cursor:pointer; padding:0; font-size:12px; text-decoration:underline; display:block; margin-top:5px; }
.mc-modal-total { background: #f1f3f5; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 15px; line-height: 1.6; text-align: right; border: 1px solid #e1e4e8; }
#btnSendLead { background-color: #27ae60 !important; color: #fff !important; width: 100%; padding: 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 16px; }

/* === ПЕЧАТЬ (FIXED) === */
@media print {
    /* Скрываем всё через visibility, чтобы не ломать поток */
    body * {
        visibility: hidden;
    }
    
    /* Показываем только наш блок и его содержимое */
    #mcEstimateBlock, #mcEstimateBlock * {
        visibility: visible;
    }

    #mcEstimateBlock {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 15px;
        background: white;
        z-index: 99999;
    }

    /* Явно показываем заголовок печати */
    .mc-print-header { 
        display: block !important; 
    }
    
    /* Скрываем кнопки и элементы управления внутри блока сметы */
    .mc-actions-bottom, .mc-del-row, .mc-title { 
        display: none !important; 
    }
    
    /* Добавляем границы для таблицы при печати */
    .mc-estimate-table th, .mc-estimate-table td {
        border: 1px solid #333 !important;
        color: #000 !important;
    }
    .mc-estimate-table th {
        background-color: #eee !important;
    }
}