/* 耗材库存页面样式 */

/* 通用输入框样式 */
.consumables-inventory-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 13px;
    color: #1d2129;
    background: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.consumables-inventory-input:hover {
    border-color: #a6adb9;
}

.consumables-inventory-input:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

/* 卡片容器 */
.consumables-inventory-card {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

/* 列表区域 */
.consumables-inventory-list {
    height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* 列表头部 */
.consumables-inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.consumables-inventory-title {
    font-size: 16px;
    font-weight: 500;
    color: #303133;
    margin: 0;
}

.consumables-inventory-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.consumables-inventory-btn {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f5f5f5;
    color: #4e5969;
    border: 1px solid #d9d9d9;
}

.consumables-inventory-btn:hover {
    background-color: #e6e6e6;
}

/* 主按钮样式 - 与耗材档案页面新增耗材按钮一致 */
.consumables-inventory-btn-primary {
    background-color: #0052d9;
    color: white;
    border-color: #0052d9;
}

.consumables-inventory-btn-primary:hover {
    background-color: #003bb3;
    border-color: #003bb3;
}

/* 危险按钮样式 */
.consumables-inventory-btn-danger {
    background-color: #f53f3f;
    color: white;
    border-color: #f53f3f;
}

.consumables-inventory-btn-danger:hover {
    background-color: #e53d3d;
}

.consumables-inventory-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* 表格容器 */
.consumables-inventory-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    padding: 0;
}

/* 表格样式 */
.consumables-inventory-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 1500px;
}

.consumables-inventory-table th,
.consumables-inventory-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ebeef5;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

.consumables-inventory-table th {
    background-color: #f5f7fa;
    font-weight: 500;
    color: #303133;
    position: sticky;
    top: 0;
    z-index: 10;
}

.consumables-inventory-table td {
    color: #4e5969;
}

/* 字段居中：库存状态(4)、重量(5)、长度(6)、高度(7)、宽度(8)、体积(9)、当前库存(10)、3天出库量(11)、7天出库量(12)、15天出库量(13)、30天出库量(14) */
.consumables-inventory-table th:nth-child(4),
.consumables-inventory-table td:nth-child(4),
.consumables-inventory-table th:nth-child(5),
.consumables-inventory-table td:nth-child(5),
.consumables-inventory-table th:nth-child(6),
.consumables-inventory-table td:nth-child(6),
.consumables-inventory-table th:nth-child(7),
.consumables-inventory-table td:nth-child(7),
.consumables-inventory-table th:nth-child(8),
.consumables-inventory-table td:nth-child(8),
.consumables-inventory-table th:nth-child(9),
.consumables-inventory-table td:nth-child(9),
.consumables-inventory-table th:nth-child(10),
.consumables-inventory-table td:nth-child(10),
.consumables-inventory-table th:nth-child(11),
.consumables-inventory-table td:nth-child(11),
.consumables-inventory-table th:nth-child(12),
.consumables-inventory-table td:nth-child(12),
.consumables-inventory-table th:nth-child(13),
.consumables-inventory-table td:nth-child(13),
.consumables-inventory-table th:nth-child(14),
.consumables-inventory-table td:nth-child(14) {
    text-align: center;
}

.consumables-inventory-table tbody tr:hover {
    background: #f5f7fa;
}

/* 排序表头样式 */
.consumables-inventory-table .sortable {
    cursor: pointer;
    user-select: none;
}

.consumables-inventory-table .sortable:hover {
    background: #e8e9eb;
}

.consumables-inventory-table .sort-indicator {
    margin-left: 4px;
    color: #0052d9;
    font-weight: bold;
}

/* 分页区域 */
.consumables-inventory-pagination {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.consumables-inventory-pagination-info {
    font-size: 14px;
    color: #4b5563;
}

.consumables-inventory-pagination-controls {
    display: flex;
    gap: 8px;
}

.consumables-inventory-pagination-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.consumables-inventory-pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.consumables-inventory-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.consumables-inventory-page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4b5563;
}

.consumables-inventory-page-size-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.consumables-inventory-page-size-select:focus {
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

/* 搜索区域样式 */
.consumables-inventory-search-form {
    background: #ffffff;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 组合搜索框样式 */
.consumables-inventory-search-field .consumables-inventory-search-combined {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e5e6eb;
    width: 100%;
    min-width: 200px;
}

.consumables-inventory-search-field .consumables-inventory-search-type {
    width: 100px;
    height: 36px;
    border: none;
    border-right: 1px solid #e5e6eb;
    border-radius: 0;
    padding: 0 12px;
    cursor: pointer;
    margin: 0;
    background-color: #ffffff;
    font-size: 13px;
}

.consumables-inventory-search-field .consumables-inventory-search-value {
    flex: 1;
    border: none;
    border-radius: 0;
    height: 36px;
    background: #ffffff;
    padding: 0 12px;
    margin: 0;
    font-size: 13px;
}

.consumables-inventory-search-field .consumables-inventory-search-type:focus,
.consumables-inventory-search-field .consumables-inventory-search-value:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumables-inventory-search-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.consumables-inventory-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.consumables-inventory-search-label {
    font-size: 13px;
    font-weight: 500;
    color: #1d2129;
    min-width: 80px;
}

.consumables-inventory-search-select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    vertical-align: middle;
    box-sizing: border-box;
}

/* 新建耗材入库单弹窗样式 */
.grn-add-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grn-add-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.grn-add-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background-color: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.grn-add-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.grn-add-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.grn-add-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.grn-add-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.grn-add-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.grn-add-basic-info {
    margin-bottom: 24px;
}

.grn-add-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
}

.grn-add-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grn-add-form-group {
    display: flex;
    flex-direction: column;
}

.grn-add-full-width {
    grid-column: span 3;
}

.grn-add-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.grn-add-required {
    color: #ff4d4f;
    margin-left: 4px;
}

.grn-add-input, .grn-add-select, .grn-add-textarea {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #212529;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.grn-add-input:focus, .grn-add-select:focus, .grn-add-textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.grn-add-textarea {
    resize: vertical;
    min-height: 80px;
}

.grn-add-owner-select-container {
    position: relative;
    display: flex;
    align-items: center;
}

.grn-add-owner-input {
    flex: 1;
    padding-right: 40px;
    cursor: pointer;
}

.grn-add-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    fill: #6c757d;
    opacity: 0.7;
}

.grn-add-owner-clear-btn {
    position: absolute;
    right: 40px;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background-color: #f8f9fa;
    transition: all 0.2s;
}

.grn-add-owner-clear-btn:hover {
    background-color: #e9ecef;
}

.grn-add-clear-icon {
    width: 16px;
    height: 16px;
    fill: #6c757d;
}

.grn-add-list-section {
    margin-top: 24px;
}

.grn-add-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.grn-add-btn {
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #ffffff;
    color: #495057;
}

.grn-add-primary {
    background-color: #1890ff;
    border-color: #1890ff;
    color: #ffffff;
}

.grn-add-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.grn-add-danger {
    background-color: #ff4d4f;
    border-color: #ff4d4f;
    color: #ffffff;
}

.grn-add-danger:hover {
    background-color: #ff7875;
    border-color: #ff7875;
}

.grn-add-cancel {
    background-color: #ffffff;
    border-color: #d9d9d9;
    color: #495057;
}

.grn-add-cancel:hover {
    border-color: #40a9ff;
    color: #40a9ff;
}

.grn-add-table-container {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

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

.grn-add-table th {
    background-color: #f8f9fa;
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.grn-add-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}

.grn-add-table tr:last-child td {
    border-bottom: none;
}

.grn-add-quantity-input, .grn-add-amount-input {
    width: 120px;
}

.grn-add-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
}

.grn-add-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.grn-add-empty-text {
    font-size: 16px;
}

.grn-add-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    gap: 12px;
}

/* 库存状态标签样式 */
.inventory-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.inventory-status.normal {
    background-color: #e8f5e8;
    color: #52c41a;
}

.inventory-status.warning {
    background-color: #fff7e6;
    color: #fa8c16;
}

.inventory-status.out-of-stock {
    background-color: #fff2f0;
    color: #ff4d4f;
}

/* 库存数量样式 */
.inventory-quantity {
    font-weight: 600;
    color: #1890ff;
}

.inventory-quantity.low {
    color: #fa8c16;
}

.inventory-quantity.critical {
    color: #ff4d4f;
}

/* 库存操作按钮组 */
.inventory-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inventory-action-btn {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
}

.inventory-action-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.inventory-action-btn.primary {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.inventory-action-btn.primary:hover {
    background: #096dd9;
    border-color: #096dd9;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .inventory-actions {
        flex-direction: column;
        gap: 4px;
    }
}

/* 库存记录弹窗样式 */
.inventory-records-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-records-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.inventory-records-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 1200px;
    height: 1000px; /* 增加高度到1000px */
    display: flex;
    flex-direction: column;
}

.inventory-records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.inventory-records-title {
    font-size: 18px;
    font-weight: 600;
    color: #262626;
}

.inventory-records-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8c8c8c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.inventory-records-close:hover {
    background-color: #f5f5f5;
    color: #262626;
}

.inventory-records-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ==================== 库存记录弹窗 - 数据表格样式 ==================== */

.inventory-records-table {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

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

.inventory-records-data-table th {
    background: #f5f5f5;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #262626;
    font-size: 14px;
    border-bottom: 1px solid #e5e5e5;
}

.inventory-records-data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

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

/* 记录类型标签 */
.inventory-record-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.inventory-record-type.in {
    background-color: #e8f5e8;
    color: #52c41a;
}

.inventory-record-type.out {
    background-color: #fff2f0;
    color: #ff4d4f;
}

/* 记录数量样式 */
.inventory-record-quantity.in {
    color: #52c41a;
    font-weight: 600;
}

.inventory-record-quantity.out {
    color: #ff4d4f;
    font-weight: 600;
}

.inventory-records-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

.inventory-records-btn {
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    color: #262626;
    cursor: pointer;
    font-size: 14px;
}

.inventory-records-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* ==================== 库存表格展开功能样式 ==================== */

.inventory-expandable {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.inventory-expand-btn:hover:not(.disabled) {
    background-color: #f0f0f0;
}

.inventory-expand-btn.expanded {
    background-color: #e6f7ff;
}

.inventory-expand-btn.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.inventory-expand-icon {
    width: 16px;
    height: 16px;
    fill: #666;
}

.inventory-expand-btn:hover .inventory-expand-icon {
    fill: #1890ff;
}

.inventory-expand-btn.expanded .inventory-expand-icon {
    fill: #1890ff;
}

/* 展开行样式 */
.inventory-expand-row {
    background-color: #fafafa;
    border-left: 3px solid #1890ff;
}

/* ==================== 库位分布样式 ==================== */

.inventory-location-distribution-container {
    padding: 0 !important;
}

.inventory-location-distribution {
    padding: 20px;
    background: white;
    margin: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.inventory-location-distribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.inventory-location-distribution-header h4 {
    margin: 0;
    color: #262626;
    font-size: 16px;
    font-weight: 600;
}

.inventory-total-quantity {
    color: #1890ff;
    font-weight: 600;
    font-size: 14px;
}

.inventory-location-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.inventory-location-table th {
    background-color: #f5f5f5;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #595959;
    border-bottom: 1px solid #e8e8e8;
}

.inventory-location-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.inventory-location-table tr:last-child td {
    border-bottom: none;
}

.inventory-area-badge {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.inventory-location-code {
    font-family: 'Courier New', monospace;
    color: #595959;
    font-weight: 500;
}

.inventory-location-quantity {
    color: #52c41a;
    font-weight: 600;
}

/* 库存记录按钮样式 */
.inventory-location-record-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.inventory-location-record-btn:hover {
    background-color: #40a9ff;
}

/* 移位补货按钮样式 */
.inventory-location-move-btn {
    background-color: #52c41a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}

.inventory-location-move-btn:hover {
    background-color: #73d13d;
}

/* 库存盘点按钮样式 */
.inventory-location-inventory-btn {
    background-color: #fa8c16;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}

.inventory-location-inventory-btn:hover {
    background-color: #ffa940;
}

/* 主行悬停效果 */
.inventory-main-row:hover {
    background-color: #f5f5f5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .inventory-records-container {
        width: 95%;
        max-height: 85vh;
    }

    .inventory-records-body {
        padding: 16px;
    }

}

/* 响应式调整 - 耗材库存主页面 */
@media (max-width: 768px) {
    .consumables-inventory-card {
        padding: 16px;
    }

    .consumables-inventory-list {
        height: calc(100vh - 200px);
    }

    .consumables-inventory-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .consumables-inventory-table {
        font-size: 12px;
    }

    .consumables-inventory-table th,
    .consumables-inventory-table td {
        padding: 8px;
    }

    .consumables-inventory-pagination {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .consumables-inventory-pagination-controls {
        justify-content: center;
    }
}
