/* ============================================
   FIN AnoIG - Estilos CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ============================================
   Layout Principal
   ============================================ */

.app-container {
    display: flex;
    height: 100vh;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

.app-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.app-body {
    display: flex;
    flex: 1;
    margin-top: 60px;
}

.app-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    z-index: 999;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    background-color: #f5f5f5;
    color: #667eea;
}

.nav-link.active {
    background-color: #f0f2ff;
    color: #667eea;
    border-left-color: #667eea;
}

.app-main {
    flex: 1;
    margin-left: 280px;
    overflow-y: auto;
    padding: 30px;
}

/* ============================================
   Páginas e Conteúdo
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.filters {
    display: flex;
    gap: 10px;
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-form select,
.filter-form button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-form select {
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.content-grid .card:nth-child(2) {
    grid-column: 2 / 3;
    grid-row: 1 / span 1;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.card-body {
    padding: 20px;
}

.card-value {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.card-success {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
}

.card-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

/* ============================================
   Cards Grid (Dashboard)
   ============================================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cards-grid .card {
    position: relative;
}

/* ============================================
   Gráficos
   ============================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.charts-grid .full-width {
    grid-column: 1 / -1;
}

/* ============================================
   Formulários
   ============================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ============================================
   Botões
   ============================================ */

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-info {
    background: #45B7D1;
    color: white;
}

.btn-info:hover {
    background: #2e8fa0;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================
   Tabelas
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    font-size: 12px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #fafafa;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

/* ============================================
   Alertas
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-color: #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left-color: #2196f3;
}

/* ============================================
   Texto
   ============================================ */

.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.text-success {
    color: #4CAF50;
}

.text-danger {
    color: #f44336;
}

.text-warning {
    color: #ff9800;
}

/* ============================================
   Utilitários
   ============================================ */

.full-width {
    grid-column: 1 / -1;
}

.money-input {
    font-family: 'Courier New', monospace;
}

.hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

/* ============================================
   Responsivo - Tablet
   ============================================ */

@media (max-width: 1024px) {
    .app-sidebar {
        width: 200px;
    }

    .app-main {
        margin-left: 200px;
        padding: 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filter-form {
        flex-wrap: wrap;
    }
}

/* ============================================
   Responsivo - Mobile
   ============================================ */

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s;
        width: 280px;
        z-index: 998;
        height: calc(100vh - 60px);
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.active {
        left: 0;
    }

    .app-main {
        margin-left: 0;
        padding: 15px;
    }

    .menu-toggle {
        display: flex;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 22px;
    }

    .filters {
        width: 100%;
    }

    .filter-form {
        flex-direction: column;
        width: 100%;
    }

    .filter-form select,
    .filter-form button {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
}

/* ============================================
   Cores de Texto
   ============================================ */

.expense-row.status-Pago {
    opacity: 0.7;
}

.expense-row.status-Pago {
    background: #f5f5f5;
}

/* ============================================
   Sombras e Efeitos
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in;
}

.alert {
    animation: fadeIn 0.3s ease-in;
}
