/* Printable tariff sheet (views.TariffSheet): A4 portrait, black on white. */
:root { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #111; }
body { margin: 0; background: #f2f2f2; }

.sheet { background: #fff; max-width: 186mm; margin: 0 auto 2rem; padding: 12mm; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.5rem; margin-bottom: 1.25rem; }
.fields label { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.fields input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid #777; border-radius: 0; font: inherit; font-weight: 400; padding: 2px 0; background: transparent; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { border: 1px solid #333; padding: 7px 8px; text-align: left; vertical-align: top; }
th { background: #eee; font-size: 0.8rem; }
tbody tr { height: 2.4em; }
.num { width: 2.5em; text-align: center; }
.fig { width: 7.5em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.diff { width: 6.5em; text-align: right; font-variant-numeric: tabular-nums; }
.req { width: 3.5em; text-align: center; }
.judge { width: 5em; }
.custom { display: block; color: #555; font-size: 0.8em; }
.not-counted .diff { color: #777; }
.note { display: block; font-size: 0.7rem; color: #777; }
tfoot td { font-weight: 700; }
.footnote { font-size: 0.75rem; color: #555; margin-top: 0.75rem; }

.toolbar, .warnings { max-width: 186mm; margin: 1rem auto; padding: 0 12mm; box-sizing: border-box; }
.toolbar { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; color: #444; }
.print { flex-shrink: 0; white-space: nowrap; font: inherit; font-weight: 600; padding: 0.5rem 1rem; border: 0; border-radius: 4px; background: #485fc7; color: #fff; cursor: pointer; }
.warnings { font-size: 0.85rem; color: #8a2a00; }
.warnings ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.option { display: inline-flex; gap: 0.3rem; align-items: center; white-space: nowrap; cursor: pointer; }

/* Display options, toggled on #tariff-sheet by static/js/sheet.js. */
.total-without-names { display: none; }
.hide-names .col-name, .hide-names .total-with-names, .hide-names .element-with-names { display: none; }
.hide-names .total-without-names, .hide-names .element-without-names { display: table-cell; }
.element-without-names { display: none; }
th.element { text-align: center; border-bottom: 1px solid #000; }
.subhead th { font-size: 0.85em; font-weight: 600; font-family: inherit; }
.hide-req .req, .hide-judge .judge { display: none; }
.hide-field-gymnast .field-gymnast, .hide-field-club .field-club, .hide-field-category .field-category,
.hide-field-competition .field-competition, .hide-field-round .field-round, .hide-field-coach .field-coach { display: none; }
.hide-fields .fields { display: none; } /* every field hidden: drop the block and its spacing */

.options { position: relative; }
.options summary { cursor: pointer; font-weight: 600; color: #222; white-space: nowrap; }
.options-panel {
    position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 10; display: flex; gap: 1.5rem;
    background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 0.6rem 0.8rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.options fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.options legend { font-size: 0.75rem; font-weight: 600; color: #666; text-transform: uppercase; padding: 0 0 0.2rem; }

.loading { max-width: 186mm; margin: 2rem auto; padding: 0 12mm; color: #444; }

@media print {
    @page { size: A4 portrait; margin: 14mm; }
    body { background: none; }
    .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .screen-only { display: none !important; }
    input[type="checkbox"] { width: 1em; height: 1em; }
}

@media (max-width: 640px) {
    .sheet { padding: 1rem; }
    .fields { grid-template-columns: 1fr; }
    .toolbar { flex-wrap: wrap; padding: 0 1rem; }
    .warnings { padding: 0 1rem; }
    .fig { width: auto; }
}
