/* Portal klienta — rozszerzenia do style.css (kancelaria: cream + navy + gold + serif)
   Style.css z ai-rekomendator dał już bazę (header, brand, form inputs, card).
   Tu dopisujemy specyficzne komponenty portalu: client-header, tabs, statuses-grid,
   deadlines, tasks, data-table, upload-zone, documents-list, contact-grid.
*/

/* ===== SHELL — szerszy wariant dla dashboardu ===== */
.shell-wide {
  max-width: 1080px;
}

/* ===== DASHBOARD LAYOUT (sidebar + main) ===== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* Ukryj site-header i site-footer gdy dashboard widoczny */
body:has(#view-dashboard:not([hidden])) #site-header-login,
body:has(#view-dashboard:not([hidden])) #site-footer-login {
  display: none;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  border-right: 2px solid var(--gold);
}

.sidebar-brand {
  padding: 0 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-logo-sidebar {
  width: 148px;
  height: auto;
}
.sidebar-tag {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 500;
  padding-top: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.1px;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}
.sidebar-link.active {
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 600;
}
.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 14px 22px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 14px;
}
.sidebar-user {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin: 0 0 8px;
  word-break: break-all;
  line-height: 1.4;
}
.sidebar-logout {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-logout:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ===== MAIN CONTENT ===== */
.dashboard-main {
  flex: 1;
  padding: 32px 40px 48px;
  max-width: calc(100% - 240px);
  overflow-x: auto;
}

/* ===== STAFF REVIEWER: klientowski podgląd tylko do odczytu ===== */
.staff-review-banner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(165, 123, 39, 0.45);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--navy);
}
.staff-review-banner[hidden] { display: none; }
.staff-review-banner strong { white-space: nowrap; }

body.staff-review-readonly #upload-zone,
body.staff-review-readonly #staff-payslip-import-panel,
body.staff-review-readonly #mileage-form,
body.staff-review-readonly #delegations-form,
body.staff-review-readonly #referrals-form,
body.staff-review-readonly #mileage-import-btn,
body.staff-review-readonly #delegations-import-btn,
body.staff-review-readonly .approve-document-btn,
body.staff-review-readonly .reject-document-btn,
body.staff-review-readonly .reopen-document-btn,
body.staff-review-readonly .delete-document-btn,
body.staff-review-readonly .edit-mileage-btn,
body.staff-review-readonly .delete-mileage-btn,
body.staff-review-readonly .edit-delegation-btn,
body.staff-review-readonly .delete-delegation-btn,
body.staff-review-readonly .delete-referral-btn,
body.staff-review-readonly .mark-read-btn {
  display: none !important;
}

@media (max-width: 680px) {
  .staff-review-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* Fallback: ukryj site-header i site-footer jeśli :has nie działa */
.dashboard-layout ~ .site-header,
.dashboard-layout ~ .site-footer { display: none; }

/* Na mobile: sidebar zwija się do topbar */
@media (max-width: 860px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: static;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 2px solid var(--gold);
  }
  .sidebar-brand { padding: 0 16px 12px; }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 0 10px;
  }
  .sidebar-link { padding: 8px 12px; white-space: nowrap; font-size: 13px; }
  .sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
  }
  .sidebar-user { margin: 0; }
  .dashboard-main {
    padding: 20px 16px 32px;
    max-width: 100%;
  }
}

/* ===== FORM UTILS (login) ===== */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.code-input {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 22px;
  letter-spacing: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--navy);
}
.form-hint {
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 0 0 16px;
  line-height: 1.55;
}
.form-hint strong { color: var(--navy); }
.delegation-preview {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.delegation-preview strong {
  color: var(--navy);
}
.delegation-preview span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
}
.delegation-preview.muted {
  color: var(--text-soft);
}
.delegation-preview.error {
  border-color: #ECBABA;
  background: var(--error-bg);
  color: var(--error);
}
.form-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--error-bg);
  border: 1px solid #ECBABA;
  color: var(--error);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.5;
}
.primary-btn {
  width: 100%;
  background: var(--navy);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: background 0.15s;
  margin-top: 4px;
}
.primary-btn:hover { background: var(--navy-dark); }
.primary-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
.secondary-btn {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.secondary-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}
.compact-btn {
  width: auto;
  min-width: 140px;
  align-self: end;
  margin-top: 0;
}
.login-footer-note {
  margin: 28px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 460px;
}

/* ===== CLIENT HEADER ===== */
.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.client-header h1 {
  font-family: "Spectral", ui-serif, Georgia, serif;
  color: var(--navy);
  font-size: 28px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.client-meta {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}
.client-contact {
  text-align: right;
  display: grid;
  gap: 10px;
  justify-items: end;
}
.client-contact .contact-detail {
  margin: 0;
  text-align: right;
  max-width: min(320px, 72vw);
}
.contact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
}
.contact-value {
  font-size: 15px;
  color: var(--navy);
  margin: 0;
  font-weight: 500;
}
.contact-detail {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.contact-detail a {
  color: var(--gold-dark);
  font-weight: 500;
}
.company-switcher-wrap {
  display: grid;
  gap: 5px;
  justify-items: end;
}
.company-switcher-trigger {
  width: min(320px, 72vw);
  min-height: 54px;
  display: grid;
  gap: 4px;
  align-items: start;
  justify-items: start;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  padding: 10px 14px 11px;
  text-align: left;
  box-shadow: 0 6px 16px rgba(45, 45, 79, 0.05);
  cursor: pointer;
}
.company-switcher-trigger:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(45, 45, 79, 0.08);
}
.company-switcher-trigger:focus {
  outline: 2px solid rgba(184, 145, 61, 0.28);
  border-color: var(--gold);
}
.company-switcher-trigger-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}
.company-switcher-trigger-meta {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  word-break: break-word;
}
.company-switcher-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  max-width: min(320px, 72vw);
  text-align: right;
}
.company-switcher-modal {
  width: min(980px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(22, 22, 42, 0.24);
  overflow: hidden;
}
.company-switcher-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.company-switcher-modal-head h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 19px;
  font-weight: 600;
}
.company-switcher-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
  overflow: auto;
}
.company-switcher-search-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 600;
}
.company-switcher-search {
  width: 100%;
  max-width: 520px;
  height: 44px;
}
.company-switcher-sections {
  display: grid;
  gap: 18px;
}
.company-switcher-section {
  display: grid;
  gap: 10px;
}
.company-switcher-section-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--navy);
}
.company-switcher-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.company-switcher-list {
  display: grid;
  gap: 10px;
}
.company-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.company-switcher-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.company-switcher-item-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  word-break: break-word;
}
.company-switcher-item-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.company-switcher-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.company-switcher-item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.company-switcher-pin {
  min-width: 40px;
  padding: 0 10px;
}
.company-switcher-empty {
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.company-switcher-selected {
  border-color: rgba(184, 145, 61, 0.45);
  box-shadow: 0 8px 18px rgba(184, 145, 61, 0.08);
}
.company-switcher-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3e9d0;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-left: 8px;
}
.company-switcher-badge.recent {
  background: #e8f0fb;
  color: #3768a3;
}
.company-switcher-badge.pinned {
  background: #f4e7c6;
  color: #8c6820;
}
.company-switcher-badge.match {
  background: #edf7eb;
  color: #2f7d32;
}
.company-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.company-switcher-pill.is-pinned {
  color: var(--gold-dark);
  border-color: rgba(184, 145, 61, 0.35);
}
.company-switcher-list .secondary-btn {
  min-height: 38px;
}
.company-switcher-item button {
  white-space: nowrap;
}
.company-switcher-empty.inline {
  margin: 0;
}
.company-switcher-modal .compact-btn {
  white-space: nowrap;
}
.company-switcher-item .secondary-btn {
  min-width: auto;
}
.company-switcher-item .ghost-btn {
  min-width: auto;
}

/* ===== ALERTS ===== */
.portal-alerts {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
}
.portal-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #d6b754;
  border-left: 8px solid var(--gold);
  border-radius: var(--radius);
  background: #fff6d8;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(45, 45, 79, 0.08);
}
.portal-alert strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 4px;
}
.portal-alert span {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
.portal-alert a {
  flex-shrink: 0;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.portal-alert-warning {
  border-left-color: #c46f36;
  background: #fff7ef;
}
.portal-alert-error {
  border-left-color: var(--error);
  background: var(--error-bg);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  background: transparent;
  border: 0;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover {
  color: var(--navy);
}
.tab-btn.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.tab-panel h2 {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 20px;
  color: var(--navy);
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.tab-panel h3 {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 16px;
  color: var(--navy);
  margin: 0 0 12px;
  font-weight: 600;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.section-subtitle {
  margin: -8px 0 16px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 760px;
}
.inline-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}
.inline-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.inline-form .wide {
  grid-column: span 2;
}
.inline-form .form-input {
  margin-bottom: 0;
}
.mileage-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}
.mileage-form .mileage-date {
  grid-column: span 1;
}
.mileage-route-block {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  gap: 10px 12px;
  align-items: end;
}
.mileage-route-title {
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: 2px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.mileage-actions {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.mileage-actions .compact-btn {
  width: 100%;
}
.form-status {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid #bfe0c8;
  background: #e7f4ea;
  color: #2b7a3d;
  font-size: 13.5px;
}
.form-status.error {
  border-color: #ECBABA;
  background: var(--error-bg);
  color: var(--error);
}

/* ===== KPI CARDS (Przegląd) ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--sh-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover {
  border-color: var(--gold-line);
  box-shadow: var(--sh-md);
  transform: translateY(-3px);
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  flex-shrink: 0;
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon-revenue { background: rgba(61, 145, 91, 0.12); color: #3d915b; }
.kpi-icon-costs { background: rgba(226, 138, 71, 0.12); color: #c46f36; }
.kpi-icon-profit { background: var(--gold-soft); color: var(--gold-dark); }
.kpi-icon-margin { background: rgba(91, 125, 188, 0.12); color: #5b7dbc; }
.kpi-value {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.kpi-trend {
  margin: 6px 0 0;
  font-size: 12px;
  color: #3d915b;
  font-weight: 500;
}
.kpi-trend.negative { color: var(--error); }

.financial-year-status {
  margin-bottom: 18px;
}
.financial-year-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 12px;
}
.financial-year-status-kicker {
  margin: 0 0 4px;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 10.5px;
  font-weight: 700;
}
.financial-year-status-head h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
}
.financial-year-status-note {
  margin: 0;
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.financial-year-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.financial-year-status-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  padding: 18px 18px 16px;
}
.financial-year-status-card.current {
  background: linear-gradient(180deg, #fbf8ef 0%, #fff 100%);
  border-color: rgba(191, 157, 86, 0.38);
}
.financial-year-status-card.previous {
  background: #fff;
}
.financial-year-status-card.due {
  background: #fbfcfe;
}
.financial-year-status-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.financial-year-status-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.financial-year-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.financial-year-status-badge.muted {
  background: rgba(21, 37, 67, 0.06);
  color: var(--muted);
}
.financial-year-status-badge.warning {
  background: rgba(228, 103, 88, 0.12);
  color: var(--error);
}
.financial-year-status-title {
  margin: 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.5px;
}
.financial-year-status-period {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.financial-year-status-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.company-readiness {
  display: grid;
  gap: 10px;
  margin: 18px 0 6px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 242, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--sh-sm);
}
.company-readiness-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.company-readiness-head h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.company-readiness-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}
.data-readiness-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Świeżość danych — drobna stopka na dole overview, nie duże kafle (decyzja KG 2026-07-14) */
.data-freshness-note {
  margin: 28px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.data-freshness-note-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Placeholder dla modułów bez danych lub z wyłączonym API. */
.module-placeholder {
  padding: 30px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-sm);
}
.module-placeholder-title {
  margin: 0 0 6px;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}
.module-placeholder-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.feature-notice,
.financials-notice {
  margin-bottom: 20px;
}
.feature-inline-notice {
  margin: -4px 0 18px;
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
}
.feature-unavailable {
  opacity: 0.62;
  cursor: not-allowed;
}
.feature-unavailable button,
.feature-unavailable input,
.feature-unavailable select {
  cursor: not-allowed;
}

.staff-ops-hero {
  margin: 0 0 16px;
  padding: 0 4px;
}
.staff-ops-hero h1 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.staff-ops-hero .lead {
  max-width: 720px;
  margin: 0;
}

.staff-ops-panel {
  margin: 18px 0 6px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--sh-sm);
}
.staff-ops-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.staff-ops-head h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.staff-ops-note {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}
.staff-ops-controls {
  display: grid;
  gap: 6px;
  min-width: min(100%, 340px);
}
.staff-ops-search-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}
.staff-ops-search {
  width: 100%;
}
.staff-ops-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}
.staff-ops-table-wrap {
  overflow: auto;
}
.staff-ops-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.staff-ops-table th,
.staff-ops-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(21, 37, 67, 0.08);
  font-size: 13px;
}
.staff-ops-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 700;
}
.staff-ops-row:hover {
  background: rgba(244, 240, 227, 0.45);
}
.staff-ops-company {
  display: grid;
  gap: 3px;
}
.staff-ops-company strong {
  color: var(--navy);
  font-size: 14px;
}
.staff-ops-company span {
  color: var(--muted);
  font-size: 12px;
}
.staff-ops-last-sync {
  display: grid;
  gap: 3px;
}
.staff-ops-last-sync strong {
  color: var(--navy);
  font-size: 13px;
}
.staff-ops-last-sync span {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.financial-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: -8px 0 24px;
}
.financial-year-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
}
.financial-year-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.financial-year-eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.financial-year-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 650;
}
.financial-year-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.financial-year-badge.muted {
  background: rgba(21, 37, 67, 0.06);
  color: var(--muted);
}
.financial-year-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.financial-year-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.financial-year-metrics dd {
  margin: 3px 0 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
}
.financial-year-metrics dd.negative {
  color: var(--error);
}

/* ===== CHART CARD ===== */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 10px;
  box-shadow: var(--sh-sm);
}
.chart-title {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--navy);
  margin: 0;
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.chart-head h2 {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 18px;
  color: var(--navy);
  font-weight: 600;
}
.chart-period {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-style: italic;
}
.chart-wrap {
  position: relative;
  height: 340px;
  width: 100%;
}

/* ===== STATUSES GRID (Przegląd) ===== */
.statuses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  /* oddech przed kolejną sekcją — kafle sklejały się z panelem zysku
     (zgłoszenie Krzysztofa 03.09, zrzut; strażnik G2b pilnuje odstępów sekcji) */
  margin-bottom: 22px;
}
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color 0.15s;
  /* Równy rząd kafli: plakietka statusu zawsze przy dolnej krawędzi
     (zgłoszenie Krzysztofa 03.09: plakietki wisiały na różnych wysokościach). */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 142px;
}
.status-card > .status-badge { margin-top: auto; }
.status-card:hover { border-color: var(--divider); }
.status-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 6px;
}
.status-value {
  font-size: 15px;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 6px;
}
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.status-badge-ok { background: #e7f4ea; color: #2b7a3d; border: 1px solid #bfe0c8; }
.status-badge-warning { background: #fdf5e3; color: #a68024; border: 1px solid #ecd7a0; }
.status-badge-error { background: var(--error-bg); color: var(--error); border: 1px solid #ECBABA; }
.status-badge-info { background: var(--surface-soft); color: var(--navy); border: 1px solid var(--border); }
.status-card-payroll {
  min-height: 142px;
}
.payroll-people-list {
  list-style: none;
  margin: 8px 0 8px;
  padding: 0;
  display: grid;
  gap: 3px;
}
.payroll-people-list li {
  color: var(--navy);
  font-size: 13px;
  line-height: 1.35;
}
.payroll-note {
  margin: 10px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--navy);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ===== DEADLINES ===== */
.deadlines-list {
  display: grid;
  gap: 10px;
}
.deadline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}
.deadline-item.soon { border-left-color: #e0a021; }
.deadline-item.overdue { border-left-color: var(--error); background: var(--error-bg); }
.deadline-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 14.5px;
}
.deadline-date {
  font-family: ui-monospace, Menlo, monospace;
  color: var(--muted);
  font-size: 13px;
}

/* ===== TASKS LIST ===== */
.tasks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.tasks-list li {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.5;
}

/* ===== DATA TABLES ===== */
.invoices-summary {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.summary-card {
  flex: 1;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.summary-card .summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 600;
}
.summary-card .summary-value {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 22px;
  color: var(--navy);
  font-weight: 600;
  margin-top: 4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13.5px;
}
.data-table thead th {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: 0.3px;
  font-family: "Spectral", ui-serif, Georgia, serif;
}
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:nth-child(even) { background: var(--surface-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 20px;
}
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.staff-import-panel {
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid #e2d6b3;
  border-radius: var(--radius-lg);
  background: #fbf8ef;
}
.staff-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.staff-import-head h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}
.staff-import-form {
  display: grid;
  gap: 14px;
}
.staff-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.staff-import-grid label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.staff-import-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.staff-import-actions .primary-btn {
  min-width: 180px;
}
.staff-import-actions .form-status {
  flex: 1;
  margin: 0;
  min-width: 260px;
}
.staff-import-batch {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(149, 124, 66, 0.18);
}
.staff-import-batch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.staff-import-batch-head h4 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
}
.staff-import-batch-rows {
  display: grid;
  gap: 10px;
}
.staff-import-batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.7fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.staff-import-batch-row label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.staff-import-row-remove {
  min-height: 42px;
  padding-inline: 14px;
}
.upload-title {
  font-size: 15px;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 4px;
}
.upload-hint {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 13.5px;
}
.upload-limits {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.upload-progress.visible { display: flex; }
.progress-bar {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.2s;
}
.link-btn {
  background: transparent;
  border: 0;
  color: var(--gold-dark);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.link-btn:hover { color: var(--navy); }
.danger-link-btn {
  color: #a33a2c !important;
}
.danger-link-btn:hover {
  color: #6f2118 !important;
}
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.row-actions .link-btn { white-space: nowrap; }

/* ===== DOCUMENTS LIST ===== */
.documents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.document-groups {
  display: grid;
  gap: 18px;
}
.document-group h4 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 15px;
}
.document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 16px;
  flex-wrap: wrap;
}
.document-main {
  flex: 1;
  min-width: 220px;
}
.document-item.unread {
  border-color: var(--gold);
  background: #fffdf8;
}
.document-name {
  font-weight: 500;
  color: var(--navy);
  font-size: 14px;
  flex: 1;
  min-width: 180px;
  word-break: break-word;
}
.document-submeta {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
  word-break: break-word;
}
.document-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}
.document-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.document-actions a,
.document-actions button {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 500;
}
.data-table .link-btn {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
}
.payslip-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.payslip-filter-btn {
  appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--navy);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.payslip-filter-btn:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.payslip-filter-btn.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(179, 141, 62, .14), var(--shadow-sm);
}
.payslip-filter-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.payslip-filter-main {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.payslip-filter-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.payslip-year-wrapper,
.payslip-month-wrapper {
  list-style: none;
}
.payslip-year-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.payslip-year-group > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}
.payslip-year-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.payslip-month-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}
.payslip-month-heading {
  margin: 12px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.payslip-documents-list {
  gap: 8px;
}
.document-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.document-status-review {
  padding: 4px 8px;
  border: 1px solid #ecd7a0;
  border-radius: 999px;
  color: #8a6c1f;
  background: #fdf5e3;
}
.upload-category-label {
  display: block;
  max-width: 280px;
  margin: 12px auto 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
}
.upload-category-label .form-input {
  margin: 6px 0 0;
  background: var(--surface);
  text-transform: none;
  letter-spacing: 0;
}

/* ===== DOCUMENT PREVIEW MODAL ===== */
body.modal-open {
  overflow: hidden;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(22, 22, 42, 0.58);
}
.document-preview-modal {
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(22, 22, 42, 0.24);
  overflow: hidden;
}
.document-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.document-preview-head h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  word-break: break-word;
}
.document-preview-body {
  min-height: 420px;
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #f3f0e8;
  overflow: auto;
}
.document-preview-frame {
  width: 100%;
  min-height: min(680px, calc(100vh - 220px));
  border: 0;
  background: #fff;
}
.document-preview-image {
  max-width: 100%;
  max-height: min(680px, calc(100vh - 220px));
  object-fit: contain;
  align-self: center;
}
.document-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.document-preview-actions .secondary-btn {
  text-decoration: none;
}

/* ===== CONTACT GRID ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.contact-support-block {
  margin-top: 22px;
}
.contact-support-block h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 650;
}
.contact-support-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.contact-card .contact-label {
  text-align: left;
}
.contact-card .contact-value {
  text-align: left;
  font-size: 15px;
  margin-top: 4px;
}
.contact-detail {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.contact-detail a {
  color: var(--gold-dark);
  font-weight: 500;
}

/* ===== TEAM GRID ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.contact-team-grid {
  margin-top: 0;
}
.team-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.team-card:hover {
  border-color: var(--gold-line);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.team-card-primary {
  border-left: 3px solid var(--gold);
}
.team-photo {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--navy);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.team-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-card-body {
  min-width: 0;
}
.team-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.team-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}
.team-role {
  margin: 5px 0 0;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
}
.team-intro {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.team-meta {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  word-break: break-word;
}
.team-meta a {
  color: var(--gold-dark);
  font-weight: 600;
}
.team-primary-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.team-footer {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 14px;
}
.team-footer p {
  margin: 0;
}
.team-footer a {
  color: var(--gold-dark);
  font-weight: 700;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.link-card-category {
  color: var(--gold);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 122px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.link-card:hover {
  border-color: var(--gold);
  text-decoration: none;
}
.link-card.disabled {
  cursor: default;
  opacity: 0.72;
}
.link-card.disabled:hover {
  border-color: var(--border);
}
.link-card strong {
  color: var(--navy);
  font-size: 16px;
}
.link-card span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}
.link-category {
  color: var(--gold-dark) !important;
  font-size: 10.5px !important;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

/* ===== EMPTY STATES ===== */
.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .client-header { flex-direction: column; align-items: flex-start; }
  .client-contact,
  .company-switcher-wrap {
    text-align: left;
    justify-items: start;
    width: 100%;
  }
  .company-switcher {
    width: 100%;
  }
  .tabs { overflow-x: auto; white-space: nowrap; }
  .data-table { font-size: 12.5px; }
  .data-table thead th, .data-table tbody td { padding: 8px 10px; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .wide { grid-column: auto; }
  .mileage-form .mileage-date,
  .mileage-route-block,
  .mileage-actions {
    grid-column: auto;
  }
  .mileage-route-block,
  .mileage-actions {
    grid-template-columns: 1fr;
  }
  .compact-btn { width: 100%; }
}

/* ===== MOBILE-FIRST DEMO POLISH ===== */
.sidebar-link.active {
  background: rgba(191, 157, 86, 0.18);
  color: #f3d47a;
}

.portal-alerts-toggle {
  display: none;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gold-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.portal-alert a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(168, 137, 64, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.upload-type-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 720px;
  margin: 14px auto 12px;
}
.upload-type-pill {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.upload-type-pill.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-dark);
  box-shadow: inset 0 0 0 1px rgba(191, 157, 86, 0.22);
}

.document-actions a,
.document-actions button,
.row-actions .link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.document-actions a:hover,
.document-actions button:hover,
.row-actions .link-btn:hover {
  border-color: var(--gold);
  text-decoration: none;
}
.document-actions .danger-link-btn,
.row-actions .danger-link-btn {
  border-color: #efc2bd;
  background: #fff7f6;
}

.mobile-bottom-nav,
.mobile-more-sheet {
  display: none;
}

@media (max-width: 860px) {
  .dashboard-layout {
    padding-bottom: 84px;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 0 0;
    box-shadow: 0 10px 24px rgba(26, 26, 46, 0.14);
  }
  .sidebar-brand {
    border-bottom: 0;
    margin-bottom: 0;
    padding: 0 14px 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand-logo-sidebar {
    width: 122px;
  }
  .sidebar-tag {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .sidebar-nav {
    display: none;
  }
  .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px 10px;
  }
  .sidebar-user {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dashboard-main {
    padding: 22px 16px 34px;
  }
  .client-header {
    margin-bottom: 18px;
    padding: 18px 0 16px;
    gap: 12px;
  }
  .client-header h1 {
    font-size: 24px;
    line-height: 1.15;
  }
  .client-meta {
    font-size: 12.5px;
    line-height: 1.45;
  }
  .eyebrow,
  .contact-label,
  .kpi-label,
  .status-label,
  .summary-card .summary-label,
  .inline-form label {
    letter-spacing: 1px;
  }
  .portal-alerts {
    gap: 8px;
    margin-bottom: 20px;
  }
  .portal-alert {
    align-items: flex-start;
    border-left-width: 5px;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(45, 45, 79, 0.06);
  }
  .portal-alert strong {
    font-size: 15px;
  }
  .portal-alert span {
    font-size: 13px;
  }
  .portal-alert a {
    width: 100%;
  }
  .portal-alert-extra {
    display: none;
  }
  .portal-alerts.expanded .portal-alert-extra {
    display: flex;
  }
  .portal-alerts-toggle {
    display: block;
  }
  .financial-year-status-grid,
  .kpi-grid,
  .statuses-grid,
  .contact-grid,
  .links-grid {
    grid-template-columns: 1fr;
  }
  .financial-year-status-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .financial-year-status-head h2 {
    font-size: 18px;
  }
  .financial-year-status-title {
    font-size: 22px;
  }
  .financial-year-status-period {
    font-size: 13px;
  }
  .kpi-card,
  .summary-card,
  .status-card,
  .contact-card,
  .link-card {
    border-radius: 8px;
  }
  .chart-card {
    padding: 16px;
  }
  .chart-wrap {
    height: 260px;
  }
  .section-head {
    gap: 10px;
  }
  .section-actions {
    width: 100%;
  }
  .section-head .secondary-btn {
    width: 100%;
  }
  .section-actions .secondary-btn {
    width: 100%;
  }
  .inline-form,
  .mileage-form {
    grid-template-columns: 1fr;
    padding: 14px;
    border-radius: 8px;
  }
  .inline-form .wide,
  .mileage-route-block,
  .mileage-actions {
    grid-column: auto;
  }
  .mileage-route-block,
  .mileage-actions {
    grid-template-columns: 1fr;
  }
  .delegation-preview {
    border-left: 4px solid var(--gold);
    border-radius: 8px;
  }
  .upload-zone {
    padding: 20px 14px;
    border-style: solid;
    text-align: left;
  }
  .staff-import-panel {
    padding: 16px;
  }
  .staff-import-head {
    flex-direction: column;
  }
  .staff-import-grid {
    grid-template-columns: 1fr;
  }
  .staff-import-batch-head {
    flex-direction: column;
  }
  .staff-import-batch-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .staff-import-row-remove {
    width: 100%;
  }
  .upload-prompt {
    display: grid;
    gap: 10px;
  }
  .upload-title,
  .upload-hint,
  .upload-limits {
    text-align: left;
    margin: 0;
  }
  .upload-category-label {
    max-width: none;
    margin: 0;
  }
  .upload-type-pills {
    grid-template-columns: 1fr;
    max-width: none;
    margin: 0;
  }
  .document-group h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    padding: 0 2px;
  }
  .document-item {
    align-items: stretch;
    border-radius: 8px;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }
  .document-main {
    min-width: 0;
  }
  .document-name {
    min-width: 0;
    margin: 0 0 6px;
  }
  .document-meta {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .document-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .document-actions a,
  .document-actions button {
    width: 100%;
  }
  .payslip-filter-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .payslip-filter-btn {
    min-height: 0;
    padding: 14px;
  }
  .payslip-filter-main {
    font-size: 24px;
  }
  .payslip-year-group > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
  }
  .payslip-year-count {
    white-space: normal;
  }
  .payslip-month-list {
    padding: 0 10px 10px;
  }
  .data-table {
    border: 0;
    background: transparent;
  }
  .data-table thead {
    display: none;
  }
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tbody {
    display: grid;
    gap: 12px;
  }
  .data-table tbody tr {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
  }
  .data-table tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 35%) 1fr;
    gap: 10px;
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 0;
  }
  .data-table tbody td:last-child {
    border-bottom: 0;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
  }
  .data-table tbody td.row-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
  }
  .data-table tbody td.row-actions::before {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }
  .row-actions .link-btn {
    width: 100%;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(229, 224, 208, 0.88);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(26, 26, 46, 0.18);
    backdrop-filter: blur(12px);
  }
  .mobile-nav-link {
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    padding: 7px 4px 6px;
    min-width: 0;
  }
  .mobile-nav-link span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
  }
  .mobile-nav-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }
  .mobile-nav-link strong {
    font-size: 10.5px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .mobile-nav-link.active {
    background: var(--navy);
    color: #fff;
  }
  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    background: rgba(26, 26, 46, 0.34);
  }
  .mobile-more-panel {
    width: 100%;
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    padding: 14px;
    box-shadow: 0 20px 60px rgba(26, 26, 46, 0.22);
  }
  .mobile-more-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    color: var(--navy);
  }
  .mobile-more-link {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--navy);
    font: inherit;
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
  }
  .mobile-more-link:focus {
    outline: 2px solid rgba(191, 157, 86, 0.35);
    outline-offset: 2px;
    background: var(--bg);
    color: var(--navy);
  }
  .mobile-more-link.active {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold-dark);
  }
}

/* ===================================================================
   WARIANT A "Private Bank refined" — hero, sec-title, staggered reveal
   (dodane 2026-05-30, Faza 2 migracji designu)
   =================================================================== */

/* HERO — Zysk netto (duża liczba serifem) */
.hero-profit {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  color: #fff;
  box-shadow: var(--sh-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}
.hero-profit::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--gold-soft), transparent 70%);
  pointer-events: none;
}
.hero-lab {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 14px;
}
.hero-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-num {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: clamp(40px, 7vw, 58px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -1px;
}
.hero-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-soft);
  color: #7BE0A0;
  border: 1px solid rgba(123, 224, 160, 0.3);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
}
.hero-trend.negative {
  background: rgba(178, 59, 59, 0.16);
  color: #F2A1A1;
  border-color: rgba(242, 161, 161, 0.3);
}
.hero-sub {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.65);
}
.hero-sub b { color: #fff; font-weight: 600; }

/* Tytuły sekcji z gold akcentem */
.sec-title {
  font-family: "Spectral", ui-serif, Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--navy);
  margin: 30px 0 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.sec-title::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* Staggered reveal — orchestrated page-load */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.reveal:nth-child(1) { animation-delay: 0.04s; }
.reveal:nth-child(2) { animation-delay: 0.10s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.22s; }
.reveal:nth-child(5) { animation-delay: 0.28s; }
.reveal:nth-child(6) { animation-delay: 0.34s; }
.reveal:nth-child(7) { animation-delay: 0.40s; }
.reveal:nth-child(8) { animation-delay: 0.46s; }
.reveal:nth-child(9) { animation-delay: 0.52s; }
@keyframes reveal-rise {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

/* Sygnał optymalizacji w hero (Faza 2.5 — insight KG 2026-05-30) */
.hero-optimize {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(191, 157, 86, 0.14);
  border: 1px solid rgba(191, 157, 86, 0.35);
  border-radius: var(--radius);
}
.hero-optimize.strong {
  background: rgba(191, 157, 86, 0.22);
  border-color: rgba(191, 157, 86, 0.6);
}
.hero-optimize-msg {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.hero-optimize-icon {
  flex-shrink: 0;
  color: var(--gold);
  margin-top: 1px;
}
.hero-optimize-icon svg { width: 18px; height: 18px; }
.hero-optimize-msg p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}
.hero-optimize-msg strong { color: #fff; }
.hero-optimize-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 13px;
}
.opt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  transition: background 0.16s, border-color 0.16s, transform 0.05s;
}
.opt-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--gold);
  color: #fff;
  text-decoration: none;
}
.opt-btn:active { transform: translateY(1px); }
.opt-btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
}
.opt-btn-primary:hover {
  background: #D8BC76;
  color: var(--navy-dark);
}

/* ===================================================================
   FAZA 3 — warstwa polish (Wariant A Private Bank refined, 2026-05-30)
   Głębia, gold akcenty, zaprojektowane empty states. Override na końcu
   pliku (świadomie; pełna konsolidacja CSS = osobny task).
   =================================================================== */

/* Empty states — z gołego italic tekstu na zaprojektowany box */
.empty-state {
  padding: 30px 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  font-style: normal;
  background: var(--surface);
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-sm);
}
.empty-state::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 2px var(--gold-line);
}

/* Głębia na kartach treści (stonowana, jeden cień) */
.inline-form,
.upload-zone,
.summary-card,
.status-card,
.team-card,
.contact-card,
.link-card,
.document-item {
  box-shadow: var(--sh-sm);
}
.data-table { box-shadow: var(--sh-sm); }

/* Karty interaktywne — delikatny lift na hover */
.status-card,
.link-card,
.team-card,
.contact-card {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.status-card:hover,
.link-card:hover,
.team-card:hover,
.contact-card:hover {
  border-color: var(--gold-line);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

/* Przyciski — głębia + lift */
.primary-btn,
.secondary-btn {
  box-shadow: var(--sh-sm);
  transition: background 0.16s, border-color 0.16s, box-shadow 0.2s, transform 0.06s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
.secondary-btn:hover { transform: translateY(-1px); }
.primary-btn:active,
.secondary-btn:active { transform: translateY(1px); }

/* Alert — z jaskrawego żółtego na stonowany papier z gold akcentem */
.portal-alert {
  background: var(--surface);
  border-color: var(--gold-line);
  box-shadow: var(--sh-sm);
}

/* Tabela — hover wiersza na desktopie (czytelność skanowania) */
@media (min-width: 861px) {
  .data-table tbody tr:hover { background: var(--gold-soft); }
}
/* Na mobile tabela jest „kartami" — bez cienia na transparentnym kontenerze */
@media (max-width: 860px) {
  .data-table { box-shadow: none; }
}

/* Pilot OCR autoksiegowanie — karta review faktury */
.ocr-summary { margin-top: 6px; padding: 8px 10px; background: #f6f8fa; border-left: 3px solid #C9A227; border-radius: 6px; }
.ocr-line { margin: 0; font-size: 13px; line-height: 1.5; }
.ocr-line.ocr-meta { color: #555; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.ocr-chip { display: inline-block; padding: 0 7px; border-radius: 10px; background: #e7edf3; font-size: 11px; }
.ocr-chip-dup { background: #fdecea; color: #b3261e; }
.approve-document-btn { color: #1a7f37; font-weight: 600; }
.ocr-review-line { color: #384150; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.ocr-review-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.4fr); gap: 8px; min-width: min(520px, 100%); }
.ocr-review-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4b5563; }
.ocr-review-form select,
.ocr-review-form input[type="text"],
.ocr-review-form input:not([type]) { min-height: 34px; border: 1px solid #d7dce3; border-radius: 6px; padding: 6px 8px; font: inherit; background: #fff; color: #1f2937; }
.ocr-review-form .review-description-input { width: 100%; }
.ocr-review-form .review-checkbox { flex-direction: row; align-items: center; gap: 6px; min-height: 34px; }
.ocr-review-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .ocr-review-form { grid-template-columns: 1fr; min-width: 0; }
}

/* ===== KONSULTACJE: pakiet, płatność, termin ===== */
.booking-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  margin-bottom: 26px;
}
.booking-kicker {
  margin: 0 0 7px;
  color: var(--gold-dark, #7b6319);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.booking-intro h2 { margin-bottom: 8px; }
.booking-intro .section-subtitle { max-width: 62ch; margin-bottom: 0; }

.booking-progress {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted, #667085);
  font-size: 12px;
  font-weight: 600;
}
.booking-progress li {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 58px;
}
.booking-progress span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border, #d6d8dc);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--muted, #667085);
  font-variant-numeric: tabular-nums;
}
.booking-progress li.active { color: var(--navy, #14213d); }
.booking-progress li.active span {
  border-color: var(--gold, #c9a227);
  background: var(--gold-soft, #f5efd8);
  color: var(--navy, #14213d);
}

.booking-state {
  position: relative;
  margin-bottom: 22px;
  padding: 20px 22px;
  border-left: 4px solid var(--gold, #c9a227);
  border-radius: var(--radius, 10px);
  background: var(--surface, #fff);
  box-shadow: var(--sh-sm);
}
.booking-state.warning { border-left-color: #a87118; background: #fffaf0; }
.booking-state.success { border-left-color: #287a53; background: #f3faf6; }
.booking-state.error { border-left-color: #a43d3d; background: #fff6f5; }
.booking-state.loading::after {
  content: "";
  display: block;
  width: min(360px, 72%);
  height: 7px;
  margin-top: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--gold-soft, #f5efd8), var(--gold-line, #dfcd87), var(--gold-soft, #f5efd8));
  background-size: 200% 100%;
  animation: booking-loading 1.2s ease-in-out infinite;
}
.booking-state-label {
  margin: 0 0 5px;
  color: var(--navy, #14213d);
  font-size: 14px;
  font-weight: 700;
}
.booking-state p:not(.booking-state-label) { margin: 0; max-width: 68ch; }
.booking-state .secondary-btn,
.booking-state .primary-btn { margin-top: 14px; margin-right: 8px; }
@keyframes booking-loading { to { background-position: -200% 0; } }

.booking-slots-panel {
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid var(--gold-line, #dfcd87);
  border-radius: var(--radius, 10px);
  background: #fffdf7;
  box-shadow: var(--sh-sm);
}
.booking-slots-head h3 { margin: 0 0 6px; color: var(--navy, #14213d); }
.booking-slots-head p { margin: 0; max-width: 70ch; color: var(--muted, #667085); line-height: 1.5; }
.booking-slots-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.booking-day-btn {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border, #d6d8dc);
  border-radius: 8px;
  background: var(--surface, #fff);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.booking-day-btn strong { color: var(--navy, #14213d); }
.booking-day-btn span { color: var(--muted, #667085); font-size: 0.86rem; }
.booking-day-btn:hover { border-color: var(--navy, #14213d); }
.booking-day-btn.active {
  border-color: var(--navy, #14213d);
  background: var(--navy, #14213d);
}
.booking-day-btn.active strong,
.booking-day-btn.active span { color: #fff; }
.booking-day-btn:focus-visible { outline: 3px solid var(--gold, #c9a227); outline-offset: 2px; }
.booking-slot-summary {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--gold-line, #dfcd87);
  border-radius: 8px;
  background: #fffdf7;
}
.booking-slot-summary > div { display: flex; gap: 10px; align-items: baseline; }
.booking-slot-summary dt {
  min-width: 116px;
  color: var(--muted, #667085);
  font-size: 0.86rem;
}
.booking-slot-summary dd {
  margin: 0;
  color: var(--navy, #14213d);
  font-weight: 700;
}
.booking-slots-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.booking-slots-list.loading,
.booking-slots-empty {
  grid-column: 1 / -1;
  color: var(--muted, #667085);
}
.booking-slot-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--border, #d6d8dc);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.booking-slot-item strong { color: var(--navy, #14213d); text-transform: capitalize; }
.booking-slot-item span { color: var(--muted, #667085); font-variant-numeric: tabular-nums; }
.booking-slot-select {
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--navy, #14213d);
  border-radius: 7px;
  background: var(--navy, #14213d);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.booking-slot-select:hover { filter: brightness(1.08); }
.booking-slot-select:focus-visible { outline: 3px solid var(--gold, #c9a227); outline-offset: 2px; }
.booking-slot-select:disabled { cursor: wait; opacity: 0.65; }
.booking-slots-panel .form-error { margin: 14px 0 0; }

.booking-request-form {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
  align-items: start;
}
.booking-packages {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.booking-packages legend {
  margin-bottom: 10px;
  color: var(--navy, #14213d);
  font-size: 16px;
  font-weight: 700;
}
.booking-package {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 17px 18px;
  border: 1px solid var(--border, #d6d8dc);
  border-radius: var(--radius, 10px);
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.08s;
}
.booking-package:hover { border-color: var(--gold-line, #dfcd87); }
.booking-package:active { transform: translateY(1px); }
.booking-package:has(input:checked) {
  border-color: var(--gold, #c9a227);
  background: var(--gold-soft, #f5efd8);
  box-shadow: inset 0 0 0 1px var(--gold, #c9a227);
}
.booking-package input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy, #14213d);
}
.booking-package input:focus-visible,
.booking-consent input:focus-visible {
  outline: 3px solid rgba(201, 162, 39, 0.42);
  outline-offset: 3px;
}
.booking-package-copy { display: grid; gap: 4px; }
.booking-package-copy strong { color: var(--navy, #14213d); font-size: 16px; }
.booking-package-copy small { color: var(--muted, #667085); line-height: 1.45; }
.booking-price {
  color: var(--navy, #14213d);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking-terms {
  padding: 20px 22px;
  border-radius: var(--radius, 10px);
  background: #f3f0e8;
  color: #263247;
}
.booking-terms-summary { display: grid; gap: 9px; }
.booking-terms-summary p { margin: 0; line-height: 1.55; }
.booking-terms-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.booking-terms-summary li { line-height: 1.5; }
.booking-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid rgba(20, 33, 61, 0.16);
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.booking-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy, #14213d); }
.booking-terms .form-error { margin: 9px 0 0 29px; }
.booking-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}
.booking-actions .primary-btn { min-width: 172px; white-space: nowrap; }
.booking-actions .form-status { margin: 0; }

@media (max-width: 860px) {
  .booking-intro { grid-template-columns: 1fr; align-items: start; }
  .booking-progress { justify-self: stretch; grid-template-columns: repeat(3, 1fr); }
  .booking-request-form { grid-template-columns: 1fr; }
  .booking-actions { grid-column: 1; align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .booking-state.loading::after { animation: none; }
  .booking-package { transition: none; }
}

/* Bezplatna konsultacja przyznawana przez pracownika (panel operacyjny) */
.staff-ops-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.free-consultation-form { display: grid; gap: 8px; margin-top: 14px; }
.free-consultation-form label { font-weight: 600; font-size: .92rem; }
.free-consultation-form select,
.free-consultation-form input[type="text"] { width: 100%; padding: 10px 12px; }
.free-consultation-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.free-consultation-result { margin-top: 12px; padding: 14px 16px; background: rgba(37,38,78,.05); display: grid; gap: 8px; }
.free-consultation-result p { margin: 0; }

.free-consultation-pending { margin: 18px 0; padding: 18px 20px; background: rgba(191,157,86,.10); display: grid; gap: 14px; }
.free-consultation-pending h3 { margin: 0; font-size: 1.05rem; }
.free-consultation-request { background: #fff; padding: 14px 16px; display: grid; gap: 8px; }
.free-consultation-request p { margin: 0; }
.free-consultation-decision-note { width: 100%; padding: 8px 10px; }
.free-consultation-decision-actions { display: flex; gap: 8px; }

/* Zaproszenie na bezplatna konsultacje (widok klienta) */
.booking-free-banner { margin: 16px 0; padding: 20px 22px; background: rgba(191,157,86,.12); border-left: 3px solid #BF9D56; display: grid; gap: 8px; }
.booking-free-banner h3 { margin: 0; font-size: 1.1rem; }
.booking-free-banner p { margin: 0; }
.booking-free-banner .primary-btn { justify-self: start; margin-top: 6px; }


/* ===== 2026-08-24: uwagi z pilota (Nitwiński) + decyzje Krzysztofa ===== */
.status-card { position: relative; }
.status-card:hover, .status-card:focus { z-index: 60; }
.statuses-grid { position: relative; z-index: 5; }
.status-card:focus { outline: 2px solid var(--gold-line); outline-offset: 2px; }
.status-card-muted { opacity: 0.62; background: var(--surface-soft); }
.status-card-muted:hover { opacity: 1; }
.status-deadline {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.35;
}
.status-deadline-days { color: var(--muted); }
.status-deadline.soon { color: #a68024; }
.status-deadline.overdue { color: var(--error); font-weight: 600; }
.status-hint {
  display: none;
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 8px);
  min-width: 260px;
  z-index: 70;
  padding: 10px 12px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 31, 51, 0.18);
}
.status-card:hover .status-hint, .status-card:focus .status-hint { display: block; }
.status-hint::after { content: ""; position: absolute; left: 24px; top: 100%; border: 7px solid transparent; border-top-color: var(--navy); }
.tasks-empty { display: flex; align-items: center; gap: 8px; }
.tasks-empty-icon {
  display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark);
}
.tasks-empty-icon svg { width: 14px; height: 14px; }
.rates-line { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.term-hint { color: var(--navy); border-bottom: 1px dotted var(--gold); cursor: help; font-weight: 600; }
.referrals-models {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0 18px;
}
.referrals-model-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 14px 16px;
}
.referrals-model-text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.referrals-summary { margin: 0 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.summary-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.referrals-form-card {
  background: var(--surface); border: 1px solid var(--gold-line); border-radius: var(--radius-lg);
  padding: 18px 20px 14px; margin: 0 0 24px; box-shadow: 0 6px 20px rgba(31, 31, 51, 0.06);
}
.referrals-form-title { margin: 0 0 4px; font-family: "Spectral", ui-serif, Georgia, serif; font-weight: 500; font-size: 19px; color: var(--navy); }
.referrals-form-hint { margin: 0 0 12px; font-size: 13px; color: var(--text-soft); }
@media (max-width: 720px) {
  .upload-type-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-hint { display: none !important; }
}

/* ---------- Baza wiedzy (etap 1c) ---------- */
.wiedza-tools { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 10px; }
.wiedza-search-label { position: absolute; left: -9999px; }
.wiedza-search {
  width: min(100%, 420px); padding: 11px 14px; font: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.wiedza-search:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wiedza-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.wiedza-filter {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.wiedza-filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.wiedza-count { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.wiedza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wiedza-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius);
  color: var(--text); font: inherit;
}
.wiedza-card:hover { border-color: var(--gold); }
.wiedza-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wiedza-card strong { color: var(--navy); font-size: 16px; }
.wiedza-card span { color: var(--muted); font-size: 13px; }
.wiedza-article { max-width: 760px; }
.wiedza-back { margin-bottom: 14px; }
.wiedza-meta { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.wiedza-body { line-height: 1.65; }
.wiedza-body p, .wiedza-body li { color: var(--text); }
.wiedza-body h2 { font-size: 20px; margin: 26px 0 10px; }
.wiedza-body h3 { font-size: 17px; margin: 22px 0 8px; }
.wiedza-body ul, .wiedza-body ol { margin: 0 0 14px 22px; }
.wiedza-body li { margin-bottom: 6px; }
.wiedza-body a { color: var(--gold-dark); font-weight: 600; }
.wiedza-body blockquote { margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--surface-alt, rgba(0,0,0,.02)); }
.wiedza-body table { border-collapse: collapse; margin: 0 0 16px; width: 100%; }
.wiedza-body td, .wiedza-body th { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.wiedza-body img { max-width: 100%; height: auto; }
.wiedza-foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }

/* ---------- Osobisty link polecający (etap B) ---------- */
.ref-link-box {
  margin: 0 0 20px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: var(--radius);
}
.ref-link-hint { color: var(--muted); font-size: 13px; margin: 6px 0 14px; max-width: 62ch; }
.ref-link-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ref-link-input {
  flex: 1 1 320px; min-width: 220px; padding: 10px 12px; font: inherit; font-size: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.ref-link-btn { white-space: nowrap; }
.ref-link-share { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ref-share-link { color: var(--gold-dark); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.ref-share-link:hover { text-decoration: underline; }
.ref-link-status { color: var(--muted); font-size: 13px; }

/* Przełącznik Milówka/Delegacje w zakładce Koszty (2026-09-01; powiększony
   2026-09-03 na zgłoszenie Krzysztofa: "malutkie słówka, nie wygląda jak
   przycisk, nikt się nie domyśli, że można kliknąć"). Duże przyciski
   segmentowe: aktywny wypełniony granatem, nieaktywny z ramką i pełnym
   kolorem tekstu — nic nie jest wyszarzone. */
.koszty-switch { display: flex; gap: 10px; margin-bottom: 22px; }
.koszty-switch .tab-btn {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 30px;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  background: var(--surface);
  margin-bottom: 0;
}
.koszty-switch .tab-btn:hover { border-color: var(--gold); }
.koszty-switch .tab-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
