.ReactModal__Overlay {
  background-color: rgba(0, 0, 0, 0.5) !important;
  -webkit-backdrop-filter: blur(1rem);
          backdrop-filter: blur(1rem);
}

.ReactModal__Content {
  margin: auto;
  max-width: min-content;
  max-height: min-content;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border-radius: 0.75rem !important;
  padding: 4rem !important;
  gap: 3rem;
}

.ReactModal__Content svg.close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  cursor: pointer;
}

.ReactModal__Content h1 {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  font-size: 3rem;
  text-align: center;
  color: #3C3C3C;
}

.ReactModal__Content > p {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  font-size: 1.5rem;
  min-width: 35rem;
  text-align: center;
  color: #848484;
}

.ReactModal__Content > button {
  border-radius: 5px;
  padding: 1rem 4rem;
  background: radial-gradient(121.43% 121.43% at -13.03% 5.46%, #FEB201 0%, #F3E706 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */;

  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-size: 1.75rem;
  text-align: center;
  color: #3C3C3C;
}

.ReactModal__Content > button.muted {
  color: #FFFFFF;
  background: #3C3C3C;
}

/* AE Theme CSS Variables */
:root,
[data-theme="dark"] {
  --ae-bg:      #0f0f1a;
  --ae-surface: #1a1a2e;
  --ae-surface2:#1c2128;
  --ae-border:  #30363d;
  --ae-text:    #e6edf3;
  --ae-muted:   #7d8590;
  --ae-green:   #3fb950;
  --ae-blue:    #58a6ff;
  --ae-red:     #f85149;
  --ae-amber:   #d29922;
  --ae-shadow:  rgba(0,0,0,0.4);
}

[data-theme="light"] {
  --ae-bg:      #f6f8fa;
  --ae-surface: #ffffff;
  --ae-surface2:#f0f2f5;
  --ae-border:  #d0d7de;
  --ae-text:    #24292f;
  --ae-muted:   #57606a;
  --ae-green:   #1a7f37;
  --ae-blue:    #0969da;
  --ae-red:     #cf222e;
  --ae-amber:   #9a6700;
  --ae-shadow:  rgba(0,0,0,0.1);
}

/* Responsive sidebar */
@media (max-width: 768px) {
  .ae-sidebar {
    position: fixed !important;
    left: -240px;
    z-index: 200;
    transition: left 0.25s;
    height: 100vh;
  }
  .ae-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px var(--ae-shadow);
  }
  .ae-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
  }
  .ae-sidebar-overlay.open {
    display: block;
  }
  .ae-hamburger {
    display: flex !important;
  }
  .ae-main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (min-width: 769px) {
  .ae-hamburger {
    display: none !important;
  }
  .ae-sidebar-overlay {
    display: none !important;
  }
}

.ae-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--ae-surface);
  border: 1px solid var(--ae-border);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.ae-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ae-muted);
  border-radius: 2px;
}

/* ── Responsive page padding ── */
.ae-page-pad {
  padding: 2rem;
}
@media (max-width: 768px) {
  .ae-page-pad {
    padding: 1rem;
  }
}

/* ── Responsive summary grid (minha-empresa) ── */
.ae-summary-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  grid-gap: 2rem;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 768px) {
  .ae-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .ae-summary-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ── Responsive card grid (minha-empresa dimensions) ── */
.ae-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 12px;
  gap: 12px;
}
@media (max-width: 900px) {
  .ae-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ae-card-grid { grid-template-columns: 1fr; }
}

/* ── Paineis: left module list → horizontal tabs on mobile ── */
.ae-panels-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--ae-border);
  overflow-y: auto;
  background: var(--ae-surface);
}
.ae-panels-content {
  flex: 1 1;
  overflow-y: auto;
  min-width: 0;
}
@media (max-width: 768px) {
  .ae-panels-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ae-border);
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    max-height: 52px;
    flex-shrink: 0;
  }
  .ae-panels-sidebar button {
    flex-shrink: 0;
    width: auto !important;
    min-width: -moz-fit-content;
    min-width: fit-content;
    height: 52px;
    border-right: none !important;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .ae-panels-body {
    flex-direction: column !important;
    overflow: visible !important;
    flex: none !important;
    min-height: 0;
  }
}

/* ── Resultado: two-column layout ── */
.ae-resultado-body {
  flex: 1 1;
  display: flex;
  overflow: hidden;
}
.ae-resultado-sidebar {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--ae-surface);
}
.ae-resultado-mobile-select {
  display: none;
}
@media (max-width: 768px) {
  .ae-resultado-body {
    flex-direction: column !important;
    overflow: visible !important;
    flex: none !important;
  }
  .ae-resultado-sidebar {
    display: none !important;
  }
  .ae-resultado-mobile-select {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ae-border);
    background: var(--ae-surface);
    flex-shrink: 0;
  }
  .ae-resultado-mobile-select select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--ae-border);
    background: var(--ae-surface2);
    color: var(--ae-text);
    font-size: 1.3rem;
    outline: none;
  }
}

/* ── Painel Inteligência: right panel hide + mobile header ── */
.pi-mobile-header {
  display: none;
}
.pi-right-panel {
  /* desktop: normal */
}
@media (max-width: 768px) {
  .pi-mobile-header {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ae-border);
    background: var(--ae-surface);
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ae-text);
  }
  .pi-right-panel {
    display: none !important;
  }
  #inteligencia-dashboard {
    flex-direction: column !important;
    overflow: visible !important;
  }
}

/* ── Shared app-shell layout fix for mobile ── */
.ae-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Minha empresa header ── */
@media (max-width: 768px) {
  .ae-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .ae-page-header .ae-company-badge {
    display: none !important;
  }
}

/* ── Shared app-shell layout fix for mobile ── */
@media (max-width: 768px) {
  .ae-app-shell {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }
  .ae-app-shell > .ae-main-content {
    overflow: visible !important;
    overflow-y: auto !important;
  }
}

/* ── Diagnóstico: nav lateral vira selector no mobile ── */
.ae-diag-layout {
  display: flex;
  padding: 7rem 4rem 0;
  gap: 2rem;
  height: calc(100vh - 7rem);
}
.ae-diag-mobile-bar {
  display: none;
}
@media (max-width: 768px) {
  .ae-diag-layout {
    flex-direction: column;
    padding: 5.5rem 1rem 0;
    height: auto;
    min-height: calc(100vh - 5.5rem);
    gap: 0;
    overflow: auto;
  }
  .ae-diag-mobile-bar {
    display: block;
    margin-bottom: 1rem;
  }
  .ae-diag-nav {
    display: none !important;
  }
  .ae-diag-questions {
    height: auto !important;
    max-height: none !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
  .ae-diag-questions::after {
    display: none !important;
  }
}

