/**
 * 社康中心绩效核算系统 - 样式表
 * 现代医疗行业风格
 */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: #f0f2f5;
    color: #333;
    font-size: 14px;
}

/* ========== 主容器布局 ========== */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    width: 260px;
    background: #1b2a3d;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1b2a3d;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #3d5a80;
    border-radius: 3px;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    color: white;
    text-align: center;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header small {
    opacity: 0.8;
    font-size: 12px;
}

.sidebar-menu {
    padding: 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu .menu-title {
    padding: 12px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-menu .menu-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.sidebar-menu .menu-item.active {
    background: rgba(46, 125, 50, 0.2);
    color: #4caf50;
    border-left-color: #4caf50;
}

.sidebar-menu .menu-item i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-menu .submenu {
    list-style: none;
    padding-left: 34px;
    margin: 0;
    display: none;
}

.sidebar-menu .has-submenu.open .submenu {
    display: block;
}

.sidebar-menu .submenu-item {
    display: block;
    padding: 10px 20px 10px 34px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu .submenu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.sidebar-menu .submenu-item.active {
    background: rgba(46, 125, 50, 0.15);
    color: #4caf50;
    border-left-color: #4caf50;
}

.sidebar-menu .toggle-icon {
    float: right;
    transition: transform 0.3s;
}

.sidebar-menu .has-submenu.open .toggle-icon {
    transform: rotate(90deg);
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 顶部导航 ========== */
.top-navbar {
    background: white;
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-navbar .navbar-brand {
    display: flex;
    align-items: center;
    color: #2e7d32;
    font-weight: 600;
    font-size: 18px;
}

.top-navbar .navbar-brand i {
    margin-right: 10px;
    font-size: 24px;
}

.top-navbar .navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-navbar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.top-navbar .user-name {
    font-weight: 500;
}

.top-navbar .user-role {
    font-size: 12px;
    color: #6c757d;
}

.top-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.top-navbar .dropdown-item {
    padding: 10px 20px;
}

.top-navbar .dropdown-item i {
    width: 20px;
    color: #6c757d;
}

/* ========== 页面内容区 ========== */
.page-content {
    padding: 24px;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.page-title i {
    color: #2e7d32;
    margin-right: 10px;
}

/* ========== 统计卡片 ========== */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2e7d32;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.stat-card.blue::before { background: #1976d2; }
.stat-card.green::before { background: #2e7d32; }
.stat-card.orange::before { background: #ff9800; }
.stat-card.red::before { background: #e53935; }
.stat-card.purple::before { background: #7b1fa2; }
.stat-card.cyan::before { background: #0097a7; }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.stat-card .stat-icon.blue { background: rgba(25, 118, 210, 0.1); color: #1976d2; }
.stat-card .stat-icon.green { background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.stat-card .stat-icon.orange { background: rgba(255, 152, 0, 0.1); color: #ff9800; }
.stat-card .stat-icon.red { background: rgba(229, 57, 53, 0.1); color: #e53935; }
.stat-card .stat-icon.purple { background: rgba(123, 31, 162, 0.1); color: #7b1fa2; }
.stat-card .stat-icon.cyan { background: rgba(0, 151, 167, 0.1); color: #0097a7; }

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #6c757d;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 10px;
}

.stat-card .stat-change.up { color: #2e7d32; }
.stat-card .stat-change.down { color: #e53935; }

/* ========== 内容卡片 ========== */
.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.content-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.content-card .card-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.content-card .card-header h5 i {
    color: #2e7d32;
    margin-right: 8px;
}

.content-card .card-body {
    padding: 20px;
}

/* ========== 表格样式 ========== */
.table-wrapper {
    overflow-x: auto;
}

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

.data-table thead th {
    background: #1b2a3d;
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
    white-space: nowrap;
}

.data-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.data-table tbody tr:hover {
    background: #f0f7f0;
}

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

.data-table .action-btns {
    display: flex;
    gap: 8px;
}

.data-table .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #2e7d32;
    color: white;
}

.btn-primary:hover {
    background: #1b5e20;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    color: white;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #388e3c;
    color: white;
}

.btn-danger {
    background: #e53935;
    color: white;
}

.btn-danger:hover {
    background: #c62828;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    color: white;
}

.btn-info {
    background: #1976d2;
    color: white;
}

.btn-info:hover {
    background: #1565c0;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid #2e7d32;
    color: #2e7d32;
}

.btn-outline-primary:hover {
    background: #2e7d32;
    color: white;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.form-group label .required {
    color: #e53935;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-control.is-invalid {
    border-color: #e53935;
}

.invalid-feedback {
    color: #e53935;
    font-size: 12px;
    margin-top: 5px;
}

/* ========== 快捷入口 ========== */
.quick-access {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.quick-access-item {
    width: calc(16.666% - 15px);
    min-width: 140px;
    padding: 20px 15px;
    background: white;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-access-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #333;
}

.quick-access-item i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.quick-access-item.blue i { color: #1976d2; }
.quick-access-item.green i { color: #2e7d32; }
.quick-access-item.orange i { color: #ff9800; }
.quick-access-item.red i { color: #e53935; }
.quick-access-item.purple i { color: #7b1fa2; }
.quick-access-item.cyan i { color: #0097a7; }

.quick-access-item span {
    font-size: 13px;
    font-weight: 500;
}

/* ========== 状态标签 ========== */
.badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.badge-primary { background: #2e7d32; color: white; }
.badge-secondary { background: #6c757d; color: white; }
.badge-success { background: #4caf50; color: white; }
.badge-danger { background: #e53935; color: white; }
.badge-warning { background: #ff9800; color: white; }
.badge-info { background: #1976d2; color: white; }

/* ========== 警告框 ========== */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    border: none;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-danger {
    background: rgba(229, 57, 53, 0.1);
    color: #c62828;
    border-left: 4px solid #e53935;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.alert-info {
    background: rgba(25, 118, 210, 0.1);
    color: #1565c0;
    border-left: 4px solid #1976d2;
}

/* ========== 模态框 ========== */
.modal-content {
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
    color: white;
    border: none;
    padding: 18px 24px;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

/* ========== 分页 ========== */
.pagination {
    margin: 20px 0;
    justify-content: center;
}

.pagination .page-link {
    color: #2e7d32;
    border-color: #ddd;
    padding: 8px 14px;
}

.pagination .page-item.active .page-link {
    background: #2e7d32;
    border-color: #2e7d32;
    color: white;
}

.pagination .page-link:hover {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 38px;
}

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

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-navbar {
        padding: 0 15px;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .quick-access-item {
        width: calc(50% - 10px);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 12px;
    }
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 10px;
}

/* ========== 面包屑 ========== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #2e7d32;
}

/* ========== 底部 ========== */
.footer {
    background: white;
    padding: 15px 24px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

/* ========== 辅助类 ========== */
.text-primary { color: #2e7d32 !important; }
.text-success { color: #4caf50 !important; }
.text-danger { color: #e53935 !important; }
.text-warning { color: #ff9800 !important; }
.text-info { color: #1976d2 !important; }

.bg-primary-light { background: rgba(46, 125, 50, 0.1); }
.bg-success-light { background: rgba(76, 175, 80, 0.1); }
.bg-danger-light { background: rgba(229, 57, 53, 0.1); }
.bg-warning-light { background: rgba(255, 152, 0, 0.1); }

/* 小按钮 */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* 卡片悬浮效果 */
.hover-shadow:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(90deg, #2e7d32 0%, #4caf50 100%);
}

/* 步骤条 */
.step-wizard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #ddd;
}

.step-item:last-child::after {
    display: none;
}

.step-item.completed::after {
    background: #2e7d32;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.step-item.active .step-icon,
.step-item.completed .step-icon {
    background: #2e7d32;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.step-item.active .step-label {
    color: #2e7d32;
    font-weight: 600;
}
