/* Firemní administrace /{admin}/ — JobsTrail dodatky k portu HitPrace /firma/
   (jt-firma-ui.css, jt-firma-dashboard.css, jt-kandidati.css, jt-inzerat-form.css, company-admin-nav.css).
   Tokeny --hp-* definuje .hp-firma-ui v jt-firma-ui.css; DS je přemapuje pod body.hp-ds--firma.
   Root 62.5 % (1rem = 10px) jako na HitPrace. */

/* ---------- Chrome + tokeny ---------- */

body.hp-ds--firma.hp-firma-ui {
  --hp-brand: var(--hp-ds-color-brand, #1d8eb8);
  --hp-brand-ink: var(--hp-ds-color-link, #0f5f82);
  --hp-border: var(--hp-ds-color-border, #e3e7ee);
  --hp-surface: var(--hp-ds-color-page, #f7f8fa);
  --hp-radius: var(--hp-ds-radius-sm, 8px);
}

.hp-firma-ui #page-content.hp-firma-page {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.hp-firma-ui .hp-firma-content {
  padding-top: 0;
}

/* Chip menu nad obsahem: stejný vnitřní okraj jako karty */
.hp-firma-ui .company-admin-nav {
  margin-top: 14px;
}

/* ---------- Flash ---------- */

.hp-firma-ui .hp-fd-saved--error {
  border-color: #f3c0c0;
  background: #fff2f2;
}

.hp-firma-ui .hp-fd-saved--error .hp-fd-saved__title {
  color: var(--hp-danger, #a8354c);
}

/* ---------- KPI s jednou kartou (kredity, statistiky) ---------- */

.hp-firma-ui .hp-fd-stats--one {
  grid-template-columns: minmax(0, 1fr);
}

.hp-firma-ui .hp-fd-stats--one .hp-fd-stats__link {
  cursor: default;
}

/* ---------- Checklist jako jediný nástroj ---------- */

.hp-firma-ui .hp-fd-tools__grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.hp-firma-ui .hp-fd-check__item a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(51, 69, 82, 0.35);
}

.hp-firma-ui .hp-fd-check__item.is-done a {
  text-decoration: none;
}

/* ---------- Obecná karta pro legacy stránky (kredity, ověřený zaměstnavatel, statistiky) ---------- */

.hp-firma-ui .hp-firma-card {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.4rem 1.4rem;
  background: var(--hp-card, #fff);
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: var(--hp-radius, 8px);
}

.hp-firma-ui .hp-firma-card .hp-fd-section-title {
  margin: 0 0 0.75rem;
}

.hp-firma-ui .hp-firma-card p {
  margin: 0 0 0.75rem;
  font-size: var(--hp-font, 1.25rem);
  line-height: 1.5;
}

.hp-firma-ui .hp-firma-card__h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: var(--hp-font-lg, 1.5rem);
  font-weight: 700;
  color: var(--hp-ink, #334552);
}

.hp-firma-ui .hp-firma-card--hero {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.hp-firma-ui .hp-firma-card__logo {
  flex: 0 0 110px;
  width: 110px;
  height: auto;
  padding: 4px;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 6px;
  background: #fff;
}

.hp-firma-ui .hp-firma-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.hp-firma-ui .hp-firma-cols {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.hp-firma-ui .hp-firma-cols .hp-firma-card {
  margin: 0;
}

.hp-firma-ui .hp-firma-code {
  min-height: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
}

/* ---------- Jednořádkový formulář (voucher, backlink) ---------- */

.hp-firma-ui .hp-firma-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.5rem 0 0;
}

.hp-firma-ui .hp-firma-inline-form .hp-inzerat-input {
  flex: 1 1 260px;
  width: auto;
  max-width: 420px;
  margin: 0;
}

/* ---------- Tabulka (historie kreditů, statistiky) ---------- */

.hp-firma-ui .hp-firma-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--hp-font, 1.25rem);
}

.hp-firma-ui .hp-firma-table th,
.hp-firma-ui .hp-firma-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--hp-border, #e3e7ee);
  text-align: left;
  vertical-align: top;
}

.hp-firma-ui .hp-firma-table th {
  font-size: var(--hp-font-sm, 1.125rem);
  font-weight: 700;
  color: var(--hp-muted, #5b6573);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hp-firma-ui .hp-firma-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hp-firma-ui .hp-firma-table .is-plus {
  color: #2f9e63;
  font-weight: 700;
}

.hp-firma-ui .hp-firma-table .is-minus {
  color: var(--hp-danger, #a8354c);
  font-weight: 700;
}

/* ---------- Výhody (ověřený zaměstnavatel) ---------- */

.hp-firma-ui .hp-firma-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem 1.25rem;
}

.hp-firma-ui .hp-firma-benefits li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--hp-font, 1.25rem);
  line-height: 1.4;
}

.hp-firma-ui .hp-firma-benefits img {
  flex: 0 0 48px;
  width: 48px;
  height: auto;
  border-radius: 6px;
}

/* ---------- Období (statistiky) ---------- */

.hp-firma-ui .hp-firma-period {
  margin: 0 0 1rem;
}

.hp-firma-ui .hp-firma-chart {
  position: relative;
  width: 100%;
}

/* ---------- Logo v profilu ---------- */

.hp-firma-ui .hp-firma-logo-preview {
  max-width: 180px;
  height: auto;
  padding: 4px;
  border: 1px solid var(--hp-border, #e3e7ee);
  border-radius: 6px;
  background: #fff;
}

/* ---------- Typeahead města ve formuláři inzerátu ---------- */

.hp-firma-ui .hp-inzerat-typeahead {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
}

.hp-firma-ui .hp-inzerat-typeahead .u-posRelative {
  width: 100% !important;
}

.hp-firma-ui .hp-inzerat-typeahead .u-posRelative {
  position: relative;
}

.hp-firma-ui .hp-inzerat-typeahead .Typeahead-hint,
.hp-firma-ui .hp-inzerat-typeahead .Typeahead-input {
  width: 100%;
  box-sizing: border-box;
}

.hp-firma-ui .hp-inzerat-typeahead .Typeahead-hint {
  position: absolute;
  top: 0;
  left: 0;
  color: #999;
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

.hp-firma-ui .hp-inzerat-typeahead .Typeahead-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
}

/* ---------- Filtr kandidátů: checkbox jako položka řádku ---------- */

.hp-firma-ui .hp-k-filters {
  margin: 0 0 1rem;
}

.hp-firma-ui .hp-firma-filter__pole--check {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.35rem;
}

.hp-firma-ui .hp-firma-filter__pole--check .hp-inzerat-check {
  margin: 0;
}

/* ---------- Přihlášení: výhody bez obrázků ---------- */

.hp-fl-why__ico {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f6fb;
  color: #1d8eb8;
  font-weight: 800;
  font-size: 1.4rem;
}

.hp-fl-page .hp-fl-note p {
  margin: 0;
}

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

  .hp-firma-ui .hp-firma-card--hero {
    flex-direction: column;
  }
}

/* ---------- Chip menu: jeden řádek na celou šířku bloku (parita HitPrace hp-firma-type.css), plné názvy od 1200 px ---------- */

@media (min-width: 992px) {
  body.hp-firma-ui .company-admin-nav,
  body.hp-firma-ui .company-admin-nav__box,
  body.hp-firma-ui .company-admin-nav__scroll {
    width: 100%;
  }

  body.hp-firma-ui .company-admin-nav__box {
    padding: 8px;
  }

  body.hp-firma-ui .company-admin-nav__scroll {
    flex-wrap: nowrap;
    column-gap: 8px;
  }

  body.hp-firma-ui .company-admin-nav__item {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    padding: 0 12px;
    font-size: 15px;
  }

  body.hp-firma-ui .company-admin-nav__label-full {
    display: none;
  }

  body.hp-firma-ui .company-admin-nav__label-short {
    display: inline;
  }
}

@media (min-width: 1200px) {
  body.hp-firma-ui .company-admin-nav__label-full {
    display: inline;
  }

  body.hp-firma-ui .company-admin-nav__label-short {
    display: none;
  }
}

/* ---------- Statistiky /{admin}/stats/ (port HitPrace hp-firma-ui.css hp-firma-stats-*) ---------- */

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

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

.hp-firma-ui .hp-firma-stats-form p {
  margin: 0;
}

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

.hp-firma-ui .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-ui .hp-firma-stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.hp-firma-ui .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-ui .hp-firma-stats-kpi__label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 15px;
  font-weight: 700;
  color: var(--hp-muted, #5b6573);
}

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

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

.hp-firma-ui .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;
}

.hp-firma-ui .hp-firma-stats-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

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

.hp-firma-ui .hp-firma-stats-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

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

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

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

.hp-firma-ui .hp-firma-stats-table .hp-firma-stats-ext {
  white-space: normal;
  font-size: 14px;
  color: var(--hp-muted, #5b6573);
}

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

  .hp-firma-ui .hp-firma-stats-kpi {
    padding: 0.6rem 0.65rem;
  }

  .hp-firma-ui .hp-firma-stats-kpi__value {
    font-size: 22px;
  }

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

  .hp-firma-ui .hp-firma-stats-table th,
  .hp-firma-ui .hp-firma-stats-table td {
    padding: 0.55rem 0.5rem;
    font-size: 15px;
  }
}

/* Statistiky na mobilu: řádek tabulky = karta (název přes celou šířku, pod ním 3 čísla s popiskem), hlavička = lišta řazení */
@media (max-width: 767px) {
  .hp-firma-ui .hp-firma-stats-wrap {
    overflow: visible;
  }

  .hp-firma-ui .hp-firma-stats-table,
  .hp-firma-ui .hp-firma-stats-table tbody {
    display: block;
  }

  .hp-firma-ui .hp-firma-stats-table thead,
  .hp-firma-ui .hp-firma-stats-table thead tr {
    display: block;
  }

  .hp-firma-ui .hp-firma-stats-table thead tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #f7f8fa;
  }

  .hp-firma-ui .hp-firma-stats-table thead th:first-child {
    display: none;
  }

  .hp-firma-ui .hp-firma-stats-table thead th,
  .hp-firma-ui .hp-firma-stats-table thead th.num {
    text-align: center;
    font-size: 14px;
    padding: 0.5rem 0.25rem;
    border-bottom: 0;
  }

  .hp-firma-ui .hp-firma-stats-table thead th.num a {
    white-space: normal;
  }

  .hp-firma-ui .hp-firma-stats-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.7rem 0 0.6rem;
    border-bottom: 1px solid var(--hp-border, #e3e7ee);
  }

  .hp-firma-ui .hp-firma-stats-table tbody td {
    display: block;
    padding: 0.15rem 0.25rem;
    border-bottom: 0;
  }

  .hp-firma-ui .hp-firma-stats-table tbody td.hp-firma-stats-job,
  .hp-firma-ui .hp-firma-stats-table tbody tr.hp-firma-stats-empty td {
    grid-column: 1 / -1;
    padding-bottom: 0.4rem;
  }

  .hp-firma-ui .hp-firma-stats-table tbody td.num {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
  }

  .hp-firma-ui .hp-firma-stats-table tbody td.num::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--hp-muted, #5b6573);
  }

  .hp-firma-ui .hp-firma-stats-table tbody td.hp-firma-stats-ext {
    font-size: 13px;
    font-weight: 400;
  }
}
