/**
 * iFinance Layout-Specific Styles
 * Page layout and structure styles
 */

/* Page Layout */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 1.5rem 0;
}

/* Header Layout */
.page-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-content {
    flex: 1;
}

.page-header-actions {
    flex-shrink: 0;
}

.page-title {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--ideal-teal);
}

.page-title i {
    margin-right: 0.5rem;
}

.page-subtitle {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Card Layout */
.card-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-grid.cols-1 {
    grid-template-columns: 1fr;
}

.card-grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card-grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Form Layout */
.form-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.form-section-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    margin: 0;
}

.form-section-body {
    padding: 1.5rem;
}

.form-section-footer {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Table Layout */
.table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.table-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-body {
    position: relative;
}

.table-footer {
    background: #f8f9fa;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Filter Layout */
.filter-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.filter-header {
    background: #f8f9fa;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.filter-body {
    padding: 1rem 1.5rem;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Sidebar Layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.sidebar {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    height: fit-content;
}

.content-area {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
}

/* Footer Layout */
.page-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .page-header-actions {
        justify-content: center;
    }

    .card-grid.cols-2,
    .card-grid.cols-3,
    .card-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        grid-template-columns: 1fr;
    }

    .table-header,
    .table-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .action-buttons {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem 0;
    }

    .form-section-body,
    .form-section-header,
    .form-section-footer,
    .table-header,
    .table-footer,
    .filter-body,
    .sidebar,
    .content-area {
        padding: 1rem;
    }

    .dashboard-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
