/**
 * 全局拟态（Neumorphism）风格 - 硅胶感
 * 应用于所有页面，替换原有的扁平风格
 */

/* ========== 全局基础：柔和浅灰背景 ========== */
body {
    background: #e0e5ec !important;
    color: #2d3748;
}

.content-wrapper {
    background: #e0e5ec !important;
}

.content-header.page-header-bar,
.page-header-bar {
    background: #e0e5ec !important;
    border-bottom: none;
}

.content.page-content {
    background: #e0e5ec !important;
}

/* ========== 卡片：凸起效果 ========== */
.card {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 10px 10px 20px #b8b8b8, -10px -10px 20px #ffffff;
}

.card-header {
    background: transparent !important;
    border-bottom: none !important;
    padding: 1rem 1.25rem;
}

.card-header h3,
.card-header .card-title {
    color: #4a5568;
    font-weight: 600;
}

.card-body {
    background: transparent !important;
    padding: 1rem 1.25rem;
}

.card-footer {
    background: transparent !important;
    border-top: none !important;
    padding: 1rem 1.25rem;
}

/* ========== 表格：拟态风格 + 卡片式行 ========== */
.table {
    background: transparent !important;
    border-radius: 12px;
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    width: 100%;
    /* 自动调整列宽 */
    table-layout: auto;
}

.table thead {
    display: table-header-group;
}

.table thead th {
    background: transparent !important;
    border: none !important;
    color: #4a5568;
    font-weight: 600;
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    /* 确保所有列的 padding 完全一致 */
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box;
}

.table tbody {
    display: table-row-group;
}

.table tbody tr {
    background: #e0e5ec !important;
    border-radius: 12px;
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    display: table-row;
    position: relative;
}

/* 移除左侧渐变条，避免影响对齐 */
.table tbody tr::before {
    display: none;
}

/* 使用边框左侧作为视觉指示 */
.table tbody tr:hover {
    box-shadow: 6px 6px 12px #c0c0c0, -6px -6px 12px #ffffff;
    transform: translateY(-2px);
}

/* 悬停时在第一列添加左侧高亮 */
.table tbody tr:hover td:first-child {
    position: relative;
}

.table tbody tr:hover td:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #5a67d8 0%, #667eea 100%);
    border-radius: 12px 0 0 12px;
}

.table tbody tr.active {
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
    background: #e8ecf1 !important;
}

.table tbody tr.active td:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #5a67d8 0%, #667eea 100%);
    border-radius: 12px 0 0 12px;
}

.table td {
    border: none !important;
    color: #2d3748;
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
    background: transparent !important;
    position: relative;
    /* 确保所有列的 padding 与表头完全一致 */
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box;
}

/* 第一列和最后一列的圆角 */
.table tbody td:first-child {
    border-radius: 12px 0 0 12px;
    padding-left: 1rem !important;
}

.table tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

/* 确保表头和表体的列宽完全一致 */
.table thead th,
.table tbody td {
    box-sizing: border-box;
}

/* ========== 全局：所有表格列自动调整宽度 ========== */
/* 移除所有固定列宽限制，让列根据内容自动调整 */
.table thead th,
.table tbody td {
    width: auto !important;
    min-width: 0;
    max-width: none;
}

/* 允许表格列根据内容自动调整 */
.table {
    table-layout: auto !important;
}

/* 文本列默认允许换行 */
.table thead th,
.table tbody td {
    white-space: normal;
    word-break: break-word;
}

/* 数字列保持不换行 */
.table td.text-right,
.table th.text-right {
    white-space: nowrap;
}

/* 操作列保持不换行 */
.table td .btn,
.table th .btn {
    white-space: nowrap;
}

/* 确保表格能够根据内容自动调整列宽 */
.table-responsive {
    overflow-x: auto;
}

.table-bordered {
    border: none;
}

.table-bordered thead th,
.table-bordered td {
    border: none !important;
}

.table-hover tbody tr:hover {
    background: #e8ecf1 !important;
}

/* 表格中的链接 */
.table a:not(.btn) {
    color: #5a67d8;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.table a:not(.btn):hover {
    color: #4c51bf;
    text-decoration: underline;
}

/* 表格中的徽章 */
.table .badge {
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.4rem 0.7rem;
    font-weight: 500;
}

/* 表格中的操作按钮组 */
.table .btn-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table .btn-sm {
    margin: 0;
    white-space: nowrap;
}

/* 表格中的图标 */
.table .fas,
.table .far {
    margin-right: 0.3rem;
}

/* 表格行号/序号列（仅当不是产品名称列时） */
.table td:first-child:not(:has-text) {
    font-weight: 600;
    color: #718096;
    font-size: 0.85rem;
}

/* 表格中的数字高亮 */
.table .text-primary {
    color: #5a67d8 !important;
    font-weight: 600;
}

.table .text-success {
    color: #48bb78 !important;
    font-weight: 600;
}

.table .text-danger {
    color: #f56565 !important;
    font-weight: 600;
}

.table .text-warning {
    color: #ed8936 !important;
    font-weight: 600;
}

/* 表格中的金额 */
.table .amount-cell,
.table .price-cell {
    font-weight: 600;
    color: #2d3748;
    font-variant-numeric: tabular-nums;
}

/* 表格中的日期时间 */
.table .date-cell,
.table .time-cell {
    color: #718096;
    font-size: 0.9rem;
}

/* ========== 产品列表页面特殊对齐修复 ========== */
.product-index .card-body {
    padding: 0 !important;
}

/* 分类标题行对齐 */
.product-index .px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
}

/* 产品列表表格自动调整列宽 */
.product-index .table {
    table-layout: auto;
    width: 100%;
}

.product-index .table thead th,
.product-index .table tbody td {
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
    box-sizing: border-box;
}

/* 文本列左对齐 */
.product-index .table thead th,
.product-index .table tbody td {
    text-align: left;
}

/* 数字列右对齐 */
.product-index .table td:nth-child(5),
.product-index .table td:nth-child(6),
.product-index .table th:nth-child(5),
.product-index .table th:nth-child(6) {
    text-align: right;
}

/* 操作列居中 */
.product-index .table td:last-child,
.product-index .table th:last-child {
    text-align: center;
}

/* 表格响应式容器对齐 */
.product-index .table-responsive {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

/* ========== 列表展开行：产品明细表对齐与列宽 ========== */
.purchase-detail-row td,
.sale-detail-row td {
    vertical-align: top;
    padding-left: 0;
    padding-right: 0;
    border-left: none;
    border-right: none;
}
.detail-row-inner {
    padding: 12px 16px 12px 72px; /* 与主表首列内容对齐（复选框+展开约70px） */
    max-width: 100%;
}
.detail-items-table {
    table-layout: fixed;
    width: 100%;
    min-width: 480px;
    margin: 0;
    background: #fff !important;
}
.detail-items-table thead th,
.detail-items-table tbody td {
    padding: 0.5rem 0.65rem;
    vertical-align: middle;
}
.detail-items-table thead th:nth-child(1),
.detail-items-table tbody td:nth-child(1) { width: 8%;  min-width: 48px;  text-align: center; }
.detail-items-table thead th:nth-child(2),
.detail-items-table tbody td:nth-child(2) { width: 36%; min-width: 140px; text-align: left;   }
.detail-items-table thead th:nth-child(3),
.detail-items-table tbody td:nth-child(3) { width: 14%; min-width: 64px;  text-align: right; }
.detail-items-table thead th:nth-child(4),
.detail-items-table tbody td:nth-child(4) { width: 10%; min-width: 52px;  text-align: center; }
.detail-items-table thead th:nth-child(5),
.detail-items-table tbody td:nth-child(5) { width: 14%; min-width: 72px;  text-align: right; }
.detail-items-table thead th:nth-child(6),
.detail-items-table tbody td:nth-child(6) { width: 14%; min-width: 72px;  text-align: right; }
/* 无金额时 4 列：序号、产品名称、数量、单位 */
.detail-items-table.detail-cols-4 thead th:nth-child(1),
.detail-items-table.detail-cols-4 tbody td:nth-child(1) { width: 8%;  }
.detail-items-table.detail-cols-4 thead th:nth-child(2),
.detail-items-table.detail-cols-4 tbody td:nth-child(2) { width: 48%; }
.detail-items-table.detail-cols-4 thead th:nth-child(3),
.detail-items-table.detail-cols-4 tbody td:nth-child(3) { width: 24%; }
.detail-items-table.detail-cols-4 thead th:nth-child(4),
.detail-items-table.detail-cols-4 tbody td:nth-child(4) { width: 16%; }

/* ========== 表单：输入框凹陷效果 ========== */
.form-control,
select.form-control,
input.form-control,
textarea.form-control {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    padding: 0.6rem 0.9rem;
    color: #2d3748;
    transition: box-shadow 0.2s ease;
}

.form-control:focus,
select.form-control:focus,
input.form-control:focus,
textarea.form-control:focus {
    box-shadow: inset 5px 5px 10px #c0c8d7, inset -5px -5px 10px #ffffff;
    outline: none;
    border: none !important;
}

.form-control:read-only,
input.form-control[readonly] {
    background: #e0e5ec !important;
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
}

.form-control::placeholder {
    color: #a0aec0;
}

/* Select2 下拉框 */
.select2-container--bootstrap4 .select2-selection {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
    box-shadow: inset 5px 5px 10px #c0c8d7, inset -5px -5px 10px #ffffff !important;
}

.select2-container--bootstrap4 .select2-dropdown {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
}

.select2-results__option {
    color: #2d3748;
}

.select2-results__option--highlighted {
    background: rgba(90, 103, 216, 0.2) !important;
    color: #2d3748 !important;
}

/* ========== 按钮：凸起效果 ========== */
.btn {
    border: none !important;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
}

.btn-primary {
    background: #5a67d8 !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #4c51bf, -4px -4px 8px #667eea;
}

.btn-primary:hover {
    background: #4c51bf !important;
    box-shadow: 5px 5px 10px #434190, -5px -5px 10px #667eea;
    transform: translateY(-1px);
}

.btn-primary:active {
    box-shadow: inset 2px 2px 4px #434190, inset -2px -2px 4px #667eea;
    transform: translateY(0);
}

.btn-secondary {
    background: #e0e5ec !important;
    color: #4a5568 !important;
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
}

.btn-secondary:hover {
    background: #e8ecf1 !important;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
    transform: translateY(-1px);
}

.btn-secondary:active {
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    transform: translateY(0);
}

.btn-success {
    background: #48bb78 !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #38a169, -4px -4px 8px #68d391;
}

.btn-success:hover {
    background: #38a169 !important;
    box-shadow: 5px 5px 10px #2f855a, -5px -5px 10px #68d391;
    transform: translateY(-1px);
}

.btn-danger {
    background: #f56565 !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #e53e3e, -4px -4px 8px #fc8181;
}

.btn-danger:hover {
    background: #e53e3e !important;
    box-shadow: 5px 5px 10px #c53030, -5px -5px 10px #fc8181;
    transform: translateY(-1px);
}

.btn-warning {
    background: #ed8936 !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #dd6b20, -4px -4px 8px #f6ad55;
}

.btn-warning:hover {
    background: #dd6b20 !important;
    box-shadow: 5px 5px 10px #c05621, -5px -5px 10px #f6ad55;
    transform: translateY(-1px);
}

.btn-info {
    background: #4299e1 !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #3182ce, -4px -4px 8px #63b3ed;
}

.btn-info:hover {
    background: #3182ce !important;
    box-shadow: 5px 5px 10px #2c5282, -5px -5px 10px #63b3ed;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.7rem 1.4rem;
    border-radius: 14px;
    font-size: 1rem;
}

.btn-outline-secondary {
    background: #e0e5ec !important;
    color: #4a5568 !important;
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
}

.btn-outline-secondary:hover {
    background: #e8ecf1 !important;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
}

/* ========== 表单卡片 ========== */
.form-card {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 20px;
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
}

.form-card-header {
    background: transparent !important;
    border-bottom: none !important;
}

.form-card-body {
    background: transparent !important;
}

.form-card-footer {
    background: transparent !important;
    border-top: none !important;
}

/* ========== 表单分组标题 ========== */
.form-section-title {
    color: #4a5568;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.form-section-title::before {
    background: #5a67d8;
    border-radius: 2px;
}

/* ========== 标签页 ========== */
.nav-tabs {
    border-bottom: none;
    background: #e0e5ec;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px;
    color: #718096;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-tabs .nav-link.active {
    background: #e0e5ec;
    color: #2d3748;
    box-shadow: 3px 3px 6px #c8d0e7, -3px -3px 6px #ffffff;
}

/* ========== 进度条 ========== */
.progress {
    background: #e0e5ec !important;
    border-radius: 10px;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    height: 10px;
}

.progress-bar {
    border-radius: 10px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========== 徽章 ========== */
.badge {
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-secondary {
    background: #a0aec0 !important;
    color: #ffffff;
}

.badge-success {
    background: #48bb78 !important;
    color: #ffffff;
}

.badge-primary {
    background: #5a67d8 !important;
    color: #ffffff;
}

.badge-warning {
    background: #ed8936 !important;
    color: #ffffff;
}

.badge-danger {
    background: #f56565 !important;
    color: #ffffff;
}

/* ========== 分页 ========== */
.pagination .page-link {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 8px;
    color: #4a5568;
    box-shadow: 3px 3px 6px #c8d0e7, -3px -3px 6px #ffffff;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: #5a67d8 !important;
    color: #ffffff;
    box-shadow: 4px 4px 8px #4c51bf, -4px -4px 8px #667eea;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    box-shadow: none;
}

/* ========== 模态框 ========== */
.modal-content {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 20px;
    box-shadow: 12px 12px 24px #b0b0b0, -12px -12px 24px #ffffff;
}

.modal-header {
    background: transparent !important;
    border-bottom: none !important;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    background: transparent !important;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    background: transparent !important;
    border-top: none !important;
    padding: 1rem 1.5rem;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.3);
}

/* ========== 顶部导航栏 ========== */
.main-header.navbar {
    background: #e0e5ec !important;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.main-header .nav-link {
    color: #4a5568;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.main-header .nav-link:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #2d3748;
}

.main-header .nav-link.text-danger {
    color: #e53e3e !important;
}

.main-header .nav-link.text-danger:hover {
    color: #c53030 !important;
    background: rgba(245, 101, 101, 0.2);
}

/* ========== 侧边栏：拟态风格 ========== */
.main-sidebar,
.main-sidebar.sidebar-dark-primary {
    background: #e0e5ec !important;
    border-right: none !important;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05);
    color: #2d3748 !important;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-sidebar.elevation-4 {
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.05) !important;
}

.main-sidebar .brand-link {
    background: #e0e5ec !important;
    border-bottom: none !important;
    padding: 0.75rem 0.75rem;
    box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.05);
}

.main-sidebar .brand-text {
    color: #2d3748 !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar {
    background: #e0e5ec !important;
    padding: 0.35rem 0;
}

.sidebar-label {
    color: #718096 !important;
    padding: 0.5rem 0.75rem 0.35rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
}

/* 菜单容器 */
.nav-sidebar {
    padding: 0.35rem;
}

.nav-sidebar .nav-item {
    margin-bottom: 0.15rem;
}

/* 父级菜单项（无子菜单） */
.nav-sidebar .nav-link.nav-parent {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin: 0.1rem 0;
    color: #4a5568 !important;
    font-weight: 500;
    font-size: 0.8rem;
    box-shadow: 2px 2px 4px #c8d0e7, -2px -2px 4px #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-sidebar .nav-link.nav-parent:hover {
    box-shadow: 3px 3px 6px #c8d0e7, -3px -3px 6px #ffffff;
    transform: translateY(-1px);
    color: #2d3748 !important;
}

.nav-sidebar .nav-link.nav-parent.active,
.nav-sidebar .nav-link.nav-parent-active {
    background: #e0e5ec !important;
    color: #5a67d8 !important;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    font-weight: 600;
}

.nav-sidebar .nav-link.nav-parent.active .nav-icon,
.nav-sidebar .nav-link.nav-parent-active .nav-icon {
    color: #5a67d8 !important;
}

/* 父级菜单项（有子菜单，disabled） */
.nav-sidebar .nav-link.nav-parent.disabled {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin: 0.1rem 0;
    color: #4a5568 !important;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 2px 2px 4px #c8d0e7, -2px -2px 4px #ffffff;
    cursor: default;
    opacity: 1;
}

/* 子菜单列表容器 */
.nav-sidebar .nav-child-list {
    padding-left: 0.35rem;
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
    background: #e0e5ec;
    border-radius: 8px;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    padding: 0.35rem;
}

/* 子菜单项 */
.nav-sidebar .nav-link.nav-child {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 8px;
    padding: 0.4rem 0.6rem 0.4rem 2rem !important;
    margin: 0.08rem 0;
    color: #718096 !important;
    font-weight: 400;
    font-size: 0.75rem;
    box-shadow: 2px 2px 4px #c8d0e7, -2px -2px 4px #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-sidebar .nav-link.nav-child:hover {
    box-shadow: 2px 2px 5px #c8d0e7, -2px -2px 5px #ffffff;
    transform: translateY(-1px);
    color: #4a5568 !important;
}

.nav-sidebar .nav-link.nav-child.active,
.nav-sidebar .nav-link.nav-child-active {
    background: #e0e5ec !important;
    color: #5a67d8 !important;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    font-weight: 600;
}

.nav-sidebar .nav-link.nav-child.active .nav-icon,
.nav-sidebar .nav-link.nav-child-active .nav-icon {
    color: #5a67d8 !important;
}

/* 菜单图标 */
.nav-sidebar .nav-icon {
    color: #718096;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
    transition: color 0.2s ease;
}

.nav-sidebar .nav-link:hover .nav-icon {
    color: #4a5568;
}

.nav-sidebar .nav-link.active .nav-icon,
.nav-sidebar .nav-link.nav-parent-active .nav-icon,
.nav-sidebar .nav-link.nav-child-active .nav-icon {
    color: #5a67d8 !important;
}

/* 菜单文字 */
.nav-sidebar .nav-link p {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* 菜单项文字颜色继承 */
.nav-sidebar .nav-link {
    color: inherit !important;
}

/* 确保子菜单始终显示 */
.nav-treeview {
    display: block !important;
}

/* 侧边栏可滚动区域：占满剩余高度，独立滚动，翻页后由 JS 恢复位置 */
.main-sidebar .sidebar {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

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

.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 侧边栏响应式优化 */
@media (max-width: 768px) {
    .main-sidebar {
        box-shadow: none;
    }
    
    .nav-sidebar .nav-link.nav-parent,
    .nav-sidebar .nav-link.nav-child {
        border-radius: 10px;
    }
}

/* ========== 页脚 ========== */
.main-footer {
    background: #e0e5ec !important;
    border-top: none;
    color: #718096;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* ========== 面包屑 ========== */
.breadcrumb {
    background: transparent !important;
}

.breadcrumb-item a {
    color: #5a67d8;
}

.breadcrumb-item.active {
    color: #4a5568;
}

/* ========== 警告框 ========== */
.alert {
    border: none !important;
    border-radius: 12px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.05);
}

.alert-info {
    background: rgba(90, 103, 216, 0.1) !important;
    color: #2d3748;
    border-left: 3px solid #5a67d8;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1) !important;
    color: #2d3748;
    border-left: 3px solid #48bb78;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1) !important;
    color: #2d3748;
    border-left: 3px solid #ed8936;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1) !important;
    color: #2d3748;
    border-left: 3px solid #f56565;
}

/* ========== 下拉菜单 ========== */
.dropdown-menu {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 12px;
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    color: #2d3748;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.dropdown-item.active,
.dropdown-item:active {
    background: rgba(90, 103, 216, 0.2);
    color: #2d3748;
}

/* ========== 工具提示 ========== */
.tooltip-inner {
    background: #2d3748;
    border-radius: 8px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
}

/* ========== 登录页 ========== */
.site-login {
    background: #e0e5ec !important;
}

.auth-card {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 20px;
    box-shadow: 12px 12px 24px #b0b0b0, -12px -12px 24px #ffffff;
}

.auth-logo {
    background: #5a67d8 !important;
    box-shadow: 4px 4px 8px #4c51bf, -4px -4px 8px #667eea;
}

/* ========== 列表页操作按钮组 ========== */
.card-header .btn-group .btn {
    margin: 0 0.15rem;
}

/* ========== GridView 统计信息 ========== */
.summary {
    color: #718096;
    background: transparent;
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
    .card {
        border-radius: 16px;
    }
    
    .btn {
        border-radius: 10px;
    }
    
    .form-control {
        border-radius: 10px;
    }
    
    .modal-content {
        border-radius: 16px;
    }
}

/* ========== 特殊页面元素 ========== */
/* 信息卡片（工作台等） */
.info-card {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 16px;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
    transition: box-shadow 0.2s ease;
}

.info-card:hover {
    box-shadow: 6px 6px 12px #c8d0e7, -6px -6px 12px #ffffff;
}

.info-icon {
    background: #e0e5ec !important;
    border-radius: 12px;
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
}

/* 快捷方式按钮 */
.qa-item {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 14px;
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    transition: all 0.2s ease;
}

.qa-item:hover {
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
    background: #e8ecf1 !important;
}

/* 单据详情页 */
.doc-view .info-card-main {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 16px;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
}

.doc-view .summary-card {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 16px;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
}

.doc-view .remark-box {
    background: #e0e5ec !important;
    border-left: 3px solid #5a67d8;
    border-radius: 12px;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
}

.doc-view .doc-details-section {
    background: #e0e5ec !important;
    border: none !important;
    border-radius: 16px;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
}

/* GridView 操作列按钮 */
.table .btn-sm {
    margin: 0 0.15rem;
}

/* ========== 图表容器 ========== */
canvas {
    border-radius: 12px;
}

/* ========== 产品类型标签 ========== */
.badge-type-product,
.badge-type-semi,
.badge-type-material {
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

/* ========== 输入组 ========== */
.input-group .form-control {
    border-radius: 12px 0 0 12px;
}

.input-group-append .btn,
.input-group-prepend .btn {
    border-radius: 0 12px 12px 0;
}

.input-group .form-control:first-child {
    border-radius: 12px 0 0 12px;
}

.input-group .form-control:last-child {
    border-radius: 0 12px 12px 0;
}

/* ========== 复选框和单选框 ========== */
.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 6px;
    background: #e0e5ec;
    border: none;
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background: #5a67d8;
    box-shadow: 2px 2px 4px #4c51bf, -2px -2px 4px #667eea;
}

.form-check-input:focus {
    box-shadow: inset 3px 3px 6px #c0c8d7, inset -3px -3px 6px #ffffff;
}

/* ========== 文件上传 ========== */
.custom-file-label {
    background: #e0e5ec;
    border: none;
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    color: #2d3748;
}

.custom-file-input:focus ~ .custom-file-label {
    box-shadow: inset 5px 5px 10px #c0c8d7, inset -5px -5px 10px #ffffff;
}

/* ========== 列表组 ========== */
.list-group-item {
    background: #e0e5ec;
    border: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    box-shadow: 3px 3px 6px #c8d0e7, -3px -3px 6px #ffffff;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    transform: translateY(-1px);
}

.list-group-item.active {
    background: #5a67d8;
    color: #ffffff;
    box-shadow: 4px 4px 8px #4c51bf, -4px -4px 8px #667eea;
}

/* ========== 卡片内的表格特殊处理 ========== */
.card .table {
    margin-bottom: 0;
    border-spacing: 0 0.5rem;
    table-layout: auto !important;
}

.card .table thead th {
    background: transparent;
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem;
    vertical-align: middle;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0;
}

.card .table tbody tr {
    margin-bottom: 0.5rem;
}

.card .table td {
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0;
}

/* 确保卡片内表格的第一列对齐 */
.card .table thead th:first-child,
.card .table tbody td:first-child {
    padding-left: 1rem !important;
}

/* 卡片头部优化 */
.card-header {
    position: relative;
    padding-bottom: 1rem;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

/* 卡片头部图标 */
.card-header .card-title i {
    color: #5a67d8;
    margin-right: 0.5rem;
}

/* 卡片头部按钮组 */
.card-header .btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ========== 空状态提示 ========== */
.empty-state {
    background: #e0e5ec;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
    color: #718096;
}
