* {
  box-sizing: border-box;
}

.dashboard {
  max-width: 1200px;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
  min-width: 0;
}

.welcome-banner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  color: #172033;
  background:
    radial-gradient(circle at top right, rgba(196, 181, 253, .42), transparent 34%),
    radial-gradient(circle at bottom left, rgba(253, 186, 116, .3), transparent 38%),
    linear-gradient(135deg, #fff7ed 0%, #eff6ff 48%, #f5f3ff 100%);
  border: 1px solid #93c5fd;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .16);
  animation: welcome-banner-fade-in 0.35s ease-out both;
}

.welcome-banner.is-dismissing {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.welcome-banner__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 26px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fde68a, #ddd6fe);
  box-shadow: 0 8px 18px rgba(124, 58, 237, .13);
}

.welcome-banner__content {
  flex: 1 1 auto;
  min-width: 0;
}

.welcome-banner__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome-banner h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.welcome-banner p {
  margin: 3px 0;
  color: #526079;
  font-size: 14px;
  line-height: 1.55;
}

.welcome-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}

.welcome-banner__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  color: #4338ca;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.welcome-banner__button:hover {
  transform: translateY(-1px);
  background: #ede9fe;
  border-color: #a78bfa;
}

.welcome-banner__button:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.3);
  outline-offset: 2px;
}

.welcome-banner__button--primary {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #7c3aed);
  border-color: #6366f1;
}

.welcome-banner__button--primary:hover {
  background: linear-gradient(135deg, #0369a1, #6d28d9);
  border-color: #6d28d9;
}

.welcome-banner__button--dismiss {
  color: #475569;
  background: #ffffff;
  border-color: #cbd5e1;
}

.welcome-banner__button[disabled] {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.welcome-banner__status {
  min-height: 20px;
  margin-top: 8px !important;
  color: #b91c1c !important;
  font-size: 12px !important;
}

.onboarding-resume-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: welcome-banner-fade-in .3s ease-out both;
}

.onboarding-resume-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(56, 189, 248, .12);
  font-size: 23px;
}

.onboarding-resume-card__content { min-width: 0; }
.onboarding-resume-card h2 { margin: 0 0 5px; font-size: 17px; }
.onboarding-resume-card p { margin: 0 0 9px; color: var(--muted); font-size: 12px; }
.onboarding-resume-card__progress { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(148, 163, 184, .16); }
.onboarding-resume-card__progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0284c7, #38bdf8, #22c55e); }
.onboarding-resume-card__percent { color: #7dd3fc; font-size: 21px; }
.onboarding-resume-card__action { display: inline-flex; justify-content: center; padding: 10px 14px; border: 1px solid rgba(56, 189, 248, .35); border-radius: 10px; color: #bae6fd; background: rgba(14, 165, 233, .1); font-size: 13px; font-weight: 700; text-decoration: none; }

@keyframes welcome-banner-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .welcome-banner {
    padding: 18px;
  }

  .welcome-banner__actions,
  .welcome-banner__button {
    width: 100%;
  }

  .onboarding-resume-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .onboarding-resume-card__action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .welcome-banner {
    display: grid;
    gap: 14px;
  }

  .welcome-banner h2 {
    font-size: 21px;
  }

  .onboarding-resume-card {
    grid-template-columns: 1fr auto;
  }

  .onboarding-resume-card__icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-banner {
    animation: none;
  }
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 40%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(18, 24, 38, 0.98) 0%, rgba(15, 22, 34, 0.94) 100%);
  box-shadow: var(--shadow);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.06);
  filter: blur(8px);
  pointer-events: none;
}

.dashboard-hero__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-hero__copy {
  display: grid;
  gap: 12px;
  max-width: 720px;
  min-width: 0;
}

.dashboard-eyebrow,
.dashboard-section-heading__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #93c5fd;
}

.dashboard-hero__copy h2,
.dashboard-section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.dashboard-hero__copy p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.dashboard-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 360px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5f5;
  font-size: 12px;
}

.dashboard-hero__overview {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-overview-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.52)),
    rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

.hero-overview-card:nth-child(2) {
  border-color: rgba(56, 189, 248, 0.18);
}

.hero-overview-card:nth-child(3) {
  border-color: rgba(34, 197, 94, 0.18);
}

.hero-overview-card__label {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-overview-card__value {
  font-size: 20px;
  line-height: 1.35;
}

.hero-overview-card__foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.dashboard-section-heading p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.kpi-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  text-decoration: none;
  appearance: none;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.4), rgba(37, 99, 235, 0), rgba(34, 197, 94, 0.3));
}

.kpi-card--clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card--clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
}

.kpi-card--clickable:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.5);
  outline-offset: 2px;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.kpi-head > span:first-child,
.kpi-value,
.kpi-foot {
  min-width: 0;
  overflow-wrap: anywhere;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.kpi-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.kpi-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.14);
}

.kpi-pill--down {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
}

.kpi-pill--alert {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
}

.panel {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.18) 0%, rgba(15, 23, 42, 0.04) 100%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.ganho-custos {
  gap: 20px;
}

.ganho-custos-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.ganho-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
}

.ganho-card-header h3 {
  margin: 0;
  font-size: 16px;
}

.ganho-card-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ganho-chart {
  min-height: 220px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.45);
}

.chart-container {
  height: 320px;
  position: relative;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.16) 0%, rgba(15, 23, 42, 0.58) 100%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
  min-width: 0;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 1;
}

.chart-container.has-empty-state canvas {
  opacity: 0.4;
  filter: saturate(0.75);
}

.chart-empty-state {
  position: absolute;
  inset: 18px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  pointer-events: none;
}

.chart-empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.chart-empty-state span {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(9, 14, 25, 0.34);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

td {
  font-size: 14px;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.text-right {
  text-align: right;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.4);
}

.status-badge--paid {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.status-badge--pending {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}

.status-badge--canceled {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: none;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-financeiro-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 55%, #22d3ee 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.btn-financeiro-primary:hover,
.btn-financeiro-primary:focus-visible {
  color: #ffffff;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
}

.btn-financeiro-secondary {
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(37, 99, 235, 0.12);
  color: #bfdbfe;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-financeiro-secondary:hover,
.btn-financeiro-secondary:focus-visible {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(37, 99, 235, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.financeiro-modal[hidden] {
  display: none;
}

.financeiro-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.financeiro-modal__card {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid rgba(96, 165, 250, 0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, #111827, #0b1120);
  color: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 34px rgba(37, 99, 235, 0.16);
}

.financeiro-modal__eyebrow {
  margin: 0 0 10px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.financeiro-modal__card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.financeiro-modal__card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.financeiro-modal__field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.financeiro-modal__field textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.financeiro-modal__field textarea:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.financeiro-modal__error {
  margin-top: 12px;
  color: #fecaca;
  font-size: 13px;
}

.financeiro-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.financeiro-modal__actions .btn {
  min-height: 42px;
}

.btn-pagar,
.pagar-conta {
  background: #16a34a;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-pagar:hover,
.pagar-conta:hover {
  background: #22c55e;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.btn-pagar:disabled,
.pagar-conta:disabled {
  cursor: wait;
  opacity: 0.7;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.table-actions {
  white-space: nowrap;
}

.table-state td {
  text-align: center;
  color: var(--muted);
}

.loading-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
  position: relative;
  margin: 6px auto;
  max-width: 70%;
}

@media (max-width: 720px) {
  .financeiro-modal {
    align-items: end;
    padding: 14px;
  }

  .financeiro-modal__card {
    border-radius: 16px;
  }

  .financeiro-modal__actions {
    display: grid;
  }

  .financeiro-modal__actions .btn {
    width: 100%;
  }
}

.loading-bar.short {
  max-width: 45%;
}

.loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.1s infinite;
}

.table-foot {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.panel--orders {
  gap: 18px;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

@media (max-width: 960px) {
  .dashboard {
    gap: 18px;
  }

  .dashboard-hero__header {
    flex-direction: column;
  }

  .dashboard-hero__chips {
    justify-content: flex-start;
    max-width: none;
  }

  .dashboard-hero__overview {
    grid-template-columns: 1fr;
  }

  .dashboard-section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-section-heading p {
    max-width: none;
    text-align: left;
  }

  .panel-header {
    flex-direction: column;
  }

  .panel-pill {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 26px;
  }

  .dashboard-hero {
    padding: 18px;
  }

  .dashboard-hero__copy h2 {
    font-size: 24px;
  }

  .kpi-grid,
  .panel-grid,
  .ganho-custos-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 15px;
  }

  .kpi-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-overview-card {
    min-height: 0;
  }

  .hero-overview-card__value {
    font-size: 18px;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .chart-container {
    height: 260px;
    padding: 10px;
    border-radius: 16px;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .table-foot {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar::after {
    animation: none;
  }
}
