:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: #17202a;
  background: #f3f5f7;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
.container { max-width: 1250px; margin: 0 auto; padding: 24px; }
h1, h2 { margin: 0 0 8px; }
h2 { font-size: 1.15rem; }
.card { background: #fff; border: 1px solid #dfe4e8; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.login-card { max-width: 420px; margin: 10vh auto; padding: 28px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
input, select, textarea { width: 100%; border: 1px solid #aeb7c0; border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; }
textarea { min-height: 95px; resize: vertical; }
button { border: 0; border-radius: 8px; padding: 10px 16px; background: #164e7a; color: #fff; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(.95); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary { background: #e7edf2; color: #1f2d3a; }
button.danger { background: #b91c1c; color: #fff; }
form { display: grid; gap: 15px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.muted { color: #66727e; margin: 0; }
.error { color: #a71919; min-height: 1.2em; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { background: #dfe6ec; color: #243746; }
.tab.active { background: #164e7a; color: #fff; }
.toolbar { display: flex; align-items: end; gap: 12px; padding: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar label { min-width: 170px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(150px, 220px)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 18px; display: flex; flex-direction: column; }
.stat strong { font-size: 2rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e1e5e8; text-align: left; vertical-align: middle; }
th { background: #eef2f5; font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.badge.present { background: #d9f2df; color: #17602a; }
.badge.absent { background: #eceff2; color: #465563; }
.badge.in { background: #dceefe; color: #0f4f7d; }
.badge.out { background: #f5e5d8; color: #783e15; }
.badge.offline { background: #fff0c7; color: #745309; }
.employee-form { grid-template-columns: repeat(4, 1fr) auto; align-items: end; padding: 16px; margin-bottom: 14px; }
.employee-form h2 { grid-column: 1 / -1; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input { max-width: 130px; }
.message { padding: 12px 15px; margin-bottom: 14px; border-radius: 8px; background: #e6f2fb; border: 1px solid #a8cde7; }
.message.error { background: #fde8e8; border-color: #efb0b0; color: #841d1d; }
dialog { border: 0; border-radius: 12px; padding: 24px; width: min(500px, 92vw); box-shadow: 0 18px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.small-button { padding: 7px 10px; font-size: .82rem; }
@media (max-width: 850px) {
  .container { padding: 12px; }
  .employee-form { grid-template-columns: 1fr 1fr; }
  .employee-form h2 { grid-column: 1 / -1; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 520px) {
  .employee-form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Grupowanie i filtrowanie według działów */
.department-row td {
  padding: 10px 14px;
  background: #dfeaf3;
  color: #173f5f;
  border-top: 2px solid #b8cad8;
  border-bottom: 1px solid #c7d6e2;
  font-weight: 800;
}
.department-row td span { transform: translateX(-18px); }
.department-row td small { color: #587083; font-weight: 600; }
.empty-row td { padding: 28px 14px; text-align: center; color: #66727e; }
.department-editor input { min-width: 170px; max-width: 230px; }
@media (max-width: 850px) {
  .department-editor { align-items: stretch; flex-direction: column; }
  .department-editor input { min-width: 150px; max-width: none; }
}

/* Wersja 1.3 – segregowanie obecnych i raporty okresowe */
.stats { grid-template-columns: repeat(3, minmax(150px, 220px)); }
.presence-status-row td {
  padding: 8px 24px;
  font-weight: 800;
  border-bottom: 1px solid #dce3e8;
}
.presence-status-row td span { transform: translateX(-18px); }
.presence-status-row td small { font-weight: 600; }
.presence-status-row.present-group td { background: #edf8f0; color: #17602a; }
.presence-status-row.absent-group td { background: #f4f5f6; color: #465563; }
.report-card {
  margin-top: 14px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}
.report-controls { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.report-controls label { min-width: 165px; }
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr; }
  .report-card { align-items: stretch; }
  .report-controls { flex-direction: column; align-items: stretch; width: 100%; }
  .report-controls label { min-width: 0; }
}

/* Wersja 1.4 – zakresy dostępu administratorów */
.scope-info {
  display: inline-block;
  margin: 5px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e8f0f7;
  color: #244e6e;
  font-weight: 700;
  font-size: .9rem;
}
.account-form {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.2fr auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px;
}
.account-form h2 { grid-column: 1 / -1; margin: 0; }
.checkbox-label {
  min-height: 43px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.checkbox-label input { width: auto; }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1000px) {
  .account-form { grid-template-columns: 1fr 1fr; }
  .account-form h2 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .account-form { grid-template-columns: 1fr; }
}

.departments-field {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  min-width: 280px;
}
.departments-field legend { font-weight: 700; padding: 0 6px; }
.department-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
  margin: 6px 0;
}
.department-checkboxes label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.department-checkboxes input { width: auto; margin: 0; }
.account-scope-editor { min-width: 330px; }
.account-scope-editor .department-checkboxes { grid-template-columns: 1fr 1fr; }
.scope-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Wersja 1.6 – adresy e-mail i raporty kierowników */
.account-email-editor {
  min-width: 250px;
  display: grid;
  gap: 8px;
}
.checkbox-label.compact {
  min-height: auto;
  font-size: .9rem;
  font-weight: 600;
}
.account-email-editor .inline { flex-wrap: wrap; }


/* Wersja 1.7 – uwagi kierowników do zdarzeń */
.manager-note-cell { min-width: 220px; white-space: pre-wrap; }
.event-actions { display: flex; gap: 7px; flex-wrap: wrap; min-width: 170px; }
#noteDialog textarea { min-height: 140px; }
#noteEventLabel { margin-bottom: 14px; }


/* Wersja 1.8 – ręczne dodawanie zdarzeń */
.manual-event-form { display:grid; grid-template-columns:minmax(220px,1.4fr) minmax(150px,.7fr) minmax(210px,1fr) minmax(260px,1.5fr) auto; gap:14px; align-items:end; margin-bottom:16px; }
.manual-event-form .form-heading { grid-column:1 / -1; }
.manual-event-form .form-heading h2 { margin:0 0 4px; }
.manual-event-form .form-heading p { margin:0; }
.manual-event-form textarea { min-height:76px; resize:vertical; }
.badge.manual { background:#fff1cc; color:#6b4b00; }
@media (max-width:1100px) { .manual-event-form { grid-template-columns:1fr 1fr; } .manual-event-form button { width:100%; } }
@media (max-width:680px) { .manual-event-form { grid-template-columns:1fr; } }
.badge.auto { background:#e8ddff; color:#4c2b82; }
.badge.card { background:#e1f5f0; color:#00644f; }


/* Wersja 2.4 – publiczny panel obecności dla pracowników */
.public-presence-page { background:#f3f5f7; }
.public-container { max-width:1100px; margin:0 auto; padding:24px; }
.public-header { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:22px; margin-bottom:16px; }
.public-header h1 { margin:0 0 6px; }
.public-header-right { text-align:right; display:grid; gap:6px; }
.public-stats { margin-bottom:16px; }
.public-filters { display:flex; align-items:end; gap:12px; padding:14px; margin-bottom:16px; flex-wrap:wrap; }
.public-filters label { min-width:190px; }
.public-presence-table { min-width:650px; }
.public-presence-table td:first-child { font-size:1.02rem; }
.public-note { margin:14px 4px 0; }
@media (max-width:700px) {
  .public-container { padding:12px; }
  .public-header { align-items:flex-start; flex-direction:column; }
  .public-header-right { text-align:left; }
  .public-filters { align-items:stretch; flex-direction:column; }
  .public-filters label { min-width:0; }
}

/* Wersja 2.6 – zgłoszenia usterek */
.fault-container { max-width: 850px; }
.fault-form-card { padding: 22px; }
.fault-form { display: grid; gap: 14px; }
.fault-form textarea { min-height: 150px; resize: vertical; }
.fault-result { margin-top: 16px; padding: 14px; border-radius: 10px; font-weight: 700; }
.fault-result.success { background: #dcfce7; color: #166534; }
.fault-result.error { background: #fee2e2; color: #991b1b; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.secondary-link { border: 1px solid #cbd5e1; border-radius: 9px; padding: 10px 12px; text-decoration: none; color: #1f2937; background: #fff; font-weight: 700; }
.fault-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.fault-toolbar label { min-width: 160px; }
.fault-stats { margin: 14px 0; }
.fault-table { min-width: 1050px; }
.fault-description { max-width: 360px; white-space: pre-wrap; }
.badge.fault-status.NEW { background: #fee2e2; color: #991b1b; }
.badge.fault-status.IN_PROGRESS { background: #fef3c7; color: #92400e; }
.badge.fault-status.DONE { background: #dcfce7; color: #166534; }
.badge.fault-status.REJECTED { background: #e5e7eb; color: #374151; }
#faultStatusDialog textarea { min-height: 120px; }
@media (max-width: 700px) {
  .fault-toolbar { align-items: stretch; flex-direction: column; }
  .fault-toolbar label { min-width: 0; }
  .topbar-actions { justify-content: flex-start; }
}
.tab-link { display: inline-flex; align-items: center; text-decoration: none; border-radius: 8px; padding: 10px 16px; font-weight: 700; }

/* Wersja 2.6.1 – logo Drzonków w publicznym panelu obecności */
.public-header-with-logo { align-items: center; }
.public-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.public-logo {
  width: 170px;
  max-width: 32vw;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}
@media (max-width: 700px) {
  .public-brand { align-items: flex-start; flex-direction: column; gap: 12px; }
  .public-logo { width: 145px; max-width: 70vw; }
}

/* v3.7.2 – wspólne logo WOSiR na wszystkich podstronach WWW */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.login-brand .public-logo {
  width: 150px;
  max-width: 100%;
}
.topbar .public-brand {
  flex: 1 1 auto;
}


/* Wersja 2.8.6 – przyciski uwag i poprawy po prawej stronie tabeli Zdarzenia */
@media (min-width: 1100px) {
  .container { max-width: 1720px; }
}

#eventsTab .table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

#eventsTab table {
  min-width: 1500px;
  table-layout: fixed;
}

#eventsTab th,
#eventsTab td {
  padding: 8px 8px;
  font-size: .82rem;
  line-height: 1.25;
  vertical-align: top;
}

#eventsTab th:nth-child(1),
#eventsTab td:nth-child(1) { width: 170px; white-space: nowrap; }
#eventsTab th:nth-child(2),
#eventsTab td:nth-child(2) { width: 220px; white-space: nowrap; }
#eventsTab th:nth-child(3),
#eventsTab td:nth-child(3) { width: 160px; }
#eventsTab th:nth-child(4),
#eventsTab td:nth-child(4) { width: 105px; }
#eventsTab th:nth-child(5),
#eventsTab td:nth-child(5) { width: 110px; }
#eventsTab th:nth-child(6),
#eventsTab td:nth-child(6) { width: 130px; word-break: break-word; }
#eventsTab th:nth-child(7),
#eventsTab td:nth-child(7) { width: 190px; word-break: break-word; }
#eventsTab th:nth-child(8),
#eventsTab td:nth-child(8) { width: 190px; word-break: break-word; white-space: pre-wrap; }
#eventsTab th:nth-child(9),
#eventsTab td:nth-child(9) { width: 190px; word-break: break-word; }
#eventsTab th:nth-child(10),
#eventsTab td:nth-child(10) { width: 165px; }

#eventsTab th:last-child,
#eventsTab td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #ffffff;
  box-shadow: -7px 0 10px rgba(0,0,0,.08);
}

#eventsTab th:last-child {
  background: #eef2f5;
  z-index: 5;
}

#eventsTab .event-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#eventsTab .event-actions .small-button {
  width: 100%;
  padding: 8px 7px;
  font-size: .78rem;
  white-space: nowrap;
}

/* Wersja 2.8.5 – zarządzanie działami */
.department-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
}
.department-form h2 { grid-column: 1 / -1; margin: 0; }
.departments-table { min-width: 1050px; }
.departments-table td:nth-child(2),
.departments-table td:nth-child(3) { font-weight: 800; text-align: center; }
.departments-table th:nth-child(2),
.departments-table th:nth-child(3) { text-align: center; }
.department-rename input { min-width: 230px; max-width: 330px; }
.department-merge select { min-width: 230px; }
@media (max-width: 760px) {
  .department-form { grid-template-columns: 1fr; }
  .department-form h2 { grid-column: auto; }
  .department-rename, .department-merge { flex-direction: column; align-items: stretch; }
  .department-rename input, .department-merge select { max-width: none; width: 100%; }
}

/* v2.8.7 - uproszczony raport miesięczny */
.report-controls-secondary { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5edf3; }
.report-controls-secondary button { min-width: 270px; }

/* v3.0 - zakładka Lokalizacja */
.location-table th,
.location-table td { vertical-align: top; }
.location-table .event-actions { display: flex; flex-direction: column; gap: 6px; }
.location-table .small-button { display: inline-block; text-align: center; text-decoration: none; }
.badge.mobile { background:#dbeafe; color:#1e40af; }


/* v3.0.3 - tryb ciemny systemu */
:root { color-scheme: light dark; }
.logo-card,
.public-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (prefers-color-scheme: dark) {
  :root {
    color: #e5e7eb;
    background: #020617;
  }
  body,
  .public-presence-page {
    background: #020617;
    color: #e5e7eb;
  }
  .card,
  dialog {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 2px 12px rgba(0,0,0,.35);
    color: #e5e7eb;
  }
  input,
  select,
  textarea {
    background: #111827;
    color: #e5e7eb;
    border-color: #475569;
  }
  input::placeholder,
  textarea::placeholder { color: #94a3b8; }
  th {
    background: #1e293b;
    color: #e5e7eb;
    border-bottom-color: #334155;
  }
  td { border-bottom-color: #334155; }
  button.secondary,
  .tab,
  .secondary-link {
    background: #1e293b;
    color: #e5e7eb;
    border-color: #334155;
  }
  .tab.active,
  button,
  .tab-link {
    background: #0ea5e9;
    color: #020617;
  }
  button.danger {
    background: #dc2626;
    color: #fff;
  }
  .muted,
  .empty-row td,
  .public-note,
  .department-row td small,
  .presence-status-row td small {
    color: #cbd5e1;
  }
  .message {
    background: #0f2a44;
    border-color: #1d4ed8;
    color: #e0f2fe;
  }
  .message.error,
  .fault-result.error {
    background: #451a1a;
    border-color: #991b1b;
    color: #fecaca;
  }
  .fault-result.success {
    background: #052e16;
    color: #bbf7d0;
  }
  .department-row td,
  .presence-status-row.present-group td,
  .presence-status-row.absent-group td {
    background: #1e293b;
    color: #e5e7eb;
    border-color: #334155;
  }
  .scope-info {
    background: #1e293b;
    color: #bae6fd;
  }
  .departments-field {
    border-color: #334155;
  }
  .report-controls-secondary {
    border-top-color: #334155;
  }
  #eventsTab th:last-child,
  #eventsTab td:last-child {
    background: #0f172a;
    box-shadow: -7px 0 10px rgba(0,0,0,.35);
  }
  #eventsTab th:last-child { background: #1e293b; }
  .badge.absent,
  .badge.fault-status.REJECTED { background: #334155; color: #e5e7eb; }
  .badge.present,
  .badge.fault-status.DONE { background: #064e3b; color: #bbf7d0; }
  .badge.in,
  .badge.mobile { background: #075985; color: #e0f2fe; }
  .badge.out { background: #7c2d12; color: #ffedd5; }
  .badge.offline,
  .badge.manual { background: #713f12; color: #fef3c7; }
  .badge.auto { background: #4c1d95; color: #ede9fe; }
  .badge.card { background: #134e4a; color: #ccfbf1; }
  .public-logo { content: url('/static/logo-drzonkow-dark.png'); }
}


.badge.warning { background: #fef3c7; color: #92400e; }
.badge.correction-pending { background: #fef3c7; color: #92400e; }
.badge.correction-approved { background: #dcfce7; color: #166534; }
.badge.correction-rejected { background: #fee2e2; color: #991b1b; }
.issues-table td, .corrections-table td, .audit-table td { vertical-align: top; }
.audit-table td:nth-child(5) { min-width: 280px; }
@media (prefers-color-scheme: dark) {
  .badge.warning,
  .badge.correction-pending { background: #713f12; color: #fef3c7; }
  .badge.correction-approved { background: #064e3b; color: #bbf7d0; }
  .badge.correction-rejected { background: #7f1d1d; color: #fecaca; }
}


.schedule-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}
.schedule-form .form-heading {
  grid-column: 1 / -1;
}
.schedule-form textarea {
  min-height: 72px;
}
/* Masowe planowanie harmonogramu */
#scheduleBulkForm {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

#scheduleBulkForm .schedule-weekdays {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

#scheduleBulkForm .schedule-weekdays > .muted {
  flex-basis: 100%;
  margin-bottom: 2px;
}

#scheduleBulkForm .schedule-weekdays label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-width: 72px;
  padding: 9px 12px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

#scheduleBulkForm .schedule-weekdays input[type="checkbox"] {
  width: auto;
  margin: 0;
}

#scheduleBulkForm > label:has(#scheduleBulkNote) {
  grid-column: 1 / -1;
}

#scheduleBulkForm #scheduleBulkNote {
  width: 100%;
  min-height: 72px;
}

#scheduleBulkForm > .inline {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  #scheduleBulkForm {
    grid-template-columns: 1fr;
  }

  #scheduleBulkForm .schedule-weekdays,
  #scheduleBulkForm > label:has(#scheduleBulkNote),
  #scheduleBulkForm > .inline {
    grid-column: 1;
  }
}
.schedule-work { background: #dbeafe; color: #1e40af; }
.schedule-day_off { background: #e5e7eb; color: #374151; }
.schedule-vacation { background: #dcfce7; color: #166534; }
.schedule-sick { background: #fee2e2; color: #991b1b; }
.schedule-delegation { background: #fef3c7; color: #92400e; }
.schedule-other { background: #ede9fe; color: #5b21b6; }

@media (prefers-color-scheme: dark) {
  .schedule-work { background: #1e3a8a; color: #dbeafe; }
  .schedule-day_off { background: #374151; color: #f3f4f6; }
  .schedule-vacation { background: #14532d; color: #dcfce7; }
  .schedule-sick { background: #7f1d1d; color: #fee2e2; }
  .schedule-delegation { background: #78350f; color: #fef3c7; }
  .schedule-other { background: #4c1d95; color: #ede9fe; }
}

/* Wersja 3.4 – alerty kierowników */
.tab-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.45em;
  height:1.45em;
  margin-left:6px;
  padding:0 6px;
  border-radius:999px;
  background:#b91c1c;
  color:#fff;
  font-size:.75rem;
  font-weight:900;
}
.alerts-stats { grid-template-columns: repeat(3, minmax(150px, 220px)); }
.critical-stat strong { color:#991b1b; }
.warning-stat strong { color:#92400e; }
.info-stat strong { color:#1d4ed8; }
.alerts-table td { vertical-align:top; }
.alert-badge.critical { background:#fee2e2; color:#991b1b; }
.alert-badge.warning { background:#fef3c7; color:#92400e; }
.alert-badge.info { background:#dbeafe; color:#1d4ed8; }
.alert-row.alert-critical td { background:#fff7f7; }
.alert-row.alert-warning td { background:#fffbeb; }
.alert-row.alert-info td { background:#f8fbff; }
@media (max-width: 700px) { .alerts-stats { grid-template-columns:1fr; } }

@media (prefers-color-scheme: dark) {
  .tab-count { background:#ef4444; color:#fff; }
  .critical-stat strong { color:#fca5a5; }
  .warning-stat strong { color:#fcd34d; }
  .info-stat strong { color:#93c5fd; }
  .alert-badge.critical { background:#7f1d1d; color:#fecaca; }
  .alert-badge.warning { background:#78350f; color:#fde68a; }
  .alert-badge.info { background:#1e3a8a; color:#bfdbfe; }
  .alert-row.alert-critical td { background:#2a1417; }
  .alert-row.alert-warning td { background:#261b09; }
  .alert-row.alert-info td { background:#101c31; }
}


/* Wersja 3.5 – mapa lokalizacji w managerze */
.location-map-card { margin-top: 16px; }
.location-map-header {
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:12px;
}
.location-map-header h3 { margin:0 0 4px 0; }
.location-map {
  width:100%;
  min-height:430px;
  border:1px solid #d1d5db;
  border-radius:18px;
  overflow:hidden;
  background:#eef2f7;
}
.location-map-fallback {
  margin-top:12px;
  border:1px solid #d1d5db;
  border-radius:18px;
  overflow:hidden;
  background:#f8fafc;
}
.location-map-fallback svg { display:block; width:100%; min-height:360px; }
.location-map-fallback rect { fill:#f1f5f9; stroke:#cbd5e1; }
.location-map-fallback polyline { fill:none; stroke:#2563eb; stroke-width:5; stroke-linejoin:round; stroke-linecap:round; }
.location-map-fallback circle { fill:#dc2626; stroke:#fff; stroke-width:3; }
.location-map-fallback text { font:700 14px Arial, sans-serif; fill:#0f172a; paint-order:stroke; stroke:#fff; stroke-width:4px; }
.location-fallback-note { padding:10px 14px; font-size:.92rem; color:#475569; border-bottom:1px solid #e5e7eb; }
.location-points-wrap { margin-top:14px; max-height:340px; overflow:auto; }
.location-points-table td { vertical-align:top; }
.location-table .event-actions { display:flex; flex-wrap:wrap; gap:6px; }
.leaflet-container { font-family: Arial, sans-serif; }
@media (max-width: 760px) {
  .location-map-header { flex-direction:column; }
  .location-map { min-height:360px; }
}
@media (prefers-color-scheme: dark) {
  .location-map { border-color:#334155; background:#0f172a; }
  .location-map-fallback { border-color:#334155; background:#0f172a; }
  .location-map-fallback rect { fill:#111827; stroke:#334155; }
  .location-map-fallback polyline { stroke:#60a5fa; }
  .location-map-fallback circle { fill:#ef4444; stroke:#020617; }
  .location-map-fallback text { fill:#e5e7eb; stroke:#020617; }
  .location-fallback-note { color:#cbd5e1; border-bottom-color:#334155; }
}


.attachment-row {
  display: grid;
  grid-template-columns: 120px 1fr 170px auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.table-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fault-status.ACCEPTED { background: #dbeafe; color: #1d4ed8; }
.fault-status.WAITING_PARTS { background: #fef3c7; color: #92400e; }
.fault-status.REPAIRED { background: #dcfce7; color: #166534; }


.work-card-controls {
  border-top: 1px solid #dbe4f0;
  padding-top: 12px;
}
.work-card-controls select {
  min-width: 260px;
}
@media (prefers-color-scheme: dark) {
  .work-card-controls {
    border-top-color: #334155;
  }
}

/* v3.8.0 – indywidualny dostęp do zakładek panelu managera */
.permission-checkboxes { min-width: 280px; }
.account-scope-editor .permission-checkboxes { grid-template-columns: 1fr; }
@media (min-width: 1500px) {
  .account-scope-editor .permission-checkboxes { grid-template-columns: 1fr 1fr; }
}


.permission-tab[hidden] {
  display: none !important;
}


/* === WSPÓLNY NAGŁÓWEK MODUŁÓW 2026-09-19 === */

.module-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 20px 22px;
}

.module-page-header .public-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.module-page-header .public-logo {
  width: 170px;
  max-width: 28vw;
  height: auto;
  flex: 0 0 auto;
}

.module-page-header h1 {
  margin: 0 0 5px;
}

.module-page-header p {
  margin: 0;
}

.module-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.module-page-actions .button,
.module-page-actions button {
  white-space: nowrap;
}

.module-page-actions [hidden] {
  display: none !important;
}

.module-page-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}

@media (max-width: 760px) {
  .module-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-page-header .public-logo {
    width: 145px;
    max-width: 45vw;
  }

  .module-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .module-page-status {
    align-items: flex-start;
    text-align: left;
  }
}


/* === PRZYCISKI NAWIGACYJNE W NAGŁÓWKACH === */

.module-page-actions a.button,
.module-page-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  box-sizing: border-box;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.module-page-actions a.button:hover,
.module-page-actions button:hover {
  background: #27364d;
  color: #ffffff;
  text-decoration: none;
  filter: none;
}

.module-page-actions a.button.secondary,
.module-page-actions button.secondary {
  background: #1e293b;
  color: #f8fafc;
}

.module-page-actions a.button.secondary:hover,
.module-page-actions button.secondary:hover {
  background: #27364d;
}

.module-page-actions a.button:not(.secondary),
.module-page-actions button:not(.secondary) {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #04111d;
}

.module-page-actions a.button:not(.secondary):hover,
.module-page-actions button:not(.secondary):hover {
  background: #38bdf8;
  color: #04111d;
}


/* === NOWOCZESNY TRYB JASNY 2026-09-21 === */

@media (prefers-color-scheme: light) {

  :root {
    color: #0f172a;
    background: #eef3f8;
  }

  body,
  .public-presence-page {
    background: #eef3f8;
    color: #0f172a;
  }

  /* Karty i główne powierzchnie */
  .card,
  dialog {
    background: #ffffff;
    border-color: #d7e0ea;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, .04),
      0 8px 24px rgba(15, 23, 42, .06);
    color: #0f172a;
  }

  /* Pola formularzy */
  input,
  select,
  textarea {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  input::placeholder,
  textarea::placeholder {
    color: #94a3b8;
  }

  input:focus,
  select:focus,
  textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
  }

  /* Tabele */
  th {
    background: #edf3f8;
    color: #334155;
    border-bottom-color: #d7e0ea;
  }

  td {
    border-bottom-color: #e2e8f0;
  }

  tbody tr:not(.department-row):not(.presence-status-row):hover td {
    background: #f8fafc;
  }

  /* Przyciski główne */
  button,
  .tab.active,
  .tab-link {
    background: #0ea5e9;
    color: #082f49;
  }

  button:hover,
  .tab-link:hover {
    filter: brightness(.97);
  }

  /* Przyciski drugorzędne / zakładki */
  button.secondary,
  .tab,
  .secondary-link {
    background: #e8eef5;
    color: #334155;
    border-color: #cbd5e1;
  }

  button.secondary:hover,
  .tab:hover,
  .secondary-link:hover {
    background: #dce6f0;
  }

  button.danger {
    background: #dc2626;
    color: #ffffff;
  }

  /* Teksty pomocnicze */
  .muted,
  .empty-row td,
  .public-note,
  .department-row td small,
  .presence-status-row td small {
    color: #64748b;
  }

  /* Komunikaty */
  .message {
    background: #eaf6fd;
    border-color: #93cfea;
    color: #164e63;
  }

  .message.error,
  .fault-result.error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
  }

  .fault-result.success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
  }

  /* Wiersze działów i obecności */
  .department-row td {
    background: #e7f0f7;
    color: #17415f;
    border-color: #cad9e5;
  }

  .presence-status-row.present-group td {
    background: #edf8f1;
    color: #166534;
    border-color: #d7eadc;
  }

  .presence-status-row.absent-group td {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
  }

  /* Informacje o zakresie dostępu */
  .scope-info {
    background: #e8f2f8;
    color: #185378;
  }

  .departments-field {
    border-color: #cbd5e1;
  }

  .report-controls-secondary,
  .work-card-controls {
    border-top-color: #d7e0ea;
  }

  /* Ostatnia kolumna tabeli zdarzeń */
  #eventsTab th:last-child,
  #eventsTab td:last-child {
    background: #ffffff;
    box-shadow: -7px 0 10px rgba(15, 23, 42, .05);
  }

  #eventsTab th:last-child {
    background: #edf3f8;
  }

  /* Wspólne nagłówki modułów */
  .module-page-header {
    background: #ffffff;
    border-color: #d7e0ea;
  }

  .module-page-header h1 {
    color: #0f172a;
  }

  .module-page-header p {
    color: #64748b;
  }

  /* Przyciski / linki w nagłówkach */
  .module-page-actions a.button,
  .module-page-actions button {
    background: #e8eef5;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: none;
  }

  .module-page-actions a.button:hover,
  .module-page-actions button:hover {
    background: #dce6f0;
    color: #0f172a;
  }

  .module-page-actions a.button.secondary,
  .module-page-actions button.secondary {
    background: #e8eef5;
    border-color: #cbd5e1;
    color: #334155;
  }

  .module-page-actions a.button.secondary:hover,
  .module-page-actions button.secondary:hover {
    background: #dce6f0;
  }

  .module-page-actions a.button:not(.secondary),
  .module-page-actions button:not(.secondary) {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #082f49;
  }

  .module-page-actions a.button:not(.secondary):hover,
  .module-page-actions button:not(.secondary):hover {
    background: #38bdf8;
    color: #082f49;
  }

  /* Mapa */
  .location-map {
    border-color: #d7e0ea;
    background: #eef3f8;
  }

  .location-map-fallback {
    border-color: #d7e0ea;
    background: #f8fafc;
  }

  .location-fallback-note {
    color: #64748b;
    border-bottom-color: #e2e8f0;
  }
}



/* ==========================================================
   ŚRODKI CZYSTOŚCI — formularz publiczny
   ========================================================== */

.cleaning-container {
  max-width: 1050px;
}

.cleaning-form-card {
  padding: 22px;
  margin-bottom: 16px;
}

.cleaning-form-card h2 {
  margin-top: 0;
}

.cleaning-order-meta {
  display: grid;
  grid-template-columns:
    minmax(170px, 0.7fr)
    minmax(220px, 1fr)
    minmax(240px, 1.3fr);
  gap: 16px;
}

.cleaning-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.cleaning-section-heading h2,
.cleaning-section-heading p {
  margin-top: 0;
}

.cleaning-category {
  margin: 20px 0 28px;
}

.cleaning-category > h3 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #dbe3ea;
}

.cleaning-product-list {
  display: grid;
  gap: 8px;
}

.cleaning-product-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    150px;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.cleaning-product-info {
  min-width: 0;
}

.cleaning-product-description {
  margin-top: 3px;
  font-size: .88rem;
}

.cleaning-quantity-wrap {
  display: grid;
  gap: 5px;
  margin: 0;
}

.cleaning-quantity-wrap span {
  font-size: .78rem;
  font-weight: 700;
}

.cleaning-quantity-wrap input {
  width: 100%;
}

.cleaning-custom-row {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.2fr)
    minmax(180px, 1.4fr)
    110px
    110px
    auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #dbe3ea;
  border-radius: 10px;
}

.cleaning-custom-row label {
  margin: 0;
}

.cleaning-remove-custom {
  white-space: nowrap;
}

.cleaning-form-card textarea {
  min-height: 110px;
  resize: vertical;
}

.cleaning-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}


@media (max-width: 800px) {

  .cleaning-order-meta {
    grid-template-columns: 1fr;
  }

  .cleaning-section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .cleaning-product-row {
    grid-template-columns: 1fr 125px;
  }

  .cleaning-custom-row {
    grid-template-columns: 1fr 1fr;
  }

  .cleaning-remove-custom {
    grid-column: 1 / -1;
  }
}


@media (max-width: 560px) {

  .cleaning-form-card {
    padding: 15px;
  }

  .cleaning-product-row {
    grid-template-columns: 1fr;
  }

  .cleaning-custom-row {
    grid-template-columns: 1fr;
  }

  .cleaning-remove-custom {
    grid-column: auto;
  }

  .cleaning-submit-row {
    justify-content: stretch;
  }

  .cleaning-submit-row button {
    width: 100%;
  }
}


@media (prefers-color-scheme: dark) {

  .cleaning-category > h3 {
    border-bottom-color: #334155;
  }

  .cleaning-product-row {
    background: #111827;
    border-color: #334155;
  }

  .cleaning-custom-row {
    border-color: #334155;
  }
}


/* ==========================================================
   ŚRODKI CZYSTOŚCI — poprawiona hierarchia formularza
   ========================================================== */

.cleaning-form-card > h2 {
  font-size: 1.18rem;
  margin-bottom: 18px;
}

.cleaning-category {
  margin: 26px 0;
  padding: 18px;
  border: 1px solid #d8e1ea;
  border-radius: 14px;
  background: #f7f9fb;
}

.cleaning-category:first-child {
  margin-top: 10px;
}

.cleaning-category > h3 {
  margin: 0 0 16px;
  padding: 0 0 10px 13px;
  border-bottom: 1px solid #cbd5e1;
  border-left: 5px solid #334155;
  font-size: 1.08rem;
  font-weight: 800;
}

.cleaning-product-list {
  gap: 10px;
}

.cleaning-product-row {
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid #d7e0e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.cleaning-product-info strong {
  display: block;
  font-size: .98rem;
  line-height: 1.3;
}

.cleaning-product-description {
  margin-top: 5px;
  font-size: .86rem;
  line-height: 1.35;
  color: #64748b;
}

.cleaning-quantity-wrap {
  padding: 8px 10px;
  border-radius: 9px;
  background: #f1f5f9;
}

.cleaning-quantity-wrap span {
  font-size: .76rem;
  color: #475569;
}

.cleaning-quantity-wrap input {
  background: #ffffff;
  font-weight: 700;
}

.cleaning-section-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}


/* tryb ciemny */

@media (prefers-color-scheme: dark) {

  .cleaning-category {
    background: #0b1220;
    border-color: #334155;
  }

  .cleaning-category > h3 {
    border-bottom-color: #334155;
    border-left-color: #94a3b8;
  }

  .cleaning-product-row {
    background: #111827;
    border-color: #334155;
    box-shadow: none;
  }

  .cleaning-product-description {
    color: #94a3b8;
  }

  .cleaning-quantity-wrap {
    background: #1e293b;
  }

  .cleaning-quantity-wrap span {
    color: #cbd5e1;
  }

  .cleaning-quantity-wrap input {
    background: #0f172a;
  }

  .cleaning-section-heading {
    border-bottom-color: #334155;
  }
}


/* ==========================================================
   ŚRODKI CZYSTOŚCI — czytelniejsze nagłówki grup
   ========================================================== */

.cleaning-category > h3 {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 9px;
  background: #e8eef4;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

@media (prefers-color-scheme: dark) {
  .cleaning-category > h3 {
    border: 0;
    background: #1e293b;
    color: #f1f5f9;
  }
}


/* ==========================================================
   ŚRODKI CZYSTOŚCI — rozmiary rękawic
   ========================================================== */

.cleaning-product-controls {
  display: grid;
  grid-template-columns: repeat(
    2,
    minmax(110px, 1fr)
  );
  gap: 10px;
  align-items: end;
}

.cleaning-product-controls
.cleaning-quantity-wrap:only-child {
  grid-column: 2;
}

.cleaning-size-wrap {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f1f5f9;
}

.cleaning-size-wrap span {
  font-size: .76rem;
  font-weight: 700;
  color: #475569;
}

.cleaning-size-wrap select {
  width: 100%;
  background: #ffffff;
  font-weight: 700;
}

@media (max-width: 560px) {

  .cleaning-product-controls {
    grid-template-columns: 1fr 1fr;
  }

  .cleaning-product-controls
  .cleaning-quantity-wrap:only-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-color-scheme: dark) {

  .cleaning-size-wrap {
    background: #1e293b;
  }

  .cleaning-size-wrap span {
    color: #cbd5e1;
  }

  .cleaning-size-wrap select {
    background: #0f172a;
  }
}


/* ==========================================================
   ŚRODKI CZYSTOŚCI — rozmiary rękawic
   ========================================================== */

.cleaning-product-row.has-sizes {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(360px, 430px);
}

.cleaning-sizes-wrap {
  padding: 8px 10px;
  border-radius: 9px;
  background: #f1f5f9;
}

.cleaning-sizes-label {
  margin-bottom: 6px;
  font-size: .76rem;
  font-weight: 700;
  color: #475569;
}

.cleaning-sizes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.cleaning-size-option {
  display: grid;
  gap: 4px;
  margin: 0;
}

.cleaning-size-option span {
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
}

.cleaning-size-option input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-weight: 700;
  background: #ffffff;
}

@media (max-width: 800px) {
  .cleaning-product-row.has-sizes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cleaning-sizes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-color-scheme: dark) {
  .cleaning-sizes-wrap {
    background: #1e293b;
  }

  .cleaning-sizes-label {
    color: #cbd5e1;
  }

  .cleaning-size-option input {
    background: #0f172a;
  }
}


/* ==========================================================
   ŚRODKI CZYSTOŚCI — rozmiar rękawic + ilość
   ========================================================== */

.cleaning-product-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(115px, 140px);
  justify-content: end;
  align-items: end;
  gap: 10px;
}

.cleaning-size-wrap {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f1f5f9;
}

.cleaning-size-wrap span {
  font-size: .76rem;
  font-weight: 700;
  color: #475569;
}

.cleaning-size-wrap select {
  width: 100%;
  min-width: 105px;
  background: #ffffff;
  font-weight: 700;
}

.cleaning-product-controls .cleaning-quantity-wrap {
  min-width: 125px;
}

@media (max-width: 700px) {
  .cleaning-product-controls {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .cleaning-size-wrap,
  .cleaning-product-controls .cleaning-quantity-wrap {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .cleaning-product-controls {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  .cleaning-size-wrap {
    background: #1e293b;
  }

  .cleaning-size-wrap span {
    color: #cbd5e1;
  }

  .cleaning-size-wrap select {
    background: #0f172a;
  }
}

/* ŚRODKI CZYSTOŚCI — korekta pola Ilość */
@media (min-width: 701px) {
  .cleaning-product-controls
  .cleaning-quantity-wrap:only-child {
    transform: translateX(-18px);
  }
}

/* === WSPÓLNE KARTY TREŚCI MODUŁÓW === */
.module-content-card {
  padding: 18px;
}

@media (max-width: 700px) {
  .module-content-card {
    padding: 14px;
  }
}

/* === Nadchodzące imprezy === */
#upcomingEventsPanel .lg-table {
  table-layout: fixed;
}

#upcomingEventsPanel .lg-table th,
#upcomingEventsPanel .lg-table td {
  vertical-align: top;
}

#upcomingEventsPanel .lg-table th:nth-child(1),
#upcomingEventsPanel .lg-table td:nth-child(1) {
  width: 13%;
}

#upcomingEventsPanel .lg-table th:nth-child(2),
#upcomingEventsPanel .lg-table td:nth-child(2) {
  width: 10%;
}

#upcomingEventsPanel .lg-table th:nth-child(3),
#upcomingEventsPanel .lg-table td:nth-child(3) {
  width: 26%;
}

#upcomingEventsPanel .lg-table th:nth-child(4),
#upcomingEventsPanel .lg-table td:nth-child(4) {
  width: 18%;
}

#upcomingEventsPanel .lg-table th:nth-child(5),
#upcomingEventsPanel .lg-table td:nth-child(5) {
  width: 33%;
}

#upcomingEventsPanel .lg-table td:nth-child(5) {
  white-space: pre-line;
  line-height: 1.4;
}

#upcomingEventsPanel .lg-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* === Imprezy i transport: odstępy wewnątrz kart === */

#upcomingEventsPanel .lg-head,
#logisticsEventsPanel .lg-head,
#logisticsReportPanel .lg-head,
#logisticsAssetsPanel > .card > .lg-head {
  padding: 16px 18px 12px;
}

#upcomingEventsPanel > div[style*="overflow:auto"],
#logisticsEventsPanel > div[style*="overflow:auto"],
#logisticsAssetsPanel > .card > div[style*="overflow:auto"] {
  padding: 0 18px 16px;
}

#logisticsAssetsPanel > .card > #locations {
  padding: 0 18px 16px;
}

#logisticsAssetsPanel > .card > .lg-resource-details {
  margin: 0 18px 16px;
}

/* === Nadchodzące imprezy: 6 kolumn === */

#upcomingEventsPanel .lg-table th:nth-child(1),
#upcomingEventsPanel .lg-table td:nth-child(1) {
  width: 13%;
}

#upcomingEventsPanel .lg-table th:nth-child(2),
#upcomingEventsPanel .lg-table td:nth-child(2) {
  width: 13%;
}

#upcomingEventsPanel .lg-table th:nth-child(3),
#upcomingEventsPanel .lg-table td:nth-child(3) {
  width: 12%;
}

#upcomingEventsPanel .lg-table th:nth-child(4),
#upcomingEventsPanel .lg-table td:nth-child(4) {
  width: 22%;
}

#upcomingEventsPanel .lg-table th:nth-child(5),
#upcomingEventsPanel .lg-table td:nth-child(5) {
  width: 16%;
}

#upcomingEventsPanel .lg-table th:nth-child(6),
#upcomingEventsPanel .lg-table td:nth-child(6) {
  width: 24%;
}

#upcomingEventsPanel .lg-table td:nth-child(6) {
  white-space: pre-line;
  line-height: 1.4;
}

.event-venue-collision-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  line-height: 1.45;
}

.event-venue-collision-warning strong {
  color: #b91c1c;
}

.event-venue-collision-warning > div {
  margin-top: 4px;
}

/* === Formularz imprezy: jednolite nagłówki sekcji === */

.event-items-head,
.event-items-section .event-items-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.event-items-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.event-items-head strong {
  display: block;
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
}

.event-items-description {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.45;
}

.event-items-head > button {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 9px 14px;
  margin: 0;
}

/* Sekcja obiektów w formularzu imprezy */

#eventVenues {
  margin-top: 0;
}

#eventVenues
  + * {
  margin-top: 0;
}

