html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Campos mais compactos para aumentar a área útil dos painéis. */
.form-control, .form-select { min-height: 2.15rem; padding: .32rem .6rem; }
.form-label { margin-bottom: .25rem; }

/* Área administrativa de empresas: informações densas com leitura rápida. */
.section-hero {
  padding: 1.25rem 1.4rem;
  border: 1px solid #dfe8f1;
  border-radius: 1rem;
  background: linear-gradient(120deg, #f8fbff 0%, #ffffff 68%);
}

.section-kicker { color: #2768a3; font-size: .7rem; font-weight: 700; letter-spacing: .1em; }
.empty-state { padding: 3.5rem 1.5rem; border: 1px dashed #b8c9d8; border-radius: 1rem; background: #fbfdff; }
.company-card { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.25rem 1.35rem; border: 1px solid #dfe8f1; border-radius: 1rem; background: #fff; box-shadow: 0 .25rem .8rem rgba(28, 72, 113, .05); }
.company-card-main { min-width: 0; flex: 1; }
.company-card-title { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.company-monogram { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; border-radius: .8rem; background: #e7f1fb; color: #17619e; font-weight: 700; }
.company-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.5rem; }
.company-metadata div { min-width: 0; }
.company-metadata dt { color: #718096; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.company-metadata dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.company-card-actions { display: flex; min-width: 11rem; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.status-pill { padding: .32rem .65rem; border-radius: 99rem; font-size: .75rem; font-weight: 700; }
.status-pill-active { color: #176b47; background: #dff5e9; }
.status-pill-blocked { color: #a03928; background: #fbe6e2; }
.company-form-shell .card { overflow: hidden; border: 1px solid #dfe8f1; border-radius: 1rem; box-shadow: 0 .2rem .7rem rgba(28, 72, 113, .04); }
.company-form-shell .card-header { padding: .9rem 1.25rem; color: #1f4f7a; background: #f7fbff; border-bottom-color: #e4edf5; }

/* Ajuda contextual: acessível por mouse, toque e teclado, sem tooltip nativo. */
.tf-help-trigger { display: inline-grid; width: 1.18rem; height: 1.18rem; place-items: center; margin-left: .25rem; padding: 0; color: #17619e; border: 1px solid #77a9d2; border-radius: 50%; background: #f5faff; font-size: .75rem; font-weight: 700; line-height: 1; vertical-align: middle; cursor: help; }
.tf-help-trigger:hover, .tf-help-trigger:focus { color: #fff; border-color: #17619e; background: #17619e; outline: none; }
.tf-contextual-help { position: absolute; z-index: 1080; width: min(19rem, calc(100vw - 24px)); padding: .7rem .8rem; color: #fff; border-radius: .6rem; background: #163d5c; box-shadow: 0 .45rem 1rem rgba(13, 47, 73, .24); font-size: .82rem; line-height: 1.35; }
.tf-contextual-help[hidden] { display: none; }

/* Central de ajuda: tópicos curtos e fáceis de consultar por portal. */
.help-hero { padding: 1.4rem; border: 1px solid #dfe8f1; border-radius: 1rem; background: linear-gradient(120deg, #f1f8ff, #fff); }
.help-topic { height: 100%; padding: 1.1rem; border: 1px solid #dfe8f1; border-radius: .85rem; background: #fff; box-shadow: 0 .2rem .7rem rgba(28,72,113,.04); }
.help-topic h2 { color: #174f78; font-size: 1rem; }
.help-topic p { margin-bottom: 0; color: #536879; }

@media (max-width: 767.98px) {
  .company-card { flex-direction: column; }
  .company-card-actions { align-items: flex-start; }
  .company-metadata { grid-template-columns: 1fr; }
}

/* Página inicial da Empresa: foco operacional sem mostrar dados ainda não cadastrados. */
.company-alert { border: 0; border-radius: .85rem; }
.company-portal-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.75rem; color: #fff; border-radius: 1rem; background: linear-gradient(125deg, #143d61, #1a6a81); box-shadow: 0 .6rem 1.5rem rgba(20, 61, 97, .16); }
.company-portal-document { display: grid; gap: .2rem; min-width: 9rem; padding: .8rem 1rem; border: 1px solid rgba(255,255,255,.2); border-radius: .75rem; background: rgba(0,0,0,.1); }
.company-portal-document span { font-size: .7rem; letter-spacing: .08em; opacity: .7; }
.company-portal-document strong { font-size: .9rem; }
.company-dashboard-heading { padding: .3rem 0 1rem; border-bottom: 1px solid #dfe8f1; }
.portal-stat-card, .portal-card { height: 100%; padding: 1.25rem; border: 1px solid #dfe8f1; border-radius: 1rem; background: #fff; box-shadow: 0 .2rem .7rem rgba(28,72,113,.04); }
.portal-stat-card { display: flex; flex-direction: column; gap: .25rem; }
.portal-stat-label { color: #718096; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.portal-stat-value { color: #174f78; font-size: 2rem; line-height: 1.2; }
.portal-stat-text { color: #174f78; font-size: 1.1rem; margin-top: .45rem; }
.portal-stat-note { color: #718096; font-size: .82rem; margin-top: auto; }
.portal-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.portal-phase { padding: .3rem .55rem; color: #245d8e; border-radius: 99rem; background: #eaf3fb; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.portal-modules { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
.portal-modules > div { display: grid; gap: .25rem; padding: .85rem; border: 1px solid #e4edf5; border-radius: .75rem; background: #fbfdff; }
.portal-modules small, .portal-branch small { color: #718096; font-size: .77rem; }
.portal-module-icon { width: fit-content; color: #1f679b; font-size: .72rem; font-weight: 700; }
.portal-branches { display: grid; gap: .8rem; }
.portal-branch { display: flex; align-items: center; gap: .7rem; }
.portal-branch > div { display: grid; gap: .1rem; }
.portal-branch-marker { width: .65rem; height: .65rem; border-radius: 50%; }
.portal-branch-active { background: #32a36b; box-shadow: 0 0 0 .25rem #e0f6e9; }
.portal-branch-blocked { background: #c75a4a; box-shadow: 0 0 0 .25rem #fbe6e2; }
.tutuflow-map { min-height: 300px; border: 1px solid #dfe8f1; border-radius: .75rem; overflow: hidden; background: #f8fbff; }
.company-full-map { min-height: calc(100vh - 15rem); }
.company-map-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; color: #526779; font-size: .78rem; }
.company-map-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.company-map-legend-dot { width: .7rem; height: .7rem; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #8295a5; }
.company-map-legend-dot.collected { background: #3b82f6; }.company-map-legend-dot.base { background: #0f766e; }.company-map-legend-dot.sector { background: #7c3aed; }.company-map-legend-dot.assigned { background: #d97706; }.company-map-legend-dot.route { background: #059669; }.company-map-legend-dot.occurrence { background: #dc2626; }.company-map-legend-dot.delivered { background: #16a34a; }
.contract-terms { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }

@media (max-width: 767.98px) {
  .company-portal-hero { align-items: flex-start; flex-direction: column; }
  .company-full-map { min-height: 65vh; }
  .portal-modules { grid-template-columns: 1fr; }
}

/* No celular, o menu fica ancorado ao botão à direita. */
@media (max-width: 575.98px) {
  .navbar-toggleable-sm .container-fluid { position: relative; }
  .tutuflow-mobile-menu {
    position: absolute;
    top: calc(100% + .45rem);
    right: .75rem;
    left: auto;
    z-index: 1040;
    width: min(22rem, calc(100vw - 1.5rem));
    padding: .55rem;
    border: 1px solid #dfe8f1;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .5rem 1.25rem rgba(28, 72, 113, .16);
  }

  .tutuflow-mobile-menu .nav-link { padding: .55rem .65rem; border-radius: .45rem; }
  .tutuflow-mobile-menu .nav-link:hover { background: #f3f8fc; }
  .tutuflow-mobile-menu .ms-auto { margin-top: .4rem; padding: .45rem .15rem .1rem; border-top: 1px solid #e6eef5; }
}
