/* Telas Funcionários e Transportadoras (Cadastros): lista e formulário em caixas, no desenho das capturas
   funcionarios, funcionario-novo, transportadoras e transportadora-nova. Prefixo reg-. Medidas da janela
   de 1440 × 900 (captura em escala 2). */
#view-root:is([data-view='employees'], [data-view='carriers']) {
  --reg-dark: #0f1921;
  --reg-line: #d9dee2;
  --reg-head: #f6f6f6;
  --reg-alt: #f3f3f3;
  --reg-text: #262b2f;
  --reg-muted: #6b7177;
  font-family: 'Source Sans Pro', 'Source Sans 3', system-ui, sans-serif;
  color: var(--reg-text);
}
.reg-screen { display: flex; flex-direction: column; gap: 14px; }
.reg-icon { display: inline-flex; width: 1em; height: 1em; line-height: 1; flex: none; }
.reg-icon svg { display: block; width: 100%; height: 100%; }
/* Barra da lista: Adicionar e Mais ações à esquerda, busca à direita. */
.reg-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.reg-toolbar-start { display: flex; gap: 4px; align-items: center; }
.reg-add, .reg-submit {
  display: inline-flex; align-items: center; gap: 6px;
  height: 37px; padding: 0 12px; border: 1px solid var(--reg-dark); border-radius: 3px;
  background: var(--reg-dark); color: #fff; font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.reg-add .reg-icon { font-size: 15px; }
.reg-add:hover, .reg-submit:hover { background: #1f2d38; }
.reg-outline {
  display: inline-flex; align-items: center; gap: 6px;
  height: 37px; padding: 0 12px; border: 1px solid var(--reg-dark); border-radius: 3px;
  background: #fff; color: var(--reg-text); font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
}
.reg-outline:disabled { cursor: not-allowed; opacity: 0.55; }
.reg-more { position: relative; }
.reg-more > summary { list-style: none; }
.reg-more > summary::-webkit-details-marker { display: none; }
.reg-caret { width: 0; height: 0; margin-left: 4px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; }
.reg-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(--reg-line); border-radius: 3px; box-shadow: 0 6px 16px rgb(15 25 33 / 12%);
}
.reg-menu button {
  display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 14px; border: 0; background: none; color: var(--reg-text); font-family: inherit; font-weight: 400; font-size: 14px; line-height: 1.3; text-align: left; cursor: pointer;
}
.reg-menu button:hover:not(:disabled) { background: var(--reg-alt); }
.reg-menu button:disabled { color: var(--reg-muted); cursor: not-allowed; }
.reg-menu small { font-size: 11px; color: var(--reg-muted); }
.reg-search { display: flex; align-items: center; gap: 4px; }
.reg-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(--reg-text); background: #fff;
}
.reg-square {
  display: inline-grid; place-items: center; width: 39px; height: 37px; border: 1px solid #cfd4d8; border-radius: 3px;
  background: #fff; color: var(--reg-text); font-size: 16px; cursor: pointer;
}
.reg-search input + .reg-square { margin-left: -4px; border-radius: 0; }
.reg-search .reg-view-mode > .reg-square { margin-right: 0; }
.reg-square.dark { border-color: var(--reg-dark); background: var(--reg-dark); color: #fff; }
.reg-square:disabled { cursor: not-allowed; }
.reg-square:not(.dark):disabled { opacity: 0.85; }
.reg-col-code { width: 22.3%; }
.reg-col-name { width: 33.4%; }
.reg-col-value { width: 8.2%; }
.reg-col-stock { width: 8.2%; }
.reg-col-date { width: 15.8%; }
.reg-col-actions { width: 12.1%; }
.reg-row-actions > div { display: flex; justify-content: center; gap: 4px; }
.reg-row-button {
  display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0;
  border: 1px solid var(--reg-line); border-radius: 3px; background: #fff; color: var(--reg-text);
  font-size: 13px; cursor: pointer; list-style: none; box-shadow: 0 1px 1px rgb(0 0 0 / 6%);
}
.reg-row-button::-webkit-details-marker { display: none; }
.reg-row-button:hover { border-color: #aeb6bd; }
.reg-row-menu { position: relative; }
.reg-row-menu .reg-menu { left: auto; right: 0; min-width: 220px; }
.reg-count { margin: 0; font-size: 14px; color: var(--reg-muted); }
.reg-count strong { font-weight: 600; color: var(--reg-text); }
.reg-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.reg-pagination ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.reg-pagination a, .reg-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(--reg-text); font-size: 15px; text-decoration: none;
}
.reg-pagination li:first-child a { border-radius: 3px 0 0 3px; margin-left: 0; }
.reg-pagination li:last-child a, .reg-pagination li:last-child.reg-page-gap { border-radius: 0 3px 3px 0; }
.reg-pagination a:hover { background: var(--reg-alt); }
.reg-pagination a.is-current { background: var(--reg-dark); border-color: var(--reg-dark); color: #fff; }
.reg-page-gap { color: var(--reg-muted); }
/* "Por página" fica no botão de modo de exibição, como na referência. */
.reg-view-mode { position: relative; }
.reg-view-mode > summary { list-style: none; cursor: pointer; }
.reg-view-mode > summary::-webkit-details-marker { display: none; }
.reg-per-page { display: flex; align-items: center; gap: 8px; min-width: 190px; padding: 8px 12px; left: auto; right: 0; }
.reg-per-page label { font-size: 14px; color: var(--reg-muted); }
.reg-per-page select { height: 32px; padding: 0 8px; border: 1px solid #cfd4d8; border-radius: 3px; font-family: inherit; font-size: 15px; background: #fff; }
.reg-search .reg-view-mode + input { border-radius: 0; }
.reg-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.reg-box { border: 1px solid var(--reg-line); border-radius: 4px; background: #fff; }
.reg-box-head { padding: 14px 20px 13px; background: var(--reg-head); border-bottom: 1px solid var(--reg-line); border-radius: 4px 4px 0 0; }
.reg-box-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 20px; font-weight: 400; color: var(--reg-text); }
.reg-box-head h2 strong { font-weight: 600; }
.reg-box-head h2 .reg-icon { font-size: 16px; color: #555d63; }
.reg-box-head p { margin: 4px 0 0; font-size: 12px; color: #4a5258; }
.reg-box-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.reg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 11px; }
.reg-span-2 { grid-column: span 2; }
.reg-span-3 { grid-column: span 3; }
.reg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.reg-label { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--reg-muted); }
.reg-required { color: #e0352b; }
.reg-tip { display: inline-flex; font-size: 12px; color: #262b2f; cursor: help; }
.reg-field textarea { padding: 8px 12px; min-height: 74px; }
.reg-field :is(input, select, textarea):disabled { background: #f1f2f3; color: #7d858b; cursor: not-allowed; }
.reg-field input[readonly] { background: #f6f6f6; }
.reg-input-group { display: flex; }
.reg-input-group > :first-child { flex: 1; min-width: 0; border-radius: 3px 0 0 3px; }
.reg-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(--reg-text);
  font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1; cursor: pointer;
}
.reg-addon.plain { background: #fff; color: #555d63; }
.reg-addon:disabled { cursor: not-allowed; color: #7d858b; }
.reg-pending { margin: 0; font-size: 11px; color: #9a6a00; }
.reg-field.is-pending { cursor: not-allowed; }
.reg-field.is-pending .reg-label { color: #8a9197; }
.reg-field input[type='file']:disabled { padding: 6px 12px; }
.reg-actions { display: flex; justify-content: space-between; align-items: center; }
.reg-cancel { border-color: #cfd4d8; height: 36px; }
.reg-submit { height: 36px; font-size: 16px; }


a.reg-row-button { text-decoration: none; }
.reg-row-button.is-danger { color: #d9352b; }
.reg-row-button:disabled { cursor: not-allowed; opacity: 0.75; }
.reg-col-code { width: 17.4%; }
.reg-col-name { width: 39.2%; }
.reg-col-cost { width: 16.4%; }
.reg-col-price { width: 17.1%; }
.reg-col-actions { width: 10%; }
/* Formulário: grade de 12 colunas, dica sob o campo e complemento do campo com R$ ou %. */
.reg-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 30px; }
.reg-label { line-height: 1.2; }
.reg-box-body { padding: 20px 20px 19px; }
.reg-main { min-width: 0; }
.reg-span-3 { grid-column: span 3; }
.reg-span-4 { grid-column: span 4; }
.reg-span-5 { grid-column: span 5; }
.reg-hint { font-size: 12px; color: var(--reg-muted); line-height: 1.25; }
.reg-input-group { display: flex; }
.reg-input-group > input { flex: 1; min-width: 0; border-radius: 0; }
.reg-input-group > input:first-child { border-radius: 3px 0 0 3px; }
.reg-input-group > input:last-child { border-radius: 0 3px 3px 0; }
.reg-addon.is-before { border: 1px solid #cfd4d8; border-right: 0; border-radius: 3px 0 0 3px; padding: 0 12px; }
.reg-input-group > .reg-addon:not(.is-before):not(.is-button) { border-radius: 0 3px 3px 0; border-left: 0; }
.reg-input-group > input + .reg-addon { border-left: 1px solid #cfd4d8; }
.reg-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(--reg-text); font-size: 16px; }
.reg-addon.is-button { border-radius: 0 3px 3px 0; cursor: pointer; font-family: inherit; }
.reg-addon.is-before + input { border-radius: 0 3px 3px 0; }
.reg-field input[name='internalCode'] { border-radius: 3px 0 0 3px; }
.reg-pending { margin: 0; font-size: 11px; color: #9a6a00; }
.reg-menu a { display: block; padding: 7px 14px; color: var(--reg-text); font-size: 14px; text-decoration: none; }
.reg-menu a:hover { background: var(--reg-alt); }


/* Tabela da lista (mesmas medidas da lista de serviços). */
/* Tabela da lista. */
.reg-table-wrap { overflow-x: auto; border: 1px solid var(--reg-line); border-radius: 4px; background: #fff; }
.reg-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.reg-table th {
  height: 46px; padding: 0 12px; background: var(--reg-head); border-bottom: 1px solid var(--reg-line);
  font-weight: 600; text-align: left; color: var(--reg-text);
}
.reg-table td { height: 53px; padding: 0 12px; border-top: 1px solid var(--reg-line); vertical-align: middle; overflow-wrap: anywhere; }
.reg-table th + th, .reg-table td + td { border-left: 1px solid var(--reg-line); }
.reg-table tbody tr:nth-child(even) td { background: var(--reg-alt); }
.reg-table tbody tr:first-child td { border-top: 0; }
.reg-list .reg-table th:last-child { text-align: center; }
.reg-table .reg-name { font-weight: 400; }
.reg-table td.reg-row-actions { text-align: center; }

/* ---- Partes próprias de Funcionários e Transportadoras ---- */
.reg-title-icon { display: inline-flex; width: 24px; height: 24px; margin-right: 4px; vertical-align: -4px; color: #262b2f; }
.reg-title-icon .reg-icon { font-size: 24px; }
.reg-sort { color: inherit; text-decoration: none; }
.reg-sort:hover { text-decoration: underline; }
.reg-detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; }

/* Colunas da lista: larguras vêm do colgroup (em %). */
.reg-table th.reg-center, .reg-table td.reg-center { text-align: center; }
.reg-table th.reg-col-actions { text-align: center; }
.reg-table td.reg-row-actions { text-align: center; }
.reg-table th, .reg-table td { width: auto; }
.reg-table { table-layout: fixed; }
.reg-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-badge {
  display: inline-block; padding: 1px 7px; border: 1px solid #b9c0c5; border-radius: 3px; background: #f1f2f3;
  color: #4a5258; font-size: 11px; font-weight: 600; line-height: 1.5;
}
.reg-badge.is-active { border-color: #2e9d53; background: #eaf7ee; color: #1f7a3d; }
.reg-badge.is-blocked { border-color: #c4cacf; background: #f1f2f3; color: #555d63; }

/* Contagem em duas células, como na referência: "Registros" e "N no total". */
.reg-count { display: inline-flex; margin: 0; border: 1px solid var(--reg-line); border-radius: 3px; background: #fff; font-size: 12px; color: var(--reg-muted); }
.reg-count span { padding: 6px 8px; }
.reg-count span + span { border-left: 1px solid var(--reg-line); }
.reg-count strong { font-weight: 600; color: var(--reg-text); }

/* Formulário em caixas empilhadas. Grade de 12 colunas, campos de 3 colunas por padrão. */
.reg-form { display: flex; flex-direction: column; gap: 16px; }
.reg-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 30px; }
.reg-span-1 { grid-column: span 1; }
.reg-span-2 { grid-column: span 2; }
.reg-span-3 { grid-column: span 3; }
.reg-span-4 { grid-column: span 4; }
.reg-span-5 { grid-column: span 5; }
.reg-span-6 { grid-column: span 6; }
.reg-span-12 { grid-column: 1 / -1; }
.reg-field textarea { min-height: 133px; padding: 8px 12px; resize: vertical; }
.reg-field select { padding-right: 28px; }
.reg-hint { font-size: 12px; color: var(--reg-muted); line-height: 1.25; }
.reg-input-group { display: flex; }
.reg-input-group > input { flex: 1; min-width: 0; border-radius: 3px 0 0 3px; }
.reg-addon { display: inline-flex; align-items: center; height: 37px; padding: 0 12px; border: 1px solid #cfd4d8; border-left: 0; border-radius: 0 3px 3px 0; background: #f6f6f6; color: var(--reg-muted); font-size: 16px; }
.reg-pending { margin: 0; font-size: 11px; color: #9a6a00; }
.reg-field.is-pending .reg-label { color: #8a9197; }

/* Cartão "Permitir acesso ao sistema" (desabilitado: ainda não grava). */
.reg-switch-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--reg-line); border-radius: 4px; background: #fff;
}
.reg-switch-card > .reg-icon { font-size: 22px; color: #4a5258; }
.reg-switch-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.reg-switch-text strong { font-size: 13px; font-weight: 600; color: var(--reg-text); }
.reg-switch-text small { font-size: 11px; color: var(--reg-muted); line-height: 1.3; }
.reg-switch { position: relative; display: inline-flex; flex: none; cursor: not-allowed; }
.reg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.reg-switch-track { position: relative; width: 36px; height: 20px; border: 1px solid #b9c0c5; border-radius: 10px; background: #e9ecef; }
.reg-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9aa2a8; }
.reg-switch-card.is-pending { opacity: 0.85; }

/* Foto e anexos: desabilitados (ainda não gravam). */
.reg-photo { display: flex; align-items: center; gap: 16px; }
.reg-photo-frame {
  display: grid; place-items: center; width: 110px; height: 110px; border: 1px solid var(--reg-line); border-radius: 4px;
  background: #f1f2f3; color: #aab1b6; font-size: 56px;
}
.reg-photo > div:last-child, .reg-attach { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.reg-outline:disabled { cursor: not-allowed; opacity: 0.6; }

/* Endereços adicionados e linhas de contato. */
.reg-entries { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--reg-line); border-radius: 3px; }
.reg-entries[hidden] { display: none; }
.reg-entries li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; font-size: 15px; }
.reg-entries li + li { border-top: 1px solid var(--reg-line); }
.reg-link { padding: 0; border: 0; background: none; color: #c0392b; font-family: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.reg-contacts { display: flex; flex-direction: column; gap: 14px; }
.reg-contacts:empty { display: none; }
.reg-remove-cell { justify-content: flex-end; }
.reg-remove { width: 39px; padding: 0; justify-content: center; }

.reg-box-body > .reg-field { max-width: none; }
.reg-actions { display: flex; justify-content: space-between; align-items: center; }
.reg-cancel { border-color: #cfd4d8; height: 36px; }
.reg-submit { height: 36px; }

@media (max-width: 900px) {
  .reg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg-span-1, .reg-span-2, .reg-span-3, .reg-span-4, .reg-span-5, .reg-span-6 { grid-column: auto; }
  .reg-span-12 { grid-column: 1 / -1; }
  .reg-search input { width: 100%; }
  .reg-search { flex: 1; }
  .reg-table-wrap { overflow-x: auto; }
  .reg-table { min-width: 640px; }
}
@media (max-width: 560px) {
  .reg-grid { grid-template-columns: 1fr; }
}

/* Valores padrão do molde de cadastros para qualquer tela que use reg-*: sem eles o botão Adicionar saía branco sobre
   branco fora de Funcionários e Transportadoras (Agenda, campos extras, tipos). Mesmos valores do bloco do topo. */
#view-root {
  --reg-dark: #0f1921;
  --reg-line: #d9dee2;
  --reg-head: #f6f6f6;
  --reg-alt: #f3f3f3;
  --reg-text: #262b2f;
  --reg-muted: #6b7177;
}
