:root {
  --ink: #0b1a34;
  --muted: #587095;
  --line: #c9d4e3;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --accent: #12274e;
  --accent-strong: #0d1f40;
  --accent-soft: #e8eef9;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at -15% -5%, #dce8fb 0%, rgba(220, 232, 251, 0) 70%),
    radial-gradient(860px 420px at 112% 12%, #e8f0ff 0%, rgba(232, 240, 255, 0) 68%),
    linear-gradient(145deg, #ebf1f8 0%, #f8faff 46%, #edf3fb 100%);
}

.app-topbar {
  border-color: #d8e2f0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 34px rgba(13, 31, 64, 0.09);
}

.app-menu-btn {
  border-color: #b9cce4;
  color: var(--accent);
  background: #f8fbff;
}

.app-menu-btn:hover {
  background: #eef4ff;
}

.app-brand-title {
  letter-spacing: -0.02em;
}

.app-brand-subtitle {
  color: #647ca2;
}

.app-user-chip {
  color: #2f466c;
  border: 1px solid #d8e2f0;
  background: rgba(245, 248, 252, 0.92);
  border-radius: 999px;
  padding: 6px 11px;
}

.app-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-bling-chip {
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.32rem 0.66rem;
  white-space: nowrap;
}

.app-bling-chip-connected {
  color: #0f6a47;
  border-color: #a8dfc4;
  background: #ebfbf3;
}

.app-bling-chip-disconnected {
  color: #7e4a08;
  border-color: #f2d7a8;
  background: #fff7e8;
}

.app-bling-chip-unconfigured {
  color: #7d1f1a;
  border-color: #f3c5c0;
  background: #fef3f2;
}

.app-bling-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.app-bling-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, -6px);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  min-width: 220px;
  max-width: 320px;
  border: 1px solid #c8d8ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(12, 33, 64, 0.16);
  color: #23466f;
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 0.48rem 0.62rem;
  text-align: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-bling-chip-wrap:hover .app-bling-tooltip,
.app-bling-chip-wrap:focus-within .app-bling-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-topbar-form {
  display: inline-flex;
}

.app-topbar-btn {
  border-radius: 999px;
  padding: 0.38rem 0.82rem;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.app-main {
  position: relative;
}

.app-sidebar {
  background:
    radial-gradient(580px 260px at -20% -20%, rgba(148, 178, 232, 0.32) 0%, rgba(148, 178, 232, 0) 70%),
    linear-gradient(180deg, #12284d 0%, #0e213f 100%);
  border-right: 1px solid rgba(157, 182, 224, 0.25);
  box-shadow: 14px 0 36px rgba(9, 27, 55, 0.2);
}

.app-nav-link {
  border: 1px solid transparent;
  color: #deebff;
  transition: all 0.2s ease;
}

.app-nav-link:hover {
  border-color: rgba(177, 201, 239, 0.3);
  background: rgba(162, 191, 238, 0.2);
  transform: translateX(2px);
}

.app-logout-btn,
.app-close-menu {
  transition: all 0.2s ease;
}

.app-close-menu {
  color: #d9e9ff;
}

.page-head {
  margin-bottom: 1.15rem;
}

.page-title {
  color: var(--ink);
  letter-spacing: -0.025em;
}

.page-subtitle {
  color: var(--muted);
}

.panel,
.bg-white.border.border-slate-200.rounded-xl,
.bg-white.border.border-slate-200.rounded {
  border-color: #d3dfee;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 16px 36px rgba(12, 33, 64, 0.08);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  top: -62px;
  right: -52px;
  width: 145px;
  height: 145px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(209, 224, 248, 0.55), rgba(209, 224, 248, 0));
  pointer-events: none;
}

.metric-label {
  color: #5e759a;
}

.metric-value {
  letter-spacing: -0.02em;
}

.table-shell {
  border-color: #cfdbeb;
}

.table-core {
  border-collapse: separate;
  border-spacing: 0;
}

.table-core thead,
.table-core thead th {
  background: #eff4fb;
  color: #2a4872;
}

.table-core tbody tr {
  transition: background-color 0.16s ease;
}

.table-core tbody tr:hover {
  background: #f8fbff;
}

.table-core tbody tr td,
.table-core thead tr th {
  border-color: #dbe6f2;
}

label,
.field-label {
  color: #324d76;
}

input,
select,
textarea,
.input-field {
  border-color: #c4d4e7;
  background: #ffffff;
  color: #0c1f3f;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #7b93b7;
}

input:focus,
select:focus,
textarea:focus,
.input-field:focus {
  outline: none;
  border-color: #739ad1;
  box-shadow: 0 0 0 4px rgba(115, 154, 209, 0.18);
}

textarea {
  resize: vertical;
}

.btn-primary,
.btn-dark,
.btn-ghost,
.btn-danger,
.btn-warning,
.btn-success,
.btn-soft {
  border: 1px solid transparent;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn-primary {
  border-color: #173367;
  background: linear-gradient(180deg, #1f4388 0%, #122b57 100%);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(18, 43, 87, 0.24);
}

.btn-dark {
  border-color: #2a456f;
  background: linear-gradient(180deg, #263f65 0%, #152845 100%);
  color: #ffffff;
}

.btn-dark:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: #c5d4e6;
  background: #ffffff;
  color: #1c3b67;
}

.btn-ghost:hover {
  background: #f2f7ff;
  border-color: #b3c8e1;
}

.btn-soft {
  border-color: #c7d8ee;
  background: #edf4ff;
  color: #1f4e89;
}

.btn-soft:hover {
  background: #e1edff;
}

.btn-danger {
  border-color: #f3c3bf;
  background: linear-gradient(180deg, #d8483f 0%, #ad241c 100%);
  color: #ffffff;
}

.btn-danger:hover {
  filter: brightness(1.03);
}

.btn-warning {
  border-color: #f5d29f;
  background: linear-gradient(180deg, #e39b23 0%, #ba6a11 100%);
  color: #ffffff;
}

.btn-success {
  border-color: #9dd9bc;
  background: linear-gradient(180deg, #18a365 0%, #0f7b4c 100%);
  color: #ffffff;
}

.btn-sm {
  font-size: 0.8rem;
}

.history-link {
  border-color: #d4e0ef;
}

.history-link:hover {
  border-color: #bacce3;
}

.app-alert {
  border-width: 1px;
  box-shadow: 0 10px 24px rgba(12, 33, 64, 0.08);
}

.app-alert-error {
  color: #8d1e17;
  border-color: #f5c4bf;
  background: var(--danger-soft);
}

.app-alert-success {
  color: #06603a;
  border-color: #a3e4c4;
  background: var(--success-soft);
}

.login-page {
  background:
    radial-gradient(760px 360px at 10% 12%, rgba(185, 209, 246, 0.52) 0%, rgba(185, 209, 246, 0) 68%),
    radial-gradient(580px 300px at 90% 82%, rgba(208, 224, 248, 0.56) 0%, rgba(208, 224, 248, 0) 66%),
    linear-gradient(145deg, #eaf1f9 0%, #f8faff 55%, #edf3fb 100%);
}

.login-card {
  border: 1px solid #d3e0ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 24px 50px rgba(10, 30, 61, 0.14);
}

.table-actions form {
  display: inline;
}

@media (max-width: 1023px) {
  .app-bling-chip-wrap {
    display: none;
  }

  .app-topbar-btn {
    font-size: 0.72rem;
    padding: 0.36rem 0.66rem;
  }

  .app-user-chip {
    display: none;
  }
}

.app-toast-stack {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  border: 1px solid #d8e2f0;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(11, 30, 56, 0.18);
  background: #ffffff;
  color: #0b1a34;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-message {
  font-size: 0.88rem;
  line-height: 1.35;
}

.app-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0.75;
}

.app-toast-close:hover {
  opacity: 1;
}

.app-toast-error {
  border-color: #f3c5c0;
  background: #fff5f4;
  color: #8d1e17;
}

.app-toast-success {
  border-color: #a3e4c4;
  background: #edfbf3;
  color: #06603a;
}

.app-toast-warning {
  border-color: #f5d29f;
  background: #fff8ee;
  color: #8f4e0f;
}

.app-toast-info {
  border-color: #c7d8ee;
  background: #f4f8ff;
  color: #1f4e89;
}

.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 26, 52, 0.48);
}

.app-confirm-backdrop.is-visible {
  display: flex;
}

.app-confirm-dialog {
  width: min(460px, 100%);
  border: 1px solid #cfdbeb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(11, 30, 56, 0.24);
  padding: 18px;
}

.app-confirm-title {
  margin: 0;
  color: #0b1a34;
  font-size: 1.05rem;
  font-weight: 700;
}

.app-confirm-message {
  margin: 10px 0 0;
  color: #324d76;
  font-size: 0.92rem;
  line-height: 1.45;
}

.app-confirm-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cost-marker {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}

.cost-marker-faturamento {
  background: #d8d8d8;
}

.cost-marker-frete {
  background: #f08c73;
}

.cost-marker-comissao {
  background: #e8a4cf;
}

.ecommerce-overview-card .text-3xl {
  font-size: 1.9rem;
  line-height: 1.1;
}

.ecommerce-overview-link {
  color: #5f7497;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ecommerce-overview-link:hover {
  color: #2f4f7b;
}
