/* Blackline Performance — painel de administração */
:root {
  --red: #E11D2A; --red-dark: #B5121E; --ink: #0B0B0C; --ink-2: #1A1A1D;
  --text: #17171A; --muted: #6B6B73; --line: #E6E6EA; --soft: #F5F5F7; --field: #CFCFD6;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--soft); -webkit-font-smoothing: antialiased; font-size: 14px; }
body.no-scroll { overflow: hidden; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.ico { width: 16px; height: 16px; flex: none; }
code { padding: 1px 6px; border-radius: 3px; background: #EDEDF0; font-size: 12.5px; }

/* marca */
.badge { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--red); color: #fff; transform: skewX(-8deg); flex: none; }
.badge svg { width: 23px; height: 20px; fill: currentColor; transform: skewX(8deg); }
.login__brand, .side__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.login__brand b, .side__brand b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.login__brand small, .side__brand small { display: block; margin-top: 4px; font-size: 8.5px; font-weight: 700; letter-spacing: .4em; color: var(--red); }

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 3px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn--red { background: var(--red); } .btn--red:hover { background: var(--red-dark); }
.btn--dark:hover { background: #26262B; }
.btn--ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn--sm { height: 36px; font-size: 12.5px; }
.btn--block { width: 100%; height: 50px; }
.btn--danger-text { color: var(--red); }
.btn:disabled { opacity: .6; cursor: wait; }
.f { display: block; min-width: 0; }
.f > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
input, select, textarea { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 3px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input[type=checkbox] { width: auto; height: auto; }
.linklike { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* login */
.login { display: grid; grid-template-columns: 420px 1fr; min-height: 100vh; }
.login__side { display: flex; flex-direction: column; justify-content: space-between; padding: 40px; background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.login__side::after { content: ""; position: absolute; right: -120px; bottom: -60px; width: 340px; height: 300px; background: var(--red); transform: skewX(-24deg); opacity: .9; }
.login__side h1 { margin: 0 0 10px; font-size: 34px; font-weight: 900; letter-spacing: -.03em; position: relative; z-index: 1; }
.login__side p { margin: 0; color: rgba(255,255,255,.6); line-height: 1.6; position: relative; z-index: 1; }
.login__foot { font-size: 12px; }
.login__main { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login__form { width: min(380px, 100%); display: grid; gap: 18px; }
.login__form h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.pw { position: relative; display: block; }
.pw input { padding-right: 84px; }
.pw__toggle { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 2px; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--ink); }
.form-err { margin: 0; min-height: 1em; font-size: 13px; font-weight: 600; color: var(--red); }
.form-err:empty { display: none; }
.link-muted { justify-self: start; font-size: 13px; color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--ink); }
.mode-note { margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* layout do painel */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 32px; padding: 24px 16px; background: var(--ink); color: #fff; }
.side__brand { padding: 0 8px; }
.side__nav { display: grid; gap: 2px; }
.side__nav button { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 12px; border: 0; border-radius: 3px; background: none; color: rgba(255,255,255,.65); font-size: 13.5px; font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.side__nav button:hover { color: #fff; background: rgba(255,255,255,.06); }
.side__nav button.is-active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--red); }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 2px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.side__foot { margin-top: auto; display: grid; gap: 4px; padding: 0 4px; }
.side__foot a, .side__foot button { padding: 8px; border: 0; background: none; color: rgba(255,255,255,.6); font-size: 13px; font-weight: 600; text-align: left; text-decoration: none; }
.side__foot a:hover, .side__foot button:hover { color: #fff; }

.main { min-width: 0; padding: 0 32px 60px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; height: 72px; margin: 0 -32px 24px; padding: 0 32px; background: var(--soft); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.top__menu { display: none; width: 40px; height: 40px; border: 0; border-radius: 3px; background: var(--ink); color: #fff; font-size: 18px; }
.save { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.save--saving { color: var(--muted); }
.save--saved { color: #1F7A3F; }
.save--saved::before { content: "● "; }
.save--error { color: var(--red); }
.banner { margin: 0 0 20px; padding: 14px 16px; border-left: 4px solid var(--red); background: #FDF0F1; font-size: 13px; line-height: 1.55; }
.view { display: none; }
.view.is-active { display: block; }
.intro { max-width: 760px; margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.card { margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.card h2 { margin: 0 0 16px; font-size: 15px; font-weight: 800; color: var(--ink); }
.card p { margin: 0 0 14px; line-height: 1.6; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; }
.f--actions { display: flex; align-items: center; gap: 12px; grid-column: 1 / -1; }
.form-msg { font-size: 13px; font-weight: 600; }
.form-msg.is-ok { color: #1F7A3F; } .form-msg.is-err { color: var(--red); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.steps-list { margin: 0; padding-left: 20px; line-height: 1.7; }
.steps-list li { margin-bottom: 6px; }

/* marcações */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1 1 320px; }
.toolbar select { width: auto; min-width: 170px; }
.summary-line { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.table-wrap { border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 12px 14px; border-bottom: 2px solid var(--ink); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--ink); white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: #FAFAFB; }
.tbl tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl .svc { max-width: 260px; color: var(--text); }
.muted { color: var(--muted); font-size: 12.5px; }
.ref { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.plate { display: inline-block; margin-top: 2px; padding: 0 6px; border: 1.5px solid var(--ink); border-radius: 3px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 2px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.pill--novo { background: #FDE8EA; color: var(--red-dark); }
.pill--contactado { background: #FFF3DA; color: #8A5A00; }
.pill--confirmado { background: #E3F4E8; color: #1F7A3F; }
.pill--concluido { background: #ECECEF; color: #3C3C44; }
.pill--cancelado { background: #F3F3F5; color: #8E8E96; text-decoration: line-through; }
.empty { padding: 50px 20px; text-align: center; }
.empty b { display: block; margin-bottom: 6px; font-size: 15px; color: var(--ink); }
.empty p { margin: 0; color: var(--muted); }

/* detalhe */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__bg { position: absolute; inset: 0; background: rgba(8,8,10,.45); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); display: flex; flex-direction: column; background: #fff; transform: translateX(100%); transition: transform .22s ease; }
.drawer__panel.is-in { transform: none; }
.drawer__head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer__head small { font-size: 12px; color: var(--muted); }
.drawer__head h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.x { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 3px; background: #fff; font-size: 22px; line-height: 1; }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer__body > * { flex: none; }
.drawer__body > .btn { align-self: flex-start; }
.status-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--field); border-radius: 3px; overflow: hidden; }
.status-seg button { flex: 1 1 auto; height: 40px; padding: 0 10px; border: 0; background: #fff; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.status-seg button + button { border-left: 1px solid var(--field); }
.status-seg button.on { background: var(--ink); color: #fff; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#dr-details h3 { margin: 6px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
#dr-details dl { margin: 0 0 14px; }
#dr-details dl div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
#dr-details dt { color: var(--muted); }
#dr-details dd { margin: 0; font-weight: 600; color: var(--ink); white-space: pre-wrap; }

/* serviços */
.group__head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin-bottom: 16px; }
.group__tools { display: flex; gap: 6px; }
.icon-btn { height: 40px; min-width: 40px; padding: 0 10px; border: 1px solid var(--field); border-radius: 3px; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn--danger { color: var(--red); }
.icon-btn--danger:hover { border-color: var(--red); }
.svc-list { margin-bottom: 14px; border-top: 2px solid var(--ink); }
.svc-row { display: grid; grid-template-columns: 50px 1.2fr 1.6fr 110px 120px 60px 40px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc-row--head { padding: 8px 0; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.svc-row.is-off .stack, .svc-row.is-off input[type=number] { opacity: .45; }
.svc-row input { height: 36px; font-size: 13px; }
.stack { display: grid; gap: 4px; }
.stack input + input { color: var(--muted); }
.chk { display: grid; place-items: center; }
.chk input { position: absolute; opacity: 0; }
.chk span { width: 20px; height: 20px; border: 1.5px solid #B4B4BC; border-radius: 2px; background: #fff; position: relative; }
.chk input:checked + span { background: var(--red); border-color: var(--red); }
.chk input:checked + span::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.chk input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%); padding: 12px 18px; border-radius: 3px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }

@media (max-width: 1100px) {
  .svc-row { grid-template-columns: 40px 1fr 1fr 90px 100px 50px 36px; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__side { min-height: 220px; padding: 28px 24px; }
  .login__side::after { width: 200px; height: 180px; right: -80px; bottom: -40px; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  body.side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .top__menu { display: block; }
  .main { padding: 0 16px 60px; }
  .top { margin: 0 -16px 18px; padding: 0 16px; }
  .top h1 { font-size: 18px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .group__head { grid-template-columns: 1fr; }
  .toolbar select { flex: 1 1 140px; min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { padding: 3px 0; border: 0; }
  .tbl td[data-l="Recebido"] { font-size: 12px; }
  .tbl tr.is-new { box-shadow: inset 3px 0 0 var(--red); }
  .tbl tr.is-new td:first-child { box-shadow: none; }
  .svc-row--head { display: none; }
  .svc-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; }
  .svc-row > * { grid-column: span 2; }
  .svc-row > [data-l]::before { content: attr(data-l); display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .svc-row > .chk { grid-column: span 1; justify-items: start; }
  .svc-row > .chk::before { margin: 0; }
  .svc-row > [data-l="Preço (MT)"] { grid-column: span 1; }
  #dr-details dl div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- serviços: formulário e lista ---------- */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px; align-items: end; margin-bottom: 16px; }
.f--span2 { grid-column: span 2; }
.f--check { display: flex; align-items: center; gap: 10px; height: 44px; cursor: pointer; }
.f--check input { width: 18px; height: 18px; accent-color: var(--red); }
.f--check span { margin: 0 !important; font-weight: 600 !important; }
.f-label { display: block; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.f-label em { font-style: normal; font-weight: 500; color: var(--muted); }
.card--accent { border-top: 3px solid var(--red); }
.svc-filter { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.svc-filter input { max-width: 340px; }
.svc-row { grid-template-columns: 44px 1.15fr 1.5fr 92px 120px 50px 150px 80px 36px; }
.svc-row--head span:nth-child(7), .svc-row--head span:nth-child(8) { white-space: nowrap; }
.svc-row select { height: 36px; font-size: 12.5px; padding: 0 8px; }
.order { display: flex; gap: 4px; }
.order .icon-btn { height: 34px; min-width: 34px; padding: 0; }
.promo-hint { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--red); }
.pad { padding: 14px 0; margin: 0; }
.svc-row.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: #FFF3DA; } 100% { background: transparent; } }
.group__tools .muted { margin-right: 6px; white-space: nowrap; }
.count--muted { background: #3A3A40; }

/* ---------- promoções ---------- */
.svc-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.svc-picker fieldset { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; }
.svc-picker legend { padding: 0 4px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.svc-picker label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.svc-picker input { width: 16px; height: 16px; accent-color: var(--red); }
.svc-picker em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.svc-picker .is-quote { color: var(--muted); }
.tbl--static tbody tr { cursor: default; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions .icon-btn { height: 32px; margin-left: 4px; font-size: 12px; }

/* ---------- cotação ---------- */
.dr-quote { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 3px; background: var(--soft); }
.dr-quote b { display: block; font-size: 14px; color: var(--ink); }
.qmodal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.qmodal__bg { position: absolute; inset: 0; background: rgba(8,8,10,.55); }
.qmodal__panel { position: relative; display: flex; flex-direction: column; width: min(1000px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-radius: 4px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.qmodal__head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.qmodal__head small { font-size: 12px; color: var(--muted); }
.qmodal__head h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.qmodal__body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.qmodal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--soft); }
.qmodal__foot .muted { flex: 1; font-size: 12px; line-height: 1.4; }
.qgrid { display: grid; grid-template-columns: 2fr 1.2fr .8fr 1fr; gap: 14px; margin-bottom: 18px; }
.qitems { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.qitems th { padding: 8px 6px; border-bottom: 2px solid var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.qitems td { padding: 6px; border-bottom: 1px solid var(--line); }
.qitems .num { text-align: right; width: 120px; }
.qitems td.num input { text-align: right; }
.qitems td:nth-child(2) { width: 80px; }
.qitems input { height: 38px; font-size: 13.5px; }
.qitems .line-total { font-weight: 700; white-space: nowrap; }
.qitems td:last-child { width: 44px; }
.qadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.qadd select { width: auto; min-width: 280px; height: 36px; font-size: 13px; }
.qbottom { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.qtotals { display: grid; gap: 10px; align-content: start; }
.f--inline { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.f--inline > span { margin: 0 !important; }
.f--inline input, .f--inline select { height: 38px; }
#q-sum { margin: 6px 0 0; border-top: 1px solid var(--line); }
#q-sum div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
#q-sum dt { color: var(--muted); } #q-sum dd { margin: 0; font-weight: 700; }
#q-sum .grand { margin-top: 4px; padding: 12px 14px; background: var(--red); color: #fff; }
#q-sum .grand dt, #q-sum .grand dd { color: #fff; font-size: 16px; font-weight: 900; }
@media (max-width: 1200px) { .svc-row { grid-template-columns: 40px 1fr 1fr 80px 100px 44px 120px 76px 34px; } }
@media (max-width: 860px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .svc-row > [data-l="Categoria"], .svc-row > .order { grid-column: span 1; }
  .qmodal { padding: 0; place-items: stretch; }
  .qmodal__panel { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .qmodal__head { padding: 14px 16px 12px; }
  .qmodal__head h2 { font-size: 19px; }
  .qmodal__body { padding: 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .qgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .qgrid > :first-child { grid-column: 1 / -1; }
  .qbottom { grid-template-columns: 1fr; gap: 16px; }
  .qitems, .qitems tbody { display: block; }
  .qitems thead { display: none; }
  .qitems tr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 36px; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .qitems td { display: block; padding: 0; border: 0; width: auto !important; min-width: 0; }
  .qitems td:first-child { grid-column: 1 / -1; }
  .qitems .line-total { align-self: center; font-size: 12.5px; }
  .qitems td:last-child .icon-btn { width: 36px; padding: 0; }
  .qadd .btn { flex: 1 1 auto; }
  .qadd select { min-width: 0; width: 100%; }
  .f--inline { grid-template-columns: 1fr; gap: 6px; }
  .qmodal__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .qmodal__foot .muted { grid-column: 1 / -1; font-size: 11.5px; }
  .qmodal__foot .btn { width: 100%; min-width: 0; padding: 0 10px; }
  .qmodal__foot #q-send { grid-column: 1 / -1; }
  .dr-quote { flex-direction: column; align-items: stretch; }
}

/* ---------- subopções no painel ---------- */
.svc-opts { margin: -4px 0 10px 44px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 3px; background: #FCFCFD; }
.svc-opts summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink); list-style: none; }
.svc-opts summary::-webkit-details-marker { display: none; }
.svc-opts summary::before { content: "▸"; color: var(--red); }
.svc-opts[open] summary::before { content: "▾"; }
.svc-opts summary b { font-weight: 600; color: var(--muted); }
.svc-opts summary em { font-style: normal; font-weight: 600; color: var(--muted); margin-left: auto; }
.svc-opts__body { display: grid; gap: 10px; padding: 0 14px 14px; }
.svc-opts__body > p { margin: 0; font-size: 12px; line-height: 1.5; }
.svc-opts__body .f--inline { grid-template-columns: 170px minmax(0, 360px); }
.svc-opts__body > .btn { justify-self: start; }
.opt-row { display: grid; grid-template-columns: 44px 1.2fr 1.6fr 120px 80px 36px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.opt-row--head { border-top: 0; padding: 0; font-size: 11px; font-weight: 700; color: var(--muted); }
.opt-row input { height: 36px; font-size: 13px; }
.opt-row.is-off { opacity: .5; }
.opt-hint { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.svc-row input:disabled { background: var(--soft); color: var(--muted); }
.dr-notes { padding: 12px 14px; border-left: 3px solid var(--red); background: var(--soft); font-size: 13.5px; line-height: 1.6; white-space: pre-line; color: var(--ink); }
.pre { white-space: pre-line; }
.q-showvat { height: auto; font-size: 12.5px; }
.q-vathelp { margin: 0; font-size: 12px; line-height: 1.5; }
@media (max-width: 860px) {
  .svc-opts { margin: 0 0 12px; }
  .svc-opts__body .f--inline { grid-template-columns: 1fr; }
  .opt-row--head { display: none; }
  .opt-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; }
  .opt-row > * { grid-column: span 2; }
  .opt-row > [data-l]::before { content: attr(data-l); display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .opt-row > .chk { grid-column: span 1; justify-items: start; }
  .opt-row > [data-l="Preço (MT)"] { grid-column: span 1; }
  .opt-row > .order { grid-column: span 1; }
  .opt-row > [data-odel] { grid-column: span 1; justify-self: end; }
}
/* telemóvel: repõe a lista de serviços em cartão (as regras de ecrã largo acima sobrepunham-se) */
@media (max-width: 860px) {
  .svc-list .svc-row { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 16px 0; }
  .svc-list .svc-row > * { grid-column: span 2; min-width: 0; }
  .svc-list .svc-row > .chk,
  .svc-list .svc-row > [data-l="Duração"],
  .svc-list .svc-row > [data-l="Preço (MT)"],
  .svc-list .svc-row > [data-l="Categoria"],
  .svc-list .svc-row > .order { grid-column: span 1; }
  .svc-list .svc-row > .chk { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
  .svc-list .svc-row > .chk::before { margin: 0; order: 2; }
  .svc-list .svc-row > [data-sdel] { grid-column: span 2; justify-self: end; width: auto; padding: 0 14px; }
  .svc-list .svc-row > [data-sdel]::after { content: " Apagar serviço"; font-size: 12px; font-weight: 700; }
  .svc-list .svc-row select, .svc-list .svc-row input { width: 100%; }
  .main, .view, .card { min-width: 0; }
}
@media (max-width: 560px) {
  .qmodal__foot .muted { display: none; }
}

.dr-quote__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-quote__btns .btn { flex: 1 1 auto; }
