/* ==========================================================================
   UGI - PREMIUM DESIGN SYSTEM & UX ARCHITECTURE (2026 STANDARDS)
   ========================================================================== */

:root {
  --bg-color: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-vip: #09090b;
  --text-main: #111111;
  --text-muted: #4b5563;
  --border-color: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --vip-text: #ffffff;
  --vip-accent: #facc15;
  --danger: #dc2626;
  --success: #16a34a;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-color: #0d0d10;
  --bg-surface: #16161a;
  --bg-vip: #1a1a1e;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #27272a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}
body {
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
mark {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  padding: 0 0.25em;
  border-radius: var(--radius-sm);
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--accent-hover);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section {
  padding: 100px 0;
}
.section--muted {
  background-color: var(--bg-surface);
}
.section-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}
h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 1.5rem;
}
h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.section__heading {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.section__heading p {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-size: 1rem;
  text-decoration: none;
  font-family: inherit;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: 1.1rem;
}
.btn-full {
  width: 100%;
  padding: 1rem;
}
.btn-primary {
  background-color: var(--text-main);
  color: var(--bg-color);
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-surface);
}
.btn-vip {
  background-color: var(--vip-accent);
  color: #000000;
  padding: 1rem 2.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.btn-vip:hover {
  background-color: #f59e0b;
  transform: translateY(-1px);
}
.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
}
.btn-ghost:hover {
  color: var(--text-main);
}

.btn-audit {
  background-color: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-color: #8b5cf6;
}
.btn-audit:hover:not(:disabled) {
  background-color: #8b5cf6;
  color: #ffffff;
}
[data-theme="dark"] .btn-audit {
  background-color: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
  border-color: #a78bfa;
}
[data-theme="dark"] .btn-audit:hover:not(:disabled) {
  background-color: #a78bfa;
  color: #000000;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--text-main);
  color: var(--bg-color);
  padding: 1rem;
  z-index: 1000;
  border-radius: var(--radius-md);
  transition: top 0.3s;
}
.skip-link:focus {
  top: 1rem;
}
.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 100;
}
.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header__brand {
  display: flex;
  align-items: center;
}
.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-main);
}
.site-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-main);
}
.topbar-right .theme-toggle {
  margin-right: 0.5rem;
}

.hero {
  padding: 6rem 0;
  text-align: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}
.hero__eyebrow-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}
.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 3rem;
}
.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}
.hero__proof {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}
.step__text {
  color: var(--text-muted);
  font-size: 1.05rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}
.feature-item {
  padding: 2.5rem;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.feature-item__icon {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
.feature-item__text {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.pricing-card {
  padding: 3rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);
}
.pricing-card--featured {
  border: 2px solid var(--accent);
}
.pricing-card__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent);
  color: #fff;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 30px;
  text-transform: uppercase;
  white-space: nowrap;
}
.pricing-card__volume {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.pricing-card__desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
  min-height: 48px;
}
.pricing-card__price {
  font-size: 3rem;
  font-weight: 700;
  margin-top: auto;
  line-height: 1;
  color: var(--text-main);
}
.pricing-card__price span {
  font-size: 1.5rem;
}
.pricing-card__peritem {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
}
.pricing-card__features {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pricing-card__features-item {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.plans-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.vip-banner {
  background-color: var(--bg-vip);
  color: var(--vip-text);
  border-radius: var(--radius-lg);
  padding: 5rem 3rem;
  margin: 2rem 0;
  text-align: center;
}
.vip-banner__content {
  max-width: 800px;
  margin: 0 auto;
}
.vip-banner__title {
  color: var(--vip-text);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 1.5rem;
}
.vip-banner__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 0;
}
.faq-item:first-child {
  border-top: 1px solid var(--border-color);
}
.faq-item dt {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}
.faq-item dd {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.site-footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  margin-top: auto;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}
.site-footer__copy {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-footer__links {
  display: flex;
  gap: 1.5rem;
}
.site-footer__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-footer__links a:hover {
  color: var(--text-main);
}

.about-hero {
  padding: 80px 0 60px;
  text-align: center;
}
.about-hero__content {
  max-width: 800px;
  margin: 0 auto;
}
.about-hero__title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 2rem;
}
.about-hero__text {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.team-member {
  padding: 3.5rem 3rem;
}
.team-member__name {
  font-size: 1.85rem;
  margin-bottom: 1.5rem;
}
.team-member__bio {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  color: var(--text-muted);
}
.experience-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-weight: 700;
}
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.experience-item {
  padding-left: 1.25rem;
  border-left: 2px solid var(--border-color);
}
.experience-item--highlight {
  border-left-color: var(--accent);
}
.experience-item__org {
  display: block;
  font-size: 1.1rem;
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.experience-item__role {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.legal-container {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 2rem;
}
.legal-container h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}
.legal-container h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.legal-container p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   ESTILOS DA TELA DE AUTENTICAÇÃO (LOGIN/SIGNUP)
   ========================================================================== */
.screen {
  display: none;
}
.screen.active {
  display: flex;
}
#screenAuth {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-surface);
  padding: 2rem;
}
.auth-box {
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}
.auth-logo-img {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  display: block;
}
.auth-title {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.auth-tabs {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}
.auth-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 0.95rem;
}
.auth-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.google-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}
.google-btn[data-theme="dark"] {
  background-color: var(--bg-color);
  color: var(--text-main);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.auth-divider .line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.auth-field {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}
.auth-field:focus {
  border-color: var(--accent);
  background: var(--bg-color);
}
#authFeedback {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  min-height: 1.2rem;
  font-weight: 500;
}
.feedback-error {
  color: var(--danger);
}
.feedback-success {
  color: var(--success);
}
.auth-forgot-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 1rem;
  text-decoration: underline;
  font-family: inherit;
  transition: var(--transition);
}
.auth-forgot-btn:hover {
  color: var(--text-main);
}
.auth-terms {
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}
.auth-terms label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  cursor: pointer;
}
.auth-terms input {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

/* ==========================================================================
   CONSULTOR (APP) - ESTRUTURA PRINCIPAL
   ========================================================================== */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-color);
}

/* --- SIDEBAR & NAVEGAÇÃO SaaS --- */
.sidebar {
  width: 280px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.new-project-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background-color: var(--text-main);
  color: var(--bg-color);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}
.new-project-btn:hover {
  opacity: 0.9;
}

.sidebar-nav {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}
.nav-item:hover,
.nav-item.active {
  background-color: var(--border-color);
  color: var(--text-main);
}
.nav-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.project-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.project-list-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  font-weight: 700;
}
.project-item-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  padding: 0.25rem;
  transition: var(--transition);
}
.project-item-wrap:hover,
.project-item-wrap.active {
  background-color: var(--border-color);
}
.project-item {
  flex: 1;
  background: none;
  border: none;
  text-align: left;
  padding: 0.6rem;
  color: var(--text-main);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}
.project-actions {
  display: flex;
  gap: 0.25rem;
  padding-right: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}
.project-item-wrap:hover .project-actions,
.project-item-wrap.active .project-actions {
  opacity: 1;
}
.project-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
}
.project-actions button:hover {
  color: var(--danger);
  background-color: rgba(220, 38, 38, 0.1);
}
.project-actions svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* --- TOPBAR --- */
.topbar {
  height: auto;
  min-height: 75px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background-color: var(--bg-color);
  flex-shrink: 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.topbar-brand > div {
  min-width: 0;
}
.topbar-name {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-surface);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}
.credit-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
}

/* --- CHAT AREA --- */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
#chatLog {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-right: 0.5rem;
  scroll-behavior: smooth;
}
.msg {
  display: flex;
  gap: 1rem;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg.bot {
  align-self: flex-start;
}
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.msg.user .msg-avatar {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.msg-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
.msg.user .msg-bubble {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-top-right-radius: 0;
}
.msg.bot .msg-bubble {
  background-color: var(--text-main);
  color: var(--bg-color);
  border-top-left-radius: 0;
}

.input-area {
  padding-top: 1.5rem;
  flex-shrink: 0;
}
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  transition: var(--transition);
}
.input-row:focus-within {
  border-color: var(--accent);
  background-color: var(--bg-color);
}
#userInput {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  max-height: 150px;
  outline: none;
  line-height: 1.5;
  padding: 0.25rem 0;
}
#userInput:disabled {
  opacity: 0.5;
}
.input-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-bottom: 0.15rem;
}
.input-buttons button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}
.input-buttons button:hover:not(:disabled) {
  color: var(--text-main);
  background-color: var(--border-color);
}
.input-buttons button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.input-buttons svg {
  width: 22px;
  height: 22px;
}
#sendBtn:not(:disabled) {
  background-color: var(--accent);
  color: #fff;
}
#sendBtn:not(:disabled) svg {
  fill: #fff;
}

/* --- RADAR DE EDITAIS (DASHBOARD) --- */
.radar-wrap {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  gap: 2rem;
}
.radar-wrap.active {
  display: flex;
}
.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.radar-title h2 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
}
.radar-title p {
  color: var(--text-muted);
}
.radar-alert-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.alert-text {
  flex: 1;
  min-width: 200px;
}
.alert-text strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}
.alert-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.alert-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.alert-input {
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-color);
  color: var(--text-main);
  outline: none;
}
.alert-input:focus {
  border-color: var(--accent);
}

/* Toggle Switch Estilo iOS */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--success);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.radar-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}
.filter-select:focus {
  border-color: var(--accent);
}

.edicts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.edict-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-color);
  transition: var(--transition);
}
.edict-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.edict-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.edict-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-open {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}
.edict-region {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.edict-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.edict-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.edict-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}
.edict-meta div {
  display: flex;
  justify-content: space-between;
}
.edict-meta strong {
  color: var(--text-main);
}

/* --- MODAL DA LOJA --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--bg-color);
  width: 95%;
  max-width: 900px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 4rem 3rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--border-color);
}
.modal-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.modal-header h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}
.modal-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}
.payment-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #b45309;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin: 2rem auto;
  max-width: 600px;
  text-align: center;
  font-size: 0.95rem;
}
[data-theme="dark"] .payment-warning {
  color: #fcd34d;
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.store-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: var(--transition);
}
.store-card:hover {
  border-color: var(--accent);
}
.store-card.featured {
  border: 2px solid var(--accent);
  background: var(--bg-color);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}
.store-price {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 1.5rem 0;
  color: var(--text-main);
}
.store-price span {
  font-size: 1.25rem;
  color: var(--text-muted);
}
.store-btn {
  margin-top: auto;
}

/* ==========================================================================
   RESPONSIVIDADE GERAL E MOBILE
   ========================================================================== */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-main);
}

@media (max-width: 768px) {
  /* Landing Page Mobile */
  .site-nav {
    display: none;
  }
  .hero__actions {
    flex-direction: column;
  }
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  /* Sidebar Mobile */
  .menu-toggle {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 200;
    height: 100vh;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
  }

  /* TOPBAR MOBILE */
  .topbar {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding: 1rem;
    padding-top: 4.5rem;
  }

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

  .topbar-logo-img {
    position: absolute;
    top: 1.25rem;
    left: 1rem;
    width: 32px;
    height: 32px;
  }

  .topbar-brand > div {
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .topbar-name {
    display: none;
  }
  .topbar-sub {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: normal;
    line-height: 1.4;
    width: 100%;
    word-break: break-word;
  }

  .topbar-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .topbar-right .btn-primary {
    display: none;
  }
  .credit-badge {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    margin: 0;
  }
  #exportBtn,
  #auditBtn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  #exportBtn svg,
  #auditBtn svg {
    margin-right: 4px !important;
    width: 14px;
    height: 14px;
  }

  .chat-wrap,
  .radar-wrap {
    padding: 1rem;
  }
  .radar-alert-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .alert-controls {
    width: 100%;
  }
  .alert-input {
    flex: 1;
  }
  .msg {
    max-width: 95%;
  }
  .modal-content {
    padding: 2rem 1.5rem;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ESTILOS COMPLEMENTARES DO PAINEL ADMIN UGI
   ========================================================================== */

/* Grid de Métricas Globais */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.metric-card {
  background: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--accent);
}
.metric-card h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.metric-card p {
  margin: 10px 0 0 0;
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main);
}

/* Caixas de Conteúdo/Seções */
.section-box {
  background: var(--bg-color);
  padding: 25px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  scroll-margin-top: 40px;
}
.section-box h2 {
  margin-top: 0;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

/* Formulários de Gestão */
.admin-controls {
  background: var(--bg-surface);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 25px;
}
.admin-controls h3 {
  margin-top: 0;
  font-size: 16px;
  color: var(--text-main);
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.admin-controls input {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 180px;
  font-family: var(--font-sans);
}
.admin-controls input:focus {
  border-color: var(--accent);
  outline: none;
}
.admin-controls .input-credits {
  max-width: 120px;
}

/* Busca */
.search-box {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  font-family: var(--font-sans);
}
.search-box:focus {
  border-color: var(--accent);
  outline: none;
}

/* Tabela de Usuários */
.table-responsive {
  overflow-x: auto;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  text-align: left;
}
.user-table th,
.user-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.user-table th {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 12px;
}
.user-table tr:hover {
  background-color: var(--bg-surface);
}
.user-id-cell {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.text-placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.credits-badge {
  font-weight: bold;
  color: var(--accent);
}

/* Botões de Ação na Tabela */
.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  color: white;
  margin-right: 5px;
  transition: var(--transition);
}
.btn-table-del {
  background-color: var(--danger);
}
.btn-table-del:hover {
  background-color: #b91c1c;
}
.btn-table-edit {
  background-color: var(--text-muted);
}
.btn-table-edit:hover {
  background-color: var(--text-main);
}

/* Ajustes Específicos para Admin Layout */
.admin-sidebar {
  position: fixed;
  left: 0;
  top: 0;
}
.admin-sidebar h2 {
  color: var(--text-main);
}
.admin-menu a {
  color: var(--text-muted);
}
.admin-menu a:hover {
  color: var(--text-main);
  background-color: var(--border-color);
}
.admin-main {
  margin-left: 280px;
  overflow-y: auto !important; /* Força a barra de rolagem a aparecer */
  height: 100vh; /* Define a altura para a tela toda */
}
.admin-header {
  margin-bottom: 30px;
}
.admin-status {
  color: var(--accent);
  font-weight: bold;
}
