/* Wspólnota Plus v215 — kontrola spójności po globalnym redesignie.
   Warstwa końcowa: nie zmienia logiki, tylko domyka konflikty CSS po v209-v214. */
.app-shell-unified-v211{
  /* v215 cleanup 2026-05-17: usunieto 4 vars o IDENTYCZNYCH wartosciach z v210 :root
     (--wp-muted #64748b, --wp-green #16a34a, --wp-red #dc2626, --wp-radius 22px).
     v210 :root dostarcza te same wartosci jako CSS variable inheritance fallback. */
  --wp-bg:#f4f8fd;
  --wp-card:#ffffff;
  --wp-card-soft:#f8fbff;
  --wp-border:#eef2f7;
  --wp-border-strong:#eef2f7;
  --wp-text:#0f172a;
  --wp-blue:#1f2937;
  --wp-blue-2:#1f2937;
  --wp-amber:#d97706;
  --wp-slate:#475569;
  --wp-radius-sm:14px;
  --wp-shadow:0 16px 42px rgba(15, 23, 42,.075);
  --wp-shadow-soft:0 8px 24px rgba(15, 23, 42,.055);
}

/* Jeden rytm strony — wszystkie stare pulpity dostają tę samą szerokość, bez efektu kartki A4. */
.app-shell-unified-v211 .main-auth > :is(.page,.owner-page,.vp-page,.vp-shell,.content,.page-content,.manager-content,.container):not(.message-stack){
  max-width:100%!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.app-shell-unified-v211 :is(.page-header,.panel-hero,.landing-hero,.vp-hero){
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:18px!important;
  border:1px solid var(--wp-border)!important;
  border-radius:28px!important;
  background:linear-gradient(135deg,#fff 0%,#f6faff 100%)!important;
  box-shadow:var(--wp-shadow)!important;
  color:var(--wp-text)!important;
  margin-bottom:20px!important;
}
.app-shell-unified-v211 :is(.page-header,.panel-hero,.landing-hero,.vp-hero) h1,
.app-shell-unified-v211 :is(.page-title,.section-title,h1,h2,h3){
  color:var(--wp-text)!important;
  letter-spacing:-.025em!important;
}
.app-shell-unified-v211 :is(.page-header,.panel-hero,.landing-hero,.vp-hero) p,
.app-shell-unified-v211 :is(.page-subtitle,.section-copy,.muted,.help-text,.form-text){
  color:var(--wp-muted)!important;
}

/* Karty i panele — wspólna geometria dla starych i nowych klas. */
.app-shell-unified-v211 :is(.card,.soft-panel,.panel-card,.stat-card,.kpi-card,.summary-card,.form-section,.filter-card,.table-card,.vp-card){
  border:1px solid var(--wp-border)!important;
  border-radius:var(--wp-radius)!important;
  background:rgba(255,255,255,.97)!important;
  box-shadow:var(--wp-shadow-soft)!important;
  color:var(--wp-text)!important;
  box-sizing:border-box!important;
  min-width:0!important;
}
.app-shell-unified-v211 :is(.card,.soft-panel,.panel-card,.form-section,.filter-card,.table-card,.vp-card) + :is(.card,.soft-panel,.panel-card,.form-section,.filter-card,.table-card,.vp-card){
  margin-top:18px!important;
}
.app-shell-unified-v211 :is(.stats-grid,.summary-grid,.kpi-grid,.metric-grid,.dashboard-grid,.card-grid,.grid-2,.grid-3,.grid-4){
  display:grid!important;
  gap:18px!important;
  min-width:0!important;
  max-width:100%!important;
}
.app-shell-unified-v211 :is(.stats-grid,.summary-grid,.kpi-grid,.metric-grid){grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;}
.app-shell-unified-v211 :is(.grid-2){grid-template-columns:repeat(auto-fit,minmax(280px,1fr))!important;}
.app-shell-unified-v211 :is(.grid-3,.card-grid){grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;}
.app-shell-unified-v211 :is(.grid-4){grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;}

/* Tabele i listy — bez ucinania na małym oknie. */
.app-shell-unified-v211 :is(.table-wrap,.table-responsive,.overflow-table,.scroll-x,.data-table-wrap){
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  -webkit-overflow-scrolling:touch!important;
  border:1px solid var(--wp-border)!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:var(--wp-shadow-soft)!important;
}
.app-shell-unified-v211 :is(table,.table){
  width:100%!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}
.app-shell-unified-v211 :is(table,.table) th{
  background:#f7fbff!important;
  color:#1f2937!important;
  font-size:12px!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
  font-weight:900!important;
  border-bottom:1px solid var(--wp-border)!important;
  white-space:nowrap!important;
}
.app-shell-unified-v211 :is(table,.table) td{
  border-bottom:1px solid #eef2f7!important;
  color:#0f172a!important;
  vertical-align:middle!important;
}
.app-shell-unified-v211 :is(table,.table) tr:last-child td{border-bottom:0!important;}
.app-shell-unified-v211 :is(table,.table) td,
.app-shell-unified-v211 :is(table,.table) th{padding:13px 14px!important;}

/* Formularze — jeden standard pól. */
.app-shell-unified-v211 :is(input,select,textarea,.form-control,.form-select){
  border:1px solid var(--wp-border-strong)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:var(--wp-text)!important;
  box-shadow:none!important;
  min-height:42px;
}
.app-shell-unified-v211 textarea{min-height:112px;}
.app-shell-unified-v211 :is(input,select,textarea,.form-control,.form-select):focus{
  border-color:#94a3b8!important;
  box-shadow:0 0 0 4px rgba(31, 41, 55,.12)!important;
  outline:none!important;
}
.app-shell-unified-v211 label{color:#334155!important;font-weight:800!important;}
.app-shell-unified-v211 :is(.form-row,.form-grid,.filters,.filter-row,.toolbar,.actions,.action-row,.bulk-actions,.manager-actions){
  gap:12px!important;
  align-items:center;
  max-width:100%!important;
  min-width:0!important;
}

/* Przyciski i badge — końcowa mapa kolorów. */
/* PR #274 (2026-05-23): catch-all'e button:not(.app-btn) i input[type='submit']:not(.app-btn)
   USUNIETE z :is(...). Pozostaly nazwane warianty (.btn, .button, .vp-btn, .vp-mini-btn). */
.app-shell-unified-v211 :is(.btn,.button,.vp-btn,.vp-mini-btn){
  border-radius:14px!important;
  font-weight:900!important;
  border:1px solid var(--wp-border)!important;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease!important;
}
.app-shell-unified-v211 :is(.btn,.button,.vp-btn,.vp-mini-btn):hover{transform:translateY(-1px);}
/* USUNIETO 2026-05-19 (PR fix/remove-blue-gradient-catchall): catch-all gradient !important
   dla .app-shell-unified-v211 :is(.btn-primary,.primary,.button-primary,.vp-btn-primary)
   oraz .app-shell-unified-v211 .btn:not(.btn-secondary):not(.btn-light):not(.btn-danger):not(.btn-outline):not(.btn-outline-secondary).
   Powod: linear-gradient niebieski !important nadpisywal intencjonalne kolory lokalnych
   komponentow z klasa .primary (np. .mt-btn.primary z konserwacji renderowal sie gradientem
   zamiast wlasnego var(--mt-blue); .wp-btn--primary i podobne traci ly swoje warianty).
   Po PR: kategoria B (39 buttonow z lokalnym wariantem koloru) renderuje wlasne style.
   Kategoria C/D buttonow Bootstrap-like nadal jest pokolorowana przez unified-cards.css
   (osobny PR planowany).
   Conflict resolution batch 2026-05-19: piąty stylelint disable comment z PR4
   (chore/stylelint-blue-catchall-rule) byl nad tym blokiem - pominiety podczas
   merge bo regula juz nie istnieje. */
/* stylelint-disable-next-line selector-disallowed-list -- LEGACY v215 nazwany wariant secondary (regex lapie .btn-*), kept until UI refactor */
.app-shell-unified-v211 :is(.btn-secondary,.btn-light,.btn-outline,.btn-outline-secondary,.vp-btn-secondary){
  background:#fff!important;
  color:#0f172a!important;
  border-color:var(--wp-border)!important;
  box-shadow:0 8px 18px rgba(15, 23, 42,.045)!important;
}
.app-shell-unified-v211 :is(.badge,.status,.status-badge,.pill,.tag,.label){
  border-radius:999px!important;
  border:1px solid transparent;
  font-weight:900!important;
  line-height:1.15!important;
}
.app-shell-unified-v211 :is(.badge-success,.status-success,.status-accepted,.status-done,.status-sent,.accepted,.success){background:#eaf8ef!important;color:#166534!important;border-color:#bce8c7!important;}
.app-shell-unified-v211 :is(.badge-info,.status-active,.status-open,.status-progress,.info){background:#eef2f7!important;color:#1f2937!important;border-color:#eef2f7!important;}
.app-shell-unified-v211 :is(.badge-warning,.status-warning,.status-pending,.status-scheduled,.warning){background:#fff7e6!important;color:#a15c07!important;border-color:#fde7b0!important;}
.app-shell-unified-v211 :is(.badge-danger,.status-danger,.status-closed,.status-error,.status-rejected,.danger,.error){background:#fff1f2!important;color:#be123c!important;border-color:#fecdd3!important;}
.app-shell-unified-v211 :is(.badge-muted,.status-muted,.status-draft,.muted-pill){background:#f1f5f9!important;color:#475569!important;border-color:#e2e8f0!important;}

/* Sidebar i właściciel — identyczny shell, bez rozjazdów. */
.app-shell-unified-v211 .sidebar{overflow-y:auto!important;overflow-x:hidden!important;}
.app-shell-unified-v211 .sidebar a,
.app-shell-unified-v211 .nav-section-summary{
  min-width:0!important;
  white-space:normal!important;
  word-break:normal!important;
}
.app-shell-unified-v211 .sidebar a.active-link,
.app-shell-unified-v211 .sidebar-direct-link.active-link{
  box-shadow:inset 3px 0 0 var(--wp-blue)!important;
}
.app-shell-unified-v211 .sidebar-unread-pill{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-width:22px!important;height:22px!important;padding:0 7px!important;
  background:#ef4444!important;color:#fff!important;border-radius:999px!important;font-size:12px!important;
}

/* Komunikaty, puste stany i modale. */
.app-shell-unified-v211 .empty-state{
  border:1px dashed #eef2f7!important;
  border-radius:24px!important;
  background:linear-gradient(135deg,#fff,#f8fbff)!important;
  color:var(--wp-muted)!important;
  box-shadow:var(--wp-shadow-soft)!important;
}
.app-shell-unified-v211 .message-item{border-radius:16px!important;box-shadow:var(--wp-shadow-soft)!important;}
.app-shell-unified-v211 :is(.document-preview-dialog,.action-confirm-dialog,.resolution-lightbox__dialog){
  border-radius:26px!important;
  border:1px solid var(--wp-border)!important;
  box-shadow:0 24px 80px rgba(15, 23, 42,.18)!important;
}

/* Ochrona przed poziomym obcięciem po starszych szablonach. */
.app-shell-unified-v211 :is(.row,.cols,.layout){
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
.app-shell-unified-v211 img,
.app-shell-unified-v211 svg,
.app-shell-unified-v211 video,
.app-shell-unified-v211 canvas{max-width:100%;height:auto;}

@media(max-width:1180px){
  .app-shell-unified-v211 :is(.page-header,.panel-hero,.landing-hero,.vp-hero){flex-direction:column!important;}
  .app-shell-unified-v211 :is(.actions,.toolbar,.action-row,.bulk-actions,.manager-actions){overflow-x:auto!important;padding-bottom:2px!important;}
}
@media(max-width:760px){
  .app-shell-unified-v211 .main.main-auth{padding:78px 14px 28px!important;}
  .app-shell-unified-v211 :is(.page-header,.panel-hero,.landing-hero,.vp-hero,.card,.soft-panel,.panel-card,.form-section){border-radius:18px!important;}
  .app-shell-unified-v211 :is(table,.table) td,
  .app-shell-unified-v211 :is(table,.table) th{padding:11px 12px!important;}
  /* PR #274 (2026-05-23): catch-all'e button:not(.app-btn) i input[type='submit']:not(.app-btn) USUNIETE. */
  .app-shell-unified-v211 :is(.btn,.button){min-height:40px;}
}


/* v215 cleanup 2026-05-17: usunieta sekcja v216 portal-preview-banner (0 uzyc w templates).
   .table-actions .btn pozostaje (2 templates: rents/rent_import_list_backup,
   resolutions/manager_bulk_links). */
.table-actions .btn {
  white-space: nowrap;
}
