/* ========== Layui Admin 风格全局样式 ========== */
/* 电脑端：默认样式，无媒体查询限制 */
/* 手机端：见 mobile.css，仅 @media (max-width: 767px) 内生效 */
/* 全局基础：简洁扁平 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f6f7fb;
    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;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}
.nav-badge-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #dc3545;
    border-radius: 50%;
}

/* 左侧菜单层级：父级更大、更粗，子级更小、内缩 */
.nav-parent {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e7eb;
}
.nav-parent.has-children {
    opacity: 0.9;
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
}
.nav-parent.has-children:hover {
    background: rgba(30, 159, 255, 0.08);
}
.nav-collapse-indicator {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-item.menu-open > .nav-parent .nav-collapse-indicator {
    transform: translateY(-50%) rotate(90deg);
    opacity: 1;
}

/* 一级菜单之间添加轻微分割线 */
.nav-sidebar > .nav-item {
    position: relative;
}
.nav-sidebar > .nav-item + .nav-item::before {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    top: -0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    pointer-events: none;
}
.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;
}

/* 二级菜单：默认折叠，仅当前组/展开组显示 */
.nav-treeview {
    display: block !important;
    padding-left: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease, transform .22s ease;
    pointer-events: none;
}
.nav-item.menu-open > .nav-treeview {
    max-height: 960px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
    .nav-treeview {
        transition: none;
    }
}

/* 内容区：浅灰底 + 紧凑内边距 */
.content-wrapper {
    background: #f6f7fb;
}
.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: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
}

.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    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: 0;
    }
}

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

/* 表单容器：扁平卡片 */
.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,
#customer-selector-modal,
#glue-product-selector-modal,
#stock-check-product-modal,
#customer-price-product-modal,
#customer-price-batch-product-modal,
#production-product-modal,
#process-template-product-modal,
#stock-log-product-modal {
    z-index: 1088 !important;
    position: fixed !important;
    inset: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

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

.modal-backdrop.glue-modal-backdrop,
.modal-backdrop.customer-price-product-backdrop,
.modal-backdrop.customer-price-batch-product-backdrop,
.modal-backdrop.process-template-product-backdrop,
.modal-backdrop.stock-log-product-backdrop,
.modal-backdrop.production-product-backdrop {
    z-index: 1087 !important;
}

/* 强制限制下拉菜单宽度 - 移除，由 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: none;
    margin: 0;
    padding: 0;
}

/* 兼容 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;
}
.dashboard-time-card .card-body {
    padding: 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 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;
}
.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 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    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-year { font-size: 1.35rem; font-weight: 700; color: #2563eb; }
/* 距离年底天数和倒计时用红色，数字放大 */
.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-year { font-size: 1.1rem; }
    
    .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;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .stock-check-form .table-responsive .table,
    .adjust-form .table { min-width: 500px; }
    #barcode-input { font-size: 16px; min-height: 44px; }
    #barcode-scan-btn { min-width: 44px; min-height: 44px; }
}

/* Toast 提示 */
.yii-toast-container { pointer-events: none; }
.yii-toast-item {
    padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-radius: 8px;
    background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.9rem; max-width: 320px;
    opacity: 0; transform: translateX(20px); transition: opacity 0.3s, transform 0.3s;
}
.yii-toast-item.yii-toast-show { opacity: 1; transform: translateX(0); }
.yii-toast-info { border-left: 4px solid #1E9FFF; }
.yii-toast-success { border-left: 4px solid #28a745; }
.yii-toast-warning { border-left: 4px solid #ffc107; }
.yii-toast-danger { border-left: 4px solid #dc3545; }

/* 空状态 */
.empty-state-icon { font-size: 3rem; opacity: 0.5; }
.empty-state-text { font-size: 0.95rem; }

/* 必填标识 */
.form-group label.required::after,
.control-label.required::after { content: ' *'; color: #dc3545; }

/* ========== 移动端适配增强 ========== */
@media (max-width: 768px) {
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .stock-check-form .card-body,
    .adjust-form .form-card-body { overflow-x: auto; }
    #barcode-input, .form-control { font-size: 16px !important; } /* 防止 iOS 缩放 */
    .btn { min-height: 44px; padding: 0.5rem 1rem; } /* 触摸目标 */
}

/* 客户对账：发生时间列宽度、单号行背景 */
.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;
}

/* ========== 2026 UI Upgrade (Art Design Pro 风格) ========== */
:root {
    --ui-bg: #f5f7fb;
    --ui-surface: #ffffff;
    --ui-surface-2: #f8fafc;
    --ui-text: #0f172a;
    --ui-text-2: #334155;
    --ui-text-3: #64748b;
    --ui-border: #e2e8f0;
    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-success: #059669;
    --ui-warning: #d97706;
    --ui-danger: #dc2626;
    --ui-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
    --ui-radius: 12px;
    --ui-transition: all .2s ease;
}

body {
    background: var(--ui-bg);
    color: var(--ui-text);
    font-size: 14px;
}

.content-wrapper,
.content.page-content {
    background: transparent !important;
}

.content-header.page-header-bar {
    background: transparent;
    border-bottom: 0;
    padding: .8rem 0 .25rem;
}

.page-title {
    color: var(--ui-text);
    font-weight: 700;
    letter-spacing: .2px;
}

.breadcrumb {
    background: transparent;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--ui-text-3);
    font-size: 12px;
}

.card,
.module-card,
.form-card {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
    background: var(--ui-surface);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
    border-bottom: 1px solid var(--ui-border);
    padding: .85rem 1.1rem;
}

.card-title {
    color: var(--ui-text);
    font-weight: 700;
}

.card-body {
    background: var(--ui-surface);
}

.form-card-body {
    padding: 1rem 1.1rem;
}

.text-muted {
    color: var(--ui-text-3) !important;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: var(--ui-transition);
}

.btn-primary {
    background: var(--ui-primary);
    border: 1px solid var(--ui-primary);
}

.btn-primary:hover {
    background: var(--ui-primary-hover);
    border-color: var(--ui-primary-hover);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--ui-primary);
    border-color: #bfdbfe;
    background: #eff6ff;
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
}

.btn-outline-secondary {
    color: var(--ui-text-2);
    border-color: var(--ui-border);
    background: #fff;
}

.btn-outline-secondary:hover {
    color: var(--ui-text);
    background: #f8fafc;
    border-color: #cbd5e1;
}

.form-control,
.custom-select {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: var(--ui-text);
    transition: var(--ui-transition);
    box-shadow: none;
}

.form-control:focus,
.custom-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.table {
    color: var(--ui-text-2);
}

.table thead th {
    background: var(--ui-surface-2);
    color: var(--ui-text-2);
    border-color: var(--ui-border);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .2px;
    text-transform: none;
}

.table td {
    border-color: #edf2f7;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f8fbff;
}

.badge {
    border-radius: 999px;
    padding: .34rem .58rem;
    font-weight: 600;
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-success {
    background: #dcfce7;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.dropdown-menu {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    box-shadow: var(--ui-shadow);
}

.pagination .page-link {
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    margin: 0 3px;
    color: var(--ui-text-2);
}

.pagination .page-item.active .page-link {
    color: #fff;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
}

.main-sidebar {
    box-shadow: 2px 0 16px rgba(15,23,42,.08);
}

.sidebar .nav-link {
    border-radius: 10px;
    margin: 3px 8px;
    transition: var(--ui-transition);
}

.sidebar .nav-link:hover {
    background: rgba(37, 99, 235, .08);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(37,99,235,.14), rgba(37,99,235,.05));
    color: #1d4ed8 !important;
}

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
}

.modal-content {
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
}

@media (max-width: 768px) {
    .card-header {
        padding: .75rem .85rem;
    }
    .card-body,
    .form-card-body {
        padding: .8rem;
    }
}

/* ========== Full UI Unification (ArtD-like) ========== */
.wrapper,
.content-wrapper,
.main-footer {
    background: var(--ui-bg) !important;
}

.main-header.navbar {
    border-bottom: 1px solid var(--ui-border) !important;
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: saturate(180%) blur(8px);
}

.main-footer {
    border-top: 1px solid var(--ui-border);
    color: var(--ui-text-3);
}

.content.page-content .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

.module-page .card-header h2,
.module-page .card-header .h5,
.module-page .card-header .h6,
.form-card .card-header h2,
.form-card .card-header .h5 {
    margin: 0;
    font-weight: 700;
    color: var(--ui-text);
}

.module-page .card-header p,
.module-page .card-header .small {
    margin-bottom: 0;
    color: var(--ui-text-3) !important;
}

.form-section {
    background: #fcfdff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: .9rem .95rem .4rem;
}

.form-section h6 {
    border-bottom: 1px solid var(--ui-border) !important;
    color: var(--ui-text-2) !important;
    font-weight: 700;
}

.form-group label,
.control-label {
    color: var(--ui-text-2);
    font-weight: 600;
    margin-bottom: .35rem;
}

.help-block,
.form-text {
    color: var(--ui-text-3) !important;
}

.table-responsive {
    border-radius: 10px;
}

.table.table-bordered {
    border-color: var(--ui-border);
}

.table.table-bordered th,
.table.table-bordered td {
    border-color: #e9eef5;
}

.table-sm th,
.table-sm td {
    padding: .52rem .55rem;
}

.card .border-top {
    border-top-color: var(--ui-border) !important;
}

.card .border-bottom {
    border-bottom-color: var(--ui-border) !important;
}

.nav-tabs {
    border-bottom: 1px solid var(--ui-border);
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    color: var(--ui-text-3);
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    color: var(--ui-primary);
    border-color: var(--ui-border) var(--ui-border) #fff;
    background: #fff;
}

.btn-group .btn,
.btn-sm {
    border-radius: 9px !important;
}

.dropdown-item {
    border-radius: 8px;
    margin: 2px 6px;
    width: auto;
}

.dropdown-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* 生产时间线与操作区统一风格 */
.timeline-content {
    border-radius: 10px !important;
    border-color: #e6edf5 !important;
    background: #fff !important;
}

.timeline-title strong {
    color: var(--ui-text);
}

.current-step-form {
    background: #f8fbff;
    border: 1px dashed #bfdbfe;
    border-radius: 10px;
    padding: .55rem .6rem .2rem;
}

.current-step-form .btn-primary {
    min-width: 120px;
}

/* 搜索过滤组件统一 */
.search-filter-card,
.search-filter-wrap {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
}

/* 复选框与色块按钮统一 */
.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--ui-primary);
    background-color: var(--ui-primary);
}

.color-preset-btn {
    transition: var(--ui-transition);
}

.color-preset-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
}

/* 数字展示更易读 */
.font-weight-bold,
strong {
    color: var(--ui-text);
}

/* 移动端进一步优化 */
@media (max-width: 992px) {
    .module-page .card-header {
        gap: .45rem;
    }
    .module-page .btn {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .content.page-content .container-fluid {
        padding-left: .65rem;
        padding-right: .65rem;
    }
    .form-section {
        padding: .75rem .75rem .2rem;
    }
    .table-sm th,
    .table-sm td {
        padding: .5rem .45rem;
    }
}

/* layout hooks from main.php */
.artd-shell .artd-topbar {
    min-height: 56px;
}
.artd-shell .artd-sidebar .brand-link {
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-top: .75rem;
    padding-bottom: .75rem;
}
.artd-shell .artd-brand-link .brand-text {
    font-weight: 700 !important;
    letter-spacing: .2px;
}
.artd-shell .artd-content-wrap {
    padding-bottom: .75rem;
}
.artd-shell .artd-page-header {
    padding-top: .7rem;
}
.artd-shell .artd-footer {
    background: transparent !important;
}

/* ===== 2026-03 ArtD full-page convergence ===== */
.module-page > .module-card,
.module-page > .form-card,
.module-page .module-card {
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    background: #fff;
}

.module-page .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid var(--ui-border);
}

.module-page .card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2a44;
}

.module-page form.mb-3,
.module-page .card-body > form:first-child {
    background: #f8fbff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    padding: 14px 16px;
}

.module-page table.table thead th {
    background: #f4f8ff;
    color: #25324d;
    font-weight: 700;
}

.module-page .badge {
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
}

/* Sales-map keeps big-screen layout, converges ArtD palette */
#screen-root {
    --screen-card-bg: rgba(17, 28, 58, 0.76);
    --screen-card-border: rgba(111, 174, 255, 0.32);
    --screen-title: #dce9ff;
    --screen-text: #b9c8ea;
}

#screen-root #screen-inner,
#screen-root .screen-middle,
#screen-root .card {
    color: var(--screen-text);
}

#screen-root .card {
    background: var(--screen-card-bg) !important;
    border: 1px solid var(--screen-card-border) !important;
    box-shadow: 0 14px 30px rgba(5, 10, 25, 0.35);
    border-radius: 14px !important;
}

#screen-root .card-title,
#screen-root .brand-main,
#screen-root .kpi-title {
    color: var(--screen-title) !important;
}

#screen-root .map-back-btn {
    border-radius: 10px !important;
    border-color: rgba(77, 163, 255, 0.5) !important;
    background: rgba(23, 43, 90, 0.75) !important;
    color: #dce9ff !important;
}

/* Report pages: pixel-level unified scaffold */
.report-page-head .card-body {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    border-radius: 14px;
}

.report-page-head h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .1px;
}

.report-filter-form {
    padding: 12px;
    border-radius: 10px;
}

.report-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2a44;
    margin-bottom: 10px;
}

/* ===== ArtD 外观系统：主题/菜单/容器 ===== */
.artd-theme-panel {
    position: fixed;
    top: 64px;
    right: -340px;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    z-index: 1062;
    transition: right .25s ease;
}
.artd-theme-panel.show { right: 12px; }
.artd-theme-mask {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .36);
    z-index: 1061;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.artd-theme-mask.show { opacity: 1; pointer-events: auto; }
.artd-theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ui-border);
}
.artd-theme-panel-body { padding: 12px 14px; }
.artd-theme-group { margin-bottom: 10px; }
.artd-theme-group label {
    display: block;
    font-size: 12px;
    color: var(--ui-text-3);
    margin-bottom: 6px;
}

/* 主题模式 */
.artd-theme-dark {
    --ui-bg: #0b1220;
    --ui-surface: #121a2b;
    --ui-surface-2: #182236;
    --ui-text: #e5ecf8;
    --ui-text-2: #c2cce0;
    --ui-text-3: #8fa0bf;
    --ui-border: #25324a;
    --ui-primary: #4d8dff;
    --ui-primary-hover: #3d7cf0;
    --ui-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.artd-theme-dark .main-header.navbar,
.artd-theme-dark .main-footer,
.artd-theme-dark .card,
.artd-theme-dark .module-card,
.artd-theme-dark .form-card,
.artd-theme-dark .artd-theme-panel {
    background: var(--ui-surface) !important;
    color: var(--ui-text);
    border-color: var(--ui-border) !important;
}
.artd-theme-dark .card-header,
.artd-theme-dark .table thead th {
    background: var(--ui-surface-2) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text-2) !important;
}
.artd-theme-dark .table td,
.artd-theme-dark .form-control,
.artd-theme-dark .custom-select {
    background: #0f1728;
    color: var(--ui-text-2);
    border-color: var(--ui-border);
}

/* 跟随系统 */
@media (prefers-color-scheme: dark) {
    .artd-theme-auto {
        --ui-bg: #0b1220;
        --ui-surface: #121a2b;
        --ui-surface-2: #182236;
        --ui-text: #e5ecf8;
        --ui-text-2: #c2cce0;
        --ui-text-3: #8fa0bf;
        --ui-border: #25324a;
        --ui-primary: #4d8dff;
        --ui-primary-hover: #3d7cf0;
        --ui-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }
}

/* 菜单布局 */
.artd-menu-compact .nav-sidebar .nav-link { padding-top: .36rem; padding-bottom: .36rem; }
.artd-menu-compact .nav-sidebar .nav-icon { font-size: .86rem; }

/* 菜单风格 */
.artd-menu-style-line .sidebar .nav-link.active {
    background: transparent !important;
    border-left: 3px solid var(--ui-primary);
    border-radius: 0 8px 8px 0;
}
.artd-menu-style-solid .sidebar .nav-link.active {
    background: var(--ui-primary) !important;
    color: #fff !important;
}
.artd-menu-style-solid .sidebar .nav-link.active .nav-icon,
.artd-menu-style-solid .sidebar .nav-link.active p { color: #fff !important; }

/* 卡片风格 */
.artd-box-flat .card,
.artd-box-flat .module-card,
.artd-box-flat .form-card { box-shadow: none !important; border-radius: 10px; }

.artd-box-glass .card,
.artd-box-glass .module-card,
.artd-box-glass .form-card {
    background: rgba(255, 255, 255, .75) !important;
    backdrop-filter: blur(10px);
}

/* 容器宽度 */
.artd-container-full .content.page-content .container-fluid,
.artd-container-full .content-header .container-fluid { max-width: 100%; }
.artd-container-wide .content.page-content .container-fluid,
.artd-container-wide .content-header .container-fluid { max-width: 1680px; }
.artd-container-narrow .content.page-content .container-fluid,
.artd-container-narrow .content-header .container-fluid { max-width: 1320px; }

/* ===== 全站列表 / 表单 / 操作区尺寸统一（跟随容器宽度） ===== */
:root {
    --artd-page-max-width: 1680px;
    --artd-content-gutter-x: 1rem;
}

.artd-container-full {
    --artd-page-max-width: 100%;
}

.artd-container-wide {
    --artd-page-max-width: 1680px;
}

.artd-container-narrow {
    --artd-page-max-width: 1320px;
}

.content-header .container-fluid,
.content.page-content .container-fluid {
    max-width: var(--artd-page-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--artd-content-gutter-x);
    padding-right: var(--artd-content-gutter-x);
}

/* 页面主容器：让列表卡片、表单卡片和操作区使用一致宽度 */
.module-page,
.doc-view,
.report-page {
    width: 100%;
    max-width: var(--artd-page-max-width);
    margin-left: auto;
    margin-right: auto;
}

.module-page > .module-card,
.module-page > .form-card,
.module-page .module-card,
.module-page .form-card {
    width: 100%;
}

/* 列表筛选区、表单首个操作区统一内距与圆角 */
.module-page form.mb-3,
.module-page .card-body > form:first-child {
    padding: 14px 16px;
    border-radius: 12px;
}

/* 操作按钮区：统一对齐与间距 */
.module-page .card-header .btn,
.module-page .card-header .btn-group,
.module-page .card-body .btn-group {
    margin-bottom: 0;
}

.module-page .card-header .btn-group {
    gap: 0.45rem;
}

/* 统一头部操作按钮：全部靠右（列表/表单/详情/报表） */
.module-page .card-header,
.doc-view .card-header,
.report-page .card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.module-page .card-header > :first-child,
.doc-view .card-header > :first-child,
.report-page .card-header > :first-child {
    margin-right: auto;
}

.module-page .card-header > .btn,
.module-page .card-header > .btn-group,
.module-page .card-header > a.btn,
.doc-view .card-header > .btn,
.doc-view .card-header > .btn-group,
.doc-view .card-header > a.btn,
.report-page .card-header > .btn,
.report-page .card-header > .btn-group,
.report-page .card-header > a.btn {
    margin-left: 0.25rem;
}

/* 表单行：不同页面保持一致的换行与间距 */
.module-page .form-row {
    row-gap: 0.25rem;
}

.module-page .form-row > .form-group {
    margin-bottom: 0.9rem;
}

/* 列表表格比例修正：避免列宽占比失衡、操作列挤压 */
.module-page .table-responsive > .table,
.module-page .table-responsive .table {
    width: 100%;
    table-layout: auto !important;
}

.module-page .table thead th {
    white-space: nowrap;
}

.module-page .table tbody td {
    vertical-align: middle;
}

/* 操作列（通常最后一列）固定为内容宽，不参与挤压 */
.module-page .table thead th:last-child,
.module-page .table tbody td:last-child {
    width: 1%;
    white-space: nowrap;
}

.module-page .table tbody td:last-child .btn,
.module-page .table tbody td:last-child .btn-group,
.module-page .table tbody td:last-child a.btn {
    white-space: nowrap;
}

@media (max-width: 767px) {
    :root {
        --artd-content-gutter-x: 0.75rem;
    }

    .module-page .card-header .btn-group {
        width: 100%;
    }
}

