/* =========================================================================
   Zenvio — sistema visual
   Todas as decisões de marca vivem nas variáveis abaixo. Para refinar a
   identidade, altere os tokens; os componentes não usam valores soltos.
   ========================================================================= */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Paleta oficial */
  --zv-deep: #172554;
  --zv-violet: #635BFF;
  --zv-lavender: #A5B4FC;
  --zv-lavender-light: #F3F1FF;
  --zv-gray-light: #F5F7FB;
  --zv-slate: #334155;
  --zv-success: #16A34A;
  --zv-warning: #D97706;
  --zv-error: #DC2626;
  --zv-white: #FFFFFF;

  /* Derivados funcionais (contraste AA sobre branco) */
  --zv-violet-strong: #4F46E5;
  --zv-ink: #172554;
  --zv-text: #334155;
  --zv-muted: #5B6578;
  --zv-line: #E2E6EF;
  --zv-line-strong: #CBD2E1;
  --zv-success-bg: #EAF7EF;
  --zv-success-ink: #116B33;
  --zv-warning-bg: #FDF3E4;
  --zv-warning-ink: #8A4B04;
  --zv-error-bg: #FDECEC;
  --zv-error-ink: #A61B1B;
  --zv-info-bg: var(--zv-lavender-light);

  /* Tipografia */
  --zv-font: "Inter", "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --zv-fs-xs: 0.75rem;
  --zv-fs-sm: 0.8125rem;
  --zv-fs-base: 0.9375rem;
  --zv-fs-md: 1.0625rem;
  --zv-fs-lg: 1.25rem;
  --zv-fs-xl: 1.625rem;
  --zv-fs-2xl: 2.125rem;
  --zv-fs-3xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --zv-lh: 1.55;

  /* Espaçamento (escala de 4px) */
  --zv-s1: 4px;
  --zv-s2: 8px;
  --zv-s3: 12px;
  --zv-s4: 16px;
  --zv-s5: 20px;
  --zv-s6: 24px;
  --zv-s8: 32px;
  --zv-s10: 40px;
  --zv-s12: 48px;
  --zv-s16: 64px;

  /* Forma — raios diferentes por hierarquia, não um único raio para tudo */
  --zv-r-control: 8px;
  --zv-r-panel: 14px;
  --zv-r-pill: 999px;
  --zv-shadow-pop: 0 12px 32px rgba(23, 37, 84, 0.16);
  --zv-focus: 0 0 0 3px rgba(99, 91, 255, 0.35);

  --zv-sidebar: 248px;
  --zv-content-max: 1180px;

  /* Cor de marca da agência (página de aprovação); padrão = violeta */
  --brand: var(--zv-violet);
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--zv-font);
  font-size: var(--zv-fs-base);
  line-height: var(--zv-lh);
  color: var(--zv-text);
  background: var(--zv-gray-light);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; }
h1, h2, h3, h4 { color: var(--zv-ink); line-height: 1.2; margin: 0 0 var(--zv-s3); font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: var(--zv-fs-xl); }
h2 { font-size: var(--zv-fs-lg); }
h3 { font-size: var(--zv-fs-md); }
p { margin: 0 0 var(--zv-s3); }
a { color: var(--zv-violet-strong); text-underline-offset: 2px; }
a:hover { color: var(--zv-deep); }
small, .text-sm { font-size: var(--zv-fs-sm); }
.muted { color: var(--zv-muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
:focus-visible { outline: none; box-shadow: var(--zv-focus); border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--zv-line); margin: var(--zv-s6) 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--zv-white); padding: 8px 12px; z-index: 100; border-radius: var(--zv-r-control); }
.skip-link:focus { left: 8px; }

/* ------------------------------------------------------------- marca */
.zv-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.zv-brand img { width: 32px; height: 32px; }
.zv-brand span { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--zv-ink); }
.zv-brand--light span { color: var(--zv-white); }

/* ------------------------------------------------------------- botões */
.btn {
  --btn-bg: var(--zv-violet);
  --btn-fg: var(--zv-white);
  --btn-bd: var(--zv-violet);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  font: 600 var(--zv-fs-sm)/1 var(--zv-font);
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bd);
  border-radius: var(--zv-r-control); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { --btn-bg: var(--zv-violet-strong); --btn-bd: var(--zv-violet-strong); color: var(--btn-fg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sm svg { width: 15px; height: 15px; }
.alert > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.badge svg, .material__meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.btn--secondary { --btn-bg: var(--zv-white); --btn-fg: var(--zv-ink); --btn-bd: var(--zv-line-strong); }
.btn--secondary:hover { --btn-bg: var(--zv-lavender-light); --btn-bd: var(--zv-lavender); --btn-fg: var(--zv-ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--zv-violet-strong); --btn-bd: transparent; }
.btn--ghost:hover { --btn-bg: var(--zv-lavender-light); --btn-bd: transparent; --btn-fg: var(--zv-deep); }
.btn--success { --btn-bg: var(--zv-success); --btn-bd: var(--zv-success); }
.btn--success:hover { --btn-bg: #12803a; --btn-bd: #12803a; }
.btn--danger { --btn-bg: var(--zv-white); --btn-fg: var(--zv-error-ink); --btn-bd: #F2B8B8; }
.btn--danger:hover { --btn-bg: var(--zv-error-bg); --btn-fg: var(--zv-error-ink); --btn-bd: var(--zv-error); }
.btn--danger-solid { --btn-bg: var(--zv-error); --btn-bd: var(--zv-error); }
.btn--danger-solid:hover { --btn-bg: #B91C1C; --btn-bd: #B91C1C; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: var(--zv-fs-xs); }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: var(--zv-fs-base); }
.btn--block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading .spinner { display: inline-block; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: zv-spin .7s linear infinite; }
@keyframes zv-spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--zv-s2); align-items: center; }
.inline-form { display: inline; }

/* ------------------------------------------------------------- formulários */
.field { display: grid; gap: 6px; margin-bottom: var(--zv-s4); }
.field label, .label { font-weight: 600; font-size: var(--zv-fs-sm); color: var(--zv-ink); }
.field .hint { font-size: var(--zv-fs-xs); color: var(--zv-muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  font: inherit; color: var(--zv-ink); background: var(--zv-white);
  border: 1px solid var(--zv-line-strong); border-radius: var(--zv-r-control);
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--zv-violet); box-shadow: var(--zv-focus); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--zv-error); }
.field-error { color: var(--zv-error-ink); font-size: var(--zv-fs-xs); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--zv-fs-sm); line-height: 1.45; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--zv-violet); flex: none; }
.form-grid { display: grid; gap: 0 var(--zv-s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.input-color { display: flex; gap: 8px; align-items: center; }
.input-color input[type="color"] { width: 46px; height: 42px; padding: 2px; border: 1px solid var(--zv-line-strong); border-radius: var(--zv-r-control); background: var(--zv-white); }
.form-actions { display: flex; gap: var(--zv-s2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--zv-s4); }

/* ------------------------------------------------------------- superfícies */
.panel { background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); padding: var(--zv-s6); }
.panel + .panel { margin-top: var(--zv-s6); }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: var(--zv-s3); margin-bottom: var(--zv-s4); flex-wrap: wrap; }
.panel__head h2, .panel__head h3 { margin: 0; }
.panel--tint { background: var(--zv-lavender-light); border-color: #E2DEFF; }
.stack > * + * { margin-top: var(--zv-s4); }
.grid { display: grid; gap: var(--zv-s6); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.divided > * + * { border-top: 1px solid var(--zv-line); }

/* Indicadores numéricos do painel: número grande, rótulo discreto, sem ícones decorativos */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); background: var(--zv-white); overflow: hidden; }
.figure { padding: var(--zv-s5) var(--zv-s6); border-right: 1px solid var(--zv-line); text-decoration: none; color: inherit; }
.figure:last-child { border-right: 0; }
.figure:hover { background: var(--zv-gray-light); }
.figure strong { display: block; font-size: var(--zv-fs-2xl); font-weight: 650; color: var(--zv-ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.figure span { font-size: var(--zv-fs-sm); color: var(--zv-muted); }
.figure--warning strong { color: var(--zv-warning-ink); }
.figure--success strong { color: var(--zv-success-ink); }
.figure--error strong { color: var(--zv-error-ink); }

/* Medidores de consumo */
.meter { display: grid; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; font-size: var(--zv-fs-sm); gap: 8px; }
.meter__bar { height: 8px; background: #E8EBF3; border-radius: var(--zv-r-pill); overflow: hidden; }
.meter__fill { height: 100%; background: var(--zv-violet); border-radius: inherit; min-width: 2px; }
.meter--warning .meter__fill { background: var(--zv-warning); }
.meter--full .meter__fill { background: var(--zv-error); }

/* ------------------------------------------------------------- status */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; font-size: var(--zv-fs-xs); font-weight: 600; border-radius: var(--zv-r-pill); white-space: nowrap; background: #EEF1F6; color: var(--zv-slate); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge--draft { background: #EEF1F6; color: var(--zv-slate); }
.badge--pending { background: var(--zv-warning-bg); color: var(--zv-warning-ink); }
.badge--approved { background: var(--zv-success-bg); color: var(--zv-success-ink); }
.badge--changes_requested { background: var(--zv-error-bg); color: var(--zv-error-ink); }
.badge--archived { background: #F1F2F4; color: #5F6672; }
.badge--plain::before { display: none; }
.badge--violet { background: var(--zv-lavender-light); color: var(--zv-violet-strong); }

/* ------------------------------------------------------------- alertas */
.alert { display: flex; gap: var(--zv-s3); align-items: flex-start; padding: var(--zv-s3) var(--zv-s4); border-radius: var(--zv-r-control); border: 1px solid; font-size: var(--zv-fs-sm); margin-bottom: var(--zv-s4); }
.alert p:last-child { margin-bottom: 0; }
.alert strong { color: inherit; }
.alert__body { flex: 1; }
.alert--success { background: var(--zv-success-bg); border-color: #BFE5CC; color: var(--zv-success-ink); }
.alert--warning { background: var(--zv-warning-bg); border-color: #F3D3A4; color: var(--zv-warning-ink); }
.alert--error { background: var(--zv-error-bg); border-color: #F5C2C2; color: var(--zv-error-ink); }
.alert--info { background: var(--zv-info-bg); border-color: #DCD7FF; color: var(--zv-deep); }
.alert .btn { flex: none; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------- tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--zv-fs-sm); }
.table th { text-align: left; font-weight: 600; color: var(--zv-muted); padding: 10px 16px; border-bottom: 1px solid var(--zv-line); background: #FAFBFD; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--zv-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFE; }
.table .row-link { font-weight: 600; color: var(--zv-ink); text-decoration: none; }
.table .row-link:hover { color: var(--zv-violet-strong); text-decoration: underline; }
.table td.actions { text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------- vazio */
.empty { text-align: center; padding: var(--zv-s12) var(--zv-s6); }
.empty h3 { margin-bottom: var(--zv-s2); }
.empty p { color: var(--zv-muted); max-width: 46ch; margin: 0 auto var(--zv-s4); }
.empty__mark { width: 52px; height: 52px; margin: 0 auto var(--zv-s4); border-radius: 14px; background: var(--zv-lavender-light); display: grid; place-items: center; color: var(--zv-violet); }

/* ------------------------------------------------------------- diálogo */
dialog.modal { border: 0; padding: 0; border-radius: var(--zv-r-panel); box-shadow: var(--zv-shadow-pop); width: min(520px, calc(100vw - 32px)); color: var(--zv-text); }
dialog.modal::backdrop { background: rgba(23, 37, 84, 0.45); }
.modal__body { padding: var(--zv-s6); }
.modal__body h2 { font-size: var(--zv-fs-lg); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--zv-s2); padding: var(--zv-s4) var(--zv-s6); background: var(--zv-gray-light); border-top: 1px solid var(--zv-line); }

/* Toast */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--zv-deep); color: var(--zv-white); padding: 12px 16px; border-radius: var(--zv-r-control); font-size: var(--zv-fs-sm); box-shadow: var(--zv-shadow-pop); transform: translateY(12px); opacity: 0; transition: .2s; pointer-events: none; }
.toast.is-visible { transform: none; opacity: 1; }

/* ------------------------------------------------------------- shell do painel */
.app { display: grid; grid-template-columns: var(--zv-sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--zv-deep); color: #C9D0E6; padding: var(--zv-s5) var(--zv-s4); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--zv-s6); overflow-y: auto; }
.sidebar .zv-brand { padding: 0 var(--zv-s2); }
.nav { display: grid; gap: 2px; }
.nav__label { font-size: var(--zv-fs-xs); color: #8E9AC0; padding: var(--zv-s3) var(--zv-s3) var(--zv-s1); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--zv-r-control); color: #D7DCEE; text-decoration: none; font-size: var(--zv-fs-sm); font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: var(--zv-white); }
.nav a[aria-current="page"] { background: rgba(165, 180, 252, 0.16); color: var(--zv-white); box-shadow: inset 3px 0 0 var(--zv-lavender); }
.sidebar__foot { margin-top: auto; display: grid; gap: var(--zv-s3); }
.plan-chip { background: rgba(255, 255, 255, 0.06); border-radius: var(--zv-r-control); padding: var(--zv-s3); font-size: var(--zv-fs-xs); color: #C9D0E6; }
.plan-chip strong { color: var(--zv-white); font-size: var(--zv-fs-sm); display: block; }
.plan-chip .meter__bar { background: rgba(255, 255, 255, 0.12); margin-top: 8px; }
.plan-chip .meter__fill { background: var(--zv-lavender); }
.plan-chip a { color: var(--zv-lavender); }

.sidebar-backdrop { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--zv-s4); padding: var(--zv-s3) var(--zv-s8); background: var(--zv-white); border-bottom: 1px solid var(--zv-line); position: sticky; top: 0; z-index: 20; min-height: 60px; }
.topbar__menu { display: none; }
.topbar__user { display: flex; align-items: center; gap: var(--zv-s3); font-size: var(--zv-fs-sm); margin-left: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--zv-lavender-light); color: var(--zv-violet-strong); display: grid; place-items: center; font-weight: 700; font-size: var(--zv-fs-sm); flex: none; }
.content { padding: var(--zv-s8); width: 100%; max-width: calc(var(--zv-content-max) + 2 * var(--zv-s8)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--zv-s4); flex-wrap: wrap; margin-bottom: var(--zv-s6); }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--zv-muted); }
.breadcrumb { font-size: var(--zv-fs-sm); margin-bottom: var(--zv-s2); color: var(--zv-muted); }
.breadcrumb a { color: var(--zv-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--zv-violet-strong); text-decoration: underline; }

.toolbar { display: flex; gap: var(--zv-s2); flex-wrap: wrap; align-items: center; margin-bottom: var(--zv-s4); }
.toolbar .input, .toolbar .select { width: auto; min-width: 200px; }
.segmented { display: inline-flex; background: #E9ECF4; border-radius: var(--zv-r-control); padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 12px; border-radius: 6px; font-size: var(--zv-fs-sm); font-weight: 500; color: var(--zv-slate); text-decoration: none; border: 0; background: none; cursor: pointer; font-family: inherit; }
.segmented [aria-current="true"], .segmented [aria-pressed="true"] { background: var(--zv-white); color: var(--zv-ink); box-shadow: 0 1px 2px rgba(23, 37, 84, .12); }

/* Lista de definição compacta */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: var(--zv-fs-sm); margin: 0; }
.kv dt { color: var(--zv-muted); }
.kv dd { margin: 0; color: var(--zv-ink); font-weight: 500; overflow-wrap: anywhere; }

/* Linha do tempo de atividades */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--zv-s4) 22px; font-size: var(--zv-fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--zv-lavender); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--zv-line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; color: var(--zv-muted); font-size: var(--zv-fs-xs); }

/* ------------------------------------------------------------- materiais (painel) */
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--zv-s4); }
.material { background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.material:hover { border-color: var(--zv-lavender); }
.material__thumb { aspect-ratio: 4 / 3; background: #EEF1F7; display: grid; place-items: center; overflow: hidden; position: relative; }
.material__thumb img, .material__thumb video { width: 100%; height: 100%; object-fit: cover; }
.material__kind { display: grid; place-items: center; gap: 6px; color: var(--zv-muted); font-size: var(--zv-fs-xs); font-weight: 600; }
.material__kind svg { width: 34px; height: 34px; color: var(--zv-violet); }
.material__version { position: absolute; left: 10px; top: 10px; background: rgba(23, 37, 84, .82); color: var(--zv-white); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--zv-r-pill); }
.material__body { padding: var(--zv-s3) var(--zv-s4) var(--zv-s4); display: grid; gap: 6px; }
.material__title { font-weight: 600; color: var(--zv-ink); font-size: var(--zv-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--zv-fs-xs); color: var(--zv-muted); }

/* Área de envio */
.dropzone { border: 1.5px dashed var(--zv-lavender); background: var(--zv-lavender-light); border-radius: var(--zv-r-panel); padding: var(--zv-s6); text-align: center; transition: background-color .15s, border-color .15s; }
.dropzone.is-over { background: #E9E5FF; border-color: var(--zv-violet); }
.dropzone p { margin: 0 0 var(--zv-s2); }
.dropzone strong { color: var(--zv-ink); }
.uploads { list-style: none; margin: var(--zv-s4) 0 0; padding: 0; display: grid; gap: var(--zv-s2); text-align: left; }
.upload-item { background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-control); padding: 10px 12px; display: grid; gap: 6px; font-size: var(--zv-fs-sm); }
.upload-item__row { display: flex; justify-content: space-between; gap: 8px; }
.upload-item__name { font-weight: 600; color: var(--zv-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item.is-error { border-color: #F5C2C2; background: var(--zv-error-bg); color: var(--zv-error-ink); }
.upload-item.is-done .meter__fill { background: var(--zv-success); }

/* Visualização de material */
.viewer { background: #0F1A3D; border-radius: var(--zv-r-panel); overflow: hidden; display: grid; place-items: center; min-height: 280px; }
.viewer { grid-template-columns: minmax(0, 1fr); }
.viewer img { display: block; max-height: 78vh; max-width: 100%; width: auto; height: auto; margin: 0 auto; }
.viewer__pdf-bar { display: flex; justify-content: center; padding: 10px; background: #0F1A3D; width: 100%; }
.viewer__pdf-bar a { color: var(--zv-lavender); font-size: var(--zv-fs-sm); font-weight: 600; }
.viewer video { display: block; width: 100%; max-height: 78vh; background: #000; }
.viewer iframe { width: 100%; height: 78vh; border: 0; background: var(--zv-white); }
.viewer__missing { color: #C9D0E6; padding: var(--zv-s10); text-align: center; font-size: var(--zv-fs-sm); }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--zv-text); }

.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.versions li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 8px; align-items: center; padding: 8px 10px; border-radius: var(--zv-r-control); font-size: var(--zv-fs-sm); }
.versions li.is-current { background: var(--zv-lavender-light); }

.comments { list-style: none; padding: 0; margin: 0 0 var(--zv-s4); display: grid; gap: var(--zv-s3); }
.comment { padding: var(--zv-s3) var(--zv-s4); border-radius: var(--zv-r-control); background: var(--zv-gray-light); font-size: var(--zv-fs-sm); }
.comment--client { background: var(--zv-lavender-light); }
.comment__head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: var(--zv-fs-xs); color: var(--zv-muted); }
.comment__head strong { color: var(--zv-ink); font-size: var(--zv-fs-sm); }
.comment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Bloco do link de aprovação */
.share { display: grid; gap: var(--zv-s3); }
.share__url { display: flex; gap: 6px; }
.share__url input { font-size: var(--zv-fs-xs); color: var(--zv-slate); background: var(--zv-gray-light); }

/* Planos (cobrança e site) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--zv-s4); }
.plan { background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); padding: var(--zv-s6); display: flex; flex-direction: column; gap: var(--zv-s3); }
.plan.is-current { border-color: var(--zv-violet); box-shadow: inset 0 0 0 1px var(--zv-violet); }
.plan.is-featured { border-color: var(--zv-deep); }
.plan h3 { margin: 0; font-size: var(--zv-fs-md); }
.plan__price { font-size: var(--zv-fs-2xl); font-weight: 700; color: var(--zv-ink); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan__price small { font-size: var(--zv-fs-sm); font-weight: 500; color: var(--zv-muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--zv-fs-sm); }
.plan li { display: flex; gap: 8px; }
.plan li svg { width: 16px; height: 16px; flex: none; color: var(--zv-success); margin-top: 2px; }
.plan .btn { margin-top: auto; }

/* ------------------------------------------------------------- autenticação */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__aside { background: var(--zv-deep); color: #D3D9EE; padding: var(--zv-s12); display: flex; flex-direction: column; justify-content: space-between; }
.auth__aside h2 { color: var(--zv-white); font-size: var(--zv-fs-2xl); max-width: 16ch; }
.auth__aside p { max-width: 42ch; }
.auth__main { display: grid; place-items: center; padding: var(--zv-s8) var(--zv-s4); background: var(--zv-white); }
.auth__card { width: min(420px, 100%); }
.auth__card h1 { font-size: var(--zv-fs-xl); margin-bottom: var(--zv-s2); }
.auth__card > p { color: var(--zv-muted); margin-bottom: var(--zv-s6); }
.auth__alt { margin-top: var(--zv-s6); font-size: var(--zv-fs-sm); text-align: center; color: var(--zv-muted); }
.auth__mobile-brand { display: none; margin-bottom: var(--zv-s8); }

/* Mini representação do fluxo (lado esquerdo do login) */
.flow-sample { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--zv-r-panel); padding: var(--zv-s4); display: grid; gap: var(--zv-s3); max-width: 380px; }
.flow-sample__row { display: flex; justify-content: space-between; align-items: center; font-size: var(--zv-fs-sm); color: #E6E9F5; }
.flow-sample .badge { background: rgba(255, 255, 255, 0.1); color: #E6E9F5; }
.flow-sample .badge--approved { background: rgba(22, 163, 74, 0.22); color: #B7F0CB; }
.flow-sample .badge--pending { background: rgba(217, 119, 6, 0.22); color: #FFD9A6; }

/* ------------------------------------------------------------- página de aprovação */
.approval { background: var(--zv-gray-light); min-height: 100vh; }
.approval__top { background: var(--zv-white); border-bottom: 1px solid var(--zv-line); }
.approval__top-inner { max-width: 960px; margin: 0 auto; padding: var(--zv-s4); display: flex; align-items: center; gap: var(--zv-s4); }
.approval__logo { max-height: 44px; max-width: 160px; object-fit: contain; }
.approval__agency { font-weight: 700; color: var(--zv-ink); }
.approval__accent { height: 4px; background: var(--brand); }
.approval__wrap { max-width: 960px; margin: 0 auto; padding: var(--zv-s6) var(--zv-s4) var(--zv-s16); }
.approval__intro h1 { font-size: var(--zv-fs-xl); margin-bottom: 4px; }
.approval__summary { display: flex; flex-wrap: wrap; gap: var(--zv-s2); margin: var(--zv-s3) 0 var(--zv-s6); }
.approval-item { background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); overflow: hidden; scroll-margin-top: 16px; }
.approval-item + .approval-item { margin-top: var(--zv-s8); }
.approval-item__head { display: flex; justify-content: space-between; align-items: center; gap: var(--zv-s3); padding: var(--zv-s4) var(--zv-s5); flex-wrap: wrap; }
.approval-item__head h2 { margin: 0; font-size: var(--zv-fs-md); }
.approval-item .viewer { border-radius: 0; }
.approval-item__body { padding: var(--zv-s5); display: grid; gap: var(--zv-s5); }
.decision { display: grid; gap: var(--zv-s3); padding: var(--zv-s4); background: var(--zv-gray-light); border-radius: var(--zv-r-control); }
.decision__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--zv-s2); }
.decision .btn--success { --btn-bg: var(--zv-success); }
.decision-stamp { display: flex; gap: var(--zv-s3); align-items: center; padding: var(--zv-s3) var(--zv-s4); border-radius: var(--zv-r-control); font-size: var(--zv-fs-sm); }
.decision-stamp--approved { background: var(--zv-success-bg); color: var(--zv-success-ink); }
.decision-stamp--changes_requested { background: var(--zv-error-bg); color: var(--zv-error-ink); }
.decision-stamp svg { width: 22px; height: 22px; flex: none; }
.approval__footer { text-align: center; font-size: var(--zv-fs-xs); color: var(--zv-muted); padding: var(--zv-s8) var(--zv-s4); }
.approval__footer a { color: var(--zv-muted); }
.powered { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--zv-slate); font-weight: 600; }
.powered img { width: 18px; height: 18px; }
details.history summary { cursor: pointer; font-size: var(--zv-fs-sm); font-weight: 600; color: var(--zv-violet-strong); }
details.history[open] summary { margin-bottom: var(--zv-s3); }
.identify { display: flex; gap: var(--zv-s2); flex-wrap: wrap; align-items: flex-end; }
.identify .field { margin: 0; flex: 1; min-width: 200px; }

/* ------------------------------------------------------------- site público */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--zv-line); }
.site-header__inner, .section__inner, .site-footer__inner { max-width: 1160px; margin: 0 auto; padding-left: var(--zv-s6); padding-right: var(--zv-s6); }
.site-header__inner { display: flex; align-items: center; gap: var(--zv-s6); min-height: 68px; }
.site-nav { display: flex; gap: var(--zv-s5); margin-left: auto; font-size: var(--zv-fs-sm); align-items: center; }
.site-nav a { color: var(--zv-slate); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--zv-violet-strong); }
.site-nav .btn { color: var(--btn-fg); }
.section { padding: var(--zv-s16) 0; }
.section--white { background: var(--zv-white); }
.section--deep { background: var(--zv-deep); color: #D3D9EE; }
.section--deep h2, .section--deep h3 { color: var(--zv-white); }
.section h2 { font-size: var(--zv-fs-2xl); max-width: 22ch; }
.section__lead { font-size: var(--zv-fs-md); color: var(--zv-muted); max-width: 60ch; margin-bottom: var(--zv-s10); }

.hero { padding: var(--zv-s16) 0 var(--zv-s12); background: var(--zv-white); border-bottom: 1px solid var(--zv-line); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--zv-s12); align-items: center; }
.hero h1 { font-size: var(--zv-fs-3xl); letter-spacing: -0.035em; line-height: 1.04; font-weight: 700; margin-bottom: var(--zv-s5); max-width: 15ch; }
.hero p { font-size: var(--zv-fs-md); color: var(--zv-muted); max-width: 48ch; margin-bottom: var(--zv-s8); }
.hero__note { font-size: var(--zv-fs-sm); color: var(--zv-muted); margin-top: var(--zv-s3); }

/* O elemento memorável: a "peça" sendo aprovada, ao vivo */
.demo { position: relative; background: var(--zv-gray-light); border: 1px solid var(--zv-line); border-radius: 20px; padding: var(--zv-s5); }
.demo__window { background: var(--zv-white); border-radius: var(--zv-r-panel); border: 1px solid var(--zv-line); overflow: hidden; }
.demo__art { aspect-ratio: 5 / 4; background: var(--zv-deep); position: relative; overflow: hidden; display: grid; place-items: end start; padding: var(--zv-s6); }
.demo__art::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; right: -14%; top: -18%; background: var(--zv-violet); }
.demo__art::after { content: ""; position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; right: 24%; top: 30%; background: var(--zv-lavender); mix-blend-mode: screen; }
.demo__art span { position: relative; z-index: 1; color: var(--zv-white); font-weight: 700; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 9ch; }
.demo__meta { display: flex; justify-content: space-between; align-items: center; padding: var(--zv-s3) var(--zv-s4); font-size: var(--zv-fs-sm); border-bottom: 1px solid var(--zv-line); }
.demo__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--zv-s2); padding: var(--zv-s4); }
.demo__stamp { position: absolute; right: -14px; top: 64px; background: var(--zv-white); border: 1px solid var(--zv-line); border-radius: var(--zv-r-panel); box-shadow: var(--zv-shadow-pop); padding: var(--zv-s3) var(--zv-s4); font-size: var(--zv-fs-sm); display: flex; gap: var(--zv-s3); align-items: center; animation: zv-stamp .5s 1.1s both cubic-bezier(.2, .9, .3, 1.2); }
.demo__stamp svg { width: 28px; height: 28px; color: var(--zv-success); }
.demo__stamp strong { display: block; color: var(--zv-ink); }
@keyframes zv-stamp { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--zv-s8); counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; border-top: 2px solid var(--zv-ink); padding-top: var(--zv-s4); }
.steps li::before { content: counter(step); font-weight: 700; font-size: var(--zv-fs-xl); color: var(--zv-violet); display: block; margin-bottom: var(--zv-s2); }
.steps h3 { font-size: var(--zv-fs-md); }
.steps p { color: var(--zv-muted); font-size: var(--zv-fs-sm); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--zv-s8) var(--zv-s12); }
.feature h3 { font-size: var(--zv-fs-md); margin-bottom: 6px; }
.feature p { color: var(--zv-muted); font-size: var(--zv-fs-sm); margin: 0; }
.section--deep .feature p { color: #B9C2DE; }

.cycle-toggle { margin-bottom: var(--zv-s6); }
.compare { margin-top: var(--zv-s10); }
.compare .table td:not(:first-child), .compare .table th:not(:first-child) { text-align: center; }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--zv-line); padding: var(--zv-s4) 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--zv-ink); font-size: var(--zv-fs-md); list-style: none; display: flex; justify-content: space-between; gap: var(--zv-s4); }
.faq summary::after { content: "+"; color: var(--zv-violet); font-weight: 500; font-size: 1.4em; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: var(--zv-s3) 0 0; color: var(--zv-muted); }

.cta-band { display: flex; justify-content: space-between; align-items: center; gap: var(--zv-s6); flex-wrap: wrap; }
.cta-band h2 { margin: 0; }

.site-footer { background: var(--zv-white); border-top: 1px solid var(--zv-line); padding: var(--zv-s10) 0; font-size: var(--zv-fs-sm); }
.site-footer__inner { display: flex; justify-content: space-between; gap: var(--zv-s6); flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: var(--zv-s5); flex-wrap: wrap; }
.site-footer a { color: var(--zv-slate); text-decoration: none; }
.site-footer a:hover { color: var(--zv-violet-strong); }

.legal { max-width: 760px; margin: 0 auto; padding: var(--zv-s12) var(--zv-s6); }
.legal h1 { font-size: var(--zv-fs-2xl); }
.legal h2 { margin-top: var(--zv-s8); }
.legal p, .legal li { line-height: 1.7; }

/* Paginação */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: var(--zv-s6); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--zv-r-control); border: 1px solid var(--zv-line); background: var(--zv-white); text-decoration: none; font-size: var(--zv-fs-sm); color: var(--zv-slate); }
.pagination [aria-current="page"] { background: var(--zv-deep); color: var(--zv-white); border-color: var(--zv-deep); }
.pagination .is-disabled { opacity: .45; }

/* Área admin: barra lateral em tom mais escuro para distinguir do painel da agência */
.app--admin .sidebar { background: #0F1A3D; }
.admin-tag { font-size: var(--zv-fs-xs); background: var(--zv-violet); color: var(--zv-white); padding: 2px 8px; border-radius: var(--zv-r-pill); font-weight: 600; }
pre.log { background: #0F1A3D; color: #D7DCEE; padding: var(--zv-s4); border-radius: var(--zv-r-control); overflow: auto; max-height: 70vh; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------- responsivo */
@media (max-width: 1080px) {
  .grid--main { grid-template-columns: 1fr; }
  .hero__grid { grid-template-columns: 1fr; }
  .demo { max-width: 520px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; box-shadow: var(--zv-shadow-pop); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(23, 37, 84, .45); z-index: 40; }
  .sidebar.is-open + .sidebar-backdrop { display: block; }
  .topbar { padding: var(--zv-s3) var(--zv-s4); }
  .topbar__menu { display: inline-flex; }
  .content { padding: var(--zv-s5) var(--zv-s4); }
  .grid--2, .grid--3, .features, .steps { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__mobile-brand { display: block; }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .figure { border-right: 0; border-bottom: 1px solid var(--zv-line); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table th, .table td { padding: 10px 12px; }
  .section { padding: var(--zv-s12) 0; }
  .site-header__inner, .section__inner, .site-footer__inner { padding-left: var(--zv-s4); padding-right: var(--zv-s4); }
  .decision__buttons { grid-template-columns: 1fr; }
  .demo__stamp { right: 8px; }
  .toolbar .input, .toolbar .select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .site-header { display: none; }
  .app { display: block; }
}
.zv-brand .admin-tag { font-size: 11px; color: var(--zv-white); letter-spacing: 0; font-weight: 600; }
@media (max-width: 640px) { .viewer iframe { height: 55vh; } }
