:root {
  --navy: #0c1c33;
  --navy-soft: #142a48;
  --blue: #1858a8;
  --blue-light: #eaf2fb;
  --cyan: #33a8c7;
  --background: #f4f7fb;
  --surface: #ffffff;
  --text: #152033;
  --muted: #68768a;
  --border: #dfe6ef;
  --success: #16876b;
  --shadow: 0 16px 40px rgba(14, 31, 53, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--background);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  color: white;
  background:
    linear-gradient(
      180deg,
      var(--navy) 0%,
      #081425 100%
    );
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 28px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: white;
  background:
    linear-gradient(
      135deg,
      var(--cyan),
      var(--blue)
    );
}

.brand-mark.large {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  font-size: 1.25rem;
}

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 15px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
}

.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.disabled {
  opacity: 0.46;
}

.main-content {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 104px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 1.55rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.eyebrow.light {
  color: #80d9ee;
}

.user-menu {
  display: flex;
  gap: 18px;
  align-items: center;
}

.user-details {
  text-align: right;
}

.user-details strong,
.user-details small {
  display: block;
}

.user-details small {
  margin-top: 3px;
  color: var(--muted);
}

.logout-button {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: white;
  cursor: pointer;
}

.page-content {
  padding: 38px 40px;
}

.welcome-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 30px;
  border-radius: 20px;
  color: white;
  background:
    linear-gradient(
      125deg,
      var(--navy-soft),
      var(--blue)
    );
  box-shadow: var(--shadow);
}

.welcome-panel h2 {
  margin: 7px 0 8px;
  font-size: 1.7rem;
}

.welcome-panel p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.status-badge {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.stat-card,
.empty-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
  display: block;
}

.stat-card span {
  font-weight: 650;
}

.stat-card strong {
  display: block;
  margin: 16px 0 10px;
  font-size: 2.2rem;
}

.stat-card small {
  line-height: 1.5;
  color: var(--muted);
}

.empty-panel {
  margin-top: 24px;
  text-align: center;
}

.empty-panel h3 {
  margin: 14px 0 7px;
}

.empty-panel p {
  max-width: 570px;
  margin: 0 auto;
  line-height: 1.65;
  color: var(--muted);
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-light);
  font-size: 1.35rem;
}

.login-body {
  background: white;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(380px, 47%) minmax(0, 1fr);
  min-height: 100vh;
}

.login-brand-panel {
  display: flex;
  align-items: flex-end;
  padding: 64px;
  color: white;
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(51, 168, 199, 0.33),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      var(--navy-soft),
      var(--navy)
    );
}

.login-brand-content {
  max-width: 510px;
}

.login-brand-content h1 {
  margin: 28px 0 16px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.login-brand-content > p:last-child {
  max-width: 440px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(100%, 430px);
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h2 {
  margin: 8px 0 8px;
  font-size: 2rem;
}

.login-heading > p:last-child {
  margin: 0;
  color: var(--muted);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.form-group input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(24, 88, 168, 0.1);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  color: white;
  background: var(--blue);
  cursor: pointer;
}

.form-error {
  margin-bottom: 20px;
  padding: 13px 14px;
  border-radius: 10px;
  color: #9d2435;
  background: #fff0f2;
}

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar,
  .page-content {
    padding-right: 22px;
    padding-left: 22px;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    gap: 20px;
  }

  .user-details {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .welcome-panel {
    display: block;
  }

  .status-badge {
    display: inline-block;
    margin-top: 20px;
  }

  .login-form-panel {
    padding: 28px 22px;
  }
}

/* HFL Cargo — identidade visual oficial */

.brand-logo {
  display: block;
  width: 100%;
  max-width: 178px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
}

.login-logo {
  display: block;
  width: min(100%, 260px);
  height: auto;
  max-height: 100px;
  margin-bottom: 28px;
  object-fit: contain;
  object-position: left center;
}

/* HFL Cargo v0.1.1 — branding e rodapés */

.main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.main-content {
  flex: 1 0 auto;
}

.brand {
  justify-content: flex-start;
  min-height: 178px;
  padding: 10px 18px 34px;
}

.brand-logo {
  display: block;
  width: 148px;
  height: auto;
  max-height: 112px;
  object-fit: contain;
  object-position: left center;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.main-nav {
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 28px 16px 4px;
  color: rgba(255, 255, 255, 0.48);
}

.sidebar-footer span,
.sidebar-footer small {
  display: block;
}

.sidebar-footer span {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer small {
  margin-top: 5px;
  font-size: 0.72rem;
}

.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 62px;
  padding: 16px 30px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
}

.app-footer a {
  font-weight: 750;
  color: var(--blue);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.app-footer-separator {
  margin: 0 8px;
  color: #a7b0be;
}

.login-form-wrapper {
  width: min(100%, 500px);
}

.login-card {
  width: 100%;
}

.login-logo {
  display: block;
  width: min(100%, 290px);
  height: auto;
  max-height: 125px;
  margin-bottom: 64px;
  object-fit: contain;
  object-position: left center;
}

.login-footer {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.login-footer a {
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 800px) {
  .app-footer {
    flex-wrap: wrap;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .app-footer {
    display: block;
  }

  .app-footer-separator {
    display: none;
  }

  .app-footer span {
    display: block;
    margin: 3px 0;
  }
}


/* =========================================================
   HFL LOGIN V0.2.1 — CORREÇÃO DE SVG E DIMENSÕES
   ========================================================= */

.hfl-login-page svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.hfl-feature-icon {
  overflow: hidden;
}

.hfl-feature-icon svg {
  display: block !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
}

.hfl-input-icon {
  overflow: hidden;
}

.hfl-input-icon svg {
  display: block !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
}

.hfl-password-toggle {
  overflow: hidden;
}

.hfl-password-toggle svg {
  display: block !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
}

.hfl-login-submit {
  overflow: hidden;
}

.hfl-login-submit svg {
  display: block !important;
  flex: 0 0 25px !important;
  width: 25px !important;
  min-width: 25px !important;
  max-width: 25px !important;
  height: 25px !important;
  min-height: 25px !important;
  max-height: 25px !important;
}

.hfl-login-shell,
.hfl-login-presentation,
.hfl-login-access,
.hfl-login-card,
.hfl-login-form,
.hfl-field,
.hfl-input-wrapper {
  min-width: 0;
}

.hfl-input-wrapper {
  display: block;
  width: 100%;
}

.hfl-input-wrapper input {
  display: block;
  max-width: 100%;
}


/* =========================================================
   HFL BACKOFFICE V0.2.0 — LOGÓTIPO E RODAPÉ
   ========================================================= */

.brand {
  min-height: 185px;
  padding:
    24px 20px
    34px;
}

.brand-logo {
  width: 118px;
  max-width: 118px;
  height: auto;
  max-height: 92px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

.app-footer {
  display: grid;
  grid-template-columns:
    minmax(80px, 1fr)
    minmax(220px, 2fr)
    minmax(80px, 1fr);
  align-items: center;
  min-height: 86px;
  margin:
    0 28px
    24px;
  padding: 18px 28px;
  border: 1px solid #d8e7ef;
  border-radius: 24px;
  color: var(--muted);
  background: #ffffff;
  box-shadow:
    0 18px 45px rgba(14, 31, 53, 0.07);
}

.app-footer-k4w {
  justify-self: start;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #148bca;
  text-decoration: none;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.app-footer-k4w:hover {
  color: #086bb0;
  text-decoration: none;
  transform: translateY(-1px);
}

.app-footer-company {
  justify-self: center;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  color: #152033;
}

.app-footer-version {
  justify-self: end;
  font-size: 0.94rem;
  font-weight: 800;
  color: #148bca;
}

@media (max-width: 800px) {
  .brand {
    min-height: auto;
  }

  .app-footer {
    grid-template-columns: 1fr;
    gap: 10px;
    margin:
      0 18px
      18px;
    padding: 20px;
    text-align: center;
  }

  .app-footer-k4w,
  .app-footer-company,
  .app-footer-version {
    justify-self: center;
  }
}


/* =========================================================
   HFL CARGO V0.3.0 — EMPRESAS
   ========================================================= */

.page-header-card,
.toolbar-card,
.content-card,
.form-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 27px 30px;
}

.page-header-card h2 {
  margin: 6px 0 7px;
  font-size: 1.8rem;
}

.page-header-card p:last-child {
  margin: 0;
  color: var(--muted);
}

.page-header-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-action,
.secondary-action,
.danger-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 43px;
  padding: 0 17px;
  border-radius: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--blue);
  color: white;
  background: var(--blue);
}

.secondary-action {
  border: 1px solid var(--border);
  color: var(--text);
  background: white;
}

.danger-action {
  border: 1px solid #d83b52;
  color: white;
  background: #d83b52;
}

.text-action,
.table-action-link {
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.toolbar-card {
  margin-top: 20px;
  padding: 20px;
}

.company-filters {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.6fr)
    minmax(170px, 0.7fr)
    minmax(150px, 0.6fr)
    auto
    auto;
  gap: 14px;
  align-items: end;
}

.filter-search label,
.filter-field label,
.portal-field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 750;
  color: #39475a;
}

.company-filters input,
.company-filters select,
.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: white;
}

.portal-field textarea {
  min-height: 120px;
  resize: vertical;
}

.company-filters input:focus,
.company-filters select:focus,
.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(24, 88, 168, 0.09);
}

.content-card {
  margin-top: 20px;
  overflow: hidden;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.content-card-header h3 {
  margin: 0 0 4px;
}

.content-card-header p {
  margin: 0;
  color: var(--muted);
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.company-name-link {
  display: block;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.data-table td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
}

.entity-tag {
  color: #155a91;
  background: #eaf4fb;
}

.status-pill.active {
  color: #08735c;
  background: #e7f8f1;
}

.status-pill.inactive {
  color: #8a3440;
  background: #fff0f2;
}

.status-pill.primary {
  color: #155a91;
  background: #eaf4fb;
}

.table-actions {
  white-space: nowrap;
}

.table-actions-column {
  width: 130px;
}

.table-action-link + .table-action-link {
  margin-left: 12px;
}

.muted-text {
  color: var(--muted);
}

.empty-state {
  padding: 56px 30px;
  text-align: center;
}

.empty-state.compact {
  padding: 30px;
}

.empty-state h3 {
  margin: 13px 0 7px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.empty-state-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-light);
}

.messages-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.message-card {
  padding: 14px 17px;
  border-radius: 12px;
  color: #08735c;
  background: #e7f8f1;
}

.form-card {
  margin-top: 20px;
  padding: 28px;
}

.narrow-form-card {
  max-width: 940px;
}

.form-section + .form-section {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.form-section-heading {
  margin-bottom: 20px;
}

.form-section-heading h3 {
  margin: 0 0 5px;
}

.form-section-heading p {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-column {
  grid-column: 1 / -1;
}

.full-width {
  margin-top: 18px;
}

.portal-field ul.errorlist {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: #b3273e;
}

.checkbox-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.checkbox-card:has(input:checked) {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.input-with-suffix {
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  border-radius: 10px 0 0 10px;
}

.input-with-suffix span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  background: #f8fafc;
}

.switches-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 22px;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  opacity: 0;
}

.switch-control {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  background: #cbd5e1;
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
}

.switch-field input:checked + .switch-control {
  background: var(--blue);
}

.switch-field input:checked + .switch-control::after {
  transform: translateX(19px);
}

.form-actions {
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 20px;
}

.detail-main .content-card,
.detail-sidebar .content-card {
  margin-top: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 24px;
}

.detail-grid dt,
.sidebar-detail-list dt {
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-grid dd,
.sidebar-detail-list dd {
  margin: 0;
}

.detail-full-width {
  grid-column: 1 / -1;
}

.sidebar-detail-list {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 24px;
}

.company-address,
.notes-content {
  padding: 24px;
  font-style: normal;
  line-height: 1.7;
  color: #455267;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 20px;
}

.contact-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.contact-card-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.contact-card h4 {
  margin: 0 0 4px;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
}

.contact-details {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}

.danger-card {
  padding: 22px;
}

.danger-card h3 {
  margin: 0 0 7px;
}

.danger-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.title-with-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-section {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.section-heading h2 {
  margin: 5px 0 0;
}

.mini-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.mini-stat-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: white;
}

.mini-stat-card span,
.mini-stat-card strong {
  display: block;
}

.mini-stat-card span {
  color: var(--muted);
}

.mini-stat-card strong {
  margin-top: 10px;
  font-size: 1.75rem;
}

.recent-list {
  display: grid;
}

.recent-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.recent-list-item:last-child {
  border-bottom: 0;
}

.recent-list-item strong,
.recent-list-item span {
  display: block;
}

.recent-list-item div span {
  margin-top: 4px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .company-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkbox-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .mini-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-header-card {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header-actions {
    align-items: stretch;
  }

  .company-filters,
  .form-grid.two-columns,
  .form-grid.three-columns,
  .contacts-grid,
  .detail-grid,
  .mini-stats-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-card-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 20px;
  }

  .full-column,
  .detail-full-width {
    grid-column: auto;
  }
}


/* =========================================================
   HFL CARGO V0.3.1 — NAVEGAÇÃO E EMPRESAS
   ========================================================= */

.topbar {
  position: relative;
  z-index: 5;
}

.nav-link {
  gap: 13px;
}

.nav-icon {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.nav-link.active .nav-icon {
  color: #6fd3ed;
}

.nav-link.disabled {
  cursor: default;
}

.company-table-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.company-avatar {
  display: inline-grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #d4e7f2;
  border-radius: 13px;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  color: #12649d;
  background:
    linear-gradient(
      145deg,
      #edf7fc,
      #dfeff8
    );
}

.status-pill {
  gap: 7px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-pill.active .status-dot {
  background: #19a57e;
  box-shadow:
    0 0 0 3px rgba(25, 165, 126, 0.12);
}

.status-pill.inactive .status-dot {
  background: #d55263;
  box-shadow:
    0 0 0 3px rgba(213, 82, 99, 0.11);
}

.company-filters {
  grid-template-columns:
    minmax(330px, 1.9fr)
    minmax(180px, 0.75fr)
    minmax(160px, 0.65fr)
    auto
    auto;
}

.toolbar-card {
  padding-top: 17px;
  padding-bottom: 17px;
}

@media (max-width: 1200px) {
  .company-filters {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   HFL CARGO — TIPOS DE ENTIDADE COMPACTOS
   ========================================================= */

.checkbox-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.checkbox-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 11px 14px;
  margin: 0;
  border: 1px solid #d8e2ee;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.checkbox-card:hover {
  border-color: #94b9e8;
  background: #f8fbff;
}

.checkbox-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  box-shadow: none !important;
}

.checkbox-card input[type="checkbox"]:checked {
  border-color: #1769d2;
  background-color: #1769d2;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.checkbox-card:has(input[type="checkbox"]:checked) {
  border-color: #1769d2;
  background: #eef6ff;
  color: #1258b0;
  box-shadow: 0 0 0 1px rgba(23, 105, 210, 0.08);
}

.checkbox-card span {
  display: block;
  margin: 0;
}

@media (max-width: 1100px) {
  .checkbox-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .checkbox-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .checkbox-card-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   HFL CARGO — TIPOS DE ENTIDADE COMPACTOS
   ========================================================= */

.checkbox-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.checkbox-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 11px 14px;
  margin: 0;
  border: 1px solid #d8e2ee;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.checkbox-card:hover {
  border-color: #94b9e8;
  background: #f8fbff;
}

.checkbox-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  box-shadow: none !important;
}

.checkbox-card input[type="checkbox"]:checked {
  border-color: #1769d2;
  background-color: #1769d2;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.checkbox-card:has(input[type="checkbox"]:checked) {
  border-color: #1769d2;
  background: #eef6ff;
  color: #1258b0;
  box-shadow: 0 0 0 1px rgba(23, 105, 210, 0.08);
}

.checkbox-card span {
  display: block;
  margin: 0;
}

@media (max-width: 1100px) {
  .checkbox-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .checkbox-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .checkbox-card-grid {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   HFL CARGO V0.4.3 — SIDEBAR STICKY DEFINITIVA
   ========================================================= */

/*
 * A estrutura original já é CSS Grid:
 *
 * .app-shell {
 *   grid-template-columns: 260px minmax(0, 1fr);
 * }
 *
 * Por isso, a sidebar deve continuar dentro do fluxo.
 */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;

  width: 260px;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;

  overflow-x: hidden;
  overflow-y: auto;

  align-self: start;
  z-index: 100;

  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color:
    rgba(255, 255, 255, 0.18)
    transparent;
}

.main-column {
  position: relative;

  width: 100%;
  min-width: 0;

  margin: 0;
  padding: 0;

  left: auto;
  transform: none;
}

.main-content {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.topbar {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page-content {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/*
 * Garante uma margem visual segura entre a sidebar
 * e o conteúdo sem deslocar a grelha.
 */
.topbar,
.page-content {
  padding-left: 32px;
  padding-right: 32px;
}

.page-content > * {
  max-width: 100%;
  box-sizing: border-box;
}


/* Navegação lateral */

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.main-nav a {
  display: flex;
  align-items: center;
  gap: 14px;

  min-height: 54px;

  border-radius: 14px;

  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.main-nav a:hover {
  transform: translateX(2px);
}

.main-nav a.active,
.main-nav a[aria-current="page"] {
  transform: none;
}


/* Scrollbar discreta */

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}


/* =========================================================
   CAMPOS COMERCIAIS COM ALTURA UNIFORME
   ========================================================= */

.portal-form select,
.portal-form input[type="text"],
.portal-form input[type="email"],
.portal-form input[type="url"],
.portal-form input[type="tel"],
.portal-form input[type="number"],
.portal-form input[type="password"] {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;

  border: 1px solid #d7e1ed;
  border-radius: 12px;

  background-color: #ffffff;
  color: #17243a;

  font: inherit;
  line-height: 1.3;

  box-sizing: border-box;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.portal-form select {
  height: 54px;
  padding-right: 42px;
  cursor: pointer;
}

.portal-form select:focus,
.portal-form input[type="text"]:focus,
.portal-form input[type="email"]:focus,
.portal-form input[type="url"]:focus,
.portal-form input[type="tel"]:focus,
.portal-form input[type="number"]:focus,
.portal-form input[type="password"]:focus {
  outline: none;
  border-color: #2474d8;
  box-shadow: 0 0 0 3px rgba(36, 116, 216, 0.11);
}

.portal-form .input-with-suffix {
  display: flex;
  align-items: stretch;

  width: 100%;
  min-height: 54px;
}

.portal-form .input-with-suffix input {
  min-width: 0;
  height: 54px;

  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.portal-form .input-with-suffix > span {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 72px;
  min-height: 54px;
  padding: 0 16px;

  border: 1px solid #d7e1ed;
  border-left: 0;
  border-radius: 0 12px 12px 0;

  background: #f5f8fc;
  color: #64748b;

  font-size: 0.91rem;
  font-weight: 650;

  box-sizing: border-box;
}


/* Responsivo */

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 280px;
    height: 100vh;

    transform: translateX(-100%);
    transition: transform 0.25s ease;

    box-shadow: 18px 0 45px rgba(2, 13, 30, 0.2);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-column {
    width: 100%;
  }

  .topbar,
  .page-content {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .page-content {
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* =========================================================
   HFL CARGO — FILTROS DE EMPRESAS UNIFORMES
   ========================================================= */

.company-filters,
.filters-form,
.filter-form {
  display: grid;
  grid-template-columns:
    minmax(280px, 1.5fr)
    minmax(220px, 0.8fr)
    minmax(220px, 0.8fr)
    auto
    auto;
  align-items: end;
  gap: 18px;
}

.company-filters .portal-field,
.filters-form .portal-field,
.filter-form .portal-field {
  min-width: 0;
}

.company-filters input,
.company-filters select,
.filters-form input,
.filters-form select,
.filter-form input,
.filter-form select {
  width: 100%;
  height: 54px;
  min-height: 54px;

  padding: 0 16px;

  border: 1px solid #d7e1ed;
  border-radius: 12px;

  background: #ffffff;
  box-sizing: border-box;

  font: inherit;
}

.company-filters button,
.filters-form button,
.filter-form button {
  min-height: 54px;
  padding: 0 24px;
  white-space: nowrap;
}

.company-filters .clear-filter,
.filters-form .clear-filter,
.filter-form .clear-filter {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .company-filters,
  .filters-form,
  .filter-form {
    grid-template-columns:
      minmax(260px, 1.4fr)
      minmax(190px, 0.8fr)
      minmax(190px, 0.8fr)
      auto;
  }

  .company-filters .clear-filter,
  .filters-form .clear-filter,
  .filter-form .clear-filter {
    grid-column: 4;
  }
}

@media (max-width: 900px) {
  .company-filters,
  .filters-form,
  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .company-filters,
  .filters-form,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .company-filters .clear-filter,
  .filters-form .clear-filter,
  .filter-form .clear-filter {
    grid-column: auto;
  }
}


/* =========================================================
   HFL CARGO V0.5.0 — MORADAS MÚLTIPLAS
   ========================================================= */

.addresses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.address-card {
  display: flex;
  flex-direction: column;
  gap: 16px;

  min-width: 0;
  padding: 22px;

  border: 1px solid #dce6f1;
  border-radius: 18px;

  background: #ffffff;

  box-shadow:
    0 8px 24px rgba(15, 35, 65, 0.035);
}

.address-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.address-card-header h4 {
  margin: 9px 0 0;

  color: #152239;
  font-size: 1.03rem;
}

.address-type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.address-type-badge {
  display: inline-flex;
  align-items: center;

  min-height: 28px;
  padding: 4px 10px;

  border-radius: 999px;

  background: #eaf3ff;
  color: #1761ad;

  font-size: 0.75rem;
  font-weight: 800;
}

.address-card .company-address {
  margin: 0;

  color: #4d5e73;
  font-size: 0.91rem;
  font-style: normal;
  line-height: 1.65;
}

.address-contact {
  display: flex;
  flex-direction: column;
  gap: 5px;

  padding-top: 14px;
  border-top: 1px solid #edf1f6;

  color: #53647a;
  font-size: 0.86rem;
}

.address-contact a {
  overflow-wrap: anywhere;
}

.address-notes {
  margin: 0;
  padding: 13px 15px;

  border-radius: 12px;

  background: #f7f9fc;
  color: #65758a;

  font-size: 0.84rem;
  line-height: 1.55;
}

.address-delete-form {
  margin-top: auto;
  padding-top: 3px;
}

.text-danger-action {
  padding: 0;
  border: 0;

  background: transparent;
  color: #b4233d;

  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;

  cursor: pointer;
}

.text-danger-action:hover {
  text-decoration: underline;
}

.contact-language {
  display: inline-flex;
  align-items: center;

  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;

  border-radius: 999px;

  background: #f0f4f8;
  color: #5c6b7d;

  font-size: 0.72rem;
  font-weight: 750;
}

@media (max-width: 1100px) {
  .addresses-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .address-card {
    padding: 18px;
  }

  .address-card-header {
    flex-direction: column;
  }
}


/* =========================================================
   HFL CARGO V0.5.1 — COMPANY EXECUTIVE DASHBOARD
   ========================================================= */

.company-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.company-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 0;
  min-height: 112px;
  padding: 18px;

  border: 1px solid #dce5f0;
  border-radius: 17px;

  background: #ffffff;

  box-shadow:
    0 8px 25px rgba(20, 40, 70, 0.035);
}

.company-kpi-icon {
  display: inline-flex;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;

  border-radius: 13px;

  background: #eaf3ff;
  color: #1761ad;

  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.company-kpi-icon.contacts {
  background: #eaf3ff;
  color: #1761ad;
}

.company-kpi-icon.addresses {
  background: #f0ebff;
  color: #6642b4;
}

.company-kpi-icon.status {
  background: #e6f8f1;
  color: #168060;
}

.company-kpi-icon.rating {
  background: #fff4dd;
  color: #a36900;
}

.company-kpi-icon.credit {
  background: #eaf7fb;
  color: #17748d;
}

.company-kpi-icon.currency {
  background: #f0f3f7;
  color: #4b5e73;
}

.company-kpi-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.company-kpi-label {
  margin-bottom: 4px;

  color: #718096;

  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.company-kpi-value {
  overflow: hidden;

  color: #17243a;

  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-kpi-value.compact {
  font-size: 1.08rem;
}

.company-kpi-note {
  overflow: hidden;
  margin-top: 5px;

  color: #8491a3;

  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Executive sidebar */

.executive-summary-card {
  border-top: 4px solid #2063ad;
}

.executive-summary-card .content-card-header {
  background:
    linear-gradient(
      135deg,
      rgba(33, 99, 174, 0.07),
      rgba(33, 99, 174, 0.01)
    );
}

.executive-summary-list {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.executive-summary-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;

  padding: 13px 0;

  border-bottom: 1px solid #edf1f6;
}

.executive-summary-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.executive-summary-list dt {
  color: #718096;

  font-size: 0.75rem;
  font-weight: 750;
}

.executive-summary-list dd {
  min-width: 0;
  margin: 0;

  color: #1d2b40;

  font-size: 0.82rem;
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.executive-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 32px;
  min-height: 28px;
  padding: 3px 9px;

  border-radius: 999px;

  background: #fff3d6;
  color: #966000;

  font-size: 0.78rem;
  font-weight: 850;
}


/* Address badges */

.address-type-badge {
  gap: 7px;
}

.address-type-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 23px;
  height: 23px;

  border-radius: 7px;

  background: rgba(255, 255, 255, 0.75);

  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.address-type-headquarters {
  background: #eaf3ff;
  color: #1761ad;
}

.address-type-billing {
  background: #f2edff;
  color: #6543ae;
}

.address-type-warehouse {
  background: #fff0df;
  color: #a75800;
}

.address-type-pickup {
  background: #e7f7f4;
  color: #087967;
}

.address-type-delivery {
  background: #e9f7e7;
  color: #36802e;
}

.address-type-customs {
  background: #fff0f2;
  color: #a33a4c;
}

.address-type-other {
  background: #eef2f6;
  color: #526377;
}


/* Contact cards */

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.contact-detail-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.contact-detail-icon {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;

  border-radius: 10px;

  background: #edf4fc;
  color: #2965a5;

  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.contact-detail-icon.whatsapp {
  background: #e7f8ef;
  color: #16834f;
}

.contact-detail-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.contact-detail-row small {
  color: #8995a5;

  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.contact-detail-row a {
  overflow: hidden;

  color: #32445b;

  font-size: 0.81rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;

  margin-top: auto;
  padding-top: 14px;

  border-top: 1px solid #edf1f6;
}

.contact-card-footer .table-action-link {
  margin-left: auto;
}


/* Responsive */

@media (max-width: 1500px) {
  .company-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .company-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .company-kpi-grid {
    grid-template-columns: 1fr;
  }

  .company-kpi-card {
    min-height: 96px;
  }

  .executive-summary-list > div {
    flex-direction: column;
    gap: 5px;
  }

  .executive-summary-list dd {
    text-align: left;
  }
}


/* =========================================================
   HFL CARGO V0.5.1 — AJUSTE PERFIL EXECUTIVO
   ========================================================= */

.detail-layout {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(360px, 410px);
  gap: 28px;
}

.executive-summary-card {
  overflow: hidden;
}

.executive-summary-card .content-card-header {
  padding: 28px 30px;
}

.executive-summary-list {
  padding: 8px 30px 24px;
}

.executive-summary-list > div {
  min-height: 58px;
  padding: 15px 0;
}

.executive-summary-list dt {
  flex: 0 0 46%;
  line-height: 1.35;
}

.executive-summary-list dd {
  flex: 1;
  line-height: 1.35;
}

.executive-summary-list .status-pill {
  white-space: nowrap;
}

@media (max-width: 1250px) {
  .detail-layout {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(330px, 370px);
  }
}

@media (max-width: 1050px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .executive-summary-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .detail-sidebar {
    grid-template-columns: 1fr;
  }

  .executive-summary-card .content-card-header {
    padding: 24px;
  }

  .executive-summary-list {
    padding: 6px 24px 22px;
  }
}


/* =========================================================
   HFL CARGO V0.5.2 — NAVEGAÇÃO E TIMELINE
   ========================================================= */

html {
  scroll-behavior: smooth;
}


/* Navegação interna da ficha */

.company-section-nav {
  position: sticky;
  z-index: 18;
  top: 18px;

  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 28px;
  padding: 8px;

  overflow-x: auto;

  border: 1px solid #dce5f0;
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.96);

  box-shadow:
    0 10px 28px rgba(18, 39, 70, 0.055);

  backdrop-filter: blur(12px);
}

.company-section-nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 42px;
  padding: 8px 15px;

  border-radius: 11px;

  color: #55677d;

  font-size: 0.79rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.company-section-nav a:hover {
  background: #edf5ff;
  color: #155da9;
  transform: translateY(-1px);
}

.company-section-nav a:focus-visible {
  outline: 3px solid rgba(32, 99, 173, 0.18);
  outline-offset: 2px;
}

.company-section-nav a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;

  border-radius: 999px;

  background: #edf1f6;
  color: #617187;

  font-size: 0.67rem;
  font-weight: 850;
}

.company-section-nav a:hover span {
  background: #ffffff;
  color: #155da9;
}

.company-anchor-section {
  scroll-margin-top: 92px;
}


/* Timeline */

.company-activity-card {
  overflow: hidden;
}

.company-activity-card .content-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.activity-total {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  min-width: 34px;
  min-height: 34px;
  padding: 4px 10px;

  border-radius: 999px;

  background: #eaf3ff;
  color: #1761ad;

  font-size: 0.76rem;
  font-weight: 850;
}

.company-timeline {
  position: relative;

  display: flex;
  flex-direction: column;

  padding: 5px 0 3px;
}

.company-timeline::before {
  position: absolute;
  top: 24px;
  bottom: 27px;
  left: 17px;

  width: 1px;

  background: #dfe7f0;

  content: "";
}

.timeline-event {
  position: relative;

  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 13px;

  padding: 12px 0;
}

.timeline-marker {
  position: relative;
  z-index: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 35px;
  height: 35px;

  border: 4px solid #ffffff;
  border-radius: 50%;

  background: #eaf3ff;
  color: #1761ad;

  box-shadow:
    0 0 0 1px #d8e3ef;

  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.timeline-marker.timeline-contact {
  background: #e8f7f1;
  color: #17795e;
}

.timeline-marker.timeline-address {
  background: #f0eaff;
  color: #6743af;
}

.timeline-event-content {
  min-width: 0;
  padding: 2px 0 13px;

  border-bottom: 1px solid #edf1f6;
}

.timeline-event:last-child .timeline-event-content {
  border-bottom: 0;
}

.timeline-event-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timeline-event-heading strong {
  color: #1d2b40;

  font-size: 0.82rem;
  line-height: 1.35;
}

.timeline-event-heading time {
  flex: 0 0 auto;

  color: #8a97a8;

  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-event-content p {
  margin: 5px 0 0;

  color: #66768a;

  font-size: 0.75rem;
  line-height: 1.5;
}

.timeline-event-time {
  display: block;
  margin-top: 5px;

  color: #9aa5b3;

  font-size: 0.63rem;
  font-weight: 700;
}

.timeline-empty {
  padding: 22px;

  border: 1px dashed #d7e0eb;
  border-radius: 13px;

  background: #f8fafc;
  color: #718096;

  font-size: 0.79rem;
  line-height: 1.5;
  text-align: center;
}


/* Responsive */

@media (max-width: 1050px) {
  .company-section-nav {
    top: 10px;
  }

  .company-activity-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .company-section-nav {
    margin-right: -5px;
    margin-left: -5px;
    border-radius: 13px;
  }

  .company-section-nav a {
    min-height: 39px;
    padding: 7px 12px;
  }

  .timeline-event-heading {
    flex-direction: column;
    gap: 3px;
  }
}


/* =========================================================
   HFL CARGO V0.6.0 — CRM COMERCIAL
   ========================================================= */

.crm-kpi-grid,
.opportunity-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 26px;
}

.opportunity-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-kpi-card,
.opportunity-kpi-grid article {
  display: flex;
  min-width: 0;
  min-height: 116px;
  flex-direction: column;
  justify-content: center;

  padding: 20px 22px;

  border: 1px solid #dce5f0;
  border-radius: 17px;

  background: #ffffff;

  box-shadow:
    0 8px 24px rgba(20, 40, 70, 0.035);
}

.crm-kpi-card span,
.opportunity-kpi-grid span {
  color: #718096;

  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.crm-kpi-card strong,
.opportunity-kpi-grid strong {
  overflow: hidden;
  margin-top: 7px;

  color: #17243a;

  font-size: 1.35rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-kpi-card small {
  margin-top: 5px;

  color: #8794a6;
  font-size: 0.72rem;
}


/* Filtros */

.crm-filters {
  display: grid;
  grid-template-columns:
    minmax(280px, 1fr)
    minmax(180px, 220px)
    minmax(210px, 280px)
    auto
    auto;
  align-items: end;
  gap: 14px;
}


/* Pipeline */

.crm-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(285px, 1fr));
  gap: 17px;

  padding-bottom: 15px;
  overflow-x: auto;
}

.pipeline-column {
  min-width: 285px;
  overflow: hidden;

  border: 1px solid #dce5f0;
  border-radius: 18px;

  background: #f5f8fc;
}

.pipeline-column-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  padding: 19px 19px 16px;

  border-bottom: 1px solid #dde5ee;

  background: #ffffff;
}

.pipeline-column-header h3 {
  margin: 0;

  color: #17243a;
  font-size: 0.92rem;
}

.pipeline-column-header span {
  display: block;
  margin-top: 4px;

  color: #8794a6;
  font-size: 0.7rem;
}

.pipeline-column-header strong {
  flex: 0 0 auto;

  color: #205fa6;
  font-size: 0.78rem;
}

.pipeline-column-body {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  gap: 12px;

  padding: 13px;
}

.opportunity-card {
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 16px;

  border: 1px solid #dfe6ef;
  border-radius: 14px;

  background: #ffffff;

  box-shadow:
    0 5px 15px rgba(25, 45, 75, 0.035);
}

.opportunity-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.opportunity-card-top time {
  color: #8a97a8;

  font-size: 0.65rem;
  font-weight: 700;
}

.opportunity-probability {
  display: inline-flex;
  align-items: center;

  min-height: 25px;
  padding: 3px 8px;

  border-radius: 999px;

  background: #edf4fc;
  color: #2364a8;

  font-size: 0.66rem;
  font-weight: 850;
}

.opportunity-title {
  color: #19273d;

  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}

.opportunity-title:hover {
  color: #155da9;
}

.opportunity-company {
  color: #65768b;

  font-size: 0.74rem;
  font-weight: 650;
  text-decoration: none;
}

.opportunity-company:hover {
  color: #155da9;
}

.opportunity-value {
  color: #16243a;

  font-size: 1rem;
  font-weight: 850;
}

.opportunity-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-top: 3px;
  padding-top: 11px;

  border-top: 1px solid #edf1f6;

  color: #7a899b;
  font-size: 0.68rem;
}

.opportunity-card-footer a {
  color: #1761ad;
  font-weight: 800;
  text-decoration: none;
}

.pipeline-empty {
  padding: 28px 15px;

  color: #8b97a7;

  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}


/* Estados */

.opportunity-status {
  display: inline-flex;
  align-items: center;

  width: fit-content;
  min-height: 29px;
  padding: 4px 10px;

  border-radius: 999px;

  background: #edf1f6;
  color: #526377;

  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.opportunity-status-new {
  background: #eaf3ff;
  color: #1761ad;
}

.opportunity-status-qualification {
  background: #f0ebff;
  color: #6642b4;
}

.opportunity-status-proposal {
  background: #fff3dc;
  color: #9c6500;
}

.opportunity-status-negotiation {
  background: #fff0df;
  color: #a75800;
}

.opportunity-status-won {
  background: #e6f8ef;
  color: #147951;
}

.opportunity-status-lost,
.opportunity-status-cancelled {
  background: #ffebee;
  color: #a52d44;
}


/* Formulário */

.field-help {
  display: block;
  margin-top: 7px;

  color: #8794a6;

  font-size: 0.72rem;
  line-height: 1.45;
}

.input-suffix-wrapper {
  position: relative;
}

.input-suffix-wrapper input {
  padding-right: 48px;
}

.input-suffix {
  position: absolute;
  top: 50%;
  right: 16px;

  color: #718096;

  font-size: 0.85rem;
  font-weight: 800;

  transform: translateY(-50%);
  pointer-events: none;
}

.crm-field-muted {
  opacity: 0.55;
}


/* Oportunidades na ficha da empresa */

.company-opportunities-list {
  display: flex;
  flex-direction: column;
}

.company-opportunity-row {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    auto
    auto
    55px
    auto;
  align-items: center;
  gap: 17px;

  padding: 16px 0;

  border-bottom: 1px solid #edf1f6;
}

.company-opportunity-row:last-child {
  border-bottom: 0;
}

.company-opportunity-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.company-opportunity-main span {
  color: #8491a3;
  font-size: 0.7rem;
}

.company-opportunity-row strong {
  color: #26364c;

  font-size: 0.78rem;
  white-space: nowrap;
}

.company-opportunity-probability {
  color: #66778b;

  font-size: 0.76rem;
  font-weight: 800;
}


/* Responsivo */

@media (max-width: 1300px) {
  .crm-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .opportunity-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-filters {
    grid-template-columns:
      minmax(260px, 1fr)
      minmax(180px, 1fr)
      minmax(210px, 1fr);
  }
}

@media (max-width: 850px) {
  .crm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-filters {
    grid-template-columns: 1fr;
  }

  .company-opportunity-row {
    grid-template-columns: 1fr auto;
  }

  .company-opportunity-row strong,
  .company-opportunity-probability {
    display: none;
  }
}

@media (max-width: 550px) {
  .crm-kpi-grid,
  .opportunity-kpi-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V0.6.0 — CORREÇÕES DA FICHA EXECUTIVA DA EMPRESA
   ========================================================= */


/* ---------------------------------------------------------
   Cartão de oportunidades comerciais
   --------------------------------------------------------- */

#company-opportunities {
  overflow: hidden;
}

#company-opportunities .content-card-header {
  padding-right: 30px;
  padding-left: 30px;
}

.company-opportunities-list {
  width: 100%;
  padding: 0 30px 10px;
  box-sizing: border-box;
}

.company-opportunity-row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.45fr)
    minmax(92px, auto)
    minmax(115px, auto)
    minmax(50px, auto)
    minmax(38px, auto);

  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 22px;

  padding: 19px 0;

  box-sizing: border-box;
}

.company-opportunity-row > * {
  min-width: 0;
}

.company-opportunity-main {
  overflow: hidden;
}

.company-opportunity-main .company-name-link {
  display: block;
  overflow: hidden;

  color: #17243a;

  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.35;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-opportunity-main span {
  display: block;
  overflow: hidden;
  margin-top: 4px;

  color: #7d8ca0;

  font-size: 0.72rem;
  line-height: 1.35;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-opportunity-row > strong {
  justify-self: end;

  color: #26364c;

  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.company-opportunity-probability {
  justify-self: center;

  color: #66778b;

  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
}

.company-opportunity-row .table-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;

  min-width: 38px;

  color: #155da9;

  font-size: 0.79rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.company-opportunity-row .table-action-link:hover {
  color: #0d4e93;
  text-decoration: underline;
}


/* ---------------------------------------------------------
   Histórico / perfil executivo
   --------------------------------------------------------- */

.company-activity-card {
  overflow: hidden;
}

.company-activity-card .content-card-header {
  padding-right: 30px;
  padding-left: 30px;
}

.company-activity-card .company-timeline {
  margin: 0;
  padding: 14px 30px 18px;
  box-sizing: border-box;
}

.company-activity-card .company-timeline::before {
  top: 38px;
  bottom: 42px;
  left: 47px;
}

.company-activity-card .timeline-event {
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 18px;

  width: 100%;
  min-width: 0;

  padding: 13px 0;
  box-sizing: border-box;
}

.company-activity-card .timeline-event-content {
  min-width: 0;
  padding: 2px 0 16px;
}

.company-activity-card .timeline-event-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;

  width: 100%;
}

.company-activity-card .timeline-event-heading strong {
  min-width: 0;

  overflow-wrap: anywhere;
}

.company-activity-card .timeline-event-heading time {
  justify-self: end;

  padding-right: 2px;

  color: #8a97a8;

  text-align: right;
  white-space: nowrap;
}

.company-activity-card .timeline-event-content p {
  max-width: 100%;
  padding-right: 12px;

  overflow-wrap: anywhere;
}

.company-activity-card .timeline-event-time {
  padding-right: 12px;
}


/* ---------------------------------------------------------
   Ecrãs intermédios
   --------------------------------------------------------- */

@media (max-width: 1180px) {
  .company-opportunity-row {
    grid-template-columns:
      minmax(180px, 1fr)
      minmax(90px, auto)
      minmax(105px, auto)
      minmax(42px, auto);

    gap: 16px;
  }

  .company-opportunity-probability {
    display: none;
  }
}


/* ---------------------------------------------------------
   Tablets
   --------------------------------------------------------- */

@media (max-width: 850px) {
  #company-opportunities .content-card-header,
  .company-activity-card .content-card-header {
    padding-right: 22px;
    padding-left: 22px;
  }

  .company-opportunities-list {
    padding-right: 22px;
    padding-left: 22px;
  }

  .company-opportunity-row {
    grid-template-columns:
      minmax(0, 1fr)
      auto;

    gap: 12px 18px;

    padding: 17px 0;
  }

  .company-opportunity-row .opportunity-status {
    justify-self: end;
  }

  .company-opportunity-row > strong {
    justify-self: start;
  }

  .company-opportunity-row .table-action-link {
    justify-self: end;
  }

  .company-opportunity-probability {
    display: none;
  }

  .company-activity-card .company-timeline {
    padding-right: 22px;
    padding-left: 22px;
  }

  .company-activity-card .company-timeline::before {
    left: 39px;
  }

  .company-activity-card .timeline-event {
    gap: 15px;
  }
}


/* ---------------------------------------------------------
   Telemóveis
   --------------------------------------------------------- */

@media (max-width: 600px) {
  #company-opportunities .content-card-header,
  .company-activity-card .content-card-header {
    padding-right: 18px;
    padding-left: 18px;
  }

  #company-opportunities .content-card-header {
    align-items: flex-start;
  }

  .company-opportunities-list {
    padding-right: 18px;
    padding-left: 18px;
  }

  .company-opportunity-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

  .company-opportunity-row > strong {
    font-size: 0.75rem;
  }

  .company-activity-card .company-timeline {
    padding: 10px 18px 16px;
  }

  .company-activity-card .company-timeline::before {
    left: 35px;
  }

  .company-activity-card .timeline-event {
    grid-template-columns: 35px minmax(0, 1fr);
    gap: 12px;
  }

  .company-activity-card .timeline-event-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .company-activity-card .timeline-event-heading time {
    align-self: flex-start;
    padding-right: 0;
  }

  .company-activity-card .timeline-event-content p,
  .company-activity-card .timeline-event-time {
    padding-right: 0;
  }
}


/* =========================================================
   V0.6.0 — ESPAÇAMENTO ENTRE HEADER E CARTÕES
   ========================================================= */

/* Espaço entre o cabeçalho da página e a secção seguinte */
.page-header-card {
    margin-bottom: 28px !important;
}

/* Caso existam páginas com toolbar logo após o cabeçalho */
.page-header-card + .toolbar-card {
    margin-top: 0;
}

/* Dashboard de empresas (KPIs) */
.page-header-card + .company-dashboard-grid,
.page-header-card + .company-summary-grid,
.page-header-card + .company-kpi-grid {
    margin-top: 0;
}

/* CRM (KPIs) */
.page-header-card + .crm-kpi-grid {
    margin-top: 0;
}

/* Pequenos ecrãs */
@media (max-width: 768px) {
    .page-header-card {
        margin-bottom: 20px !important;
    }
}



/* =========================================================
   V0.6.0 — AJUSTE DO CABEÇALHO DA FICHA DA EMPRESA
   ========================================================= */

.page-header-card .title-with-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.page-header-card .title-with-status > div {
  min-width: 0;
}

.page-header-card .title-with-status h2 {
  margin: 0;
}

.page-header-card .title-with-status .status-pill {
  flex: 0 0 auto;
  margin: 0;
}

.page-header-card .page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.page-header-card .page-header-actions > a,
.page-header-card .page-header-actions > button,
.page-header-card .page-header-actions > form {
  flex: 0 0 auto;
}

.page-header-card .page-header-actions form {
  margin: 0;
}


/* Larguras intermédias */

@media (max-width: 1180px) {
  .page-header-card {
    align-items: flex-start;
  }

  .page-header-card .page-header-actions {
    max-width: 620px;
    gap: 14px;
  }
}


/* Tablets */

@media (max-width: 850px) {
  .page-header-card {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .page-header-card .page-header-actions {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
}


/* Telemóveis */

@media (max-width: 600px) {
  .page-header-card .title-with-status {
    align-items: flex-start;
    gap: 10px;
  }

  .page-header-card .page-header-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-header-card .page-header-actions > a,
  .page-header-card .page-header-actions > button,
  .page-header-card .page-header-actions > form,
  .page-header-card .page-header-actions form button {
    width: 100%;
  }
}



/* =========================================================
   V0.6.0 — AJUSTE DOS FILTROS E PIPELINE DO CRM
   ========================================================= */


/* Barra de filtros */

.toolbar-card {
  overflow: hidden;
}

.crm-filters {
  display: grid;
  grid-template-columns:
    minmax(280px, 1.5fr)
    minmax(180px, 0.7fr)
    minmax(180px, 0.7fr)
    auto
    auto;
  align-items: end;
  gap: 20px;

  width: 100%;
  padding: 24px 28px;
  box-sizing: border-box;
}

.crm-filters > * {
  min-width: 0;
}

.crm-filters input,
.crm-filters select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

.crm-filters .secondary-action {
  min-height: 44px;
  white-space: nowrap;
}

.crm-filters .text-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;

  padding: 0 4px;

  white-space: nowrap;
}


/* Pipeline */

.crm-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 20px;

  width: 100%;
  max-width: 100%;
  padding: 0 0 18px;
  overflow-x: auto;
  box-sizing: border-box;
}

.pipeline-column {
  min-width: 260px;
  max-width: none;
}

.pipeline-column-header {
  min-height: 98px;
  box-sizing: border-box;
}

.pipeline-column-body {
  min-height: 320px;
}


/* Evita que a última coluna fique colada à margem */

.crm-pipeline::after {
  display: block;
  width: 1px;
  content: "";
}


/* Ecrãs intermédios */

@media (max-width: 1250px) {
  .crm-filters {
    grid-template-columns:
      minmax(240px, 1.4fr)
      minmax(170px, 0.7fr)
      minmax(170px, 0.7fr)
      auto;
  }

  .crm-filters .text-action {
    grid-column: 4;
  }

  .crm-pipeline {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
  }
}


/* Tablets */

@media (max-width: 900px) {
  .crm-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
  }

  .crm-filters .filter-search {
    grid-column: 1 / -1;
  }

  .crm-filters .secondary-action,
  .crm-filters .text-action {
    width: 100%;
  }

  .crm-filters .text-action {
    grid-column: auto;
  }
}


/* Telemóveis */

@media (max-width: 600px) {
  .crm-filters {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .crm-filters .filter-search {
    grid-column: auto;
  }

  .crm-pipeline {
    grid-template-columns: repeat(4, minmax(245px, 1fr));
    gap: 14px;
  }

  .pipeline-column {
    min-width: 245px;
  }
}



/* =========================================================
   V0.6.0 — ESPAÇAMENTO ENTRE FILTROS E PIPELINE CRM
   ========================================================= */

.toolbar-card {
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .toolbar-card {
        margin-bottom: 22px;
    }
}

@media (max-width: 600px) {
    .toolbar-card {
        margin-bottom: 18px;
    }
}



/* =========================================================
   V0.6.1 — NOTAS E HISTÓRICO DA OPORTUNIDADE
   ========================================================= */

.opportunity-notes-card,
.opportunity-activity-card {
  overflow: hidden;
}

.opportunity-note-form {
  margin-bottom: 24px;
  padding: 20px;

  border: 1px solid #dfe7f0;
  border-radius: 14px;

  background: #f8fafc;
}

.opportunity-note-form textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  box-sizing: border-box;
}

.opportunity-note-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.opportunity-notes-list {
  display: flex;
  flex-direction: column;
}

.opportunity-note-item {
  padding: 20px 0;
  border-bottom: 1px solid #edf1f6;
}

.opportunity-note-item:last-child {
  border-bottom: 0;
}

.opportunity-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.opportunity-note-meta strong {
  color: #1d2b40;
  font-size: 0.8rem;
}

.opportunity-note-meta time {
  flex: 0 0 auto;

  color: #8a97a8;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.opportunity-note-body {
  margin-top: 10px;

  color: #5f7085;
  font-size: 0.78rem;
  line-height: 1.65;
}

.opportunity-note-body p {
  margin: 0 0 8px;
}

.opportunity-note-body p:last-child {
  margin-bottom: 0;
}


/* Timeline da oportunidade */

.opportunity-timeline {
  position: relative;

  display: flex;
  flex-direction: column;

  padding: 8px 0 2px;
}

.opportunity-timeline::before {
  position: absolute;
  top: 29px;
  bottom: 32px;
  left: 18px;

  width: 1px;

  background: #dfe7f0;

  content: "";
}

.opportunity-timeline-event {
  position: relative;

  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  gap: 15px;

  padding: 13px 0;
}

.opportunity-timeline-marker {
  position: relative;
  z-index: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 37px;
  height: 37px;

  border: 4px solid #ffffff;
  border-radius: 50%;

  background: #eaf3ff;
  color: #1761ad;

  box-shadow:
    0 0 0 1px #d8e3ef;

  font-size: 0.53rem;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.opportunity-activity-created {
  background: #eaf3ff;
  color: #1761ad;
}

.opportunity-activity-updated {
  background: #f0eaff;
  color: #6743af;
}

.opportunity-activity-status_changed {
  background: #fff3dc;
  color: #9c6500;
}

.opportunity-activity-note_added {
  background: #e8f7f1;
  color: #17795e;
}

.opportunity-activity-won {
  background: #e6f8ef;
  color: #147951;
}

.opportunity-activity-lost {
  background: #ffebee;
  color: #a52d44;
}

.opportunity-timeline-content {
  min-width: 0;
  padding: 3px 0 16px;

  border-bottom: 1px solid #edf1f6;
}

.opportunity-timeline-event:last-child
.opportunity-timeline-content {
  border-bottom: 0;
}

.opportunity-timeline-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.opportunity-timeline-heading strong {
  color: #1d2b40;

  font-size: 0.82rem;
  line-height: 1.4;
}

.opportunity-timeline-heading time {
  color: #8a97a8;

  font-size: 0.66rem;
  font-weight: 750;
  white-space: nowrap;
}

.opportunity-timeline-content p {
  margin: 6px 0 0;

  color: #66768a;

  font-size: 0.75rem;
  line-height: 1.55;
}

.opportunity-timeline-content small {
  display: block;
  margin-top: 7px;

  color: #9aa5b3;

  font-size: 0.64rem;
  font-weight: 700;
}

.opportunity-activity-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;

  margin-top: 8px;
}

.opportunity-activity-change span {
  display: inline-flex;
  align-items: center;

  min-height: 26px;
  padding: 3px 9px;

  border-radius: 999px;

  background: #edf3fa;
  color: #52677f;

  font-size: 0.67rem;
  font-weight: 800;
}

.opportunity-activity-change b {
  color: #8b98a9;
  font-size: 0.72rem;
}


@media (max-width: 600px) {
  .opportunity-note-meta,
  .opportunity-timeline-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .opportunity-note-form-actions {
    justify-content: stretch;
  }

  .opportunity-note-form-actions .primary-action {
    width: 100%;
  }
}

