@font-face {
  font-family: "Cormorant Garamond";
  src: url("fontes/cormorant.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: Jost;
  src: url("fontes/jost.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #242321;
  --muted: #695d51;
  --paper: #f5efe5;
  --surface: #fffcf8;
  --accent: #8c4331;
  --border: #dfd3c5;
  --positive: #315441;
  --negative: #962c22;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Futura PT", Jost, system-ui, sans-serif;
}
h1, h2 { margin: 0; font: 500 1.7rem/1.13 "Cormorant Garamond", Georgia, serif; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); }
h3 { margin: 0 0 8px; font-size: .94rem; }
p { margin: 0; }
header { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--accent); }
.header-inner {
  max-width: 1192px;
  margin: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 30px);
}
.brand-logo { display: block; width: clamp(122px, 17vw, 174px); height: auto; }
.brand h1 { border-left: 1px solid #837265; padding-left: clamp(16px, 3vw, 30px); }
main {
  max-width: 1192px;
  margin: auto;
  padding: 24px;
}
#quote {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.quote-fields, .sidebar { display: grid; gap: 16px; min-width: 0; }
section, aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
section > h2, aside > h2 { margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.wide { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: 5px; font-size: .86rem; font-weight: 650; }
input, select, button, textarea {
  min-width: 0;
  border: 1px solid #b8a99b;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: inherit;
  font: inherit;
}
input, select { min-height: 42px; font-size: .95rem; }
button { cursor: pointer; font-size: .85rem; font-weight: 700; min-height: 38px; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .58; cursor: default; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.header-button { background: transparent; color: inherit; border-color: #bba99a; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
header :focus-visible { outline-color: #f8d8c5; }
small, .muted { color: var(--muted); font-size: .83rem; font-weight: 400; }
details > summary { cursor: pointer; }
.form-hint { margin-top: 12px; }
.profile { padding: 0; }
.profile > summary { padding: 17px 22px; font-weight: 650; }
.profile > summary small { display: block; margin: 3px 0 0 16px; }
.profile[open] > summary { border-bottom: 1px solid var(--border); }
.profile-body { padding: 18px 22px; }
.guide {
  margin-top: 18px;
  border-radius: 9px;
  background: var(--paper);
  padding: 12px;
  font-size: .86rem;
}
.guide p { margin-top: 10px; }
.profile-body > .actions { margin-top: 14px; }
.sidebar { position: sticky; top: 16px; }
.hero { background: #eddbcf; padding: 14px 16px; border-radius: 10px; }
.hero > span, .metric > span { display: block; font-size: .82rem; font-weight: 650; }
.hero strong { display: block; font-size: clamp(1.85rem, 4vw, 2.6rem); line-height: 1.2; color: #713523; }
.hero strong, .metric strong { font-variant-numeric: tabular-nums; }
.hero small { display: block; margin-top: 3px; }
.hero small:empty { display: none; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.metric { border: 1px solid var(--border); padding: 10px 12px; border-radius: 9px; min-width: 0; }
.metric strong { display: block; font-size: 1.2rem; color: var(--positive); overflow-wrap: anywhere; }
.negative .metric strong { color: var(--negative); }
.cost-details { border-top: 1px solid var(--border); margin: 12px 0; padding-top: 11px; }
.cost-details summary { font-weight: 700; font-size: .9rem; }
.cost-details > p { margin-top: 8px; }
.order-summary { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #f7f0e7; overflow-x: auto; }
.order-summary table { width: 100%; margin: 6px 0; border-collapse: collapse; font-size: .81rem; font-variant-numeric: tabular-nums; }
.order-summary th, .order-summary td { padding: 5px 3px; text-align: right; }
.order-summary th:first-child { text-align: left; }
.order-summary td { white-space: nowrap; }
.order-summary tr { border-bottom: 1px solid var(--border); }
.order-summary tr.order-total { border-bottom: 0; font-weight: 750; }
.order-summary .order-profit { color: var(--positive); font-weight: 750; }
.order-summary .order-profit.negative { color: var(--negative); }
.distribution { display: flex; overflow: hidden; height: 9px; margin-top: 9px; border-radius: 6px; background: var(--border); }
.distribution > span { min-width: 0; display: block; background: var(--bar-color); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 7px 0 0; }
.legend li { color: var(--muted); font-size: .78rem; }
.legend li::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--bar-color);
  content: "";
}
dl { margin: 8px 0 12px; }
dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
dt, dd { font-size: .87rem; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
#costs div:last-child { font-weight: 750; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { margin-top: 8px; }
.status:empty { display: none; }
.profile-sync { margin-top: 12px; }
#hint { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
#history { padding: 0 4px; margin: 10px 0; list-style: none; max-height: 260px; overflow: auto; }
#history li { padding: 6px 0; font-size: .86rem; }
.saved { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.saved span { overflow-wrap: anywhere; }
.history-search { position: relative; margin-top: 12px; }
.history-search svg { position: absolute; top: 12px; left: 11px; color: var(--muted); pointer-events: none; }
.history-search input { width: 100%; padding-left: 36px; }
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }
.history-actions button { width: 36px; height: 36px; min-height: 0; padding: 0; font-size: 1.19rem; line-height: 1; }
.history-open { color: var(--positive); }
.history-delete { color: var(--negative); }
.history-delete:hover { background: #fae4de; }
textarea { width: 100%; margin-top: 8px; }
.customer-message { margin-top: 16px; }
.customer-message textarea { margin-top: 0; resize: vertical; font-size: .88rem; line-height: 1.45; }
.customer-message button { margin-top: 8px; }
[hidden] { display: none !important; }
@media (max-width: 860px) {
  #quote { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 480px) {
  main, .header-inner { padding: 15px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 7px; }
  .brand h1 { border-left: 0; padding-left: 0; font-size: 1.85rem; }
  header button { max-width: 110px; }
  section, aside, .profile-body, .profile > summary { padding: 15px; }
  .fields { gap: 11px; }
}
.sales-panel { border-top: 3px solid #bb7964; }
.choice-grid { display: grid; gap: 8px; }
.choice-grid.channels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid.plans { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid button {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 48px;
  background: #fbf6ef;
  border-color: var(--border);
  padding: 8px;
  overflow-wrap: anywhere;
}
.channels button:not(.other-channel) { min-height: 100px; }
.channels .channel-logo { justify-self: center; width: 38px; height: 32px; object-fit: contain; margin-bottom: 3px; }
.choice-grid button[aria-pressed="true"] {
  color: #753523;
  border-color: var(--accent);
  background: #f0ded1;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-grid button.other-channel {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 32px;
  padding-inline: 11px;
}
.choice-grid button > small { font-size: .73rem; line-height: 1.25; }
.margin-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: center;
  margin-top: 15px;
}
.margin-control input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.margin-number { display: flex; align-items: center; color: var(--accent); gap: 3px; }
.margin-number input { width: 75px; min-height: 32px; text-align: right; color: inherit; }
.margin-control > small { grid-column: 1 / -1; }
.price-control { margin-top: 12px; }
.promotion-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 14px;
  cursor: pointer;
}
.promotion-switch small { display: block; }
.promotion-switch input {
  appearance: none;
  position: relative;
  width: 46px;
  min-height: 26px;
  border-radius: 20px;
  padding: 0;
  margin: 0;
  background: #ded1c3;
  cursor: pointer;
}
.promotion-switch input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
}
.promotion-switch input:checked { background: var(--accent); border-color: var(--accent); }
.promotion-switch input:checked::before { left: 23px; }
.sale-charges { margin-top: 14px; }
@media (max-width: 525px) {
  .choice-grid.channels, .choice-grid.plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.view-nav {
  display: flex;
  max-width: 1192px;
  padding: 16px 24px 0;
  margin-inline: auto;
  gap: 8px;
  flex-wrap: wrap;
}
.view-nav button[aria-pressed="true"] { background: var(--accent); color: white; border-color: var(--accent); }
.slicer-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px dashed #b8a99b;
  border-radius: 8px;
}
.slicer-drop small { display: block; margin-top: 2px; }
.slicer-drop.is-dragging {
  background: #f3e2d6;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.slicer-options { display: flex; align-items: end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.slicer-options label { flex: 1 1 200px; }
.history-panel .history-search { max-width: 430px; }
.history-table-wrap { overflow-x: auto; margin: 15px 0; border: 1px solid var(--border); border-radius: 10px; }
.history-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.history-table th, .history-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
.history-table thead { background: var(--paper); }
.history-table tbody > tr:last-child > * { border-bottom: 0; }
.history-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-table tbody tr:hover { background: #fbf5ee; }
.history-piece { display: flex; align-items: center; min-width: 155px; gap: 8px; overflow-wrap: anywhere; }
.photo-trigger { display: block; padding: 0; border: 0; border-radius: 6px; background: var(--paper); overflow: hidden; cursor: zoom-in; }
.photo-trigger img { display: block; width: 100%; height: 100%; object-fit: cover; }
.history-thumbnail { flex: 0 0 auto; width: 42px; height: 42px; }
.history-actions button:not(.history-open):not(.history-delete) { width: auto; padding: 0 8px; font-size: .76rem; }
.production-view { max-width: 1480px; }
.production-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.production-header h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); }
.production-help { margin-bottom: 10px; }
.production-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(258px, 24vw, 300px);
  gap: 14px;
  overflow-x: auto;
  padding: 3px 3px 14px;
  scroll-snap-type: x proximity;
}
.production-board.production-board-dragging { scroll-snap-type: none; user-select: none; }
.production-add-column {
  align-self: start;
  min-height: 49px;
  border: 1px dashed #bba696;
  background: transparent;
  color: var(--accent);
  scroll-snap-align: start;
}
.production-add-column:hover:not(:disabled) { background: #fcf7f0; }
.production-column {
  position: relative;
  min-width: 0;
  min-height: 200px;
  padding: 12px;
  background: #f8f1e8;
  scroll-snap-align: start;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.production-column.production-drop-target {
  background: #f5e6db;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px #8c433129;
}
.production-column-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.production-column-head h3 { margin: 0; color: var(--accent); overflow-wrap: anywhere; }
.production-column-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.production-column-toggle, .production-column-delete {
  background: transparent;
  border-color: transparent;
  min-height: 34px;
  min-width: 27px;
  padding: 0 4px;
}
.production-column-toggle { color: var(--accent); }
.production-column-delete { color: var(--negative); font-size: 1.04rem; }
.production-column-closed { min-height: 0; align-self: start; }
.production-column-handle { font-size: .9rem; }
.production-column.production-drop-before { box-shadow: inset 4px 0 var(--accent); }
.production-column.production-drop-after { box-shadow: inset -4px 0 var(--accent); }
.production-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
  cursor: grab;
  touch-action: pan-y;
  transition: opacity .16s ease, border-color .18s ease, box-shadow .18s ease;
}
.production-column .production-card:hover { border-color: #bc9888; box-shadow: 0 6px 18px #49302614; }
.production-column .production-card-dragging { opacity: .28; box-shadow: none; }
.production-drop-slot {
  display: grid;
  place-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #af6d58;
  border-radius: 8px;
  background: #fffcf780;
  color: #753523;
  font-size: .78rem;
  font-weight: 700;
  animation: production-slot-in .18s ease-out;
  pointer-events: none;
}
.production-card-arrived { animation: production-settle .28s cubic-bezier(.2,.75,.24,1); }
@keyframes production-slot-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes production-settle {
  from { transform: translateY(-5px) scale(.99); border-color: var(--accent); box-shadow: 0 7px 18px #8c433133; }
  to { transform: translateY(0) scale(1); border-color: var(--border); box-shadow: none; }
}
.production-card:active { cursor: grabbing; }
.production-handle {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  padding: 2px;
  line-height: 1;
  color: var(--accent);
  background: transparent;
  border-color: transparent;
  cursor: grab;
  touch-action: none;
}
.production-handle:hover:not(:disabled) { border-color: transparent; }
.production-handle:active { cursor: grabbing; }
.production-drag-preview {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 20;
  margin: 0;
  border-color: #a86551;
  box-shadow: 0 18px 35px #37231d3b, 0 4px 12px #37231d21;
  transform-origin: 60% 24%;
  will-change: transform;
  pointer-events: none;
}
.production-column-preview {
  border: 1px solid #a86551;
  border-radius: 9px;
  background: var(--surface);
  padding: 8px 10px;
}
@media (prefers-reduced-motion: reduce) {
  .production-column, .production-card { transition: none; }
  .production-card-arrived, .production-drop-slot { animation: none; }
}
.production-card h4 { margin: 0; line-height: 1.27; overflow-wrap: anywhere; }
.production-card > p { overflow-wrap: anywhere; }
.production-customer { font-size: .84rem; font-weight: 700; }
.production-card-compact { margin-top: 6px; padding: 0; }
.production-card-compact.production-drag-preview { margin-top: 0; }
.production-compact-button {
  width: 100%;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "customer price" "piece price";
  align-items: center;
  gap: 2px 8px;
  text-align: left;
  line-height: 1.25;
  color: var(--ink);
  touch-action: pan-y;
}
.production-compact-customer { grid-area: customer; overflow-wrap: anywhere; }
.production-compact-piece { grid-area: piece; color: var(--muted); font-size: .78rem; font-weight: 500; overflow-wrap: anywhere; }
.production-compact-price { grid-area: price; color: var(--positive); white-space: nowrap; font-size: .79rem; font-variant-numeric: tabular-nums; }
.production-image { width: 100%; height: 85px; margin-bottom: 5px; }
.production-due, .production-deadline, .production-specs, .production-amount, .production-notes { margin-top: 6px; }
.production-due, .production-deadline { font-size: .8rem; font-weight: 700; }
.production-deadline { padding: 3px 6px; border-radius: 5px; background: var(--paper); color: var(--muted); }
.production-deadline-soon { background: #fbe7a5; color: #604400; }
.production-deadline-overdue { background: #fae0da; color: #852719; }
.production-specs { border-top: 1px solid var(--border); padding-top: 6px; }
.production-amount { color: var(--positive); font-weight: 750; font-variant-numeric: tabular-nums; }
.production-notes { white-space: pre-wrap; padding: 5px 6px; border-radius: 5px; background: var(--paper); font-size: .82rem; }
.production-actions { margin-top: 7px; }
.production-actions button { min-height: 32px; padding: 4px 8px; font-size: .77rem; }
.order-dialog { width: min(94vw, 570px); max-height: 90dvh; padding: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.order-dialog::backdrop { background: rgb(36 35 33 / 58%); }
.photo-dialog {
  width: min(94vw, 960px);
  max-height: 94dvh;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.photo-dialog::backdrop { background: rgb(36 35 33 / 78%); }
.photo-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.photo-dialog-head h2 { overflow-wrap: anywhere; }
.photo-dialog-head button { min-width: 38px; font-size: 1.4rem; padding: 0 8px; }
.photo-dialog > img { display: block; max-width: 100%; max-height: 76dvh; height: auto; width: auto; margin-inline: auto; object-fit: contain; }
.order-dialog h2 { margin-bottom: 12px; }
.order-dialog .actions { margin-top: 12px; }
.delete-order { color: var(--negative); border-color: #dfbbb1; margin-inline-start: auto; }
.delete-order:hover:not(:disabled) { background: #fae4de; border-color: var(--negative); }
@media (max-width: 480px) {
  .view-nav { padding-inline: 15px; }
  .production-board { grid-auto-columns: clamp(238px, 85vw, 338px); gap: 11px; }
  .order-dialog .fields { grid-template-columns: 1fr; }
}

.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.header-actions form { margin: 0; }
.session-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 16px;
  background: #f9e8c8;
  color: #543715;
  border-bottom: 1px solid #dbbb85;
}
.session-notice a { color: inherit; font-weight: 700; }
.login-page { min-height: 100dvh; display: grid; place-items: center; }
.login-main { width: min(100%, 440px); }
.login-panel { padding: 0; overflow: hidden; }
.login-logo { display: block; width: 100%; height: 112px; padding: 24px; object-fit: contain; background: var(--ink); }
.login-body { padding: 22px; }
.login-body h1 { margin-bottom: 14px; font-size: 2.3rem; }
.login-body form { display: grid; gap: 12px; }
.login-body input { font-size: 16px; }
.login-body button { min-height: 44px; }
.login-message { margin-bottom: 12px; padding: 8px 10px; background: #fae0da; border-radius: 6px; color: #852719; }
