/* Diretório de empresas: identidade de campo, superfícies neutras e dados legíveis. */
.company-directory-heading { margin-bottom: 28px; }
.company-directory-heading .eyebrow { margin: 0 0 8px; font-size: .8rem; }
.company-directory-heading h1 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 650; line-height: 1.15; }
.company-directory-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); }
.company-search { display: block; padding: 20px 24px; margin-bottom: 32px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.company-search label { display: block; margin-bottom: 8px; font-size: .85rem; font-weight: 600; color: var(--ink); }
.company-search-controls { display: flex; align-items: center; gap: 12px; }
.company-search-input { position: relative; flex: 1; min-width: 0; }
.company-search-input svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.company-search-input input { height: 44px; padding-left: 42px; }
.company-search-controls button { min-height: 44px; padding: 10px 24px; }
.company-clear { color: var(--work-green); font-size: .875rem; font-weight: 600; text-decoration: none; }
.company-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.company-list-heading h2 { margin: 0; font-size: 1.18rem; font-weight: 650; }
.company-list-heading p { margin: 6px 0 0; color: var(--muted); font-size: .875rem; }
.company-list-heading > span { color: var(--muted); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.layout > main .company-directory .company-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%, 320px),1fr)); gap: 16px; }
.company-directory-card { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 20px; }
.company-directory-card:focus-visible { outline: 3px solid var(--work-green); outline-offset: 3px; }
.company-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.company-symbol { display: grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--work-green); background: var(--work-soft); border-radius: 10px; }
.company-symbol svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.company-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.company-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.company-state.is-active { color: var(--work-green); }
.company-identity h2 { font-size: 1.08rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.company-identity p { margin: 5px 0 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.company-directory-card dl { margin-top: auto; padding-top: 16px; }
.company-directory-card dt { font-size: .78rem; }
.company-directory-card dd { font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.company-duplicate { margin: 0; color: var(--work-amber); font-size: .8rem; }
.company-card-action { display: flex; justify-content: space-between; align-items: center; color: var(--work-green); font-size: .85rem; font-weight: 650; }
.company-card-action span { font-size: 1.1rem; }
.company-empty { grid-column: 1 / -1; padding: 32px 24px; border: 1px dashed var(--line); border-radius: 12px; background: var(--white); color: var(--ink); }
.company-empty p { margin: 8px 0; color: var(--muted); }.company-empty a { color: var(--work-green); font-weight: 600; }
@media (max-width: 620px) {
  .company-directory-heading { margin-bottom: 24px; }
  .company-search { padding: 16px; margin-bottom: 24px; }
  .company-search-controls { flex-wrap: wrap; gap: 8px; }
  .company-search-input { flex-basis: 100%; }
  .company-search-controls button { flex: 1; }
  .company-clear { padding: 10px 12px; }
  .company-list-heading { align-items: start; }
  .company-list-heading p { line-height: 1.4; }
  .company-directory-card { padding: 16px; }
}
.company-search-controls .primary { background: #176443; color: #fff; }
.company-search-controls .primary:hover { background: #104c32; }
:root[data-theme=dark] .company-search-input input::placeholder { color: #a6b8bd; opacity: 1; }
.company-search-feedback { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.company-search-feedback.is-error { color: var(--danger); }
:root[data-theme=dark] .company-search-feedback.is-error { color: #ffa99f; }
/* Histórico da empresa: lista de visitas em linhas amplas no desktop e cartões no celular. */
.company-detail-back { margin-bottom: 24px; }
.company-detail-back a { display: inline-flex; gap: 8px; align-items: center; color: var(--work-green); font-size: .875rem; font-weight: 600; text-decoration: none; }
.company-detail-back a:hover { text-decoration: underline; }
.company-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.company-detail-title { display: flex; align-items: flex-start; min-width: 0; gap: 16px; }
.company-detail-title .company-symbol { width: 48px; height: 48px; }
.company-detail-title .company-symbol svg { width: 22px; height: 22px; }
.company-detail-title .eyebrow { margin: 0 0 4px; font-size: .8rem; }
.company-detail-title h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.company-detail-summary { display: flex; gap: 32px; flex: none; padding-left: 28px; border-left: 1px solid var(--line); }
.company-detail-summary div { display: grid; gap: 4px; }
.company-detail-summary strong { color: var(--work-green); font-size: 1.5rem; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.company-detail-summary span { color: var(--muted); font-size: .8rem; }
.visits-section { margin-top: 32px; }
.visits-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.visits-heading h2 { margin: 0; font-size: 1.18rem; font-weight: 650; }
.visits-heading p { margin: 6px 0 0; color: var(--muted); font-size: .875rem; }
.visits-heading > span { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.visits-list { display: grid; gap: 12px; }
.visit-card { display: grid; grid-template-columns: minmax(180px,2fr) minmax(110px,1fr) minmax(120px,1fr) minmax(100px,.8fr) auto; gap: 20px; align-items: center; padding: 20px 24px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.visit-unit { display: flex; align-items: center; gap: 12px; min-width: 0; }
.visit-unit > div,.visit-detail { display: grid; gap: 5px; min-width: 0; }
.visit-unit strong { font-size: .95rem; overflow-wrap: anywhere; }
.visit-unit-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--work-green); background: var(--work-soft); border-radius: 10px; }
.visit-unit-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.visit-label { color: var(--muted); font-size: .78rem; font-weight: 500; }
.visit-detail time,.visit-detail strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.visit-status { width: max-content; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.visit-status::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.visit-status.is-active { color: var(--work-green); }
.visit-action { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--work-green); font-size: .85rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.visit-action:hover { border-color: var(--work-green); background: var(--work-soft); }
.visit-action:focus-visible,.company-detail-back a:focus-visible { outline: 3px solid var(--work-green); outline-offset: 3px; }
.visit-empty { padding: 32px 24px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink); background: var(--white); }
.visit-empty p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
@media(max-width: 1100px) {
  .visit-card { grid-template-columns: minmax(160px,2fr) repeat(3,minmax(95px,1fr)); }
  .visit-action { grid-column: 1 / -1; justify-self: start; }
}
@media(max-width: 700px) {
  .company-detail-back { margin-bottom: 20px; }
  .company-detail-header { align-items: stretch; flex-direction: column; gap: 20px; padding: 20px; }
  .company-detail-summary { gap: 32px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .visits-section { margin-top: 24px; }
  .visits-heading { align-items: start; }
  .visits-heading p { line-height: 1.4; }
  .visit-card { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 16px; }
  .visit-unit { grid-column: 1 / -1; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .visit-action { grid-column: 1 / -1; justify-self: stretch; }
}
