/* levantamentos.css - v9.0 */

:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --bg-color: #f9fafb;
  --text-main: #1f2937;
  --border-color: #e5e7eb;
}

body { background-color: var(--bg-color); color: var(--text-main); }
.page-container { max-width: 1600px; margin: 2rem auto; padding: 0 20px; }

/* Toolbar */
.toolbar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; background: white; padding: 1.25rem 2rem; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.toolbar-info h2 { margin: 0; font-size: 1.5rem; }
.obra-tag { color: var(--primary); font-weight: 600; }
.toolbar-actions { display: flex; gap: 12px; align-items: center; }

/* Busca */
.search-box { position: relative; display: flex; align-items: center; }
.search-box input { padding: 0.6rem 1rem; border: 1px solid var(--border-color); border-radius: 8px; width: 300px; }
.search-box .btn-icon { position: absolute; right: 5px; background: none; border: none; cursor: pointer; }

/* Tabela */
.table-card { background: white; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid var(--border-color); }
.modern-table { width: 100%; border-collapse: collapse; }
.modern-table th { background: #f8fafc; padding: 1rem; text-align: left; font-size: 0.85rem; text-transform: uppercase; color: #6b7280; font-weight: 600; border-bottom: 1px solid var(--border-color); vertical-align: top; }
.modern-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; font-size: 0.9rem; }
.modern-table tr:hover { background-color: #f9fafb; cursor: pointer; }

/* Headers Especiais */
.th-toggle { display: table-cell; vertical-align: middle; }
.th-sub { display: block; font-size: 0.65rem; color: #9ca3af; font-weight: normal; margin-top: 2px; }
.btn-eye { background: none; border: none; cursor: pointer; font-size: 1rem; margin-left: 5px; opacity: 0.5; }
.btn-eye:hover { opacity: 1; }

/* Cores Tabela */
.col-bg-gray { background: #f9fafb; }
.col-destaque-header { background: rgba(102, 126, 234, 0.05); border-left: 1px solid #eee; border-right: 1px solid #eee; }
.col-destaque-body { background: #fdfdff; border-left: 1px solid #f3f4f6; border-right: 1px solid #f3f4f6; }

/* Botões */
.btn-action { padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 500; cursor: pointer; border: none; }
.btn-action.primary { background: var(--primary); color: white; }
.btn-action.outline { background: white; border: 1px solid var(--border-color); }
.btn-icon-small { background: white; border: 1px solid #ddd; border-radius: 4px; width: 28px; height: 28px; cursor: pointer; margin: 0 2px; }
.btn-icon-small.del { color: red; background: #fff5f5; border-color: #fecaca; }

/* Utils */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); font-weight: 600; }
.text-muted { color: #6b7280; }
.text-danger { color: #ef4444; }
.text-success { color: #10b981; }
.font-mono { font-family: monospace; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.85rem; }
.table-footer { padding: 1rem; background: #f8fafc; color: #6b7280; font-size: 0.9rem; }

/* Formula Display */
.formula-display { font-size: 0.8rem; color: var(--primary); margin-top: 4px; font-style: italic; }
.badge-perda { background: #fff1f2; color: #be123c; font-size: 0.7rem; padding: 1px 5px; border-radius: 4px; margin-left: 5px; border: 1px solid #fecdd3; }

/* Modais */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-seletor-box { background: white; width: 700px; max-height: 85vh; border-radius: 12px; display: flex; flex-direction: column; }
.modal-card { background: white; width: 550px; max-height: 90vh; border-radius: 12px; display: flex; flex-direction: column; }
.modal-card.wide { width: 900px; }

.modal-header, .modal-header-seletor { padding: 1.25rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #f9fafb; border-radius: 12px 12px 0 0; }
.modal-header-seletor { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.btn-close-modal, .btn-close-white { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: inherit; }

.modal-body-scroll, .modal-body-seletor { padding: 1.5rem; overflow-y: auto; }
.lista-seletor { display: grid; gap: 10px; }
.card-seletor-item { border: 1px solid var(--border-color); padding: 10px; border-radius: 8px; cursor: pointer; }
.card-seletor-item:hover { border-color: var(--primary); background: #f0fdf4; }

/* Form */
.form-box { background: #f3f4f6; padding: 1rem; border-radius: 8px; margin: 1rem 0; }
.form-row { margin-bottom: 1rem; }
.inp { width: 100%; padding: 0.6rem; border: 1px solid #d1d5db; border-radius: 6px; }
.dynamic-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 1rem; }
.form-footer { display: flex; justify-content: space-between; align-items: center; }
.btn-group { display: flex; gap: 10px; }
.btn-pri { background: var(--primary); color: white; padding: 8px 16px; border-radius: 6px; border:none; cursor: pointer; }
.btn-sec { background: #e5e7eb; padding: 8px 16px; border-radius: 6px; border:none; cursor: pointer; }

.hist-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; }
.hist-actions button { background: none; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; padding: 2px 6px; }