:root {
  --green: #064b27;
  --green-2: #073d22;
  --green-3: #0b6a35;
  --line: #e4e8ee;
  --text: #171b26;
  --muted: #667085;
  --gold: #f2b705;
  --blue: #1458d4;
  --purple: #7a22e8;
  --orange: #ea6700;
  --shadow: 0 22px 60px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; color: var(--text); background: #f5f7fb; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.client-only { display: none; }

.signup-extra-stores {
  display: grid;
  gap: 10px;
  margin: 8px 0;
}

.signup-store-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #cfd8dc;
  border-radius: 8px;
  background: #fafcfb;
}

.signup-add-store-btn {
  width: 100%;
  margin-bottom: 10px;
}

.client-stores-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-stores-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.profile-store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d5e4dc;
  border-radius: 8px;
  background: #f7fcf9;
}

.profile-store-row b {
  display: block;
  color: var(--green);
}

.profile-store-row small {
  display: block;
  color: #5b6678;
  margin-top: 2px;
}

.profile-add-store {
  display: grid;
  gap: 8px;
}

.profile-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--green);
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.profile-password-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5ebe7;
}

.profile-password-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.profile-status.is-error {
  color: #b42318 !important;
}

.user-menu-reset {
  width: 100%;
  text-align: left;
  border: none;
  background: #f4fbf6;
  color: #1f4d33;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 6px;
}

.user-menu-reset:hover {
  background: #e3f3e8;
}

.user-menu-reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}

.profile-add-store .nc-field span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

#section-novo .client-store-field select {
  height: 40px;
  width: 100%;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46vw) minmax(420px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 54px clamp(28px, 6vw, 92px) 100px;
  background: linear-gradient(90deg, rgba(255,255,255,.28), rgba(11,64,38,.08)), url("assets/home-bg.png") center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.login-page::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 82px;
  background: linear-gradient(90deg, #064b27, #073d22);
  z-index: 0;
}

.login-brand {
  align-self: start;
  margin-top: 14px;
  color: var(--green);
  text-align: center;
  text-shadow: 0 2px 16px rgba(255,255,255,.85);
  position: relative;
  z-index: 1;
}

.brand-script, .side-script {
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(78px, 9vw, 132px);
  font-weight: 800;
  line-height: .78;
}

.brand-sub {
  letter-spacing: 12px;
  font-weight: 900;
  font-size: clamp(24px, 2.6vw, 36px);
}

.login-brand p {
  margin: 24px 0 0;
  color: #111827;
  font-weight: 700;
  letter-spacing: .6px;
}

.login-card {
  width: min(100%, 720px);
  justify-self: end;
  padding: clamp(34px, 4vw, 60px);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
}

.login-card h1 {
  margin: 0;
  color: var(--green);
  text-align: center;
  font-size: clamp(30px, 3vw, 44px);
}

.login-copy { margin: 18px 0 34px; text-align: center; color: #374151; font-size: 17px; }
.login-card h2 { margin: 0 0 22px; text-align: center; font-size: 18px; }

.google-btn {
  width: 100%;
  height: 70px;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  background: #fff;
  color: #171b26;
  font-weight: 800;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.google-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.google-mark svg {
  display: block;
  width: 28px;
  height: 28px;
}
.divider { display: flex; align-items: center; gap: 22px; margin: 34px 0; color: #4b5563; }
.divider::before, .divider::after { content: ""; height: 1px; background: #dfe4ea; flex: 1; }

.login-form { display: grid; gap: 20px; }
.input-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border: 1px solid #d4dbe4;
  border-radius: 8px;
  background: rgba(255,255,255,.88);
}

.field-icon { color: #687385; font-size: 21px; width: 24px; text-align: center; }
.input-wrap input { border: 0; outline: 0; flex: 1; height: 100%; background: transparent; font-size: 18px; min-width: 0; }
.icon-btn { border: 0; background: transparent; color: #687385; font-size: 18px; width: 38px; height: 38px; }
.login-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; color: #202938; }
.login-row a { color: #0757e8; text-decoration: none; }

.primary-btn {
  min-height: 50px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #0b6b39, #064b27);
  color: #fff;
  font-weight: 900;
  letter-spacing: .2px;
  padding: 0 22px;
  box-shadow: 0 8px 20px rgba(6,75,39,.18);
}

.outline-btn {
  min-height: 44px;
  border: 1px solid #b9c9c0;
  border-radius: 7px;
  background: #fff;
  color: var(--green);
  font-weight: 900;
  padding: 0 18px;
}

.admin-note { text-align: center; margin: 24px 0 0; color: #374151; }
.admin-note strong { color: var(--green); }
.status { min-height: 20px; margin: 14px 0 0; color: #a42626; text-align: center; font-weight: 700; }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; padding-top: 22px; border-top: 1px solid #dde3ea; }
.trust-row div { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; align-items: center; }
.trust-row span { grid-row: span 2; color: #667085; font-size: 23px; }
.trust-row b { font-size: 15px; }
.trust-row small { color: #4b5563; }
.login-footer { position: absolute; z-index: 1; left: 0; right: 0; bottom: 18px; color: #fff; text-align: center; display: grid; gap: 8px; }

.app-page { min-height: 100vh; background: #f7f8fb; }
.app-hero {
  min-height: 395px;
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 38px;
  padding: 48px 6vw 48px 42vw;
  background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(255,244,198,.2)), url("assets/home-bg.png") center 42% / cover no-repeat;
  color: #fff;
  text-shadow: 0 2px 9px rgba(0,0,0,.52);
}

.hero-slogan { width: min(680px, 100%); text-align: center; color: var(--green); text-shadow: 0 2px 8px rgba(255,255,255,.82); }
.hero-slogan h2 { margin: 0; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: clamp(36px, 4vw, 58px); line-height: 1.12; }
.gold-line { display: block; width: min(400px, 78%); height: 18px; border-bottom: 10px solid var(--gold); border-radius: 50%; margin: 6px auto 0; }
.hero-icons { width: min(760px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; text-align: center; }
.hero-icons span { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 16px; background: rgba(255,255,255,.88); color: var(--green); text-shadow: none; font-size: 32px; }
.hero-icons b, .hero-icons small { display: block; }
.hero-icons b { font-size: 14px; }
.hero-icons small { margin-top: 6px; line-height: 1.35; }

.workspace { display: flex; align-items: stretch; min-height: calc(100vh - 395px); }
.sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: linear-gradient(160deg, #086035, #003a20);
  color: #fff;
  padding: 14px 10px;
}

.side-logo { height: 76px; text-align: center; }
.side-script { color: #fff; font-size: 42px; }
.side-logo span { display: block; font-size: 10px; letter-spacing: 2px; margin-top: 2px; }
.side-title { color: #b9d9c9; font-size: 11px; margin: 22px 10px 10px; }
.nav {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 0 14px;
}
.nav:hover, .nav.active { background: rgba(255,255,255,.16); }
.nav span { width: 18px; text-align: center; }

.main-area { min-width: 0; flex: 1; }
.topbar { height: 66px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 28px; }
.hamb, .top-icon { border: 0; background: #fff; color: #1f2937; width: 42px; height: 42px; border-radius: 8px; font-size: 22px; }
.hamb:hover, .top-icon:hover { background: #f2f4f7; }
.topbar-spacer { flex: 1; }
.user-pill { display: flex; align-items: center; gap: 10px; min-width: 155px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #d8dee8; display: grid; place-items: center; color: #98a2b3; }
.user-pill small { display: block; color: #4b5563; }

.content { padding: 26px 36px 40px; }
.section { display: none; }
.active-section { display: block; }
.section h1, .content h1 { margin: 0 0 6px; font-size: 27px; }
.section p { margin: 0 0 18px; color: #4b5563; }

.filters { display: grid; grid-template-columns: minmax(280px, 1.6fr) .8fr .8fr .7fr .7fr auto auto; gap: 12px; align-items: end; margin: 20px 0; }
.filters label { color: #667085; font-size: 13px; font-weight: 700; }
.filters input, .filters select, .search-box {
  width: 100%;
  height: 42px;
  border: 1px solid #d6dce5;
  border-radius: 7px;
  background: #fff;
  box-sizing: border-box;
}
.filters input, .filters select { padding: 0 12px; color: #344054; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.search-box input { border: 0; outline: 0; padding: 0; flex: 1; min-width: 0; background: transparent; height: 100%; }
.search-icon { flex-shrink: 0; line-height: 1; opacity: 0.7; }

.history-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.history-filters .filters-search { width: 100%; }

.history-filters .filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.history-filters .filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 170px;
  min-width: 0;
}

.history-filters .filter-field-date {
  flex: 0 1 170px;
  max-width: 190px;
}

.history-filters .filter-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.history-filters .filter-field select,
.history-filters .filter-field input[type="date"] {
  width: 100%;
  height: 42px;
  border: 1px solid #d6dce5;
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
  color: #344054;
  box-sizing: border-box;
}

.history-filters .filter-actions {
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}

.history-filters .filter-actions .compact {
  min-width: 120px;
}
.compact { min-height: 42px; height: 42px; white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 20px; margin: 14px 0 26px; }
.metric { position: relative; min-height: 88px; border: 1px solid; border-radius: 8px; padding: 19px 74px 16px 22px; overflow: hidden; }
.metric small { display: block; font-weight: 900; font-size: 12px; margin-bottom: 8px; }
.metric b { font-size: clamp(22px, 2vw, 28px); }
.metric span { position: absolute; right: 20px; top: 22px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 900; }
.green { background: #effaf2; border-color: #cdebd8; color: #0b6a31; }
.green span { background: #bceacb; color: #0b6a31; }
.blue { background: #f0f5ff; border-color: #d3e0ff; color: var(--blue); }
.blue span { background: var(--blue); }
.purple { background: #f7f0ff; border-color: #e2d0ff; color: var(--purple); }
.purple span { background: var(--purple); }
.orange { background: #fff4e8; border-color: #ffd3ad; color: var(--orange); }
.orange span { background: var(--orange); }

.panel, .table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.04);
  padding: 20px;
}

.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 14px 20px; border-bottom: 1px solid #eef1f5; text-align: left; font-size: 14px; }
th { background: #fafafa; color: #4b5563; font-size: 12px; }
.badge { display: inline-flex; background: #dff7e6; color: #0a6a30; border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 900; }
.badge-processing { background: #fff4db; color: #9a6700; }
.badge-received-finance { background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.badge-applied,
.badge-applied-final { background: #16a34a; color: #fff; font-weight: 800; }
.status-select { height: 32px; border: 1px solid #d9e0e4; border-radius: 6px; padding: 0 8px; font-size: 12px; font-weight: 800; background: #fff; }
.status-select.badge-processing { background: #fffaf0; color: #9a6700; }
.status-select.badge-received-finance { background: #eff6ff; color: #1d4ed8; }
.status-select.badge-applied,
.status-select.badge-applied-final { background: #ecfdf3; color: #15803d; border-color: #16a34a; }
.credit-phase-final { box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25); }
.applied-return-btn { background: #ecfdf3; color: #15803d; border-color: #86efac; }
.credit-sheet-modal-card { width: min(980px, 100%); }
.credit-sheet-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  padding: 8px;
  background: #f8faf9;
  border: 1px solid #e3ebe6;
  border-radius: 10px;
}
.credit-sheet-preview-img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}
.credit-sheet-preview-pdf {
  width: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}
.credit-sheet-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.view-credit-btn { background: #eef6ff; color: #1458d4; border-color: #bfd7ff; }
tr.row-applied-final { background: #f0fdf4; }
tr.row-applied-final td { border-color: #bbf7d0; }
.row-actions { display: flex; gap: 7px; }
.mini-btn, td button { border: 1px solid #d7e1dc; background: #fff; color: var(--green); border-radius: 6px; padding: 6px 9px; text-decoration: none; font-weight: 900; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; color: #344054; }
.pagination button, .pagination select { height: 34px; border: 1px solid #d7dfe7; border-radius: 6px; background: #fff; margin-left: 6px; padding: 0 12px; }
.pagination button:first-child { background: var(--green); color: #fff; }

.credit-builder { display: grid; grid-template-columns: minmax(360px, 520px) 1fr; gap: 22px; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-form label { color: #4b5563; font-size: 13px; font-weight: 800; }
.grid-form input, .admin-form input, .admin-form select { width: 100%; height: 42px; border: 1px solid #d9e0e4; border-radius: 6px; padding: 0 12px; margin-top: 6px; }
.wide { grid-column: span 2; }
.actions { display: flex; gap: 12px; margin-top: 18px; }
.save-status { color: var(--green) !important; font-weight: 800; }
.save-status.is-error { color: #b42318 !important; background: #fff5f5; border: 1px solid #f3b4ad; border-radius: 6px; padding: 8px 10px; }
.login-password-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #5a6b62;
  line-height: 1.4;
}
.preview-panel { background: linear-gradient(120deg, rgba(255,255,255,.95), rgba(241,249,244,.95)), url("assets/home-bg.png") center / cover no-repeat; }
.credit-preview { min-height: 120px; background: rgba(255,255,255,.92); border: 1px dashed #9ab5a5; border-radius: 12px; padding: 18px; white-space: pre-wrap; line-height: 1.6; }
.template-status { min-height: 18px; margin: 0 0 10px; color: var(--green); font-weight: 800; font-size: 13px; }
.template-status.is-error { color: #b42318; }
.text-preview-details { margin-top: 14px; }
.text-preview-details summary { cursor: pointer; color: var(--green); font-weight: 800; margin-bottom: 8px; }
.list { display: grid; gap: 10px; }
.list div { padding: 12px; border: 1px solid #eef1f2; border-radius: 6px; background: #fafafa; }
.admin-layout { display: grid; grid-template-columns: minmax(340px, 1fr) 1.2fr; gap: 22px; align-items: start; }
.admin-form-panel { border-top: 4px solid var(--green); }
.admin-form { display: grid; grid-template-columns: 1.1fr 1.4fr .75fr .85fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.admin-cliente-extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f8fcf9;
}
.admin-cliente-extras label { color: #4b5563; font-size: 12px; font-weight: 900; }
.admin-cliente-extras input { width: 100%; height: 42px; border: 1px solid #d9e0e4; border-radius: 6px; padding: 0 12px; margin-top: 6px; }
.admin-form label { color: #4b5563; font-size: 12px; font-weight: 900; }
.admin-hint { margin: 10px 0 0 !important; font-size: 13px; }

.admin-subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px 14px;
  padding-left: 10px;
  border-left: 2px solid #d7eadf;
}

.admin-subnav .nav {
  font-size: 13px;
  padding-left: 8px;
}
.user-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.user-card { display: grid !important; gap: 5px; }
.user-card b { color: var(--green); }
.user-card small { color: #667085; text-transform: capitalize; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: 0 8px 24px rgba(16,24,40,.04); }
.admin-card h2 { margin: 0 0 14px; color: var(--green); font-size: 18px; }
.admin-card p { margin: 0 0 16px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.admin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.admin-kpis div { min-height: 86px; border-radius: 8px; border: 1px solid #d7eadf; background: #f2fbf5; padding: 14px; }
.admin-kpis small { display: block; color: #4b6756; font-weight: 900; margin-bottom: 8px; }
.admin-kpis b { color: var(--green); font-size: 28px; }
.quick-action { width: 100%; height: 42px; border: 1px solid #d7e1dc; background: #fff; color: var(--green); border-radius: 7px; font-weight: 900; margin-bottom: 10px; text-align: left; padding: 0 14px; }
.quick-action:hover { background: #f0f8f3; }
.admin-user-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-user-row { display: grid; grid-template-columns: 1.2fr 1.6fr .8fr .8fr; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #eef1f5; }
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-row.header { background: #fafafa; color: #4b5563; font-size: 12px; font-weight: 900; }
.role-pill { display: inline-flex; width: fit-content; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 900; background: #e8f5ee; color: var(--green); text-transform: capitalize; }
.seller-report { display: grid; gap: 10px; }
.seller-report div { display: flex; justify-content: space-between; gap: 12px; border: 1px solid #eef1f5; border-radius: 7px; padding: 12px; background: #fbfcfd; }
.seller-report .seller-link { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; color: var(--green); font-weight: 900; font-size: inherit; }
.seller-report .seller-link:hover { text-decoration: underline; }

.client-search { margin-bottom: 14px; }
.client-row { width: 100%; text-align: left; cursor: pointer; border: 1px solid #eef1f2; border-radius: 6px; background: #fafafa; padding: 12px; display: grid; gap: 4px; }
.client-row:hover { border-color: #b9dfc8; background: #f2fbf5; }
.client-row b { color: var(--green); }
.client-row small { color: #667085; font-weight: 700; }

.detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.detail-head h1 { margin: 0; }
.detail-head p { margin: 6px 0 0; color: var(--muted); }

.user-manage-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; border: 1px solid #eef1f2; border-radius: 6px; padding: 12px; background: #fafafa; }
.user-manage-row .user-card { border: 0; padding: 0; background: transparent; }
.user-actions-menu { position: relative; z-index: 2; }
.user-menu-btn { width: 36px; height: 36px; border: 1px solid #d9e0e4; border-radius: 6px; background: #fff; cursor: pointer; font-weight: 900; color: var(--green); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; background: #fff; border: 1px solid #d9e0e4; border-radius: 8px; box-shadow: 0 12px 28px rgba(16,24,40,.12); padding: 12px; display: grid; gap: 10px; }
#section-usuarios .panel,
#section-usuarios .user-list,
#usersView .card { overflow: visible; }

.catalog-count { margin: 8px 0 12px; color: #4b6756; font-weight: 800; font-size: 13px; }
.catalog-list { gap: 12px; }
.catalog-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid #eef1f2;
  border-radius: 10px;
  background: #fff;
}
.catalog-item-actions { display: flex; align-items: flex-start; }
.catalog-edit-btn { white-space: nowrap; }
.catalog-edited-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1458d4;
  font-size: 11px;
  font-weight: 800;
}
.catalog-edit-modal .catalog-edit-card { width: min(560px, 100%); }
.catalog-edit-form { display: grid; gap: 12px; }
.catalog-edit-form label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
.catalog-edit-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9e0e4;
  border-radius: 8px;
  font: inherit;
}
.catalog-edit-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 10px;
  border: 1px dashed #d9e0e4;
  border-radius: 10px;
  background: #f9fcfa;
}
.catalog-edit-preview {
  width: 140px;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #d9e0e4;
  background: #fff;
}
.catalog-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.catalog-edit-status { margin: 0; min-height: 18px; color: #4b6756; font-size: 13px; font-weight: 700; }
body.catalog-edit-open { overflow: hidden; }
.catalog-thumb,
.ocr-match-thumb {
  width: 110px;
  height: 142px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #d9e0e4;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
}
.catalog-item-body { display: grid; gap: 4px; min-width: 0; }
.catalog-label { font-size: 11px; font-weight: 900; color: #667085; text-transform: uppercase; margin-right: 6px; }
.catalog-item-name span { color: #1f2937; font-weight: 700; }
.catalog-size { color: #667085; }
.catalog-empty { padding: 12px; color: #667085; }

.ocr-product-matches,
.ocr-preview { margin-top: 10px; }
.ocr-match-head { margin-bottom: 8px; color: var(--green); }
.ocr-match-list { display: grid; gap: 8px; }
.ocr-match-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f7fcf9;
}
.ocr-match-item b { display: block; color: var(--green); }
.ocr-match-item span { display: block; font-size: 13px; }
.ocr-match-empty { color: #667085; font-size: 13px; margin: 0; }

.client-signup-box { margin-top: 14px; border: 1px solid #d7eadf; border-radius: 10px; padding: 12px 14px; background: #f7fcf9; }
.client-signup-box summary { cursor: pointer; font-weight: 900; color: var(--green); }
.seller-signup-box { background: #f4f9ff; border-color: #c8d9f0; }
.seller-signup-box summary { color: #1458d4; }

.pending-seller-panel {
  border-top: 4px solid #f2b705;
  text-align: left;
}

.pending-seller-panel h1 {
  color: var(--green);
  margin-top: 0;
}

.pending-approvals-panel {
  margin-bottom: 18px;
  border-top: 4px solid #1458d4;
}

.pending-sellers-list {
  display: grid;
  gap: 10px;
}

.pending-seller-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e3ebe6;
  border-radius: 8px;
  background: #fafcfb;
}

.pending-seller-row b {
  display: block;
  color: var(--green);
}

.pending-seller-row small,
.pending-seller-row span {
  display: block;
  color: #5b6678;
  font-size: 12px;
  margin-top: 2px;
}

.pending-seller-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-status-pill {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
}

.account-status-pill.pending {
  background: #fff7e6;
  color: #b54708;
}

.account-status-pill.rejected {
  background: #fff1f1;
  color: #b42318;
}

body.seller-pending-mode .app-hero {
  display: none;
}

body.seller-pending-mode .workspace {
  min-height: 100vh;
}
.signup-form { margin-top: 12px; }
.signup-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.proof-photo-panel,
.client-photo-panel { margin-top: 16px; padding: 14px; border: 1px dashed #9ab5a5; border-radius: 10px; background: #f7fcf9; }
.proof-photo-panel h3,
.client-photo-panel h3 { margin: 0 0 8px; color: var(--green); font-size: 16px; }
.proof-photo-preview,
.client-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.proof-photo-preview img,
.client-photo-preview img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid #d9e0e4; }
.proof-photo-existing { margin-top: 10px; }
.expiration-proof-panel { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.approval-proof-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proof-upload-btn { margin-top: 4px; }
.proof-ocr-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: #2f5d44;
  min-height: 18px;
}
.proof-ocr-status.is-error { color: #b42318; }
.proof-ocr-matches { margin-top: 8px; }
.ai-learn-hint { margin-top: 10px; font-size: 12px; color: #5b6678; }
.ocr-zoom-hint { margin-top: 6px; font-size: 12px; color: #3d6b52; font-style: italic; }
.proof-ocr-status.is-zoom { color: #1d4ed8; }

.detected-products-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cfe0d6;
  border-radius: 10px;
  background: #f3faf6;
}
.detected-products-panel h4 {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 15px;
}
.detected-products-list { display: grid; gap: 10px; }
.detected-product-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px dashed #b7cfc2;
  border-radius: 8px;
  background: #fff;
}
.detected-product-row label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #5b6678;
}
.detected-product-row input {
  height: 34px;
  border: 1px solid #d5e4dc;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}
.detected-product-row .detected-span-2 { grid-column: span 2; }
.detected-main-hint { grid-column: 1 / -1; color: #6b7280; font-size: 11px; }
@media (max-width: 760px) {
  .detected-product-row { grid-template-columns: 1fr 1fr; }
  .detected-product-row .detected-span-2 { grid-column: span 2; }
}

.top-notify-wrap { position: relative; }
.top-notify-btn { position: relative; }
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
}
.notify-badge.hidden { display: none; }
.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid #d5e4dc;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 120;
  padding: 12px;
}
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.notify-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.notify-item {
  display: grid;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e3ebe6;
  border-radius: 8px;
  background: #f9fcfa;
  cursor: pointer;
}
.notify-item:hover { background: #eef8f2; border-color: #b9d4c4; }
.notify-item b { color: var(--green); font-size: 14px; }
.notify-item small { color: #5b6678; }
.notify-item span { font-size: 12px; color: #7a8799; }
.notify-empty { margin: 0; color: #5b6678; font-size: 13px; }
.notify-view-all { width: 100%; margin-top: 10px; }

.proof-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.proof-modal.hidden { display: none; }
.proof-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.proof-modal-card {
  position: relative;
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d5e4dc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 16px;
}
.proof-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.proof-modal-meta { margin: 4px 0 0; color: #5b6678; font-size: 13px; }
.proof-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.proof-gallery-card {
  border: 1px solid #e3ebe6;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fcfa;
}
.proof-gallery-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.proof-gallery-meta {
  padding: 10px;
  display: grid;
  gap: 6px;
}
.proof-gallery-meta b { font-size: 13px; color: var(--green); }
.proof-gallery-meta small { color: #6b7280; word-break: break-all; }
.proof-modal-foot { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.proof-modal-invoice-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}
.proof-modal-invoice-downloads.hidden { display: none; }
.exp-proof-invoice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
body.proof-modal-open { overflow: hidden; }

.nav-pending-badge {
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.nav-pending-badge.hidden { display: none; }
#navHistorico { position: relative; }

.badge-pending { background: #fff7e6; color: #b54708; }
tr.row-pending-approval { background: #fffbf0; }
tr.row-pending-approval:hover { background: #fff4e0; }
.badge-rejected { background: #fff1f1; color: #b42318; }
.status-cell { display: grid; gap: 6px; min-width: 160px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.approval-kpis { margin-bottom: 18px; }

.approval-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.approval-filters-bar .search-box { flex: 1 1 280px; }

.approval-row-actions,
.approval-row-actions .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.approval-proof-empty {
  font-size: 12px;
  color: #7a8799;
}

.approval-reviewed-label {
  font-size: 12px;
  font-weight: 700;
  color: #5b6678;
}

.approval-queue-empty {
  margin: 12px 0 0;
  color: #5b6678;
  font-size: 14px;
}

.approval-queue-empty.hidden { display: none; }

#section-aprovacao .table-wrap td b {
  color: var(--green);
}
.approve-btn { background: #e8f5ee; color: var(--green); border: 1px solid #b9dfc8; }
.reject-btn { background: #fff1f1; color: #b42318; border: 1px solid #f2c6c6; }

.user-menu-panel.hidden { display: none; }
.user-menu-panel label { font-size: 12px; font-weight: 900; color: #4b5563; display: grid; gap: 6px; }
.user-menu-panel select { height: 36px; border: 1px solid #d9e0e4; border-radius: 6px; padding: 0 8px; }
.user-menu-remove { border: 0; background: #fff1f1; color: #b42318; border-radius: 6px; height: 36px; font-weight: 800; cursor: pointer; }

@media (max-width: 1180px) {
  .login-page { grid-template-columns: 1fr; padding: 34px 22px 100px; }
  .login-brand { align-self: center; margin-top: 0; }
  .login-card { justify-self: center; }
  .app-hero { padding-left: 24px; justify-items: center; }
  .filters { grid-template-columns: 1fr 1fr; }
  .history-filters .filter-actions { margin-left: 0; width: 100%; }
  .history-filters .filter-actions .compact { flex: 1 1 140px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .credit-builder, .admin-form, .admin-layout, .admin-grid, .admin-kpis { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}

@media (max-width: 900px) {
  .app-hero { display: none; }
  .workspace { min-height: 100vh; }
  .hamb { display: grid; place-items: center; flex-shrink: 0; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(88vw, 288px);
    max-width: 288px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.28);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  .nav { min-height: 48px; font-size: 15px; }
  body.sidebar-open { overflow: hidden; }
}

@media (min-width: 901px) {
  .hamb { display: none; }
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 820px) {
  .pending-seller-row {
    grid-template-columns: 1fr;
  }

  .pending-seller-actions .primary-btn,
  .pending-seller-actions .outline-btn {
    width: 100%;
  }

  .login-card { padding: 28px 20px; }
  .trust-row, .hero-icons, .cards { grid-template-columns: 1fr; }
  .workspace { display: block; }
  .content {
    padding: 16px max(14px, env(safe-area-inset-right)) 28px max(14px, env(safe-area-inset-left));
  }
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    gap: 10px;
    flex-wrap: wrap;
  }
  .user-pill {
    min-width: 0;
    max-width: calc(100% - 52px);
  }
  .user-pill b,
  .user-pill small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
  }
  .filters { grid-template-columns: 1fr; }
  .filters .compact,
  .filters button {
    width: 100%;
  }
  .history-filters .filter-field,
  .history-filters .filter-field-date {
    flex: 1 1 100%;
    max-width: none;
  }
  .history-filters .filter-actions .compact {
    width: 100%;
    flex: 1 1 100%;
  }
  .login-row, .pagination { align-items: flex-start; flex-direction: column; }
  .pagination > div { width: 100%; }
  .grid-form, .wide { grid-template-columns: 1fr; grid-column: auto; }
  .admin-user-row { grid-template-columns: 1fr; gap: 4px; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { flex-direction: column; }
  .actions .primary-btn,
  .actions .outline-btn { width: 100%; }
  .section h1, .content h1 { font-size: 22px; }
  .table-wrap {
    margin: 0 -4px;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 640px; }
  th, td { padding: 10px 12px; font-size: 13px; }
  .row-actions { flex-wrap: wrap; }
  .status-cell { min-width: 140px; }
  .user-manage-row { grid-template-columns: 1fr; }
  .user-menu-panel {
    position: static;
    margin-top: 8px;
    box-shadow: none;
    border: 1px solid #e3ebe6;
  }
  .catalog-item { grid-template-columns: 1fr; }
  .catalog-item-actions { justify-content: flex-start; }
  .catalog-thumb, .ocr-match-thumb {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 3 / 4;
  }
  .metric { padding-right: 22px; }
  .metric span { display: none; }
  .notify-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(70vh, 420px);
  }
}


/* Template/PDF/OCR engine - somente dentro da aba Novo Crédito */
.template-engine {
  margin-bottom: 18px;
}

.template-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-upload-btn input {
  display: none;
}

.template-canvas-wrap {
  min-height: 420px;
  background: #f8fafc;
  border: 1px solid #d9e0e4;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.template-canvas-wrap.is-loading::before {
  content: "Carregando template do credito...";
  display: block;
  text-align: center;
  color: #667085;
  font-weight: 700;
  padding: 180px 12px;
}

.template-canvas-wrap.is-error::before {
  content: "Template nao carregou. Confirme template.jpg no deploy e use Ctrl+F5.";
  display: block;
  text-align: center;
  color: #b42318;
  font-weight: 700;
  padding: 180px 12px;
}

.template-canvas-wrap.is-loading canvas,
.template-canvas-wrap.is-error canvas {
  display: none;
}

#creditTemplateCanvas {
  display: block;
  width: 100%;
  max-height: 740px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}


/* Ajuste de preenchimento do template e múltiplas linhas - apenas Novo Crédito */
.extra-rows-box {
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 12px;
  background: #fbfcfd;
}

.extra-rows-box strong {
  display: block;
  color: var(--green);
  margin-bottom: 4px;
}

.extra-rows-box small {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

#extraRowsList {
  display: grid;
  gap: 8px;
}

.extra-credit-row {
  display: grid;
  grid-template-columns: 62px 52px .8fr .75fr .55fr 1.6fr .75fr .75fr .75fr .75fr 34px;
  gap: 6px;
  align-items: center;
}

.row-proof-upload-btn,
.row-exp-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 36px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px dashed #9aa5b1;
  background: #fff;
  color: #064b27;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.row-proof-upload-btn.has-photos {
  border-style: solid;
  border-color: #064b27;
  background: #eef8f1;
}

.row-exp-upload-btn {
  background: #fff8e6;
  color: #7a5a00;
}

.row-exp-upload-btn.has-photos {
  border-style: solid;
  border-color: #d4a017;
  background: #fff3cd;
}

.row-proof-upload-btn input,
.row-exp-upload-btn input {
  display: none;
}

.inline-proof-upload-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.inline-proof-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.inline-proof-upload-btn.is-uploading {
  opacity: 0.65;
  pointer-events: none;
}

.proof-sheet-photo {
  margin: 0 0 16px;
}

.proof-sheet-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: #5b6678;
}

.proof-sheet-invoice-group + .proof-sheet-invoice-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.proof-photos-preview {
  max-height: min(72vh, 820px);
  overflow: auto;
}

.extra-credit-row-wrap {
  display: grid;
  gap: 6px;
}

.row-exp-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 4px;
}

.row-exp-preview img,
.row-exp-pending img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d9e0e4;
}

.row-exp-pending {
  position: relative;
}

.exp-proof-invoice-group {
  grid-column: 1 / -1;
  margin-bottom: 12px;
}

.exp-proof-invoice-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--green);
}

.exp-proof-invoice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.extra-credit-row input,
.extra-credit-row select {
  min-width: 0;
  height: 36px;
  border: 1px solid #d9e0e4;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  background: #fff;
}

.extra-credit-row button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: #b42318;
  color: #fff;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .extra-credit-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— Novo Crédito: layout premium (somente esta seção) ——— */
#section-novo.nc-section {
  --nc-gold: #d4a017;
  --nc-gold-soft: rgba(212, 160, 23, 0.14);
  --nc-surface: #ffffff;
  --nc-ink-muted: #5b6678;
}

#section-novo .nc-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 22px 26px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(6, 75, 39, 0.96) 0%, rgba(11, 106, 53, 0.92) 55%, rgba(6, 75, 39, 0.98) 100%),
    url("assets/home-bg.png") center / cover no-repeat;
  color: #fff;
  box-shadow: 0 18px 42px rgba(6, 75, 39, 0.22);
  position: relative;
  overflow: hidden;
}

#section-novo .nc-hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--nc-gold-soft), transparent 68%);
  pointer-events: none;
}

#section-novo .nc-hero-copy {
  position: relative;
  z-index: 1;
}

#section-novo .nc-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

#section-novo .nc-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}

#section-novo .nc-hero p {
  margin: 0;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.5;
}

#section-novo .nc-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

#section-novo .nc-meta-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 160, 23, 0.45);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#section-novo .nc-layout.credit-builder {
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

#section-novo .nc-form-card,
#section-novo .nc-preview-card {
  border: 1px solid rgba(6, 75, 39, 0.1);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  background: var(--nc-surface);
}

#section-novo .nc-card-head,
#section-novo .nc-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fafcfb 0%, #fff 100%);
}

#section-novo .nc-card-head h2,
#section-novo .nc-preview-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--green);
  font-weight: 900;
}

#section-novo .nc-card-head p {
  margin: 0;
  font-size: 13px;
  color: var(--nc-ink-muted);
}

#section-novo .nc-step {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--nc-gold-soft);
  border: 1px solid rgba(212, 160, 23, 0.35);
  color: #7a5a00;
  font-size: 12px;
  font-weight: 900;
}

#section-novo .nc-quick-fill {
  margin: 0 16px 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(6, 75, 39, 0.22);
  background: linear-gradient(180deg, #f7fcf9 0%, #fff 100%);
}

#section-novo .nc-quick-fill.is-collapsed .nc-quick-fill-legend,
#section-novo .nc-quick-fill.is-collapsed .nc-quick-fill-input,
#section-novo .nc-quick-fill.is-collapsed .nc-quick-fill-actions {
  display: none;
}

#section-novo .nc-quick-fill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#section-novo .nc-quick-fill-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--green);
}

#section-novo .nc-quick-fill-head p {
  margin: 0;
  font-size: 12px;
  color: var(--nc-ink-muted);
  line-height: 1.45;
}

#section-novo .nc-quick-fill-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

#section-novo .nc-quick-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef6f0;
  border: 1px solid #d2e4d8;
  font-size: 11px;
  color: #2f4a38;
  line-height: 1.3;
}

#section-novo .nc-quick-tag b {
  color: #064b27;
  font-weight: 900;
  text-transform: capitalize;
}

#section-novo .nc-quick-tag em {
  font-style: normal;
  color: #5b6678;
  font-weight: 600;
}

#section-novo .nc-quick-fill-input {
  width: 100%;
  min-height: 88px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid #cfd8dc;
  border-radius: 10px;
  font-size: 14px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
  color: #1a2e22;
}

#section-novo .nc-quick-fill-input:focus {
  outline: none;
  border-color: rgba(6, 75, 39, 0.45);
  box-shadow: 0 0 0 3px rgba(6, 75, 39, 0.1);
}

#section-novo .nc-quick-fill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#section-novo .nc-form-body {
  padding: 12px 16px 8px;
}

#section-novo .nc-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

#section-novo .nc-span-2 {
  grid-column: 1 / -1;
}

#section-novo .nc-field {
  display: grid;
  gap: 6px;
  color: var(--nc-ink-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#section-novo .nc-field span {
  margin: 0;
}

#section-novo .nc-field input,
#section-novo .nc-field select {
  margin-top: 0;
  height: 40px;
  border: 1px solid #d5dde6;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

#section-novo .nc-field select {
  cursor: pointer;
  padding-right: 28px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #5b6678 50%), linear-gradient(135deg, #5b6678 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

#section-novo .nc-field input:focus,
#section-novo .nc-field select:focus {
  outline: none;
  border-color: rgba(6, 75, 39, 0.45);
  box-shadow: 0 0 0 3px rgba(6, 75, 39, 0.1);
}

#section-novo .nc-photo-panel {
  margin: 0 22px 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(6, 75, 39, 0.28);
  background: linear-gradient(180deg, #f4fbf7, #fff);
}

#section-novo .nc-actions {
  margin: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fafcfb;
  flex-wrap: wrap;
  gap: 8px;
}

#section-novo .nc-btn-primary {
  min-height: 48px;
  padding: 0 26px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(6, 75, 39, 0.24);
}

#section-novo .nc-save-status {
  padding: 0 22px 18px;
  margin: 0;
}

#section-novo .nc-edit-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #e8c96a;
  color: #6b4e00;
  font-size: 14px;
  font-weight: 600;
}

.row-actions {
  flex-wrap: wrap;
  align-items: center;
}

.row-actions .edit-credit-btn {
  border-color: #2f6b4a;
  background: #eef8f1;
  color: #064b27;
}

.row-actions .delete-credit-btn {
  border-color: #c45c5c;
  background: #fff5f5;
  color: #8b1e1e;
}

#section-novo .nc-preview-card.preview-panel {
  background: #fff;
}

#section-novo .nc-preview-head .template-status {
  margin: 0;
  font-size: 12px;
}

#section-novo .template-engine {
  padding: 0 18px 18px;
}

#section-novo .nc-toolbar.template-toolbar {
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #064b27, #073d22);
  gap: 8px;
}

#section-novo .nc-toolbar .primary-btn,
#section-novo .nc-toolbar .outline-btn,
#section-novo .nc-toolbar .file-upload-btn {
  min-height: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 12px;
  padding: 0 16px;
}

#section-novo .nc-toolbar .outline-btn,
#section-novo .nc-toolbar .file-upload-btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#section-novo .nc-toolbar .outline-btn:hover,
#section-novo .nc-toolbar .file-upload-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

#section-novo .nc-toolbar .primary-btn {
  background: linear-gradient(180deg, #f2c94c, #d4a017);
  color: #1a2e05;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

#section-novo .nc-extra-rows.extra-rows-box {
  border-radius: 12px;
  border-color: #e2e8f0;
  background: #f8fafc;
  margin-bottom: 14px;
}

#section-novo .template-canvas-wrap {
  border-radius: 14px;
  border: 1px solid #d9e0e4;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#section-novo .template-canvas-wrap.is-loading::before,
#section-novo .template-canvas-wrap.is-error::before {
  padding: 140px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
}

#section-novo #creditTemplateCanvas {
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.1);
}

#section-novo .nc-ocr-status {
  margin-top: 10px;
  font-size: 13px;
}

#section-novo .nc-text-preview {
  margin: 0 18px 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafcfb;
}

#section-novo .nc-text-preview .credit-preview {
  border: 0;
  background: #fff;
  border-radius: 8px;
  min-height: 96px;
}

@media (max-width: 1180px) {
  #section-novo .nc-layout.credit-builder {
    grid-template-columns: 1fr;
  }

  #section-novo .nc-hero {
    flex-direction: column;
  }

  #section-novo .nc-compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #section-novo .nc-hero {
    padding: 18px;
  }

  #section-novo .nc-form-groups,
  #section-novo .nc-actions,
  #section-novo .nc-card-head,
  #section-novo .nc-preview-head {
    padding-left: 16px;
    padding-right: 16px;
  }

  #section-novo .nc-toolbar.template-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #section-novo .nc-toolbar .primary-btn,
  #section-novo .nc-toolbar .outline-btn,
  #section-novo .nc-toolbar .file-upload-btn {
    width: 100%;
    justify-content: center;
  }
}

.photo-upload-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1250;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #b8d4c4;
  background: #f4fbf6;
  box-shadow: 0 12px 32px rgba(15, 45, 30, 0.18);
  transform: translateX(-50%);
}

.photo-upload-toast.hidden {
  display: none;
}

.photo-upload-toast.is-error {
  border-color: #e8b4b4;
  background: #fff5f5;
}

.photo-upload-toast.is-success {
  border-color: #b8d4c4;
  background: #f4fbf6;
}

.photo-upload-toast.is-uploading {
  border-color: #9ec5ff;
  background: #f5f9ff;
}

.photo-upload-toast-body {
  display: grid;
  gap: 8px;
}

#photoUploadToastMessage {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #1f3d2d;
}

.photo-upload-toast.is-error #photoUploadToastMessage {
  color: #8b1e1e;
}

.photo-upload-toast.is-uploading #photoUploadToastMessage {
  color: #1a3f7a;
}

.photo-upload-detail {
  margin: 0;
  font-size: 12px;
  color: #5b6678;
  word-break: break-word;
}

.photo-upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 45, 30, 0.12);
  overflow: hidden;
}

.photo-upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8f5b, #3cb371);
  transition: width 0.25s ease;
}

.photo-upload-toast.is-uploading .photo-upload-progress-bar {
  background: linear-gradient(90deg, #2b6cb0, #4299e1);
}

.delete-undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #b8d4c4;
  background: #f4fbf6;
  box-shadow: 0 12px 32px rgba(15, 45, 30, 0.18);
  transform: translateX(-50%);
}

.delete-undo-toast.hidden {
  display: none;
}

.delete-undo-toast span {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #1f3d2d;
}

.delete-undo-toast #deleteUndoBtn {
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .delete-undo-toast {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

/* ——— Mobile: login e telas estreitas ——— */
@media (max-width: 480px) {
  .login-page {
    padding: 20px 14px 88px;
    gap: 16px;
  }

  .brand-script, .side-script {
    font-size: clamp(52px, 18vw, 78px);
  }

  .brand-sub {
    letter-spacing: 6px;
    font-size: 20px;
  }

  .login-card {
    width: 100%;
    padding: 22px 16px;
    border-radius: 14px;
  }

  .login-card h1 { font-size: 26px; }
  .login-copy { font-size: 15px; margin-bottom: 22px; }

  .google-btn {
    height: 54px;
    font-size: 17px;
    gap: 14px;
  }

  .google-mark svg { width: 24px; height: 24px; }

  .input-wrap {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding: 10px 12px;
    align-items: center;
  }

  .input-wrap input,
  .filters input,
  .filters select,
  .search-box input,
  .grid-form input,
  .admin-form input,
  .admin-form select {
    font-size: 16px;
  }

  .login-password-hint {
    flex: 1 1 100%;
    order: 3;
    margin-top: 4px;
  }

  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .primary-btn,
  .outline-btn {
    min-height: 48px;
    width: 100%;
  }

  .divider { margin: 22px 0; }

  .trust-row div {
    grid-template-columns: 32px 1fr;
  }

  .cards { gap: 12px; }
  .metric { min-height: 76px; padding: 14px 16px; }
  .metric b { font-size: 22px; }

  .panel, .table-wrap { padding: 14px; }

  .credit-builder { gap: 14px; }

  .proof-modal {
    padding: 0;
    align-items: stretch;
  }

  .proof-modal-card {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }

  .proof-modal-gallery {
    grid-template-columns: 1fr;
  }

  .admin-kpis { grid-template-columns: 1fr; }
  .admin-kpis b { font-size: 24px; }

  .seller-report div {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-head {
    flex-direction: column;
    gap: 10px;
  }

  .detail-head .outline-btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .top-notify-wrap { order: 2; }
  .user-pill { order: 3; width: 100%; max-width: 100%; }
  .user-pill b,
  .user-pill small { max-width: 100%; }
}
