/* ==========================================================
   CORPUS STORE — base compartilhada (tokens, reset, componentes)
   Paleta: fundo branco · laranja · preto · amarelo
   ========================================================== */
:root {
  --laranja: #ff6a00;
  --laranja-escuro: #e05500;
  --laranja-claro: #fff1e6;
  --preto: #111111;
  --preto-2: #1d1d1d;
  --amarelo: #ffc400;
  --amarelo-claro: #fff7d6;
  --branco: #ffffff;
  --cinza-50: #f7f7f7;
  --cinza-100: #efefef;
  --cinza-200: #e2e2e2;
  --cinza-400: #a3a3a3;
  --cinza-600: #5f5f5f;
  --verde: #14a44d;
  --vermelho: #dc3545;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Inter", sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.05);
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.18);
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--preto);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--laranja-escuro); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .3px; line-height: 1.1; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amarelo); outline-offset: 2px; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s, opacity .15s;
  background: var(--cinza-100); color: var(--preto);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--laranja); color: #fff; box-shadow: 0 6px 16px rgba(255,106,0,.28); }
.btn--primary:hover:not(:disabled) { background: var(--laranja-escuro); }
.btn--dark { background: var(--preto); color: #fff; }
.btn--dark:hover:not(:disabled) { background: #000; }
.btn--yellow { background: var(--amarelo); color: var(--preto); }
.btn--outline { background: transparent; border-color: var(--preto); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--cinza-100); }
.btn--danger { background: #fdecee; color: var(--vermelho); }
.btn--whats { background: #25d366; color: #fff; }
.btn--whats:hover { background: #1ebe5b; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 52px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; color: inherit; position: relative;
}
.icon-btn:hover { background: var(--cinza-100); }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner--dark { border-color: var(--cinza-200); border-top-color: var(--laranja); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--cinza-600); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--cinza-200); border-radius: var(--radius-sm);
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--laranja); box-shadow: 0 0 0 4px rgba(255,106,0,.12); }
.input--sm { min-height: 38px; padding: 6px 10px; }
.grid-2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--laranja); }
.form-error { color: var(--vermelho); font-size: 13px; font-weight: 600; min-height: 1em; margin: 4px 0 10px; }
.hint { font-size: 12px; color: var(--cinza-600); }

/* ---------- Chips / seletores ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--cinza-200); background: #fff; font-weight: 600; font-size: 14px;
  transition: all .15s;
}
.chip:hover:not(:disabled) { border-color: var(--preto); }
.chip.is-active { background: var(--preto); border-color: var(--preto); color: #fff; }
.chip:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
  background: var(--cinza-100); color: var(--preto);
}
.badge--amarelo { background: var(--amarelo); color: var(--preto); }
.badge--laranja { background: var(--laranja); color: #fff; }
.badge--preto { background: var(--preto); color: #fff; }
.badge--verde { background: #e3f6ea; color: #0b7a36; }
.badge--vermelho { background: #fdecee; color: var(--vermelho); }
.badge--cinza { background: var(--cinza-100); color: var(--cinza-600); }

/* ---------- Modal / Drawer ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(17,17,17,.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .3s var(--ease);
}
.modal.is-open { transform: none; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--cinza-100);
}
.modal__head h2 { font-size: 24px; }
.modal > form, .modal > .ck-done { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal__body { padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
.modal__foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cinza-100); display: flex; gap: 10px; flex-wrap: wrap; }
.modal__foot .btn { flex: 1; }
@media (min-width: 768px) {
  .modal {
    left: 50%; top: 50%; bottom: auto; right: auto;
    width: min(640px, calc(100vw - 48px)); max-height: 88vh;
    border-radius: 22px;
    transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
    transition: transform .25s var(--ease), opacity .2s;
  }
  .modal.is-open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .modal--wide { width: min(920px, calc(100vw - 48px)); }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 12px;
  background: var(--preto); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: all .25s var(--ease);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast--success { border-left: 5px solid var(--verde); }
.toast--error { border-left: 5px solid var(--vermelho); }
.toast--info { border-left: 5px solid var(--amarelo); }

.empty { text-align: center; padding: 48px 16px; color: var(--cinza-600); }
.empty .icon { display: block; width: 48px; height: 48px; color: var(--cinza-400); margin: 0 auto 10px; }

.skeleton { background: linear-gradient(90deg, var(--cinza-100) 0%, var(--cinza-50) 50%, var(--cinza-100) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
