
*{box-sizing:border-box}
html{min-height:100%;background:#101820}
body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#e8edf3;background:#101820}
a{color:#e5a0a0;text-decoration:none}
.dashboard{min-height:100vh;display:flex;background:#101820}
.sidebar{width:300px;flex:0 0 300px;background:#121e29;border-right:1px solid #2a3947;padding:21px 14px;display:flex;flex-direction:column;min-height:100vh}
.brand{display:flex;align-items:center;gap:14px;margin-bottom:30px;padding:0 0 0 0}
.brand-icon{display:grid;place-items:center;background:#b3262d;color:#fff;font-weight:900;border-radius:14px;width:61px;height:61px;flex:0 0 61px}
.brand strong{display:block;letter-spacing:1.5px;font-size:17px}
.brand small{display:block;color:#9eacb9;font-size:11px;letter-spacing:1.5px;margin-top:5px}
.sidebar nav{display:grid;gap:7px;margin-top:45px}
.sidebar nav a{display:block;padding:15px 12px;color:#b8c5d0;border-radius:10px;font-size:14px}
.sidebar nav a:hover{background:#1b2a37;color:#fff}
.sidebar nav a.active{background:#2c2025;color:#fff;border-left:3px solid #c33138}
.sidebar nav em{float:right;font-size:10px;color:#81909d;font-style:normal}
.side-foot{margin-top:auto;color:#788897;font-size:11px;padding:16px 8px}
.main{flex:1;min-width:0;padding:34px 40px;max-width:1700px}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:28px}
.topbar h1{font-size:28px;line-height:1.2;margin:7px 0 0;color:#f4f7fb}
.eyebrow{font-size:11px;letter-spacing:2px;color:#d16b70;font-weight:800}
.userbox{font-size:13px;color:#b9c6d1;white-space:nowrap}
.userbox a{color:#f08b8f}
.welcome{padding:30px 32px;border:1px solid #334452;border-radius:16px;background:linear-gradient(110deg,#243746,#192631);display:flex;justify-content:space-between;align-items:center;gap:20px}
.welcome h2{font-size:27px;margin:10px 0}
.welcome p{max-width:700px;color:#b6c4cf;line-height:1.65}
.welcome-mark{font-size:45px;font-weight:900;color:#e5a0a0;border:4px solid #a72b32;border-radius:18px;padding:12px 18px;transform:rotate(-5deg)}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:24px 0}
.stats article{background:#192631;border:1px solid #2d3e4d;border-radius:14px;padding:21px;min-width:0}
.stats article span{color:#d66b70;font-size:22px}
.stats article strong{display:block;font-size:29px;margin:13px 0 4px;color:#f4f7fb}
.stats article small{color:#9fadb9;font-size:12px}
.panel-note{background:#192631;border:1px solid #2d3e4d;border-radius:14px;padding:22px;margin:18px 0}
.panel-note h3{margin:0 0 10px;color:#f1f5fa}
.panel-note p{color:#aab8c4;line-height:1.65}
.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #b3262d;border-radius:9px;background:#b3262d;color:white;padding:13px 18px;font-weight:700;cursor:pointer;text-align:center;font:inherit;font-size:13px}
.btn:hover{background:#c53239}
.btn-secondary{background:#344756;color:#e8edf3;border-color:#40536a}
.btn-secondary:hover{background:#43596b}
.muted,.hint{color:#aab7c4;font-size:13px;line-height:1.5}
.quiet-link{display:inline-block;color:#aebdca;font-size:13px}
.alert{padding:13px 15px;border-radius:9px;background:#4b2226;color:#ffd9dc;font-size:13px;border:1px solid #70363c}
.status-pill{display:inline-block;padding:5px 9px;border-radius:99px;font-size:11px;background:#344756;color:#dce6ee}
.status-pill.active{background:#1d4939;color:#9be0bd}
.status-pill.suspended{background:#57441f;color:#f2d28a}
.status-pill.inactive{background:#4a3436;color:#d9a5a7}
.table-wrap{width:100%;overflow-x:auto}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:13px 12px;border-bottom:1px solid #30414f;font-size:13px}
th{color:#9eafbd;font-weight:600}
td{color:#dce4eb}
.empty{text-align:center;color:#9eafbd;padding:28px}
@media(max-width:1050px){.sidebar{width:245px;flex-basis:245px}.main{padding:26px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.dashboard{display:block}.sidebar{width:100%;min-height:0;padding:15px}.sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:15px}.side-foot{display:none}.main{padding:20px}.topbar{align-items:flex-start;flex-direction:column}.welcome-mark{display:none}}

/* v0.4.1 – naprawa pełnego arkusza i formularzy */
.directory-heading{display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:24px!important;padding:0 0 22px!important;margin:0 0 22px!important;border-bottom:1px solid #293544!important}
.directory-heading h2{font-size:30px!important;line-height:1.2!important;margin:8px 0 9px!important;color:#f4f7fb!important}
.directory-heading p{font-size:13px!important;line-height:1.55!important;margin:0!important;color:#9aafca!important}
.result-counter{display:inline-flex!important;align-items:center!important;min-height:42px!important;padding:0 15px!important;border:1px solid #344256!important;border-radius:9px!important;color:#b7c9e1!important;font-size:11px!important;white-space:nowrap!important;background:#101925!important}
.management-card{display:block!important;width:100%!important;padding:25px!important;margin:0 0 18px!important;background:#151e2a!important;border:1px solid #2b394b!important;border-radius:14px!important}
.management-card-heading{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:20px!important;margin:0 0 22px!important}
.management-card-heading h3{font-size:18px!important;line-height:1.3!important;margin:0 0 7px!important;color:#f1f5fa!important}
.management-card-heading p{font-size:12px!important;line-height:1.5!important;margin:0!important;color:#91a8c6!important}
form.directory-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:19px 20px!important;width:100%!important;align-items:start!important;margin:0!important}
form.directory-form>label{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;min-width:0!important;width:100%!important;margin:0!important;padding:0!important;color:#c5d2e2!important;font-size:12px!important;line-height:1.35!important;font-weight:600!important}
form.directory-form input,form.directory-form select{display:block!important;width:100%!important;min-width:0!important;max-width:none!important;height:48px!important;min-height:48px!important;margin:0!important;padding:0 14px!important;border:1px solid #465970!important;border-radius:9px!important;background:#0c1420!important;color:#f4f7fb!important;font-family:inherit!important;font-size:14px!important;line-height:normal!important;box-shadow:none!important;outline:none!important}
form.directory-form input::placeholder{color:#7f93ae!important;opacity:1!important}
form.directory-form input:focus,form.directory-form select:focus{border-color:#8aa7cc!important;box-shadow:0 0 0 3px rgba(105,145,193,.13)!important}
.directory-form-actions{display:flex!important;grid-column:1/-1!important;align-items:center!important;gap:11px!important;margin:4px 0 0!important;padding:0!important}
.directory-form-actions .btn{display:inline-flex!important;justify-content:center!important;align-items:center!important;width:auto!important;min-width:160px!important;height:46px!important;min-height:46px!important;margin:0!important;padding:0 22px!important;border-radius:9px!important;font-size:13px!important;font-weight:700!important}
.directory-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important;margin:0 0 18px!important}
.directory-summary>div{display:block!important;min-width:0!important;padding:17px 19px!important;border:1px solid #2b394b!important;border-radius:11px!important;background:#151e2a!important}
.directory-summary strong{display:block!important;margin:0 0 5px!important;color:#f2f5f9!important;font-size:24px!important;line-height:1.2!important}
.directory-summary span{display:block!important;color:#91a9c8!important;font-size:11px!important;line-height:1.4!important}
.directory-filters{display:grid!important;grid-template-columns:minmax(240px,1.5fr) minmax(190px,.8fr) auto auto!important;align-items:center!important;gap:12px!important;margin:0 0 20px!important;width:100%!important}
.directory-filters input,.directory-filters select{display:block!important;width:100%!important;min-width:0!important;height:48px!important;margin:0!important;padding:0 14px!important;border:1px solid #40536a!important;border-radius:9px!important;background:#0c1420!important;color:#f2f5f9!important;font:inherit!important;font-size:13px!important}
.directory-filters .btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;height:48px!important;min-width:100px!important;margin:0!important;padding:0 18px!important}
.filter-reset{white-space:nowrap!important;color:#a9c4e6!important;font-size:12px!important}
.directory-table{width:100%!important;min-width:760px!important;border-collapse:collapse!important}
.directory-table th{padding:14px 12px!important;color:#91a9c8!important;font-size:10px!important;letter-spacing:.7px!important;text-align:left!important}
.directory-table td{padding:15px 12px!important;border-top:1px solid #293849!important;color:#dce5ef!important;font-size:13px!important}
.directory-table tbody tr:hover{background:#1a2735!important}
.row-actions{white-space:nowrap!important}.row-actions a{display:inline-block!important;margin-right:13px!important;color:#a9c4e6!important;font-size:12px!important;font-weight:600!important}.row-actions a:last-child{color:#ef9a9d!important}
.success-banner{margin:0 0 16px!important;padding:13px 16px!important;border:1px solid #28614e!important;border-radius:9px!important;background:#173c32!important;color:#a8e3c9!important;font-size:13px!important}
.text-action{color:#a9c4e6!important;font-size:12px!important;white-space:nowrap!important}
@media(max-width:900px){form.directory-form{grid-template-columns:repeat(2,minmax(0,1fr))!important}.directory-filters{grid-template-columns:1fr 1fr!important}}
@media(max-width:600px){.directory-heading{align-items:flex-start!important;flex-direction:column!important}.management-card{padding:17px!important}form.directory-form{grid-template-columns:1fr!important;gap:15px!important}.directory-form-actions{flex-direction:column!important;align-items:stretch!important}.directory-form-actions .btn{width:100%!important}.directory-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}.directory-filters{grid-template-columns:1fr!important}.directory-filters .btn{width:100%!important}.management-card-heading{flex-direction:column!important}}


/* OSP CONTROL – szybki powrót na górę */
.back-to-top{
  position:fixed;left:50%;bottom:22px;z-index:9999;
  width:48px;height:48px;display:flex;align-items:center;justify-content:center;
  border:1px solid #d65b61;border-radius:50%;
  background:rgba(179,38,45,.97);color:#fff;
  font-family:inherit;font-size:27px;font-weight:800;line-height:1;
  box-shadow:0 5px 22px rgba(0,0,0,.38);
  cursor:pointer;opacity:0;visibility:hidden;pointer-events:none;
  transform:translate(-50%,12px);
  transition:opacity .2s ease,transform .2s ease,visibility .2s ease,background .2s ease;
}
.back-to-top.is-visible{
  opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0);
}
.back-to-top:hover{background:#cc343b}
.back-to-top:focus-visible{outline:3px solid #f2b8ba;outline-offset:3px}
@media(max-width:600px){.back-to-top{bottom:16px;width:46px;height:46px}}
@media(prefers-reduced-motion:reduce){.back-to-top{transition:none}}

/* OSP CONTROL – ujednolicony wygląd formularza historii na karcie osoby */
.panel-note .member-form{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:start!important;
  gap:18px 20px!important;
  width:100%!important;
  margin:18px 0 0!important;
}
.panel-note .member-form>label{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:8px!important;
  min-width:0!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  color:#c5d2e2!important;
  font-size:12px!important;
  line-height:1.4!important;
  font-weight:600!important;
}
.panel-note .member-form input,
.panel-note .member-form select{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:48px!important;
  min-height:48px!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid #40536a!important;
  border-radius:9px!important;
  background:#0c1420!important;
  color:#f2f5f9!important;
  font:inherit!important;
  font-size:14px!important;
  line-height:normal!important;
  box-shadow:none!important;
  outline:none!important;
  color-scheme:dark;
}
.panel-note .member-form input:focus,
.panel-note .member-form select:focus{
  border-color:#8aa7cc!important;
  box-shadow:0 0 0 3px rgba(105,145,193,.15)!important;
}
.panel-note .member-form input::placeholder{color:#7f93ae!important;opacity:1!important}
.panel-note .member-form .form-actions{
  display:flex!important;
  grid-column:1/-1!important;
  align-items:center!important;
  gap:12px!important;
  margin:3px 0 0!important;
  padding:0!important;
}
.panel-note .member-form .form-actions .btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:170px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0 22px!important;
  border-radius:9px!important;
  font-size:13px!important;
  font-weight:700!important;
}
.panel-note>.hint{
  margin:17px 0 0!important;
  padding-top:14px!important;
  border-top:1px solid #2b394b!important;
  color:#91a9c8!important;
  font-size:12px!important;
  line-height:1.6!important;
}
@media(max-width:650px){
  .panel-note .member-form{grid-template-columns:1fr!important;gap:15px!important}
  .panel-note .member-form .form-actions{grid-column:1!important}
  .panel-note .member-form .form-actions .btn{width:100%!important}
}

/* OSP CONTROL – pola o pełnej szerokości w formularzach modułów */
form.directory-form>.wide-field{grid-column:1/-1!important}
@media(max-width:600px){form.directory-form>.wide-field{grid-column:auto!important}}

/* Ewidencja zdarzeń */
.event-form .wide-field{grid-column:1/-1}.event-type-field{grid-column:1/-1;border:0;padding:0;margin:0;min-width:0}.event-type-field legend{font-size:13px;font-weight:700;margin-bottom:10px;color:var(--text,#e8edf7)}.event-type-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.event-type-options label{position:relative;cursor:pointer}.event-type-options input{position:absolute;opacity:0;pointer-events:none}.event-type-options span{display:flex;align-items:center;justify-content:center;min-height:48px;padding:9px 12px;border:1px solid var(--border,#29354a);border-radius:10px;background:var(--card,#111b2b);color:var(--text,#e8edf7);font-size:13px;text-align:center}.event-type-options input:checked+span{border-color:#e34b55;background:rgba(210,45,58,.13);color:#fff}.event-type-options input:focus-visible+span{outline:2px solid #e34b55;outline-offset:2px}.event-map-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.event-map{width:100%;height:300px;border:1px solid var(--border,#29354a);border-radius:12px;overflow:hidden;background:#172235;z-index:0}.overview-map{height:390px}.map-status{font-size:12px;color:var(--muted,#9aa8bd);margin-top:7px;min-height:18px}.event-assignments{border:1px solid var(--border,#29354a);background:rgba(255,255,255,.02);border-radius:12px;padding:16px}.event-assignments h4{margin:0 0 5px;font-size:15px}.event-assignments p{margin:0 0 13px;color:var(--muted,#9aa8bd);font-size:12px}.event-check-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.event-check{display:flex;align-items:center;gap:9px;min-width:0;padding:10px 11px;border:1px solid var(--border,#29354a);border-radius:9px;background:var(--card,#111b2b);cursor:pointer}.event-check input{width:17px;height:17px;flex:0 0 auto;accent-color:#d9434d}.event-check span{display:flex;flex-direction:column;min-width:0;font-size:13px}.event-check small{font-size:11px;color:var(--muted,#9aa8bd);margin-top:2px}.event-type-pill{display:inline-flex;padding:5px 9px;border-radius:20px;background:rgba(255,255,255,.07);font-size:12px;white-space:nowrap}.event-type-pill.fire,.event-type-pill.accident{background:rgba(218,64,74,.15);color:#ff9ba2}.event-type-pill.local_hazard{background:rgba(230,164,58,.14);color:#f2c477}.event-type-pill.medical{background:rgba(63,157,204,.15);color:#8fd2f0}.event-map-card{margin-top:20px}.map-status{line-height:1.5}
@media(max-width:900px){.event-type-options{grid-template-columns:repeat(2,minmax(0,1fr))}.event-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-map{height:320px}}
@media(max-width:560px){.event-type-options,.event-check-grid{grid-template-columns:1fr}.event-map{height:260px}.overview-map{height:280px}.event-map-heading{align-items:flex-start;flex-direction:column}.event-map-heading .btn{width:100%}.event-assignments{padding:12px}}

/* Nawigacja: sekcja zdarzeń i dwa podmenu */
.sidebar nav .nav-section-label{padding:18px 18px 6px;color:#71839b;font-size:10px;font-weight:800;letter-spacing:1.2px}

/* OSP CONTROL – formularz dodawania zdarzenia: spójny ciemny wygląd */
.event-form .event-description-field textarea {
  display:block!important; width:100%!important; min-width:0!important;
  box-sizing:border-box!important; min-height:125px!important; padding:14px 16px!important;
  color:#e8edf5!important; background:#0c1420!important;
  border:1px solid #465970!important; border-radius:11px!important;
  box-shadow:none!important; font:inherit!important; font-size:14px!important;
  line-height:1.6!important; resize:vertical!important; color-scheme:dark;
}
.event-form .event-description-field textarea::placeholder {color:#8293a8!important;opacity:1!important}
.event-form .event-description-field textarea:focus {
  outline:none!important; border-color:#8aa7cc!important;
  box-shadow:0 0 0 3px rgba(105,145,193,.13)!important;
}
.event-form input[readonly] {
  color:#f3d5d6!important; background:#172333!important;
  border-color:#684047!important; cursor:default!important;
}
.event-form label small {display:block;color:#91a2b8;font-size:11px;line-height:1.45;margin-top:2px}
@media(max-width:600px){.event-form .event-description-field textarea{min-height:110px!important}}


/* FINAL OVERRIDE – compact checklist and vehicle cards in event form */
.directory-form.event-form .firefighter-picker-list,
.directory-form.event-form .vehicle-check-grid {
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr)) !important;
  gap:10px !important;
  align-items:stretch !important;
  width:100% !important;
  max-width:100% !important;
}
.directory-form.event-form .firefighter-picker-list label.event-check,
.directory-form.event-form .vehicle-check-grid label.event-check {
  display:flex !important;
  flex-direction:row !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:12px !important;
  box-sizing:border-box !important;
  position:relative !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  min-height:58px !important;
  height:auto !important;
  margin:0 !important;
  padding:11px 14px !important;
  overflow:hidden !important;
  background:#101b2a !important;
  border:1px solid #35465d !important;
  border-radius:10px !important;
  color:#edf3fb !important;
  cursor:pointer !important;
}
.directory-form.event-form .firefighter-picker-list label.event-check:has(input:checked),
.directory-form.event-form .vehicle-check-grid label.event-check:has(input:checked) {
  border-color:#d9434d !important;
  background:rgba(190,39,51,.13) !important;
}
.directory-form.event-form .firefighter-picker-list label.event-check input[type="checkbox"],
.directory-form.event-form .vehicle-check-grid label.event-check input[type="checkbox"] {
  appearance:auto !important;
  -webkit-appearance:checkbox !important;
  display:block !important;
  position:static !important;
  inset:auto !important;
  opacity:1 !important;
  visibility:visible !important;
  flex:0 0 18px !important;
  width:18px !important;
  min-width:18px !important;
  max-width:18px !important;
  height:18px !important;
  min-height:18px !important;
  margin:0 !important;
  padding:0 !important;
  transform:none !important;
  accent-color:#c52b36 !important;
}
.directory-form.event-form .firefighter-picker-list label.event-check > span,
.directory-form.event-form .vehicle-check-grid label.event-check > span {
  display:block !important;
  flex:1 1 auto !important;
  width:auto !important;
  min-width:0 !important;
  max-width:100% !important;
  margin:0 !important;
  padding:0 !important;
  color:#edf3fb !important;
  font-size:14px !important;
  line-height:1.4 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
.directory-form.event-form .vehicle-check-grid label.event-check > span strong {
  display:block !important;
  color:#fff !important;
  font-size:14px !important;
  font-weight:700 !important;
}
.directory-form.event-form .vehicle-check-grid label.event-check > span small {
  display:block !important;
  margin-top:3px !important;
  color:#9fb2cc !important;
  font-size:12px !important;
}
.directory-form.event-form details.firefighter-picker {
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  background:#101b2a !important;
  border:1px solid #35465d !important;
  border-radius:10px !important;
  overflow:hidden !important;
}
.directory-form.event-form details.firefighter-picker > summary {
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  width:100% !important;
  min-height:50px !important;
  box-sizing:border-box !important;
  padding:0 15px !important;
  color:#edf3fb !important;
  cursor:pointer !important;
  list-style:none !important;
}
.directory-form.event-form details.firefighter-picker > summary::marker,
.directory-form.event-form details.firefighter-picker > summary::-webkit-details-marker { display:none !important; content:""; }
.directory-form.event-form details.firefighter-picker > summary .selected-count {
  display:inline-block !important;
  flex:0 0 auto !important;
  margin-left:auto !important;
  color:#e7a0a5 !important;
  font-size:12px !important;
  white-space:nowrap !important;
}
.directory-form.event-form .firefighter-picker-list {
  max-height:260px !important;
  overflow-y:auto !important;
  padding:12px !important;
  border-top:1px solid #2d4057 !important;
}
.directory-form.event-form .vehicle-assignment { width:100% !important; }
@media(max-width:700px) {
  .directory-form.event-form .firefighter-picker-list,
  .directory-form.event-form .vehicle-check-grid {
    grid-template-columns:1fr !important;
  }
}
