:root {
  --brand: #0D72B9;
  --brand-d: #0a5d97;
  --brand-l: #e7f1f9;
  --nav: #0D72B9;
  --secondary: #4D4D4D;
  --teal: #017e84;
  --bg: #f3f4f6;
  --card: #fff;
  --border: #dee2e6;
  --text: #24292f;
  --muted: #6c757d;
  --danger: #d23f3a;
  --ok: #1e8e3e;
  --warn: #c98a1b;
  --info: #2b7bb9;
  --radius: 6px;
  --ui-font: 'Quicksand';
  font-family: var(--ui-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
body.portal-mode { background: #fff; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: #f1f3f5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- Navbar ---------- */
#nav { height: 46px; background: var(--nav); color: #fff; display: flex; align-items: center; gap: 2px; padding: 0 8px; position: sticky; top: 0; z-index: 40; }
#nav a { color: #fff; text-decoration: none; }
.nav-home { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 4px; flex: none; }
.nav-home:hover, .nav-top:hover, .nav-dd.open > .nav-top { background: rgba(255,255,255,.14); }
.nav-app { font-size: 17px; font-weight: 700; padding: 0 12px 0 4px; white-space: nowrap; }
.nav-menu { display: flex; flex: 1; min-width: 0; align-items: stretch; height: 100%; }
.nav-top { background: none; border: 0; color: #fff; padding: 0 12px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; height: 100%; }
.nav-top.active { background: rgba(0,0,0,.16); }
.nav-dd { position: relative; height: 100%; display: flex; }
.nav-sub { display: none; position: absolute; top: 100%; left: 0; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 0 0 6px 6px; box-shadow: 0 8px 22px rgba(0,0,0,.14); min-width: 220px; padding: 6px 0; z-index: 50; }
.nav-dd.right .nav-sub { left: auto; right: 0; }
.nav-dd.open .nav-sub { display: block; }
.nav-sub a, .nav-sub button { display: block; padding: 8px 18px; color: var(--text) !important; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; white-space: nowrap; }
.nav-sub a:hover, .nav-sub button:hover { background: #f1f3f5; text-decoration: none; }
.nav-sub-h { padding: 8px 18px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.nav-sub-h b, .nav-sub-h small { display: block; }
.nav-sub-h small { color: var(--muted); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; padding-left: 8px; height: 100%; }
.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.avatar { width: 28px; height: 28px; border-radius: 5px; background: var(--secondary); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; vertical-align: middle; border-radius: 4px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 8px; background: var(--brand); }
.avatar.lg.co { background: #6c7a89; }
.nav-company { opacity: .9; font-size: 13px; }
.sync { font-size: 12px; opacity: .85; }
.sync.error { background: #ffd8d6; color: #8a1c17; padding: 2px 8px; border-radius: 10px; opacity: 1; }
@media (max-width: 900px) { .nav-company { display: none; } .nav-menu { overflow-x: auto; scrollbar-width: none; } .nav-sub { position: fixed; top: 46px; left: 8px; right: 8px; } }

/* ---------- Home ---------- */
.home { min-height: calc(100vh - 46px); background: radial-gradient(ellipse at top left, color-mix(in srgb, var(--brand) 22%, #fff) 0%, #f5f7fa 55%, color-mix(in srgb, var(--brand) 10%, #eef3f6) 100%); padding: 64px 16px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, 112px); gap: 30px 22px; justify-content: center; max-width: 760px; margin: 0 auto; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--text) !important; text-decoration: none !important; }
.tile-icon { width: 74px; height: 74px; border-radius: 16px; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.14); transition: transform .15s ease, box-shadow .15s ease; }
.tile:hover .tile-icon { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.tile span { font-size: 14px; text-align: center; font-weight: 500; }

/* ---------- Control panel ---------- */
.cp { padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.cp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cp-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.cp-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 18px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.crumbs a { color: var(--brand); }
.crumbs .sep { color: var(--muted); }
.cp-search { position: relative; flex: 1; max-width: 520px; min-width: 240px; }
.sbox { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 4px; background: #fff; padding: 2px 4px 2px 8px; min-height: 34px; flex-wrap: wrap; }
.sbox:focus-within { border-color: var(--brand); }
.sb-ico { color: var(--muted); display: flex; }
.sbox input { border: 0; outline: none; flex: 1; min-width: 100px; padding: 4px; background: transparent; }
.facets { display: contents; }
.facet { display: inline-flex; align-items: center; gap: 4px; background: #e9ecef; border-radius: 3px; padding: 2px 4px 2px 0; font-size: 12.5px; overflow: hidden; }
.facet i { background: var(--brand); color: #fff; padding: 3px 5px; display: flex; font-style: normal; }
.facet.g i { background: var(--teal); }
.facet button { border: 0; background: none; cursor: pointer; padding: 0 4px; font-size: 14px; color: var(--muted); }
.sp-toggle { border: 0; background: none; cursor: pointer; padding: 6px 8px; color: var(--muted); border-left: 1px solid var(--border); margin-left: auto; }
.sp-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.15); z-index: 30; padding: 10px 6px; gap: 6px; }
.sp-panel.open { display: flex; }
.sp-col { flex: 1; min-width: 0; }
.sp-col h6 { margin: 2px 10px 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--brand); }
.sp-col button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 12px 6px 28px; cursor: pointer; border-radius: 3px; position: relative; }
.sp-col button:hover { background: #f1f3f5; }
.sp-col button.on::before { content: '✓'; position: absolute; left: 10px; color: var(--brand); font-weight: 700; }
.sp-col hr { border: 0; border-top: 1px solid var(--border); margin: 4px 8px; }
.pager { display: flex; align-items: center; gap: 2px; }
.pg-txt { color: var(--muted); font-size: 13px; margin-right: 4px; white-space: nowrap; }
.vswitch { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.vswitch button { border: 0; background: #fff; padding: 6px 9px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.vswitch.txt button { padding: 5px 12px; }
.vswitch button + button { border-left: 1px solid var(--border); }
.vswitch button.on { background: var(--brand-l); color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 3px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand-l); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.search { position: relative; }
.search input { width: min(300px, 70vw); padding: 6px 10px 6px 30px; border: 1px solid var(--border); border-radius: 4px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--border); background: #fff; padding: 6px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.3; font-weight: 500; }
.btn:hover { background: #f1f3f5; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-secondary { background: #e7e9ed; border-color: #e7e9ed; color: var(--text); }
.btn-secondary:hover { background: #d8dbe0; }
.btn-light { background: #f1f3f5; border-color: #f1f3f5; }
.btn-danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn-link { border: 0; background: none; color: var(--brand); padding: 4px 0; cursor: pointer; margin-right: 16px; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.btn-link.sm { font-size: 12.5px; margin: 0 0 0 6px; }
.btn-link.danger, .danger { color: var(--danger) !important; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 5px; border-radius: 4px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: #eef0f2; text-decoration: none; }
.icon-btn.s { padding: 1px 3px; }
.icon-btn.gear { padding: 6px; }
details.dd { position: relative; }
details.dd > summary { list-style: none; }
details.dd > summary::-webkit-details-marker { display: none; }
.dd-menu { position: absolute; left: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 6px 16px rgba(0,0,0,.12); min-width: 200px; z-index: 30; padding: 4px 0; }
.dd-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; cursor: pointer; }
.dd-menu button:hover { background: #f1f3f5; }

/* ---------- List ---------- */
.list-wrap { background: var(--card); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap; }
table.list td { padding: 8px 12px; border-bottom: 1px solid #eef0f2; white-space: nowrap; }
table.list tbody tr[data-href], table.list tbody tr[data-u], table.list tbody tr[data-id]:not(.ed) { cursor: pointer; }
table.list tbody tr[data-href]:hover { background: color-mix(in srgb, var(--brand) 5%, #fff); }
table.list tfoot td { font-weight: 700; background: #fafbfc; }
table.list tr.grp td { background: #f1f3f5; font-weight: 700; cursor: pointer; }
table.list tr.grp .gcar { display: inline-block; margin-right: 6px; transition: transform .15s; }
table.list tr.grp.closed .gcar { transform: rotate(-90deg); }
table.list.editable td { padding: 4px 8px; }
table.list.editable input.inp, table.list.editable select { border: 1px solid transparent; padding: 5px 6px; border-radius: 3px; background: transparent; }
table.list.editable input.inp:hover, table.list.editable select:hover { border-color: var(--border); }
table.list.editable input.inp:focus { border-color: var(--brand); outline: none; background: #fff; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.nowrap, table.lines td[data-sub] { white-space: nowrap; }
.empty { text-align: center; padding: 70px 16px; color: var(--muted); background: var(--card); }
.empty h3 { color: var(--text); margin: 0 0 8px; font-size: 18px; }
.boot { min-height: 60vh; display: grid; place-items: center; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--brand-l); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-draft { background: #e8eaed; color: #495057; }
.b-sent { background: #e1eefa; color: var(--info); }
.b-sale { background: #dff3e5; color: var(--ok); }
.b-cancel { background: #fbe4e3; color: var(--danger); }
.pos { color: var(--ok); } .neg { color: var(--danger); } .low { color: var(--danger); font-weight: 700; } .warn { color: var(--warn); font-weight: 700; }
.hint { color: var(--muted); font-size: 12.5px; }
.fav { color: #c9ced4; } .fav.on { color: #f3b31b; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag button { border: 0; background: none; cursor: pointer; padding: 0 0 0 3px; color: inherit; opacity: .7; }
.c0 { background: #e9ecef; color: #495057; } .c1 { background: #fde2e1; color: #a12622; } .c2 { background: #fde9d4; color: #9a4b0b; } .c3 { background: #fdf3c7; color: #7c5d02; } .c4 { background: #d6efff; color: #0b5a8f; } .c5 { background: #eadcf5; color: #5b2d86; } .c6 { background: #fbdcd2; color: #8f3a1d; } .c7 { background: #d0f0ec; color: #0f6157; } .c8 { background: #dde3fb; color: #2d3c8f; } .c9 { background: #f9d8e8; color: #8d1d55; } .c10 { background: #dcf3d6; color: #2d6a1b; } .c11 { background: #ece5dd; color: #5e4a33; }
.act-dot { display: inline-flex; vertical-align: middle; }
.act-dot.late { color: var(--danger); } .act-dot.today { color: var(--warn); } .act-dot.future { color: var(--ok); }
.act-t.late { color: var(--danger); font-weight: 700; } .act-t.today { color: var(--warn); font-weight: 700; }
.stars { display: inline-flex; gap: 1px; }
.stars button, .stars i { border: 0; background: none; cursor: pointer; color: #d0d4d9; font-size: 16px; padding: 0; font-style: normal; line-height: 1; }
.stars .on { color: #f3b31b; }
.stars.ro i { font-size: 13px; cursor: default; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; padding: 12px 16px 30px; }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; color: var(--text) !important; text-decoration: none !important; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s ease, border-color .15s ease; }
.kcard:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); border-color: #c9ced4; }
.kcard.dragging { opacity: .5; }
.k-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.k-top b { font-weight: 700; overflow-wrap: anywhere; }
.k-top span { white-space: nowrap; font-weight: 700; }
.k-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.k-meta { color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.kc-partner, .kc-prod { display: flex; gap: 12px; align-items: flex-start; }
.kc-img { width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.kc-img img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #fff; }
.kc-prod .kc-img { width: 72px; height: 72px; }
.kc-prod .kc-img img { width: 72px; height: 72px; }
.noimg { color: #c9ced4; }
.kc-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kc-body small { color: var(--muted); }
.kc-body .badge { align-self: flex-start; }
.kcols { display: flex; gap: 12px; padding: 12px 16px 30px; overflow-x: auto; align-items: flex-start; min-height: calc(100vh - 140px); }
.kcol { flex: 0 0 300px; background: #eceef1; border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.kcol.fold { flex-basis: 160px; }
.kcol.over { outline: 2px dashed var(--brand); background: var(--brand-l); }
.kcol.add { background: none; flex-basis: 140px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.kcol-h b { flex: 1; font-size: 15px; }
.kcol-n { color: var(--muted); font-size: 12px; background: #fff; border-radius: 10px; padding: 0 7px; }
.kcol-sum { font-weight: 700; font-size: 13px; }
.kcol-bar { display: flex; height: 6px; background: #dfe2e6; border-radius: 3px; overflow: hidden; }
.kcol-bar i { display: block; height: 100%; }
.b-won { background: var(--ok); } .b-plan { background: #7fc495; } .b-today { background: #f1b44c; } .b-late { background: var(--danger); }
.kcol-cards { display: flex; flex-direction: column; gap: 6px; }
.kc-lead { display: flex; flex-direction: column; gap: 4px; }
.kc-lead small { color: var(--muted); }
.kl-rev { font-weight: 700; }
.kl-bot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.k-team { display: flex; flex-direction: column; gap: 6px; }
.k-team small { color: var(--muted); }
.kt-row { display: flex; justify-content: space-between; font-size: 13px; }
.bar-bg { height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.bar-bg i { display: block; height: 100%; background: var(--brand); transition: width .3s; }

/* ---------- Form ---------- */
.form-view { padding-bottom: 20px; }
.actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.actionbar .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.statusbar { display: flex; flex-wrap: wrap; }
.statusbar span { padding: 6px 14px 6px 20px; background: #fff; border: 1px solid var(--border); margin-left: -1px; font-size: 13px; color: var(--muted); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); white-space: nowrap; }
.statusbar span:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: 14px; }
.statusbar span.cur { background: var(--brand-l); color: var(--brand); font-weight: 700; border-color: var(--brand); }
.statusbar span.click { cursor: pointer; }
.statusbar span.click:hover:not(.cur) { background: #f1f3f5; }
.form-cols { display: grid; grid-template-columns: minmax(0, 1fr); }
.with-chatter .form-cols { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1280px) { .with-chatter .form-cols { grid-template-columns: minmax(0, 1fr); } }
.sheet-wrap { padding: 16px; min-width: 0; }
.sheet { position: relative; background: var(--card); max-width: 1240px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
@media (max-width: 640px) { .sheet-wrap { padding: 8px; } .sheet { padding: 16px; } }
.sheet h1 { margin: 0 0 16px; font-size: 26px; font-weight: 700; }
.sheet h1 input { font-size: 26px; font-weight: 700; width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 4px 0; background: transparent; }
.sheet h1 input:focus { outline: none; border-bottom-color: var(--brand); }
.sheet h1.docnum { font-size: 28px; }
.sheet h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.grp-t { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.ribbon { position: absolute; top: 18px; right: -1px; background: var(--danger); color: #fff; padding: 4px 18px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-radius: 3px 0 0 3px; z-index: 2; }
.ribbon.green { background: var(--ok); } .ribbon.blue { background: var(--info); } .ribbon.gray { background: #6c757d; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 0; min-height: 34px; }
.field.full { grid-template-columns: 1fr; }
@media (max-width: 480px) { .field { grid-template-columns: 1fr; gap: 2px; } }
.field > label { font-weight: 700; color: #3d434a; }
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 10px; cursor: help; vertical-align: top; }
.fv { min-width: 0; }
.field input, .field select, .field textarea, .inp { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 5px 2px; background: transparent; border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-bottom-color: var(--brand); }
.field input:disabled, .field select:disabled, .inp:disabled { border-bottom-color: transparent; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
.field select:disabled { appearance: none; -webkit-appearance: none; }
.field input[type=checkbox], .field input[type=radio] { width: auto; }
.inp.boxed, textarea.boxed { border: 1px solid var(--border); border-radius: 4px; padding: 8px; background: #fff; }
.field .ro { padding: 5px 2px; }
.field input.color { width: 44px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 4px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline > input { flex: 1; }
.addr { display: flex; flex-direction: column; gap: 2px; }
.addr-row { display: flex; gap: 8px; }
.addr-row > * { flex: 1; }
textarea { resize: vertical; min-height: 60px; }
.cust-info { color: var(--muted); font-size: 13px; padding: 0 0 6px 188px; line-height: 1.5; }
@media (max-width: 480px) { .cust-info { padding-left: 0; } }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.radio-row.wrap { margin-bottom: 14px; }
.radio-col { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.checks { display: flex; gap: 16px; }
.checks.col { flex-direction: column; gap: 6px; }
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ced4da; border-radius: 21px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(17px); }
.stats { display: flex; justify-content: flex-end; margin: -24px -28px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.stats:empty { display: none; }
@media (max-width: 640px) { .stats { margin: -16px -16px 14px; } }
.stat { padding: 8px 18px; border: 0; border-left: 1px solid var(--border); display: flex; align-items: center; gap: 10px; background: none; cursor: pointer; text-align: left; min-width: 140px; }
.stat:hover { background: #f6f7f9; }
.stat-i { color: var(--muted); display: flex; }
.stat b { display: block; font-size: 14px; color: var(--brand); }
.stat small { color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin: 22px 0 0; }
.tabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 8px 16px; cursor: pointer; color: var(--muted); border-radius: 4px 4px 0 0; white-space: nowrap; font-weight: 500; }
.tabs button.on { border-color: var(--border); background: #fff; color: var(--text); font-weight: 700; margin-bottom: -1px; }
.tabpane { padding-top: 12px; }
.partner-head, .prod-head { display: flex; justify-content: space-between; gap: 20px; }
.ph-main { flex: 1; min-width: 0; }
.sub-m2o { max-width: 440px; margin: -8px 0 12px; }
.avatar-up { width: 92px; height: 92px; border-radius: 8px; border: 1px dashed var(--border); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: #adb5bd; flex: none; background: #fafbfc; }
.avatar-up img { width: 100%; height: 100%; object-fit: contain; }
.avatar-up span svg { width: 34px; height: 34px; }
.with-star { display: flex; align-items: center; gap: 8px; }
.fav-btn { border: 0; background: none; font-size: 24px; color: #d0d4d9; cursor: pointer; padding: 0; }
.fav-btn.on { color: #f3b31b; }
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.child-card { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--text) !important; text-decoration: none !important; background: #fff; text-align: left; }
.child-card small { display: block; color: var(--muted); }
.child-card.add { justify-content: center; align-items: center; color: var(--brand) !important; cursor: pointer; border-style: dashed; font-weight: 600; }
.lead-money { display: flex; gap: 24px; margin: -6px 0 14px; flex-wrap: wrap; }
.lead-money label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.lead-money input { font-size: 18px; font-weight: 700; border: 0; border-bottom: 1px solid var(--border); width: 180px; background: transparent; padding: 3px 0; }

/* many2one */
.m2o { position: relative; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); min-height: 30px; }
.m2o:focus-within { border-bottom-color: var(--brand); }
.m2o input { border: 0 !important; flex: 1; min-width: 60px; padding: 5px 2px; background: transparent; outline: none; }
.m2o.ro { border-bottom-color: transparent; }
.m2o-open { color: var(--muted); display: flex; padding: 2px; border-radius: 3px; }
.m2o-open:hover { background: #eef0f2; color: var(--brand); }
.m2m { flex-wrap: wrap; padding: 2px 0; gap: 3px; }
.m2o-dd { position: absolute; z-index: 70; background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.16); max-height: 320px; overflow-y: auto; padding: 4px 0; }
.m2o-dd button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; }
.m2o-dd button small { display: block; color: var(--muted); font-size: 12px; }
.m2o-dd button.hi, .m2o-dd button:hover { background: var(--brand-l); }
.m2o-dd button.create { color: var(--brand); font-style: italic; }
.m2o-dd button.dis { color: var(--muted); cursor: default; }
.sm-list { max-height: 55vh; overflow-y: auto; margin-top: 10px; }
.sm-list tr { cursor: pointer; }
.sm-list tr:hover { background: var(--brand-l); }

/* order lines */
.lines-wrap { overflow-x: auto; }
table.lines { width: 100%; border-collapse: collapse; min-width: 940px; }
table.lines th { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--border); font-weight: 700; white-space: nowrap; }
table.lines td { padding: 6px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
table.lines td.mv { width: 26px; padding: 6px 0; }
table.lines td.mv .icon-btn { display: flex; }
table.lines .desc-cell { min-width: 380px; width: 46%; }
table.lines .desc-cell .m2o input { font-weight: 700; }
table.lines textarea.desc { margin-top: 4px; font-size: 13px; color: #555; min-height: 0; resize: none; overflow: hidden; border-bottom-color: transparent; }
table.lines textarea.desc:focus { border-bottom-color: var(--brand); }
table.lines input.inp.n { text-align: right; width: 96px; }
table.lines input.inp.n.s { width: 64px; }
table.lines .tax-cell { min-width: 110px; }
table.lines .tax-cell .m2m { justify-content: flex-end; border-bottom-color: transparent; }
table.lines .unit { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
table.lines tr.ln-sec td { background: #e9ecef; font-weight: 700; }
table.lines tr.ln-sec input { font-weight: 700; }
table.lines tr.ln-note td { font-style: italic; color: #555; }
table.lines tr.ln-note textarea { font-style: italic; resize: none; overflow: hidden; min-height: 0; }
table.lines.pick { min-width: 640px; }
.add-line td { border-bottom: 0 !important; padding-top: 10px !important; }
.warn-ico { color: var(--warn); cursor: help; margin-left: 4px; }
.sum-row { display: grid; grid-template-columns: 1fr 360px; gap: 28px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .sum-row { grid-template-columns: 1fr; } }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; gap: 10px; }
.totals .grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; font-size: 18px; font-weight: 700; }
.totals .grand.due { border-top-width: 1px; font-size: 16px; color: var(--brand); }
.paid-line { color: var(--muted); font-size: 13px; }
.cat-top { display: flex; gap: 8px; margin-bottom: 12px; }
.cat-top > * { flex: 1; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; }
.cat-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cat-card.in { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.cat-img { height: 90px; display: grid; place-items: center; color: #c9ced4; }
.cat-img img { max-height: 90px; max-width: 100%; object-fit: contain; }
.cat-name { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.cat-price { color: var(--muted); font-size: 13px; }
.cat-q { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cat-q button { border: 1px solid var(--border); background: #fff; border-radius: 4px; width: 30px; height: 28px; cursor: pointer; font-weight: 700; }
.cat-q button.add { width: 100%; color: var(--brand); }

/* rich text */
.rte { border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.rte.ro { border-color: transparent; }
.rte-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: #f8f9fa; flex-wrap: wrap; border-radius: 4px 4px 0 0; }
.rte-bar button { border: 1px solid transparent; background: none; padding: 3px 9px; border-radius: 3px; cursor: pointer; font-size: 13px; }
.rte-bar button:hover { background: #e9ecef; border-color: var(--border); }
.rte-body { min-height: 110px; max-height: 520px; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.55; }
.rte.ro .rte-body { padding: 0; max-height: none; }
.rte-body:empty::before { content: attr(data-ph); color: var(--muted); }
.rich p { margin: 0 0 10px; }
.rich h1, .rich h2, .rich h3 { margin: 6px 0 8px; font-size: 16px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 22px; }
.sig-img { max-width: 320px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }

/* chatter */
.chatter { background: #fff; border-left: 1px solid var(--border); padding: 12px 16px 30px; min-width: 0; }
@media (max-width: 1280px) { .chatter { border-left: 0; border-top: 1px solid var(--border); max-width: 1272px; width: 100%; margin: 0 auto; background: transparent; } }
.ch-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.ch-tabs button { border: 1px solid var(--border); background: #fff; padding: 5px 10px; border-radius: 4px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font-weight: 500; }
.ch-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ch-new { margin-bottom: 12px; }
.ch-new textarea { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 8px; width: 100%; }
.ch-new-b { margin-top: 6px; }
.pt-hist .ch-new { display: flex; gap: 8px; align-items: flex-end; }
.ch-acts { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; background: #fcfcfd; }
.ch-acts h6 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.act { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid #eef0f2; font-size: 13px; }
.act:first-of-type { border-top: 0; }
.act-i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-size: 12px; }
.act.late .act-i { background: var(--danger); } .act.today .act-i { background: var(--warn); } .act.future .act-i { background: var(--ok); }
.act-b { display: flex; gap: 0; flex-wrap: wrap; }
.act-b .btn-link { font-size: 12px; margin-right: 10px; }
.ch-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef0f2; line-height: 1.45; }
.ch-item small { color: var(--muted); margin-left: 4px; }
.ch-item.note .ch-body { background: #f6f7f9; border-radius: 4px; padding: 4px 8px; margin-top: 2px; }
.ch-body { overflow-wrap: anywhere; }
.ch-body p { margin: 0 0 4px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fadein .15s ease; }
.modal { background: #fff; border-radius: 6px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal.wide { width: min(860px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-b textarea.inp { margin-top: 8px; }
.modal-f { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fadein { from { opacity: 0; } }
.sig-tabs { display: flex; gap: 6px; align-items: center; margin: 12px 0 6px; }
.sig-tabs button[data-sm] { border: 1px solid var(--border); background: #fff; padding: 4px 12px; border-radius: 4px; cursor: pointer; }
.sig-tabs button.on { background: var(--brand-l); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.sig-tabs .btn-link { margin-left: auto; margin-right: 0; }
#sg-c { width: 100%; height: auto; aspect-ratio: 640 / 180; border: 1px dashed #adb5bd; border-radius: 4px; background: #fff; touch-action: none; cursor: crosshair; }

/* ---------- Dashboards ---------- */
.dash { max-width: 1240px; margin: 16px auto; padding: 0 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi small { color: var(--muted); display: block; }
.kpi b { font-size: 22px; display: block; margin-top: 4px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi-inline { display: flex; gap: 30px; margin-bottom: 10px; }
.kpi-inline small { display: block; color: var(--muted); }
.kpi-inline b { font-size: 20px; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .cards2, .cards3 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.dcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.dcard-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dcard-b { display: flex; gap: 16px; padding: 14px 16px; align-items: stretch; }
.dcard-l { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.dcard-r { display: flex; flex-direction: column; gap: 6px; margin-left: auto; text-align: right; }
.dbars { flex: 1; display: flex; align-items: flex-end; gap: 8px; height: 130px; }
.dbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; }
.dbar i { display: block; width: 100%; max-width: 40px; background: color-mix(in srgb, var(--brand) 55%, #fff); border-radius: 3px 3px 0 0; min-height: 2px; }
.dbar i.late { background: #f2a7a4; }
.dbar small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dbar em { font-style: normal; font-size: 10.5px; white-space: nowrap; }
.mini td, .mini th { padding: 6px 8px; border-bottom: 1px solid #eef0f2; text-align: left; white-space: nowrap; }
.mini { width: 100%; border-collapse: collapse; }
.mini tr[data-href] { cursor: pointer; }
.mini tr[data-href]:hover { background: var(--brand-l); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 260px) 1fr 140px; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-b { background: #f1f3f5; height: 18px; border-radius: 3px; overflow: hidden; }
.hb-b i { display: block; height: 100%; background: var(--brand); }
.hb-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.an-ctl label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.an-ctl select { border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; background: #fff; }
.an-f { margin-top: 10px; }
.pdf-paybox { margin-top: 5mm; border: 1px solid #c3c8cf; border-radius: 2mm; padding: 3mm; break-inside: avoid; }
.pdf-paybox b { display: block; margin-bottom: 1mm; }
.pdf-sign.two { flex-direction: row; gap: 20mm; align-items: stretch; margin-top: 20mm; }
.pdf-sign.two div { flex: 1; border-top: 1px solid #000; text-align: center; padding-top: 2mm; }

/* calendar */
.cal { background: #fff; border: 1px solid var(--border); border-radius: 6px; margin: 12px 16px; overflow: hidden; }
.cal-body > .cal { margin: 12px 16px; }
.cal-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cal-top b { text-transform: capitalize; min-width: 160px; text-align: center; }
.cal-lbl { text-transform: capitalize; min-width: 170px; text-align: center; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-h { padding: 6px; text-align: center; font-weight: 700; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-c { min-height: 104px; border-right: 1px solid #eef0f2; border-bottom: 1px solid #eef0f2; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-c.out { background: #fafbfc; }
.cal-c.today { background: var(--brand-l); }
.cal-d { font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-ev { background: var(--brand); color: #fff !important; font-size: 11.5px; padding: 2px 5px; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk { background: #fff; margin: 12px 16px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.wk-head, .wk-allday { display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.wk-head > div { padding: 8px 4px; text-align: center; font-size: 13px; text-transform: capitalize; color: var(--muted); }
.wk-head > div.today { color: var(--brand); font-weight: 700; }
.wk-head b { font-size: 18px; color: var(--text); margin-left: 4px; }
.wk-allday > div { min-height: 28px; padding: 2px; border-left: 1px solid #eef0f2; }
.wk-allday .hint { display: grid; place-items: center; border: 0; font-size: 10px; }
.wk-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); max-height: calc(100vh - 230px); overflow-y: auto; position: relative; }
.wk-hours div { height: var(--px); font-size: 11px; color: var(--muted); text-align: right; padding: 0 6px; transform: translateY(-6px); }
.wk-day { position: relative; border-left: 1px solid #eef0f2; }
.wk-slot { height: var(--px); border-bottom: 1px solid #f1f3f5; cursor: pointer; }
.wk-slot:hover { background: var(--brand-l); }
.wk-ev { position: absolute; left: 3px; right: 3px; color: #fff !important; border-radius: 4px; padding: 3px 6px; font-size: 12px; overflow: hidden; text-decoration: none !important; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.wk-ev.ad { position: static; display: block; margin-bottom: 2px; }
.wk-ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev small { opacity: .9; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }

/* whatsapp */
.wa-edit { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
@media (max-width: 960px) { .wa-edit { grid-template-columns: 1fr; } }
.wa-phone { position: sticky; top: 60px; align-self: start; }
.wa-chat { background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='4' cy='4' r='1' fill='%23d9d2c5'/%3E%3C/svg%3E"); border-radius: 12px; padding: 18px 14px; min-height: 260px; border: 1px solid var(--border); }
.wa-bubble { background: #fff; border-radius: 0 8px 8px 8px; padding: 8px 10px 18px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.1); position: relative; overflow-wrap: anywhere; }
.wa-time { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #8696a0; }

/* settings */
.logo-box { display: flex; gap: 14px; align-items: center; }
.logo-box img { max-height: 64px; max-width: 220px; border: 1px solid var(--border); border-radius: 6px; padding: 6px; background: #fff; }
.theme-prev { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-top: 14px; }
.tp-nav { color: #fff; display: flex; gap: 14px; padding: 8px 12px; font-size: 13px; }
.tp-body { padding: 12px; background: #f6f7f9; }
.tp-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin-top: 10px; display: flex; justify-content: space-between; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, #000) 0%, var(--brand) 60%, color-mix(in srgb, var(--brand) 60%, #fff) 100%); padding: 16px; }
.auth-card { background: #fff; border-radius: 10px; padding: 32px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-logo { text-align: center; margin-bottom: 4px; }
.auth-logo img { max-height: 70px; max-width: 260px; }
.auth-logo b { font-size: 24px; color: var(--brand); }
.auth-card h2 { margin: 0; font-size: 20px; text-align: center; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.auth-card input { border: 1px solid var(--border); border-radius: 5px; padding: 9px 10px; }
.auth-card input:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.auth-card .btn { padding: 10px; font-size: 15px; }
.auth-err { color: var(--danger); background: #fbe4e3; padding: 8px 10px; border-radius: 5px; margin: 0; font-size: 13px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- Portal do cliente ---------- */
.portal { color: #212529; padding-bottom: 60px; }
.pt-wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.pt-head { border-bottom: 1px solid var(--border); background: #fff; }
.pt-head-in { display: flex; justify-content: space-between; align-items: center; min-height: 66px; }
.pt-logo img { max-height: 44px; max-width: 230px; display: block; }
.pt-logo b { font-size: 20px; color: var(--brand); }
.pt-user { color: var(--muted); }
.pt-banner { background: #cff4fc; border: 1px solid #9eeaf9; color: #055160; text-align: center; padding: 12px; border-radius: 6px; margin: 16px 0 0; }
.pt-banner a { color: #055160; font-weight: 700; }
.pt-bc { color: var(--muted); font-size: 13px; margin: 16px 0 18px; }
.pt-row { display: grid; grid-template-columns: 290px 1fr; gap: 36px; align-items: start; }
@media (max-width: 900px) { .pt-row { grid-template-columns: 1fr; gap: 20px; } }
.pt-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .pt-side { position: static; } }
.pt-amount { font-size: 28px; font-weight: 500; margin: 0; }
.pt-side-btns { display: flex; flex-direction: column; gap: 8px; }
.pt-side-btns .btn { padding: 9px 12px; }
.pt-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pt-nav li + li { padding-left: 12px; }
.pt-nav a { color: #212529; }
.pt-contact small { color: var(--muted); display: block; margin-bottom: 8px; }
.pt-contact-row { display: flex; gap: 10px; align-items: center; }
.pt-contact-row .avatar { width: 36px; height: 36px; background: var(--brand); }
.pt-contact-row a { display: block; font-size: 13px; }
.pt-main { min-width: 0; }
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.alert.warn { background: #fff3cd; border-color: #ffe69c; color: #664d03; }
.alert.warn a { color: #664d03; }
.alert.ok { background: #d1e7dd; border-color: #a3cfbb; color: #0a3622; }
.alert.err { background: #f8d7da; border-color: #f1aeb5; color: #58151c; }
.alert.info { background: #e7f1ff; border-color: #b6d4fe; color: #052c65; }
.pt-title { font-size: 28px; font-weight: 500; margin: 6px 0 22px; }
.pt-info { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 26px; }
@media (max-width: 640px) { .pt-info { grid-template-columns: 1fr; } }
.pt-info h5 { font-size: 16px; font-weight: 600; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.pt-kv th { text-align: left; font-weight: 700; padding: 3px 18px 3px 0; white-space: nowrap; vertical-align: top; }
.pt-kv td { padding: 3px 0; }
.pt-info address { font-style: normal; line-height: 1.5; }
.pt-addr { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }
.pt-addr svg { margin-top: 4px; color: var(--muted); flex: none; }
.pt-table-wrap { overflow-x: auto; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-table th { text-align: left; padding: 8px; border-bottom: 2px solid #212529; font-weight: 700; white-space: nowrap; }
.pt-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pt-table td.num { white-space: nowrap; }
.pt-table .r-sec td { background: #e9ecef; font-weight: 700; }
.pt-table .r-note td { font-style: italic; }
.pt-totals table { margin: 10px 0 0 auto; width: min(380px, 100%); border-collapse: collapse; }
.pt-totals td { padding: 6px 8px; border-top: 1px solid var(--border); }
.pt-totals .grand td { border-top: 2px solid #212529; font-size: 15px; }
.pt-sig { margin-top: 24px; }
.pt-sig img { max-width: 300px; border: 1px solid var(--border); border-radius: 4px; }
.pt-terms { margin-top: 34px; }
.pt-terms h4 { font-size: 24px; font-weight: 500; margin: 0 0 14px; }
.pt-accept { display: flex; gap: 8px; margin: 28px 0 8px; flex-wrap: wrap; }
.pt-accept .btn { padding: 9px 18px; }
.pt-hist { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 20px; }
.pt-hist h3 { font-size: 20px; font-weight: 500; margin: 0 0 14px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2f3640; color: #fff; padding: 10px 18px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* ---------- PDF (impressão) ---------- */
#print { display: none; }
@page {
  size: A4;
  margin: 8mm 0 11mm 0;
  @bottom-right { content: "Página " counter(page) "/" counter(pages); font: 9pt Lato, Arial, sans-serif; color: #666; padding-right: 14mm; vertical-align: top; }
}
@media print {
  html, body { background: #fff !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pdf { font-family: var(--rf), Lato, "Segoe UI", Arial, sans-serif; color: #222; font-size: 10pt; line-height: 1.45; }
.pdf-wv { position: fixed; top: 0; right: 0; width: 120mm; height: 95mm; overflow: hidden; z-index: 0; pointer-events: none; }
.pdf-wv svg { width: 100%; height: 100%; display: block; }
.pdf-head { position: fixed; top: 0; left: 0; right: 0; height: 30mm; padding: 4mm 14mm 0; z-index: 1; }
.pdf-co { position: relative; font-size: 10pt; line-height: 1.45; max-width: 95mm; }
.pdf-logo { position: absolute; right: 14mm; top: 2mm; }
.pdf-logo img { max-height: 18mm; max-width: 75mm; display: block; }
.pdf-logo-txt { font-size: 14pt; letter-spacing: .12em; color: var(--rc); text-transform: uppercase; font-weight: 300; }
/* top fixo (área útil da página = 297 − 8 − 11 = 278 mm): funciona mesmo quando a 1ª página é uma capa sem margens */
.pdf-foot { position: fixed; top: 262mm; left: 0; right: 0; height: 16mm; padding: 0 14mm; display: flex; justify-content: space-between; align-items: flex-start; font-size: 10pt; z-index: 1; overflow: hidden; }
.pdf-foot .wv-bot { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 8mm; }
.pdf-frame { width: 100%; border-collapse: collapse; position: relative; z-index: 1; }
.pdf-frame > tbody > tr > td, .pdf-frame > thead > tr > td, .pdf-frame > tfoot > tr > td { padding: 0 14mm; }
.pdf-sp-top { height: 32mm; }
.pdf-sp-bot { height: 18mm; }
.pdf-title { color: var(--rc); text-align: center; font-weight: 400; font-size: 22pt; margin: 2mm 0 6mm; }
.pdf-cust { line-height: 1.45; margin-bottom: 6mm; font-size: 10.5pt; }
.pdf-info { display: grid; grid-template-columns: repeat(3, 1fr); background: #f0f0f1; border-radius: 3mm; padding: 2.5mm 3mm; margin-bottom: 6mm; gap: 3mm; }
.pdf-info b { display: block; color: #444; }
.pdf-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #a9bfd6; border-radius: 3mm 3mm 0 3mm; overflow: hidden; }
.pdf-table th { background: var(--rc); color: #fff; font-weight: 400; padding: 2mm 2.5mm; text-align: left; white-space: nowrap; }
.pdf-table td { padding: 2.5mm; border-top: 1px solid #c3c8cf; vertical-align: top; }
.pdf-table tr { break-inside: avoid; page-break-inside: avoid; }
.pdf-table .r-prod td + td { border-left: 1px solid #c3c8cf; }
.pdf-table .r-prod td.val { background: #eff0f2; white-space: nowrap; }
.pdf-table .r-prod td.num { white-space: nowrap; }
.pdf-table .r-sec td { background: var(--sec, #e8e9eb); font-weight: 700; }
.pdf-table .r-note td { font-style: italic; }
.pdf-table tbody tr:first-child td { border-top: 0; }
.pdf-total { display: flex; flex-direction: column; align-items: flex-end; break-inside: avoid; }
.pdf-sub { display: flex; gap: 6mm; padding: 1mm 3mm; }
.pdf-grand { display: flex; background: var(--rc); color: #fff; font-weight: 700; border-radius: 0 0 2.5mm 2.5mm; overflow: hidden; }
.pdf-grand span { padding: 2mm 3mm; }
.pdf-grand span + span { border-left: 1px solid rgba(255,255,255,.45); }
.pdf-pay { margin: 5mm 0 0; }
.pdf-sign { margin-top: 6mm; display: flex; flex-direction: column; align-items: flex-end; break-inside: avoid; }
.pdf-sign img { max-width: 70mm; max-height: 25mm; }
.pdf-sign span { font-size: 9pt; color: #555; }
.pdf-terms-h { font-size: 26pt; font-weight: 400; margin: 8mm 0 3mm; color: #1d2433; break-after: avoid; }
.pdf-terms { font-size: 9.5pt; text-align: justify; }
.pdf-terms strong, .pdf-terms b { font-weight: 700; }
.pdf-terms p { margin: 0 0 3mm; }
.pdf-terms h1, .pdf-terms h2, .pdf-terms h3 { font-size: 11pt; margin: 3mm 0 2mm; }
.layout-limpo .pdf-table { border-color: #d0d4d9; }

/* ---------- Visuais da proposta ---------- */
.pdf-title small { display: block; font-size: 9pt; letter-spacing: .18em; text-transform: uppercase; color: var(--rc2); font-weight: 700; margin-bottom: 1mm; }
.title-left .pdf-title { text-align: left; }
/* imagens dos produtos ao lado da descrição */
.ln-flex { display: flex; gap: 3mm; align-items: flex-start; }
.ln-img { flex: none; width: 24mm; height: 24mm; display: grid; place-items: center; border-radius: 2mm; background: #fff; border: 1px solid #e3e6ea; overflow: hidden; }
.ln-img:empty { visibility: hidden; }
.ln-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-p .ln-img { width: 16mm; height: 16mm; }
.img-g .ln-img { width: 34mm; height: 34mm; }
.pt-table .ln-img { width: 64px; height: 64px; border-radius: 6px; }
.img-p .pt-table .ln-img { width: 44px; height: 44px; }
.img-g .pt-table .ln-img { width: 96px; height: 96px; }
/* layout "faixa" (moderno) */
.layout-faixa .pdf-head { padding-top: 7mm; }
.layout-faixa .pdf-band { position: absolute; top: 0; left: 0; right: 0; height: 4mm; background: linear-gradient(90deg, var(--rc) 0 72%, var(--rc2) 72% 100%); }
.layout-faixa .pdf-co { position: absolute; right: 14mm; top: 8mm; text-align: right; font-size: 8.5pt; color: #555; max-width: 100mm; }
.layout-faixa .pdf-logo { left: 14mm; right: auto; top: 8mm; }
.layout-faixa .pdf-logo img { max-height: 15mm; }
.layout-faixa .pdf-foot { border-top: 0.6mm solid var(--rc); padding-top: 2mm; height: 14mm; }
.layout-faixa .pdf-foot b { color: var(--rc); }
.layout-faixa .pdf-title { color: var(--rc); font-weight: 700; font-size: 20pt; margin: 4mm 0 5mm; }
.layout-faixa .pdf-terms-h { color: var(--rc); font-size: 18pt; font-weight: 700; border-bottom: 0.6mm solid var(--rc); padding-bottom: 2mm; }
.layout-faixa .pdf-cust b { color: var(--rc2); font-size: 11pt; }
.layout-limpo .pdf-title { color: var(--rc); }
/* caixa de informações em linha */
.info-linha .pdf-info { background: none; border-radius: 0; padding: 0; gap: 4mm; }
.info-linha .pdf-info > div { border-left: 0.8mm solid var(--rc); padding: 0.5mm 0 0.5mm 3mm; }
.info-linha .pdf-info b { color: var(--rc2); font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; }
/* tabela com linhas leves */
.tbl-linhas .pdf-table { border: 0; border-radius: 0; }
.tbl-linhas .pdf-table th { background: var(--rc); border-radius: 0; }
.tbl-linhas .pdf-table td { border-top: 1px solid #e3e6ea; }
.tbl-linhas .pdf-table .r-prod td + td { border-left: 0; }
.tbl-linhas .pdf-table .r-prod td.val { background: none; font-weight: 700; color: var(--rc2); }
.tbl-linhas .pdf-table .r-sec td { background: var(--sec); color: var(--rc); text-transform: uppercase; letter-spacing: .04em; font-size: 9.5pt; }
.tbl-linhas .pdf-grand { border-radius: 2mm; margin-top: 2mm; font-size: 12pt; }
/* páginas de capa/rodapé (Construtor de cotações) */
@page fullpage { margin: 0; @bottom-right { content: none; } }
.pdf-fullpage { display: none; }
@media print {
  .pdf-fullpage { display: flex; page: fullpage; width: 210mm; height: 296.5mm; align-items: center; justify-content: center; position: relative; z-index: 20; background: #fff; break-inside: avoid; overflow: hidden; }
  .pdf-fullpage.before { break-after: page; }
  .pdf-fullpage.after { break-before: page; }
  .pdf-fullpage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
}

/* ---------- Construtor de cotações ---------- */
.qb { display: flex; flex-direction: column; gap: 18px; }
.qb-sec h3 { font-size: 14px; margin: 0 0 10px; }
.qb-sec h3 small { font-weight: 400; color: var(--muted); }
.qb-mid span { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px dashed var(--brand); border-radius: 6px; color: var(--brand); background: var(--brand-l); font-weight: 600; }
.qb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.qb-card { position: relative; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; cursor: pointer; background: #fff; color: var(--text) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.qb-card:hover { border-color: #b9c0c8; }
.qb-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.qb-card input { position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; accent-color: var(--brand); }
.qb-card.add { justify-content: center; align-items: center; min-height: 180px; border-style: dashed; color: var(--brand) !important; font-weight: 600; font: inherit; }
.qb-thumb { height: 150px; display: grid; place-items: center; background: #f4f5f7; border-radius: 4px; overflow: hidden; }
.qb-thumb img { max-width: 100%; max-height: 150px; object-fit: contain; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.qb-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qb-card small { color: var(--muted); }
.qb-style { max-width: 640px; }
.kc-doc { display: flex; gap: 12px; }
.kd-thumb { width: 64px; height: 90px; flex: none; display: grid; place-items: center; background: #f4f5f7; border-radius: 4px; overflow: hidden; }
.kd-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.qd-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.qd-pages figure { margin: 0; text-align: center; }
.qd-pages img { width: 100%; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.08); background: #fff; }
.qd-pages figcaption { font-size: 12px; color: var(--muted); }

/* ---------- Editor de visual ---------- */
.style-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.style-tabs button { text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; position: relative; }
.style-tabs button.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: var(--brand-l); }
.style-tabs span { color: var(--muted); font-size: 13px; }
.style-tabs em { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 10px; padding: 1px 8px; }
.style-edit { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .style-edit { grid-template-columns: 1fr; } }
.se-prev { position: sticky; top: 60px; background: #e9ecef; border-radius: 8px; padding: 14px; overflow: hidden; }
.sp-scale { width: 442px; height: 625px; overflow: hidden; }
.sp-page { width: 210mm; min-height: 297mm; background: #fff; transform: scale(0.557); transform-origin: top left; box-shadow: 0 4px 18px rgba(0,0,0,.18); position: relative; overflow: hidden; }
.sp-page .pdf { position: relative; height: 297mm; overflow: hidden; }
.sp-page .pdf-head, .sp-page .pdf-foot, .sp-page .pdf-wv { position: absolute; }
.sp-page .pdf-foot { top: auto; bottom: 0; }
.sp-page .pdf-frame { margin-top: 0; }

/* ---------- Visualizador da montagem (Ver detalhes / Pré-visualizar) ---------- */
body.dv-open { overflow: hidden; }
.dv-bg { position: fixed; inset: 0; z-index: 65; background: #525659; display: flex; flex-direction: column; animation: fadein .15s ease; }
.dv-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #323639; color: #fff; flex-wrap: wrap; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.dv-bar b { font-size: 15px; }
.dv-info { color: #c9ced4; font-size: 13px; }
.dv-acts { margin-left: auto; display: flex; gap: 8px; }
.dv-pages { flex: 1; overflow-y: auto; padding: 22px 16px 60px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.dv-page { margin: 0; width: min(794px, 100%); }
.dv-page img { width: 100%; display: block; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.dv-page figcaption, .dv-cap { color: #c9ced4; font-size: 12px; text-align: center; margin-top: 6px; }
.dv-sheet-wrap { display: flex; flex-direction: column; align-items: center; }
.dv-sheet { width: 210mm; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.dv-sheet .pdf { position: relative; min-height: 297mm; padding-bottom: 18mm; }
.dv-sheet .pdf-head, .dv-sheet .pdf-wv { position: absolute; }
.dv-sheet .pdf-foot { position: absolute; top: auto; bottom: 0; }
.dv-sheet .pdf-frame thead, .dv-sheet .pdf-frame tfoot { display: table-header-group; }
.dv-sheet .pdf-frame tfoot { display: table-footer-group; }
@media (max-width: 640px) { .dv-info { display: none; } .dv-acts { margin-left: 0; width: 100%; } .dv-acts .btn { flex: 1; } }

/* ---------- Portal: composição (capas antes, anexos depois) ---------- */
.pt-docs { display: flex; flex-direction: column; gap: 18px; margin: 0 0 30px; }
.pt-docs#pq-after { margin: 34px 0 0; }
.pt-docpage { margin: 0; }
.pt-docpage img { width: 100%; display: block; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.14); background: #fff; }
.qb-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dv-bar .btn-light { color: var(--text); }

/* ---------- Páginas geradas para "Baixar PDF" (fora da tela) ---------- */
.pgs { position: fixed; left: -12000px; top: 0; pointer-events: none; }
.pg { width: 210mm; height: 297mm; position: relative; overflow: hidden; background: #fff; margin-bottom: 4mm; }
.pg .pdf-wv { position: absolute; top: 8mm; }
.pg .pdf-head { position: absolute; top: 8mm; }
.pg .pdf-foot { position: absolute; top: 270mm; bottom: auto; }
.pg-body { position: absolute; top: 40mm; left: 0; right: 0; height: 228mm; padding: 0 14mm; overflow: hidden; }
.pg-body > *:first-child { margin-top: 0; }
.pg-num { position: absolute; top: 287mm; right: 14mm; font: 9pt Lato, Arial, sans-serif; color: #666; }
.spin.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: middle; border-color: rgba(255,255,255,.4); border-top-color: #fff; }

/* ---------- Pesquisa de preços ---------- */
.mk-page { max-width: 1240px; margin: 0 auto; padding: 16px; }
.mk-modal .modal.wide { width: min(1100px, 96vw); }
.mk-top { display: flex; gap: 8px; margin-bottom: 10px; }
.mk-top .inp { flex: 1; font-size: 15px; padding: 8px 10px; }
.mk-src, .mk-links { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.mk-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 14px; padding: 2px 10px; cursor: pointer; background: var(--card); }
.mk-chip.off { opacity: .55; cursor: not-allowed; }
.mk-chip small { background: var(--warn); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; }
.mk-cfg { margin-left: 4px; }
.mk-store { border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; text-decoration: none; background: var(--card); }
.mk-store:hover { border-color: var(--brand); }
.mk-store.dis { color: var(--muted); }
.mk-status { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 8px 0; }
.mk-status .err { color: var(--danger); }
.mk-status .spin.sm { border-color: var(--brand-l); border-top-color: var(--brand); }
.mk-grid { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.mk-page .mk-grid { max-height: none; }
.mk-card { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--card); }
.mk-img { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; overflow: hidden; color: var(--muted); }
.mk-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mk-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-title { font-weight: 600; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-title:hover { color: var(--brand); text-decoration: underline; }
.mk-info small { color: var(--muted); }
.mk-price { text-align: right; display: flex; flex-direction: column; white-space: nowrap; }
.mk-price b { font-size: 16px; }
.mk-act { display: flex; flex-direction: column; gap: 4px; }
.btn.s { padding: 4px 10px; font-size: 13px; }
@media (max-width: 640px) { .mk-card { grid-template-columns: 56px 1fr; } .mk-img { width: 56px; height: 56px; } .mk-price { text-align: left; } .mk-act { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }
.ln-src { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ln-src .btn-link { font-size: 12px; padding: 0; }
.mk-quotes td { vertical-align: top; }
/* Integrações */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.ig-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--card); }
.ig-card.on { border-color: var(--ok); }
.ig-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ig-card .field { grid-template-columns: 1fr; }
.ig-card input[type=text], .ig-card input[type=password] { width: 100%; }
.ig-test { font-size: 12px; margin: 6px 0; }
.ig-test.ok { color: var(--ok); } .ig-test.err { color: var(--danger); }
.ig-btns { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ig-stores input.inp { width: 100%; }
/* Catálogo de fornecedores */
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin: 14px 0; }
.sup-log { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 12px; }
.sup-stock.in { color: var(--ok); }
.sup-stock.out { color: var(--danger); font-weight: 600; }
.sup-box { border-left: 4px solid var(--ok); background: var(--bg); padding: 8px 12px; margin: 12px 0; border-radius: 4px; }
.sup-box.out { border-left-color: var(--danger); }
.sup-desc { margin: 8px 0 16px; }
.sup-desc summary { cursor: pointer; color: var(--brand); }
.sup-desc > div { max-height: 320px; overflow: auto; font-size: 13px; padding: 8px 0; }
/* Seleção de produtos: lista com fotos e janela com filtros */
.m2o-dd.thumbs { min-width: 420px !important; max-width: 92vw; }
.m2o-dd.thumbs button { display: flex; align-items: center; gap: 8px; }
.m2o-dd .dd-img { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 4px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.m2o-dd .dd-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.m2o-dd .dd-t { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.m2o-dd .dd-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m2o-dd button.more { color: var(--brand); font-weight: 600; border-top: 1px solid var(--border); }
.spin.sm.dark { border-color: var(--brand-l); border-top-color: var(--brand); }
.pk-modal .modal.wide { width: min(1240px, 97vw); }
.pk { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; min-height: 60vh; }
.pk-side { border-right: 1px solid var(--border); padding-right: 12px; max-height: 70vh; overflow-y: auto; }
.pk-facet { margin-bottom: 14px; display: flex; flex-direction: column; gap: 2px; }
.pk-facet > b { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; margin-bottom: 4px; }
.pk-facet > button { display: flex; justify-content: space-between; gap: 8px; background: none; border: 0; padding: 4px 8px; border-radius: 4px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.pk-facet > button:hover:not(:disabled) { background: var(--brand-l); }
.pk-facet > button.on { background: var(--brand); color: #fff; }
.pk-facet > button.on small { color: #fff; }
.pk-facet > button:disabled { opacity: .4; cursor: default; }
.pk-facet > button small { color: var(--muted); }
.pk-facet label { display: flex; gap: 6px; align-items: center; font-size: 13px; padding: 2px 0; }
.pk-facet select { margin-top: 4px; }
.feat-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--text); font-family: inherit; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.add { border-style: dashed; color: var(--muted); }
.chip small { opacity: .7; }
.feat-chips.sm .chip { cursor: default; font-size: 11px; padding: 0 7px; background: var(--bg); }
.pk-main { display: flex; flex-direction: column; min-width: 0; }
.pk-top { display: flex; gap: 8px; }
.pk-top .inp:first-child { flex: 1; font-size: 15px; padding: 8px 10px; }
.pk-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; min-height: 4px; }
.pk-count { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.pk-list { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.pk-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto 130px; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: var(--card); }
.pk-row.in { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.pk-img { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; overflow: hidden; color: var(--muted); }
.pk-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pk-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pk-info small { color: var(--muted); }
.pk-price { text-align: right; display: flex; flex-direction: column; white-space: nowrap; }
.pk-act { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: center; }
.pk-n { font-size: 12px; color: var(--brand); font-weight: 600; }
@media (max-width: 760px) {
  .pk { grid-template-columns: 1fr; }
  .pk-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; max-height: 32vh; }
  .pk-row { grid-template-columns: 56px minmax(0, 1fr); }
  .pk-img { width: 56px; height: 56px; }
  .pk-price { text-align: left; }
  .pk-act { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .m2o-dd.thumbs { min-width: 0 !important; }
}
.pk-top #pk-q { flex: 1 1 auto; width: auto; min-width: 0; }
.pk-top #pk-sort { flex: 0 0 200px; width: 200px; }
@media (max-width: 760px) { .pk-top #pk-sort { flex-basis: 130px; width: 130px; } }

.ig-how { background: var(--bg); border-radius: 4px; padding: 6px 10px; margin: 6px 0 10px; font-size: 13px; }
.ig-how summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.ig-how ol { margin: 8px 0 8px 18px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
