.service-page { background: #f3f6f8; }
.portal-wrap { max-width: 1160px; width: calc(100% - 64px); margin: auto; }
.portal-heading { padding: 52px 0 25px; max-width: 820px; }
.portal-heading h1 { font-size: 40px; line-height: 1.2; margin-bottom: 20px; }
.portal-heading p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.header-links { display: flex; gap: 22px; align-items: center; }
.demo-notice { padding: 16px 20px; border: 1px solid #ddc69f; background: #fff8e9; color: #624813; border-radius: 5px; font-size: 14px; margin-bottom: 30px; }
.demo-notice a { text-decoration: underline; }
.portal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 35px; padding-bottom: 45px; }
.back-link { font-size: 14px; font-weight: 600; }
.steps { list-style: none; display: flex; padding: 0; margin: 0 0 18px; gap: 12px; }
.steps li { flex: 1; padding: 14px 8px; border-bottom: 3px solid #ccd6dd; font-size: 14px; font-weight: 600; color: #5c6b74; }
.steps [aria-current] { border-color: #bd202b; color: #a41b26; }
.form-step, .success-panel { background: white; border: 1px solid #dde5eb; border-radius: 6px; padding: 30px; }
.form-step h2, .success-panel h2 { font-size: 26px; }
.field-help { color: var(--muted); font-size: 14px; line-height: 1.7; }
label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 22px; }
.fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.required { color: #ad1723; }
.optional { font-size: 12px; color: #6b7780; font-weight: 400; margin-left: 5px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
  display: block; width: 100%; font: inherit; font-weight: 400; color: #172832;
  border: 1px solid #aebfc9; border-radius: 4px; background: white;
  padding: 12px 13px; min-height: 48px; margin-top: 8px;
}
input[type=file] { display: block; width: 100%; margin-top: 8px; font-size: 14px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #bd202b44; border-color: #a41b26; }
textarea { resize: vertical; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.step-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.quiet { background: #eaf0f4; color: #253b48; }
.category-options { border: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 25px; }
.category-options legend { margin-bottom: 15px; }
.category-options label { margin: 0; position: relative; }
.category-options input { position: absolute; left: 14px; top: 18px; accent-color: #bd202b; }
.category-options span { display: block; padding: 16px 14px 16px 40px; border: 1px solid #c7d2da; border-radius: 5px; background: #fafcfd; }
.category-options input:checked + span { border-color: #bd202b; background: #fff4f4; }
.category-options input:focus-visible + span { outline: 3px solid #bd202b55; }
.check-label { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; }
.check-label input { margin-top: 5px; accent-color: #bd202b; }
.check-label a { text-decoration: underline; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.service-aside { background: #e8eff3; border-radius: 5px; padding: 26px; align-self: start; margin-top: 70px; }
.service-aside h2 { font-size: 21px; }
.service-aside h3 { font-size: 17px; }
.service-aside p { font-size: 14px; color: #4a5c68; }
.aside-phone { font-size: 23px; font-weight: 750; white-space: nowrap; }
.aside-divider { border-top: 1px solid #c6d3dc; margin: 25px 0; }
.message { padding: 16px; margin: 0 0 20px; border-radius: 4px; font-size: 14px; }
.error { background: #fff0f0; border: 1px solid #e6a7ab; color: #8f1721; }
.submission-summary { background: #f2f6f8; padding: 18px; border-radius: 4px; margin-bottom: 22px; white-space: pre-line; font-size: 14px; }
.privacy-info { margin-top: 25px; font-size: 13px; color: #52616b; }
.privacy-info summary { cursor: pointer; }
.privacy-info p { padding-top: 12px; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.success-panel strong { display: block; font-size: 25px; overflow-wrap: anywhere; margin-bottom: 25px; }
.success-panel .button { margin-top: 15px; }
.helped-panel { border-left: 5px solid #286034; }
[hidden] { display: none !important; }

/* Pierwsza Zapora (Self-Help Barrier on serwis.html) */
.barrier-box {
  background: #f8fbff;
  border: 2px solid #1d4ed8;
  border-radius: 8px;
  padding: 24px;
  margin: 6px 0 26px;
}
.barrier-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.barrier-header h3 { font-size: 20px; margin: 0 0 6px; color: #102637; }
.barrier-meta { font-size: 13px; color: #475569; margin: 0 0 12px; font-weight: 600; }
.barrier-intro { font-size: 14px; color: #334155; margin: 0 0 14px; }
.barrier-steps {
  margin: 0 0 18px;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}
.barrier-steps li {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
}
.barrier-diagram {
  margin: 16px 0;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.barrier-diagram img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.barrier-diagram figcaption {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}
.barrier-decision {
  border-top: 1px solid #cbd5e1;
  padding-top: 16px;
  margin-top: 16px;
}
.barrier-question {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
  color: #0f172a;
}
.barrier-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.barrier-passed-banner {
  background: #e4f2e6;
  border: 1px solid #96cba0;
  color: #1f5129;
  padding: 12px 16px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Panel serwisanta i administratora (admin.html) */
.admin-wrap { max-width: 1380px; }
.login-panel { max-width: 480px; margin: 45px auto 85px; background: white; padding: 32px; border: 1px solid #dce4ea; border-radius: 6px; }
.login-panel h1 { font-size: 28px; margin-bottom: 10px; }
.demo-credentials { margin-top: 22px; padding-top: 16px; border-top: 1px solid #e2e8f0; font-size: 13px; }
.demo-credentials summary { cursor: pointer; font-weight: 600; color: #334155; }
.demo-cred-list { display: grid; gap: 8px; margin-top: 12px; }
.cred-chip {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 13px;
  color: #1e293b;
}
.cred-chip:hover { border-color: #102637; background: #eff6ff; }

.admin-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-top: 32px; }
.admin-top h1 { font-size: 32px; margin: 4px 0; }
.admin-top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-note { font-size: 14px; color: #546975; margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.stat-card {
  background: white;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  padding: 16px 20px;
}
.stat-card.highlight {
  background: #f0fdf4;
  border-color: #86efac;
}
.stat-label { display: block; font-size: 12px; color: #526571; font-weight: 600; }
.stat-value { display: block; font-size: 28px; color: #102637; margin-top: 4px; }

.panel-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #d5e0e7;
  margin: 24px 0;
  flex-wrap: wrap;
}
.panel-tab {
  padding: 13px 22px;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #4b5e6b;
  border-radius: 6px 6px 0 0;
}
.panel-tab.active {
  background: white;
  border-color: #d5e0e7;
  color: #bd202b;
}

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.section-bar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-search {
  width: 320px !important;
  margin-top: 0 !important;
  min-height: 44px !important;
}

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-toolbar button {
  padding: 10px 16px;
  border: 1px solid #c4d0d9;
  background: white;
  border-radius: 4px;
  color: #213744;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.admin-toolbar button.active {
  background: #172832;
  color: white;
  border-color: #172832;
}

/* Karty Obiektów */
.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 45px;
}
.building-card {
  background: white;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.building-card.is-assigned {
  border-left: 5px solid #195b86;
}
.bcard-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.building-card h3 { font-size: 22px; margin: 2px 0 0; }
.bcard-sub { font-size: 14px; color: #546975; margin: 0; }
.bcard-devices { display: flex; flex-wrap: wrap; gap: 6px; }
.dev-chip {
  background: #eef3f7;
  border: 1px solid #cbd7e0;
  color: #1e3342;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.clickable-chip:hover { background: #dbeafe; border-color: #2563eb; }
.bcard-meta {
  font-size: 13px;
  color: #495d69;
  border-top: 1px solid #e6edf2;
  padding-top: 12px;
  display: grid;
  gap: 4px;
}
.bcard-actions { margin-top: auto; padding-top: 8px; }

/* Karta szczegółowa obiektu i lokalu */
.detail-back-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-back-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.building-hero-card {
  background: white;
  border: 1px solid #d5e0e7;
  border-radius: 8px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  margin-bottom: 22px;
}
.building-hero-main h2 { font-size: 30px; margin: 10px 0 4px; }
.bdetail-subtitle { font-size: 16px; color: #4d626f; margin: 0 0 18px; }
.bdetail-meta-grid { display: grid; gap: 14px; }
.meta-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .05em; color: #60737f; }
.bdetail-meta-grid p { margin: 4px 0 0; font-size: 14px; font-weight: 600; }

.building-access-box {
  background: #f5f8fa;
  border: 1px solid #d5e0e7;
  border-radius: 6px;
  padding: 18px 20px;
}
.building-access-box h3 { font-size: 14px; margin: 0 0 6px; color: #102637; }
.building-access-box p { font-size: 13.5px; color: #334155; margin: 0; white-space: pre-line; }
.mt-small { margin-top: 14px !important; }

/* Pasek wyboru lokali */
.units-strip-card {
  background: white;
  border: 1px solid #d5e0e7;
  border-radius: 8px;
  padding: 22px 26px;
  margin-bottom: 22px;
}
.units-strip-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.units-strip-top h3 { font-size: 20px; margin: 0 0 4px; }
.units-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-pill {
  padding: 9px 15px;
  border-radius: 20px;
  border: 1px solid #bdcad4;
  background: #f8fafc;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.unit-pill.active {
  background: #bd202b;
  border-color: #bd202b;
  color: white;
}
.selected-unit-info {
  margin-top: 16px;
  padding: 16px 18px;
  background: #fff9f9;
  border: 1px solid #f2c6c9;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.unit-notes-text { margin: 8px 0 0; font-size: 14px; color: #1e293b; white-space: pre-line; }

.building-sub-block {
  background: white;
  border: 1px solid #d5e0e7;
  border-radius: 8px;
  padding: 24px 26px;
  margin-bottom: 24px;
}
.sub-block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.sub-block-header h3, .sub-block-header h2 { font-size: 21px; margin: 0 0 4px; }

/* Urządzenia i Instrukcje */
.devices-list { display: grid; gap: 18px; }
.device-card {
  border: 1px solid #d5e0e7;
  border-radius: 6px;
  padding: 20px;
  background: #fcfdfe;
}
.device-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.device-card-top h4 { font-size: 18px; margin: 8px 0 4px; }
.device-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.device-instructions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.inst-box {
  padding: 16px;
  border-radius: 6px;
  font-size: 13.5px;
}
.client-inst-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}
.tech-inst-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}
.inst-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #475569;
  margin-bottom: 6px;
}
.inst-steps-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.pre-line { white-space: pre-line; line-height: 1.55; }

/* Plany i zdjęcia */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.attachment-card {
  border: 1px solid #d5e0e7;
  border-radius: 6px;
  overflow: hidden;
  background: white;
  display: flex;
  flex-direction: column;
}
.attachment-thumb {
  width: 100%;
  height: 185px;
  object-fit: contain;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}
.attachment-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.attachment-body h4 { font-size: 16px; margin: 2px 0; }
.attachment-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }

/* Historia napraw */
.repairs-timeline { display: grid; gap: 16px; }
.repair-card {
  border: 1px solid #d5e0e7;
  border-radius: 6px;
  padding: 18px 20px;
  background: #fcfdfe;
}
.repair-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e6edf2;
  margin-bottom: 14px;
}
.repair-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.repair-desc-box {
  background: #f1f5f9;
  padding: 12px;
  border-radius: 5px;
  font-size: 13.5px;
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.repair-summary-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #064e3b;
  padding: 12px;
  border-radius: 5px;
  font-size: 13.5px;
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.repair-summary-empty {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 12px;
  border-radius: 5px;
  font-size: 13px;
  margin: 8px 0 0;
}
.repair-mini-history { margin-top: 10px; display: grid; gap: 4px; }

/* Tabela zgłoszeń i serwisanci */
.admin-search { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; max-width: 650px; }
.admin-search input { margin-top: 0 !important; }
.tickets-table { width: 100%; border-collapse: collapse; background: white; text-align: left; }
.tickets-table th { font-size: 12px; color: #596c78; padding: 16px; border-bottom: 1px solid #d8e2e8; }
.tickets-table td { padding: 18px 16px; border-bottom: 1px solid #e2e8ed; font-size: 14px; vertical-align: top; }
.ticket-open, .link-inline {
  border: 0; background: transparent; color: #9e1520; text-align: left;
  text-decoration: underline; font: inherit; font-weight: 700; padding: 0;
}
.link-inline { font-size: 12px; margin-top: 4px; display: inline-block; }
.text-success { color: #166534 !important; font-weight: 600; }
.small { font-size: 12px; color: #627681; }
.table-wrap { overflow-x: auto; border: 1px solid #dce4e9; border-radius: 6px; }
.badge {
  display: inline-block; padding: 4px 9px; border-radius: 4px;
  font-size: 12px; font-weight: 650; background: #e7eef3; color: #324b5b; white-space: nowrap;
}
.badge.new { background: #fff0d4; color: #755315; }
.badge.progress { background: #e0efff; color: #195b86; }
.badge.resolved { background: #e4f2e6; color: #286034; }
.badge.closed { background: #ebedf0; color: #5a626d; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 22px 0 40px; font-size: 13px; }

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 45px;
}
.user-card {
  background: white;
  border: 1px solid #d5e0e7;
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-card h3 { font-size: 20px; margin: 0; }

/* Modale */
.detail-modal {
  border: 0; border-radius: 8px;
  width: min(820px, calc(100% - 30px));
  max-height: 90vh; padding: 28px;
  box-shadow: 0 15px 80px #0004;
}
.preview-modal { width: min(1020px, calc(100% - 30px)); }
.preview-stage { text-align: center; background: #f1f5f9; padding: 16px; border-radius: 6px; margin-top: 12px; }
.preview-full-image { max-width: 100%; max-height: 72vh; height: auto; }
.detail-modal::backdrop { background: #172832a6; }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 14px; }
.modal-top h2 { font-size: 22px; margin: 0; }
.modal-top button { padding: 8px 14px; background: #edf1f4; border: 0; border-radius: 4px; font-weight: 600; }
.detail-building-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 12px 16px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
}
.ticket-data { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.ticket-data dt { font-size: 12px; color: #60737f; }
.ticket-data dd { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-description { padding: 16px; background: #eff4f7; border-radius: 5px; white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere; margin-bottom: 20px; }
.ticket-history { list-style: none; padding: 0; }
.ticket-history li { border-top: 1px solid #dbe4e9; padding: 14px 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.checkbox-group { border: 1px solid #cbd5e1; border-radius: 6px; padding: 14px 16px; margin-bottom: 20px; }
.checkbox-group legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-grid .check-label { margin-bottom: 0; }
.mail-warning { padding: 15px 20px; background: #fff6df; font-size: 14px; border-radius: 4px; margin: 20px 0; }
.empty-state, .empty-card { padding: 34px !important; text-align: center; color: #637783; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; }

@media (max-width: 960px) {
  .portal-layout, .building-hero-card, .device-instructions-grid, .repair-card-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .service-aside { margin-top: 0; }
  .portal-wrap { width: calc(100% - 36px); }
}

@media (max-width: 600px) {
  .portal-heading { padding-top: 32px; }
  .portal-heading h1 { font-size: 30px; }
  .form-step, .success-panel, .building-sub-block, .building-hero-card, .units-strip-card { padding: 18px; }
  .fields.two, .category-options, .stats-grid, .checkbox-grid, .buildings-grid, .ticket-data { grid-template-columns: 1fr; }
  .inline-search { width: 100% !important; }
  .step-actions { justify-content: space-between; }
  .portal-footer { flex-direction: column; }
}
