/**
 * 财务记录列表全尺寸样式
 * 将财务记录列表的高度和宽度扩大到和容器一样大
 * 适配新的统一表格结构
 */

/* 重置页面布局为全屏模式 */
html, body {
    height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 主容器调整 - 占满除导航栏外的所有空间 */
.container-fluid.main-container {
    height: calc(100vh - 40px) !important; /* 减去导航栏高度40px */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 筛选器区域调整 - 固定高度，不占用过多空间 */
.filter-section {
    flex: 0 0 auto !important;
    height: 50px !important; /* 固定筛选器高度 */
    margin-bottom: 0 !important; /* 去掉底部间距 */
    overflow: hidden !important;
}

.filter-section .card-body {
    padding: 0.3rem 0.75rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

/* 内容行调整 - 占满剩余空间，去掉顶部间距 */
.row.content-row {
    flex: 1 !important;
    height: calc(100vh - 90px) !important; /* 减去导航栏和筛选器高度 */
    margin: 0 !important;
    margin-top: 0 !important; /* 强制去掉顶部间距 */
    padding-top: 0 !important; /* 强制去掉顶部内边距 */
    overflow: hidden !important;
    display: flex !important;
}

/* 左侧边栏调整 - 固定宽度，占满高度，去掉间距 */
#leftSidebar {
    height: 100% !important;
    flex: 0 0 280px !important;
    max-width: 280px !important;
    /* overflow 和 display 由 sidebar-optimize.css 控制 */
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 0 !important; /* 强制去掉底部间距 */
}

/* 左侧边栏卡片去掉间距 */
#leftSidebar .card {
    margin-bottom: 0 !important; /* 强制去掉卡片底部间距 */
}

/* 右侧主内容区域调整 - 占满剩余空间和高度，去掉间距 */
#mainContent {
    height: 100% !important;
    flex: 1 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important; /* 去掉左右内边距，扩大到屏幕边缘 */
    margin: 0 !important;
    padding-left: 0 !important; /* 强制去掉左边距 */
}

/* 强制去掉所有可能的间距 */
.row.mt-0.mb-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 确保筛选器容器紧贴内容 */
.filter-section.card {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #dee2e6 !important; /* 添加底部边框作为分隔 */
}

/* 主内容卡片调整 - 占满主内容区域 */
#mainContent .card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important; /* 去掉圆角，贴合屏幕边缘 */
    overflow: hidden !important;
    border: none !important; /* 去掉边框 */
}

/* 卡片内容区域调整 - 占满卡片空间 */
#mainContent .card-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* 主内容区域容器调整 - 占满卡片内容空间，扩大到屏幕边缘 */
.main-content-area {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 新的统一表格容器样式 */
.table-container {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: none !important;
    border-radius: 0 !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 表格响应式容器 - 占满表格容器 */
.table-responsive {
    height: 100% !important;
    max-height: 100% !important;
    flex: 1 !important;
    overflow: auto !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 表格本身样式 */
.data-table {
    width: 100% !important;
    min-width: 770px !important; /* 保持最小宽度以确保所有列可见 */
    table-layout: fixed !important;
    margin: 0 !important;
}

/* 表格头部样式 */
.data-table thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
}

/* 卡片底部（分页区域）- 固定高度，扩大到屏幕边缘 */
.card-footer {
    flex: 0 0 auto !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    overflow: hidden !important;
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
    border: 1px solid #dee2e6 !important; /* 添加边框 */
    border-top: 1px solid #dee2e6 !important;
    border-radius: 0 !important; /* 去掉圆角 */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 !important;
}

/* 移除旧的分离式表格样式 */
.table-header,
.table-body {
    /* 这些样式已不再需要，因为改用统一表格 */
}

/* 覆盖现有的账户表格容器样式 */
#leftSidebar .table-responsive {
    max-height: none !important;
    height: auto !important;
}

/* 强制覆盖内联样式 */
body .table-container[style] {
    height: 100% !important;
}

body #mainContent .main-content-area[style] {
    height: 100% !important;
    flex: 1 !important;
}

body .row.content-row[style] {
    height: calc(100vh - 90px) !important;
    flex: 1 !important;
}

/* 移除任何固定的calc高度设置 */
.table-container[style*="calc(100vh"] {
    height: 100% !important;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    /* 中等屏幕设备 */
    .container-fluid.main-container {
        height: calc(100vh - 35px) !important;
    }
    
    .row.content-row {
        height: calc(100vh - 85px) !important;
    }
}

@media (max-width: 767.98px) {
    /* 小屏幕设备 */
    .container-fluid.main-container {
        height: calc(100vh - 30px) !important;
    }
    
    .row.content-row {
        height: calc(100vh - 80px) !important;
        flex-direction: column !important;
    }
    
    #leftSidebar {
        height: 200px !important;
        flex: 0 0 auto !important;
        max-width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    #mainContent {
        height: calc(100vh - 280px) !important;
        flex: 1 !important;
    }
}

/* 确保滚动条样式不影响布局 */
.table-responsive::-webkit-scrollbar {
    width: 8px !important;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 4px !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
} 