/* 主�局样式 */
/* 登录容器 */
/* 登录表单 */
/* 侧边列表栏 */
/*反馈文本*/



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}

#login-message {/*登录反馈文本*/
    margin-top: 15px;
    text-align: center;
    color: red;
}

.dashboard {
    display: flex;  /*弹性布局*/
    flex-direction: column; /*行方向*/
    height: 100vh;/* /*高度*/
}

.sidebar {
    max-width: 100%;
    background-color: #067aaf;
    color: rgb(247, 245, 245);
    padding: 10px;
    position: relative;/*相对定位*/
    height: 9%;

}

.sidebar h3 {
    margin-bottom:5px;
    margin-left: 10px;
   
}

.sidebar ul {
    list-style: none;/*无列表样式*/
    padding: 0;
    display: flex;   
    flex-direction: row;

}

.sidebar ul li {
    margin-bottom: 5px;
    flex-direction: row;

}

.sidebar ul li a {
    color: white;
    text-decoration: none;/*无下划线*/
    display: block;
    padding: 8px 10px;
    border-radius: 4px; 
    font-weight: bold;
    
}

.sidebar ul li a:hover {
    background-color: #afe9f4;
    color: rgb(21, 12, 0);
}
.menu-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
#user_info:hover,#logout_button:hover {
   background-color: #afe9f4;
    color: rgb(21, 12, 0);
    font-weight: bold;
}


.menu-item {
    margin-top: 10px;
}

.menu-title {
    display: block;
    padding: 8px 12px;
    font-weight: bold;
    color: #ccc;
    cursor: pointer;
    position: relative;
}

.menu-title::after {/*下拉箭头*/
    content: '▼';
    position: absolute;
    right: 12px;
    font-size: 10px;
    transition: transform 0.3s;
}

/*.menu-title.expanded::after {
    transform: rotate(180deg);/*旋转*/
/*}*/

.sub-menu {
    margin-left: 20px;
    margin-top: 5px;
    display: none;
}

.sub-menu.show {
    display: block;
}

.sub-menu li {
    margin-bottom: 3px;
}

.sub-menu li a {
    padding: 6px 12px;
    font-size: 14px;
}

.content {
    flex: 1;/*自适应宽度*/
    padding: 2px 10px 10px 10px;
    overflow-y: auto;/*自动滚动条*/  
    margin-top: 3px; 
}

.content h2 {
    margin-bottom: 20px;
}
.index-card {
    background-color: white;
    padding: 5px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 2px;/*外边距*/
    height: 12%;
}

.card {
    background-color: white;
    padding: 11px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 5px;/*外边距*/
}
.submit-container{
    max-height: 130px;/*最大高度*/
    height: 120px;/*自动高度*/
    border-radius: 8px;/*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 10px;/*外边距*/
    background-color: white;
    display: flex;  

    /*align-items: flex-end;*/
}
.submit-container textarea {
    width:85%;
    height: 80%;
    align-self: flex-start;/*左对齐*/
    background-color: white;/*背景颜色*/
    padding: 10px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-top: 15px;/*外边距*/
    margin-bottom: 15px;
    margin-left: 10px;
    min-height: 40px;/*最小高度*/
    max-height: 100px;/*最大高度，不超过容器*/
    /*height: auto;/*自动高度*/
    font-size: 13px;/*字体大小*/
    resize: none;/*禁止手动调整大小*/
    overflow-y: auto;/*垂直滚动*/
}

.submit-container button {
    width: 85%;
   /* height: 85%;*/
    background-color: gray;
    /*align-self: flex-end;*/
    display: auto;/*自动布局*/
    gap: 30px;
    align-self: flex-end;/*右对齐*/   
    padding: 10px 20px;/*内边距*/
    margin-top: 15px;/*外边距*/
    margin-bottom: 10px;/*外边距*/
    margin-right: 10px;/*右外边距*/
    margin-left: 10px;/*左外边距*/
    border-radius: 8px;/*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    /* flex-direction: column !important; */
    font-size: clamp(10px, 1.2vw, 14px);/*字体大小*/
    font-family: '微软雅黑';/*字体*/
    font-weight: bold;/*字体加粗*/  
    justify-content: center;  /* 水平居中 */
    align-items: center;      /* 垂直居中 */
    

}
.submit-container button:hover {
    background-color: #4CAF50;
    color: white;
}

.content h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

.content h3 {
    margin-bottom: 15px;
    font-size: 15px;
}


.chart-container {
    max-height: 300px;
    margin-top: 20px;
}


.stats {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 1px;
    background-color: #f9f9fa;
    border-radius: 5px;
    max-height: 10%;
    max-width: 80%;
}


.stat-item h4 {
    margin-bottom:10px;
    color: #404042;
}

.stat-item p {
    font-size:13px;
    font-weight: bold;
    color: #333;
}

.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background-color: white;
    width: 100%;
    min-height: 38px;
    text-align: left;
}

.multi-select-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
}

.multi-select-dropdown.show {
    display: block;
}

.search-input {
    width: 100%;
    padding: 4px 4px;
    border: none;
    border-bottom: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
    font-size: 10px;
    outline: none;
    background-color: #f8f9fa;
}

.search-input:focus {
    background-color: white;
}

.options-wrapper {
    max-height: 220px;
    overflow-y: auto;
}

.multi-select-dropdown label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.multi-select-dropdown label:last-child {
    border-bottom: none;
}

.multi-select-dropdown label:hover {
    background-color: #e8f4ea;
}

.multi-select-dropdown label.selected {
    background-color: #d4edda;
}

.multi-select-dropdown input[type="checkbox"] {
    margin-right: 10px;
    max-width: 16px;
    max-height: 16px;
    cursor: pointer;
    accent-color: #4CAF50;
   
}

.no-results {
    padding: 15px 12px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 全选样式 */
.select-all {
    background-color: #e3f2fd;
    font-weight: bold;
    border-bottom: 2px solid #2196F3;
}

.select-all:hover {
    background-color: #bbdefb;
}

/* 标签容器样式 */
.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    max-height: 60px;
    overflow-y: auto;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background-color: #e8f4ea;
    border-radius: 4px;
    font-size: 11px;
    color: #333;
    border: 1px solid #4CAF50;
}

.tag .close-btn {
    margin-left: 4px;
    cursor: pointer;
    color: #f44336;
    font-weight: bold;
}

.tag .close-btn:hover {
    color: #d32f2f;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    max-width: 100%;
    max-height: 60px;
    overflow-y: auto;
}

.tag {
    background: #4CAF50;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tag .close-btn {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    margin-left: 2px;
    padding: 0 2px;
}

.tag .close-btn:hover {
    color: #ffcccc;
}


.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}


/* 平板端适配 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

  .dashboard {      
        flex-direction: column;
    }
}

/* 手机端适配 (<768px) */
@media (max-width: 768px) {    
    .sidebar {
        max-width: 100%;
        padding: 0px;
        position: relative;
        font-size: 10px;
        max-height: 25%;
    }
    .sidebar ul {
        max-height: 30%;
        font-size: 8px;
    }
    
    .content {
        padding: 10px 5px;
        width: 100%;
    }
    .card {
        font-size: 6px;
    }
     .card h3{
        font-size: 10px;
    }
    .card p{
        font-size: 5px;
    }
    .filters {
        font-size: 8px;
    }
    .sub-menu li a {
    padding: 6px 12px;
    font-size: 6px;
    }
    .filter-item label {
    font-size: 6px;
    }
      .multi-select-input {
        width: 100%;       /* 全屏宽度 */
        max-width: 280px;  /* 最大宽度限制 */
        height: 35px;      /* 更大的点击区域 */
        padding: 10px 14px;
        font-size: 10px;   /* 更大的字体便于阅读 */
        box-sizing: border-box;/* 包含内边距和边框在宽度内 */
        gap: 7px;/* 选项之间的间距 */
    }
    .filter-item input[type="date"] {
        width: 100%;
        max-width: 280px;
        height: 35px;
        padding: 10px 14px;
        font-size: 13px;
        box-sizing: border-box;/* 包含内边距和边框在宽度内 */
        margin-bottom: 8px;    /* 下方间距 */
        margin-top: 4px;        /* 上方间距 */
    }

    /* 如果 filter-item 是 flex 容器，可以添加 gap */
    .filter-item {
        gap: 3px;  /* label 和 input 之间的间距 */
    }
    .filter-item .filter-button {
        width: 100%;
        margin-bottom: 8px;
        height: 35px;
        box-sizing: border-box;
        font-size: 13px;
        gap:10px;
    }


/* 平板适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .dashboard {
        display: flex;
        flex-direction: column;
        
    }
    
    #bu-summary-grid .bu-card {
        min-width: 65px !important;
        padding: 5px !important;
    }
    
    #bu-summary-grid .bu-card .bu-name {
        font-size: 13px !important;
    }
    
    #bu-summary-grid .bu-card .bu-amount {
        font-size: 15px !important;
    }
    
    #bu-summary-grid .bu-card .bu-percent {
        font-size: 12px !important;
    }
}

/* 小屏手机适配 (<= 480px) */
@media (max-width: 480px) {
    /* sidebar 小屏手机适配 */
    .sidebar {
        padding: 8px !important;
        font-size: 9px !important;
        position: relative;
        height: auto;
        max-height: none;

    }  
    
    .sidebar ul{
        gap: 3px !important;
        font-size: 11px !important;
        margin-top: -3px !important;
        margin-bottom: -11px !important;
    }    

    #bu-summary-container {
        padding: 10px 15px !important;
    }
    
    #bu-summary-container h4 {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }
    
    #bu-summary-grid .bu-card {
        padding: 6px 4px !important;
    }
    
    #bu-summary-grid .bu-card .bu-name {
        font-size: 11px !important;
    }
    
    #bu-summary-grid .bu-card .bu-amount {
        font-size: 12px !important;
    }
    
    #bu-summary-grid .bu-card .bu-percent {
        font-size: 10px !important;
    }
}

/* 表格排序样式 */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
}

.sortable:hover {
    background-color: #f5f7fa;
}

.sortable::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sort-asc::after {
    border-bottom: 4px solid #1890ff;
}

.sort-desc::after {
    border-top: 4px solid #1890ff;
}

/* 合计行样式 - 永远置底 */
.total-row {
    background-color: #e6f7ff !important;
    font-weight: bold !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

.total-row td {
    border-top: 2px solid #1890ff !important;
}

/* 确保合计行不受排序影响 */
tr.total-row {
    display: table-row !important;
}
.notice {
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: -10px !important;
}
}
