/* Modal */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  justify-content: center; align-items: flex-start; padding-top: 40px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: 12px; width: 95%; max-width: 700px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-header {
  background: linear-gradient(135deg, #1a3c7d, #0f2b5e); color: white;
  padding: 18px 24px; border-radius: 12px 12px 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
.modal-body { padding: 24px; }
.modal-body .field { margin-bottom: 14px; }
.modal-body .field label { display: block; font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 3px; }
.modal-body .field .val { font-size: 14px; font-weight: 500; }
.modal-body .field input, .modal-body .field select, .modal-body .field textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.modal-body .field textarea { height: 60px; resize: vertical; }
.parcelas-table { width: 100%; font-size: 13px; margin-top: 8px; }
.parcelas-table th { background: #f0f0f0; padding: 6px 10px; font-size: 11px; }
.parcelas-table td { padding: 6px 10px; text-align: center; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 10px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }

.valor { font-weight: 600; color: #27ae60; }

tr.sub-item td { background: #fdf6ee; }
tr.sub-item td:first-child { padding-left: 28px; font-size: 12px; }
.btn-split { background: #8e44ad; color: white; }
.btn-split:hover { background: #7d3c98; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.badge-sub { background: #e8daef; color: #6c3483; font-size: 10px; padding: 2px 6px; border-radius: 8px; margin-left: 4px; }
.qtd-badge { background: #dfe6e9; color: #2d3436; padding: 3px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.qtd-badge.multi { background: #ffeaa7; color: #856404; }

/* Modal de Pedido — layout OMIE (largo + abas), espelha mockup_pedido.html */
.modal.modal-wide { max-width: 1080px; }
.modal.modal-wide .modal-body { padding: 18px 22px; color: #2d3436; }
.modal.modal-wide .field { margin-bottom: 0; }
.modal.modal-wide .field label { display: block; font-size: 11px; color: #8a93a2; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; font-weight: 600; }
.modal.modal-wide .field input, .modal.modal-wide .field select, .modal.modal-wide .field textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #d7dce3; border-radius: 7px; font-size: 13px; background: #fff;
}
.modal.modal-wide .two-cols { gap: 14px; margin-bottom: 12px; }
.pm-head { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; align-items: end; margin-bottom: 4px; }
.pm-totais { display: flex; margin: 16px 0 6px; border: 1px solid #e3e8ef; border-radius: 8px; overflow: hidden; }
.pm-totais .cel { flex: 1; padding: 10px 14px; border-right: 1px solid #e3e8ef; }
.pm-totais .cel:last-child { border-right: none; background: #f4f8ff; }
.pm-totais .lbl { font-size: 10px; color: #8a93a2; text-transform: uppercase; letter-spacing: .4px; }
.pm-totais .vlr { font-size: 16px; font-weight: 700; color: #2d3436; margin-top: 2px; }
.pm-totais .cel:last-child .vlr { color: #1a3c7d; }
.pm-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e3e8ef; margin: 14px 0 0; }
.pm-tab { padding: 9px 16px; font-size: 13px; cursor: pointer; border-radius: 8px 8px 0 0; color: #6b7280; font-weight: 500; border: 2px solid transparent; border-bottom: none; position: relative; top: 2px; }
.pm-tab.active { color: #1a3c7d; background: #fff; border-color: #e3e8ef; font-weight: 700; }
.pm-pane { display: none; padding: 16px 2px; }
.pm-pane.active { display: block; }
.modal.modal-wide .pm-pane table.mp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal.modal-wide .pm-pane table.mp-table thead th { background: #f4f6fa; color: #5b6472; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding: 9px 10px; text-align: left; border-bottom: 1px solid #e3e8ef; }
.modal.modal-wide .pm-pane table.mp-table tbody td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; }
.modal.modal-wide .pm-pane table.mp-table tfoot td { padding: 10px; font-weight: 700; border-top: 2px solid #e3e8ef; }

/* Ficha Técnica Modal */
.modal-ficha .modal { max-width: 1100px; }
.ft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ft-section { background: #f8f9fa; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.ft-section h3 { font-size: 14px; color: #1a3c7d; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #1a3c7d; padding-bottom: 6px; }
.ft-row { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.ft-row label { font-size: 12px; color: #555; min-width: 90px; font-weight: 500; }
.ft-row select, .ft-row input[type=number], .ft-row input[type=text] {
  padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; background: white;
}
.ft-row select { min-width: 140px; }
.ft-row input[type=number] { width: 80px; }
.ft-check { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ft-check input[type=checkbox] { accent-color: #1a3c7d; }
.ft-check label { font-size: 12px; color: #555; min-width: auto; }
.ft-area-result { background: #1a3c7d; color: white; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 16px; text-align: center; margin-top: 8px; }
.svg-container { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 10px; text-align: center; min-height: 280px; }
.acc-list { flex: 1 1 auto; min-height: 320px; max-height: none; overflow-y: auto; }
.ft-col-right { display: flex; flex-direction: column; }
.ft-section-acc { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.ft-section-acc h3 { flex: 0 0 auto; }
.hub-head { font-size: 14px; color: #666; margin: 4px 2px 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hub-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .1s; }
.hub-card:hover { border-color: #1a3c7d; box-shadow: 0 4px 16px rgba(26,60,125,0.13); }
.hub-card:active { transform: scale(0.99); }
.hub-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hub-ico { font-size: 24px; line-height: 1; }
.hub-nome { font-size: 17px; font-weight: 700; color: #1a3c7d; }
.hub-badge { margin-left: auto; font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.hub-badge.ativo { background: #e8f5e9; color: #2e7d32; }
.hub-badge.breve { background: #fff3cd; color: #8a5a00; }
.hub-desc { font-size: 13px; color: #555; line-height: 1.5; }
.hub-telas { font-size: 12px; color: #8a93a0; margin-top: 12px; }
.acc-item { background: white; border: 1px solid #e0e0e0; border-radius: 6px; padding: 8px 12px; margin-bottom: 6px; }
.acc-item-header { display: flex; align-items: center; gap: 8px; }
.acc-item-config { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.acc-item-config select, .acc-item-config input { padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 11px; }
.acc-item-config input[type=number] { width: 50px; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mp-table th { background: #1a3c7d; color: white; padding: 8px; text-align: left; font-size: 11px; }
.mp-table td { padding: 6px 8px; border-bottom: 1px solid #eee; }
.mp-table input { width: 70px; padding: 3px 5px; border: 1px solid #ccc; border-radius: 3px; font-size: 11px; text-align: right; }
.mp-table tr:last-child { font-weight: 700; background: #f0f0f0; }
.mp-table .mp-auto { background: #f0f8e8; }
.btn-ficha { background: #2980b9; color: white; }
.btn-ficha:hover { background: #2471a3; }

@media (max-width: 768px) {
  .content { padding: 15px; }
  .toolbar input { min-width: 100%; }
  .two-cols { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: 8px 6px; }
}
