/* ─────────────────────────────────────────────────────────
   Remessio — identidade visual
   Para trocar a paleta da marca, altere apenas os tokens em :root.
   ───────────────────────────────────────────────────────── */
:root {
  /* Base (azul-tinta, não preto) */
  --bg:        #0F1626;
  --surface:   #161F33;
  --surface2:  #1D2842;
  --border:    #2A3756;
  --border-strong: #3A4A70;

  /* Marca: azul "aerograma" + verde reservado a sucesso/entrega */
  --brand:        #4D8DFF;
  --brand-dark:   #2F6FE6;
  --brand-soft:   rgba(77,141,255,.14);
  --brand-grad:   linear-gradient(135deg, #4D8DFF 0%, #2ED3B7 100%);

  --success:      #34D399;
  --success-soft: rgba(52,211,153,.14);
  --warning:      #F5B544;
  --warning-soft: rgba(245,181,68,.14);
  --danger:       #F0586B;
  --danger-soft:  rgba(240,88,107,.14);
  --info:         #4D8DFF;
  --info-soft:    rgba(77,141,255,.14);

  --text:     #EDF1FA;
  --text-sec: #A8B3CC;
  --muted:    #6B7795;

  /* Compatibilidade com a paleta antiga */
  --accent: var(--brand);
  --accent-dark: var(--brand-dark);

  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

[x-cloak] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }

/* Estrutura */
.sidebar { background: var(--surface); border-right: 1px solid var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-sm { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.divider { border-color: var(--border); }
hr.divider { border-top-width: 1px; }

/* Marca */
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand-grad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -8px rgba(77,141,255,.8);
}
.brand-mark svg { width: 20px; height: 20px; color: #0B1222; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.brand-tag  { font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .01em; }

/* Campos */
.input-base {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; padding: 8px 12px; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.input-base:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-base::placeholder { color: var(--muted); }
select.input-base option { background: var(--surface2); }
textarea.input-base { resize: vertical; min-height: 80px; }
.checkbox-green, .checkbox { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
input[type="date"].input-base, input[type="time"].input-base { color-scheme: dark; }

/* Botões */
.btn-primary {
  background: var(--brand); color: #fff; font-weight: 600; font-family: inherit;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, transform .05s; border: none;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; color: var(--text-sec); font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; font-size: 13px;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border-strong); }
.btn-danger {
  background: transparent; color: var(--danger); font-family: inherit;
  border: 1px solid rgba(240,88,107,.45); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; font-size: 13px;
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-warning {
  background: transparent; color: var(--warning); font-family: inherit;
  border: 1px solid rgba(245,181,68,.45); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; font-size: 13px;
}
.btn-warning:hover { background: var(--warning-soft); border-color: var(--warning); }
.btn-success {
  background: var(--success); color: #062A1C; font-weight: 600; font-family: inherit;
  border: none; border-radius: var(--radius-sm); cursor: pointer; transition: filter .15s; font-size: 13px;
}
.btn-success:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Navegação */
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text-sec);
  font-size: 13.5px; font-weight: 500; transition: all .15s; cursor: pointer;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-section { margin: 14px 0 4px; padding: 0 12px; font-size: 11px; font-weight: 600; color: var(--muted); }

/* Badges */
.badge-green, .badge-red, .badge-blue, .badge-yellow, .badge-gray {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}
.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-red    { background: var(--danger-soft);  color: var(--danger); }
.badge-blue   { background: var(--info-soft);    color: var(--info); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-gray   { background: var(--surface2);     color: var(--text-sec); }

/* Progresso de campanha */
.progress { height: 8px; border-radius: 999px; background: var(--surface2); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .6s ease; }
.progress.is-live > span {
  background-image: linear-gradient(135deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%,
                    rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%, transparent);
  background-size: 18px 18px; animation: progress-stripes 1s linear infinite;
}
.progress.is-done > span { background: var(--success); }
.progress.is-paused > span { background: var(--warning); }
.progress.is-cancel > span { background: var(--muted); }
@keyframes progress-stripes { from { background-position: 0 0; } to { background-position: 18px 0; } }
@media (prefers-reduced-motion: reduce) { .progress.is-live > span { animation: none; } }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.kpi .kpi-label { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.kpi .kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: 11.5px; color: var(--muted); }

/* Modal e toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,9,18,.72); backdrop-filter: blur(2px);
  z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; max-width: 760px;
  width: 100%; max-height: 88vh; overflow-y: auto;
}
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 500; max-width: 420px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
}
.toast-success { background: #123B2E; border: 1px solid var(--success); color: #CFF7E6; }
.toast-error   { background: #42202A; border: 1px solid var(--danger);  color: #FFD9DF; }

/* Tabelas */
table th { font-weight: 600; }
tbody tr:hover { background: rgba(255,255,255,.02); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Responsivo */
.topbar { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; padding: 16px !important; }
  .topbar { display: flex; }
  .grid-2 { grid-template-columns: 1fr !important; }
}
