.hidden {
    display: none !important;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.74);
    color: #e2e8f0;
}

th,
td {
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 10px;
    vertical-align: top;
    text-align: left;
}

th {
    background: rgba(8, 47, 73, 0.72);
    color: #bae6fd;
}

.order {
    width: 78px;
}

.project-select {
    min-width: 180px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    padding: 8px 10px;
}

.report-edit textarea {
    min-width: 240px;
}

.result-edit-row td {
    background: rgba(2, 6, 23, 0.38);
}

.result-row td {
    background: #fff;
    white-space: pre-line;
}

.print-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px 36px;
    align-items: start;
}

.print-meta > div {
    min-width: 0;
}

.print-meta-period {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 210px;
    justify-self: end;
}

.print-blocks {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.print-task {
    position: relative;
    border: 1px solid #d8e0ea;
    border-left: 4px solid #0f766e;
    padding: 16px 18px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    break-inside: auto;
    page-break-inside: auto;
}

.print-task-main {
    min-width: 0;
    padding-right: 48px;
}

.print-task-number {
    position: absolute;
    top: 16px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #0f766e;
    background: #0f766e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.print-task-label,
.print-task-result h3 {
    margin: 0 0 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.print-task h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.32;
    overflow-wrap: anywhere;
}

.print-task dl {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    max-width: 100%;
    margin: 0;
    color: #475569;
    font-size: 12px;
}

.print-task dl > div {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 4px 8px;
    white-space: nowrap;
}

.print-task dt {
    margin: 0;
    color: #64748b;
}

.print-task dd {
    margin: 0;
    color: #0f172a;
    font-weight: 700;
}

.print-task-result {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}

.print-task-result div {
    max-width: 100%;
}

.project-summary {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 14px 16px;
}

.project-summary h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.project-summary dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.project-summary dl > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.project-summary dl > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.project-summary dt,
.project-summary dd {
    margin: 0;
}

.project-summary dd {
    font-weight: 700;
}

.print-total {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    border-top: 2px solid #0f172a;
    padding-top: 12px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.comment {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #cbd5e1;
}

.comment h2 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.comment p {
    margin: 0;
    line-height: 1.55;
}

.meta dt {
    color: #667085;
}

.meta dd {
    margin: 0;
    font-weight: 700;
}

.contacts {
    white-space: normal;
    color: #667085;
}

.logo-screen {
    filter: invert(1) grayscale(1) brightness(1.8);
}

.logo-print {
    filter: none;
}

.document table {
    background: #fff;
    color: #000;
}

.document th,
.document td {
    border-color: #cbd5e1;
}

.document th {
    background: #f1f5f9;
    color: #0f172a;
}

.starfield {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .75) 1px, transparent 1px),
        radial-gradient(circle, rgba(125, 211, 252, .5) 1px, transparent 1px);
    background-position: 0 0, 36px 54px;
    background-size: 96px 96px, 132px 132px;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body {
        background: #fff;
        color: #000;
    }

    .starfield,
    body > div.fixed {
        display: none !important;
    }

    .logo-screen,
    .logo-print {
        filter: none !important;
    }

    main {
        max-width: none !important;
        padding: 0 !important;
    }

    .print-actions {
        display: none !important;
    }

    .document {
        border: 0 !important;
        padding: 0 !important;
    }

    table {
        background: #fff;
        color: #000;
        page-break-inside: auto;
        font-size: 11pt;
    }

    td {
        border-color: #d7dde5;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-row-group;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-blocks {
        gap: 12px;
        margin-top: 18px;
    }

    .print-task {
        padding: 12px 0 12px 12px;
        border-width: 1px 0 0 3px;
        border-color: #d7dde5 #fff #fff #7f8c8d;
        box-shadow: none;
    }

    .print-task-main {
        padding-right: 40px;
    }

    .print-task-number {
        top: 12px;
        right: 0;
    }

    .print-task:first-child {
        border-top-width: 0;
    }

    .print-task-result {
        margin-left: 0;
        padding: 10px 12px;
        border-color: #d7dde5;
        background: #f7f7f7 !important;
        font-size: 11pt;
        line-height: 1.5;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    th {
        background: #f0f0f0 !important;
        color: #000;
    }

    a[href]::after {
        content: "";
    }
}
