/* Společný vizuální systém /firma/ — tokeny + primitiva.
   Není to nový framework: feature CSS (hp-fd, hp-inzerat, hp-k, hp-prem, hp-ao)
   si tokeny bere odtud. Root je 16 px (body 14 px rem nemění). */

.hp-firma-ui {
  --hp-ink: #334552;
  --hp-muted: #5b6573;
  --hp-surface: #f7f8fa;
  --hp-card: #fff;
  --hp-border: #e3e7ee;
  --hp-brand: #2aadde;
  --hp-brand-ink: #0f5f82;
  --hp-danger: #a8354c;
  --hp-radius: 6px;
  --hp-callout-bg: #e8f6fb;
  --hp-callout-border: #9ad4ee;
  --hp-premium-bg: #fff8e0;
  --hp-premium-border: #ecd08a;
  --hp-premium-ink: #3f2200;
  --hp-font: 1.25rem;
  --hp-font-sm: 1.125rem;
  --hp-font-lg: 1.5rem;
  --hp-firma-content-max: none;
  color: var(--hp-ink);
  font-size: var(--hp-font);
  line-height: 1.5;
}

.hp-firma-ui .page-content {
  max-width: var(--hp-firma-content-max);
  float: none;
  width: 100%;
}

.hp-firma-ui .col-sm-8.page-content {
  width: 100%;
}

/* Callout — místo Bootstrap .alert-info (špatný kontrast na /firma/) */
.hp-firma-ui .hp-firma-callout,
.hp-firma-callout {
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--hp-callout-border, #9ad4ee);
  border-radius: var(--hp-radius, 6px);
  background: var(--hp-callout-bg, #e8f6fb);
  color: var(--hp-brand-ink, #0f5f82);
}

.hp-firma-callout p,
.hp-firma-ui .hp-firma-callout p {
  margin: 0 0 0.4rem;
  color: inherit;
  font-size: 1.125rem;
  line-height: 1.45;
}

.hp-firma-callout p:last-child,
.hp-firma-ui .hp-firma-callout p:last-child {
  margin-bottom: 0;
}

.hp-firma-callout a {
  color: var(--hp-brand-ink, #0f5f82);
  font-weight: 700;
}

.hp-firma-callout h6,
.hp-firma-callout .hp-firma-callout__title {
  margin: 0 0 0.35rem;
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--hp-ink, #334552);
}

/* Buttons */
.hp-firma-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: var(--hp-radius, 6px);
  background: #fff;
  color: var(--hp-ink, #334552);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.hp-firma-btn:hover,
.hp-firma-btn:focus-visible {
  border-color: #c5ccd8;
  background: #f8fafc;
  color: var(--hp-ink, #334552);
  text-decoration: none;
}

.hp-firma-btn--quiet {
  background: #fff;
  font-weight: 600;
}

.hp-firma-btn--primary {
  border-color: #e31c3d;
  background: #e31c3d;
  color: #fff;
}

.hp-firma-btn--primary:hover,
.hp-firma-btn--primary:focus-visible {
  border-color: #c71836;
  background: #c71836;
  color: #fff;
}

.hp-firma-btn--premium {
  border-color: var(--hp-premium-border, #ecd08a);
  background: var(--hp-premium-bg, #fff8e0);
  color: var(--hp-premium-ink, #3f2200);
}

.hp-firma-btn--premium:hover,
.hp-firma-btn--premium:focus-visible {
  border-color: #d4a017;
  background: #fff3c4;
  color: var(--hp-premium-ink, #3f2200);
}

/* Chip choice (úvazek / směnnost) */
.hp-firma-chip-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-firma-chip-choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 999px;
  background: #fff;
  color: var(--hp-ink, #334552);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
}

.hp-firma-chip-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hp-firma-chip-choice label:has(input:checked) {
  border-color: var(--hp-brand, #2aadde);
  background: #eef8fc;
  color: var(--hp-brand-ink, #0f5f82);
  box-shadow: 0 0 0 1px var(--hp-brand, #2aadde);
}

.hp-firma-chip-choice label:hover {
  border-color: #c5ccd8;
}

/* Filter bar */
.hp-firma-filter-wrap {
  margin: 0 0 1rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: var(--hp-radius, 6px);
  background: #fff;
}

.hp-firma-filter-wrap__summary {
  display: none;
  list-style: none;
}

.hp-firma-filter-wrap__summary::-webkit-details-marker {
  display: none;
}

.hp-firma-filter {
  margin: 0;
  padding: 0.7rem 0.85rem 0.55rem;
  border: 0;
  background: transparent;
}

.hp-firma-filter__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.hp-firma-ui .page-content p.hp-firma-filter__pole {
  margin: 0;
  min-width: 0;
}

.hp-firma-filter__pole--q {
  flex: 1.4 1 0;
}

.hp-firma-filter__pole--obec {
  flex: 0.85 1 0;
}

.hp-firma-filter__pole--sort {
  flex: 1 1 0;
}

.hp-firma-ui .page-content .hp-firma-filter label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--hp-muted, #5b6573);
}

.hp-firma-filter input,
.hp-firma-filter select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 1.125rem;
  color: var(--hp-ink, #334552);
}

.hp-firma-filter.is-enhanced .hp-firma-filter__submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hp-firma-filter__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.2rem 1.1rem;
  margin: 0.45rem 0 0;
}

.hp-firma-filter__more {
  flex: 1 1 12rem;
  margin: 0;
  min-width: 0;
}

.hp-firma-filter__more > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--hp-brand-ink, #0f5f82);
  list-style: none;
}

.hp-firma-filter__more > summary::-webkit-details-marker,
.hp-firma-filter__more > summary::marker {
  display: none;
  content: none;
}

.hp-firma-filter__more-label {
  text-decoration: underline;
  text-decoration-color: rgba(15, 95, 130, 0.38);
  text-underline-offset: 0.18em;
}

.hp-firma-filter__more > summary::after {
  content: "▾";
  font-size: 0.95em;
  font-weight: 700;
  color: inherit;
  opacity: 0.7;
}

.hp-firma-filter__more[open] > summary::after {
  content: "▴";
}

.hp-firma-filter__more > summary:hover,
.hp-firma-filter__more > summary:focus-visible {
  color: #0c4a66;
}

.hp-firma-filter__more > summary:hover .hp-firma-filter__more-label,
.hp-firma-filter__more > summary:focus-visible .hp-firma-filter__more-label {
  text-decoration-color: currentColor;
}

.hp-firma-ui .page-content a.hp-firma-filter__reset {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--hp-muted, #5b6573);
  text-decoration: underline;
  text-decoration-color: rgba(91, 101, 115, 0.45);
  text-underline-offset: 0.18em;
}

.hp-firma-ui .page-content a.hp-firma-filter__reset:hover,
.hp-firma-ui .page-content a.hp-firma-filter__reset:focus-visible {
  color: var(--hp-ink, #334552);
  text-decoration-color: currentColor;
}

.hp-firma-filter__more-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e8f6fb;
  color: var(--hp-brand-ink, #0f5f82);
  font-size: 0.9375rem;
  font-weight: 800;
}

.hp-firma-filter__more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem 0.6rem;
  align-items: end;
  margin: 0.55rem 0 0.15rem;
}

.hp-firma-filter__akce {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.hp-firma-filter__akce--more {
  grid-column: 1 / -1;
}

.hp-firma-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 1rem 0 0;
}

.hp-firma-pager a,
.hp-firma-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 4px;
  background: #fff;
  color: var(--hp-ink, #334552);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
}

.hp-firma-pager a:hover {
  background: #f8fafc;
  text-decoration: none;
}

.hp-firma-pager .is-active {
  border-color: var(--hp-brand, #2aadde);
  background: #eef8fc;
  color: var(--hp-brand-ink, #0f5f82);
}

@media (max-width: 767px) {
  .hp-firma-filter-wrap__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hp-ink, #334552);
    cursor: pointer;
  }

  .hp-firma-filter-wrap__summary::after {
    content: "▾";
    flex: 0 0 auto;
    color: var(--hp-muted, #5b6573);
  }

  .hp-firma-filter-wrap[open] > .hp-firma-filter-wrap__summary::after {
    content: "▴";
  }

  .hp-firma-filter {
    padding: 0.65rem 0.85rem 0.7rem;
    border-top: 1px solid var(--hp-border, #e3e7ee);
  }

  .hp-firma-filter__row {
    flex-wrap: wrap;
  }

  .hp-firma-filter__pole--q {
    flex: 1 1 100%;
  }

  .hp-firma-filter__pole--obec,
  .hp-firma-filter__pole--sort {
    flex: 1 1 0;
  }

  .hp-firma-filter__more-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hp-firma-stats-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  background: #fff;
}

.hp-firma-stats-table th,
.hp-firma-stats-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--hp-border, #e3e7ee);
  text-align: left;
  font-size: 1.125rem;
}

.hp-firma-stats-table th {
  font-weight: 800;
  color: var(--hp-muted, #5b6573);
  background: #f7f8fa;
}

.hp-firma-stats-table th.num a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.hp-firma-stats-table th.num a:hover,
.hp-firma-stats-table th.num a:focus-visible {
  color: var(--hp-brand-ink, #0f5f82);
  text-decoration: underline;
}

.hp-firma-stats-table th.is-sorted a::after {
  content: " ↓";
  font-weight: 700;
}

.hp-firma-stats-table th.is-sorted.is-asc a::after {
  content: " ↑";
}

.hp-firma-stats-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: end;
  margin: 0 0 1rem;
}

.hp-firma-stats-form label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hp-muted, #5b6573);
}

.hp-firma-stats-form input[type="date"] {
  min-height: 40px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 4px;
  font: inherit;
}

.hp-firma-stats-presets {
  margin: 0 0 0.75rem;
}

.hp-firma-stats-presets a.is-active {
  font-weight: 800;
}

.hp-firma-stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.hp-firma-stats-kpi {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: var(--hp-radius, 6px);
  background: #fff;
}

.hp-firma-stats-kpi__label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hp-muted, #5b6573);
}

.hp-firma-stats-kpi__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--hp-ink, #334552);
}

.hp-firma-stats-charts {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.hp-firma-stats-chart {
  position: relative;
  height: 11rem;
  padding: 0.45rem 0.7rem 0.25rem;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: var(--hp-radius, 6px);
  background: #fff;
}

@media (max-width: 767px) {
  .hp-firma-stats-kpis {
    grid-template-columns: 1fr;
  }

  .hp-firma-stats-chart {
    height: 10rem;
  }
}
