/* Стили для печати документов */

/* Скрытие основного интерфейса при печати */
@media print {
    body {
        background: white;
        font-size: 12pt;
    }

    .app-container {
        max-width: 100%;
        padding: 0;
    }

    .app-header,
    .app-main,
    .app-footer,
    .calculate-actions,
    .print-actions,
    .equipment-actions,
    .equipment-stats {
        display: none !important;
    }

    /* Показываем только шаблоны печати */
    .print-template {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .print-document {
        padding: 20px;
        page-break-inside: avoid;
    }
}

/* Стили документов печати */
.print-document {
    background: white;
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm;
    font-family: 'Times New Roman', Times, serif;
}

.print-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

.print-header h1 {
    font-size: 18pt;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.print-date {
    font-size: 12pt;
    color: #666;
}

.print-body {
    margin-bottom: 20px;
}

/* Таблицы печати */
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.print-table th,
.print-table td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
    font-size: 11pt;
}

.print-table th {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: center;
}

.print-table .total-row {
    font-weight: bold;
    background-color: #f8f8f8;
}

.print-table .highlight-row {
    background-color: #e8f5e8;
    font-weight: bold;
}

/* Подписи */
.print-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.signatures {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.signature-block {
    flex: 1;
    text-align: left;
}

.signature-block p {
    margin-bottom: 5px;
    font-size: 10pt;
    color: #666;
}

.signature-line {
    width: 150px;
    height: 1px;
    background: #333;
    margin-top: 40px;
}

/* Документ заявки на оборудование */
.equipment-document {
    max-width: 190mm;
}

.equipment-document .equipment-items tr:nth-child(even) {
    background-color: #fafafa;
}

.equipment-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.equipment-summary p {
    margin: 5px 0;
    font-size: 11pt;
}

/* Стили для нового бегунка */
.runner-document {
    font-family: 'Arial', sans-serif;
    font-size: 11pt;
    padding: 10mm;
}

.runner-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.runner-title {
    font-size: 24pt;
    font-weight: bold;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.runner-datetime {
    font-size: 12pt;
    color: #333;
}

.runner-car-section {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.runner-car-row {
    margin-bottom: 5px;
}

.runner-label {
    font-weight: bold;
    margin-right: 10px;
}

.runner-car-model {
    font-size: 14pt;
    font-weight: bold;
}

.runner-car-trim {
    font-size: 11pt;
    color: #666;
}

.runner-car-prices {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.runner-price-item {
    text-align: center;
}

.runner-price-label {
    display: block;
    font-size: 9pt;
    color: #666;
    margin-bottom: 3px;
}

.runner-final-price,
.runner-rrc-price,
.runner-purchase-price {
    font-size: 14pt;
    font-weight: bold;
}

.runner-discounts-section {
    margin-bottom: 15px;
}

.runner-table {
    width: 100%;
    border-collapse: collapse;
}

.runner-table td {
    padding: 6px 10px;
    border: 1px solid #333;
    font-size: 10pt;
}

.runner-table td:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.runner-discount-row td {
    background-color: #fafafa;
}

.runner-total-row td {
    font-weight: bold;
    background-color: #f0f0f0;
}

.runner-equipment-section {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.runner-equipment-total {
    font-size: 12pt;
}

.runner-equipment-label {
    font-weight: bold;
    margin-right: 10px;
}

.runner-equipment-total-price {
    font-weight: bold;
    font-size: 14pt;
}

.runner-margin-section {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f8f0;
    border-left: 4px solid #4caf50;
}

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

.runner-margin-label {
    font-size: 12pt;
    font-weight: bold;
}

.runner-margin-bnds {
    font-size: 16pt;
    font-weight: bold;
    color: #2e7d32;
}

.runner-info-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.runner-client-info {
    display: flex;
    flex-direction: column;
}

.runner-client-name {
    font-weight: bold;
    font-size: 12pt;
}

.runner-client-phone {
    color: #666;
    font-size: 11pt;
}

.runner-manager-info {
    display: flex;
    align-items: center;
}

.runner-manager-name {
    font-weight: bold;
    font-size: 12pt;
}

.runner-signature-section {
    margin-top: 30px;
}

.runner-signature-line {
    width: 200px;
    height: 1px;
    background: #333;
    position: relative;
}

.runner-signature-label {
    position: absolute;
    top: 5px;
    left: 0;
    font-size: 10pt;
    color: #666;
}

/* Новые стили для обновленного шаблона */
.runner-info-section {
    margin-bottom: 15px;
}

.runner-info-row {
    display: flex;
    margin-bottom: 8px;
    align-items: baseline;
}

.runner-label {
    width: 140px;
    min-width: 140px;
    font-weight: bold;
    font-size: 11pt;
}

.runner-section-title {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 8px;
}

.runner-tradein-section {
    margin-bottom: 15px;
}

.runner-prices-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.runner-prices-table td {
    border: 1px solid #333;
    padding: 6px 10px;
    font-size: 11pt;
}

.runner-label-cell {
    background-color: #f5f5f5;
    font-weight: bold;
    width: 70%;
}

.runner-value-cell {
    text-align: right;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    width: 30%;
}

.runner-summary-section {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f8f8;
    border: 1px solid #333;
}

.runner-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11pt;
}

.runner-summary-row:first-child {
    font-size: 14pt;
    font-weight: bold;
}

.runner-summary-label {
    font-weight: bold;
}

.runner-summary-value {
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Разбиение на страницы */
@media print {
    .print-document {
        page-break-inside: avoid;
    }

    .runner-document .equipment-section {
        page-break-inside: avoid;
    }

    .print-table {
        page-break-inside: avoid;
    }
}

/* Скрытие элементов в браузере (не для печати) */
.print-template {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Предварительный просмотр печати */
@media screen {
    .print-template.active {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 20px;
        background: #f0f0f0;
    }

    .print-template.active .print-document {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        max-width: 210mm;
    }
}

/* Нумерация страниц */
@media print {
    @page {
        size: A4;
        margin: 15mm;
    }

    .print-document {
        counter-increment: page;
    }
}

/* Дополнительные стили для форматирования сумм */
.print-table td:last-child,
.print-table th:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Цветовые акценты для типов сделок */
.deal-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 10pt;
    font-weight: 500;
}

.deal-type-badge.cash {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.deal-type-badge.credit {
    background-color: #e3f2fd;
    color: #1565c0;
}

.deal-type-badge.trade-in {
    background-color: #fff3e0;
    color: #ef6c00;
}

.deal-type-badge.leasing {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.deal-type-badge.fleet {
    background-color: #e0f2f1;
    color: #00897b;
}

/* Компактный стиль для длинных списков */
.print-table.compact th,
.print-table.compact td {
    padding: 4px 8px;
    font-size: 10pt;
}

/* Жирная сумма в итоговой строке */
.print-table .total-row td:last-child {
    font-weight: bold;
    font-size: 12pt;
}

/* Выделение важных полей */
.important-field {
    background-color: #fffde7;
}

/* Информация о марже */
.margin-info {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f8f0;
    border-left: 4px solid #4caf50;
    font-size: 11pt;
}

.margin-info .margin-bnds {
    font-size: 14pt;
    font-weight: bold;
    color: #2e7d32;
}

.margin-info .margin-snds {
    font-size: 12pt;
    color: #666;
}




