/* ========== Layui Admin 风格全局样式 ========== */
/* 全局基础：简洁扁平 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f2f2f2;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* 顶栏：白底细边 */
.main-header.navbar {
    border-bottom: 1px solid #e6e6e6;
    background: #fff;
}
.main-header .nav-link {
    font-size: 0.9rem;
    color: #333;
}
.main-header .nav-link:hover {
    color: #1E9FFF;
}

.main-header .nav-link.text-danger {
    color: #ef4444 !important;
    font-weight: 500;
}

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

/* 侧边栏：略微收窄，去掉重阴影 */
.main-sidebar {
    background: #111827;
}
.main-sidebar .brand-link {
    border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}
.sidebar-label {
    font-size: 0.75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 12px 16px 4px;
    opacity: 0.9;
}
.nav-sidebar .nav-link {
    font-size: 0.9rem;
}
.nav-sidebar .nav-link p {
    margin-bottom: 0;
}

/* 左侧菜单层级：父级更大、更粗，子级更小、内缩 */
.nav-parent {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e7eb;
}
.nav-parent.disabled {
    opacity: 0.8;
}
.nav-parent-active {
    background: rgba(30, 159, 255, 0.15);
}
.nav-child-list {
    padding-left: 0.35rem;
    margin-top: 2px;
}
.nav-child {
    font-size: 0.85rem;
    padding-left: 2rem;
}
.nav-child .nav-icon {
    font-size: 0.8rem;
}
.nav-child-active {
    background: rgba(30, 159, 255, 0.15);
}

/* 菜单名前的统一小图标标识（CSS 伪元素实现） */
/* 左侧 nav-icon 大小与颜色（依赖不同 icon class 区分功能） */
.nav-sidebar .nav-icon {
    font-size: 0.95rem;
    margin-right: 6px;
}

/* 取消 AdminLTE 对子菜单的折叠行为：所有子级始终展示在父级下方 */
.nav-treeview {
    display: block !important;
    padding-left: 0;
}

/* 内容区：浅灰底 + 紧凑内边距 */
.content-wrapper {
    background: #f2f2f2;
}
.content-header.page-header-bar,
.page-header-bar {
    padding: 12px 0 8px;
    margin-bottom: 0;
}
.page-header-bar .page-title,
.content-header .page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
}
.content.page-content {
    padding-top: 12px;
    padding-bottom: 24px;
}
@media (max-width: 576px) {
    .page-header-bar .row {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .page-header-bar .col-auto { margin-top: 6px; }
}

/* 页脚 */
.main-footer {
    border-top: 1px solid #e6e6e6;
    background: #fff;
    color: #666;
}

/* ========== 列表与卡片（Layui Admin 风格）========== */
.card {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e6e6e6;
    background: #fff;
}

.card-header {
    background: #fafafa;
    border-bottom: 1px solid #e6e6e6;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3, .card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.card-body {
    padding: 1rem 1.25rem;
}
.card-body.p-0 {
    padding: 0;
}

/* 主按钮：扁平蓝 */
.card-header .btn-primary,
.btn-primary {
    background: #1E9FFF;
    border: none;
    border-radius: 2px;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    color: #fff;
}
.card-header .btn-primary:hover,
.btn-primary:hover {
    background: #0c7cd5;
    color: #fff;
}
.card-header .btn-primary i {
    margin-right: 0.35rem;
}

/* 确保按钮在右侧 */
.card-header.d-flex {
    flex-direction: row;
}

.card-header.d-flex .btn-primary {
    margin-left: auto;
    flex-shrink: 0;
}

/* 响应式：小屏幕上按钮样式调整 */
@media (max-width: 576px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .card-header .btn-primary {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

/* 表格：Layui 风格 */
.table {
    background: #fff;
    font-size: 0.875rem;
}
.table th, .table td {
    vertical-align: middle;
    padding: 10px 12px;
    border-color: #e6e6e6;
}
.table thead th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e6e6e6;
}
.table-bordered th, .table-bordered td {
    border-color: #e6e6e6 !important;
}
.table-hover tbody tr:hover {
    background: #f5f5f5;
}
.table tbody tr + tr td {
    border-top: 1px solid #eee;
}
.table a:not(.btn) {
    color: #1E9FFF;
}
.table a:not(.btn):hover {
    color: #0c7cd5;
    text-decoration: underline;
}

/* GridView 分页与统计信息，美观易操作 */
.summary {
    font-size: 0.8125rem;
    color: #6b7280;
    padding: 0.5rem 0.75rem;
    margin: 0;
}
/* 分页容器：与统计信息同一行时对齐 */
nav[aria-label="Page navigation"],
.pagination-wrapper {
    display: inline-flex;
    align-items: center;
}
.pagination {
    margin: 0.5rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    border: none;
    font-size: 0.875rem;
}
.pagination li {
    display: inline-block;
}
.pagination .page-link,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pagination .page-link:hover,
.pagination a:hover:not(.disabled):not([aria-disabled="true"]) {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}
.pagination .page-item.active .page-link,
.pagination li.active .page-link,
.pagination li.active a {
    background: #1E9FFF;
    border-color: #1E9FFF;
    color: #fff;
    cursor: default;
}
.pagination .page-item.active .page-link:hover,
.pagination li.active a:hover {
    background: #1a8ae6;
    border-color: #1a8ae6;
    color: #fff;
}
.pagination .page-item.disabled .page-link,
.pagination li.disabled .page-link,
.pagination li.disabled span {
    color: #9ca3af;
    background: #f9fafb;
    border-color: #e5e7eb;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination .page-item:first-child .page-link,
.pagination .page-item:first-child a,
.pagination .page-item:last-child .page-link,
.pagination .page-item:last-child a,
.pagination li:first-child a,
.pagination li:first-child span,
.pagination li:last-child a,
.pagination li:last-child span {
    border-radius: 8px;
}
/* 兼容默认 LinkPager（无 .page-item/.page-link 时） */
.pagination > li > a {
    border-radius: 8px;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.pagination > li > a:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}
.pagination > li.active > a {
    background: #1E9FFF;
    border-color: #1E9FFF;
    color: #fff;
}
.pagination > li.disabled > span {
    color: #9ca3af;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-outline-secondary {
    border-radius: 2px;
    border: 1px solid #e6e6e6;
    color: #333;
    background: #fff;
}
.btn-outline-secondary:hover {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #333;
}
.product-index .table-responsive + hr,
.product-index hr {
    border-color: #eee;
    margin: 0.5rem 0;
}

/* 产品类型标签 */
.badge-type-product {
    background: #10b981;
}
.badge-type-semi {
    background: #3b82f6;
}
.badge-type-material {
    background: #6b7280;
}

/* Dashboard 卡片 */
.dashboard {
    margin-top: 12px;
}

/* 工作台页面隐藏面包屑导航 */
.dashboard-page ~ .content-header .breadcrumb,
body:has(.dashboard-page) .content-header .breadcrumb {
    display: none !important;
}

.dashboard-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.dashboard-card {
    border-radius: 2px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e6e6e6;
}
.dashboard-card.highlight {
    background: #fff;
    border-left: 3px solid #1E9FFF;
}
.dashboard-card h5 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: .35rem;
}
.dashboard-card strong {
    font-size: 1.25rem;
}
.low-stock {
    color: #b91c1c;
    font-weight: 500;
}

/* 快捷方式按钮网格 */
.quick-actions .qa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 2px;
    border: 1px solid #e6e6e6;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: background .15s ease;
    height: 100%;
    min-height: 75px;
}
.quick-actions .qa-item:hover {
    background: #f5f5f5;
}
.quick-actions .qa-icon {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}
.quick-actions .qa-text {
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.3;
}

.todo-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}
.todo-metric .todo-label {
    color: #6b7280;
}
.todo-metric .todo-value {
    font-weight: 600;
}

.chart-placeholder {
    height: 220px;
    border-radius: 2px;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.85rem;
    background: #fafafa;
}

.progress-label {
    font-size: 0.8rem;
    color: #666;
}
.progress {
    height: 8px;
    border-radius: 2px;
    background: #f0f0f0;
}
.progress-bar {
    border-radius: 2px;
}

/* 登录页 */
.site-login {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 2px;
    padding: 28px;
    border: 1px solid #e6e6e6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.auth-card-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.auth-card-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.25rem;
}

.auth-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    margin-right: 10px;
    font-size: 1rem;
}

.auth-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .25rem;
}

.site-login .btn-primary {
    border-radius: 2px;
    padding: 0.5rem 1.25rem;
    background: #1E9FFF;
    border: none;
}
.site-login .btn-primary:hover {
    background: #0c7cd5;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ========== 页面标题和导航精致样式 ========== */

/* 内容头部（兼容旧 class） */
.content-header h1 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

/* 面包屑：简洁样式 */
.content-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.content-header .breadcrumb-item + .breadcrumb-item::before {
    content: "▶";
    color: #adb5bd;
    padding: 0 0.4rem;
    font-size: 0.65em;
}

/* 面包屑链接 */
.content-header .breadcrumb-item a {
    color: #1E9FFF;
}
.content-header .breadcrumb-item a:hover {
    color: #0c7cd5;
    text-decoration: underline;
}

/* 当前页（不可点击）：深色 */
.content-header .breadcrumb-item.active {
    color: #212529;
}

/* 响应式 */
@media (max-width: 768px) {
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .content-header .breadcrumb {
        font-size: 0.8rem;
    }
    
    /* 表单卡片响应式 */
    .form-card-header {
        padding: 1.25rem 1.5rem;
    }
    
    .form-card-body {
        padding: 1.5rem;
    }
    
    .form-card-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .product-form,
    .customer-form,
    .purchase-form,
    .sale-form,
    .produce-form,
    .delivery-form,
    .return-form,
    .adjust-form,
    .scrap-form,
    .user-form {
        padding: 1rem 0.5rem;
    }
}

/* ========== 表单页面精致样式 ========== */

/* 表单容器：扁平卡片 */
.form-card {
    background: #fff;
    border-radius: 2px;
    border: 1px solid #e6e6e6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: visible;
    margin-bottom: 1.25rem;
}
.form-card-header {
    display: none;
}
.form-card-body {
    padding: 1.25rem 1.5rem;
}
.form-card-footer {
    background: #fafafa;
    border-top: 1px solid #e6e6e6;
    padding: 12px 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 表单字段组：更精致的间距和样式 */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* 表单标签 */
.form-group label,
.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.4rem;
    display: block;
}

/* 输入框：简洁 */
.form-control,
select.form-control,
input.form-control,
textarea.form-control {
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #333;
    background: #fff;
    transition: border-color 0.15s;
    font-family: inherit;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-control:focus,
select.form-control:focus,
input.form-control:focus,
textarea.form-control:focus {
    border-color: #1E9FFF;
    outline: none;
    background: #fff;
}

.form-control:read-only,
input.form-control[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}
.form-control::placeholder {
    color: #999;
}

/* 下拉选择框：优化显示，防止文字遮挡 */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
    cursor: pointer;
    min-width: 200px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* 下拉选项：确保文字完整显示 */
select.form-control option {
    padding: 0.5rem 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    min-height: 2.5rem;
    line-height: 1.4;
}

/* 表格中的下拉框：自适应宽度 */
table select.form-control {
    width: 100%;
    min-width: 180px;
    max-width: 100%;
}

/* 下拉框聚焦时：显示完整内容 */
select.form-control:focus {
    overflow: visible;
    white-space: normal;
    min-height: auto;
}

/* 下拉菜单样式优化（浏览器原生下拉） */
select.form-control:not([multiple]) {
    background-color: #ffffff;
}

/* 产品选择下拉框：特殊优化 */
select.form-control.product-select,
table select.form-control {
    min-width: 220px;
    max-width: 100%;
}

/* 确保下拉框在表格中不被遮挡 */
.table td {
    position: relative;
    overflow: visible;
}

.table td select.form-control {
    position: relative;
    z-index: 1;
}

/* 下拉框打开时的样式 */
select.form-control:focus {
    z-index: 10;
    position: relative;
}

/* Select2 下拉框样式优化 - 简化版本，防止变形 */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* 确保 Select2 下拉菜单宽度与选择框一致，限制高度 */
.select2-container--bootstrap4 .select2-dropdown {
    max-height: 280px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: auto !important;
    /* 宽度由 JavaScript 动态设置，不在这里设置 */
}

/* 表格中的 Select2 容器 */
.table td .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

/* 表格中的下拉菜单宽度严格限制 - 移除所有宽度设置，由 JS 控制 */
.table td .select2-container--bootstrap4 .select2-dropdown {
    left: 0 !important;
    right: auto !important;
    /* 宽度由 JavaScript 动态设置 */
}

/* Select2 选择框样式 */
.select2-container--bootstrap4 .select2-selection {
    border: 1px solid #e6e6e6 !important;
    border-radius: 2px !important;
    min-height: 34px;
    background: #fff;
}

.select2-container--bootstrap4 .select2-selection--single {
    height: 34px !important;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
    padding-left: 0.6rem !important;
    padding-right: 1.75rem !important;
    color: #333;
}
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: #1E9FFF !important;
    outline: none;
}

/* 产品选择器输入框样式 */
.product-select-input {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease;
}

.product-select-input:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.product-select-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 2px 4px rgba(15, 23, 42, 0.06) !important;
    outline: none;
}

/* 产品选择模态框 */
#product-selector-modal .modal-content {
    border-radius: 2px;
    border: 1px solid #e6e6e6;
}
#product-selector-modal .modal-header {
    border-bottom: 1px solid #e6e6e6;
    padding: 12px 1rem;
}
#product-selector-modal .modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}
#product-selector-modal .modal-body {
    padding: 1rem;
}
#product-selector-modal .product-list-container {
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    margin-top: 0.75rem;
}

#product-selector-modal .list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

#product-selector-modal .list-group-item:last-child {
    border-bottom: none;
}

#product-selector-modal .list-group-item:hover {
    background-color: #f8fafc;
}

#product-selector-modal .list-group-item.active {
    background-color: #eff6ff;
    color: #1e40af;
}

#product-selector-modal #product-search-input {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

#product-selector-modal #product-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* 确保模态框在最上层 */
#product-selector-modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 强制限制下拉菜单宽度 - 移除，由 JS 控制 */
.select2-container--bootstrap4 .select2-dropdown--below {
    /* 宽度由 JavaScript 动态设置 */
}

.select2-container--bootstrap4 .select2-dropdown--above {
    /* 宽度由 JavaScript 动态设置 */
}

/* 搜索框样式 */
.select2-search--dropdown {
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex: 0 0 auto !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 选项样式 */
.select2-results__option {
    padding: 0.65rem 0.75rem !important;
    line-height: 1.5;
    font-size: 0.9rem;
    color: #1e293b;
}

.select2-results__option[aria-selected="true"] {
    background-color: #f1f5f9;
    color: #1e293b;
}

.select2-results__option--highlighted {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.select2-results__option--highlighted[aria-selected="true"] {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* 确保下拉菜单不被表格遮挡 */
.table {
    overflow: visible !important;
}

.table td {
    position: relative;
    overflow: visible !important;
}

/* 表单卡片中的表格 */
.form-card-body {
    overflow: visible !important;
}

.form-card-body .table {
    overflow: visible !important;
    margin-top: 1rem;
    border-radius: 2px;
    border: 1px solid #e6e6e6;
}

.form-card-body .table td {
    overflow: visible !important;
    position: relative;
}

/* 确保表单卡片不会裁剪下拉菜单 */
.form-card {
    overflow: visible !important;
}

/* Select2 结果容器 - 限制高度并添加滚动 */
.select2-results {
    max-height: 220px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.25rem 0;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

.select2-results::-webkit-scrollbar {
    width: 8px;
}

.select2-results::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.select2-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.select2-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 表单行布局（两列） */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 表单分组标题 */
.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
}

.form-section-title:first-child {
    margin-top: 0;
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #1E9FFF;
    border-radius: 1px;
    margin-right: 8px;
}

/* 按钮：统一扁平 */
.btn {
    border-radius: 2px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.btn-primary {
    background: #1E9FFF;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #0c7cd5;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    border: 1px solid #e6e6e6;
    color: #333;
    border-radius: 2px;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #333;
}

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

.btn-danger {
    background: #ff5722;
    border: none;
    color: #fff;
    border-radius: 2px;
}
.btn-danger:hover {
    background: #e64a19;
    color: #fff;
}

/* 表单内的表格样式 */
.form-card-body .table thead {
    background: #fafafa;
}
.form-card-body .table thead th {
    font-weight: 600;
    color: #333;
    padding: 10px 12px;
    border-bottom: 1px solid #e6e6e6;
}

.form-card-body .table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    overflow: visible !important;
    position: relative;
}

.form-card-body .table tbody tr:last-child td {
    border-bottom: none;
}

/* 表单内的添加按钮 */
.form-card-body .btn-sm.btn-secondary {
    margin-top: 1rem;
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    color: #64748b;
}

.form-card-body .btn-sm.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #475569;
}

/* 表单页面整体布局 */
.product-form,
.customer-form,
.purchase-form,
.sale-form,
.produce-form,
.delivery-form,
.return-form,
.adjust-form,
.scrap-form,
.user-form {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* 兼容 AdminLTE 的 card 类（用于向后兼容） */
.card.form-card,
.card.form-card .card-header,
.card.form-card .card-body,
.card.form-card .card-footer {
    /* 如果某些地方仍使用 card 类，确保样式一致 */
}

/* 帮助文本 */
.help-block,
.form-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
}

/* 错误提示 */
.has-error .form-control,
.has-error select.form-control,
.has-error input.form-control {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.help-block-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* ========== 工作台时钟和倒计时样式 ========== */

/* 工作台卡片：与全局 card 一致 */
.dashboard-info-card,
.dashboard-time-card {
    height: 100%;
}

/* 确保所有卡片高度一致 */
.dashboard .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard .card .card-body {
    flex: 1;
}

/* 图表容器样式 */
#monthlySaleChart {
    max-width: 100%;
    max-height: 300px;
}

.dashboard-info-card .card-header,
.dashboard-time-card .card-header {
    padding: 12px 16px;
}
.dashboard-info-card .card-body {
    padding: 1rem 1.25rem;
}

/* 工作台信息小块 */
.info-card {
    background: #fff;
    border-radius: 2px;
    padding: 0.875rem 1rem;
    border: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}
.info-card.highlight {
    border-left: 3px solid #1E9FFF;
}
.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 2px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #1E9FFF;
    flex-shrink: 0;
}
.info-card.highlight .info-icon {
    background: rgba(30, 159, 255, 0.1);
    color: #1E9FFF;
}
.info-content { flex: 1; min-width: 0; }
.info-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}
.info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}
.info-card.highlight .info-value {
    color: #1E9FFF;
}

/* 产品累计销售数量样式 */
.total-sale-metric {
    text-align: center;
    padding: 1.5rem 0;
}

.total-sale-value {
    font-size: 2rem;
    font-weight: 600;
    color: #1E9FFF;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}
.total-sale-unit {
    font-size: 0.9rem;
    color: #666;
}

/* 工作台时钟 */
.dashboard-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}
.clock-datetime-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.clock-datetime {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    line-height: 1.4;
}
.clock-date-part { font-size: 1rem; font-weight: 500; color: #333; }
.clock-time-part {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
}
.clock-weekday { font-size: 0.9rem; color: #666; margin-left: 0.35rem; }
.clock-seconds {
    color: #1E9FFF;
    font-weight: 600;
}

/* 倒计时区域样式：与上方时钟拉高间距 */
.countdown-section {
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.countdown-card {
    background: #fafafa;
    border-radius: 2px;
    padding: 0.75rem 1rem;
    border: 1px solid #e6e6e6;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.countdown-label { font-size: 0.75rem; color: #666; }
/* 距离年底天数和倒计时用红色，数字放大 */
.countdown-value {
    font-size: 2rem;
    font-weight: 600;
    color: #c00;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.countdown-unit { font-size: 0.9rem; color: #666; }
.countdown-section .countdown-seconds {
    font-size: 0.95rem;
    color: #c00;
    margin-left: 0.35rem;
    font-variant-numeric: tabular-nums;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .dashboard-time-card {
        margin-top: 1rem;
    }
    
    .dashboard-info-card .card-body,
    .dashboard-time-card .card-body {
        padding: 1rem;
    }
    
    .clock-date-part {
        font-size: 0.75rem;
    }
    
    .clock-time-part {
        font-size: 1.25rem;
    }
    
    .clock-weekday {
        font-size: 0.8rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .countdown-label,
    .countdown-unit {
        font-size: 0.7rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .info-card {
        padding: 0.875rem;
    }
    
    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .info-value {
        font-size: 1.2rem;
    }
    
    .total-sale-value {
        font-size: 2rem;
    }
}

/* ========== 单据详情页通用样式（销售单/采购单）========== */
.doc-view .info-card-main {
    background: #fff;
    border-radius: 2px;
    padding: 1.25rem;
    border: 1px solid #e6e6e6;
}
.doc-view .info-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.doc-view .info-row:last-child { margin-bottom: 0; }
.doc-view .info-col { flex: 1; }
.doc-view .info-label-small {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.35rem;
}
.doc-view .info-value-large {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1E9FFF;
}
.doc-view .info-value-medium {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}
.doc-view .summary-card {
    background: #fafafa;
    border-radius: 2px;
    padding: 1.25rem;
    border: 1px solid #e6e6e6;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}
.doc-view .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.doc-view .summary-label { font-size: 0.875rem; color: #666; }
.doc-view .summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}
.doc-view .summary-value.highlight {
    font-size: 1.2rem;
    color: #1E9FFF;
    font-weight: 600;
}
.doc-view .remark-box {
    background: #fafafa;
    border-left: 3px solid #1E9FFF;
    border-radius: 2px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.doc-view .remark-text {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}
.doc-view .doc-details-section,
.doc-view .sale-details-section {
    background: #fff;
    border-radius: 2px;
    padding: 1.25rem;
    border: 1px solid #e6e6e6;
    margin-bottom: 1.25rem;
}
.doc-view .section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e6e6e6;
}
.doc-view .section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.doc-view .section-title i { color: #1E9FFF; }
.doc-view .table-wrapper { overflow-x: auto; }
.doc-view .doc-table,
.doc-view .sale-table,
.doc-view .delivery-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.doc-view .doc-table thead,
.doc-view .sale-table thead,
.doc-view .delivery-table thead {
    background: #fafafa;
}
.doc-view .doc-table thead th,
.doc-view .sale-table thead th,
.doc-view .delivery-table thead th {
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    border-bottom: 1px solid #e6e6e6;
}
.doc-view .doc-table tbody td,
.doc-view .sale-table tbody td,
.doc-view .delivery-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    color: #333;
    vertical-align: top;
}
.doc-view .doc-table tbody tr:hover,
.doc-view .sale-table tbody tr:hover,
.doc-view .delivery-table tbody tr:hover {
    background: #f9f9f9;
}
.doc-view .product-name { font-weight: 500; color: #333; margin-bottom: 0.2rem; }
.doc-view .product-type { font-size: 0.8rem; color: #666; }
.doc-view .qty-cell,
.doc-view .price-cell,
.doc-view .amount-cell {
    font-weight: 500;
    white-space: nowrap;
}
.doc-view .unit-cell { color: #666; font-size: 0.875rem; }
.doc-view .doc-table tfoot,
.doc-view .sale-table tfoot,
.doc-view .delivery-table tfoot {
    background: #fafafa;
    border-top: 1px solid #e6e6e6;
}
.doc-view .summary-row td {
    padding: 0.75rem;
    font-weight: 600;
    border-bottom: none;
    vertical-align: middle;
}
.doc-view .summary-label-cell { color: #333; }
.doc-view .summary-qty,
.doc-view .total-amount-text {
    font-weight: 600;
    color: #1E9FFF;
}
.doc-view .action-buttons-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid #e6e6e6;
}
.doc-view .action-buttons-right { display: flex; gap: 0.5rem; align-items: center; }
.doc-view .badge-lg { font-size: 0.9rem; padding: 0.4rem 0.75rem; }
.badge-sm { font-size: 0.75rem; padding: 0.2rem 0.4rem; }
@media (max-width: 768px) {
    .doc-view .info-row { flex-direction: column; gap: 0.75rem; }
    .doc-view .action-buttons-section { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .doc-view .action-buttons-right .btn { width: 100%; }
}

/* ========== 全局确认弹窗：卡片模式（layouts/main.php #yii-confirm-modal）========== */
/* 遮罩在下层，弹窗在上层，避免按钮被挡住无法点击 */
#yii-confirm-backdrop { z-index: 1040 !important; }
#yii-confirm-modal.show {
    display: flex !important;
    z-index: 1050 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto;
    visibility: visible !important;
}
#yii-confirm-modal .modal-dialog.modal-confirm-card {
    max-width: 420px;
    margin: 0;
    pointer-events: auto;
    transform: none;
}
#yii-confirm-modal .modal-content.confirm-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15), 0 0 1px rgba(0,0,0,.1);
    overflow: hidden;
    background: #fff !important;
    pointer-events: auto;
}
#yii-confirm-modal .modal-header.confirm-card-header {
    font-weight: 600;
    font-size: 1.05rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}
#yii-confirm-modal .modal-body.confirm-card-body {
    padding: 1.25rem 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
}
#yii-confirm-modal .modal-footer.confirm-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}
#yii-confirm-modal .btn-confirm-ok {
    min-width: 88px;
    font-weight: 500;
}

/* 库存不足弹窗：确保卡片白底和层级 */
#yii-shortage-modal .modal-content.confirm-card {
    background: #fff !important;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
#yii-shortage-modal .modal-dialog {
    margin: 0;
    max-width: 480px;
    pointer-events: auto;
    transform: none;
}
#yii-shortage-modal .modal-content { pointer-events: auto; }

/* 导出信息落款单位：控件高度自动 */
.export-footer-company {
    height: auto;
}

/* 客户对账：发生时间列宽度、单号行背景 */
.report-reconciliation .col-time {
    width: 1%;
    white-space: nowrap;
    max-width: 180px;
}
.report-reconciliation .recon-row-sn td {
    background-color: #e8f0f8;
}
.report-reconciliation .recon-row-sn:hover td {
    background-color: #dce8f4;
}

