/* css/partials/financeiro.css
   Estilos específicos para página financeiro.php
   Movido de CSS inline para centralização
*/

/* CARDS E LAYOUT GERAL */
.finance-card {
    background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    padding: 0;
    border: 2px solid #d4af37;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* TABELA PERSONALIZADA COM TEMA MEDIEVAL */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table thead th {
    background: linear-gradient(135deg, #3d2817 0%, #2c1810 100%);
    color: #ffd700;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #8b6914;
    letter-spacing: 0.5px;
}

.custom-table tbody td {
    padding: 15px;
    color: #3d2817;
    border-bottom: 1px solid #d4af37;
    vertical-align: middle;
}

.custom-table tbody tr {
    background: white;
    transition: all 0.2s ease;
}

.custom-table tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.08);
    box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.text-center { text-align: center !important; }

.empty-state {
    text-align: center;
    color: #8b6914;
    padding: 40px !important;
    font-style: italic;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.profit {
    background-color: rgba(103, 194, 58, 0.15);
    color: #67c23a;
    border: 1px solid #67c23a;
    font-weight: 700;
}

.badge.expense {
    background-color: rgba(245, 108, 108, 0.15);
    color: #f56c6c;
    border: 1px solid #f56c6c;
    font-weight: 700;
}

.badge-item {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(100, 149, 237, 0.15);
    color: #6495ed;
    border: 1px solid #6495ed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.val-profit {

    .badge-team {
        display: inline-block;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        background-color: rgba(255, 165, 0, 0.15);
        color: #ff9800;
        border: 1px solid #ff9800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    color: #67c23a;
    font-weight: 700;
}

.val-expense {
    color: #f56c6c;
    font-weight: 700;
}

/* BOTÕES DE AÇÃO NA TABELA */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
    font-size: 1rem;
    margin: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    color: #8b6914;
}

.btn-edit:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.btn-del {
    color: #c0392b;
}

.btn-del:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.btn-icon-del {
    background: none;
    border: none;
    color: #8b6914;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-del:hover {
    color: #c0392b;
    transform: scale(1.1);
}

/* CONTROLES E RESUMO FINANCEIRO */
.financial-controls-wrapper {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 2px solid #d4af37;
}

.financial-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select,
.filter-btn {
    height: 40px !important;
    box-sizing: border-box !important;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 0;
    vertical-align: middle;
    line-height: normal;
}

.filter-select {
    border: 2px solid #d4af37;
    padding: 0 30px 0 12px;
    color: #3d2817;
    background-color: #f5f0e8;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 120px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b6914' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    font-weight: 600;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #8b6914;
    background-color: #fff;
    box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.1);
}

.filter-btn {
    padding: 0 20px;
    background: linear-gradient(135deg, #8b6914 0%, #a0790e 100%);
    border: 2px solid #d4af37;
    color: #f5f0e8;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #a0790e 0%, #8b6914 100%);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.filter-btn:active {
    transform: translateY(0);
    background: linear-gradient(135deg, #6a4f0a 0%, #8b6914 100%);
}

/* CARDS FINANCEIROS */
.financial-summary-cards {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.fin-card {
    background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid #d4af37;
    border-left: 4px solid transparent;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.fin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.fin-card.income { border-left-color: #67c23a; }
.fin-card.expense { border-left-color: #c0392b; }
.fin-card.balance { border-left-color: #8b6914; }
.fin-card.pending-income { border-left-color: #f39c12; }
.fin-card.pending-expense { border-left-color: #d35400; }

.fin-label {
    font-size: 0.7rem;
    color: #8b6914;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.fin-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c1810;
    white-space: nowrap;
}

.fin-card.income .fin-value { color: #67c23a; }
.fin-card.expense .fin-value { color: #c0392b; }
.fin-card.balance .fin-value { color: #8b6914; }
.fin-card.pending-income .fin-value { color: #f39c12; }
.fin-card.pending-expense .fin-value { color: #d35400; }

/* PAGINAÇÃO */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 15px;
    gap: 5px;
    background-color: #f5f0e8;
    border-top: 2px solid #d4af37;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    border: 2px solid #d4af37;
    background-color: #f5f0e8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #3d2817;
    font-weight: 600;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background-color: rgba(212, 175, 55, 0.15);
    border-color: #8b6914;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #8b6914 0%, #a0790e 100%);
    border-color: #ffd700;
    color: #f5f0e8;
    font-weight: 700;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* SEPARADOR VISUAL */
.separator-divider {
    width: 1px;
    background: #d4af37;
    height: 40px;
    margin: 0 10px;
}

/* BOTÃO NOVO LANÇAMENTO */
.action-btn.green {
    background: linear-gradient(135deg, #67c23a 0%, #5daf34 100%);
    border: 2px solid #4cae4c;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.green:hover {
    background: linear-gradient(135deg, #5daf34 0%, #4cae4c 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(103, 194, 58, 0.4);
}

.action-btn.green:active {
    transform: translateY(-1px);
}

.action-btn.green i {
    font-size: 1.2rem;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
    border: 3px solid #d4af37;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 540px;
    width: 90%;
    max-height: 92vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #3d2817 0%, #2c1810 100%);
    padding: 14px 20px;
    border-bottom: 3px solid #d4af37;
    border-radius: 9px 9px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
    margin: 0;
    letter-spacing: 0.5px;
}

.close-modal {
    color: #d4af37;
    font-size: 1.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-modal:hover {
    color: #ffd700;
    background: rgba(212, 175, 55, 0.2);
    transform: rotate(90deg);
}

.modal-tabs-wrapper {
    display: flex;
    gap: 0;
    background: #3d2817;
    border-bottom: 2px solid #8b6914;
}

.modal-tab {
    flex: 1;
    padding: 11px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-right: 1px solid #8b6914;
    background: rgba(0, 0, 0, 0.2);
}

.modal-tab:last-child {
    border-right: none;
}

.modal-tab:hover {
    background: rgba(139, 105, 20, 0.3);
    color: #ffd700;
}

.modal-tab.active {
    background: linear-gradient(135deg, #8b6914 0%, #a0790e 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-tab i {
    font-size: 0.95rem;
}

#financial-form {
    padding: 16px 20px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #3d2817;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 9px 10px;
    border: 2px solid #d4af37;
    border-radius: 6px;
    font-size: 0.92rem;
    background: #fff;
    color: #3d2817;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #8b6914;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.col-grow {
    flex: 1;
}

.form-group.col-fixed {
    width: 108px;
}

.info-badge {
    background: rgba(139, 105, 20, 0.15);
    color: #8b6914;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 6px;
}

.hidden {
    display: none !important;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid #d4af37;
}

.btn-submit {
    padding: 9px 24px;
    background: linear-gradient(135deg, #67c23a 0%, #5daf34 100%);
    border: 2px solid #4cae4c;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #5daf34 0%, #4cae4c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(103, 194, 58, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .financial-controls-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .financial-summary-cards {
        width: 100%;
        justify-content: flex-start;
    }

    .custom-table {
        font-size: 0.8rem;
    }

    .custom-table thead th,
    .custom-table tbody td {
        padding: 10px;
    }

    .fin-card {
        flex: 1;
        min-width: auto;
    }
}
