/* 自定义样式 - 医院管理后台 */

/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,body{
    font-size:14px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    overflow-x: hidden;
}
form .form-row{
    display: flex;
    flex-direction: row;
    align-items: center;
    padding:5px;
}
form .form-row .form-label{
    width: auto;
    padding:0 5px;
    margin-bottom: 0;
}
form .form-row .form-control,form .form-row .form-select,form .form-row .icon-selector{
    flex:1
}
.form-row.px-form{
    padding-right: 10px !important;
    padding-left: 10px !important;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: 260px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* 侧边栏折叠状态 */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .sidebar-header small,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .user-avatar {
    width: 40px;
    height: 40px;
}

/* 侧边栏头部 */
.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 5px;
    margin-left:10px;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

/* 用户信息 */
.btn-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.btn-user:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-user:focus,
.btn-user:active {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: none;
}

.btn-user .user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.btn-user .user-avatar-sm .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-user .user-avatar-sm i {
    font-size: 1.2rem;
}

.btn-user .user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-user .bi-chevron-down {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
}

.btn-user[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    border-radius: 12px;
    min-width: 260px;
    padding: 8px 0;
    margin-top: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 下拉菜单头部 */
.dropdown-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-md {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.user-avatar-md .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-md i {
    font-size: 1.8rem;
}

.user-details {
    flex: 1;
}

.user-fullname {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.badge-super {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
}

.badge-admin {
    background: #e8f4f8;
    color: #17a2b8;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
}

/* 下拉菜单项 */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.dropdown-item i {
    width: 20px;
    font-size: 1.1rem;
    color: #999;
}

.dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 24px;
}

.dropdown-item:hover i {
    color: #667eea;
}

.dropdown-item.text-danger i {
    color: #dc3545;
}

.dropdown-item.text-danger:hover {
    background: #fff5f5;
}

.dropdown-item.text-danger:hover i {
    color: #dc3545;
}

.dropdown-divider {
    margin: 8px 0;
    background: #f0f0f0;
}

/* 导航菜单 */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid white;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.2rem;
    min-width: 24px;
}

.nav-label {
    flex: 1;
    font-size: 0.95rem;
}

.nav-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    min-width: 20px;
    text-align: center;
}

/* 子菜单 */
.sub-menu {
    list-style: none;
    padding-left: 45px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sub-menu.show {
    max-height: 500px;
}

.sub-menu .nav-link {
    padding: 8px 15px;
    font-size: 0.85rem;
}

.has-submenu > .nav-link::after {
    content: '\f282';
    font-family: bootstrap-icons;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.has-submenu.open > .nav-link::after {
    transform: rotate(180deg);
}

/* 主内容区域 */
.main-content {
    margin-left: 260px;
    transition: all 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* 顶部导航栏 */
.top-navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #667eea;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    transform: scale(1.1);
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

/* 内容区域 */
.content-wrapper {
    padding: 20px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: transparent;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
}

/* 表单样式 */
.form-control {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 警告框样式 */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 徽章样式 */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    font-weight: 500;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
}

.page-link {
    border-radius: 5px;
    margin: 0 3px;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        padding-top: 0;
        height: auto;
    }
    
    main {
        padding: 15px;
    }
    
    .card:hover {
        transform: none;
    }
}

/* 加载动画 */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 统计卡片颜色变体 */
.card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: white;
}

.card-warning {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
}

.card-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 仪表板专用样式 */
.stat-card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0;
}

.stat-info p {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 图表容器 */
.chart-container {
    position: relative;
    margin: 20px 0;
}

/* 活动列表 */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s ease;
}

.activity-item:hover {
    background: #f8f9fa;
    padding-left: 10px;
}

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

/* 快速操作按钮 */
.quick-action {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-action:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
}

.quick-action:hover i {
    color: white !important;
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

/* 系统状态 */
.system-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status-label {
    font-size: 0.85rem;
    color: #666;
}

.status-value {
    font-weight: bold;
}

.progress {
    height: 8px;
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stat-info h3 {
        font-size: 1.3rem;
    }
    
    .quick-action {
        padding: 15px;
    }
    
    .quick-action i {
        font-size: 1.5rem;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表格操作按钮 */
.table-actions .btn {
    padding: 0.25rem 0.5rem;
    margin: 0 2px;
    font-size: 0.875rem;
}

/* 面包屑导航 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

/* 工具类 */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}


.report-tab {
    cursor: pointer;
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.report-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.report-tab:hover:not(.active) {
    background: #f0f0f0;
}

.report-card {
    border: none;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.report-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.abnormal-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.normal-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.image-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
}

.image-gallery {
    display: flex;
    overflow-x: auto;
    gap: 10px;
}

.image-item {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: scale(1.05);
}

/* ========== Toast 消息提示样式 ========== */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 200px;
    max-width: 400px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    pointer-events: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-message.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.toast-message.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast-message.warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
}

.toast-message.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* 加载遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}