@font-face { font-family: "Dancing Script"; src: url("../fonts/dancing-script-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-latin-wght-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --bg: #f3f1ed; --surface: #fff; --ink: #22252a; --muted: #6b7078; --line: #e2dfd8;
  --dark: #22252a; --red: #b3261e; --green: #2e7d32; --amber: #b26a00; --blue: #1f5f99;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: 64px; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }
.cursive { font-family: "Dancing Script", cursive; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---------- topo / menu ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: 64px; background: var(--dark); z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.topbar-in { max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; background: #fff; border-radius: 8px; padding: 5px 10px; }
.brand img { height: 34px; width: auto; display: block; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #c9ccd1; text-decoration: none; padding: 9px 14px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: var(--red); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 20px; border-radius: 8px; width: 42px; height: 40px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--dark); flex-direction: column; padding: 8px 12px 14px; margin: 0; box-shadow: 0 8px 14px rgba(0,0,0,.25); }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; }
}

/* ---------- estrutura ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { font-size: 1.15rem; }
.card-head h3 { font-size: 1rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; }

/* ---------- formulários ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid .full { grid-column: 1 / -1; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid, .grid-3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: .88rem; color: #3c4047; }
.field .hint { font-size: .8rem; color: var(--muted); font-style: italic; margin-top: -2px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfccc4; border-radius: 8px; font: inherit; font-size: 16px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(179,38,30,.35); outline-offset: 1px; border-color: var(--red); }
input.invalid { border-color: var(--red); background: #fff6f5; }
input[readonly], textarea[readonly] { background: #f3f1ed; }
input[type=range] { width: 100%; accent-color: var(--red); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: #e9e6df; color: var(--ink); transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--dark); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: #c62828; color: #fff; }
.btn-warn { background: #fff; color: var(--amber); border-color: #e0b36a; }
.btn-wa { background: #1fa855; color: #fff; }
.btn-ghost { background: #fff; border-color: #cfccc4; }
.btn-outline-danger { background: #fff; color: #c62828; border-color: #e3a5a5; }

/* ---------- abas ---------- */
.tabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; box-shadow: var(--shadow); }
.tabs button { flex: 1; padding: 11px 12px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; border-radius: 7px; cursor: pointer; }
.tabs button:hover { background: #f3f1ed; color: var(--ink); }
.tabs button.active { background: var(--dark); color: #fff; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg button { flex: 1 1 200px; padding: 12px; border: 2px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { border-color: var(--dark); background: var(--dark); color: #fff; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
table.t th { text-align: left; background: #f6f4f0; padding: 10px 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #50545b; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t th[data-sort] { cursor: pointer; user-select: none; }
table.t td { padding: 9px 12px; border-top: 1px solid #eeebe5; vertical-align: top; }
table.t tbody tr:hover { background: #faf9f6; }
table.t .num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: #e7eef6; color: var(--blue); white-space: nowrap; }
.badge-green { background: #e3f1e4; color: var(--green); }
.badge-amber { background: #fbeed6; color: var(--amber); }
.badge-purple { background: #f0e6f5; color: #6a2c8a; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }

/* ---------- avisos ---------- */
.toasts { position: fixed; top: 76px; right: 14px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 28px)); }
.toast { background: #fff; border-left: 5px solid var(--green); border-radius: 8px; padding: 12px 14px; box-shadow: 0 6px 22px rgba(0,0,0,.18); font-weight: 500; font-size: .92rem; cursor: pointer; animation: tin .2s ease; }
.toast-error { border-color: #c62828; }
.toast-warn { border-color: #e09a1a; }
.toast-loading { border-color: var(--blue); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .25s; }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }

/* ---------- janelas ---------- */
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.35); animation: min .2s ease; }
.modal-wide { max-width: 860px; }
@keyframes min { from { opacity: 0; transform: translateY(14px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1.15rem; }
.modal-x { border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; }
.modal-x:hover { background: #f1efe9; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- início ---------- */
.home-hero { text-align: center; padding: 26px 0 30px; }
.home-hero h1 { font-size: 2.1rem; }
.home-hero p { color: var(--muted); font-size: 1.05rem; margin-top: 8px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.menu-card { position: relative; display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; text-decoration: none; color: inherit; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.menu-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.menu-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.13); }
.menu-card .ico { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.menu-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.menu-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.menu-card .arrow { margin-left: auto; color: #b6b2a8; font-size: 1.3rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 40px; }

/* ---------- orçamento ---------- */
.flag { background: #e7f0fb; color: var(--blue); border: 1px solid #c3d8ef; padding: 6px 12px; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.catalog { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.cat-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid #eeebe5; }
.cat-item:first-child { border-top: 0; }
.cat-item .info { flex: 1; min-width: 0; }
.cat-item h4 { font-size: .95rem; }
.cat-item p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.cat-item .price { font-weight: 700; color: var(--green); white-space: nowrap; }
.cat-item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .cat-item { flex-wrap: wrap; } .cat-item .acts { width: 100%; } .cat-item .acts .btn { flex: 1; } }
.orc-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fcfbf9; flex-wrap: wrap; }
.orc-item .info { flex: 1 1 220px; min-width: 0; }
.orc-item h4 { font-size: .98rem; }
.orc-item p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.orc-item .qty { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.orc-item .qty input { width: 70px; padding: 6px 8px; text-align: center; }
.orc-item .sub { font-weight: 700; min-width: 110px; text-align: right; }
.total-bar { display: flex; justify-content: space-between; align-items: center; background: var(--dark); color: #fff; padding: 14px 18px; border-radius: 8px; margin-top: 12px; font-size: 1.2rem; font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 200px; }
.mini-list { max-height: 90px; overflow: auto; font-size: .8rem; min-width: 190px; }

/* ---------- imagem ---------- */
.img-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 18px; align-items: start; }
@media (max-width: 980px) { .img-layout { grid-template-columns: 1fr; } }
.preview-box { position: sticky; top: 80px; }
@media (max-width: 980px) { .preview-box { position: static; } }
#cartao { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.2); background: #eee; }
.crop { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
#crop { width: 180px; height: 180px; border-radius: 50%; cursor: grab; touch-action: none; border: 2px solid var(--dark); background: #ddd; flex: none; }
#crop:active { cursor: grabbing; }

.temas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.tema { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 5px 5px 6px; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 600; color: var(--muted); line-height: 1.2; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.tema canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
.tema:hover { border-color: #b9b5aa; }
.tema.active { border-color: var(--red); color: var(--ink); box-shadow: 0 0 0 3px rgba(179,38,30,.15); }

/* ---------- estoque ---------- */
.quick-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .quick-layout { grid-template-columns: 1fr; } }
.pre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pre-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.pre-card.sel { border-color: var(--green); box-shadow: 0 0 0 2px rgba(46,125,50,.2); }
.pre-card h4 { font-size: .98rem; }
.pre-card small { color: var(--muted); }
.pre-card .row { margin-top: auto; padding-top: 6px; }
.sel-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sel-item:last-of-type { border-bottom: 0; }
.sel-item .qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.sel-item .qty input { width: 80px; padding: 6px 8px; }
.stats { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: .9rem; }
.low { color: #c62828; font-weight: 700; }

/* ---------- biografia ---------- */
.narrow { max-width: 820px; margin: 0 auto; }
.result h3 { font-size: 1rem; margin: 16px 0 6px; }
.loading-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 180; display: grid; place-items: center; }
.loading-ov div { background: #fff; padding: 22px 30px; border-radius: 12px; font-weight: 600; }
