/* === Faturamais — Design Tokens === */
:root {
  --primary: #0a2540;
  --primary-600: #0d3b5c;
  --accent: #00b894;
  --accent-600: #009c7a;
  --accent-400: #00d4aa;
  --danger: #e63946;
  --warning: #f59e0b;
  --info: #3b82f6;
  --text: #1a1a2e;
  --text-secondary: #5f6b7a;
  --text-light: #8a95a5;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 12px 40px rgba(10, 37, 64, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
}

[data-theme="dark"],
body.dark {
  --text: #e8ecf1;
  --text-secondary: #9aa5b1;
  --text-light: #6b7a8a;
  --bg: #0b0f14;
  --surface: #121820;
  --surface-elevated: #18222e;
  --border: #243341;
  --primary: #8ab4f8;
  --primary-600: #aecbfa;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* === Tipografia === */
.display {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.25rem; }

.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }

/* === Botões === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-elevated);
}

/* === Layout geral === */
.container {
  width: min(100% - 2rem, 1150px);
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--surface);
}

/* === Header/Nav === */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}

.logo svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* === Hero === */
.hero {
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  color: var(--accent-600);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.hero-proof strong {
  color: var(--text);
  font-size: 1.1rem;
}

.hero-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

/* === Features === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 184, 148, 0.12);
  color: var(--accent-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* === Pricing === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  position: relative;
}

.badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.pricing-card h3 {
  margin-bottom: 0.25rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 1rem 0;
}

.price span {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.pricing-features {
  list-style: none;
  margin: 1.5rem 0;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.pricing-features li svg {
  flex-shrink: 0;
  color: var(--accent-600);
}

/* === FAQ === */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

.faq-item p {
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

/* === Footer === */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 1.5rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: #fff;
}

/* === Dashboard === */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--primary);
  color: #fff;
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar .logo {
  color: #fff;
  padding: 0 1.5rem 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 0 0.75rem;
}

.sidebar nav a,
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active,
.sidebar nav button:hover,
.sidebar nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar nav a.active,
.sidebar nav button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.main {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar h1 {
  font-size: 1.75rem;
}

.user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.tema-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.kpi-change {
  font-size: 0.85rem;
  font-weight: 600;
}

.kpi-change.positive { color: var(--accent-600); }
.kpi-change.negative { color: var(--danger); }

.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 220px;
  padding-top: 1.25rem;
}

.bar {
  flex: 1;
  background: linear-gradient(to top, var(--accent-600), var(--accent-400));
  border-radius: 6px 6px 0 0;
  min-width: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 0.5rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.donut-chart {
  width: 160px;
  height: 160px;
  margin: 0 auto 1.25rem;
  position: relative;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card h3 {
  margin-bottom: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody td {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody strong {
  color: var(--text);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status.done { background: rgba(0, 184, 148, 0.12); color: var(--accent-600); }
.status.pending { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.status.shipping { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.status.cancelado { background: rgba(230, 57, 70, 0.12); color: var(--danger); }
.status.warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.config-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.config-form input,
.config-form select,
.config-form textarea {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.config-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.config-form .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

/* === Responsividade === */
@media (max-width: 1024px) {
  .hero-grid,
  .features-grid,
  .pricing-grid,
  .config-grid,
  .charts-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: 3rem 0;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 1rem;
  }

  .topbar h1 {
    font-size: 1.35rem;
  }

  .topbar .user span {
    display: none;
  }

  .section {
    padding: 3rem 0;
  }
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
}

.toast.show {
  display: block;
  animation: slideIn 0.3s ease;
}

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

/* === Acessibilidade === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[aria-hidden="true"] {
  pointer-events: none;
}

/* === Animações e microinterações === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero > .container > .hero-grid > div:first-child {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-visual {
  animation: fadeInUp 1s ease 0.15s forwards;
  opacity: 0;
}

.feature-card:nth-child(1) { animation: fadeInUp 0.6s ease 0.1s forwards; opacity: 0; }
.feature-card:nth-child(2) { animation: fadeInUp 0.6s ease 0.2s forwards; opacity: 0; }
.feature-card:nth-child(3) { animation: fadeInUp 0.6s ease 0.3s forwards; opacity: 0; }
.feature-card:nth-child(4) { animation: fadeInUp 0.6s ease 0.4s forwards; opacity: 0; }
.feature-card:nth-child(5) { animation: fadeInUp 0.6s ease 0.5s forwards; opacity: 0; }
.feature-card:nth-child(6) { animation: fadeInUp 0.6s ease 0.6s forwards; opacity: 0; }

.pricing-card:nth-child(1) { animation: fadeInUp 0.6s ease 0.1s forwards; opacity: 0; }
.pricing-card:nth-child(2) { animation: fadeInUp 0.6s ease 0.2s forwards; opacity: 0; }
.pricing-card:nth-child(3) { animation: fadeInUp 0.6s ease 0.3s forwards; opacity: 0; }

/* === Loading === */
.skeleton {
  background: linear-gradient(90deg, var(--surface-elevated) 25%, var(--bg) 50%, var(--surface-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

