/* Shared styles for cockpit print templates.
 *
 * Linked from each app/templates/cockpit/*_print*.html. Holds rules common to
 * every print page (body reset, header, QR block, color indicators, print
 * button, footer, @media print). Template-specific styles (tables, match
 * blocks, signature boxes, etc.) stay inline in each template.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
    padding: 20px;
}

.header {
    position: relative;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid black;
    padding-bottom: 10px;
}

.header h1 {
    font-size: 16pt;
    margin-bottom: 5px;
}

.header h2 {
    font-size: 12pt;
    font-weight: normal;
}

.qr-code {
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    text-align: center;
    line-height: 1;
    color: inherit;
    text-decoration: none;
}

.qr-code svg {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.qr-caption {
    font-size: 7pt;
    color: #555;
    margin-top: 2px;
}

.color-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 4px;
}

.color-white {
    border: 1.5px solid #374151;
    background-color: white;
}

.color-black {
    background-color: #374151;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.bye {
    font-style: italic;
    color: #666;
}

.footer {
    margin-top: 20px;
    font-size: 8pt;
    color: #666;
    text-align: center;
}

.print-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    /* Above .header (position: relative, later in DOM) so the button is
       fully clickable; otherwise the header's box overlaps and swallows
       clicks on the button's interior. */
    z-index: 10;
    padding: 10px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12pt;
}

.print-btn:hover {
    background: #1d4ed8;
}

/* Absent players / teams block (components/print_absent_list.html).
 * Shared by every pairing sheet, so it lives here rather than inline in four
 * templates. Kept visually secondary to the pairing table above it. */
.absent-section {
    margin-top: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.absent-section h3 {
    font-size: 11pt;
    margin-bottom: 6px;
}

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

table.absent th,
table.absent td {
    padding: 5px 8px;
    border-bottom: 1px solid #d1d5db;
    text-align: left;
}

table.absent thead th {
    background-color: #f3f4f6;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 10pt;
    border-bottom: 2px solid #000;
}

table.absent .col-absent-reason {
    width: 220px;
    color: #444;
}

@media print {
    body {
        padding: 10px;
    }

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

    @page {
        margin: 0.8cm;
    }

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

    thead {
        display: table-header-group;
    }
}
