:root {
  --bg-start: #f6f4ef;
  --bg-end: #efdbb2;
  --card-bg: rgba(255, 255, 255, 0.86);
  --card-border: rgba(78, 75, 72, 0.2);
  --text-main: #2e334e;
  --text-muted: #4e4b48;
  --button-bg: #f87c56;
  --button-border: #f87c56;
  --button-hover: #ea6d46;
  --button-secondary-bg: rgba(46, 51, 78, 0.08);
  --button-secondary-border: rgba(46, 51, 78, 0.28);
  --button-secondary-hover: rgba(46, 51, 78, 0.16);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg-end);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #fff9ec 0%, var(--bg-start) 38%, var(--bg-end) 100%);
  padding: 24px;
}

@supports (min-height: 100svh) {
  body {
    min-height: 100svh;
  }
}

.card {
  width: min(100%, 420px);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border-radius: 28px;
  margin-top: 66px;
  padding: 86px 24px 26px;
  box-shadow: 0 18px 44px rgba(46, 51, 78, 0.14);
  overflow: visible;
}

.site-footer {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.profile {
  text-align: center;
}

.profile-avatar-wrap {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  margin: -152px auto 16px;
  padding: 4px;
  background: linear-gradient(140deg, #f87c56, #f6d39a);
  box-shadow: 0 14px 32px rgba(46, 51, 78, 0.26);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: inherit;
  border: 3px solid rgba(255, 255, 255, 0.92);
  display: block;
}

.brand-wrap {
  margin: 0 auto 20px;
  width: min(100%, 320px);
}

.brand-logo {
  width: 100%;
  display: block;
}

.profile-role {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 8px 24px;
  border-radius: 999px;
  border: 1px solid rgba(46, 51, 78, 0.18);
  background: rgba(248, 124, 86, 0.12);
  color: #2e334e;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}


.profile-role-meta {
  margin-top: -4px;
  margin-bottom: 16px;
  padding: 6px 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.95;
}
.profile h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-welcome {
  color: #d7e0eb;
  font-size: 1rem;
  line-height: 1.4;
}

.profile-about {
  margin-top: 18px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(78, 75, 72, 0.2);
  background: rgba(239, 219, 178, 0.22);
  color: var(--text-main);
  text-align: left;
}

.profile-about h2 {
  font-size: 1.03rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2e334e;
}

.profile-about p {
  color: #4e4b48;
  font-size: 0.92rem;
  line-height: 1.45;
}

.specialties-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.specialty-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(78, 75, 72, 0.18);
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
}

.specialty-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.specialty-card p {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.specialties-grid .specialty-card:last-child {
  grid-column: 1 / -1;
}

.links {
  margin-top: 26px;
  display: grid;
  gap: 14px;
}

.link-button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  color: #fff9f6;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  background: var(--button-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(248, 124, 86, 0.35);
}

.link-button-secondary {
  color: var(--text-main);
  background: var(--button-secondary-bg);
  border-color: var(--button-secondary-border);
}

.link-button-secondary:hover,
.link-button-secondary:focus-visible {
  background: var(--button-secondary-hover);
  box-shadow: 0 12px 24px rgba(46, 51, 78, 0.16);
}

.admin-body {
  display: block;
}

.admin-login-logo-wrap {
  width: min(100%, 320px);
  margin: 24px auto 0;
}

.admin-login-logo {
  width: 100%;
  display: block;
}

.admin-card {
  max-width: 1000px;
  margin: 24px auto;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 24px;
}

.admin-dashboard-body {
  padding: 16px;
}

.admin-dashboard-card {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
}

@supports (min-height: 100svh) {
  .admin-dashboard-card {
    min-height: calc(100svh - 32px);
  }
}

.admin-login-card {
  max-width: 420px;
}

.admin-header p {
  color: var(--text-muted);
  margin-top: 6px;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logout-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--button-border);
  background: rgba(248, 124, 86, 0.12);
  color: var(--text-main);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.logout-button:hover {
  background: rgba(248, 124, 86, 0.2);
  border-color: rgba(248, 124, 86, 0.65);
  transform: translateY(-1px);
}

.logout-button:focus-visible {
  outline: 2px solid rgba(248, 124, 86, 0.65);
  outline-offset: 2px;
}

.logout-button svg {
  width: 20px;
  height: 20px;
}

.metric-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.metric-box p {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 8px;
}

.metric-comparativo {
  margin-top: 8px;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 22px;
  font-size: 0.88rem;
}

.metric-comparativo-linha {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-comparativo-linha.positivo {
  color: #1b8f3f;
}

.metric-comparativo-linha.negativo {
  color: #c43636;
}

.metric-comparativo-linha.neutro {
  color: var(--text-muted);
}

.metric-comparativo .seta {
  font-size: 0.78rem;
  line-height: 1;
}

.metrics-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.metrics-grid .metric-box {
  margin-top: 0;
}

.table-section {
  margin-top: 22px;
}

.chart-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.chart-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.66);
}

.chart {
  margin-top: 10px;
  min-height: 280px;
}

.table-section .chart {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.74);
}

.table-section h2 {
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.94rem;
}

th {
  background: rgba(248, 124, 86, 0.14);
}

td a {
  color: var(--text-main);
}

.table-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pagination-button {
  border: 1px solid var(--button-border);
  background: rgba(46, 51, 78, 0.08);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-form {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.login-form input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
}

.admin-tip {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.error-message {
  margin-top: 12px;
  color: #a12d2d;
}

.apexcharts-tooltip,
.apexcharts-tooltip-title,
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
  color: #1f2f46 !important;
}

.chart .apexcharts-text,
.chart .apexcharts-legend-text,
.chart .apexcharts-datalabel,
.chart .apexcharts-data-labels text {
  fill: var(--text-main) !important;
  color: var(--text-main) !important;
}

.periodo-section {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.periodo-section label {
  font-weight: 600;
}

.periodo-section select,
.periodo-customizado input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
}

.periodo-customizado {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-shell {
  display: block;
}

.admin-sidebar-title {
  margin-bottom: 10px;
}

.admin-menu-list,
.admin-submenu-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.admin-menu-link,
.admin-menu-toggle {
  width: 100%;
  text-align: left;
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-main);
  border: 1px solid transparent;
  background: rgba(46, 51, 78, 0.06);
  text-decoration: none;
}

.admin-menu-toggle {
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: inherit;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.admin-menu-link.is-active,
.admin-menu-link:hover,
.admin-menu-toggle:hover {
  border-color: var(--button-border);
  background: rgba(248, 124, 86, 0.2);
}

.admin-submenu-list {
  margin-top: 6px;
  margin-left: 12px;
}

.admin-content {
  min-width: 0;
  padding-top: 158px;
}

.report-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.report-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-grid input,
.report-grid select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-main);
}

.admin-sidebar-collapse {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--button-border);
  background: rgba(46, 51, 78, 0.08);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.admin-sidebar-collapse svg {
  width: 16px;
  height: 16px;
}

.admin-sidebar-collapse:hover {
  background: rgba(248, 124, 86, 0.2);
  transform: translateY(-1px);
}

.admin-menu-link,
.admin-menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-menu-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-menu-text {
  white-space: nowrap;
}

.admin-menu-group {
  position: relative;
}

.admin-submenu-list {
  margin-top: 6px;
  margin-left: 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

.admin-menu-group .admin-submenu-list.is-open {
  max-height: 200px;
  opacity: 1;
  pointer-events: auto;
}

.admin-topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 50;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(255, 249, 236, 0.92);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 12px;
}

.admin-topbar-nav-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.admin-topbar-logo-link {
  display: inline-flex;
  align-items: center;
}

.admin-topbar-logo {
  width: 200px;
  max-width: 38vw;
  height: auto;
  display: block;
}

.admin-menu-list-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-menu-logout-item .logout-form {
  margin: 0;
}

.admin-menu-logout-item .logout-button {
  width: 40px;
  height: 40px;
}

.admin-menu-group .admin-submenu-list.is-open {
  display: grid;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  max-height: none;
  opacity: 1;
  pointer-events: auto;
  margin: 0;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--button-border);
  background: rgba(255, 255, 255, 0.98);
  z-index: 30;
}

.report-field {
  display: grid;
  gap: 6px;
}

.report-grid > label,
.report-grid > select {
  margin: 0;
}

.scroll-top-button {
  position: sticky;
  margin-left: auto;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--button-border);
  background: rgba(248, 124, 86, 0.45);
  color: var(--text-main);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.scroll-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-button:hover {
  background: rgba(248, 124, 86, 0.7);
  transform: translateY(-2px);
}

@media (max-width: 920px) {
  .admin-content {
    padding-top: 224px;
  }

  .admin-topbar {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .admin-topbar-nav-wrap {
    flex-wrap: wrap;
  }

  .admin-menu-list-top {
    flex-wrap: wrap;
  }
}

.not-found-card {
  text-align: center;
}

.not-found-header h1 {
  font-size: 1.5rem;
  margin-top: 6px;
  margin-bottom: 10px;
}

.not-found-code {
  display: inline-block;
  margin: 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(46, 51, 78, 0.2);
  background: rgba(248, 124, 86, 0.12);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.not-found-description {
  color: var(--text-muted);
  line-height: 1.45;
}

.not-found-icons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 1.5rem;
}

.not-found-icons span {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(46, 51, 78, 0.2);
  background: rgba(46, 51, 78, 0.06);
}
