/* =========================================
   CLIQUE PARA ABRIR — PAINEL DE PROPOSTAS
   ========================================= */

:root {
  color-scheme: light;

  --background: #faf7f2;
  --surface: #ffffff;
  --surface-soft: #f3ede5;
  --surface-rose: #f7eeeb;

  --text: #302b28;
  --text-muted: #71665f;

  --primary: #754b49;
  --primary-hover: #603b39;
  --primary-soft: #eee0dc;

  --border: #ded4ca;
  --success: #385b46;
  --success-soft: #eaf1e9;
  --warning: #79551e;
  --warning-soft: #fbf0da;
  --danger: #993c3c;
  --danger-soft: #faece9;

  --font-body: "Segoe UI", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  --radius-small: 10px;
  --radius: 18px;
  --radius-large: 26px;

  --shadow: 0 12px 40px rgb(62 42 30 / 6%);
  --shadow-modal: 0 24px 80px rgb(32 22 16 / 20%);

  --sidebar-width: 250px;
  --bottom-nav-height: 76px;

  --transition: 180ms ease;
}

/* BASE */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-heading);
  font-weight: 400;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 600;
}

::selection {
  color: var(--text);
  background: var(--primary-soft);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* CAPA DE ENTRADA */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow-y: auto;
  background: var(--background);
}

.login-decoration {
  display: none;
}

.login-content {
  display: flex;
  min-height: 100%;
  padding: 36px 24px;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-brand {
  display: inline-flex;
  min-height: 44px;
  margin-bottom: 44px;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.login-brand > span {
  font-size: 1.65rem;
}

.login-eyebrow {
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card h1 {
  font-size: clamp(2.6rem, 8vw, 3.5rem);
  line-height: 1.08;
}

.login-description {
  max-width: 350px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.8;
}

.login-form {
  display: grid;
  margin-top: 32px;
  gap: 20px;
}

.login-form input {
  min-height: 54px;
  background: var(--surface);
}

.login-password {
  position: relative;
}

.login-password input {
  padding-right: 88px !important;
}

.login-password__toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 72px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
}

.login-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  justify-content: space-between;
}

.login-message {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.login-preview {
  margin-top: 22px;
  text-align: center;
}

.login-preview .text-link {
  font-size: 0.8rem;
}

.login-preview p {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.login-signature {
  margin-top: 36px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.94rem;
  font-style: italic;
  text-align: center;
}

body.login-visible {
  overflow: hidden;
}

@media (min-width: 960px) {
  .login-screen {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }

  .login-decoration {
    position: relative;
    display: flex;
    min-height: 100%;
    padding: 64px;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: #754b49;
    color: #fff7ef;
  }

  .login-decoration::before,
  .login-decoration::after {
    position: absolute;
    width: 480px;
    height: 640px;
    border: 1px solid rgb(255 247 239 / 15%);
    border-radius: 50%;
    content: "";
    pointer-events: none;
  }

  .login-decoration::before {
    top: -260px;
    right: -240px;
    transform: rotate(-30deg);
  }

  .login-decoration::after {
    bottom: -310px;
    left: -250px;
    transform: rotate(25deg);
  }

  .login-decoration__star {
    margin-bottom: 28px;
    color: #ead2c5;
    font-size: 2.6rem;
  }

  .login-decoration > p {
    position: relative;
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 4.4vw, 4.6rem);
    line-height: 1.18;
    letter-spacing: -0.04em;
    text-wrap: balance;
  }

  .login-decoration__signature {
    margin-top: 40px;
    color: #ead2c5;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .login-content {
    padding: 48px;
  }
}

@media (max-height: 700px) {
  .login-brand {
    margin-bottom: 24px;
  }

  .login-content {
    align-items: flex-start;
  }
}

/* CAPA DE LOGIN — AJUSTE DE TAMANHO E ESPAÇAMENTO */

.login-screen {
  height: 100dvh;
}

.login-content {
  min-height: 0;
  padding: 24px 32px;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 520px;
}

.login-card h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-wrap: nowrap;
}

.login-eyebrow {
  margin-bottom: 12px;
}

.login-description {
  max-width: 410px;
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.65;
}

.login-form {
  margin-top: 24px;
  gap: 16px;
}

.login-form input,
.login-submit {
  min-height: 48px;
}

.login-submit {
  margin-top: 2px;
}

.login-decoration {
  min-height: 0;
}

.login-decoration > p {
  font-size: clamp(2.4rem, 4vw, 4rem);
}

@media (min-width: 960px) {
  .login-screen {
    overflow: hidden;
  }

  .login-decoration {
    padding: 48px;
  }

  .login-content {
    padding: 24px 44px;
    align-items: center;
  }
}

@media (max-height: 650px) {
  .login-content {
    padding-block: 18px;
    align-items: center;
  }

  .login-form {
    margin-top: 18px;
    gap: 12px;
  }

  .login-description {
    margin-top: 10px;
  }

  .login-decoration__star {
    margin-bottom: 16px;
  }

  .login-decoration__signature {
    margin-top: 24px;
  }
}

@media (max-width: 480px) {
  .login-content {
    padding-inline: 20px;
  }

  .login-card h1 {
    font-size: clamp(1.2rem, 5.6vw, 1.65rem);
  }
}

.login-decoration {
  background: #754B49;
}

.login-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 112px;
  height: auto;
  margin-bottom: 20px;
  flex-shrink: 0;
}

@media (max-height: 650px) {
  .login-logo {
    width: 80px;
    margin-bottom: 14px;
  }

  .login-decoration > p {
    font-size: clamp(2rem, 3.5vw, 3rem);
  }

  .login-decoration__signature {
    margin-top: 20px;
  }
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ESTRUTURA — MOBILE FIRST */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-content {
  min-width: 0;
  padding-bottom: calc(
    var(--bottom-nav-height) + env(safe-area-inset-bottom) + 16px
  );
}

.sidebar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding-bottom: env(safe-area-inset-bottom);
}

.brand,
.sidebar__signature {
  display: none;
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  min-height: var(--bottom-nav-height);
  max-width: 600px;
  margin-inline: auto;
  padding: 7px 8px;
  gap: 4px;
}

.nav-item {
  display: flex;
  min-width: 0;
  min-height: 58px;
  padding: 7px 3px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.2;
  transition:
    color var(--transition),
    background var(--transition);
}

.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item--create {
  min-height: 52px;
  margin: 0 4px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
}

.nav-item--create .icon {
  width: 25px;
  height: 25px;
}

.topbar {
  display: flex;
  min-height: 82px;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  font-family: var(--font-heading);
  font-size: 1.04rem;
  letter-spacing: -0.025em;
}

.topbar__brand span {
  margin-left: 4px;
  color: var(--primary);
}

.topbar__context {
  display: none;
}

.profile-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-link__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-rose);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

main {
  width: 100%;
  max-width: 1300px;
  margin-inline: auto;
  padding: 32px 20px 44px;
}

main:focus {
  outline: none;
}

.view > section + section {
  margin-top: 38px;
}

.page-heading {
  display: flex;
  margin-bottom: 32px;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.page-heading h1 span[aria-hidden] {
  color: var(--primary);
  font-size: 0.7em;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-description {
  max-width: 620px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.section-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.section-description {
  max-width: 680px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.section-empty {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.app-footer {
  display: flex;
  max-width: 1300px;
  margin-inline: auto;
  padding: 0 20px 24px;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.app-footer span:first-child {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.96rem;
}

/* BOTÕES E LINKS */

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 12px 20px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition);
}

.button--primary {
  background: var(--primary);
  color: white;
}

.button--secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button--danger {
  background: var(--danger);
  color: white;
}

.button > span[aria-hidden] {
  font-size: 1.15rem;
  line-height: 1;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  padding: 8px 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-underline-offset: 5px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.action-group {
  display: flex;
  margin-block: 20px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ESTADOS VAZIOS */

.empty-state {
  display: flex;
  padding: 38px 22px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  text-align: center;
}

.empty-state__symbol {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-rose);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.9rem;
}

.empty-state h2,
.empty-state h3 {
  max-width: 460px;
}

.empty-state p {
  max-width: 440px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.empty-state .button {
  margin-top: 8px;
}

.today-section .empty-state {
  align-items: flex-start;
  background: var(--surface-soft);
  text-align: left;
}

.today-section .empty-state__symbol {
  width: auto;
  height: auto;
  margin: 0;
  background: transparent;
  font-size: 1.6rem;
}

/* LISTAS E CARDS */

.proposal-grid,
.product-grid,
.addon-grid,
.portfolio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.proposal-grid:empty,
.product-grid:empty,
.addon-grid:empty,
.portfolio-grid:empty,
.today-list:empty,
.draft-list:empty,
#lista-notas:empty {
  display: none;
}

.proposal-card,
.product-card,
.addon-card,
.portfolio-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.proposal-card,
.product-card,
.addon-card {
  padding: 22px;
}

.proposal-card__header {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-card__code {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.proposal-card__title,
.product-card__title,
.addon-card__title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.25;
}

.proposal-card__meta,
.product-card__description,
.addon-card__description {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.proposal-card__footer {
  display: flex;
  margin-top: 22px;
  padding-top: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.proposal-card__value {
  font-size: 1rem;
  font-weight: 600;
}

.product-card.is-selected,
.addon-card.is-selected {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.product-card__price,
.addon-card__price {
  margin-block: 18px;
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 600;
}

.product-card__price del,
.addon-card__price del {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.product-card .button,
.addon-card .button {
  width: 100%;
}

.status-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 10px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
}

.status-badge[data-status="publicada"],
.status-badge[data-status="enviada"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-badge[data-status="visualizada"],
.status-badge[data-status="pedido_fechado"] {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge[data-status="em_negociacao"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge[data-status="expirada"],
.status-badge[data-status="nao_fechou"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.label-chip {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.today-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 12px;
  list-style: none;
}

.today-item,
.draft-item {
  display: flex;
  min-width: 0;
  padding: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.today-item__content,
.draft-item__content {
  min-width: 0;
}

.today-item p,
.draft-item p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.draft-list {
  display: grid;
  gap: 12px;
}

/* FORMULÁRIOS */

.filters {
  display: grid;
  margin-bottom: 24px;
  padding: 20px;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.field > label {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.field > label span {
  color: var(--text-muted);
  font-weight: 400;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
  outline-offset: 2px;
}

input[readonly] {
  background: var(--surface-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--primary);
}

.checkbox-field,
.switch-field,
.checkbox-group label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  cursor: pointer;
}

.switch-field {
  font-weight: 600;
}

.field-help {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.form-error {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-small);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.86rem;
}

.results-count {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.results-count:empty,
.save-status:empty {
  display: none;
}

/* ETAPAS DA PROPOSTA */

.wizard-nav {
  margin-bottom: 28px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.wizard-nav ol {
  display: flex;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.wizard-nav button {
  display: inline-flex;
  min-height: 44px;
  padding: 6px 9px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.wizard-nav button span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.72rem;
}

.wizard-nav button[aria-current="step"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.wizard-nav button[aria-current="step"] span {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.wizard-nav button.is-complete span {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

#form-proposta {
  padding: 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
}

.wizard-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.wizard-step > legend {
  width: 100%;
  margin-bottom: 24px;
  padding: 0;
  font-family: var(--font-heading);
  font-size: 1.55rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.save-status {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.save-status[data-state="saved"] {
  color: var(--success);
}

.save-status[data-state="error"] {
  color: var(--danger);
}

.wizard-actions {
  display: flex;
  margin-top: 32px;
  padding-top: 22px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
}

#proxima-etapa,
#publicar-proposta {
  margin-left: auto;
}

.special-condition {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

#config-condicao-especial {
  margin-top: 18px;
}

.checkbox-group {
  display: grid;
  margin: 22px 0 0;
  padding: 0;
  gap: 4px;
  border: 0;
}

.checkbox-group legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

#editor-referencias {
  display: grid;
  margin-top: 24px;
  gap: 28px;
}

.reference-group {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.reference-group h3 {
  margin-bottom: 16px;
}

.reference-list {
  display: grid;
  gap: 12px;
}

.reference-item {
  display: grid;
  min-width: 0;
  padding: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.reference-item__cover {
  width: 64px;
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-soft);
}

.reference-item .field {
  margin-top: 10px;
}

.review-summary {
  margin-bottom: 26px;
}

.review-row {
  display: flex;
  padding-block: 14px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.review-row > span:first-child {
  color: var(--text-muted);
}

.review-row > :last-child {
  text-align: right;
}

/* PUBLICAÇÃO */

.publication-success {
  max-width: 620px;
  margin-bottom: 30px;
}

.publication-success__symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 1.5rem;
}

.publication-success p:last-child {
  margin-top: 16px;
  color: var(--text-muted);
}

#view-publicada {
  max-width: 780px;
}

#view-publicada > .field {
  margin-top: 24px;
  margin-bottom: 12px;
}

/* PORTFÓLIO */

.portfolio-card__cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface-soft);
}

.portfolio-card__body {
  padding: 18px;
}

.portfolio-card__body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 400;
}

.portfolio-card__body p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.portfolio-card__actions {
  display: flex;
  margin-top: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* GESTÃO */

.settings-menu {
  display: grid;
  gap: 12px;
}

.settings-menu a {
  position: relative;
  display: flex;
  min-height: 100px;
  padding: 22px 48px 22px 22px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    background var(--transition),
    border-color var(--transition);
}

.settings-menu a::after {
  position: absolute;
  top: 50%;
  right: 22px;
  color: var(--primary);
  content: "→";
  transform: translateY(-50%);
}

.settings-menu strong {
  font-size: 0.94rem;
  font-weight: 600;
}

.settings-menu span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

#conteudo-gestao {
  display: grid;
  gap: 24px;
}

.settings-section {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.settings-section h2 {
  margin-bottom: 22px;
}

/* FICHA DA PROPOSTA */

#view-ficha > .text-link {
  margin-bottom: 20px;
}

.detail-tabs {
  display: flex;
  margin-top: 28px;
  margin-bottom: 24px;
  padding: 4px 4px 0;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.detail-tabs [role="tab"] {
  min-height: 48px;
  padding: 10px 6px;
  flex-shrink: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.detail-tabs [aria-selected="true"] {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

[role="tabpanel"] {
  min-width: 0;
}

#form-nota {
  margin-top: 18px;
}

#form-nota .button {
  margin-top: 14px;
}

#lista-notas {
  display: grid;
  margin-top: 28px;
  gap: 14px;
}

.note-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.note-item__text {
  white-space: pre-wrap;
}

.note-item time {
  display: block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  position: relative;
  padding: 0 0 24px 26px;
  border-left: 1px solid var(--border);
}

.activity-item::before {
  position: absolute;
  top: 6px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  content: "";
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-item time {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* MODAL */

.modal {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-modal);
}

.modal::backdrop {
  background: rgb(39 29 24 / 46%);
}

.modal__header {
  display: flex;
  padding: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  font-size: 1.55rem;
}

.modal__body {
  padding: 24px 22px;
}

.modal__body > p + p {
  margin-top: 14px;
}

.modal__body .form-grid {
  gap: 18px;
}

.modal__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  padding: 18px 22px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* AVISOS */

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(
    var(--bottom-nav-height) + env(safe-area-inset-bottom) + 18px
  );
  left: 18px;
  z-index: 60;
  width: fit-content;
  max-width: calc(100% - 36px);
  margin-inline: auto;
  padding: 14px 20px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: white;
  box-shadow: var(--shadow-modal);
  font-size: 0.85rem;
  text-align: center;
}

.noscript-message {
  position: relative;
  z-index: 40;
  margin: 20px;
  padding: 16px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-small);
  background: var(--warning-soft);
  color: var(--warning);
}

/* INTERAÇÕES EM DISPOSITIVOS COM MOUSE */

@media (hover: hover) {
  .button--primary:hover:not(:disabled) {
    background: var(--primary-hover);
  }

  .button--secondary:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--surface-rose);
  }

  .button--danger:hover:not(:disabled) {
    background: #7c3030;
  }

  .text-link:hover {
    text-decoration: underline;
  }

  .nav-item:hover {
    background: var(--surface-soft);
    color: var(--primary);
  }

  .nav-item--create:hover {
    background: var(--primary-hover);
    color: white;
  }

  .settings-menu a:hover {
    border-color: var(--primary);
    background: var(--surface-rose);
  }

  .icon-button:hover {
    border-color: var(--primary);
    background: var(--surface-rose);
  }
}

/* CELULARES PEQUENOS */

@media (max-width: 359px) {
  .topbar {
    padding-inline: 14px;
  }

  .topbar__brand {
    font-size: 0.9rem;
  }

  .profile-link > span:last-child {
    display: none;
  }

  main {
    padding-inline: 14px;
  }

  .empty-state {
    padding-inline: 18px;
  }

  .nav-item {
    font-size: 0.63rem;
  }

  .wizard-actions .button {
    width: 100%;
  }

  #proxima-etapa,
  #publicar-proposta {
    margin-left: 0;
  }
}

/* TABLETS */

@media (min-width: 640px) {
  .topbar {
    padding-inline: 32px;
  }

  main {
    padding: 42px 32px 52px;
  }

  .page-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-heading > .button {
    flex-shrink: 0;
  }

  .proposal-grid,
  .product-grid,
  .addon-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .filters,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--full,
  .field--search {
    grid-column: 1 / -1;
  }

  .empty-state {
    padding: 44px 32px;
  }

  #form-proposta {
    padding: 32px;
  }

  .settings-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-footer {
    padding-inline: 32px;
    flex-direction: row;
    justify-content: space-between;
  }

  .checkbox-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-inline: 30px;
  }
}

/* DESKTOP */

@media (min-width: 1024px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .sidebar {
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    padding: 36px 20px 24px;
    flex-direction: column;
    border-top: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  .brand {
    display: flex;
    padding: 0 10px;
    align-items: center;
    gap: 12px;
  }

  .brand__symbol {
    color: var(--primary);
    font-size: 1.8rem;
  }

  .brand__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .brand__text strong {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 400;
    letter-spacing: -0.035em;
  }

  .brand__text > span {
    color: var(--text-muted);
    font-size: 0.7rem;
  }

  .main-nav {
    display: flex;
    width: 100%;
    max-width: none;
    min-height: auto;
    margin: 42px 0 0;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nav-item {
    min-height: 50px;
    padding: 12px 16px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    border-radius: var(--radius-small);
    font-size: 0.87rem;
  }

  .nav-item--create {
    margin: 8px 0;
  }

  .sidebar__signature {
    display: block;
    margin-top: auto;
    padding: 36px 12px 0;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-style: italic;
    line-height: 1.6;
  }

  .app-content {
    grid-column: 2;
    padding-bottom: 0;
  }

  .topbar {
    min-height: 88px;
    padding-inline: 44px;
  }

  .topbar__brand {
    display: none;
  }

  .topbar__context {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .topbar__context > span {
    color: var(--text-muted);
    font-size: 0.82rem;
  }

  .topbar__context time {
    color: var(--text-muted);
    font-size: 0.72rem;
  }

  main {
    padding: 48px 44px 64px;
  }

  .view > section + section {
    margin-top: 44px;
  }

  .page-heading {
    margin-bottom: 38px;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 24px;
  }

  .filters .field--search {
    grid-column: 1 / -1;
  }

  .app-footer {
    padding-inline: 44px;
    padding-bottom: 28px;
  }

  .toast {
    right: 28px;
    bottom: 28px;
    left: auto;
    max-width: 420px;
    margin: 0;
  }
}

/* TELAS AMPLAS */

@media (min-width: 1440px) {
  :root {
    --sidebar-width: 270px;
  }

  .sidebar {
    padding-inline: 24px;
  }

  .proposal-grid,
  .product-grid,
  .portfolio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filters .field--search {
    grid-column: span 2;
  }
}

/* ACESSIBILIDADE — MOVIMENTO REDUZIDO */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}