/* ============ M3 Arts — Orçamentos ============ */
:root {
  --preto: #101010;
  --preto-2: #1b1b1b;
  --dourado: #b8860b;
  --dourado-2: #d4a017;
  --dourado-claro: #e9d9ac;
  --branco: #ffffff;
  --off: #faf8f4;
  --cinza-1: #f0eee9;
  --cinza-2: #d9d6cf;
  --cinza-3: #8a877f;
  --cinza-4: #55524b;
  --verde: #2e7d32;
  --verm: #b3362a;
  --sombra: 0 6px 24px rgba(16, 16, 16, .08);
  --sombra-2: 0 10px 40px rgba(16, 16, 16, .14);
  --radius: 14px;
  --fonte: 'Jost', system-ui, sans-serif;
  --fonte-titulo: 'Playfair Display', serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--fonte);
  background: var(--off);
  color: var(--preto);
  display: flex;
  min-height: 100vh;
  font-size: 15.5px;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: 232px; min-width: 232px;
  background: var(--preto);
  color: var(--branco);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { width: 46px; height: 46px; object-fit: contain; }
.sidebar-brand strong { display: block; letter-spacing: 2px; font-size: 15px; }
.sidebar-brand span { font-size: 11px; color: var(--dourado-2); letter-spacing: 3px; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; flex: 1; }
.sidebar-nav a {
  color: #cfcdc7; text-decoration: none; padding: 10px 12px; border-radius: 9px;
  display: flex; align-items: center; gap: 10px; font-weight: 400; letter-spacing: .4px; font-size: 14.5px;
  transition: all .15s;
}
.sidebar-nav a .ico { color: var(--dourado-2); width: 18px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(212,160,23,.14); color: var(--dourado-claro); }
.sidebar-nav a.nav-cta { background: var(--dourado); color: #fff; margin: 6px 0 10px; font-weight: 500; }
.sidebar-nav a.nav-cta .ico { color: #fff; }
.sidebar-nav a.nav-cta:hover { background: var(--dourado-2); }
.sidebar-foot { padding: 16px; font-size: 12px; color: var(--cinza-3); border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot em { font-style: italic; color: var(--dourado-claro); opacity: .8; }

/* ---------- login ---------- */
body.auth-mode > .sidebar, body.auth-mode > .main { display: none; }
.auth-screen {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--preto);
  background-image: radial-gradient(circle at 15% 15%, rgba(184,134,11,.22), transparent 42%),
                    radial-gradient(circle at 85% 88%, rgba(184,134,11,.16), transparent 46%);
  overflow-y: auto;
}
.auth-card {
  background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.45);
  padding: 34px 32px 26px; width: 400px; max-width: 100%; text-align: center;
}
.auth-logo { width: 130px; height: auto; margin-bottom: 14px; }
.auth-card h2 { font-family: var(--fonte-titulo); font-size: 23px; margin-bottom: 4px; }
.auth-sub { font-size: 14px; color: var(--cinza-3); margin-bottom: 18px; line-height: 1.45; }
.auth-card .field { text-align: left; }
.auth-btn { width: 100%; justify-content: center; margin-top: 8px; padding: 12px; font-size: 15.5px; }
.auth-slogan { margin-top: 20px; font-size: 12px; font-style: italic; color: var(--dourado); }

.user-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.user-name { font-size: 13px; color: #e6e4df; font-weight: 500; }
.user-box .btn { padding: 4px 10px; font-size: 12px; color: #cfcdc7; border-color: rgba(255,255,255,.2); }
.user-box .btn:hover { border-color: var(--dourado-2); color: #fff; }

/* ---------- main ---------- */
.main { flex: 1; padding: 28px 34px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--fonte-titulo); font-size: 27px; font-weight: 700; }
.page-head .sub { color: var(--cinza-3); font-size: 14px; margin-top: 2px; }

/* ---------- components ---------- */
.card {
  background: var(--branco); border-radius: var(--radius); box-shadow: var(--sombra);
  padding: 20px 22px; margin-bottom: 18px;
}
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 14px; letter-spacing: .3px; }
.card h2 .tag { font-size: 11px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--preto); color: #fff; border: none; border-radius: 9px;
  padding: 10px 18px; font-family: var(--fonte); font-size: 14.5px; font-weight: 500; letter-spacing: .3px;
  transition: all .15s; text-decoration: none;
}
.btn:hover { background: #2c2c2c; }
.btn.gold { background: var(--dourado); }
.btn.gold:hover { background: var(--dourado-2); }
.btn.ghost { background: transparent; color: var(--preto); border: 1.5px solid var(--cinza-2); }
.btn.ghost:hover { border-color: var(--preto); }
.btn.danger { background: transparent; color: var(--verm); border: 1.5px solid #e5c5c1; }
.btn.danger:hover { border-color: var(--verm); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--cinza-4); margin-bottom: 5px; }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--cinza-2); border-radius: 9px;
  font-family: var(--fonte); font-size: 15px; background: #fff; color: var(--preto);
  transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--dourado); }
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: 12px; color: var(--cinza-3); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; background: var(--cinza-1); color: var(--cinza-4);
}
.tag.gold { background: rgba(184,134,11,.12); color: var(--dourado); }
.tag.green { background: rgba(46,125,50,.1); color: var(--verde); }
.tag.red { background: rgba(179,54,42,.1); color: var(--verm); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--cinza-3); padding: 8px 10px; border-bottom: 1.5px solid var(--cinza-1); }
table.list td { padding: 10px; border-bottom: 1px solid var(--cinza-1); vertical-align: middle; }
table.list tr:hover td { background: var(--off); }

/* product/kit cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pcard {
  background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .2s;
}
.pcard:hover { box-shadow: var(--sombra-2); }
.pcard .ph { background: linear-gradient(160deg, #fbfaf7, #f0eee9); height: 160px; display: flex; align-items: center; justify-content: center; position: relative; }
.pcard .ph img { max-width: 82%; max-height: 88%; object-fit: contain; }
.pcard .ph .cfg-ok { position: absolute; top: 8px; right: 8px; }
.pcard .body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pcard .code { font-size: 12px; color: var(--dourado); font-weight: 600; letter-spacing: 1px; }
.pcard .name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.pcard .meta { font-size: 12.5px; color: var(--cinza-3); }
.pcard .price { font-size: 17px; font-weight: 700; margin-top: 4px; }
.pcard .price small { font-weight: 400; color: var(--cinza-3); font-size: 12px; }
.pcard .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pcard.archived { opacity: .55; }

.kit-mini-photos { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; padding: 10px; }
.kit-mini-photos img { object-fit: contain; }

/* modal */
#modal-root:empty { display: none; }
.modal-back {
  position: fixed; inset: 0; background: rgba(12,12,12,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--sombra-2); width: 640px; max-width: 96vw;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal.wide { width: 980px; }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-head .x { cursor: pointer; border: none; background: none; font-size: 22px; color: var(--cinza-3); }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--cinza-1); }

/* toast */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--preto); color: #fff; border-left: 4px solid var(--dourado); padding: 12px 18px;
  border-radius: 10px; box-shadow: var(--sombra-2); font-size: 14px; max-width: 380px;
  animation: slidein .25s ease;
}
.toast.err { border-left-color: var(--verm); }
.toast.ok { border-left-color: var(--verde); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 30px; font-size: 13.5px;
  color: var(--cinza-3); background: var(--cinza-1); cursor: default; letter-spacing: .3px;
}
.step .n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--cinza-2); color: var(--cinza-4);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.step.done { color: var(--verde); background: rgba(46,125,50,.08); cursor: pointer; }
.step.done .n { background: var(--verde); color: #fff; }
.step.current { background: var(--preto); color: #fff; }
.step.current .n { background: var(--dourado); color: #fff; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }

/* logo upload */
.dropzone {
  border: 2px dashed var(--cinza-2); border-radius: var(--radius); padding: 34px; text-align: center;
  color: var(--cinza-3); cursor: pointer; transition: all .15s; background: #fff;
}
.dropzone:hover, .dropzone.drag { border-color: var(--dourado); color: var(--dourado); background: #fffdf6; }
.dropzone strong { color: var(--preto); display: block; margin-bottom: 4px; font-size: 16px; }

.logo-preview-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.logo-variant {
  border: 2.5px solid var(--cinza-2); border-radius: 12px; padding: 10px; cursor: pointer; text-align: center;
  width: 150px; transition: all .15s; background: #fff;
}
.logo-variant.checker { }
.logo-variant img, .logo-variant canvas { width: 100%; height: 90px; object-fit: contain;
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; border-radius: 6px; }
.logo-variant.on-dark img, .logo-variant.on-dark canvas { background: #222; }
.logo-variant .lbl { font-size: 12.5px; margin-top: 6px; color: var(--cinza-4); font-weight: 500; }
.logo-variant.sel { border-color: var(--dourado); box-shadow: 0 0 0 3px rgba(184,134,11,.15); }

/* option slots */
/* sem numero fixo de opcoes: as colunas se acomodam a quantas houver */
.option-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; align-items: start; }
.oslot { background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); padding: 16px; position: relative; }
.oslot .opt-tag { position: absolute; top: -10px; left: 14px; }
.oslot h4 { margin: 6px 0 10px; font-size: 15.5px; }
.oslot .kit-photos { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 110px; margin-bottom: 10px; }
.oslot .kit-photos img { object-fit: contain; }
.oslot .prices { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

/* apply grid */
.apply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.apply-item { background: #fff; border-radius: 12px; box-shadow: var(--sombra); overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.apply-item:hover { box-shadow: var(--sombra-2); }
.apply-item canvas, .apply-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: linear-gradient(160deg,#fbfaf7,#f0eee9); display: block; }
.apply-item .cap { padding: 8px 10px; font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; color: var(--cinza-4); }

/* logo editor */
.editor-wrap { display: flex; gap: 18px; }
.editor-canvas-box { flex: 1; min-width: 0; }
.editor-canvas-box canvas { width: 100%; border-radius: 10px; background: #f4f2ee; cursor: move; display: block; }
.editor-controls { width: 250px; min-width: 250px; }
.editor-controls .field { margin-bottom: 10px; }
.editor-controls input[type=range] { width: 100%; accent-color: var(--dourado); }
.editor-controls .rangeval { font-size: 12px; color: var(--cinza-3); float: right; }

/* freight */
.freight-box { border: 1.5px solid var(--cinza-1); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.freight-box h4 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.vol-row { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr) 34px; gap: 8px; align-items: center; margin-bottom: 6px; }
.vol-row input, .vol-row select { padding: 7px 8px; border: 1.5px solid var(--cinza-2); border-radius: 7px; font-family: var(--fonte); font-size: 13.5px; width: 100%; }
.vol-head { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr) 34px; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--cinza-3); margin-bottom: 4px; }
.quote-result { border-radius: 10px; padding: 10px 14px; background: var(--off); border: 1.5px solid var(--cinza-1); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; }
.quote-result.sel { border-color: var(--dourado); background: #fffdf4; }

/* review / A4 preview */
.a4-preview {
  background: #fff; border-radius: 6px; box-shadow: var(--sombra-2); margin: 0 auto 26px;
  width: 100%; max-width: 900px; aspect-ratio: 297/210; position: relative; overflow: hidden;
}
.a4-zoom { transform-origin: top left; position: absolute; top: 0; left: 0; width: 1122px; height: 794px; }

/* dashboard */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--preto); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.tile .v { font-size: 30px; font-weight: 700; font-family: var(--fonte-titulo); color: var(--dourado-2); }
.tile .l { font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; color: #b9b6af; margin-top: 2px; }
.tile.light { background: #fff; color: var(--preto); box-shadow: var(--sombra); }
.tile.light .v { color: var(--preto); }
.tile.light .l { color: var(--cinza-3); }

.empty { text-align: center; padding: 44px 20px; color: var(--cinza-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; opacity: .4; }

.warn-banner { background: #fdf6e3; border: 1.5px solid #ecd9a0; color: #7a5c00; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.err-banner { background: #fdeceb; border: 1.5px solid #eec7c3; color: var(--verm); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.ok-banner { background: #eef7ee; border: 1.5px solid #c4dfc5; color: var(--verde); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 14px 50px; }
  .grid2, .grid3, .grid4, .option-slots { grid-template-columns: 1fr; }
  .editor-wrap { flex-direction: column; }
  .editor-controls { width: 100%; min-width: 0; }
}
