/* v212: ręczne ujednolicenie najważniejszych ekranów pod shell v211.
   Zakres: wygląd pulpitów, uchwał, głosowań, wyników i konserwacji.
   Bez zmian logiki biznesowej. */

:root{
  --v212-bg:#f4f7fb;
  --v212-card:#ffffff;
  --v212-card-soft:#f8fbff;
  --v212-border:#eef2f7;
  --v212-border-soft:#eef2f7;
  --v212-text:#0f172a;
  --v212-muted:#64748b;
  --v212-blue:#1f2937;
  --v212-blue-2:#1f2937;
  --v212-green:#16a34a;
  --v212-orange:#f97316;
  --v212-red:#dc2626;
  --v212-purple:#7c3aed;
  --v212-radius:24px;
  --v212-radius-sm:16px;
  --v212-shadow:0 18px 42px rgba(15, 23, 42,.08);
  --v212-shadow-sm:0 10px 24px rgba(15, 23, 42,.055);
}

body.app-shell-unified-v211{background:var(--v212-bg)!important;color:var(--v212-text)!important;}
.app-shell-unified-v211 .main{background:linear-gradient(180deg,#f8fbff 0%,#f3f7fc 100%)!important;}
.app-shell-unified-v211 .main > *{box-sizing:border-box;}

/* Wspólny rytm stron */
.app-shell-unified-v211 .home39-shell,
.app-shell-unified-v211 .vote-dashboard,
.app-shell-unified-v211 .res-list-page,
.app-shell-unified-v211 .vp-page,
.app-shell-unified-v211 .konserwacja-html,
.app-shell-unified-v211 .maint-screen,
.app-shell-unified-v211 .app-page,
.app-shell-unified-v211 .page-shell{
  width:100%;
  max-width:1540px;
  margin:0 auto;
  padding:0;
}

.app-shell-unified-v211 .home39-topbar,
.app-shell-unified-v211 .vote-dashboard__head,
.app-shell-unified-v211 .res-filter-panel,
.app-shell-unified-v211 .vp-hero,
.app-shell-unified-v211 .konserwacja-html .topbar,
.app-shell-unified-v211 .konserwacja-html .page-head,
.app-shell-unified-v211 .maint-screen-head,
.app-shell-unified-v211 .app-page-hero{
  background:rgba(255,255,255,.9)!important;
  border:1px solid var(--v212-border)!important;
  border-radius:28px!important;
  box-shadow:var(--v212-shadow-sm)!important;
  padding:24px!important;
  margin:0 0 20px!important;
  color:var(--v212-text)!important;
}

.app-shell-unified-v211 .home39-greeting h1,
.app-shell-unified-v211 .vote-dashboard__head h1,
.app-shell-unified-v211 .vp-brand-text h1,
.app-shell-unified-v211 .konserwacja-html .title h1,
.app-shell-unified-v211 .maint-screen-head__title,
.app-shell-unified-v211 .app-page-hero__title,
.app-shell-unified-v211 h1.page-title{
  color:var(--v212-text)!important;
  font-size:clamp(28px,2.35vw,42px)!important;
  line-height:1.05!important;
  font-weight:950!important;
  letter-spacing:-.04em!important;
  margin:0 0 8px!important;
}

.app-shell-unified-v211 .home39-greeting p,
.app-shell-unified-v211 .vote-breadcrumb,
.app-shell-unified-v211 .vp-brand-text p,
.app-shell-unified-v211 .konserwacja-html .title p,
.app-shell-unified-v211 .maint-screen-head__copy,
.app-shell-unified-v211 .app-page-hero__copy,
.app-shell-unified-v211 .section-copy{
  color:var(--v212-muted)!important;
  font-weight:650!important;
  line-height:1.55!important;
}

/* Karty KPI: wspólny wygląd dla managera, właściciela, głosowań, konserwacji */
.app-shell-unified-v211 .home39-stats,
.app-shell-unified-v211 .vote-kpi-grid,
.app-shell-unified-v211 .kpi-grid,
.app-shell-unified-v211 .dashboard-kpi-grid,
.app-shell-unified-v211 .konserwacja-html .kpis,
.app-shell-unified-v211 .maint-kpi-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;
  gap:16px!important;
  margin:0 0 20px!important;
}
.app-shell-unified-v211 .home39-stat,
.app-shell-unified-v211 .vote-kpi,
.app-shell-unified-v211 .dashboard-kpi-card,
.app-shell-unified-v211 .kpi-card,
.app-shell-unified-v211 .konserwacja-html .kpi,
.app-shell-unified-v211 .maint-kpi-card,
.app-shell-unified-v211 .res-kpi{
  background:rgba(255,255,255,.94)!important;
  border:1px solid var(--v212-border)!important;
  border-radius:24px!important;
  box-shadow:var(--v212-shadow-sm)!important;
  padding:20px!important;
  min-height:126px!important;
  display:flex!important;
  align-items:flex-start!important;
  gap:14px!important;
  color:var(--v212-text)!important;
}
.app-shell-unified-v211 .home39-stat__icon,
.app-shell-unified-v211 .vote-kpi__icon,
.app-shell-unified-v211 .kpi-icon,
.app-shell-unified-v211 .res-kpi__icon,
.app-shell-unified-v211 .maint-kpi-card__icon{
  width:46px!important;height:46px!important;min-width:46px!important;
  border-radius:16px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  background:#eef2f7!important;color:var(--v212-blue)!important;
  font-size:20px!important;box-shadow:0 10px 18px rgba(31, 41, 55,.10)!important;
}
.app-shell-unified-v211 .home39-stat strong,
.app-shell-unified-v211 .vote-kpi__value,
.app-shell-unified-v211 .dashboard-kpi-card .value,
.app-shell-unified-v211 .konserwacja-html .kpi-number,
.app-shell-unified-v211 .maint-kpi-card__value,
.app-shell-unified-v211 .res-kpi__value{
  display:block!important;
  color:var(--v212-text)!important;
  font-size:30px!important;
  line-height:1.05!important;
  font-weight:950!important;
  letter-spacing:-.035em!important;
}
.app-shell-unified-v211 .home39-stat span,
.app-shell-unified-v211 .vote-kpi__label,
.app-shell-unified-v211 .dashboard-kpi-card .label,
.app-shell-unified-v211 .konserwacja-html .kpi-title,
.app-shell-unified-v211 .maint-kpi-card__label,
.app-shell-unified-v211 .res-kpi__label{
  color:var(--v212-muted)!important;
  font-size:13px!important;
  font-weight:850!important;
}
.app-shell-unified-v211 .vote-kpi__note,
.app-shell-unified-v211 .res-kpi__hint,
.app-shell-unified-v211 .trend{font-size:12px!important;font-weight:800!important;color:#16a34a!important;}

/* Karty sekcji i siatki */
.app-shell-unified-v211 .home39-card,
.app-shell-unified-v211 .vote-card,
.app-shell-unified-v211 .res-table-card,
.app-shell-unified-v211 .vp-card,
.app-shell-unified-v211 .vp-filter,
.app-shell-unified-v211 .vp-privacy-note,
.app-shell-unified-v211 .konserwacja-html .card,
.app-shell-unified-v211 .maint-panel-card,
.app-shell-unified-v211 .maint-bulk-card,
.app-shell-unified-v211 .maint-filter-panel,
.app-shell-unified-v211 .card,
.app-shell-unified-v211 .card-soft,
.app-shell-unified-v211 .soft-panel,
.app-shell-unified-v211 .filter-card,
.app-shell-unified-v211 .toolbar-card{
  background:rgba(255,255,255,.94)!important;
  border:1px solid var(--v212-border)!important;
  border-radius:var(--v212-radius)!important;
  box-shadow:var(--v212-shadow-sm)!important;
  color:var(--v212-text)!important;
}
.app-shell-unified-v211 .vote-card,
.app-shell-unified-v211 .res-table-card,
.app-shell-unified-v211 .vp-card,
.app-shell-unified-v211 .vp-filter,
.app-shell-unified-v211 .konserwacja-html .card,
.app-shell-unified-v211 .maint-panel-card,
.app-shell-unified-v211 .maint-bulk-card,
.app-shell-unified-v211 .maint-filter-panel{padding:20px!important;}

.app-shell-unified-v211 .vote-main-grid,
.app-shell-unified-v211 .vote-bottom-grid,
.app-shell-unified-v211 .dashboard-grid,
.app-shell-unified-v211 .maint-list-layout,
.app-shell-unified-v211 .home39-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(280px,360px)!important;
  gap:20px!important;
  align-items:start!important;
}
.app-shell-unified-v211 .vote-bottom-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}

/* Tabele */
.app-shell-unified-v211 .vote-table-wrap,
.app-shell-unified-v211 .res-table-wrap,
.app-shell-unified-v211 .maint-table-shell,
.app-shell-unified-v211 .table-wrap,
.app-shell-unified-v211 .table-responsive,
.app-shell-unified-v211 .overflow-table{
  border:1px solid var(--v212-border)!important;
  border-radius:22px!important;
  box-shadow:none!important;
  background:#fff!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
  max-width:100%!important;
}
.app-shell-unified-v211 table,
.app-shell-unified-v211 .vote-table,
.app-shell-unified-v211 .res-modern-table,
.app-shell-unified-v211 .maint-table,
.app-shell-unified-v211 .recent-tickets-table,
.app-shell-unified-v211 .table-compact{
  width:100%!important;
  border-collapse:separate!important;
  border-spacing:0!important;
  background:#fff!important;
  min-width:760px;
}
.app-shell-unified-v211 th,
.app-shell-unified-v211 .vote-table th,
.app-shell-unified-v211 .res-modern-table th,
.app-shell-unified-v211 .maint-table th,
.app-shell-unified-v211 .recent-tickets-table th,
.app-shell-unified-v211 .table-compact th{
  background:#f8fbff!important;
  color:#1f2937!important;
  font-size:12px!important;
  letter-spacing:.075em!important;
  text-transform:uppercase!important;
  font-weight:950!important;
  border-bottom:1px solid var(--v212-border)!important;
  padding:14px 16px!important;
  white-space:nowrap!important;
}
.app-shell-unified-v211 td,
.app-shell-unified-v211 .vote-table td,
.app-shell-unified-v211 .res-modern-table td,
.app-shell-unified-v211 .maint-table td,
.app-shell-unified-v211 .recent-tickets-table td,
.app-shell-unified-v211 .table-compact td{
  color:#0f172a!important;
  border-bottom:1px solid var(--v212-border-soft)!important;
  padding:14px 16px!important;
  vertical-align:middle!important;
}
.app-shell-unified-v211 tbody tr:hover{background:#f8fbff!important;}

/* Przyciski, linki akcji, statusy */
.app-shell-unified-v211 .vote-action,
.app-shell-unified-v211 .vote-action--primary,
.app-shell-unified-v211 .vote-link,
.app-shell-unified-v211 .vp-btn,
.app-shell-unified-v211 .vp-mini-btn,
.app-shell-unified-v211 .res-btn,
.app-shell-unified-v211 .maint-action-tile,
.app-shell-unified-v211 .maint-table-link,
.app-shell-unified-v211 .card-link,
.app-shell-unified-v211 .table-link{
  border-radius:14px!important;
  font-weight:900!important;
  text-decoration:none!important;
}
/* stylelint-disable-next-line selector-disallowed-list -- LEGACY v212 catch-all gradient (kandydat do refactoru), kept until UI refactor */
.app-shell-unified-v211 .btn,
.app-shell-unified-v211 .res-btn,
.app-shell-unified-v211 .vp-btn,
.app-shell-unified-v211 .vote-action--primary,
.app-shell-unified-v211 .konserwacja-html .btn.primary{
  background:linear-gradient(180deg,var(--v212-blue-2),var(--v212-blue))!important;
  border:1px solid var(--v212-blue)!important;
  color:#fff!important;
  box-shadow:0 12px 26px rgba(31, 41, 55,.18)!important;
}
/* stylelint-disable-next-line selector-disallowed-list -- LEGACY v212 nazwany wariant secondary (regex lapie .btn-*), kept until UI refactor */
.app-shell-unified-v211 .btn-secondary,
.app-shell-unified-v211 .res-btn--secondary,
.app-shell-unified-v211 .vp-mini-btn,
.app-shell-unified-v211 .vote-action,
.app-shell-unified-v211 .konserwacja-html .btn:not(.primary){
  background:#fff!important;
  color:#0f172a!important;
  border:1px solid #eef2f7!important;
  box-shadow:0 8px 18px rgba(15, 23, 42,.055)!important;
}

.app-shell-unified-v211 .badge,
.app-shell-unified-v211 .pill,
.app-shell-unified-v211 .badge-soft,
.app-shell-unified-v211 .vote-status,
.app-shell-unified-v211 .res-tag,
.app-shell-unified-v211 .res-status-pill,
.app-shell-unified-v211 .maint-badge,
.app-shell-unified-v211 .status-badge,
.app-shell-unified-v211 .priority{
  border-radius:999px!important;
  font-size:12px!important;
  font-weight:900!important;
  padding:6px 10px!important;
  border:1px solid transparent!important;
  white-space:nowrap!important;
}
.app-shell-unified-v211 .badge-soft,
.app-shell-unified-v211 .res-status-pill,
.app-shell-unified-v211 .vote-status{background:#eef2f7!important;color:#1f2937!important;border-color:#eef2f7!important;}
.app-shell-unified-v211 .pill-success,
.app-shell-unified-v211 .badge-success,
.app-shell-unified-v211 .res-tag--green,
.app-shell-unified-v211 .vote-status--active,
.app-shell-unified-v211 .status-badge.status-open,
.app-shell-unified-v211 .maint-badge--status-new{background:#dcfce7!important;color:#15803d!important;border-color:#bbf7d0!important;}
.app-shell-unified-v211 .pill-warning,
.app-shell-unified-v211 .badge-warning,
.app-shell-unified-v211 .res-tag--orange,
.app-shell-unified-v211 .maint-badge--priority-high{background:#fff7ed!important;color:#c2410c!important;border-color:#fed7aa!important;}
.app-shell-unified-v211 .pill-danger,
.app-shell-unified-v211 .badge-danger,
.app-shell-unified-v211 .res-tag--red,
.app-shell-unified-v211 .vote-status--closed,
.app-shell-unified-v211 .maint-badge--priority-critical{background:#fee2e2!important;color:#b91c1c!important;border-color:#fecaca!important;}
.app-shell-unified-v211 .res-tag--gray,
.app-shell-unified-v211 .badge-muted{background:#f1f5f9!important;color:#475569!important;border-color:#e2e8f0!important;}

/* Formularze i filtry */
.app-shell-unified-v211 .res-filter-form,
.app-shell-unified-v211 .maint-filter-grid,
.app-shell-unified-v211 .filter-card__form,
.app-shell-unified-v211 .home39-community-form{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;
  gap:14px!important;
  align-items:end!important;
}
.app-shell-unified-v211 .res-field,
.app-shell-unified-v211 .maint-field,
.app-shell-unified-v211 .filter-field{display:grid!important;gap:7px!important;}
.app-shell-unified-v211 .res-field label,
.app-shell-unified-v211 .maint-field span,
.app-shell-unified-v211 .filter-field label,
.app-shell-unified-v211 label{font-weight:850!important;color:#1f2937!important;}

/* Wyniki głosowań — manager i właściciel */
.app-shell-unified-v211 .vp-shell{max-width:1540px!important;margin:0 auto!important;}
.app-shell-unified-v211 .vp-logo{width:58px!important;height:58px!important;border-radius:18px!important;background:#eef2f7!important;object-fit:contain!important;overflow:visible!important;}
.app-shell-unified-v211 .vp-results-list,
.app-shell-unified-v211 .vp-owner-results-list{display:grid!important;gap:18px!important;}
.app-shell-unified-v211 .vp-card-grid,
.app-shell-unified-v211 .vp-owner-card-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(280px,420px)!important;gap:18px!important;align-items:stretch!important;}
.app-shell-unified-v211 .vp-outcome{font-weight:950!important;letter-spacing:.04em!important;}
.app-shell-unified-v211 .vp-empty{background:#fff!important;border:1px dashed #eef2f7!important;border-radius:24px!important;box-shadow:var(--v212-shadow-sm)!important;padding:28px!important;color:var(--v212-muted)!important;}

/* Konserwacja — dopięcie stylu i kolumn po wcześniejszych uwagach */
.app-shell-unified-v211 .konserwacja-html .content{padding:0!important;max-width:1540px!important;margin:0 auto!important;}
.app-shell-unified-v211 .konserwacja-html .recent-tickets-table .col-title{width:34%!important;}
.app-shell-unified-v211 .konserwacja-html .recent-tickets-table .col-location{width:16%!important;}
.app-shell-unified-v211 .konserwacja-html .location-cell{max-width:190px!important;white-space:normal!important;line-height:1.35!important;color:#475569!important;}
.app-shell-unified-v211 .konserwacja-html .card-header,
.app-shell-unified-v211 .vote-card__header,
.app-shell-unified-v211 .res-table-head,
.app-shell-unified-v211 .maint-panel-card__header{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:16px!important;margin-bottom:16px!important;}
.app-shell-unified-v211 .konserwacja-html .card-header h2,
.app-shell-unified-v211 .vote-card__header h2,
.app-shell-unified-v211 .res-table-title,
.app-shell-unified-v211 .maint-panel-card__title{color:var(--v212-text)!important;font-weight:950!important;letter-spacing:-.025em!important;margin:0!important;}

/* Pulpit głosowań: aktywne uchwały na dole zostaje z wcześniejszej paczki, ale układ spójny */
.app-shell-unified-v211 .vote-card--table{order:3!important;}
.app-shell-unified-v211 .vote-side-stack{order:1!important;display:grid!important;gap:18px!important;}
.app-shell-unified-v211 .vote-main-grid{grid-template-columns:minmax(280px,360px) minmax(0,1fr)!important;}
.app-shell-unified-v211 .vote-main-grid .vote-card--table{grid-column:1 / -1!important;}

/* Puste stany */
.app-shell-unified-v211 .empty-state,
.app-shell-unified-v211 .vote-empty,
.app-shell-unified-v211 .maint-empty,
.app-shell-unified-v211 .vp-empty{
  border-radius:22px!important;
  background:#f8fbff!important;
  border:1px dashed #eef2f7!important;
  color:#64748b!important;
  font-weight:750!important;
}

/* Responsywność — bez obcinania przy mniejszym ekranie */
@media(max-width:1280px){
  .app-shell-unified-v211 .vote-main-grid,
  .app-shell-unified-v211 .dashboard-grid,
  .app-shell-unified-v211 .maint-list-layout,
  .app-shell-unified-v211 .home39-grid{grid-template-columns:1fr!important;}
  .app-shell-unified-v211 .vote-bottom-grid{grid-template-columns:1fr!important;}
  .app-shell-unified-v211 .vp-card-grid,
  .app-shell-unified-v211 .vp-owner-card-grid{grid-template-columns:1fr!important;}
}
@media(max-width:760px){
  .app-shell-unified-v211 .home39-topbar,
  .app-shell-unified-v211 .vote-dashboard__head,
  .app-shell-unified-v211 .res-filter-panel,
  .app-shell-unified-v211 .vp-hero,
  .app-shell-unified-v211 .konserwacja-html .topbar,
  .app-shell-unified-v211 .konserwacja-html .page-head,
  .app-shell-unified-v211 .maint-screen-head,
  .app-shell-unified-v211 .app-page-hero{padding:18px!important;border-radius:22px!important;}
  .app-shell-unified-v211 .home39-stats,
  .app-shell-unified-v211 .vote-kpi-grid,
  .app-shell-unified-v211 .kpi-grid,
  .app-shell-unified-v211 .dashboard-kpi-grid,
  .app-shell-unified-v211 .konserwacja-html .kpis,
  .app-shell-unified-v211 .maint-kpi-grid{grid-template-columns:1fr!important;}
}
