
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%); min-height: 100vh; padding: 15px; }
.container { max-width: 1100px; 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, #0d47a1); 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; }
.content { padding: 15px 20px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.sum-card { border-radius: 10px; padding: 12px; text-align: center; }
.sum-card .lbl { font-size: 10px; font-weight: 700; opacity: 0.8; margin-bottom: 3px; }
.sum-card .val { font-size: 20px; font-weight: 800; }
.sc-blue { background: #e3f2fd; color: #1565c0; }
.sc-green { background: #e8f5e9; color: #2e7d32; }
.sc-orange { background: #fff3e0; color: #e65100; }
.sc-grey { background: #f5f5f5; color: #555; }

/* Filtros */
.filtros { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 180px; 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; }

/* 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; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tr:hover td { background: #f9f9f9; }

.status { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.s-Active { background: #e8f5e9; color: #2e7d32; }
.s-PaidOff { background: #e3f2fd; color: #1565c0; }
.s-Default { background: #fdecea; color: #c62828; }
.s-Repossessed { background: #f5f5f5; color: #757575; }

.type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.t-CFD { background: #e8f5e9; color: #2e7d32; }
.t-CASH { background: #fff3e0; color: #e65100; }

.btn-sm { padding: 4px 10px; border-radius: 5px; font-size: 11px; font-weight: 700; border: none; cursor: pointer; }
.btn-view { background: #e3f2fd; color: #1565c0; }
.btn-del { background: #fdecea; color: #c62828; }

.empty { text-align: center; padding: 40px; color: #aaa; }
.empty .big { font-size: 40px; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 14px; padding: 24px; width: 100%; max-width: 620px; position: relative; margin: auto; }
.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; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.section-title { font-size: 12px; font-weight: 800; color: #1565c0; text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #e3f2fd; }
.cfd-fields { display: block; }
.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; }

/* Calculado */
.calc-box { background: #e8f5e9; border: 1px solid #c8e6c9; border-radius: 8px; padding: 10px 14px; margin-top: 10px; font-size: 13px; }
.calc-box strong { color: #2e7d32; }

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

