:root {
  --ht-accent: #10b981;
  --ht-accent-strong: #059669;
  --ht-bg: #f4f7fb;
  --ht-surface: #ffffff;
  --ht-surface-soft: #f8fafc;
  --ht-border: #e6ebf1;
  --ht-text: #0f172a;
  --ht-muted: #64748b;
  --ht-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.dark {
  --ht-bg: #0b1220;
  --ht-surface: #111827;
  --ht-surface-soft: #172033;
  --ht-border: rgba(148, 163, 184, .14);
  --ht-text: #f8fafc;
  --ht-muted: #94a3b8;
  --ht-shadow: 0 14px 34px rgba(0,0,0,.24);
}

/* Dashboard: camada visual somente. Nenhuma regra funcional é alterada. */
.hany-glass {
  background: var(--ht-surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--ht-border) !important;
  box-shadow: var(--ht-shadow) !important;
}

.dark .hany-glass {
  background: var(--ht-surface) !important;
  border-color: var(--ht-border) !important;
}

.space-y-8.pb-10 {
  max-width: 1600px;
  margin-inline: auto;
}

.space-y-8.pb-10 > div:first-child {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--ht-border);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(16,185,129,.12), transparent 32%),
    var(--ht-surface);
  box-shadow: var(--ht-shadow);
}

.space-y-8.pb-10 > div:first-child h1 {
  color: var(--ht-text) !important;
  letter-spacing: -.04em !important;
}

.space-y-8.pb-10 > div:first-child p {
  color: var(--ht-muted) !important;
}

.period-btn {
  min-height: 38px;
  border-radius: 11px !important;
  white-space: nowrap;
}

.period-btn.active {
  background: var(--ht-text) !important;
  color: #fff !important;
  box-shadow: 0 7px 16px rgba(15,23,42,.14) !important;
}

.dark .period-btn.active {
  background: #6ee7b7 !important;
  color: #052e16 !important;
}

.stat-card {
  min-width: 0;
  border-radius: 20px !important;
  padding: 1.1rem !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}

.stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 30px rgba(15,23,42,.075) !important;
  border-color: rgba(16,185,129,.22) !important;
}

.stat-card h2 {
  color: var(--ht-text) !important;
  font-size: clamp(1.55rem, 2.6vw, 2rem) !important;
  line-height: 1.05 !important;
  letter-spacing: -.035em;
}

.stat-card p { line-height: 1.35; }

.lg\:col-span-2.hany-glass,
.space-y-6 > .hany-glass {
  border-radius: 24px !important;
}

.lg\:col-span-2.hany-glass { padding: 1.35rem !important; }
.space-y-6 > .hany-glass { padding: 1.1rem !important; }

#hanyDashboardChart { max-width: 100%; }

.space-y-6 a.group {
  min-height: 74px;
  border: 1px solid var(--ht-border);
  background: var(--ht-surface-soft) !important;
  border-radius: 16px !important;
}

.space-y-6 a.group:hover {
  background: var(--ht-accent) !important;
  border-color: var(--ht-accent) !important;
}

.font-num {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-variant-numeric: tabular-nums;
}

/* Mobile-first refinements: aparência de app, não desktop espremido. */
@media (max-width: 768px) {
  .space-y-8.pb-10 {
    padding-bottom: 5.25rem !important;
  }

  .space-y-8.pb-10 > :not([hidden]) ~ :not([hidden]) {
    margin-top: .85rem !important;
  }

  .space-y-8.pb-10 > div:first-child {
    gap: .9rem !important;
    padding: 1rem !important;
    border-radius: 18px !important;
    align-items: stretch !important;
  }

  .space-y-8.pb-10 > div:first-child h1 {
    font-size: 1.65rem !important;
    line-height: 1.08 !important;
  }

  .space-y-8.pb-10 > div:first-child p {
    margin-top: .35rem !important;
    font-size: .84rem !important;
  }

  .space-y-8.pb-10 > div:first-child > .hany-glass {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 14px !important;
    padding: .3rem !important;
    scrollbar-width: none;
  }

  .space-y-8.pb-10 > div:first-child > .hany-glass::-webkit-scrollbar { display: none; }

  .period-btn {
    flex: 0 0 auto;
    padding: .55rem .8rem !important;
    font-size: .65rem !important;
    min-height: 36px;
  }

  .grid.grid-cols-1.gap-6.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: .72rem !important;
  }

  .stat-card {
    padding: .88rem !important;
    border-radius: 17px !important;
  }

  .stat-card > .flex:first-of-type > div:first-child {
    padding: .55rem !important;
    border-radius: 12px !important;
  }

  .stat-card > .flex:first-of-type > div:first-child svg {
    width: 1.05rem !important;
    height: 1.05rem !important;
  }

  .stat-card > .flex:first-of-type > span {
    font-size: .57rem !important;
    padding: .28rem .42rem !important;
  }

  .stat-card .mt-6 { margin-top: .8rem !important; }

  .stat-card .mt-6 > p:first-child {
    font-size: .61rem !important;
    letter-spacing: .07em !important;
  }

  .stat-card h2 {
    margin-top: .28rem !important;
    font-size: clamp(1.22rem, 5.5vw, 1.55rem) !important;
    overflow-wrap: anywhere;
  }

  .stat-card .mt-6 > p:last-child {
    margin-top: .48rem !important;
    font-size: .62rem !important;
  }

  .grid.grid-cols-1.gap-8.lg\:grid-cols-3 {
    gap: .85rem !important;
  }

  .lg\:col-span-2.hany-glass {
    padding: 1rem !important;
    border-radius: 18px !important;
  }

  .lg\:col-span-2.hany-glass > .mb-8 {
    margin-bottom: 1rem !important;
    align-items: flex-start !important;
  }

  .lg\:col-span-2.hany-glass h3 { font-size: 1rem !important; }
  .lg\:col-span-2.hany-glass p { font-size: .72rem !important; }
  .lg\:col-span-2.hany-glass .relative.h-\[380px\] { height: 240px !important; }

  .space-y-6 { gap: 0 !important; }
  .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: .85rem !important; }

  .space-y-6 > .hany-glass {
    padding: 1rem !important;
    border-radius: 18px !important;
  }

  .space-y-6 .grid.grid-cols-3.gap-3 { gap: .55rem !important; }

  .space-y-6 a.group {
    min-height: 68px;
    padding: .65rem .3rem !important;
    border-radius: 14px !important;
  }

  .space-y-6 a.group span {
    font-size: .56rem !important;
    letter-spacing: .02em;
  }

  .space-y-6 a.group svg {
    width: 1.05rem !important;
    height: 1.05rem !important;
    margin-bottom: .38rem !important;
  }
}

@media (max-width: 370px) {
  .grid.grid-cols-1.gap-6.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-hany,
  .stat-card {
    animation: none !important;
    transition: none !important;
  }
}

/* v1.4 — refinamento mobile final */
.dashboard-alert-card {
  text-decoration: none !important;
  color: inherit;
}
.dashboard-alert-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}
.dashboard-alert-card:focus-visible {
  outline: 3px solid rgba(16, 185, 129, .28);
  outline-offset: 2px;
}
.dashboard-alert-arrow {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .space-y-8.pb-10 {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .space-y-8.pb-10 > div:first-child {
    gap: .68rem !important;
    padding: .82rem !important;
  }

  .space-y-8.pb-10 > div:first-child h1 {
    font-size: 1.5rem !important;
  }

  .space-y-8.pb-10 > div:first-child p {
    margin-top: .24rem !important;
    font-size: .8rem !important;
    line-height: 1.32 !important;
  }

  .space-y-8.pb-10 > div:first-child > .hany-glass {
    padding: .22rem !important;
    gap: .12rem !important;
  }

  .period-btn {
    min-height: 40px !important;
    padding: .5rem .68rem !important;
    font-size: .61rem !important;
    letter-spacing: .035em !important;
  }

  .stat-card .mt-6 > p:last-child {
    font-size: .66rem !important;
    line-height: 1.32 !important;
  }

  .lg\:col-span-2.hany-glass > .mb-8 {
    gap: .55rem !important;
    flex-wrap: wrap;
  }

  .lg\:col-span-2.hany-glass .relative.h-\[380px\] {
    height: 214px !important;
  }

  .space-y-6 > .hany-glass h4 {
    margin-bottom: .85rem !important;
  }

  .space-y-6 a.group {
    min-height: 72px !important;
    touch-action: manipulation;
  }

  .dashboard-alert-card {
    min-height: 64px;
    padding: .78rem !important;
    touch-action: manipulation;
  }

  .dashboard-alert-card > div {
    gap: .72rem !important;
  }

  .dashboard-alert-card h5 {
    font-size: .68rem !important;
  }

  .dashboard-alert-card p {
    font-size: .67rem !important;
  }

  .dashboard-alert-arrow {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 390px) {
  .period-btn {
    padding-inline: .58rem !important;
    font-size: .58rem !important;
  }
}
