
* { 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: 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, #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; }
.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(4, 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; opacity: 0.8; margin-bottom: 3px; text-transform: uppercase; }
.summary-card .value { font-size: 16px; font-weight: 800; }
.sc-fecham { background: #fff3e0; color: #e65100; }
.sc-pagar { background: #e3f2fd; color: #1565c0; }
.sc-pagos { background: #e8f5e9; color: #1b5e20; }
.sc-total { background: #f3e5f5; color: #6a1b9a; }

/* Nav */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.month-year { font-size: 18px; font-weight: 700; color: #333; }
.nav-buttons { display: flex; gap: 8px; }
.nav-btn { background: #2e7d32; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; }

/* Legend */
.legend { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #555; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.ld-fech { background: #ff9800; }
.ld-pagar { background: #1976d2; }
.ld-venc { background: #e53935; }
.ld-pago { background: #43a047; }

/* Calendar Grid */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 15px; }
.calendar-header-day { text-align: center; padding: 6px; font-weight: 700; font-size: 11px; color: #2e7d32; background: #e8f5e9; border-radius: 6px; }
.calendar-day { border: 2px solid #e8e8e8; border-radius: 8px; padding: 3px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; min-height: 52px; }
.calendar-day:hover { border-color: #2e7d32; box-shadow: 0 2px 8px rgba(46,125,50,0.3); transform: scale(1.03); }
.calendar-day.other-month { opacity: 0.15; pointer-events: none; }
.calendar-day.today { background: linear-gradient(135deg, #1b5e20, #2e7d32); color: white; border-color: #1b5e20; }
.calendar-day.today .day-amount { color: #fff; }
.calendar-day.selected { border-color: #2e7d32; border-width: 3px; box-shadow: 0 0 0 2px rgba(46,125,50,0.3); }
.calendar-day.has-events { background: #f5f5f5; border-color: #bbb; }
.calendar-day.has-pagar { background: #e3f2fd; border-color: #1976d2; }
.calendar-day.has-fechamento { background: #fff8e1; border-color: #ff9800; }
.calendar-day.has-vencimento { background: #ffebee; border-color: #e53935; }
.calendar-day.has-pago { background: #e8f5e9; border-color: #43a047; }
.day-number { font-size: 12px; font-weight: 700; }
.day-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-fech { background: #ff9800; }
.dot-pagar { background: #1976d2; }
.dot-venc { background: #e53935; }
.dot-pago { background: #43a047; }
.day-count { font-size: 8px; font-weight: 700; text-align: center; color: #555; margin-top: 1px; }

/* Detail Section */
.detail-section { background: #f5f7fa; padding: 15px; border-radius: 12px; margin-top: 10px; }
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.detail-title { font-size: 15px; font-weight: 700; color: #333; }
.detail-subtitle { font-size: 12px; color: #888; }

.event-item { background: white; padding: 12px; border-radius: 10px; margin-bottom: 8px; border-left: 5px solid #ccc; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.2s; }
.event-item:hover { transform: translateX(3px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.event-item.ev-fechamento { border-left-color: #ff9800; }
.event-item.ev-pagar { border-left-color: #1976d2; }
.event-item.ev-vencimento { border-left-color: #e53935; }
.event-item.ev-pago { border-left-color: #43a047; background: #f8fff8; }

.event-left { flex: 1; }
.event-name { font-size: 14px; font-weight: 700; color: #333; }
.event-info { font-size: 11px; color: #888; margin-top: 2px; }
.event-right { text-align: right; }
.event-amount { font-size: 15px; font-weight: 800; }
.event-type { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 3px; }
.et-fechamento { background: #fff3e0; color: #e65100; }
.et-pagar { background: #e3f2fd; color: #1565c0; }
.et-vencimento { background: #ffebee; color: #c62828; }
.et-pago { background: #e8f5e9; color: #1b5e20; }

.badge-tipo { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px; margin-left: 5px; }
.bt-business { background: #e3f2fd; color: #1565c0; }
.bt-pessoal { background: #f3e5f5; color: #6a1b9a; }

.empty-day { text-align: center; padding: 20px; color: #999; font-size: 13px; }

/* Dark Mode */
body.dark-mode { background: linear-gradient(135deg, #0a2e0a 0%, #16213e 100%); }
body.dark-mode .container { background: #0f0f23; color: #e0e0e0; }
body.dark-mode .month-year { color: #e0e0e0; }
body.dark-mode .calendar-header-day { background: #0a2e0a; color: #4caf50; }
body.dark-mode .calendar-day { border-color: #2a2a4a; background: #16213e; color: #e0e0e0; }
body.dark-mode .calendar-day.has-events { background: #1a1a3e; }
body.dark-mode .calendar-day.has-pagar { background: #152030; border-color: #1976d2; }
body.dark-mode .calendar-day.has-fechamento { background: #2e2515; border-color: #ff9800; }
body.dark-mode .calendar-day.has-vencimento { background: #2e1515; border-color: #e53935; }
body.dark-mode .calendar-day.has-pago { background: #152e15; border-color: #43a047; }
body.dark-mode .calendar-day.other-month { opacity: 0.1; }
body.dark-mode .day-count { color: #aaa; }
body.dark-mode .detail-section { background: #16213e; }
body.dark-mode .detail-title { color: #e0e0e0; }
body.dark-mode .event-item { background: #1a1a3e; }
body.dark-mode .event-name { color: #e0e0e0; }
body.dark-mode .legend-item { color: #aaa; }
body.dark-mode .summary-card.sc-fecham { background: #2e2515; }
body.dark-mode .summary-card.sc-pagar { background: #152030; }
body.dark-mode .summary-card.sc-pagos { background: #152e15; }
body.dark-mode .summary-card.sc-total { background: #2d1a3e; }

@media (max-width: 600px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .header { flex-direction: column; text-align: center; }
    .calendar-day { min-height: 44px; }
}

