/* CSS específico para a tela de Controle Financeiro */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Custom Date Range */
.custom-date-range {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.date-inputs {
    display: flex;
    align-items: end;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.input-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Financial Summary Cards */
.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.summary-card.revenue::before {
    background-color: #27ae60;
}

.summary-card.profit::before {
    background-color: #3498db;
}

.summary-card.transactions::before {
    background-color: #f39c12;
}

.summary-card.ticket::before {
    background-color: #9b59b6;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
    color: white;
}

.revenue .card-icon {
    background-color: #27ae60;
}

.profit .card-icon {
    background-color: #3498db;
}

.transactions .card-icon {
    background-color: #f39c12;
}

.ticket .card-icon {
    background-color: #9b59b6;
}

.card-content h3 {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.card-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 5px 0;
}

.card-change {
    font-size: 12px;
    color: #7f8c8d;
}

.card-change.positive {
    color: #27ae60;
}

.card-change.negative {
    color: #e74c3c;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.chart-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.chart-controls select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.chart-container canvas {
    max-height: 300px;
}

/* Transactions Section */
.transactions-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.section-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.transactions-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.transactions-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.transactions-table tr:hover {
    background-color: #f8f9fa;
}

.transaction-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.transaction-type.sale {
    background-color: #d4edda;
    color: #155724;
}

.transaction-type.return {
    background-color: #f8d7da;
    color: #721c24;
}

.transaction-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.transaction-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.transaction-status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-view {
    padding: 4px 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.btn-view:hover {
    background-color: #2980b9;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-pagination {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-pagination:hover {
    background-color: #f8f9fa;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Goals Section */
.goals-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.goal-card {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.goal-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.goal-period {
    font-size: 12px;
    color: #7f8c8d;
    background-color: white;
    padding: 4px 8px;
    border-radius: 12px;
}

.goal-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #2c3e50;
}

.progress-percentage {
    font-weight: bold;
    color: #3498db;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.transaction-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #2c3e50;
}

.detail-row .value {
    color: #7f8c8d;
}

.modal-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.modal-items-table th,
.modal-items-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.modal-items-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.transaction-summary {
    border-top: 2px solid #3498db;
    padding-top: 15px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.summary-row.total {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    border-top: 1px solid #ecf0f1;
    padding-top: 10px;
    margin-top: 10px;
}

.modal-actions {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .financial-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .financial-summary {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .transactions-table {
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }
}
