:root{--fire:#7b1113;--fire2:#b51f25;--soft:#f7f8fa}.bg-fire{background:linear-gradient(90deg,var(--fire),var(--fire2))}.card{border:0;box-shadow:0 8px 24px rgba(0,0,0,.08);border-radius:16px}.btn-fire{background:var(--fire2);border-color:var(--fire2);color:#fff}.btn-fire:hover{background:var(--fire);border-color:var(--fire);color:#fff}.table thead th{background:#f1f3f5;font-size:.88rem;text-transform:uppercase;letter-spacing:.02em}.status-pill{display:inline-flex;align-items:center;border-radius:999px;padding:.25rem .65rem;font-size:.82rem;font-weight:600}.st-draft{background:#eef2ff;color:#3730a3}.st-live{background:#fff7ed;color:#c2410c}.st-done{background:#ecfdf5;color:#047857}.st-empty{background:#f3f4f6;color:#4b5563}.step{display:flex;gap:.75rem;align-items:center}.step .dot{width:34px;height:34px;border-radius:50%;background:#fee2e2;color:#991b1b;display:grid;place-items:center;font-weight:700}.summary-row{cursor:pointer}.summary-row:hover td{background:#fff7ed}.metric{background:#fff;border-radius:14px;padding:16px;box-shadow:0 4px 16px rgba(0,0,0,.06)}.metric b{font-size:1.6rem}.form-control,.form-select{border-radius:10px}.drag-handle{cursor:grab;color:#6b7280}.category-badge{font-weight:700;border-radius:999px;padding:.25rem .55rem;background:#e5e7eb}.live-mode{border:2px solid #f97316;background:#fff7ed;border-radius:16px;padding:1rem}
.judge-toolbar{display:flex;gap:16px;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px;box-shadow:0 6px 22px rgba(15,23,42,.06)}
.save-state{padding:8px 12px;border-radius:999px;background:#f1f5f9;font-weight:700;white-space:nowrap}.save-state.saving{background:#fef3c7}.save-state.saved{background:#dcfce7}.save-state.error{background:#fee2e2;color:#991b1b}
.team-header{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.team-header>div{background:#111827;color:#fff;border-radius:16px;padding:14px}.team-header span{display:block;color:#cbd5e1;font-size:12px}.team-header strong{font-size:18px}
.judge-card{border:0;box-shadow:0 6px 24px rgba(15,23,42,.08);border-radius:18px;overflow:hidden}.judge-card .card-header{background:#f8fafc;border-bottom:1px solid #e5e7eb}
.judge-table th{font-size:12px;text-transform:uppercase;color:#475569;background:#f8fafc}.judge-table td{vertical-align:middle}.counter{display:flex;gap:8px;align-items:center}.count-value{min-width:32px;text-align:center;font-weight:800;font-size:18px}.mdp-cell{min-width:44px;min-height:34px;font-weight:800}.result-card{border:0;border-radius:18px;box-shadow:0 6px 24px rgba(15,23,42,.08)}
.number-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.num-btn{height:64px;border:1px solid #cbd5e1;border-radius:16px;background:#fff;font-size:24px;font-weight:800}.num-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}.signature-canvas{width:100%;height:320px;border:2px dashed #94a3b8;border-radius:16px;background:#fff;touch-action:none}
@media(max-width:900px){.team-header{grid-template-columns:repeat(2,minmax(0,1fr))}.judge-toolbar{align-items:flex-start;flex-direction:column}.judge-table{font-size:13px}.judge-card{margin-bottom:14px}}
.st-dq{background:#fee2e2;color:#991b1b}.dq-note{color:#991b1b;font-weight:700}.detail-btn{white-space:nowrap}
.no-print {}
.print-body { background:#fff; color:#111; }
.print-section { page-break-inside: avoid; }
.signature-line { border-bottom:1px dotted #111; height:48px; margin:0 30px 6px; }
@media print {
  .no-print, .navbar { display:none !important; }
  body { background:#fff !important; }
  main.container, main.container-fluid { max-width:none !important; width:100% !important; padding:0 !important; }
  .card { border:0 !important; box-shadow:none !important; }
  .card-body { padding:0 !important; }
  table { font-size:11px; }
  .print-header { margin-top:0; }
}
.live-screen{background:#0f172a;color:#e5e7eb;border-radius:22px;padding:22px;min-height:75vh;box-shadow:0 10px 30px rgba(15,23,42,.18)}
.live-header{display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid rgba(255,255,255,.12);padding-bottom:18px}
.live-title{font-size:clamp(1.6rem,3vw,3rem);font-weight:900;letter-spacing:.02em;color:#fff}.live-subtitle{color:#cbd5e1;font-size:1.1rem}.live-clock{text-align:right;font-size:2rem;font-weight:900;color:#fff}.live-clock small{display:block;font-size:.85rem;color:#cbd5e1;font-weight:500}.live-category{background:#fff;color:#111827;border-radius:18px;padding:16px;box-shadow:0 8px 24px rgba(0,0,0,.16)}.live-category h2{font-size:1.35rem;font-weight:900;margin:0;color:#0f172a}.live-progress{display:flex;align-items:center;gap:10px;min-width:160px}.live-progress span{font-weight:800;color:#0f172a}.live-progress div{height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden;flex:1}.live-progress i{display:block;height:100%;background:#22c55e;border-radius:999px}.live-table{margin:0}.live-table th{font-size:.78rem;color:#475569;background:#f8fafc!important}.live-place{font-size:1.1rem;font-weight:900}.live-team b{display:block;font-size:1.05rem}.live-team small{display:block;color:#64748b}.live-final{font-size:1.15rem;font-weight:900}.btn-live{background:#0f172a;color:#fff;border-color:#0f172a}.btn-live:hover{background:#1e293b;color:#fff;border-color:#1e293b}
@media(max-width:900px){.live-screen{padding:12px;border-radius:14px}.live-header{align-items:flex-start;flex-direction:column}.live-clock{text-align:left}.live-table{font-size:.85rem}.live-progress{min-width:110px}}
.age-result-box{display:grid;grid-template-columns:auto auto;gap:4px 12px;align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px;padding:10px 14px;min-width:220px}.age-result-box span{color:#64748b;font-size:.78rem;text-transform:uppercase;font-weight:700}.age-result-box b{font-size:1.1rem}.mdp-age-mode{border:1px solid #e5e7eb;background:#f8fafc;border-radius:16px;padding:14px}.mdp-members-table input{min-width:150px}

/* Etap 1.12 — układ zawodów z bocznymi panelami */
.competition-left,.competition-right{position:fixed;top:56px;bottom:0;z-index:1020;background:#fff;border-color:#e5e7eb;box-shadow:0 12px 30px rgba(15,23,42,.12);overflow:auto;transition:transform .22s ease;width:292px}.competition-left{left:0;border-right:1px solid #e5e7eb}.competition-right{right:0;border-left:1px solid #e5e7eb;width:340px}.side-head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#f8fafc}.side-competition{padding:12px 14px;border-bottom:1px solid #e5e7eb;background:#fff7ed}.side-competition span{color:#64748b}.side-nav{display:grid;gap:4px;padding:10px}.side-nav a{display:block;padding:10px 12px;border-radius:10px;color:#111827;text-decoration:none;font-weight:700}.side-nav a:hover{background:#f1f5f9}.competition-main{padding-left:316px!important;padding-right:364px!important;transition:padding .22s ease}.sidebars-left-collapsed .competition-left{transform:translateX(-105%)}.sidebars-left-collapsed .competition-main{padding-left:24px!important}.sidebars-right-collapsed .competition-right{transform:translateX(105%)}.sidebars-right-collapsed .competition-main{padding-right:24px!important}.start-list{padding:0 10px 18px}.start-category{font-weight:900;text-transform:uppercase;color:#334155;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:8px 10px;margin:10px 0 8px}.start-team{display:block;text-decoration:none;color:#111827;border:1px solid #e5e7eb;border-radius:14px;padding:10px;margin-bottom:8px;background:#fff}.start-team:hover{border-color:#fb923c;background:#fff7ed;color:#111827}.start-team.active{border-color:#2563eb;background:#eff6ff}.start-statuses{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.start-statuses .status-pill{font-size:.72rem;padding:.18rem .45rem}.start-filter{padding:10px}.sidebar-backdrop{display:none;position:fixed;inset:56px 0 0 0;background:rgba(15,23,42,.35);z-index:1010}.start-team.hidden-by-filter{display:none}.context-empty{max-width:780px;margin:30px auto}.competition-picker .card{transition:transform .15s ease, box-shadow .15s ease}.competition-picker .card:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(15,23,42,.14)}
@media(max-width:1200px){.competition-left,.competition-right{top:56px}.competition-main{padding-left:24px!important;padding-right:24px!important}.competition-left{transform:translateX(-105%)}.competition-right{transform:translateX(105%)}body.mobile-left-open .competition-left{transform:translateX(0)}body.mobile-right-open .competition-right{transform:translateX(0)}body.mobile-left-open .sidebar-backdrop,body.mobile-right-open .sidebar-backdrop{display:block}}
@media print{.competition-left,.competition-right,.sidebar-backdrop{display:none!important}.competition-main{padding-left:0!important;padding-right:0!important}}

/* Etap 1.12.1 — poprawka historii i zwijane kategorie listy startowej */
.audit-payload{max-width:520px;white-space:pre-wrap;word-break:break-word}
.start-category{width:100%;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px;text-align:left;cursor:pointer;font-weight:900;text-transform:uppercase;color:#334155;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:8px 10px;margin:10px 0 8px}.start-category small{font-size:.68rem;text-transform:none;color:#64748b;font-weight:800;white-space:nowrap}.start-category-chevron{transition:transform .16s ease;color:#64748b}.start-category.collapsed .start-category-chevron{transform:rotate(-90deg)}.start-category-teams{display:block}.start-category-teams.collapsed{display:none}


/* Etap 1.12.2 — historia zmian i kompaktowa lista startowa */
.start-view-toggle{padding:0 10px 8px}.start-legend{padding:0 12px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.status-dot{width:11px;height:11px;border-radius:50%;display:inline-block;border:1px solid rgba(15,23,42,.18);vertical-align:middle}.status-dot.st-empty{background:#cbd5e1}.status-dot.st-live{background:#facc15}.status-dot.st-done{background:#22c55e}.status-dot.st-dq{background:#ef4444}.status-dot.st-draft{background:#f97316}.start-dots{display:none;gap:6px;align-items:center;white-space:nowrap}.start-team-main b{line-height:1.15}.competition-right.start-compact{width:300px}.competition-right.start-compact .start-help,.competition-right.start-compact .start-municipality,.competition-right.start-compact .start-statuses,.competition-right.start-compact .start-team-id{display:none!important}.competition-right.start-compact .start-dots{display:inline-flex}.competition-right.start-compact .start-team{padding:8px 10px;border-radius:12px;margin-bottom:6px}.competition-right.start-compact .start-team-main{align-items:center!important}.competition-right.start-compact .start-team-main b{font-size:.86rem;font-weight:800}.competition-right.start-compact .start-category{padding:7px 9px;margin:8px 0 6px}.competition-right.start-compact .start-category small{font-size:.64rem}.competition-right.start-compact .start-list{padding-left:8px;padding-right:8px}.sidebars-right-collapsed .competition-right.start-compact{transform:translateX(105%)}
@media(max-width:1200px){.competition-right.start-compact{width:320px;max-width:92vw}}

/* Etap 1.13 - sędziowanie na żywo i podpisy */
.live-judge-bar{border-left:6px solid #198754}
.live-choice{transition:.15s ease; border:1px solid #dfe5ea}
.live-choice:hover{transform:translateY(-2px); box-shadow:0 .5rem 1.2rem rgba(0,0,0,.08)}
.signature-row{max-width:100%;}
.signature-box{width:190px; min-width:170px;}
.signature-preview{height:58px; border:1px dashed #b6bec8; border-radius:.5rem; background:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; padding:3px;}
.signature-preview.empty{background:#f8f9fa; color:#6c757d; font-size:.82rem;}
.signature-preview.has-signature{border-style:solid; border-color:#198754; background:#fff;}
.signature-preview img{max-width:100%; max-height:100%; display:block;}
.signature-box .signature-btn{width:100%; white-space:normal; line-height:1.15;}
.signature-canvas{background:#fff; border:2px solid #222; border-radius:.5rem; width:100%; height:320px; touch-action:none;}
@media (max-width: 700px){.signature-box{width:100%;}.live-judge-bar{align-items:flex-start!important}}

/* Etap 1.13.1 - kompaktowy podgląd podpisu w Panelu Sędziego */
.signature-row{
  gap:.5rem!important;
  align-items:flex-start;
}
.signature-box{
  width:132px!important;
  min-width:132px!important;
  max-width:132px!important;
}
.signature-box .small{
  font-size:.68rem!important;
  line-height:1.1!important;
  margin-bottom:.2rem!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.signature-preview{
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  padding:2px!important;
  border-radius:.35rem!important;
}
.signature-preview.empty{
  font-size:.66rem!important;
}
.signature-preview img{
  max-width:100%!important;
  max-height:28px!important;
  object-fit:contain!important;
}
.signature-box .signature-btn{
  padding:.18rem .3rem!important;
  font-size:.66rem!important;
  line-height:1.05!important;
  min-height:24px;
}
@media (max-width: 700px){
  .signature-box{width:48%!important;min-width:120px!important;max-width:48%!important;}
  .signature-preview{height:38px!important;max-height:38px!important;}
  .signature-preview img{max-height:32px!important;}
}

/* Etap 2.0 — publiczne zgłoszenia drużyn */
.submission-public{background:#f8fafc;}
.submission-public .card{border-radius:18px;}
.submission-public .form-label{font-weight:700;}
.submission-public .table td,.submission-public .table th{vertical-align:middle;}
/* Etap 2.0.1 — zgłoszenia jednostek */
.st-correction{background:#dbeafe;color:#1d4ed8}.submission-team-list .list-group-item{border-left:6px solid #e5e7eb}.submission-row.submission-draft{background:#f8fafc;border-left-color:#cbd5e1}.submission-row.submission-submitted{background:#fffbeb;border-left-color:#facc15}.submission-row.submission-accepted{background:#ecfdf5;border-left-color:#22c55e}.submission-row.submission-correction{background:#eff6ff;border-left-color:#3b82f6}.submission-row.submission-rejected,.submission-row.submission-cancelled{background:#f8fafc;border-left-color:#ef4444;opacity:.86}.submission-public .list-group-item{border-radius:14px;margin-bottom:8px;border-top-width:1px}.submission-public .accordion-button{font-weight:800}.submission-public .table input,.submission-public .table select{min-width:150px}

/* Etap 2.4 — sekretariat zgłoszeń */
@media print{.no-print,.navbar,.competition-left,.competition-right,.sidebar-backdrop{display:none!important}.competition-main,main{padding:0!important;margin:0!important}.card{border:1px solid #111!important;box-shadow:none!important}.table{font-size:12px}.print-title{display:block!important}}


/* Etap 2.5 — porządek nawigacji */
.home-hero{display:flex;align-items:center;justify-content:space-between;gap:1rem;background:#fff;border-radius:18px;padding:20px 22px;box-shadow:0 8px 24px rgba(0,0,0,.08)}
.competition-home-card{height:100%;border:1px solid #e5e7eb;border-radius:16px;padding:16px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.04)}
.competition-home-card:hover{border-color:#fb923c;background:#fff7ed}
.side-nav-grouped{padding:10px 10px 16px}.side-section-title{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:900;margin:12px 8px 5px}.side-section{display:grid;gap:3px;margin-bottom:4px}.side-link{display:flex!important;align-items:center;gap:8px;padding:9px 10px!important;border-radius:10px;color:#111827;text-decoration:none;font-weight:700}.side-link:hover{background:#f1f5f9}.side-link.active{background:#fff7ed;color:#991b1b}.side-icon{width:22px;text-align:center;flex:0 0 22px}.no-right-sidebar .competition-main{padding-right:24px!important}.sidebars-left-collapsed.no-right-sidebar .competition-main{padding-left:24px!important}
@media(max-width:700px){.home-hero{align-items:flex-start;flex-direction:column}.home-hero .btn{width:100%}}

/* Etap 2.8.2 — czytelniejsze listy drużyn i panel zawodów */
.competition-regulation-grid,
.teams-regulation-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(520px,1fr));
  gap:1rem;
  align-items:start;
}
.competition-regulation-box,
.teams-regulation-box{
  min-width:0;
}
.competition-team-table th,
.competition-team-table td,
.teams-list-table th,
.teams-list-table td{
  vertical-align:middle;
}
.competition-team-table td:nth-child(2),
.teams-list-table td:nth-child(2){
  min-width:190px;
}
.team-check-icon{
  display:inline-flex;
  width:1.55rem;
  height:1.55rem;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  margin-right:.25rem;
  font-size:1rem;
}
.team-check-ok{background:#e8f8ee;}
.team-check-warn{background:#fff5d6;}
.team-check-bad{background:#ffe2e6;}
.team-row-check-warn{background:rgba(255,193,7,.04);}
.team-row-check-bad{background:rgba(220,53,69,.04);}
@media (max-width: 1250px){
  .competition-regulation-grid,
  .teams-regulation-grid{grid-template-columns:1fr;}
}
@media (max-width: 700px){
  .competition-team-table,
  .teams-list-table{font-size:.88rem;}
  .competition-team-table th:nth-child(3),
  .competition-team-table td:nth-child(3){display:none;}
}


/* Zawody OSP 3.1.7.4 — globalne kolory grup/kategorii */
:root{
  --zosp-cat-osp-male-bg:#dbeafe;
  --zosp-cat-osp-male-fg:#1e40af;
  --zosp-cat-osp-male-border:#93c5fd;
  --zosp-cat-mdp-male-bg:#eaf6ff;
  --zosp-cat-mdp-male-fg:#075985;
  --zosp-cat-mdp-male-border:#bae6fd;
  --zosp-cat-osp-female-bg:#fce7f3;
  --zosp-cat-osp-female-fg:#9d174d;
  --zosp-cat-osp-female-border:#f9a8d4;
  --zosp-cat-mdp-female-bg:#fff1f8;
  --zosp-cat-mdp-female-fg:#be185d;
  --zosp-cat-mdp-female-border:#fbcfe8;
}
.zosp-category-badge{display:inline-flex;align-items:center;border-radius:999px;border:1px solid rgba(15,23,42,.12);padding:.22rem .55rem;font-weight:800;font-size:.82rem;white-space:nowrap;}
.zosp-category-badge.zosp-cat-osp-male{background:var(--zosp-cat-osp-male-bg);color:var(--zosp-cat-osp-male-fg);border-color:var(--zosp-cat-osp-male-border);}
.zosp-category-badge.zosp-cat-mdp-male{background:var(--zosp-cat-mdp-male-bg);color:var(--zosp-cat-mdp-male-fg);border-color:var(--zosp-cat-mdp-male-border);}
.zosp-category-badge.zosp-cat-osp-female{background:var(--zosp-cat-osp-female-bg);color:var(--zosp-cat-osp-female-fg);border-color:var(--zosp-cat-osp-female-border);}
.zosp-category-badge.zosp-cat-mdp-female{background:var(--zosp-cat-mdp-female-bg);color:var(--zosp-cat-mdp-female-fg);border-color:var(--zosp-cat-mdp-female-border);}
.zosp-category-badge.zosp-cat-other{background:#f1f5f9;color:#334155;border-color:#cbd5e1;}
.zosp-cat-strip{border-left:6px solid #cbd5e1;}
.zosp-cat-strip.zosp-cat-osp-male{border-left-color:var(--zosp-cat-osp-male-border);}
.zosp-cat-strip.zosp-cat-mdp-male{border-left-color:var(--zosp-cat-mdp-male-border);}
.zosp-cat-strip.zosp-cat-osp-female{border-left-color:var(--zosp-cat-osp-female-border);}
.zosp-cat-strip.zosp-cat-mdp-female{border-left-color:var(--zosp-cat-mdp-female-border);}
