:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dde3ec;
  --text: #1a2332;
  --muted: #5c6b7f;
  --primary: #1e5aa8;
  --primary-hover: #164a8c;
  --danger: #c0392b;
  --danger-hover: #a93226;
  --success-bg: #e8f5e9;
  --success-text: #2e7d32;
  --error-bg: #fdecea;
  --error-text: #c62828;
  --warning: #e65100;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: min(100%, 1920px);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.brand {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover { color: var(--primary); }

.main { padding: 1.5rem 1.25rem 3rem; }

.footer {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.page-header { margin-bottom: 1.5rem; }

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.muted { color: var(--muted); margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 90, 168, 0.12);
}

.card h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: #eef2f7;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.table tbody tr:hover { background: #fafbfc; }

.col-actions {
  white-space: nowrap;
  width: 1%;
  text-align: right;
}

.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.table-precos {
  table-layout: fixed;
  width: 100%;
  max-width: 42rem;
}

.table-precos col.col-uf { width: 4.5rem; }
.table-precos col.col-preco { width: 11rem; }
.table-precos col.col-acoes { width: 9.5rem; }

.table-precos .cell-uf {
  font-variant-numeric: tabular-nums;
}

.table-precos .input-preco,
.table-precos .input-uf-full {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.table-precos .input-preco:focus,
.table-precos .input-uf-full:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.15);
}

.table-precos-form thead th:last-child {
  border-bottom-color: transparent;
}

.hidden-form {
  display: none;
}

.input-preco-inline {
  width: 7rem;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { background: #f0f3f7; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #eef2f7; }

.btn-danger {
  background: #fff;
  border-color: #f5c6c2;
  color: var(--danger);
}

.btn-danger:hover { background: var(--error-bg); }

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-full { grid-column: 1 / -1; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.15);
}

.field input[readonly] { background: #f5f7fa; color: var(--muted); }

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-bar-wide {
  align-items: flex-end;
}

.input-busca {
  flex: 1;
  min-width: 12rem;
  max-width: 28rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.input-qtd {
  width: 8rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.field-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-inline label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.simulacao-composicao-selecionada {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f5f8fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.simulacao-resumo {
  margin-bottom: 1.5rem;
}

.orcamento-bloco {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.orcamento-bloco-aninhado {
  margin-top: 0.75rem;
  border-left: 3px solid var(--primary);
}

.orcamento-bloco-header {
  margin-bottom: 0.85rem;
}

.orcamento-bloco-titulo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.orcamento-bloco-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.orcamento-bloco-total {
  color: var(--text);
}

.table-orcamento {
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.table-orcamento .orcamento-insumo-desc {
  display: block;
  margin-top: 0.15rem;
}

.col-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.memorial-formula {
  display: block;
  white-space: normal;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  background: #f3f6fa;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

.orcamento-referencia-legenda {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.orcamento-subtotais {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.orcamento-subtotal-destaque {
  color: var(--text);
  font-weight: 600;
}

.table-select tbody tr:hover {
  background: #f0f6ff;
}

.input-uf { width: 4rem; text-transform: uppercase; }

.input-sm {
  width: 6rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
}

.inline-form,
.inline-edit-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.section { margin-top: 2rem; }
.section h2 { font-size: 1.1rem; margin: 0 0 1rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-warning { background: #fff8e6; color: #7a5a00; border: 1px solid #f0d78c; }
.alert-error { background: var(--error-bg); color: var(--error-text); }

.importacao-resultado {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  background: #fafbfc;
}

.importacao-erros {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.importacao-erros h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.text-warning { color: #b45309; }

.stat-card-warning .stat-value {
  color: #b45309;
}

.table-wrap {
  overflow-x: auto;
}

.table-erros .col-trecho {
  min-width: 220px;
  max-width: 420px;
}

.trecho-planilha {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #374151;
  background: #f3f4f6;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

.table-erros .col-erro {
  min-width: 180px;
}

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #eef2f7;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.text-warning { color: var(--warning); font-size: 0.85rem; }

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

code {
  background: #eef2f7;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.row-form { display: contents; }

.code-block {
  background: #1a2332;
  color: #e8ecf1;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 0.5rem 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input[type="file"] {
  padding: 0.35rem 0;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}

.tab {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--primary);
}

.tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.hint-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.hint-list li {
  margin-bottom: 0.35rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.form-grid-actions {
  align-items: end;
}

.field-actions {
  display: flex;
  align-items: flex-end;
}

.progress-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-percent {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 10px;
  background: #e8edf3;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #3d8fd4);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-bar-erro .progress-bar-fill {
  background: linear-gradient(90deg, #c62828, #e57373);
}

.progress-status {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-confirmacao {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: #fff8e1;
  border: 1px solid #ffe082;
}

.progress-log {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.progress-log-line {
  padding: 0.2rem 0;
  border-bottom: 1px solid #f0f3f7;
}

.progress-log-line:last-child {
  border-bottom: none;
}

.log-ok { color: var(--success-text); }
.log-erro { color: var(--error-text); }
.log-aviso { color: var(--warning); }
.log-info { color: var(--muted); }

.btn-warning {
  background: #f9a825;
  color: #1a2332;
  border: none;
}

.btn-warning:hover {
  background: #f57f17;
  color: #fff;
}

@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .row-between { flex-direction: column; }
}

/* —— Editor de orçamento —— */
.orcamento-editor-header {
  margin-bottom: 1rem;
}

.orcamento-editor-campos {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.orcamento-editor-campos .field {
  margin: 0;
}

.orcamento-editor-campos .input-wide {
  min-width: 280px;
}

.orcamento-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.orcamento-editor-status {
  margin-left: auto;
  font-size: 0.85rem;
}

.orcamento-editor-section {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.orcamento-editor-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.orcamento-editor-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.88rem;
  margin: 0;
}

.orcamento-editor-table thead th {
  background: #e8edf3;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orcamento-editor-table td,
.orcamento-editor-table th {
  overflow: hidden;
  vertical-align: middle;
}

.orcamento-editor-table .col-ignorar-cronograma {
  width: 2.5rem;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.ignorar-cronograma-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ignorar-cronograma-label input {
  margin: 0;
  cursor: pointer;
}

.orcamento-editor-table .col-item {
  width: 4.5rem;
  text-align: center;
}

.orcamento-editor-table .col-servicos {
  width: 36%;
}

.orcamento-editor-table th.col-servicos,
.orcamento-editor-table td.col-servicos {
  max-width: 0;
}

.orcamento-editor-table .col-qtd {
  width: 5.5rem;
}

.orcamento-editor-table .col-und {
  width: 4rem;
  text-align: center;
}

.orcamento-editor-table .col-num {
  width: 7.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.orcamento-editor-table .col-actions {
  width: 6.5rem;
  text-align: center;
}

.orcamento-row-subtitulo {
  background: #e8dcc8;
}

.orcamento-row-subtitulo td {
  border-top: 2px solid #c9b896;
}

.orcamento-row-linha:nth-child(even) {
  background: #fafbfc;
}

.orcamento-row-decomp {
  background: #f4f7fb;
}

.orcamento-row-decomp td {
  border-top: 1px dashed #d0d7de;
  font-size: 0.92em;
}

.orcamento-decomp-servicos {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.btn-expand-decomp {
  min-width: 1.75rem;
  padding: 0.15rem 0.35rem;
  flex-shrink: 0;
}

.btn-expand-placeholder {
  display: inline-block;
  width: 1.75rem;
  flex-shrink: 0;
}

.orcamento-row-erro {
  background: #fff5f5 !important;
}

.orcamento-row-total-geral {
  background: #e8edf3;
  border-top: 2px solid var(--border);
}

.orcamento-row-total-geral td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.input-inline {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: inherit;
  font-family: inherit;
}

.input-inline:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30, 90, 168, 0.15);
}

.input-subtitulo {
  font-weight: 600;
  text-transform: uppercase;
  min-width: 0;
}

.input-codigo {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.input-codigo-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
}

.input-codigo-wrap .input-codigo {
  flex: 1 1 auto;
  min-width: 0;
}

.item-descricao-hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.input-qtd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.orcamento-linha-servicos {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.orcamento-descricao {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orcamento-codigo-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.orcamento-codigo-wrap .input-codigo {
  flex: 0 1 9rem;
  min-width: 6rem;
  max-width: 10rem;
}

.btn-busca-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  min-width: 2rem;
}

.btn-busca-item svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.badge-tipo {
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-erro {
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 50%;
  cursor: help;
}

.orcamento-acoes {
  white-space: nowrap;
}

.orcamento-acoes .btn {
  padding: 0.2rem 0.45rem;
  min-width: 1.75rem;
}

.orcamento-subtotal {
  font-weight: 600;
}

/* —— Modal de busca no catálogo —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.45);
}

.modal-dialog {
  position: relative;
  width: min(100%, 960px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  margin-top: 2vh;
}

.modal-busca-catalogo {
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.modal-busca-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-busca-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.modal-filtro-grupo {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.modal-filtro-grupo legend {
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modal-filtro-opcao {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--surface);
  user-select: none;
}

.modal-filtro-opcao:has(input:checked) {
  border-color: var(--primary);
  background: #eef4fc;
  color: var(--primary);
  font-weight: 600;
}

.modal-filtro-opcao input {
  margin: 0;
}

.input-busca-modal {
  flex: 1 1 280px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.input-busca-modal:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30, 90, 168, 0.15);
}

.modal-busca-resultados {
  flex: 1 1 auto;
  max-height: min(60vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-busca-resultados .table {
  margin: 0;
  font-size: 0.88rem;
}

.modal-busca-resultados td:nth-child(2) {
  min-width: 280px;
  word-break: break-word;
}

.dl-inline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 0.75rem;
}

.dl-inline dt {
  font-weight: 600;
  color: var(--muted);
}

.input-seq-montagem {
  width: 4.5rem;
  text-align: center;
}

/* Cronograma de obra */
.cronograma-resumo {
  margin-bottom: 1.5rem;
}

.cronograma-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cronograma-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  background: #f4f7fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 10rem;
}

.cronograma-card-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.cronograma-etapa {
  border-top: 2px solid var(--border);
  padding-top: 1.25rem;
}

.cronograma-etapa-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cronograma-etapa-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.cronograma-timeline {
  margin-bottom: 1.25rem;
}

.cronograma-bar-wrap {
  margin-bottom: 0.65rem;
}

.cronograma-bar-label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.cronograma-bar-track {
  height: 1.25rem;
  background: #e8edf3;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.cronograma-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b6ea5, #5a8fc4);
  border-radius: 4px;
  min-width: 2px;
}

.cronograma-bloco-detalhe {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cronograma-bloco-detalhe h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.cronograma-bloco-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .cronograma-bloco-grid {
    grid-template-columns: 1fr;
  }
}

.cronograma-bloco-detalhe h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.cronograma-atividades {
  margin-top: 1rem;
}

.cronograma-atividades summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Gantt em grade (estilo planilha) */
.cronograma-gantt-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.cronograma-gantt-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.cronograma-gantt {
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 100%;
}

.cronograma-gantt th,
.cronograma-gantt td {
  border: 1px solid #d8dee6;
  padding: 0;
}

.gantt-label-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  min-width: 10rem;
  max-width: 14rem;
  padding: 0.4rem 0.6rem !important;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.gantt-preds {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
  white-space: normal;
}

.gantt-day-col {
  min-width: 1.4rem;
  width: 1.4rem;
  padding: 0.25rem 0 !important;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  background: #f4f7fb;
}

.gantt-cell {
  width: 1.4rem;
  min-width: 1.4rem;
  height: 1.35rem;
  background: #fff;
}

.gantt-cell.gantt-active {
  background: #f5d547;
}

/* Dependências na página de detalhe */
.pred-table-wrap {
  overflow-x: auto;
}

.pred-table td {
  vertical-align: top;
}

.pred-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 8rem;
  overflow-y: auto;
}

.pred-check-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.pred-check-label input {
  flex-shrink: 0;
}

.table-compact th,
.table-compact td {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.input-readonly {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f4f6f9;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

