/* 主题色变量 */
:root {
    --main-bg: #f8f9fa;
    --main-color: #0d6efd;
    --sidebar-bg: #212529; /* 深灰色 */
    --sidebar-active-bg: #343a40; /* 稍浅的深灰色 */
    --card-bg: #fff;
    --text-color: #222;
    --muted-text: #6c757d;
}

html {
    height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-color);
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* 侧边栏样式 */
.sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .05);
    background-color: var(--sidebar-bg) !important;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #fff;
    background-color: var(--sidebar-active-bg);
    border-left: 3px solid var(--main-color);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* 主内容区域样式 */
main {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* 卡片样式 */
.card, .login-card, .noauth-container {
    background-color: var(--card-bg);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
}

/* 按钮主色 */
.btn, .btn-login {
    font-weight: 500;
    background-color: var(--main-color);
    color: #fff;
    border: none;
}

.btn:hover, .btn-login:hover {
    background-color: #0b5ed7;
    color: #fff;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.04);
}

/* 模态框样式 */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* 统计卡片样式 */
.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.5rem;
    color: white;
}

.bg-primary {
    background-color: #0d6efd !important;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: #0d6efd;
    border-color: #dee2e6;
    background-color: #fff;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0a58ca;
}

/* 搜索区域样式 */
.search-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-filter {
    width: auto;
    min-width: 120px;
}

.search-input-wrapper {
    position: relative;
    width: 250px;
}

.search-input-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-input-wrapper input {
    padding-left: 35px;
}

/* 数据表格信息文本 */
.datatable-info {
    color: #6c757d;
    font-size: 0.875rem;
}

/* 响应式调整 */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        padding: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .search-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
}

body.login-bg {
    background-color: #f8f9fa !important;
}

.sidebar .nav-link.active {
    color: var(--main-color);
    background-color: #fff;
    border-left: 3px solid var(--main-color);
}

/* 确保页面铺满整个屏幕 */
.container-fluid {
    min-height: 100vh;
    padding-left: 0;
    padding-right: 0;
}

/* 确保行容器铺满高度 */
.row {
    min-height: 100vh;
    margin-left: 0;
    margin-right: 0;
}

/* 主内容区域铺满屏幕 */
.col-md-9.ms-sm-auto.col-lg-10,
main.col-md-9.ms-sm-auto.col-lg-10 {
    min-height: 100vh;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* 针对使用独立布局的页面 */
.container.py-4 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 卡片容器优化 */
.card.shadow-sm {
    flex: 1;
    margin-bottom: 0;
}

/* 表格容器高度优化 */
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.table-responsive {
    flex: 1;
    border-radius: 0.375rem;
}

/* 搜索区域优化 */
.search-bar {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* 强制覆盖Bootstrap的col类 */
#sidebar {
    transition: all 0.3s ease !important;
}

#sidebar.sidebar-collapsed {
    /* 直接设置宽度，覆盖所有Bootstrap类 */
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
    overflow: hidden !important;
}

/* 强制覆盖Bootstrap的col-md-3 col-lg-2 */
#sidebar.sidebar-collapsed.col-md-3,
#sidebar.sidebar-collapsed.col-lg-2 {
    width: 60px !important;
    flex: 0 0 60px !important;
    max-width: 60px !important;
}

/* 收起时隐藏文字 */
#sidebar.sidebar-collapsed .sidebar-header h2,
#sidebar.sidebar-collapsed .nav-link span,
#sidebar.sidebar-collapsed .nav-link .ms-auto,
#sidebar.sidebar-collapsed .collapse,
#sidebar.sidebar-collapsed .user-info {
    display: none !important;
}

/* 收起时图标居中 */
#sidebar.sidebar-collapsed .nav-link {
    text-align: center !important;
    justify-content: center !important;
    padding: 0.75rem 0.5rem !important;
}

/* 主内容区域调整 */
main.main-expanded {
    /* 当侧边栏收起时，主内容区域占满剩余空间 */
    flex: 1 1 auto !important;
    max-width: calc(100% - 60px) !important;
    width: calc(100% - 60px) !important;
    margin-left: 0 !important;
    transition: all 0.3s ease !important;
}

/* 强制覆盖Bootstrap的main col类 */
main.main-expanded.col-md-9,
main.main-expanded.col-lg-10 {
    flex: 1 1 auto !important;
    max-width: calc(100% - 60px) !important;
    width: calc(100% - 60px) !important;
}

/* 容器和行的基础样式 */
.container-fluid {
    padding: 0 !important;
}

.row {
    margin: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
}

/* 侧边栏收起按钮样式优化 */
#sidebar-toggle {
    border: 2px solid #007bff !important;
    background: rgba(255,255,255,0.1) !important;
    color: #007bff !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    min-width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#sidebar-toggle:hover {
    background: rgba(0,123,255,0.1) !important;
    color: #007bff !important;
    border-color: #007bff !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3) !important;
}

#sidebar-toggle i {
    font-size: 16px !important;
    transition: transform 0.2s ease !important;
}

#sidebar-toggle:hover i {
    transform: scale(1.1) !important;
}

/* 展开按钮（不再需要，隐藏） */
.expand-btn {
    display: none !important;
} 