/* System zawodów PSZS Malbork — panel koordynatora. Kolory z logo PSZS (czerwień, żółć). Układ: górny pasek + jedna kolumna; telefon na zawodach. */
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root {
  --bg: #f1f0ec; --surface: #ffffff; --surface-2: #f6f5f1; --ink: #1d1c1a; --muted: #625f5a; --line: #d9d6cf; --line-2: #e8e6e0;
  --accent: #c8141c; --accent-ink: #ffffff; --accent-soft: #fbe3e2; --gold: #f2c80f; --gold-soft: #fdf4cc;
  --city: #2b5ea7; --city-soft: #e2ebf7; --rural: #2e7a4a; --rural-soft: #e0f0e5;
  --ok: #2e7a4a; --ok-soft: #e0f0e5; --warn: #8f5d00; --warn-soft: #fbefd5; --err: #b3261e; --err-soft: #fbe3e1;
  --shade: #b4b1aa; --paper: #ffffff; --paper-ink: #111;
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #151413; --surface: #1e1d1b; --surface-2: #262522; --ink: #ecebe7; --muted: #a29e97; --line: #3a3834; --line-2: #2d2b28;
  --accent: #ff5a5f; --accent-ink: #1d0a0a; --accent-soft: #3d1b1c; --gold: #f2c80f; --gold-soft: #3a3214;
  --city: #7fa8e6; --city-soft: #1d2a3d; --rural: #6cc08c; --rural-soft: #183024;
  --ok: #6cc08c; --ok-soft: #183024; --warn: #e3b14f; --warn-soft: #362a12; --err: #f0857c; --err-soft: #3d1c1a; --shade: #67645f; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #151413; --surface: #1e1d1b; --surface-2: #262522; --ink: #ecebe7; --muted: #a29e97; --line: #3a3834; --line-2: #2d2b28;
  --accent: #ff5a5f; --accent-ink: #1d0a0a; --accent-soft: #3d1b1c; --gold: #f2c80f; --gold-soft: #3a3214;
  --city: #7fa8e6; --city-soft: #1d2a3d; --rural: #6cc08c; --rural-soft: #183024;
  --ok: #6cc08c; --ok-soft: #183024; --warn: #e3b14f; --warn-soft: #362a12; --err: #f0857c; --err-soft: #3d1c1a; --shade: #67645f; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14.5px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--accent); }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 9px 7px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 700; font-size: 21px; letter-spacing: .02em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { font-weight: 600; color: var(--muted); font-size: 16px; }
.nav { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.nav a, .sub button { background: none; border: 0; padding: 7px 11px; border-radius: var(--r); cursor: pointer; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover, .sub button:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.user { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
main { padding-block: 18px 70px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 16px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.panel > h3 { margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: var(--r); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
.btn.big { padding: 12px 16px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.field .hint { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.inp, select.inp, textarea.inp { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 7px 9px; min-width: 0; width: 100%; }
.inp.err { border-color: var(--err); }
textarea.inp { min-height: 70px; resize: vertical; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.formgrid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; font-weight: 500; }
.chip.city { background: var(--city-soft); color: var(--city); }
.chip.rural { background: var(--rural-soft); color: var(--rural); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--err-soft); color: var(--err); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.gold { background: var(--gold-soft); color: var(--warn); }
.note { border-left: 3px solid var(--line); padding: 8px 12px; background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.err { border-color: var(--err); background: var(--err-soft); }
.note.ok { border-color: var(--ok); background: var(--ok-soft); }
.tw { overflow-x: auto; max-width: 100%; }
table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .c { text-align: center; } table.t .r { text-align: right; }
table.t tr.out td { color: var(--muted); }
table.t tr.clickable { cursor: pointer; }
table.t tr.clickable:hover td { background: var(--surface-2); }
table.t input.inp { padding: 4px 6px; }
.num { font-family: var(--f-display); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
table.cross { border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 100%; }
table.cross th, table.cross td { border: 1px solid var(--line); padding: 6px 7px; text-align: center; white-space: nowrap; }
table.cross th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
table.cross td.nm { text-align: left; white-space: normal; min-width: 170px; }
table.cross td.diag { background: var(--shade); }
table.cross td.pts { font-weight: 600; }
table.cross td.pl { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.evhead { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.evhead .meta { color: var(--muted); display: flex; gap: 2px 14px; flex-wrap: wrap; margin-top: 4px; }
.crumbs { font-size: 13px; margin-bottom: 6px; } .crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.sub { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.sub button { border-radius: var(--r) var(--r) 0 0; padding: 9px 12px; }
.sub button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.sub button .stepno { font-family: var(--f-display); font-weight: 700; color: var(--accent); margin-right: 4px; }
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; }
.mcard.done { border-left: 4px solid var(--ok); }
.mcard.approved { border-left: 4px solid var(--city); }
.mcard.err { border-left: 4px solid var(--err); }
.mcard .no { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1; text-align: center; }
.mcard .no small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; font-family: var(--f-body); }
.mcard .teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; }
.mcard .tn { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mcard .tn.b { text-align: right; }
.score { display: flex; align-items: center; gap: 4px; }
.score input { width: 54px; text-align: center; font-family: var(--f-display); font-size: 21px; font-weight: 600; padding: 5px 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.score input.s { width: 46px; font-size: 16px; }
.score .colon { font-family: var(--f-display); font-size: 20px; font-weight: 700; color: var(--muted); }
.sets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sets .set { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sets .set span { font-size: 11px; color: var(--muted); }
.mextra { grid-column: 2 / 4; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.mextra select, .mextra input { padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mactions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.errs { grid-column: 2 / 4; color: var(--err); font-size: 13px; }
.hist { grid-column: 2 / 4; font-size: 12.5px; color: var(--muted); }
.ov { position: fixed; inset: 0; background: rgba(10, 10, 10, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: max(36px, env(safe-area-inset-top, 0px)) 12px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; width: min(760px, 100%); padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(1040px, 100%); }
.modal h2 { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); left: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: var(--r); box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; pointer-events: auto; }
.toast.err { background: var(--err); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: left; }
.kpi .v { font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1; }
.kpi .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.alert .v { color: var(--accent); }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.li:last-child { border-bottom: 0; }
.li .t1 { font-weight: 600; } .li .t2 { font-size: 12.5px; color: var(--muted); }
.groupbox { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.groupbox h3 { margin-bottom: 6px; }
.drawn { display: grid; grid-template-columns: 34px 1fr auto; gap: 6px 10px; align-items: center; }
.drawn .n { font-family: var(--f-display); font-size: 22px; font-weight: 700; color: var(--accent); text-align: center; }
.loading-block { padding: 40px; text-align: center; color: var(--muted); }
.docframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.remark { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: start; margin-bottom: 6px; }
.remark .k { font-family: var(--f-display); font-weight: 700; color: var(--accent); padding-top: 7px; text-align: right; }
.remark textarea { min-height: 40px; }
.tapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tapgrid .btn { white-space: normal; min-height: 58px; text-align: center; flex-direction: column; gap: 2px; }
.tapgrid .btn b { font-size: 15px; }
.order-list { counter-reset: o; }
.order-list .li { padding: 6px 0; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.status-steps button { border: 1px solid var(--line); background: var(--surface); padding: 4px 9px; border-radius: 99px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.status-steps button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.status-steps button.done { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--ok); transition: width .3s; }
.att { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.att input { text-align: center; padding: 5px 2px; }
.hjgrid td input { width: 46px; text-align: center; padding: 4px 2px; text-transform: uppercase; }
.login { max-width: 380px; margin: 8vh auto; }
.login img { width: 90px; display: block; margin: 0 auto 10px; }
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .top .wrap { gap: 4px 10px; }
  .brand span { display: none; }
  .nav { order: 3; flex-basis: 100%; }
  .user span { display: none; }
  .mcard { grid-template-columns: 40px minmax(0, 1fr); }
  .mcard .mactions, .mextra, .errs, .hist { grid-column: 1 / 3; justify-content: flex-start; }
  .mcard .teams { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .mcard .tn.b { text-align: center; }
  .score { justify-content: center; }
  .modal { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: tin .18s ease-out; } @keyframes tin { from { transform: translateY(8px); opacity: 0; } } }
/* instalator i strony błędów */
body.plain { padding: 24px 16px; } .narrow { max-width: 720px; margin: 0 auto; }
.install fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; padding: 12px 14px; background: var(--surface); }
.install label { display: block; margin: 6px 0; } .install input, .install select { display: block; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r); margin-top: 3px; }
.install .grid2 { gap: 0 14px; } .checks { list-style: none; padding: 0; } .checks .ok { color: var(--ok); } .checks .bad { color: var(--err); }
.err-box { background: var(--err-soft); color: var(--err); padding: 8px 14px; border-radius: 6px; } .ok-box { background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 6px; }
