/* ============================================
   FINDUO - SISTEMA FINANCEIRO
   Estilos Principais
============================================ */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #0f172a;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   TELA DE LOGIN
============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem 1rem;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--card-shadow-lg);
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-logo p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.btn-login {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    background: var(--primary-color);
    border: none;
    transition: all 0.3s ease;
    width: 100%;
    color: white;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-lg);
    color: white;
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: var(--sidebar-bg);
    padding: 1.5rem 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-logo h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo small {
    color: #94a3b8;
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-menu a.active::before {
    height: 60%;
}

.sidebar-menu a i {
    font-size: 1.25rem;
    margin-right: 0.875rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-details {
    flex: 1;
}

.user-details strong {
    color: white;
    font-size: 0.875rem;
    display: block;
    line-height: 1.3;
}

.user-details small {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ============================================
   MENU MOBILE
============================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--card-shadow-lg);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   CARDS
============================================ */
.card-custom {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: none;
    transition: all 0.3s ease;
    height: 100%;
}

.card-custom:hover {
    box-shadow: var(--card-shadow-lg);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.card-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.card-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.card-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.card-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.card-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.value-positive {
    color: var(--secondary-color);
}

.value-negative {
    color: var(--danger-color);
}

/* ============================================
   GRÁFICO
============================================ */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.chart-fake {
    height: 300px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    gap: 0.5rem;
    position: relative;
}

.chart-bar {
    flex: 1;
    background: var(--primary-color);
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 20px;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: translateY(-5px);
}

/* ============================================
   TABELA
============================================ */
.table-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}

.table {
    margin: 0;
    width: 100%;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.table tbody tr {
    transition: background 0.2s ease;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
============================================ */
.badge-custom {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.813rem;
    white-space: nowrap;
    display: inline-block;
}

.badge-entrada {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.badge-saida {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.category-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   BOTÕES
============================================ */
.btn-custom {
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.938rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary-custom {
    background: var(--primary-color);
    color: white;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--card-shadow-lg);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
}

.btn-outline-custom:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* ============================================
   FORMULÁRIOS
============================================ */
.form-control {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.938rem;
}

.form-select {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.input-group-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: none;
    color: #64748b;
    font-weight: 500;
}

/* Radio buttons customizados para tipo de lançamento */
.form-check-input[type="radio"] {
    display: none;
}

.form-check-input[type="radio"]:checked + label .tipo-option {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.tipo-option {
    transition: all 0.2s ease;
    cursor: pointer;
}

.tipo-option:hover {
    border-color: var(--primary-color) !important;
}

/* ============================================
   MODAL
============================================ */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--card-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem;
    gap: 0.5rem;
}

/* ============================================
   ALERTAS
============================================ */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert i {
    font-size: 1.25rem;
}

/* ============================================
   UTILIDADES
============================================ */
.text-muted {
    color: #64748b !important;
}

.small {
    font-size: 0.875rem;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   ANIMAÇÕES
============================================ */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ============================================
   ESTADOS DE LOADING
============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}