/*
  CSS Print Stylesheet for Counter Industrial Reports
  Conforms to W3C CSS Paged Media Module Level 3 and Gotenberg 8 standards
*/

@page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
    @bottom-right {
        content: "Стр. " counter(page) " из " counter(pages);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: 8pt;
        color: #64748b;
    }
}

@page landscape-page {
    size: A4 landscape;
    margin: 10mm 10mm 10mm 10mm;
}

* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    background: #ffffff;
    margin: 0;
    padding: 0;
    font-size: 9.5pt;
    line-height: 1.35;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.brand-title {
    font-size: 16pt;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0f172a;
    text-transform: uppercase;
}

.brand-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #334155;
    font-size: 7.5pt;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

.legal-sub {
    font-size: 7.5pt;
    color: #64748b;
    margin-top: 2px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.meta-item {
    font-size: 8pt;
}

.meta-label {
    color: #64748b;
    font-weight: 500;
}

.meta-val {
    color: #0f172a;
    font-weight: 700;
    font-size: 8.5pt;
}

.kpi-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.kpi-card {
    flex: 1;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    border-left: 4px solid #2563eb;
}

.kpi-card.success { border-left-color: #10b981; }
.kpi-card.warning { border-left-color: #f59e0b; }
.kpi-card.danger { border-left-color: #ef4444; }

.kpi-num {
    font-size: 15pt;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.kpi-desc {
    font-size: 7.5pt;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

table.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin-bottom: 14px;
    page-break-inside: auto;
}

table.report-table th {
    background: #1e293b;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    font-size: 8pt;
    border: 1px solid #0f172a;
    text-transform: uppercase;
}

table.report-table td {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

table.report-table tr:nth-child(even) {
    background: #f8fafc;
}

table.report-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.badge-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 7.5pt;
    font-weight: 700;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

.signatures-block {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    page-break-inside: avoid;
}

.sig-col {
    width: 45%;
    font-size: 8.5pt;
}

.sig-line {
    border-bottom: 1px solid #0f172a;
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    font-size: 7.5pt;
    color: #64748b;
}

.merkle-footer {
    page-break-inside: avoid;
    margin-top: 16px;
}
