/* Telas Serviços (cadastro) e Vendas de serviços: estilos próprios, copiados do desenho da lista e do formulário de
   produtos (mesma estrutura no original) e ajustados às capturas servicos, servico-novo, vendas-servicos e
   venda-servico-nova. Prefixo service-, para não depender do produtos.css. */
/* Medidas tiradas da referência de 1440 × 900 (captura em escala 2). Cores do relatório de fidelidade visual. */

#view-root:is([data-view='services'], [data-view='service-sales']) {
  --service-dark: #0f1921;
  --service-line: #d9dee2;
  --service-head: #f6f6f6;
  --service-alt: #f3f3f3;
  --service-text: #262b2f;
  --service-muted: #6b7177;
  font-family: 'Source Sans Pro', 'Source Sans 3', system-ui, sans-serif;
  color: var(--service-text);
}


.service-screen { display: flex; flex-direction: column; gap: 14px; }
.service-icon { display: inline-flex; width: 1em; height: 1em; line-height: 1; flex: none; }
.service-icon svg { display: block; width: 100%; height: 100%; }

/* Barra da lista: Adicionar e Mais ações à esquerda, busca à direita. */
.service-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.service-toolbar-start { display: flex; gap: 4px; align-items: center; }
.service-add, .service-submit {
  display: inline-flex; align-items: center; gap: 6px;
  height: 37px; padding: 0 12px; border: 1px solid var(--service-dark); border-radius: 3px;
  background: var(--service-dark); color: #fff; font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.service-add .service-icon { font-size: 15px; }
.service-add:hover, .service-submit:hover { background: #1f2d38; }
.service-outline {
  display: inline-flex; align-items: center; gap: 6px;
  height: 37px; padding: 0 12px; border: 1px solid var(--service-dark); border-radius: 3px;
  background: #fff; color: var(--service-text); font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.service-outline:disabled { cursor: not-allowed; opacity: 0.55; }
.service-more { position: relative; }
.service-more > summary { list-style: none; }
.service-more > summary::-webkit-details-marker { display: none; }
.service-caret { width: 0; height: 0; margin-left: 4px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; }
.service-menu {
  position: absolute; z-index: 20; top: calc(100% + 2px); left: 0; min-width: 260px; margin: 0; padding: 4px 0;
  list-style: none; background: #fff; border: 1px solid var(--service-line); border-radius: 3px; box-shadow: 0 6px 16px rgb(15 25 33 / 12%);
}
.service-menu button {
  display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 14px; border: 0; background: none; color: var(--service-text); font-family: inherit; font-weight: 400; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer;
}
.service-menu button:hover:not(:disabled) { background: var(--service-alt); }
.service-menu button:disabled { color: var(--service-muted); cursor: not-allowed; }
.service-menu small { font-size: 11px; color: var(--service-muted); }

.service-search { display: flex; align-items: center; gap: 4px; }
.service-search input {
  width: 237px; height: 37px; min-height: 37px; padding: 0 12px; border: 1px solid #cfd4d8; border-radius: 3px 0 0 3px;
  font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; color: var(--service-text); background: #fff;
}
.service-square {
  display: inline-grid; place-items: center; width: 39px; height: 37px; border: 1px solid #cfd4d8; border-radius: 3px;
  background: #fff; color: var(--service-text); font-size: 16px; cursor: pointer;
}
.service-search input + .service-square { margin-left: -4px; border-radius: 0; }
.service-search .service-view-mode > .service-square { margin-right: 0; }
.service-square.dark { border-color: var(--service-dark); background: var(--service-dark); color: #fff; }
.service-square:disabled { cursor: not-allowed; }
.service-square:not(.dark):disabled { opacity: 0.85; }

/* Tabela da lista. */
.service-table-wrap { overflow-x: auto; border: 1px solid var(--service-line); border-radius: 4px; background: #fff; }
.service-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.service-table th {
  height: 46px; padding: 0 12px; background: var(--service-head); border-bottom: 1px solid var(--service-line);
  font-weight: 600; text-align: left; color: var(--service-text);
}
.service-table td { height: 53px; padding: 0 12px; border-top: 1px solid var(--service-line); vertical-align: middle; overflow-wrap: anywhere; }
.service-table th + th, .service-table td + td { border-left: 1px solid var(--service-line); }
.service-table tbody tr:nth-child(even) td { background: var(--service-alt); }
.service-table tbody tr:first-child td { border-top: 0; }
.service-col-code { width: 22.3%; }
.service-col-name { width: 33.4%; }
.service-col-value { width: 8.2%; }
.service-col-stock { width: 8.2%; }
.service-col-date { width: 15.8%; }
.service-col-actions { width: 12.1%; }
.service-list .service-table th:last-child { text-align: center; }
.service-row-actions > div { display: flex; justify-content: center; gap: 4px; }
.service-row-button {
  display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0;
  border: 1px solid var(--service-line); border-radius: 3px; background: #fff; color: var(--service-text);
  font-size: 13px; cursor: pointer; list-style: none; box-shadow: 0 1px 1px rgb(0 0 0 / 6%);
}
.service-row-button::-webkit-details-marker { display: none; }
.service-row-button:hover { border-color: #aeb6bd; }
.service-row-menu { position: relative; }
.service-row-menu .service-menu { left: auto; right: 0; min-width: 220px; }
.service-count { margin: 0; font-size: 14px; color: var(--service-muted); }
.service-count strong { font-weight: 600; color: var(--service-text); }
.service-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.service-pagination ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.service-pagination a, .service-page-gap {
  display: inline-grid; place-items: center; min-width: 38px; height: 36px; padding: 0 10px; margin-left: -1px;
  border: 1px solid #cfd4d8; background: #fff; color: var(--service-text); font-size: 15px; text-decoration: none;
}
.service-pagination li:first-child a { border-radius: 3px 0 0 3px; margin-left: 0; }
.service-pagination li:last-child a, .service-pagination li:last-child.service-page-gap { border-radius: 0 3px 3px 0; }
.service-pagination a:hover { background: var(--service-alt); }
.service-pagination a.is-current { background: var(--service-dark); border-color: var(--service-dark); color: #fff; }
.service-page-gap { color: var(--service-muted); }
/* "Por página" fica no botão de modo de exibição, como na referência. */
.service-view-mode { position: relative; }
.service-view-mode > summary { list-style: none; cursor: pointer; }
.service-view-mode > summary::-webkit-details-marker { display: none; }
.service-per-page { display: flex; align-items: center; gap: 8px; min-width: 190px; padding: 8px 12px; left: auto; right: 0; }
.service-per-page label { font-size: 14px; color: var(--service-muted); }
.service-per-page select { height: 32px; padding: 0 8px; border: 1px solid #cfd4d8; border-radius: 3px; font-family: inherit; font-size: 15px; background: #fff; }
.service-search .service-view-mode + input { border-radius: 0; }

.service-detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; }

/* Formulário: abas verticais à esquerda e caixas à direita. */
.service-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 31px; align-items: start; }
.service-tabs { display: flex; flex-direction: column; gap: 6px; }
.service-tab {
  display: flex; align-items: center; gap: 14px; min-height: 51px; padding: 8px 14px 8px 16px;
  border: 1px solid var(--service-line); border-radius: 3px; background: #fff; color: var(--service-text);
  font-family: inherit; text-align: left; cursor: pointer;
}
.service-tab .service-icon { font-size: 20px; color: #4a5258; }
.service-tab strong { display: block; font-size: 15px; font-weight: 400; line-height: 1.25; }
.service-tab small { display: block; font-size: 12px; line-height: 1.3; color: var(--service-muted); }
.service-tab[aria-selected='true'] { border-color: var(--service-dark); background: var(--service-dark); color: #fff; }
.service-tab[aria-selected='true'] .service-icon, .service-tab[aria-selected='true'] small { color: #e6e9eb; }
.service-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.service-boxes { display: flex; flex-direction: column; gap: 16px; }
.service-boxes[hidden] { display: none; }
.service-box { border: 1px solid var(--service-line); border-radius: 4px; background: #fff; }
.service-box-head { padding: 14px 20px 13px; background: var(--service-head); border-bottom: 1px solid var(--service-line); border-radius: 4px 4px 0 0; }
.service-box-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 20px; font-weight: 400; color: var(--service-text); }
.service-box-head h2 strong { font-weight: 600; }
.service-box-head h2 .service-icon { font-size: 16px; color: #555d63; }
.service-box-head p { margin: 4px 0 0; font-size: 12px; color: #4a5258; }
.service-box-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 11px; }
.service-span-2 { grid-column: span 2; }
.service-span-3 { grid-column: span 3; }
.service-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.service-label { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--service-muted); }
.service-required { color: #e0352b; }
.service-tip { display: inline-flex; font-size: 12px; color: #262b2f; cursor: help; }
.service-field input, .service-field select, .service-field textarea, .service-prices input {
  width: 100%; min-height: 37px; padding: 0 12px; border: 1px solid #cfd4d8; border-radius: 3px;
  background: #fff; color: var(--service-text); font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1.2;
}
.service-field textarea { padding: 8px 12px; min-height: 74px; }
.service-field :is(input, select, textarea):disabled { background: #f1f2f3; color: #7d858b; cursor: not-allowed; }
.service-field input[readonly] { background: #f6f6f6; }
.service-input-group { display: flex; }
.service-input-group > :first-child { flex: 1; min-width: 0; border-radius: 3px 0 0 3px; }
.service-addon {
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 37px; padding: 0 14px;
  border: 1px solid #cfd4d8; border-left: 0; border-radius: 0 3px 3px 0; background: #f6f6f6; color: var(--service-text);
  font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; cursor: pointer;
}
.service-addon.plain { background: #fff; color: #555d63; }
.service-addon:disabled { cursor: not-allowed; color: #7d858b; }
.service-pending { margin: 0; font-size: 11px; color: #9a6a00; }
.service-field.is-pending { cursor: not-allowed; }
.service-field.is-pending .service-label { color: #8a9197; }
.service-field input[type='file']:disabled { padding: 6px 12px; }
.service-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; color: #4a5258; }
.service-switch input { position: absolute; opacity: 0; pointer-events: none; }
.service-switch-track { position: relative; width: 28px; height: 16px; border: 1px solid #b9c0c5; border-radius: 9px; background: #e9ecef; }
.service-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #9aa2a8; }
.service-switch.is-pending { opacity: 0.75; cursor: not-allowed; }
.service-unit { max-width: 356px; }
.service-prices td { height: 50px; }
.service-prices td:nth-child(4) { width: 22%; }
#view-root[data-view='services'] .service-prices td:nth-child(1) { width: 18%; }
#view-root[data-view='services'] .service-prices output { font-variant-numeric: tabular-nums; }
.service-inline-actions { display: flex; gap: 6px; }
.service-actions { display: flex; justify-content: space-between; align-items: center; }
.service-cancel { border-color: #cfd4d8; height: 36px; }
.service-submit { height: 36px; font-size: 16px; }

@media (max-width: 900px) {
  .service-layout { grid-template-columns: 1fr; }
  .service-tabs { flex-direction: row; overflow-x: auto; }
  .service-tab { min-width: 180px; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-search input { width: 100%; }
  .service-search { flex: 1; }
}
@media (max-width: 560px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-span-2, .service-span-3 { grid-column: auto; }
}

/* Ícone e nome no título da lista. */
.service-title-icon { display: inline-flex; width: 24px; height: 24px; margin-right: 4px; vertical-align: -4px; color: #262b2f; }
.service-title-icon .service-icon { font-size: 24px; }
a.service-row-button { text-decoration: none; }
.service-row-button.is-danger { color: #d9352b; }
.service-row-button:disabled { cursor: not-allowed; opacity: 0.75; }
.service-sort { color: inherit; text-decoration: none; }
.service-sort:hover { text-decoration: underline; }
.service-col-code { width: 17.4%; }
.service-col-name { width: 39.2%; }
.service-col-cost { width: 16.4%; }
.service-col-price { width: 17.1%; }
.service-col-actions { width: 10%; }
.service-table .service-name { font-weight: 400; }
.service-table td.service-row-actions { text-align: center; }

/* Formulário: grade de 12 colunas, dica sob o campo e complemento do campo com R$ ou %. */
.service-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 30px; }
.service-label { line-height: 1.2; }
.service-box-body { padding: 20px 20px 19px; }
.service-main { min-width: 0; }
.service-span-3 { grid-column: span 3; }
.service-span-4 { grid-column: span 4; }
.service-span-5 { grid-column: span 5; }
.service-hint { font-size: 12px; color: var(--service-muted); line-height: 1.25; }
.service-input-group { display: flex; }
.service-input-group > input { flex: 1; min-width: 0; border-radius: 0; }
.service-input-group > input:first-child { border-radius: 3px 0 0 3px; }
.service-input-group > input:last-child { border-radius: 0 3px 3px 0; }
.service-addon.is-before { border: 1px solid #cfd4d8; border-right: 0; border-radius: 3px 0 0 3px; padding: 0 12px; }
.service-input-group > .service-addon:not(.is-before):not(.is-button) { border-radius: 0 3px 3px 0; border-left: 0; }
.service-input-group > input + .service-addon { border-left: 1px solid #cfd4d8; }
.service-addon { display: inline-flex; align-items: center; flex: none; height: 37px; padding: 0 14px; border: 1px solid #cfd4d8; border-left: 0; background: #f6f6f6; color: var(--service-text); font-size: 16px; }
.service-addon.is-button { border-radius: 0 3px 3px 0; cursor: pointer; font-family: inherit; }
.service-addon.is-before + input { border-radius: 0 3px 3px 0; }
.service-field input[name='internalCode'] { border-radius: 3px 0 0 3px; }
.service-detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; }
.service-pending { margin: 0; font-size: 11px; color: #9a6a00; }

/* Vendas de serviços: mês em botão escuro com seta, estado vazio e tabela. */
.service-search .service-month { position: relative; margin-left: 0; }
.service-month > summary { list-style: none; cursor: pointer; }
.service-month > summary::-webkit-details-marker { display: none; }
.service-month-button {
  display: inline-flex; align-items: center; gap: 6px; height: 37px; padding: 0 16px; border: 1px solid var(--service-dark); border-radius: 3px;
  background: var(--service-dark); color: #fff; font-family: inherit; font-size: 16px; line-height: 1;
}
.service-month .service-menu { left: auto; right: 0; min-width: 200px; }
.service-menu a { display: block; padding: 7px 14px; color: var(--service-text); font-size: 14px; text-decoration: none; }
.service-menu a:hover { background: var(--service-alt); }
.service-sales-list .service-search { display: flex; align-items: center; gap: 4px; }
.service-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px 32px;
  border: 1px solid var(--service-line); border-radius: 4px; background: #fff; text-align: center;
}
.service-empty-icon { display: grid; place-items: center; width: 69px; height: 69px; margin-bottom: 10px; border: 1px solid var(--service-line); border-radius: 50%; background: #f1f2f3; color: #4a5258; font-size: 28px; }
.service-empty h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--service-text); }
.service-empty p { margin: 0 0 8px; font-size: 14px; color: var(--service-muted); }
.service-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.service-sales-table th, .service-sales-table td { width: auto; }
.service-sales-table th:last-child, .service-sales-table td:last-child { width: 90px; text-align: center; }

/* Venda de serviços: a tabela de linhas não tem coluna Tipo, como na referência. */
.service-sale-form .saleform-table .col-type { display: none; }

/* Leva 3 (grupo G2): medidas da captura da lista de serviços (colunas, texto de 14 px, botões de 41 px). */
#view-root[data-view='services'] .service-table { font-size: 14px; }
#view-root[data-view='services'] .service-col-code { width: 17.9%; }
#view-root[data-view='services'] .service-col-name { width: 37.4%; }
#view-root[data-view='services'] .service-col-cost { width: 17%; }
#view-root[data-view='services'] .service-col-price { width: 17.5%; }
#view-root[data-view='services'] .service-col-actions { width: 10.1%; }
#view-root[data-view='services'] .service-add { padding: 0 13px; gap: 3px; }
#view-root[data-view='services'] .service-more > summary { padding: 0 12px; gap: 5px; }
#view-root[data-view='services'] .service-caret { margin-left: 3px; border-left-width: 4px; border-right-width: 4px; border-top-width: 5px; }
#view-root[data-view='services'] .service-search input { width: 238px; height: 38px; min-height: 38px; }
#view-root[data-view='services'] .service-search .service-square { width: 41px; height: 38px; }
#view-root[data-view='services'] .service-search .service-view-mode > .service-square { width: 42px; }
#view-root[data-view='services'] .service-tab small { font-size: 11px; line-height: 1.25; }
#view-root[data-view='services'] .service-tab strong { font-size: 14px; }
#view-root[data-view='services'] .service-box-head p { font-size: 11px; }
#view-root[data-view='services'] .service-field small { font-size: 11px; }
#view-root[data-view='services'] .service-input-group > .service-addon.is-before { flex: 0 0 42px; width: 42px; padding: 0; justify-content: center; background: #fff; border-radius: 3px 0 0 3px; }
#view-root[data-view='services'] .service-input-group > .service-addon.is-before + input { flex: 1 1 auto; min-width: 0; }
#view-root[data-view='services'] .service-hint { font-size: 11px; }

/* Botão "Adicionar venda" do estado vazio das vendas de serviços: o sinal de mais ficava escuro sobre o círculo escuro. */
.service-outline .service-icon path[d^="M11 6h2"] { fill: #fff; }
