/* 自定义样式 */
.sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

/* 侧边栏内容区域使用flex布局 */
.sidebar .position-sticky {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 1.5rem); /* 减去pt-3的padding */
}

/* 版权信息固定在底部 */
.sidebar-footer {
    margin-top: auto !important;
}

/* Logo样式 */
.navbar-brand-logo {
    max-height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.nav-link {
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.nav-link:hover,
.nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.nav-link i {
    margin-right: 8px;
    width: 16px;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
}

.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.text-xs {
    font-size: 0.7rem;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* 图表容器 */
.chart-area {
    position: relative;
    height: 300px;
}

.chart-pie {
    position: relative;
    height: 250px;
}

/* 表格样式 */
.table {
    font-size: 0.9rem;
}

.table th {
    background-color: #f8f9fc;
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .chart-area,
    .chart-pie {
        height: 200px;
    }
}

/* 自定义浅色徽章样式 */
.badge-light-success {
    color: #155724;
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
}

.badge-light-warning {
    color: #664d03;
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
}

.badge-light-info {
    color: #055160;
    background-color: #cff4fc;
    border: 1px solid #b6effb;
}

.badge-light-secondary {
    color: #41464b;
    background-color: #e2e3e5;
    border: 1px solid #d3d6db;
}

.badge-light-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
}

/* 组织架构树状图样式 */
.org-tree {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
}

.tree-node {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20px;
    width: 1px;
    height: 100%;
    border-left: 1px dashed #ddd;
}

.tree-node::after {
    content: '';
    position: absolute;
    top: 20px;
    left: -20px;
    width: 15px;
    height: 1px;
    border-top: 1px dashed #ddd;
}

.tree-node:last-child::before {
    height: 20px;
}

.tree-node-content {
    position: relative;
    padding: 8px 12px;
    margin-left: 20px;
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.tree-node-content:hover {
    background: #eaecf4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tree-node-title {
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 4px;
}

.tree-node-meta {
    font-size: 12px;
    color: #858796;
}

.tree-children {
    margin-left: 20px;
    padding-left: 0;
    list-style: none;
}

.tree-root > .tree-node::before,
.tree-root > .tree-node::after {
    display: none;
}

.tree-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    margin-right: 6px;
}

.tree-type-group {
    background-color: #e74a3b;
    color: white;
}

.tree-type-division {
    background-color: #3498db;
    color: white;
}

.tree-type-campus {
    background-color: #2ecc71;
    color: white;
}

.tree-type-regional {
    background-color: #f39c12;
    color: white;
}

.tree-type-value_added {
    background-color: #9b59b6;
    color: white;
}

/* 树状图展开/收缩动画 */
.tree-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tree-expand {
    max-height: 1000px;
    transition: max-height 0.3s ease-in;
}

/* 树状图中的小按钮样式 */
.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.65rem;
    line-height: 1.2;
    border-radius: 0.15rem;
}

/* 树状图中的排序号样式 */
.tree-sort-number {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: normal;
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* 拖拽功能样式 */
.tree-node-content {
    position: relative;
    padding: 8px 12px;
    margin-left: 20px;
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: grab;
}

.tree-node-content:hover {
    background: #eaecf4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tree-node-content.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    cursor: grabbing;
    z-index: 1000;
}

.tree-node-content.drag-over {
    border: 2px dashed #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.tree-node-content.drop-above {
    border-top: 3px solid #28a745;
}

.tree-node-content.drop-below {
    border-bottom: 3px solid #28a745;
}

.tree-node-content.drop-into {
    border: 2px solid #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

/* 拖拽手柄 */
.drag-handle {
    display: inline-block;
    margin-right: 8px;
    color: #adb5bd;
    cursor: grab;
    font-size: 12px;
}

.drag-handle:hover {
    color: #6c757d;
}

.dragging .drag-handle {
    cursor: grabbing;
}

/* 工具提示样式 */
.metric-tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    color: #6c757d;
    cursor: help;
    font-size: 14px;
    text-align: center;
    line-height: 16px;
    border-radius: 50%;
    transition: color 0.3s ease;
}

.metric-tooltip:hover {
    color: #007bff;
}

.tooltip-box {
    position: fixed;
    z-index: 1000;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.tooltip-box.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-box::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #333;
}