/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1A237E;
    --secondary-color: #5C6BC0;
    --white: #FFFFFF;
    --black: #000000;
    --gray: #37474F;
    --light-gray: #ECEFF1;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light-gray);
    color: var(--gray);
    line-height: 1.6;
}

/* Sidebar Desktop */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.filho-info {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
}

.filho-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.filho-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: var(--white);
    font-size: 32px;
    font-weight: 600;
}

.filho-nome {
    font-weight: 600;
    color: var(--gray);
    font-size: 16px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: var(--light-gray);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: var(--white);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--white);
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--light-gray);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--light-gray);
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar .avatar-placeholder {
    font-size: 18px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-link {
    font-size: 13px;
    color: var(--secondary-color);
    text-decoration: none;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: var(--light-gray);
    color: var(--gray);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

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

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 30px;
    min-height: 100vh;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    color: var(--gray);
    text-decoration: none;
    font-size: 12px;
    position: relative;
    transition: all 0.3s;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item .badge {
    position: absolute;
    top: 8px;
    right: 50%;
    transform: translateX(15px);
    background: var(--danger);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
}

.page-header p {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #0D47A1;
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--gray);
}

.btn-secondary:hover {
    background: #CFD8DC;
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

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

.status-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
}

.status-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

.status-card.warning {
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
    color: var(--white);
}

.status-card.info {
    background: linear-gradient(135deg, #2196F3 0%, #64B5F6 100%);
    color: var(--white);
}

.status-icon {
    flex-shrink: 0;
}

.status-content {
    flex: 1;
}

.status-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.status-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-card.alert-card {
    border: 2px solid var(--warning);
}

/* Lists */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 0;
    border-bottom: 1px solid var(--light-gray);
}

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

.list-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.list-content {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 4px;
}

.list-subtitle {
    font-size: 13px;
    color: #78909C;
}

.list-description {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

.list-time {
    font-size: 12px;
    color: #78909C;
    text-align: right;
}

.list-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.list-actions {
    display: flex;
    gap: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
}

.empty-state-large {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state-large h3 {
    margin: 20px 0 10px;
    color: var(--gray);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #CFD8DC;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #78909C;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
}

.link-small {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

.link-small:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid var(--info);
}

.info-alert {
    background: #E3F2FD;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    gap: 15px;
    color: #1565C0;
}

.info-alert svg {
    flex-shrink: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-warning {
    background: #FFF3E0;
    color: #E65100;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.badge-info {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-category {
    background: var(--light-gray);
    color: var(--gray);
}

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

.summary-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.summary-card.success {
    border-left-color: var(--success);
}

.summary-card.warning {
    border-left-color: var(--warning);
}

.summary-card.danger {
    border-left-color: var(--danger);
}

.summary-label {
    font-size: 13px;
    color: #78909C;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #CFD8DC;
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.table th {
    background: var(--light-gray);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
}

.table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--light-gray);
}

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

.text-muted {
    color: #78909C;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-close:hover {
    background: var(--light-gray);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--light-gray);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Calendar */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.calendar-nav h2 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
    text-transform: capitalize;
}

.calendar-container {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.calendar {
    width: 100%;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
    padding: 12px 4px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 8px;
    position: relative;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    border-color: var(--primary-color);
}

.calendar-day.empty {
    border: none;
    background: transparent;
    cursor: default;
}

.calendar-day.today {
    border-color: var(--primary-color);
    background: rgba(26, 35, 126, 0.05);
}

.calendar-day.has-event {
    background: rgba(26, 35, 126, 0.02);
}

.day-number {
    font-weight: 600;
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 4px;
}

.event-marker {
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    text-align: center;
    font-weight: 600;
}

.event-marker.primary {
    background: var(--primary-color);
    color: var(--white);
}

.event-marker.secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.event-marker.pendente {
    background: var(--warning);
    opacity: 0.7;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.primary {
    background: var(--primary-color);
}

.legend-color.secondary {
    background: var(--secondary-color);
}

.legend-color.pendente {
    background: var(--warning);
}

/* Documents */
.documents-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.document-section {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-title {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-gray);
}

.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.document-card {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.document-preview {
    aspect-ratio: 4/3;
    background: var(--light-gray);
    overflow: hidden;
    cursor: pointer;
}

.document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-ext {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.document-info {
    padding: 16px;
}

.document-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
}

.document-meta {
    font-size: 12px;
    color: #78909C;
    margin-bottom: 8px;
}

.document-notes {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
}

.document-actions {
    display: flex;
    gap: 8px;
}

/* Pix Info */
.pix-info {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pix-info h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.pix-data {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: 6px;
}

.divisao-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: var(--white);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-bottom: 80px;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .status-cards,
    .dashboard-grid,
    .finance-summary {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .calendar-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-day {
        padding: 4px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-marker {
        font-size: 8px;
        padding: 1px 2px;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .documents-list {
        grid-template-columns: 1fr;
    }
}
