
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 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, #667eea, #764ba2); 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; 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; }
.content { padding: 15px 20px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.summary-card { border-radius: 10px; padding: 12px; text-align: center; }
.summary-card .label { font-size: 11px; font-weight: 600; opacity: 0.8; margin-bottom: 4px; }
.summary-card .value { font-size: 18px; font-weight: 800; }
.summary-card.roxo { background: #f3e5f5; color: #6a1b9a; }
.summary-card.azul { background: #e3f2fd; color: #1565c0; }
.summary-card.verde { background: #e8f5e9; color: #1b5e20; }

/* Search */
.search-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; background: #f5f5f5; border-radius: 10px; padding: 8px 14px; border: 2px solid #e0e0e0; }
.search-bar input { border: none; background: none; outline: none; flex: 1; font-size: 14px; }
.search-bar .clear-btn { cursor: pointer; font-size: 16px; color: #999; display: none; }

/* Contract Cards */
.contract-list { display: flex; flex-direction: column; gap: 10px; }
.contract-card { border: 2px solid #e0e0e0; border-radius: 12px; padding: 14px; transition: all 0.2s; }
.contract-card:hover { border-color: #764ba2; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

.contract-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.contract-client { font-size: 16px; font-weight: 700; color: #333; }
.contract-date { font-size: 12px; color: #888; background: #f5f5f5; padding: 3px 8px; border-radius: 12px; }

.contract-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.contract-detail { text-align: center; }
.contract-detail .detail-label { font-size: 10px; color: #999; font-weight: 600; text-transform: uppercase; }
.contract-detail .detail-value { font-size: 14px; font-weight: 700; color: #333; }

.contract-footer { display: flex; justify-content: space-between; align-items: center; }
.contract-file { font-size: 11px; color: #764ba2; font-weight: 600; }
.btn-delete { background: #fdecea; color: #c62828; border: none; padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-delete:hover { background: #c62828; color: white; }

/* Sort */
.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.sort-bar select { padding: 6px 10px; border-radius: 8px; border: 2px solid #ddd; font-size: 12px; font-weight: 600; }
.total-text { font-size: 12px; color: #888; font-weight: 600; }

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

/* Dark Mode */
body.dark-mode { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
body.dark-mode .container { background: #0f0f23; color: #e0e0e0; }
body.dark-mode .contract-card { border-color: #333; background: #16213e; }
body.dark-mode .contract-card:hover { border-color: #764ba2; }
body.dark-mode .contract-client { color: #e0e0e0; }
body.dark-mode .contract-date { background: #1a1a2e; color: #aaa; }
body.dark-mode .contract-detail .detail-value { color: #e0e0e0; }
body.dark-mode .search-bar { background: #16213e; border-color: #333; }
body.dark-mode .search-bar input { color: #e0e0e0; }
body.dark-mode .summary-card.roxo { background: #2d1a3e; }
body.dark-mode .summary-card.azul { background: #1a2e3e; }
body.dark-mode .summary-card.verde { background: #1a2e1a; }
body.dark-mode .sort-bar select { background: #16213e; color: #e0e0e0; border-color: #333; }

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .contract-details { grid-template-columns: repeat(3, 1fr); }
    .header { flex-direction: column; text-align: center; }
}

