* { box-sizing: border-box; }
body { margin: 0; color: #243648; background: #fff; font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: #005298; text-underline-offset: 3px; }
#naglowek { padding: 0 16px; border-bottom: 1px solid #e4eaf0; }
#naglowek_logo { max-width: 604px; height: 115px; margin: auto; background: url(grafika/naglowek.jpg) center / contain no-repeat; }
#naglowek_logo a { display: block; width: 100%; height: 100%; }
#srodek { min-height: 65vh; padding: 40px 28px 48px; background: #f4f7fa; }
h1 { max-width: 820px; margin: 0 auto 28px; color: #15364f; text-align: center; font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700; line-height: 1.35; text-wrap: balance; }
.toolbar { max-width: 1280px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin: 24px auto; padding: 20px 24px; background: #fff; border: 1px solid #dce5ed; border-radius: 12px; }
.toolbar form { margin: 0; }
.toolbar .search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; flex: 1; gap: 8px 12px; min-width: 240px; }
.search-form label { grid-column: 1 / -1; font-size: .875rem; font-weight: 600; }
.search-form input { width: 100%; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px; margin: 24px auto 0; font-size: .875rem; text-align: center; }
.pagination a { font-weight: 600; padding: 8px; }
input { min-width: 0; min-height: 44px; border: 1px solid #9aacbb; border-radius: 6px; padding: 9px 12px; max-width: 100%; font: inherit; background: #fff; color: #172b3a; }
.myButton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border: 1px solid #005298; border-radius: 6px; color: #fff; background: #005298; font: inherit; font-size: .875rem; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; white-space: nowrap; }
.myButton:hover { background: #003964; }
.secondary { background: #fff; color: #005298; }
.secondary:hover { color: #fff; }
.danger { background: #9c2020; border-color: #9c2020; }
.danger:hover { background: #741717; }
:focus-visible { outline: 3px solid #d27a00; outline-offset: 3px; }
#tabela { max-width: 1280px; margin: 24px auto; border: 1px solid #dce5ed; border-radius: 12px; overflow: hidden; background: #fff; }
.schools-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .875rem; line-height: 1.65; }
.schools-table th, .schools-table td { padding: 16px 18px; text-align: left; vertical-align: top; overflow-wrap: break-word; word-break: normal; }
.schools-table th { color: #fff; background: #005298; font-size: .75rem; font-weight: 600; line-height: 1.5; }
.schools-table td { border-bottom: 1px solid #e4eaf0; }
.schools-table tr:last-child td { border-bottom: 0; }
.schools-table tbody tr:nth-child(even) { background: #f8fafc; }
.schools-table .column-number { width: 6%; white-space: nowrap; }
.schools-table .column-miejscowosc { width: 17%; }
.schools-table .column-szkola_nazwa { width: 29%; }
.schools-table .column-daty { width: 17%; }
.schools-table .column-uwagi { width: 31%; }
.cell-number { color: #647787; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-miejscowosc { font-weight: 600; color: #005298; }
.cell-szkola_nazwa { font-weight: 600; color: #18394f; }
.schools-table--admin { table-layout: auto; }
.schools-table.schools-table--admin th { width: auto; }
.schools-table--admin th, .schools-table--admin td { padding: 12px; }
.school-form { max-width: 720px; margin: 24px auto; display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr); gap: 12px; align-items: center; }
.school-form button { grid-column: 2; justify-self: start; }
.login-box { max-width: 380px; margin: auto; }
.login-box form { display: grid; gap: 12px; margin-bottom: 24px; }
.confirmation { max-width: 720px; margin: auto; }
.notice, .error { text-align: center; }
.notice { color: #145526; }
.error { color: #9c2020; }
details { max-width: 900px; margin: 20px auto; }
summary { cursor: pointer; }
#stopka { padding: 24px 16px; color: #fff; background: #005298; text-align: center; font-size: .8125rem; line-height: 1.9; }
#stopka a { color: #fff; }
@media (max-width: 1000px) {
    #tabela { border: 0; border-radius: 0; background: transparent; overflow: visible; }
    .schools-table, .schools-table tbody { display: block; width: 100%; }
    .schools-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .schools-table tbody { display: grid; gap: 16px; }
    .schools-table tbody tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 22px; background: #fff; border: 1px solid #dce5ed; border-radius: 12px; box-shadow: 0 2px 5px rgb(23 43 58 / 3%); }
    .schools-table tbody tr:nth-child(even) { background: #fff; }
    .schools-table td { display: block; grid-column: 1 / -1; min-width: 0; padding: 0; border: 0; }
    .schools-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #63798b; font-size: .6875rem; font-weight: 600; letter-spacing: .045em; line-height: 1.5; text-transform: uppercase; }
    .schools-table .cell-number { position: absolute; top: 22px; right: 22px; font-size: .75rem; }
    .schools-table td.cell-number::before { content: "LP. "; display: inline; margin: 0; font-size: inherit; }
    .schools-table .cell-miejscowosc { padding-right: 64px; }
    .schools-table .cell-szkola_nazwa { padding-bottom: 16px; border-bottom: 1px solid #e4eaf0; font-size: 1.0625rem; line-height: 1.5; }
    .schools-table .cell-daty { font-variant-numeric: tabular-nums; }
    .schools-table .cell-uwagi { line-height: 1.75; }
    .schools-table .cell-action { grid-column: auto; }
    .cell-action .myButton { width: 100%; }
}
@media (max-width: 600px) {
    #naglowek_logo { height: 92px; }
    #srodek { padding: 28px 16px 32px; }
    h1 { margin-bottom: 20px; }
    .toolbar { margin: 20px auto; padding: 16px; gap: 12px; }
    .toolbar .search-form { flex-basis: 100%; min-width: 0; gap: 8px; }
    .toolbar > .myButton, .toolbar > form:not(.search-form) { margin-left: auto; }
    .schools-table tbody tr { padding: 18px; }
    .schools-table .cell-number { top: 18px; right: 18px; }
    .school-form { grid-template-columns: 1fr; }
    .school-form button { grid-column: 1; }
    .pagination { gap: 4px 12px; }
}

.list-tools { max-width: 1280px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px auto 16px; }
.results-count { margin: 0; color: #63798b; font-size: .875rem; }
.results-count strong { color: #15364f; font-size: 1.05rem; }
.list-tools-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.list-tools-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.export-button, .add-school-button { gap: 8px; }
.add-school-button > span { font-size: 1.25rem; line-height: 1; }
html { scrollbar-gutter: stable; }
html.dialog-open { overflow: hidden; scrollbar-gutter: auto; }
.school-modal { width: min(680px, calc(100% - 32px)); max-width: 680px; max-height: calc(100dvh - 48px); margin: auto; padding: 0; color: #243648; background: #fff; border: 1px solid #dce5ed; border-radius: 20px; box-shadow: 0 24px 100px rgb(15 35 52 / 24%); overflow: hidden; }
.school-modal::backdrop { background: rgb(12 30 47 / 58%); backdrop-filter: blur(4px); }
.school-modal[open] { display: flex; flex-direction: column; animation: modal-enter .18s ease-out; }
.school-modal-header { position: relative; flex-shrink: 0; padding: 28px 32px 24px; border-bottom: 1px solid #e4eaf0; background: linear-gradient(120deg, #f0f7ff, #fff 80%); }
.school-modal-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; background: #005298; color: #fff; border-radius: 14px; }
.school-modal-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.modal-close { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #dce5ed; border-radius: 50%; color: #526b7d; background: #fff; font-size: 26px; line-height: 1; text-decoration: none; }
.modal-close:hover { color: #005298; background: #e9f2fa; }
.modal-eyebrow { margin: 0 0 6px; color: #63798b; font-size: .65rem; font-weight: 700; letter-spacing: .12em; }
.school-modal h2 { margin: 0; color: #15364f; font-size: 1.65rem; line-height: 1.3; letter-spacing: -.025em; }
.school-modal-header > p:last-child { margin: 8px 0 0; color: #63798b; font-size: .875rem; }
.modal-school-form { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-form-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 32px 28px; }
.required-note { margin: 0 0 18px; color: #63798b; font-size: .75rem; }
.required-note > span, .required-star { color: #9c2020; }
.modal-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 20px; }
.modal-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.modal-field-wide { grid-column: 1 / -1; }
.modal-field label { color: #294456; font-size: .8125rem; font-weight: 600; }
.modal-field input, .modal-field textarea { width: 100%; min-width: 0; border: 1px solid #b8c9d7; border-radius: 8px; padding: 11px 12px; color: #172b3a; background: #fff; font: inherit; font-size: .9375rem; line-height: 1.5; }
.modal-field textarea { resize: vertical; }
.modal-field input::placeholder { color: #8596a3; }
.modal-form-footer { display: flex; flex-shrink: 0; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 32px; border-top: 1px solid #e4eaf0; background: #f8fafc; }
.modal-form-footer .myButton { gap: 8px; }
.modal-error { flex-shrink: 0; margin: 20px 32px 0; padding: 12px 16px; color: #8c2020; background: #fff2f1; border: 1px solid #f1cbc6; border-radius: 8px; font-size: .875rem; }
@keyframes modal-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .school-modal[open] { animation: none; } }
@media (max-width: 600px) {
    .list-tools { align-items: flex-start; flex-direction: column; }
    .list-tools-actions { width: 100%; }
    .list-tools-actions .myButton { flex: 1; }
    .school-modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
    .school-modal-header { padding: 22px 20px 20px; }
    .school-modal-icon { width: 40px; height: 40px; margin-bottom: 14px; border-radius: 11px; }
    .school-modal h2 { font-size: 1.4rem; }
    .modal-close { top: 16px; right: 16px; }
    .modal-form-body { padding: 18px 20px 24px; }
    .modal-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .modal-field input, .modal-field textarea { font-size: 1rem; }
    .modal-form-footer { padding: 14px 20px; gap: 10px; }
    .modal-form-footer .myButton { flex: 1; padding-inline: 12px; }
    .modal-error { margin: 18px 20px 0; }
}
