/* Acessibilidade e acabamento responsivo compartilhados por todas as áreas. */
:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.announcement .announcement-close {
  margin-left: 0;
  padding: 8px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.brand-home {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.sidebar .brand-home {
  width: 100%;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
}

.nav-group {
  margin: 0;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin: 9px 13px 3px;
  color: #637189;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  list-style: none;
  cursor: pointer;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: '⌄';
  color: #8190a7;
  font-size: 13px;
  transition: transform .18s ease;
}

.nav-group[open] summary::after {
  transform: rotate(180deg);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (min-width: 721px) and (max-width: 1100px) {
  .sidebar .nav-group summary {
    display: none;
  }

  .sidebar .nav-group:not([open]) > .nav-links {
    display: flex;
  }
}

html[data-theme="dark"] .report-filters,
html[data-theme="dark"] .portal-top nav {
  background: #111b2c;
  color: #e7edf7;
  border-color: #253248;
}

html[data-theme="dark"] .portal-welcome p:not(.eyebrow) {
  color: #a9b6c8;
}

html[data-theme="dark"] .secure-chip {
  background: #123b2d;
  color: #76dfad;
  border-color: #245b46;
}

html[data-theme="dark"] .steps i,
html[data-theme="dark"] .steps span {
  border-color: #334155;
  color: #a9b6c8;
}

html[data-theme="dark"] .steps span {
  background: #334155;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app main {
    min-width: 0;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    visibility: hidden;
    background: rgb(2 8 23 / 68%);
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .sidebar-backdrop.open {
    visibility: visible;
    opacity: 1;
  }

  .sidebar.open .nav-group summary {
    min-height: 44px;
    margin: 2px 8px;
    padding: 0 5px;
  }

  .announcement {
    min-height: 44px;
    gap: 8px;
    overflow: hidden;
  }

  .announcement b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .announcement button,
  .announcement .announcement-close {
    flex: 0 0 auto;
  }

  .topbar {
    gap: 8px;
  }

  .global-search {
    min-width: 0;
  }

  .global-search input {
    min-width: 0;
    width: 100%;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .menu-toggle,
  .icon-button,
  .auth-theme {
    min-width: 44px;
    min-height: 44px;
  }

  .app main > header {
    align-items: flex-start;
    gap: 12px;
  }

  /* Corrige a regra antiga que ocultava o texto do botão principal no celular. */
  .app .primary,
  .app main > header .primary {
    min-height: 44px;
    padding: 0 14px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .app .primary:first-letter {
    font-size: inherit;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
    max-width: none;
    min-height: 44px;
  }

  .filter-group {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .filter-pill,
  .action {
    min-height: 40px;
  }

  .panel {
    max-width: 100%;
    overflow-x: auto;
  }

  .panel table {
    min-width: 640px;
  }

  dialog,
  .modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  #modal-content {
    padding: 22px 16px;
  }

  .login-card input,
  .signup-main input,
  .signup-main select,
  .portal input,
  .portal select {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .cards,
  .portal-kpis {
    grid-template-columns: 1fr;
  }

  .login-card {
    width: min(390px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  .signup-main {
    padding: 22px 18px;
  }

  .steps {
    margin-left: auto;
    margin-right: auto;
  }

  .trial-chip {
    display: none;
  }

  .app main > header {
    flex-direction: column;
  }

  .app main > header .primary {
    width: 100%;
  }

  .portal-welcome,
  .portal-top {
    align-items: flex-start;
    gap: 12px;
  }
}
