
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 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, #1b5e20, #2e7d32); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header h2 { font-size: 18px; }
.header-right { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-add { background: white; color: #1b5e20; border: none; padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn-link { background: rgba(255,255,255,0.2); color: white; border: 2px solid white; padding: 7px 13px; border-radius: 6px; font-weight: 600; font-size: 12px; text-decoration: none; }
.content { padding: 15px 20px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 15px; }
.summary-card { border-radius: 10px; padding: 10px 6px; text-align: center; }
.summary-card .label { font-size: 9px; font-weight: 700; text-transform: uppercase; opacity: 0.8; }
.summary-card .value { font-size: 15px; font-weight: 800; margin-top: 2px; }
.sc-total { background: #e8f5e9; color: #1b5e20; }
.sc-disp { background: #e3f2fd; color: #1565c0; }
.sc-vend { background: #ede7f6; color: #4a2c8a; }
.sc-inv { background: #fff3e0; color: #e65100; }
.sc-lucro { background: #e8f5e9; color: #1b5e20; }
.sc-roi { background: #f3e5f5; color: #6a1b9a; }

/* Filters */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 15px; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: 18px; border: 2px solid #ddd; background: white; font-size: 11px; font-weight: 600; cursor: pointer; color: #555; transition: all 0.2s; }
.filter-tab.active { background: #2e7d32; color: white; border-color: #2e7d32; }

/* Land cards */
.land-card { border: 2px solid #e0e0e0; border-radius: 12px; padding: 14px; margin-bottom: 12px; transition: all 0.2s; }
.land-card:hover { border-color: #2e7d32; box-shadow: 0 4px 15px rgba(46,125,50,0.15); }
.land-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.land-title { font-size: 15px; font-weight: 800; color: #333; margin-bottom: 4px; }
.land-address { font-size: 12px; color: #666; }
.land-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.land-actions { display: flex; gap: 6px; flex-shrink: 0; }
.land-btn { background: none; border: none; font-size: 16px; cursor: pointer; opacity: 0.5; padding: 4px; }
.land-btn:hover { opacity: 1; }

.land-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.land-stat { background: #f8f9fa; padding: 10px; border-radius: 8px; }
.land-stat .ls-label { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.land-stat .ls-value { font-size: 13px; font-weight: 800; color: #333; margin-top: 2px; }

.financial-block { background: #f0fff0; border: 1px solid #c8e6c9; border-radius: 10px; padding: 12px; margin-top: 8px; }
.financial-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #e8f5e9; font-size: 12px; }
.financial-row:last-child { border-bottom: none; font-weight: 800; font-size: 13px; }
.financial-row .fr-label { color: #555; }
.financial-row .fr-value { font-weight: 700; color: #333; }
.financial-row .fr-positive { color: #2e7d32; }
.financial-row .fr-negative { color: #c62828; }

.util-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.util-badge { padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.util-ok { background: #e8f5e9; color: #1b5e20; }
.util-no { background: #fdecea; color: #c62828; }
.util-partial { background: #fff8e1; color: #f57f17; }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.status-disponivel { background: #e8f5e9; color: #1b5e20; }
.status-bloqueado { background: #fdecea; color: #c62828; }
.status-vendido { background: #e3f2fd; color: #1565c0; }
.status-parceiros { background: #ede7f6; color: #4a2c8a; }
.status-cfd { background: #fff3e0; color: #e65100; }
.county-badge { background: #f0f0f0; color: #555; display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; }

.maps-btn { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.maps-btn:hover { background: #c8e6c9; }

.payment-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.payment-avista { background: #e3f2fd; color: #1565c0; }
.payment-parcelado { background: #fff3e0; color: #e65100; }

/* Empty */
.empty-state { text-align: center; padding: 40px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: flex-start; padding: 20px; overflow-y: auto; }
.modal-overlay.show { display: flex; }
.modal-box { background: white; border-radius: 14px; padding: 20px; width: 100%; max-width: 560px; margin-bottom: 30px; }
.modal-title { font-size: 16px; font-weight: 800; color: #1b5e20; margin-bottom: 15px; text-align: center; }
.modal-section { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #1b5e20; letter-spacing: 0.5px; padding: 10px 0 6px; border-top: 1px solid #e8f5e9; margin-top: 10px; }
.modal-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.modal-label { font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px; margin-top: 8px; }
.modal-input { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.modal-input:focus { border-color: #2e7d32; }
.modal-select { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; background: white; }
.modal-select:focus { border-color: #2e7d32; }
.modal-textarea { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 13px; outline: none; resize: vertical; min-height: 80px; }
.modal-textarea:focus { border-color: #2e7d32; }
.modal-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal-preview { background: #e8f5e9; padding: 12px; border-radius: 8px; margin-top: 10px; font-size: 13px; color: #1b5e20; }
.modal-preview-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.modal-preview-row.total { font-weight: 800; font-size: 14px; border-top: 1px solid #a5d6a7; margin-top: 4px; padding-top: 6px; }
.modal-btns { display: flex; gap: 10px; margin-top: 15px; }
.modal-btn { flex: 1; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; border: none; }
.modal-btn-cancel { background: #f0f0f0; color: #666; }
.modal-btn-save { background: #2e7d32; color: white; }

.installment-fields { display: none; }
.installment-fields.show { display: block; }

.wa-lang-btn { flex:1; padding: 8px; border-radius: 8px; border: 2px solid #e0e0e0; background: white; font-size: 13px; font-weight: 700; cursor: pointer; color: #555; transition: all 0.2s; }
.wa-lang-btn.active { background: #25d366; color: white; border-color: #25d366; }
.foto-upload-area { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:4px; }
.foto-preview { width:100px; height:80px; border-radius:10px; border:2px dashed #ccc; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#fafafa; flex-shrink:0; cursor:pointer; }
.foto-preview img { width:100%; height:100%; object-fit:cover; }
.foto-placeholder { font-size:28px; color:#ccc; }
.btn-foto-upload { background:#2e7d32; color:#fff; border:none; padding:8px 14px; border-radius:7px; font-weight:600; cursor:pointer; font-size:12px; }
.btn-foto-remove { background:#ef5350; color:#fff; border:none; padding:8px 14px; border-radius:7px; font-weight:600; cursor:pointer; font-size:12px; }
.toggle-field { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.toggle-field label { font-size: 13px; font-weight: 600; color: #444; }
.toggle-field input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: #2e7d32; }
.hoa-fields { display: none; }
.hoa-fields.show { display: block; }

.details-toggle { background: none; border: none; color: #2e7d32; font-size: 11px; font-weight: 700; cursor: pointer; padding: 4px 0; }

/* Drag and Drop */
.land-card { position: relative; }
.drag-handle { position: absolute; top: 8px; right: 8px; font-size: 18px; color: #aaa; cursor: grab; opacity: 0; transition: opacity 0.2s; z-index: 10; user-select: none; padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,0.85); line-height: 1; }
.land-card:hover .drag-handle { opacity: 0.7; }
.drag-handle:hover { opacity: 1 !important; color: #2e7d32; background: #e8f5e9; }
.drag-handle:active { cursor: grabbing; }
.land-card.dragging { opacity: 0.4; transform: scale(0.98); }
.land-card.drag-over-top { border-top: 3px solid #2e7d32; margin-top: -1px; }
.land-card.drag-over-bottom { border-bottom: 3px solid #2e7d32; margin-bottom: -1px; }
.land-card.touch-dragging { box-shadow: 0 8px 25px rgba(46,125,50,0.35); z-index: 100; }

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .land-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .header { flex-direction: column; text-align: center; }
    .modal-grid2, .modal-grid3 { grid-template-columns: 1fr !important; }
    .drag-handle { opacity: 0.5; }
}

