/* ==========================================================================
   Browse Companies (/companies) — company/listing.blade.php + company/listing/*
   Follows the Followed Companies starter package ("Browse Companies" screens)
   on the Workafy tokens from workafy-ui.css. Scoped under .wf-cos so legacy
   main.css / style.css rules cannot leak in.
   ========================================================================== */

.wf-cos { background: #fff; color: var(--wf-text); font-family: var(--wf-font); }
.wf-cos *, .wf-cos *::before, .wf-cos *::after { box-sizing: border-box; }
.wf-cos h1, .wf-cos h2, .wf-cos h3, .wf-cos p { margin: 0; }
.wf-cos ul { list-style: none; margin: 0; padding: 0; }
.wf-cos a { text-decoration: none; }
.wf-cos-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wf-cos-muted { color: #4b5563; font-size: 13.5px; margin-top: 2px !important; }
.wf-cos-link { color: var(--wf-green) !important; font-size: 13px; font-weight: 600; }
.wf-cos-link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.wf-cos-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 0 13px; border-radius: 7px; border: 1px solid transparent;
  font: 700 13.5px/1 var(--wf-font); white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.wf-cos-btn:focus-visible { outline: 0; box-shadow: var(--wf-focus); }
.wf-cos-btn[hidden] { display: none; }
.wf-cos-btn--primary { background: var(--wf-green); border-color: var(--wf-green); color: #fff !important; }
.wf-cos-btn--primary:hover { background: var(--wf-green-dark); border-color: var(--wf-green-dark); }
.wf-cos-btn--outline { background: #fff; border-color: var(--wf-green); color: var(--wf-green) !important; }
.wf-cos-btn--outline:hover { background: var(--wf-green-soft); }
.wf-cos-btn--ghost { background: #fff; border-color: var(--wf-line); color: var(--wf-ink) !important; }
.wf-cos-btn--ghost:hover { border-color: #cbd5e1; background: var(--wf-surface); }
.wf-cos-btn--soft { background: var(--wf-green-soft); border-color: var(--wf-green-line); color: var(--wf-green-dark) !important; }
.wf-cos-btn--soft:hover { border-color: var(--wf-green); }
.wf-cos-btn--danger { background: var(--wf-danger); border-color: var(--wf-danger); color: #fff !important; }
.wf-cos-btn--danger:hover { background: var(--wf-danger-text); }
.wf-cos-btn--block { display: flex; width: 100%; min-height: 42px; }
.wf-cos-btn.is-busy { opacity: .6; pointer-events: none; }

/* ---------- Hero ---------- */
.wf-cos-hero { background: linear-gradient(180deg, #f7f9fb 0%, #f3f6f8 100%); border-bottom: 1px solid var(--wf-line); padding: 44px 0 34px; text-align: center; }
.wf-cos-hero h1 { font-size: 36px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; color: var(--wf-ink); }
.wf-cos-hero__sub { margin-top: 12px !important; font-size: 15px; color: var(--wf-text); }
.wf-cos-search {
  max-width: 960px; margin: 26px auto 0; display: flex; align-items: center; background: #fff;
  border: 1px solid var(--wf-line-soft); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .07); padding: 8px 8px 8px 0;
}
.wf-cos label.wf-cos-search__field { position: relative; display: flex; align-items: center; gap: 12px; flex: 1 1 0; min-width: 0; height: 40px; margin: 0; padding: 0 18px 0 22px; font-weight: 400; color: var(--wf-ink); }
.wf-cos label.wf-cos-search__field--q { flex-grow: 1; }
.wf-cos label.wf-cos-search__field--select { flex: 0 1 205px; }
.wf-cos-search__field + .wf-cos-search__field { border-left: 1px solid var(--wf-line); }
.wf-cos-search__field > i:first-child { width: 18px; flex: none; text-align: center; font-size: 16px; color: #1f2937; }
.wf-cos-search__field input, .wf-cos-search__field select {
  flex: 1; min-width: 0; height: 40px; margin: 0; padding: 0 !important; border: 0 !important; outline: 0; box-shadow: none !important;
  background: transparent !important; font: 400 15px var(--wf-font); color: var(--wf-ink); -webkit-appearance: none; appearance: none;
}
.wf-cos-search__field input::placeholder { color: #6b7280; opacity: 1; }
.wf-cos-search__field select { cursor: pointer; padding-right: 22px !important; color: #374151; text-overflow: ellipsis; }
.wf-cos-search__chev { position: absolute; right: 18px; font-size: 12px; color: #4b5563; pointer-events: none; }
.wf-cos-search__submit { flex: none; min-height: 44px; padding: 0 20px; border-radius: 8px; font-size: 14.5px; font-weight: 600; }

/* ---------- Stats ---------- */
.wf-cos-body { padding-top: 26px; padding-bottom: 56px; }
.wf-cos-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.wf-cos-stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: #fff; border: 1px solid var(--wf-line); border-radius: 12px; box-shadow: var(--wf-shadow-xs); }
.wf-cos-stat strong { font-size: 28px; line-height: 1.15; font-weight: 800; color: var(--wf-ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wf-cos-stat > span:last-child { font-size: 14px; color: #4b5563; font-weight: 500; }
.wf-cos-stat__icon { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--wf-green-soft); color: var(--wf-green); font-size: 14px; }

/* ---------- Toolbar ---------- */
.wf-cos-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 30px 0 16px; flex-wrap: wrap; }
.wf-cos-count { font-size: 20px; font-weight: 700; color: var(--wf-ink); }
.wf-cos-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wf-cos-seg { display: inline-flex; padding: 3px; background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: 9px; }
.wf-cos-seg a { padding: 0 12px; height: 30px; display: inline-flex; align-items: center; border-radius: 6px; font-size: 13px; font-weight: 600; color: #4b5563 !important; white-space: nowrap; }
.wf-cos-seg a:hover { color: var(--wf-ink) !important; }
.wf-cos-seg a.is-active { background: #fff; color: var(--wf-green-dark) !important; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.wf-cos label.wf-cos-sort { margin: 0; font-weight: 400; }
.wf-cos-select { position: relative; display: inline-flex; }
.wf-cos-select select {
  height: 38px; min-width: 196px; padding: 0 34px 0 13px !important; border: 1px solid var(--wf-line) !important; border-radius: 8px !important;
  background: #fff !important; font: 500 13px var(--wf-font); color: var(--wf-ink); -webkit-appearance: none; appearance: none; cursor: pointer; box-shadow: none !important;
}
.wf-cos-select select:focus { outline: 0; border-color: var(--wf-green) !important; box-shadow: var(--wf-focus) !important; }
.wf-cos-select i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #4b5563; pointer-events: none; }
.wf-cos-tools .wf-cos-btn { min-height: 38px; }
.wf-cos-tools .wf-cos-btn i { color: var(--wf-green); }

.wf-cos-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 16px; }
.wf-cos-chip { display: inline-flex; align-items: center; gap: 10px; height: 30px; padding: 0 12px; border-radius: 6px; background: var(--wf-green-soft); border: 1px solid var(--wf-green-line); color: var(--wf-green-dark) !important; font-size: 13px; font-weight: 600; }
.wf-cos-chip:hover { border-color: var(--wf-green); }
.wf-cos-chips .wf-cos-link { margin-left: 6px; font-weight: 500; }

/* ---------- Company card ---------- */
.wf-cos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wf-co {
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 18px; background: #fff;
  border: 1px solid var(--wf-line); border-radius: 14px; box-shadow: var(--wf-shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.wf-co:hover { border-color: #d6dde6; box-shadow: 0 10px 26px rgba(15, 23, 42, .07); }
.wf-co__logo { width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; border: 1px solid transparent; }
.wf-co__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.wf-co__logo:has(img) { border-color: var(--wf-line); }
.wf-co__logo span { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.wf-co__logo--green { background: var(--wf-green-soft); color: var(--wf-green-dark); }
.wf-co__logo--purple { background: #f3e8ff; color: #7c3aed; }
.wf-co__logo--blue { background: #e8f0ff; color: #1d4ed8; }
.wf-co__logo--amber { background: #fff4e5; color: #b45309; }
.wf-co__body { min-width: 0; }
.wf-co__name { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 2px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.wf-co__name a { color: var(--wf-ink) !important; }
.wf-co__name a:hover { color: var(--wf-green) !important; }
.wf-co__verified { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--wf-green); }
.wf-co__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wf-green); }
.wf-co__meta { margin-top: 4px !important; font-size: 13.5px; color: #4b5563; line-height: 1.4; }
.wf-co__meta + .wf-co__meta { margin-top: 3px !important; }
.wf-co__pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px !important; }
.wf-co__pills li { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 11px; border: 1px solid var(--wf-line); border-radius: 9px; background: #fff; line-height: 1.25; }
.wf-co__pills strong { font-size: 14px; font-weight: 700; color: var(--wf-ink); }
.wf-co__pills span { font-size: 12px; color: #374151; }
.wf-co__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Pagination ---------- */
.wf-cos-pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.wf-cos-pager__page, .wf-cos-pager__step {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--wf-line); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 500; color: var(--wf-ink) !important;
}
.wf-cos-pager__step { padding: 0 14px; min-width: 84px; }
.wf-cos-pager__step i { font-size: 10px; }
.wf-cos-pager a:hover { border-color: var(--wf-green); color: var(--wf-green) !important; }
.wf-cos-pager__page.is-current { background: var(--wf-green); border-color: var(--wf-green); color: #fff !important; font-weight: 700; }
.wf-cos-pager__step.is-disabled { color: #b8c0cc !important; }
.wf-cos-pager__gap { color: var(--wf-muted); }

/* ---------- Empty state ---------- */
.wf-cos-empty { padding: 52px 24px; text-align: center; border: 1px solid var(--wf-line); border-radius: 14px; background: #fff; }
.wf-cos-empty__icon { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--wf-green-soft); color: var(--wf-green); font-size: 30px; }
.wf-cos-empty h3 { font-size: 20px; font-weight: 700; color: var(--wf-ink); }
.wf-cos-empty p { margin: 10px auto 0 !important; max-width: 460px; font-size: 14px; color: #4b5563; line-height: 1.6; }
.wf-cos-empty__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.wf-cos-empty__actions .wf-cos-btn { min-height: 42px; padding: 0 22px; }

/* ---------- Modals & toast ---------- */
.wf-cos-modal { position: fixed; inset: 0; z-index: 1060; display: grid; place-items: center; padding: 16px; background: rgba(7, 20, 33, .48); }
.wf-cos-modal[hidden] { display: none; }
.wf-cos-modal__dialog { position: relative; width: 100%; max-width: 420px; padding: 32px 28px 26px; background: #fff; border-radius: 16px; box-shadow: var(--wf-shadow-lg); text-align: center; }
.wf-cos-modal__close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--wf-muted); font-size: 18px; cursor: pointer; }
.wf-cos-modal__close:hover { background: var(--wf-surface); color: var(--wf-ink); }
.wf-cos-modal__icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--wf-green-soft); color: var(--wf-green); font-size: 21px; }
.wf-cos-modal__icon--warn { background: var(--wf-danger-soft); color: var(--wf-danger); }
.wf-cos-modal h2 { font-size: 19px; font-weight: 700; color: var(--wf-ink); }
.wf-cos-modal p { margin-top: 8px !important; font-size: 14px; color: #4b5563; line-height: 1.55; }
.wf-cos-modal__actions { display: grid; gap: 10px; margin-top: 22px; }
.wf-cos-modal__actions--row { grid-template-columns: 1fr 1fr; }
.wf-cos-modal__actions .wf-cos-btn { min-height: 42px; }
.wf-cos-alert-form { margin-top: 18px; display: grid; gap: 12px; text-align: left; }
.wf-cos label.wf-cos-field { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: var(--wf-ink); }
.wf-cos-field input { height: 42px; padding: 0 12px !important; border: 1px solid var(--wf-input-line) !important; border-radius: 8px !important; font: 400 14px var(--wf-font); box-shadow: none !important; }
.wf-cos-field input:focus { outline: 0; border-color: var(--wf-green) !important; box-shadow: var(--wf-focus) !important; }
.wf-cos-error { color: var(--wf-danger-text); font-size: 12.5px; }
.wf-cos-toast { position: fixed; left: 50%; bottom: 28px; z-index: 1070; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px; background: var(--wf-dark); color: #fff; font: 500 14px var(--wf-font); box-shadow: var(--wf-shadow-lg); }
body.wf-cos-lock { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wf-cos-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .wf-cos-hero { padding: 30px 0 24px; }
  .wf-cos-hero h1 { font-size: 28px; }
  .wf-cos-search { flex-wrap: wrap; padding: 8px; }
  .wf-cos label.wf-cos-search__field { flex: 1 1 100%; height: 46px; padding: 0 12px; }
  .wf-cos-search__field + .wf-cos-search__field { border-left: 0; border-top: 1px solid var(--wf-line); }
  .wf-cos-search__chev { right: 12px; }
  .wf-cos-search__submit { flex: 1 1 100%; margin-top: 8px; min-height: 46px; }
  .wf-cos-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wf-cos-wrap { padding: 0 16px; }
  .wf-cos-hero h1 { font-size: 25px; }
  .wf-cos-hero__sub { font-size: 14px; }
  .wf-cos-stats { gap: 10px; }
  .wf-cos-stat { padding: 14px; }
  .wf-cos-stat strong { font-size: 22px; }
  .wf-cos-stat > span:last-child { font-size: 12.5px; }
  .wf-cos-stat__icon { width: 28px; height: 28px; top: 12px; right: 12px; font-size: 12px; }
  .wf-cos-toolbar { margin-top: 22px; }
  .wf-cos-tools { width: 100%; }
  .wf-cos-seg { width: 100%; }
  .wf-cos-seg a { flex: 1; justify-content: center; padding: 0 6px; }
  .wf-cos-sort, .wf-cos-select, .wf-cos-select select { width: 100%; }
  .wf-co { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .wf-co__logo { width: 46px; height: 46px; border-radius: 10px; }
  .wf-co__logo span { font-size: 16px; }
  .wf-co__name { font-size: 16px; }
  .wf-co__pills { gap: 8px; }
  .wf-co__pills li { flex: 1 1 0; min-width: 0; padding: 6px 9px; }
  .wf-co__actions .wf-cos-btn { flex: 1 1 auto; }
  .wf-cos-pager__step { min-width: 0; }
}
