/* PEREKO unified brand typography — Centrum Partnera, HeatFlow admin, Centrum Produktowe */
:root{
  --pereko-font-display:"Montserrat",Arial,sans-serif;
  --pereko-font-body:"Source Sans 3","Segoe UI",Arial,sans-serif;
  --pereko-text:16px;
  --pereko-small:14px;
  --pereko-label:13px;
  --pereko-button:14px;
  --pereko-section:22px;
  --pereko-line:1.55;
  --pereko-search-width:260px;
  --pereko-control-height:44px;
  --pereko-panel-radius:16px;
  --pereko-panel-line:#dce2e5;
  --pereko-row-line:#edf0f1;
}

body.admin-page{
  font-family:var(--pereko-font-body);
  font-size:var(--pereko-text);
  line-height:var(--pereko-line);
}

/* Keep existing hero H1 scale exactly as designed. */
.admin-hero h1{font-family:var(--pereko-font-display)!important;}

.admin-brand b,
.panel-head h2,
.modal-card h2,
.form-section__head b,
.user-card-activity-head b,
.detail-title,
.asset-group-title,
.logged-user-meta b,
.registry-switch__button,
.metric-copy strong,
[role="dialog"] h2,
[role="dialog"] h3{
  font-family:var(--pereko-font-display)!important;
}

.admin-brand b{font-size:14px!important;font-weight:700!important;}
.admin-brand small{font-size:13px!important;line-height:1.35!important;}

.admin-hero p,
.panel-head p,
.modal-card>p,
.product-detail,
.asset-font-note,
[role="dialog"] p{
  font-family:var(--pereko-font-body)!important;
  font-size:16px!important;
  line-height:1.55!important;
}

.eyebrow,.panel-kicker{
  font-family:var(--pereko-font-display)!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:1.3!important;
  letter-spacing:.07em!important;
}

.panel-head h2,
[role="dialog"] h2{
  font-size:22px!important;
  line-height:1.25!important;
  font-weight:700!important;
  letter-spacing:-.015em!important;
}

[role="dialog"] h3{
  font-size:18px!important;
  line-height:1.3!important;
  font-weight:700!important;
}

.registry-switch__button,
.admin-context-switch a{
  font-family:var(--pereko-font-display)!important;
  font-size:14px!important;
  font-weight:600!important;
  line-height:1.2!important;
}

/* Buttons — one visual system. */
.primary-button,.secondary-button,.ghost-button,
.admin-actions a,.admin-actions button,
.mini,.doc-link,.gallery-download,
.asset-switch button,
.currency-switch button,
.hf-installer-actions button,
button.hero-action,a.hero-action,
[role="dialog"] button,
[role="dialog"] .button,
[role="dialog"] a.button{
  font-family:var(--pereko-font-display)!important;
  font-size:14px!important;
  font-weight:600!important;
  line-height:1!important;
  letter-spacing:0!important;
}

.primary-button,.secondary-button,.ghost-button,
button.hero-action,a.hero-action{
  min-height:44px;
  border-radius:9px!important;
  padding-left:16px!important;
  padding-right:16px!important;
}

.admin-actions a,.admin-actions button{
  min-height:40px;
  height:40px!important;
  border-radius:9px!important;
  padding-left:12px!important;
  padding-right:12px!important;
}

/* Every registry search follows the Rejestr ofert search geometry 1:1. */
.admin-page input[type="search"],
.admin-page .filters input[type="search"],
.admin-page .user-live-search input[type="search"],
.admin-page .hf-installer-actions input[type="search"]{
  box-sizing:border-box!important;
  width:var(--pereko-search-width)!important;
  min-width:var(--pereko-search-width)!important;
  max-width:var(--pereko-search-width)!important;
  flex:0 0 var(--pereko-search-width)!important;
  height:var(--pereko-control-height)!important;
  padding:0 11px!important;
  border:1px solid #d3dade!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#39454b!important;
  font-family:var(--pereko-font-body)!important;
  font-size:16px!important;
  font-weight:400!important;
  line-height:1.3!important;
  box-shadow:none!important;
}

.admin-page .user-live-search{
  width:var(--pereko-search-width)!important;
  min-width:var(--pereko-search-width)!important;
  flex:0 0 var(--pereko-search-width)!important;
}

.admin-page input[type="search"]::placeholder,
.admin-page .filters input[type="search"]::placeholder,
.admin-page .hf-installer-actions input[type="search"]::placeholder{
  font-family:var(--pereko-font-body)!important;
  font-size:16px!important;
  font-weight:400!important;
  color:#7c888e!important;
  opacity:1;
}

.filters select,
.form-grid input,.form-grid select,
.catalog-product-form-grid input,.catalog-product-form-grid select,.catalog-product-form-grid textarea,
[role="dialog"] input:not([type="search"]),
[role="dialog"] select,
[role="dialog"] textarea{
  font-family:var(--pereko-font-body)!important;
  font-size:16px!important;
  line-height:1.3!important;
  border-radius:9px!important;
  border-color:#d3dade!important;
  background:#fff!important;
}

.filters select,
.form-grid input,.form-grid select,
[role="dialog"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
[role="dialog"] select{
  height:var(--pereko-control-height)!important;
}

/* One registry pattern across Centrum Partnera, HeatFlow and Centrum Produktowe. */
.admin-page .registry-panel,
.admin-page .product-view>.panel,
.admin-pro-page .panel{
  margin-top:18px!important;
  border:1px solid var(--pereko-panel-line)!important;
  border-radius:var(--pereko-panel-radius)!important;
  background:#fff!important;
  box-shadow:0 10px 30px rgba(35,43,47,.035)!important;
  overflow:hidden!important;
}

.admin-page .registry-panel .panel-head,
.admin-page .product-view>.panel>.panel-head,
.admin-pro-page .panel>.panel-head,
.admin-pro-page .hf-installer-head{
  padding:21px 22px 17px!important;
  display:flex!important;
  justify-content:space-between!important;
  align-items:flex-end!important;
  gap:24px!important;
  background:#fff!important;
}

.admin-page .registry-panel .table-wrap,
.admin-page .product-view .table-wrap,
.admin-pro-page .panel .table-wrap{
  overflow:auto!important;
  border-top:1px solid #e4e8ea!important;
  background:#fff!important;
}

.admin-page .registry-panel table,
.admin-page .product-view table,
.admin-pro-page .panel table{
  width:100%!important;
  border-collapse:collapse!important;
}

.admin-page .registry-panel thead th,
.admin-page .product-view thead th,
.admin-pro-page .panel thead th{
  padding:11px 13px!important;
  text-align:left;
  background:#f6f8f8!important;
  color:#7b878d!important;
  border:0!important;
}

.admin-page .registry-panel tbody td,
.admin-page .product-view tbody td,
.admin-pro-page .panel tbody td{
  padding:13px!important;
  border-top:1px solid var(--pereko-row-line)!important;
  vertical-align:middle!important;
  background:#fff;
}

/* Tables and registries typography. */
th{
  font-family:var(--pereko-font-display)!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.3!important;
  letter-spacing:.035em!important;
}
td{
  font-family:var(--pereko-font-body)!important;
  font-size:14px!important;
  line-height:1.45!important;
}
.user-cell b,.distributor-name b,.activity b,.rank b{
  font-size:14px!important;
  line-height:1.35!important;
}
.user-cell small,.distributor-name small,.activity time,.activity small,
.branch-chip small,.doc-note{
  font-size:13px!important;
  line-height:1.35!important;
}
.role,.badge{font-size:13px!important;}

/* Metrics — label on the left, number aligned to the far right in every tile. */
.metric-copy{
  width:100%!important;
  flex:1 1 auto!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"label value" "meta value"!important;
  column-gap:16px!important;
  align-items:center!important;
}
.metric-copy small{
  font-family:var(--pereko-font-display)!important;
  font-size:13px!important;
  font-weight:600!important;
  letter-spacing:.035em!important;
  overflow:hidden;
  text-overflow:ellipsis;
}
.metric-copy strong{
  grid-area:value!important;
  justify-self:end!important;
  font-size:24px!important;
  font-weight:700!important;
  line-height:1!important;
  text-align:right!important;
}
.metric-copy em{font-size:13px!important;}
.metric-copy--expandable{
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"label value" "meta value"!important;
  column-gap:16px!important;
  align-items:center!important;
}
.metric-copy--expandable .metric-value-row{
  grid-area:value!important;
  justify-self:end!important;
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  min-height:30px!important;
  line-height:1!important;
}
.metric-copy--expandable .metric-value-row strong{
  display:block!important;
  line-height:1!important;
}
.metric-copy--expandable .metric-breakdown{
  margin:0!important;
  align-self:center!important;
}
.metric-copy--expandable .metric-breakdown summary{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:24px!important;
}

.logged-user-meta b{font-size:14px!important;font-weight:700!important;}
.logged-user-meta small{font-size:13px!important;line-height:1.35!important;}

.detail-title,.asset-group-title{font-size:18px!important;font-weight:700!important;}
.asset-table td,.detail-table td{font-size:14px!important;}
.asset-table th,.detail-table th{font-size:13px!important;}

/* Modals opened from Podgląd, Akcja, user cards, import and HeatFlow. */
.modal-card,
.hf-installer-modal__dialog,
[role="dialog"]{
  font-family:var(--pereko-font-body)!important;
  font-size:16px!important;
  line-height:1.5!important;
}

.modal-card label,
.form-grid label,
.form-grid label span,
[role="dialog"] label,
[role="dialog"] label span,
[role="dialog"] small,
[role="dialog"] .form-message,
[role="dialog"] .help-text{
  font-family:var(--pereko-font-body)!important;
  font-size:14px!important;
  line-height:1.4!important;
}

.modal-card b,
[role="dialog"] b,
[role="dialog"] strong{
  font-family:var(--pereko-font-display)!important;
}

.filters,.hf-installer-actions{align-items:center;}

@media(max-width:1000px){
  .admin-page .registry-panel .panel-head,
  .admin-page .product-view>.panel>.panel-head,
  .admin-pro-page .panel>.panel-head,
  .admin-pro-page .hf-installer-head{align-items:flex-start!important;flex-direction:column!important;}
}

@media(max-width:680px){
  body.admin-page{font-size:15px;}
  .admin-hero p,.panel-head p{font-size:15px!important;}
  .admin-page input[type="search"],
  .admin-page .filters input[type="search"],
  .admin-page .user-live-search,
  .admin-page .user-live-search input[type="search"],
  .admin-page .hf-installer-actions input[type="search"]{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    flex:1 1 auto!important;
    font-size:15px!important;
  }
  th{font-size:12px!important;}
  td{font-size:13.5px!important;}
}
