/* ============================================================
   ADSFLOW — base styles
   SaaS B2B premium, claro, tons frios.
   Escala tipográfica revista: nenhum texto abaixo de 11px.
   ============================================================ */

:root {
  /* AdsFlow Manual de Marca v1.0
     Preto Ink #111214 · Branco Papel #FAFAFA · Grafite #55575C · Azul Acento #3565E8 */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f4f4f5;
  --ink: #111214;
  --ink-soft: #2a2c30;
  --muted: #55575c;
  --muted-2: #7a7d84;
  --line: #e6e7ea;
  --line-strong: #d4d6da;
  --blue: #3565e8;
  --blue-dark: #2a53c7;
  --blue-soft: #eaf0fe;
  --green: #0f8a5f;
  --green-soft: #e8f7f0;
  --amber: #b97a12;
  --amber-soft: #fdf3dd;
  --red: #cc4747;
  --red-soft: #fdeeee;
  --shadow: 0 16px 45px rgba(17, 18, 20, 0.08);
  --sidebar: 260px;
  --radius: 16px;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  color: inherit;
}
button,
select,
input[type="checkbox"],
label.upload-zone {
  cursor: pointer;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Shell / Sidebar ---------- */
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  background: rgba(248, 250, 253, 0.96);
  border-right: 1px solid var(--line);
  transition:
    width 0.25s ease,
    transform 0.25s ease;
  backdrop-filter: blur(18px);
}
.brand {
  height: 45px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  overflow: hidden;
}
.brand-mark {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #111214 url("/brand/adsflow-icone-escuro-1024.png") center/78% no-repeat;
  box-shadow: 0 0 0 1px rgba(17, 18, 20, 0.08);
}
.brand-mark span {
  display: none;
}
.brand-copy {
  display: grid;
  line-height: 1;
  white-space: nowrap;
}
.brand-copy strong {
  letter-spacing: -0.6px;
  font-size: 19px;
  font-weight: 700;
}
.brand-copy strong span {
  color: var(--muted);
  font-weight: 500;
}
.brand-copy small {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.main-nav {
  display: grid;
  gap: 6px;
  margin-top: 40px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s ease;
}
.nav-item:hover {
  background: #eef2f9;
  color: var(--ink);
}
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 650;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -18px;
  width: 3px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
}
.nav-icon svg {
  width: 20px;
  height: 20px;
}
.nav-label {
  overflow: hidden;
  white-space: nowrap;
}
.nav-count {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(53, 101, 232, 0.1);
  font-size: 12px;
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  overflow: hidden;
}
.help-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  white-space: nowrap;
}
.help-icon {
  display: grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}
.help-card div:last-child {
  display: grid;
  gap: 3px;
}
.help-card strong {
  font-size: 12.5px;
}
.help-card span {
  color: var(--muted);
  font-size: 11.5px;
}
.version {
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ---------- Topbar ---------- */
.main-column {
  min-width: 0;
  margin-left: var(--sidebar);
  transition: margin-left 0.25s ease;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(226, 231, 239, 0.9);
  backdrop-filter: blur(20px);
}
.topbar-left,
.topbar-right,
.profile {
  display: flex;
  align-items: center;
}
.topbar-left {
  gap: 18px;
}
.topbar-right {
  gap: 18px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: 0.2s ease;
}
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}
.icon-button svg {
  width: 19px;
  height: 19px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-2);
  font-size: 13px;
}
.breadcrumb b {
  color: #c8ced8;
  font-weight: 400;
}
.breadcrumb strong {
  color: var(--ink-soft);
  font-weight: 600;
}
.notification-button {
  position: relative;
  border: 0;
  background: transparent;
}
.notification-button span {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
}
.profile {
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.profile-avatar,
.large-avatar {
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #648df5, #94b2fb);
  color: #fff;
  font-weight: 700;
}
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 12px;
}
.profile-avatar img,
.large-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-copy {
  display: grid;
  gap: 2px;
  min-width: 105px;
}
.profile-copy strong {
  font-size: 13px;
}
.profile-copy span {
  color: var(--muted);
  font-size: 11.5px;
}
.profile > svg {
  width: 15px;
  color: #a2aabb;
}

/* ---------- Página / Cabeçalho ---------- */
.main-content {
  width: 100%;
  max-width: 1740px;
  margin: 0 auto;
  padding: 40px 34px 60px;
}
.page {
  display: none;
}
.page.active {
  display: block;
  animation: page-in 0.3s ease;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 28px;
}
.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
}
.page-heading h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.1;
}
.page-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 56ch;
}
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  transition: 0.2s ease;
}
.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(53, 101, 232, 0.22);
}
.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}
.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}
.secondary-button:hover {
  border-color: #c4cdda;
  background: var(--surface-soft);
}

/* ---------- Métricas ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border: 18px solid var(--blue-soft);
  border-radius: 50%;
  opacity: 0.45;
}
.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}
.metric-icon svg {
  width: 17px;
  height: 17px;
}
.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.metric-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.metric-trend {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 650;
  font-size: 12px;
}

/* ---------- Seção da tabela ---------- */
.table-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(33, 47, 77, 0.04);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 18px;
}
.section-head h2,
.settings-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.section-head p,
.settings-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.view-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}
.view-switcher button {
  display: grid;
  place-items: center;
  width: 33px;
  height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
}
.view-switcher button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 6px rgba(30, 44, 74, 0.08);
}
.view-switcher svg {
  width: 16px;
  height: 16px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(380px, 100%);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.search-box:focus-within {
  border-color: #a9c0fb;
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.search-box svg,
.filter-select svg {
  width: 16px;
  min-width: 16px;
  color: var(--muted-2);
}
.search-box input {
  width: 100%;
  min-width: 80px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 13.5px;
}
.search-box input::placeholder {
  color: var(--muted-2);
}
.search-box kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted-2);
  font-size: 11px;
  font-family: var(--mono);
  white-space: nowrap;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-select {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.filter-select select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}
.toolbar .secondary-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
}
.active-filters {
  display: none;
  gap: 7px;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
}
.active-filters.visible {
  display: flex;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 500;
}
.filter-chip button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
}
.selection-bar {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-top: 1px solid #d9e3fc;
  background: var(--blue-soft);
  color: #43598c;
  font-size: 13px;
}
.selection-bar.visible {
  display: flex;
}
.selection-bar div {
  display: flex;
  gap: 14px;
}
.selection-bar button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}
.selection-bar button.danger-text {
  color: var(--red);
}

/* ---------- Tabela ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: #cdd5e1 transparent;
}
.creative-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.creative-table th {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.3px;
  text-align: left;
  white-space: nowrap;
}
.creative-table th:not(.sticky-col) {
  min-width: 150px;
}
.creative-table th:nth-child(n + 7) {
  min-width: 200px;
}
.creative-table td {
  height: 80px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.creative-table tbody tr {
  cursor: pointer;
}
.creative-table tbody tr:hover td {
  background: #f8fbff;
}
.creative-table tbody tr.selected td {
  background: #f4f8ff;
}
.creative-table tbody tr:last-child td {
  border-bottom: 0;
}
.sticky-col {
  position: sticky;
  z-index: 5;
}
th.sticky-col {
  z-index: 8;
  background: #fbfcfe;
}
.select-col {
  left: 0;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  text-align: center !important;
}
.thumb-col {
  left: 46px;
  width: 94px;
  min-width: 94px;
  max-width: 94px;
}
.name-col {
  left: 140px;
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  box-shadow: 10px 0 14px -12px rgba(24, 35, 58, 0.28);
}
.creative-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}
.creative-thumb {
  position: relative;
  overflow: hidden;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #e8edf4;
  box-shadow: inset 0 0 0 1px rgba(20, 30, 50, 0.05);
}
.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
tr:hover .creative-thumb img {
  transform: scale(1.04);
}
.media-type {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: rgba(20, 29, 48, 0.75);
  color: #fff;
  backdrop-filter: blur(3px);
}
.media-type svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  stroke-width: 1.4;
}
.creative-name-cell {
  display: grid;
  gap: 5px;
  white-space: normal;
}
.creative-name-cell strong {
  max-width: 196px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creative-name-cell span {
  color: var(--muted);
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-pill.active {
  background: var(--green-soft);
  color: var(--green);
}
.status-pill.active::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.12);
}
.status-pill.inactive {
  background: #f0f2f6;
  color: var(--muted);
}
.status-pill.inactive::before {
  background: #9aa3b0;
}
.id-cell {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.money-cell {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.rate-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.rate-value {
  display: block;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.rate-bar {
  width: 62px;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #e9edf3;
}
.rate-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.rate-context {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}
.step-number {
  margin-right: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-family: var(--mono);
}
.empty-state {
  padding: 55px 20px !important;
  text-align: center;
  color: var(--muted) !important;
  font-size: 14px;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.pagination {
  display: flex;
  gap: 5px;
}
.pagination button {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
}
.pagination button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.pagination button:disabled {
  opacity: 0.45;
  cursor: default;
}
.pagination svg {
  width: 14px;
}

/* ---------- Cards ---------- */
.card-view {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}
.card-view.visible {
  display: grid;
}
.creative-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: 0.2s ease;
  background: #fff;
}
.creative-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.creative-card-image {
  position: relative;
  height: 156px;
  background: #edf1f6;
}
.creative-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.creative-card-content {
  padding: 16px;
}
.creative-card-content h3 {
  margin: 12px 0 4px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.1px;
}
.creative-card-content p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}
.card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.card-stats span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.card-stats strong {
  color: var(--ink);
  font-size: 14px;
}

/* ---------- Sidebar recolhida ---------- */
body.sidebar-collapsed {
  --sidebar: 82px;
}
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .help-card div:last-child,
body.sidebar-collapsed .help-card strong,
body.sidebar-collapsed .help-card span,
body.sidebar-collapsed .workspace-chip span,
body.sidebar-collapsed .workspace-chip strong,
body.sidebar-collapsed .workspace-chip svg,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .version {
  display: none;
}
body.sidebar-collapsed .workspace-chip {
  min-height: 44px;
  padding: 8px;
  grid-template-columns: 1fr;
  justify-items: center;
}
body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}
body.sidebar-collapsed .nav-item.active::before {
  left: -18px;
}
body.sidebar-collapsed .help-card {
  justify-content: center;
  padding: 10px;
}

/* ---------- Drawer (formulário lateral) ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  background: rgba(26, 36, 57, 0.38);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: 0.25s ease;
}
.drawer-backdrop.open {
  visibility: visible;
  opacity: 1;
}
.creative-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(720px, 96vw);
  height: 100vh;
  background: #fff;
  box-shadow: -20px 0 60px rgba(20, 30, 50, 0.16);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.creative-drawer.open {
  transform: translateX(0);
}
.creative-drawer form {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 104px;
  padding: 26px 30px;
  border-bottom: 1px solid var(--line);
}
.drawer-header h2,
.invite-dialog h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.drawer-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 2px 30px 30px;
}
.form-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child {
  border-bottom: 0;
}
.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}
.form-section-title > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
}
.form-section-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.form-section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid label,
.editor-controls label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.form-grid label.full {
  grid-column: 1 / -1;
}
.form-grid label em {
  color: var(--red);
  font-style: normal;
}
.form-grid label > span {
  color: var(--muted-2);
  font-weight: 400;
}
.form-grid input,
.form-grid select,
.notes-label textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  cursor: text;
}
.form-grid input:focus,
.form-grid select:focus,
.notes-label textarea:focus {
  border-color: #a9c0fb;
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.form-grid input::placeholder,
.notes-label textarea::placeholder,
.additional-result-row input::placeholder {
  color: var(--muted-2);
}
.form-grid select {
  cursor: pointer;
}

/* Upload */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 22px;
  border: 1.5px dashed #c4d2e8;
  border-radius: 12px;
  background: #fafcff;
  text-align: center;
  transition: 0.2s ease;
}
.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.upload-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.upload-icon svg {
  width: 20px;
  height: 20px;
}
.upload-zone strong {
  font-size: 13.5px;
  font-weight: 600;
}
.upload-zone strong span {
  color: var(--blue);
}
.upload-zone small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}
.file-previews {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.file-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.file-preview img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #edf1f5;
}
.file-preview div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.file-preview strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-preview span {
  color: var(--muted);
  font-size: 11.5px;
}
.file-preview button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
}

/* Editor de miniatura */
.thumbnail-editor {
  display: none;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.thumbnail-editor.visible {
  display: grid;
}
.editor-preview {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  border-radius: 10px;
  background: #dfe6ee;
}
.editor-preview img,
.editor-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.crop-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.crop-guides span {
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
}
.crop-guides span:nth-child(1),
.crop-guides span:nth-child(2) {
  top: 0;
  bottom: 0;
  width: 1px;
}
.crop-guides span:nth-child(1) {
  left: 33.33%;
}
.crop-guides span:nth-child(2) {
  right: 33.33%;
}
.crop-guides span:nth-child(3),
.crop-guides span:nth-child(4) {
  left: 0;
  right: 0;
  height: 1px;
}
.crop-guides span:nth-child(3) {
  top: 33.33%;
}
.crop-guides span:nth-child(4) {
  bottom: 33.33%;
}
.editor-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.editor-controls label {
  font-size: 12.5px;
}
.editor-controls label output {
  float: right;
  color: var(--blue);
  font-weight: 650;
}
.editor-controls input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}
.editor-controls .secondary-button {
  margin-top: auto;
}

/* Importação de resultados */
.results-import-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #d5e1fb;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6faff 0%, #fbfcff 100%);
}
.results-import-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.results-import-icon svg {
  width: 20px;
  height: 20px;
}
.results-import-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.results-import-copy strong {
  color: var(--ink-soft);
  font-size: 13.5px;
}
.results-import-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.results-import-copy span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-import-copy span.success {
  color: var(--green);
  font-weight: 600;
}
.results-import-copy span.error {
  color: var(--red);
  font-weight: 600;
}
.results-import-card .secondary-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* Funil */
.funnel-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.funnel-form label {
  display: grid;
  grid-template-columns: 34px 1fr 120px;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 0.15s ease;
}
.funnel-form label:focus-within {
  border-color: #a9c0fb;
}
.funnel-form label > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  font-family: var(--mono);
}
.funnel-form label div {
  display: grid;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.funnel-form label small {
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
}
.funnel-form input {
  width: 120px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  text-align: right;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.funnel-form input:focus {
  border-color: #a9c0fb;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

/* Resultados complementares */
.additional-results {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.additional-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.additional-results-head h4 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 650;
}
.additional-results-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.secondary-button.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}
.record-only-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f4f6fa;
  color: var(--muted);
  font-size: 12px;
}
.record-only-note svg {
  width: 15px;
  min-width: 15px;
  color: var(--muted-2);
}
.additional-results-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.additional-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr) 34px;
  gap: 8px;
  align-items: center;
}
.additional-result-row input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  font-size: 13.5px;
}
.additional-result-row input:focus {
  border-color: #a9c0fb;
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.additional-result-row button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
}
.additional-result-row button svg {
  width: 15px;
  height: 15px;
}
.additional-results-empty {
  margin-top: 14px;
  padding: 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* Anotações */
.notes-label {
  position: relative;
  display: block;
}
.notes-label textarea {
  min-height: 120px;
  padding: 12px 14px 30px;
  resize: vertical;
  line-height: 1.55;
}
.notes-label span {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 30px;
  border-top: 1px solid var(--line);
  background: #fff;
}

/* ---------- Configurações ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 24px;
  align-items: start;
}
.settings-nav {
  display: grid;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.65);
}
.settings-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}
.settings-nav button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(40, 52, 76, 0.07);
  font-weight: 650;
}
.settings-nav span {
  font-size: 11px;
  font-family: var(--mono);
}
.settings-content {
  display: grid;
  gap: 18px;
}
.settings-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.settings-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.saved-indicator {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  transition: 0.2s ease;
}
.saved-indicator.visible {
  opacity: 1;
}
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}
.large-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  font-size: 18px;
}
.profile-photo-row p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
}
.settings-card .form-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: right;
}
.users-list {
  display: grid;
}
.user-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child {
  border-bottom: 0;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.user-info {
  display: grid;
  gap: 3px;
}
.user-info strong {
  font-size: 13.5px;
}
.user-info span,
.user-role {
  color: var(--muted);
  font-size: 12.5px;
}
.user-row button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Dialog / Toast ---------- */
.invite-dialog {
  width: min(480px, 92vw);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(20, 30, 50, 0.25);
}
.invite-dialog::backdrop {
  background: rgba(27, 36, 54, 0.42);
  backdrop-filter: blur(2px);
}
.invite-dialog form > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.invite-dialog .form-grid {
  padding: 22px 24px;
}
.invite-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid #c8e6d8;
  border-radius: 12px;
  background: #f0faf5;
  color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
}
.toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.toast > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
}
.toast p {
  margin: 0;
  color: #2e5a48;
  font-size: 13.5px;
  font-weight: 500;
}

/* ============================================================
   Tema escuro — ativado via html[data-theme="dark"]
   ============================================================ */
html[data-theme="dark"] {
  --bg: #0d1524;
  --surface: #151f33;
  --surface-soft: #1a2540;
  --ink: #e9eef8;
  --ink-soft: #c9d3e5;
  --muted: #97a3bc;
  --muted-2: #67748f;
  --line: #232f4a;
  --line-strong: #2e3c5c;
  --blue: #5d87f5;
  --blue-dark: #4a75e8;
  --blue-soft: rgba(93, 135, 245, 0.14);
  --green: #3fc48f;
  --green-soft: rgba(63, 196, 143, 0.13);
  --amber: #e0a63f;
  --amber-soft: rgba(224, 166, 63, 0.13);
  --red: #ef7070;
  --red-soft: rgba(239, 112, 112, 0.13);
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
html[data-theme="dark"] .sidebar {
  background: rgba(15, 23, 40, 0.96);
}
html[data-theme="dark"] .topbar {
  background: rgba(13, 21, 36, 0.86);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .nav-item:hover {
  background: #1a2540;
}
html[data-theme="dark"] .notification-button span {
  border-color: var(--bg);
}
html[data-theme="dark"] .breadcrumb b {
  color: #46536f;
}
html[data-theme="dark"] .creative-table th,
html[data-theme="dark"] th.sticky-col {
  background: #182338;
}
html[data-theme="dark"] .creative-table td {
  background: var(--surface);
}
html[data-theme="dark"] .creative-table tbody tr:hover td {
  background: #1a2742;
}
html[data-theme="dark"] .creative-table tbody tr.selected td {
  background: #1c2946;
}
html[data-theme="dark"] .name-col {
  box-shadow: 10px 0 14px -12px rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .creative-thumb {
  background: #223050;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .toolbar {
  background: #182338;
}
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .pagination button {
  background: var(--surface);
}
html[data-theme="dark"] .pagination button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #0d1524;
}
html[data-theme="dark"] .search-box:focus-within {
  border-color: #3d5da8;
}
html[data-theme="dark"] .view-switcher button.active {
  background: #26345a;
  box-shadow: none;
}
html[data-theme="dark"] .selection-bar {
  border-top-color: #2a3a63;
  background: rgba(93, 135, 245, 0.1);
  color: #b9c8ec;
}
html[data-theme="dark"] .status-pill.inactive {
  background: #232e48;
  color: var(--muted);
}
html[data-theme="dark"] .rate-bar {
  background: #263354;
}
html[data-theme="dark"] .creative-card {
  background: var(--surface);
}
html[data-theme="dark"] .creative-card-image {
  background: #223050;
}
html[data-theme="dark"] .metric-card::after {
  opacity: 0.25;
}
html[data-theme="dark"] .creative-drawer {
  background: #121b2e;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .drawer-footer {
  background: #121b2e;
}
html[data-theme="dark"] .drawer-backdrop {
  background: rgba(3, 7, 15, 0.55);
}
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .notes-label textarea,
html[data-theme="dark"] .funnel-form input,
html[data-theme="dark"] .additional-result-row input {
  background: #1a2540;
}
html[data-theme="dark"] .form-grid input:focus,
html[data-theme="dark"] .form-grid select:focus,
html[data-theme="dark"] .notes-label textarea:focus,
html[data-theme="dark"] .funnel-form input:focus,
html[data-theme="dark"] .additional-result-row input:focus {
  border-color: #3d5da8;
}
html[data-theme="dark"] .funnel-form label:focus-within {
  border-color: #3d5da8;
}
html[data-theme="dark"] .upload-zone {
  background: #16213a;
  border-color: #33425f;
}
html[data-theme="dark"] .upload-zone:hover,
html[data-theme="dark"] .upload-zone.dragging {
  background: rgba(93, 135, 245, 0.1);
  border-color: var(--blue);
}
html[data-theme="dark"] .editor-preview {
  background: #223050;
}
html[data-theme="dark"] .crop-guides span {
  background: rgba(255, 255, 255, 0.25);
}
html[data-theme="dark"] .results-import-card {
  background: linear-gradient(135deg, #17233e 0%, #16203a 100%);
  border-color: #2a3a63;
}
html[data-theme="dark"] .record-only-note {
  background: #1a2540;
}
html[data-theme="dark"] .settings-nav {
  background: rgba(21, 31, 51, 0.65);
}
html[data-theme="dark"] .settings-nav button.active {
  background: #26345a;
  box-shadow: none;
}
html[data-theme="dark"] .settings-card {
  background: var(--surface);
}
html[data-theme="dark"] .invite-dialog {
  background: #121b2e;
  color: var(--ink);
}
html[data-theme="dark"] .invite-dialog::backdrop {
  background: rgba(3, 7, 15, 0.6);
}
html[data-theme="dark"] .toast {
  background: #14281f;
  border-color: #235c44;
}
html[data-theme="dark"] .toast p {
  color: #a9dcc5;
}
html[data-theme="dark"] .search-box kbd {
  background: #1a2540;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .search-box {
    width: 100%;
  }
  .toolbar-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 760px) {
  :root {
    --sidebar: 0px;
  }
  body {
    font-size: 14.5px;
  }
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 15px 0 40px rgba(20, 30, 50, 0.15);
  }
  body.mobile-menu-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-collapsed {
    --sidebar: 0px;
  }
  body.sidebar-collapsed .brand-copy {
    display: grid;
  }
  body.sidebar-collapsed .nav-label {
    display: inline;
  }
  body.sidebar-collapsed .nav-count {
    display: inline-block;
  }
  body.sidebar-collapsed .help-card div:last-child {
    display: grid;
  }
  body.sidebar-collapsed .version {
    display: block;
  }
  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 0 10px;
  }
  body.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: 0 12px;
  }
  .topbar {
    padding: 0 16px;
  }
  .breadcrumb span,
  .breadcrumb b,
  .profile-copy,
  .profile > svg,
  .notification-button {
    display: none;
  }
  .profile {
    padding-left: 0;
    border-left: 0;
  }
  .main-content {
    padding: 28px 14px 45px;
  }
  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }
  .primary-button {
    align-self: flex-start;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .toolbar-actions .filter-select {
    flex: 1;
  }
  .toolbar-actions .secondary-button {
    width: 100%;
  }
  .section-head {
    padding: 18px;
  }
  .toolbar {
    padding: 12px 18px;
  }
  .card-view {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .form-grid.two,
  .thumbnail-editor {
    grid-template-columns: 1fr;
  }
  .funnel-form label {
    grid-template-columns: 34px 1fr 100px;
  }
  .funnel-form input {
    width: 100px;
  }
  .results-import-card {
    grid-template-columns: 44px 1fr;
  }
  .results-import-card .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .additional-result-row {
    grid-template-columns: 1fr 1fr 34px;
  }
  .form-grid label.full {
    grid-column: auto;
  }
  .drawer-header,
  .drawer-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .drawer-footer {
    padding: 13px 18px;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .settings-nav button {
    justify-content: center;
  }
  .settings-nav button span {
    display: none;
  }
  .settings-card {
    padding: 18px;
  }
  .settings-card-head {
    align-items: flex-start;
    gap: 15px;
  }
  .user-row {
    grid-template-columns: 40px 1fr auto;
  }
  .user-role {
    display: none;
  }
}

/* ============================================================
   ADSFLOW — visual system v1
   Direção: interface operacional, monocromática e silenciosa.
   ============================================================ */

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --ink: #171717;
  --ink-soft: #333331;
  --muted: #71716c;
  --muted-2: #a0a09a;
  --line: #e7e7e3;
  --line-strong: #d8d8d3;
  --blue: #181817;
  --blue-dark: #000000;
  --blue-soft: #ecece9;
  --green: #28734f;
  --green-soft: #e8f3ec;
  --amber: #8a6822;
  --amber-soft: #f4f0df;
  --red: #b64646;
  --red-soft: #f8eaea;
  --shadow: 0 20px 60px rgba(23, 23, 22, 0.09);
  --sidebar: 244px;
  --radius: 16px;
}

body {
  background: var(--bg);
  letter-spacing: -0.01em;
}

.sidebar {
  padding: 18px 14px;
  background: rgba(248, 248, 246, 0.96);
  border-right-color: #e4e4e0;
}

.brand {
  height: 42px;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #171717 url("/adsflow-symbol.svg") center / cover no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.brand-mark span {
  display: none;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.7px;
}

.brand-copy strong span {
  color: #8c8c87;
  font-weight: 550;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.15px;
}

.workspace-chip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  min-height: 55px;
  margin: 18px 2px 22px;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.02);
}

.workspace-chip span {
  grid-column: 1;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.workspace-chip strong {
  grid-column: 1;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chip svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  color: var(--muted-2);
  transform: translateY(-50%);
}

.nav-section-label {
  display: block;
  margin: 0 12px 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.main-nav {
  gap: 3px;
  margin-top: 0;
}

.nav-item {
  height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: #666661;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover {
  background: #eeeeeb;
  color: var(--ink);
}

.nav-item.active {
  background: #e8e8e5;
  color: #181817;
  font-weight: 650;
}

.nav-item.active::before {
  display: none;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
}

.nav-count {
  min-width: 23px;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.055);
  color: #696964;
  text-align: center;
}

.help-card {
  padding: 12px;
  border-color: var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.help-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #1a1a19;
  color: #fff;
  font-size: 12px;
}

.help-card strong {
  font-size: 12px;
}

.help-card span {
  color: var(--muted-2);
  font-size: 11px;
}

.version {
  margin-top: 13px;
  font-size: 9.5px;
  letter-spacing: 1.15px;
}

.topbar {
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(24px);
}

.topbar-left {
  gap: 14px;
}

.topbar-right {
  gap: 10px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.breadcrumb {
  font-size: 12.5px;
}

.breadcrumb strong {
  color: var(--ink);
}

.notification-button span {
  background: #181817;
}

.profile {
  margin-left: 4px;
  padding: 4px 7px 4px 10px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-soft);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #262625;
  font-size: 11px;
}

.profile-copy {
  min-width: 96px;
}

.main-content {
  max-width: 1800px;
  padding: 32px 28px 56px;
}

.page-heading {
  align-items: center;
  margin-bottom: 25px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.45px;
}

.page-heading h1 {
  font-size: clamp(27px, 2.5vw, 34px);
  font-weight: 620;
  letter-spacing: -1.15px;
}

.page-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
}

.primary-button {
  border-color: #181817;
  background: #181817;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13);
}

.primary-button:hover {
  border-color: #000;
  background: #000;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.17);
}

.secondary-button:hover {
  border-color: #c7c7c1;
  background: #f4f4f2;
}

.metric-grid {
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card {
  min-height: 146px;
  padding: 19px 20px 17px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card::after {
  display: none;
}

.metric-top {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.5px;
}

.metric-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #f0f0ed;
  color: #777771;
}

.metric-icon svg {
  width: 14px;
  height: 14px;
}

.metric-value {
  margin-top: 8px;
  font-size: 27px;
  font-weight: 620;
  letter-spacing: -1px;
}

.metric-spark {
  position: absolute;
  right: 20px;
  bottom: 21px;
  width: 74px;
  height: 28px;
  overflow: visible;
  color: #2b2b29;
}

.metric-spark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.metric-spark circle {
  fill: currentColor;
  stroke: none;
}

.metric-foot {
  max-width: calc(100% - 82px);
  margin-top: 13px;
  gap: 6px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.metric-trend {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
}

.table-section {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(24, 24, 23, 0.035);
}

.section-head {
  padding: 20px 22px 17px;
}

.section-head h2,
.settings-card h2 {
  font-size: 16px;
  font-weight: 620;
}

.section-head p,
.settings-card p {
  margin-top: 4px;
  font-size: 12.5px;
}

.view-switcher {
  border-radius: 9px;
  background: #f2f2f0;
}

.view-switcher button.active {
  background: #fff;
  color: #191918;
}

.toolbar {
  gap: 12px;
  padding: 12px 22px;
  background: #fafaf9;
}

.search-box,
.filter-select {
  height: 38px;
  border-color: var(--line);
  border-radius: 9px;
}

.search-box {
  width: min(420px, 100%);
}

.search-box:focus-within {
  border-color: #aaa9a2;
  box-shadow: 0 0 0 3px #eeeeeb;
}

.search-box input,
.filter-select select {
  font-size: 12.5px;
}

.filter-chip {
  background: #ededeb;
  color: #3f3f3c;
}

.selection-bar.visible {
  position: fixed;
  left: calc(50% + var(--sidebar) / 2);
  bottom: 24px;
  z-index: 70;
  display: flex;
  width: min(560px, calc(100vw - var(--sidebar) - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: #191918;
  color: #fff;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
}

.selection-bar button {
  color: #e8e8e5;
}

.creative-table th {
  height: 46px;
  padding: 0 14px;
  background: #fafaf9;
  color: #8a8a84;
  font-size: 10.5px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.creative-table td {
  height: 72px;
  padding: 8px 14px;
  color: #40403d;
  font-size: 12.5px;
}

.creative-table tbody tr:hover td {
  background: #f8f8f6;
}

.creative-table tbody tr.selected td {
  background: #f2f2ef;
}

th.sticky-col {
  background: #fafaf9;
}

.creative-table input[type="checkbox"] {
  accent-color: #181817;
}

.creative-thumb {
  width: 52px;
  height: 52px;
  border-radius: 9px;
}

.thumb-col {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}

.name-col {
  left: 130px;
  width: 238px;
  min-width: 238px;
  max-width: 238px;
}

.creative-name-cell strong {
  max-width: 204px;
  font-size: 13px;
  font-weight: 600;
}

.creative-name-cell span {
  color: #91918b;
  font-size: 11.5px;
}

.status-pill {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11.5px;
}

.status-pill::before {
  width: 5px;
  height: 5px;
}

.status-pill.active::before {
  box-shadow: none;
}

.id-cell {
  font-size: 11.5px;
}

.money-cell {
  font-size: 13px;
  font-weight: 600;
}

.rate-value {
  font-size: 13.5px;
  font-weight: 600;
}

.rate-bar {
  height: 4px;
  background: #ecece9;
}

.rate-bar i {
  background: #464643;
}

.table-footer {
  min-height: 54px;
}

.pagination button.active {
  border-color: #181817;
  background: #181817;
}

.creative-card {
  border-radius: 12px;
}

.creative-card:hover {
  box-shadow: 0 18px 45px rgba(24, 24, 23, 0.11);
}

.form-section-title > span,
.upload-icon,
.results-import-icon,
.user-avatar {
  background: #ededeb;
  color: #333331;
}

.form-grid input:focus,
.form-grid select:focus,
.notes-label textarea:focus,
.funnel-form input:focus,
.additional-result-row input:focus {
  border-color: #aaa9a2;
  box-shadow: 0 0 0 3px #eeeeeb;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: #777771;
  background: #f3f3f1;
}

.upload-zone strong span,
.editor-controls label output,
.funnel-form label small,
.settings-nav button.active {
  color: #333331;
}

.editor-controls input[type="range"] {
  accent-color: #181817;
}

.results-import-card {
  border-color: var(--line);
  background: #fafaf9;
}

.settings-nav button.active {
  background: #fff;
}

.settings-card {
  border-radius: var(--radius);
}

.drawer-backdrop {
  background: rgba(20, 20, 19, 0.28);
  backdrop-filter: blur(5px);
}

.creative-drawer {
  width: min(700px, 96vw);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] {
  --bg: #111110;
  --surface: #191918;
  --surface-soft: #20201f;
  --ink: #f1f1ee;
  --ink-soft: #d0d0ca;
  --muted: #999992;
  --muted-2: #6e6e69;
  --line: #2d2d2a;
  --line-strong: #3b3b37;
  --blue: #f1f1ee;
  --blue-dark: #ffffff;
  --blue-soft: #2a2a27;
}

html[data-theme="dark"] .sidebar {
  background: rgba(20, 20, 19, 0.97);
}

html[data-theme="dark"] .workspace-chip,
html[data-theme="dark"] .help-card,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .creative-table th,
html[data-theme="dark"] th.sticky-col {
  background: rgba(25, 25, 24, 0.94);
}

html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .nav-item.active {
  background: #2a2a28;
  color: #f1f1ee;
}

html[data-theme="dark"] .primary-button {
  border-color: #f1f1ee;
  background: #f1f1ee;
  color: #151514;
}

html[data-theme="dark"] .metric-icon,
html[data-theme="dark"] .form-section-title > span,
html[data-theme="dark"] .upload-icon,
html[data-theme="dark"] .results-import-icon,
html[data-theme="dark"] .user-avatar {
  background: #2b2b29;
  color: #c9c9c3;
}

html[data-theme="dark"] .metric-spark {
  color: #d2d2cc;
}

html[data-theme="dark"] *:focus-visible {
  outline-color: #8d8d87;
}

html[data-theme="dark"] .search-box:focus-within,
html[data-theme="dark"] .form-grid input:focus,
html[data-theme="dark"] .form-grid select:focus,
html[data-theme="dark"] .notes-label textarea:focus,
html[data-theme="dark"] .funnel-form input:focus,
html[data-theme="dark"] .additional-result-row input:focus,
html[data-theme="dark"] .funnel-form label:focus-within {
  border-color: #777771;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .view-switcher {
  border-color: #3a3a37;
  background: #242422;
}

html[data-theme="dark"] .view-switcher button {
  color: #8f8f89;
}

html[data-theme="dark"] .view-switcher button.active {
  background: #efefeb;
  color: #171716;
  box-shadow: none;
}

html[data-theme="dark"] .status-pill.inactive {
  background: #2b2b29;
  color: #a2a29b;
}

html[data-theme="dark"] .rate-bar {
  background: #343431;
}

html[data-theme="dark"] .settings-nav button.active {
  background: #2a2a28;
  color: #f1f1ee;
  box-shadow: none;
}

html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .notes-label textarea,
html[data-theme="dark"] .funnel-form input,
html[data-theme="dark"] .additional-result-row input {
  background: #222220;
}

html[data-theme="dark"] .large-avatar {
  background: #30302d;
}

html[data-theme="dark"] .creative-table tbody tr:hover td,
html[data-theme="dark"] .creative-table tbody tr.selected td {
  background: #222220;
}

html[data-theme="dark"] .rate-bar i {
  background: #c9c9c3;
}

html[data-theme="dark"] .search-box kbd,
html[data-theme="dark"] .record-only-note {
  background: #2a2a28;
  color: #9d9d96;
}

html[data-theme="dark"] .selection-bar {
  border-color: #41413d;
  background: #eeeeea;
  color: #181817;
}

html[data-theme="dark"] .selection-bar button {
  color: #353532;
}

html[data-theme="dark"] .selection-bar button.danger-text {
  color: #a34a4a;
}

html[data-theme="dark"] .upload-zone {
  border-color: #454541;
  background: #20201e;
}

html[data-theme="dark"] .upload-zone:hover,
html[data-theme="dark"] .upload-zone.dragging,
html[data-theme="dark"] .results-import-card {
  border-color: #5a5a54;
  background: #252523;
}

html[data-theme="dark"] .editor-preview,
html[data-theme="dark"] .creative-card-image,
html[data-theme="dark"] .creative-thumb {
  background: #292927;
}

html[data-theme="dark"] .creative-drawer,
html[data-theme="dark"] .drawer-footer,
html[data-theme="dark"] .invite-dialog {
  background: #191918;
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar: 0px;
  }

  .workspace-chip,
  .nav-section-label {
    display: none;
  }

  .brand {
    margin-bottom: 22px;
  }

  .main-content {
    padding: 24px 14px 44px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .metric-card:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-card:last-child {
    border-bottom: 0;
  }

  .selection-bar.visible {
    left: 50%;
    width: calc(100vw - 28px);
  }

  .selection-bar.visible > span {
    max-width: 120px;
  }
}
