:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --ink: #1f1f24;
  --muted: #666a73;
  --line: #d9dde3;
  --green: #258f67;
  --teal: #087f8c;
  --red: #d93636;
  --shadow: 0 16px 40px rgba(31, 31, 36, 0.1);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; }
input, select, textarea, button { font: inherit; }

.page { width: min(1180px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 62px; height: 62px; border-radius: 8px; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.platform-brand img { width: 190px; height: 58px; border: 0; object-fit: contain; }
.brand h1 { margin: 0; font-size: 26px; }
.muted { color: var(--muted); margin: 0; }
.eyebrow { margin: 0; color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--green); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.secondary { background: var(--teal); }
.button.danger { background: var(--red); }
.grid { display: grid; gap: 18px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(31,31,36,.06); padding: 16px; }
.card h2, .card h3 { margin-top: 0; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 5px; font-weight: 700; }
.form input, .form select, .form textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.checkbox-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.checkbox-list legend { font-weight: 800; padding: 0 6px; }
.checkbox-list label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.checkbox-list input { width: auto; min-height: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 8px; background: #e7f5f6; color: var(--teal); font-weight: 800; }
.pill.off { background: #f7e7e7; color: var(--red); }
.status-novo { background: #fff8d7; color: #8a6500; }
.status-producao { background: #e7f5f6; color: var(--teal); }
.status-entrega { background: #e9f0ff; color: #294f9b; }
.status-finalizado { background: #e8f5ec; color: var(--green); }
.status-cancelado { background: #f7e7e7; color: var(--red); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); }
.flash { padding: 12px; border-radius: 8px; background: #fff8d7; border: 1px solid #f2d46b; margin-bottom: 12px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: center; gap: 20px; padding: 28px; }
.hero h2 { font-size: clamp(30px, 5vw, 52px); line-height: 1.02; margin: 8px 0 12px; }
.hero-panel { min-height: 180px; display: grid; align-content: center; gap: 8px; padding: 18px; border-radius: 8px; background: #e7f5f6; border: 1px solid #bfe3e7; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 4px 0; }
.model-card img { width: 100%; height: 140px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.model-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; }
.tab { background: #fff; color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.tab.active { background: var(--ink); color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product { display: grid; grid-template-columns: 120px minmax(0, 1fr); overflow: hidden; padding: 0; }
.product img { width: 120px; height: 100%; min-height: 150px; object-fit: cover; }
.product-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.product-body h3 { margin: 0; }
.product-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.cart { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
.cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.qty { display: flex; align-items: center; gap: 7px; }
.qty button { min-height: 30px; width: 30px; padding: 0; background: #eceff3; color: var(--ink); }
.total-line { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; }
.modal { position: fixed; inset: 0; display: none; place-items: center; padding: 16px; background: rgba(31,31,36,.62); z-index: 20; }
.modal.open { display: grid; }
.modal-box { width: min(760px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 8px; padding: 16px; }
.addons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.addon { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8fa; }
.mobile-cart { display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 12; justify-content: space-between; }
.copy-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8fa; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-row input { min-width: 0; }
.report-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.metric { display: grid; gap: 8px; }
.metric span { color: var(--muted); font-weight: 800; }
.metric strong { font-size: 28px; }
.order-filter select { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.order-card { scroll-margin-top: 120px; }
.receipt { white-space: pre-wrap; overflow: auto; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: #fbfcfd; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.timeline { display: grid; gap: 10px; margin: 20px 0; }
.timeline-step { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.timeline-step span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.timeline-step.done { color: var(--green); }
.timeline-step.done span { background: var(--green); border-color: var(--green); }
.status-art { display: grid; justify-items: center; gap: 8px; margin: 18px 0; text-align: center; }
.status-art svg { width: min(220px, 100%); height: auto; }
.status-art svg * { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.status-art p { margin: 0; color: var(--muted); font-weight: 700; }
.status-art-novo svg * { stroke: var(--teal); }
.status-art-producao svg * { stroke: #8a6500; }
.status-art-entrega svg * { stroke: #294f9b; }
.status-art-finalizado svg * { stroke: var(--green); }
.status-art-cancelado svg * { stroke: var(--red); }

@media print {
  body { background: #fff; }
  .no-print, .topbar, .mobile-cart { display: none !important; }
  .page { width: 100%; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .receipt { border: 0; font-size: 12px; }
}

@media (max-width: 900px) {
  .two, .three, .menu-layout, .product-grid, .hero { grid-template-columns: 1fr; }
  .report-filter { grid-template-columns: 1fr; }
  .cart { position: static; max-height: none; }
}

@media (max-width: 620px) {
  body { padding-bottom: 76px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .product { grid-template-columns: 105px minmax(0, 1fr); }
  .product img { width: 105px; min-height: 160px; }
  .addons { grid-template-columns: 1fr; }
  .copy-row { grid-template-columns: 1fr; }
  .mobile-cart.show { display: flex; }
}
