
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 1000px; margin: 5px auto; background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.header { background: linear-gradient(135deg, #1565c0, #1976d2); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header h2 { font-size: 18px; font-weight: 800; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-back { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn-add { background: white; color: #1565c0; border: none; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn-link { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.4); padding: 7px 12px; border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; }
.content { padding: 15px 20px; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: #f5f5f5; border-radius: 10px; padding: 12px; text-align: center; }
.kpi .num { font-size: 24px; font-weight: 800; color: #1565c0; }
.kpi .lbl { font-size: 11px; color: #888; margin-top: 2px; }

/* Filtros */
.filtros { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; padding: 8px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 13px; outline: none; }
.search-box:focus { border-color: #1565c0; }
.filter-select { padding: 8px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 13px; outline: none; background: white; cursor: pointer; }

/* Pipeline visual */
.pipeline-bar { display: flex; gap: 4px; margin-bottom: 16px; border-radius: 8px; overflow: hidden; }
.pipeline-seg { flex: 1; padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 700; color: white; cursor: pointer; transition: opacity 0.2s; }
.pipeline-seg:hover { opacity: 0.85; }
.seg-new { background: #1565c0; }
.seg-psa { background: #f57f17; }
.seg-cfd { background: #e65100; }
.seg-contracted { background: #2e7d32; }
.seg-cancelled { background: #9e9e9e; }

/* Tabela */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #f5f5f5; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tr:hover td { background: #f9f9f9; }
tr:last-child td { border-bottom: none; }
.cursor { cursor: pointer; }

/* Status badge */
.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.s-NEW { background: #e3f2fd; color: #1565c0; }
.s-PSA_SENT { background: #fff8e1; color: #f57f17; }
.s-CFD_SENT { background: #fff3e0; color: #e65100; }
.s-CONTRACTED { background: #e8f5e9; color: #2e7d32; }
.s-CANCELLED { background: #f5f5f5; color: #757575; }

/* Ações */
.btn-sm { padding: 4px 10px; border-radius: 5px; font-size: 11px; font-weight: 700; border: none; cursor: pointer; }
.btn-detail { background: #e3f2fd; color: #1565c0; }
.btn-contract { background: #e8f5e9; color: #2e7d32; }
.btn-del { background: #fdecea; color: #c62828; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 15px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 14px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; color: #1565c0; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; }
.form-group input:focus, .form-group select:focus { border-color: #1565c0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-save { background: #1565c0; color: white; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; width: 100%; margin-top: 8px; }
.btn-save:hover { background: #0d47a1; }

/* Detalhe do buyer */
.detail-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #888; font-weight: 600; }
.detail-value { font-weight: 700; text-align: right; max-width: 60%; }
.section-title { font-size: 12px; font-weight: 700; color: #1565c0; text-transform: uppercase; letter-spacing: 0.5px; margin: 14px 0 6px; border-bottom: 1px solid #e3f2fd; padding-bottom: 4px; }

/* Mensagem vazia */
.empty { text-align: center; padding: 40px; color: #aaa; }
.empty .big { font-size: 40px; }
.empty p { margin-top: 8px; font-size: 14px; }

/* Msg copiada */
.msg-box { background: #f5f5f5; border-radius: 8px; padding: 12px; font-size: 12px; color: #555; margin-top: 12px; white-space: pre-wrap; line-height: 1.5; }
.btn-copy { background: #1565c0; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer; margin-top: 8px; width: 100%; }

@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .header { flex-direction: column; }
}
    .version { font-size: 10px; opacity: 0.5; text-align: right; padding: 4px 20px 8px; }

