/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Estilos para a página de login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    width: 150px;
    height: auto;
    margin-bottom: 30px;
}

.login-title {
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Layout principal do sistema */
.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8f9fa;
}

.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 40px;
    margin-right: 20px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    color: #666;
}

.logout-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

/* Navegação */
.nav-menu {
    background: #343a40;
    padding: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #495057;
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Conteúdo principal */
.content-wrapper {
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 20px;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar {
    width: 350px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

/* Fluxo de caixa */
.fluxo-caixa {
    margin-bottom: 20px;
}

.fluxo-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.saldo-atual {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.saldo-valor {
    font-size: 24px;
    font-weight: bold;
}

.saldo-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Formulários */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.form-col-2 {
    flex: 2;
}

.form-col-3 {
    flex: 3;
}

/* Tabelas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsividade */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 1; /* Sidebar aparece depois do conteúdo principal no mobile */
    }
    
    .main-content {
        order: 0; /* Conteúdo principal aparece primeiro no mobile */
    }
    
    .nav-list {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .content-wrapper {
        padding: 10px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .sidebar {
        padding: 15px;
    }
}

/* Estilos para parcelamento */
.parcelas-preview {
    margin-top: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.parcelas-header {
    background: #f8f9fa;
    padding: 15px;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
}

.parcela-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f3f4;
}

.parcela-item:last-child {
    border-bottom: none;
}

.parcela-numero {
    font-weight: 600;
    color: #667eea;
}

.parcela-data input {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 14px;
}

.parcela-valor {
    font-weight: 600;
    color: #28a745;
}

/* Estilos para radio buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-item input[type="radio"] {
    margin: 0;
}

.radio-item label {
    margin: 0;
    cursor: pointer;
}

/* Select customizado */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Máscaras de entrada */
.currency-input {
    text-align: right;
}
