/* ERP企业级专业样式系统 */

:root {
    /* ERP专业色彩系统 */
    --erp-primary: #1e3a8a;
    --erp-primary-light: #3b82f6;
    --erp-primary-dark: #1e40af;
    --erp-secondary: #64748b;
    --erp-accent: #0ea5e9;
    --erp-success: #059669;
    --erp-warning: #d97706;
    --erp-danger: #dc2626;
    --erp-info: #0891b2;
    
    /* 中性色系统 */
    --erp-gray-50: #f8fafc;
    --erp-gray-100: #f1f5f9;
    --erp-gray-200: #e2e8f0;
    --erp-gray-300: #cbd5e1;
    --erp-gray-400: #94a3b8;
    --erp-gray-500: #64748b;
    --erp-gray-600: #475569;
    --erp-gray-700: #334155;
    --erp-gray-800: #1e293b;
    --erp-gray-900: #0f172a;
    
    /* ERP背景色 */
    --erp-bg-primary: #ffffff;
    --erp-bg-secondary: #f8fafc;
    --erp-bg-tertiary: #f1f5f9;
    --erp-surface: #ffffff;
    --erp-border: #e2e8f0;
    --erp-border-light: #f1f5f9;
    
    /* 文字颜色 */
    --erp-text-primary: #0f172a;
    --erp-text-secondary: #475569;
    --erp-text-muted: #64748b;
    --erp-text-inverse: #ffffff;
    
    /* ERP阴影系统 */
    --erp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --erp-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --erp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --erp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* ERP尺寸系统 */
    --erp-radius-sm: 4px;
    --erp-radius: 6px;
    --erp-radius-md: 8px;
    --erp-radius-lg: 12px;
    
    /* ERP间距系统 */
    --erp-space-xs: 0.25rem;
    --erp-space-sm: 0.5rem;
    --erp-space: 1rem;
    --erp-space-md: 1.5rem;
    --erp-space-lg: 2rem;
    --erp-space-xl: 3rem;
    
    /* ERP字体 */
    --erp-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --erp-font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
}

/* 重置和基础样式 */
* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    line-height: 1.5;
}

body {
    margin: 0;
    font-family: var(--erp-font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--erp-text-primary);
    background: var(--erp-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ERP布局容器 */
.erp-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--erp-space);
}

.erp-main {
    display: flex;
    min-height: 100vh;
}

.erp-sidebar {
    width: 180px;
    background: var(--erp-surface);
    border-right: 1px solid var(--erp-border);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.erp-content {
    flex: 1;
    background: var(--erp-bg-secondary);
    min-height: 100vh;
    margin-left: 180px;
    padding-top: 65px;
}

/* ERP头部 */
.erp-header {
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    padding: var(--erp-space) var(--erp-space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--erp-shadow-sm);
    position: fixed;
    top: 0;
    left: 180px;
    right: 0;
    z-index: 100;
}

.erp-logo {
    display: flex;
    align-items: center;
    gap: var(--erp-space-sm);
    font-size: 18px;
    font-weight: 600;
    color: var(--erp-primary);
}

.erp-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--erp-primary);
    border-radius: var(--erp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.erp-user-menu {
    display: flex;
    align-items: center;
    gap: var(--erp-space);
}

/* ERP导航 */
.erp-nav {
    padding: var(--erp-space);
}

.erp-nav-section {
    margin-bottom: var(--erp-space-md);
}

.erp-nav-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--erp-text-muted);
    margin-bottom: var(--erp-space-sm);
    padding: 0 var(--erp-space-sm);
    line-height: 1.0;
}

.erp-nav-item {
    display: flex;
    align-items: center;
    gap: var(--erp-space-sm);
    padding: var(--erp-space-sm) var(--erp-space);
    margin: 2px 0;
    border-radius: var(--erp-radius);
    color: var(--erp-text-secondary);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.erp-nav-item:hover {
    background: var(--erp-bg-tertiary);
    color: var(--erp-text-primary);
}

.erp-nav-item.active {
    background: var(--erp-primary);
    color: var(--erp-text-inverse);
    font-weight: 500;
}

.erp-nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ERP面包屑 */
.erp-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--erp-space-sm);
    padding: var(--erp-space-sm) 0;
    font-size: 13px;
    color: var(--erp-text-muted);
}

.erp-breadcrumb-item {
    color: var(--erp-text-secondary);
    text-decoration: none;
}

.erp-breadcrumb-item:hover {
    color: var(--erp-primary);
}

.erp-breadcrumb-separator {
    color: var(--erp-text-muted);
}

/* ERP页面标题 */
.erp-page-header {
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    padding: var(--erp-space-lg) var(--erp-space-lg);
    margin-bottom: var(--erp-space-lg);
}

.erp-page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--erp-text-primary);
    margin: 0 0 var(--erp-space-sm) 0;
}

/* 页面标题内部容器：标题与描述垂直排列 */
.header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 页面描述（副标题） */
.page-description {
    font-size: 14px;
    color: var(--erp-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.erp-page-subtitle {
    font-size: 14px;
    color: var(--erp-text-secondary);
    margin: 0;
}

/* ERP卡片 */
.erp-card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    box-shadow: var(--erp-shadow-sm);
    margin-bottom: var(--erp-space);
}

.erp-card-header {
    padding: var(--erp-space) var(--erp-space-lg);
    border-bottom: 1px solid var(--erp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.erp-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--erp-text-primary);
    margin: 0;
}

.erp-card-body {
    padding: var(--erp-space-lg);
}

.erp-card-footer {
    padding: var(--erp-space) var(--erp-space-lg);
    border-top: 1px solid var(--erp-border);
    background: var(--erp-bg-secondary);
    border-radius: 0 0 var(--erp-radius-md) var(--erp-radius-md);
}

/* ERP表单 */
.erp-form {
    display: flex;
    flex-direction: column;
    gap: var(--erp-space);
}

.erp-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--erp-space);
}

.erp-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--erp-space-xs);
}

.erp-form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--erp-text-primary);
}

.erp-form-label.required::after {
    content: ' *';
    color: var(--erp-danger);
}

.erp-form-control {
    padding: var(--erp-space-sm) var(--erp-space);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    font-size: 14px;
    font-family: var(--erp-font-family);
    background: var(--erp-bg-primary);
    color: var(--erp-text-primary);
    transition: all 0.15s ease;
}

.erp-form-control:focus {
    outline: none;
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.erp-form-control:disabled {
    background: var(--erp-bg-tertiary);
    color: var(--erp-text-muted);
    cursor: not-allowed;
}

.erp-form-hint {
    font-size: 12px;
    color: var(--erp-text-muted);
}

.erp-form-error {
    font-size: 12px;
    color: var(--erp-danger);
}

/* ERP按钮 */
.erp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--erp-space-xs);
    padding: var(--erp-space-sm) var(--erp-space);
    border: 1px solid transparent;
    border-radius: var(--erp-radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--erp-font-family);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.erp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.erp-btn-primary {
    background: var(--erp-primary);
    color: var(--erp-text-inverse);
    border-color: var(--erp-primary);
}

.erp-btn-primary:hover:not(:disabled) {
    background: var(--erp-primary-dark);
    border-color: var(--erp-primary-dark);
}

.erp-btn-secondary {
    background: var(--erp-surface);
    color: var(--erp-text-primary);
    border-color: var(--erp-border);
}

.erp-btn-secondary:hover:not(:disabled) {
    background: var(--erp-bg-tertiary);
    border-color: var(--erp-gray-300);
}

.erp-btn-success {
    background: var(--erp-success);
    color: var(--erp-text-inverse);
    border-color: var(--erp-success);
}

.erp-btn-warning {
    background: var(--erp-warning);
    color: var(--erp-text-inverse);
    border-color: var(--erp-warning);
}

.erp-btn-danger {
    background: var(--erp-danger);
    color: var(--erp-text-inverse);
    border-color: var(--erp-danger);
}

.erp-btn-sm {
    padding: var(--erp-space-xs) var(--erp-space-sm);
    font-size: 13px;
}

.erp-btn-lg {
    padding: var(--erp-space) var(--erp-space-lg);
    font-size: 16px;
}

/* ERP表格 */
.erp-table-container {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    overflow: hidden;
    margin-bottom: var(--erp-space);
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.erp-table th {
    background: var(--erp-bg-tertiary);
    padding: var(--erp-space-sm) var(--erp-space);
    text-align: left;
    font-weight: 600;
    color: var(--erp-text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--erp-border);
}

.erp-table td {
    padding: var(--erp-space-sm) var(--erp-space);
    border-bottom: 1px solid var(--erp-border-light);
    color: var(--erp-text-primary);
    text-align: left;
}

.erp-table tbody tr:hover {
    background: var(--erp-bg-secondary);
}

.erp-table tbody tr:last-child td {
    border-bottom: none;
}

.erp-table .line-row td {
    padding: 6px 10px;
    vertical-align: middle;
}

.erp-table .line-row .form-input {
    padding: 6px 8px;
    font-size: 13px;
}

/* ERP状态标签 */
.erp-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--erp-space-xs);
    padding: var(--erp-space-xs) var(--erp-space-sm);
    border-radius: var(--erp-radius);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.erp-badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--erp-success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.erp-badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--erp-warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.erp-badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--erp-danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.erp-badge-info {
    background: rgba(8, 145, 178, 0.1);
    color: var(--erp-info);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

/* ERP工具栏 */
.erp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--erp-space);
    padding: var(--erp-space) var(--erp-space-lg);
    background: var(--erp-surface);
    border-bottom: 1px solid var(--erp-border);
    margin-bottom: var(--erp-space);
}

.erp-toolbar-left,
.erp-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--erp-space);
}

.erp-search {
    position: relative;
    width: 300px;
}

.erp-search-input {
    width: 100%;
    padding: var(--erp-space-sm) var(--erp-space) var(--erp-space-sm) 36px;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    font-size: 14px;
}

.erp-search-icon {
    position: absolute;
    left: var(--erp-space-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-text-muted);
}

/* ERP统计卡片 */
.erp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--erp-space);
    margin-bottom: var(--erp-space-lg);
}

.erp-stat-card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-md);
    padding: var(--erp-space-lg);
    box-shadow: var(--erp-shadow-sm);
}

.erp-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--erp-space);
}

.erp-stat-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--erp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.erp-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--erp-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.erp-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--erp-text-primary);
    margin-bottom: var(--erp-space-xs);
}

.erp-stat-change {
    font-size: 12px;
    font-weight: 500;
}

.erp-stat-change.positive {
    color: var(--erp-success);
}

.erp-stat-change.negative {
    color: var(--erp-danger);
}

/* ERP消息提示 */
.erp-alert {
    padding: var(--erp-space) var(--erp-space-lg);
    border-radius: var(--erp-radius);
    border: 1px solid;
    margin-bottom: var(--erp-space);
    display: flex;
    align-items: center;
    gap: var(--erp-space-sm);
}

.erp-alert-success {
    background: rgba(5, 150, 105, 0.05);
    border-color: rgba(5, 150, 105, 0.2);
    color: var(--erp-success);
}

.erp-alert-warning {
    background: rgba(217, 119, 6, 0.05);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--erp-warning);
}

.erp-alert-danger {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--erp-danger);
}

.erp-alert-info {
    background: rgba(8, 145, 178, 0.05);
    border-color: rgba(8, 145, 178, 0.2);
    color: var(--erp-info);
}

/* ERP加载状态 */
.erp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--erp-border);
    border-top: 2px solid var(--erp-primary);
    border-radius: 50%;
    animation: erp-spin 1s linear infinite;
}

@keyframes erp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ERP空状态 */
.erp-empty-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--erp-space-xl);
    text-align: center;
    color: var(--erp-text-muted);
    min-height: 200px;
}

/* ERP响应式设计 */
@media (max-width: 1024px) {
    .erp-sidebar {
        width: 160px;
    }
    
    .erp-content {
        margin-left: 160px;
    }
    
    .erp-search {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .erp-main {
        flex-direction: column;
    }
    
    .erp-sidebar {
        position: static;
        width: 100%;
        height: auto;
        order: 2;
        margin-left: 0;
    }
    
    .erp-content {
        order: 1;
        margin-left: 0;
    }
    
    .erp-form-row {
        grid-template-columns: 1fr;
    }
    
    .erp-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .erp-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--erp-space);
    }
    
    .erp-toolbar-left,
    .erp-toolbar-right {
        justify-content: center;
    }
    
    .erp-search {
        width: 100%;
    }
}

/* ERP深色主题 */
@media (prefers-color-scheme: dark) {
    :root {
        --erp-bg-primary: #0f172a;
        --erp-bg-secondary: #1e293b;
        --erp-bg-tertiary: #334155;
        --erp-surface: #1e293b;
        --erp-border: #334155;
        --erp-border-light: #475569;
        --erp-text-primary: #f1f5f9;
        --erp-text-secondary: #cbd5e1;
        --erp-text-muted: #94a3b8;
    }
}

/* ==================== 新布局系统 ==================== */

/* 全宽顶部头部 */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.system-time {
    font-size: 14px;
    opacity: 0.9;
    font-family: 'JetBrains Mono', monospace;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.system-status {
    font-size: 13px;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.logout-btn {
    cursor: pointer;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #1e3a8a;
    border: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logout-btn:hover {
    background: #ffffff;
    color: #1e40af;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* 主布局容器 */
.main-layout {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 左侧菜单栏 */
.sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 20px 8px;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    margin: -2px 12px;
    border-radius: 6px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1e3a8a;
}

.nav-link.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.nav-link span {
    font-size: 14px;
}

/* 右侧内容区 */
.content-area {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    background: #f8fafc;
    min-height: calc(100vh - 60px);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #64748b;
}

.breadcrumb a {
    color: #475569;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1e3a8a;
}

.breadcrumb span:last-child {
    color: #1e3a8a;
    font-weight: 500;
}

/* Flash消息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}

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

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

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

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

/* 页面标题区 */
.page-header {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.page-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* 数据卡片 */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-box {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #dbeafe;
}

.stat-icon.green {
    background: #d1fae5;
}

.stat-icon.orange {
    background: #fef3c7;
}

.stat-icon.red {
    background: #fee2e2;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

.btn-primary:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

.btn-secondary {
    background: white;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* 响应式 - 1400px以下收缩为图标模式 */
@media (max-width: 1400px) {
    .sidebar {
        width: 60px;
        overflow: visible;
    }

    .sidebar-nav {
        padding: 8px 0;
    }

    .nav-group {
        margin-bottom: 4px;
    }

    .nav-title {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 5px 0;
        margin: 4px 8px;
        position: relative;
    }

    .nav-link span:first-child {
        font-size: 14px;
    }

    .nav-text {
        display: none;
    }

    /* 悬停提示框 */
    .nav-link[data-title]::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: #1e3a8a;
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        margin-left: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        pointer-events: none;
    }

    /* 悬停提示框箭头 */
    .nav-link[data-title]::before {
        content: '';
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: #1e3a8a;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        margin-left: -2px;
        z-index: 1000;
        pointer-events: none;
    }

    /* 悬停时显示提示 */
    .nav-link:hover[data-title]::after,
    .nav-link:hover[data-title]::before {
        opacity: 1;
        visibility: visible;
    }

    .nav-link:hover {
        background: #dbeafe;
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
    }

    .nav-link.active {
        background: #1e40af;
        color: white;
    }

    .nav-link.active:hover {
        background: #1e3a8a;
    }

    .content-area {
        margin-left: 60px;
    }
}

/* 其他响应式调整 - 保持头部布局 */
@media (max-width: 768px) {
    .main-header {
        padding: 0 16px;
    }

    .logo-text {
        font-size: 16px;
    }
}

/* ==================== 弹窗模态框样式 ==================== */
.erp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.erp-modal.active, .erp-modal[style*="flex"] {
    display: flex !important;
}

.erp-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.erp-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.erp-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

.erp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.erp-modal-close:hover {
    color: #1e3a8a;
}

.erp-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.erp-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
}

/* 表单字段样式 */
.form-field {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #1e293b;
    transition: all 0.2s;
}

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

.form-input::placeholder {
    color: #94a3b8;
}

/* 弹窗响应式 */
@media (max-width: 768px) {
    .erp-modal-content {
        max-width: 95% !important;
        width: 95% !important;
        margin: 10px !important;
    }
    
    .erp-modal-header {
        padding: 12px 16px;
    }
    
    .erp-modal-body {
        padding: 16px;
    }
    
    .erp-modal-footer {
        padding: 12px 16px;
    }
}

/* =========================================================
   以下为原 material_inbound.css 共享样式
   已于 2026-08-26 合并入 style.css（全局生效，不再单独引入）
   ========================================================= */
/* =========================================================
   material_inbound.css
   从 material_inbound.php 抽取的页面样式，现作为共享基础样式，
   供 采购入库页 / 供应商页 等共用。
   设计令牌：主色 #1d4ed8 / 边框 #e5e7eb / 圆角 3-4px / 扁平无重阴影
   需在本页经全局 style.css 之后引入（即放在 <body> 内或布局之后）。
   ========================================================= */

/* 页面标题 */
.page-title-section { margin-bottom: 14px; }
.page-title-section h1 {
    font-size: 20px; font-weight: 700; color: #1f2937;
    display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.page-title-section .subtitle { font-size: 13px; color: #6b7280; margin-left: 30px; }

/* 标签页 */
.tabs {
    display: flex; border-bottom: 1px solid #e5e7eb; margin-bottom: 14px; gap: 0;
}
.tab {
    padding: 8px 18px; font-size: 13.5px; color: #6b7280; background: transparent;
    border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: all 0.15s; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: #1d4ed8; }
.tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }

/* 标签面板切换 */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: erpTabFade 0.2s ease; }
@keyframes erpTabFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* 卡片 */
.card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 4px;
    margin-bottom: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card-header {
    padding: 10px 16px; border-bottom: 1px solid #f3f4f6;
    display: flex; align-items: center; justify-content: space-between;
    background: #fafbfc; flex-wrap: wrap; gap: 8px;
}
.card-title { font-size: 14px; font-weight: 600; color: #1f2937; }
.card-body { padding: 16px; }
/* 卡片标题行高固定 20px，批量签收按钮显隐时不撑高 header */
.card-header .card-title { line-height: 20px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 表单 */
.form-row { display: flex; gap: 16px; margin-bottom: 14px; align-items: flex-end; flex-wrap: wrap; }
.form-header-grid { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 0; }
.form-header-grid .form-field-checkbox { justify-content: flex-end; }
.form-header-grid .checkbox-label { padding-bottom: 0; }
.form-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.form-field label { font-size: 12.5px; font-weight: 500; color: #4b5563; }
.form-input, .form-control {
    padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 3px;
    font-size: 13px; color: #1f2937; background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s; outline: none; width: 100%;
}
.form-input:focus, .form-control:focus {
    border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.1);
}
.checkbox-label {
    display: flex; align-items: center; gap: 6px; font-size: 13px;
    color: #4b5563; padding-bottom: 6px; flex-shrink: 0; cursor: pointer;
}
.checkbox-label input { accent-color: #1d4ed8; width: 15px; height: 15px; }

/* 表格 */
.table-wrap { width: 100%; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 3px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.data-table thead th {
    padding: 9px 8px; text-align: left; font-weight: 600; color: #4b5563;
    background: #f8fafc; border-bottom: 1px solid #e5e7eb; white-space: nowrap;
    font-size: 12.5px; overflow: hidden; text-overflow: ellipsis;
}
.data-table tbody td {
    padding: 8px 8px; border-bottom: 1px solid #f3f4f6; color: #1f2937;
    vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table input[type="text"], .data-table input[type="number"] {
    padding: 5px 7px; border: 1px solid #d1d5db; border-radius: 3px;
    font-size: 13px; width: 100%; outline: none;
}
.data-table input[type="text"]:focus, .data-table input[type="number"]:focus {
    border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.1);
}
.data-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: #1d4ed8; }

.batch-no { font-family: 'Consolas','Monaco',monospace; font-size: 12px; font-weight: 600; color: #1e40af; }
.batch-display {
    background: #f8fafc !important; font-family: 'Consolas','Monaco',monospace !important;
    font-weight: 600 !important; color: #1e40af !important; border: 1px dashed #cbd5e1 !important;
}
.qty { font-variant-numeric: tabular-nums; font-weight: 500; }
.qty-editable {
    cursor: pointer; padding: 2px 8px; border-radius: 4px;
    border: 1px dashed transparent; transition: all 0.15s ease; user-select: none;
    display: inline-block; min-width: 52px; text-align: right;
}
.qty-editable:hover { background: rgba(30,58,138,0.10); border-color: #1d4ed8; color: #1d4ed8; }
.qty-editable input { font-family: inherit; }

/* 列宽 */
.col-check { width: 4%; }
.col-batch { width: 13%; }
.col-supplier { width: 12%; }
.col-material { width: 12%; }
.col-qty { width: 8%; }
.col-remain { width: 8%; }
.col-notes { width: 9%; }
.col-date { width: 10%; }
.col-status { width: 8%; }
.col-action { width: 6%; text-align: center; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    border: 1px solid transparent; border-radius: 3px; font-size: 13px;
    font-weight: 500; transition: all 0.15s; text-decoration: none;
    line-height: 1.4; white-space: nowrap; cursor: pointer;
}
.btn-primary { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.btn-primary:hover { background: #1e40af; border-color: #1e40af; }
.btn-secondary { background: #fff; color: #4b5563; border-color: #d1d5db; }
.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; color: #1f2937; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fef2f2; border-color: #dc2626; }
.btn-success { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-warning { background: #fff; color: #b45309; border-color: #fcd34d; }
.btn-warning:hover { background: #fffbeb; border-color: #b45309; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-add-row { background: #f0fdf4 !important; color: #166534 !important; border-color: #bbf7d0 !important; }
.btn-add-row:hover { background: #dcfce7 !important; border-color: #86efac !important; }

/* 徽章 */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 3px;
    font-size: 11.5px; font-weight: 500; line-height: 1.5;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }
.sign-clickable { cursor: pointer; }
.sign-clickable:hover { opacity: 0.85; }

/* 表单操作区 */
.form-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid #f3f4f6;
    flex-wrap: wrap; gap: 10px;
}

/* 分页 */
.pagination-container {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-top: 1px solid #f3f4f6; background: #fafbfc;
    font-size: 12.5px; flex-wrap: wrap; gap: 8px;
}
.pagination-info { color: #6b7280; }
.pagination-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination-btn, .page-btn {
    padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 3px;
    font-size: 12.5px; color: #4b5563; background: #fff; text-decoration: none;
    transition: all 0.15s; cursor: pointer;
}
.pagination-btn:hover:not(.disabled), .page-btn:hover:not(.disabled) { border-color: #1d4ed8; color: #1d4ed8; }
.pagination-btn.disabled, .page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-num, .page-num {
    min-width: 28px; height: 26px; padding: 0 7px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #d1d5db; border-radius: 3px; font-size: 12.5px;
    color: #4b5563; background: #fff; text-decoration: none; transition: all 0.15s;
}
.pagination-num:hover, .page-num:hover { border-color: #1d4ed8; color: #1d4ed8; }
.pagination-num.active, .page-num.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.pagination-ellipsis, .page-ellipsis { color: #9ca3af; padding: 0 4px; }

/* 弹窗 */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center;
    z-index: 2000; animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 4px;
    width: 100%; max-width: 500px; animation: slideUp 0.18s ease; overflow: hidden;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
    padding: 10px 16px; border-bottom: 1px solid #f3f4f6;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 14px; font-weight: 600; color: #1f2937; line-height: 20px; margin: 0; }
.modal-close {
    width: 21px; height: 21px; border: none; background: transparent; font-size: 14px;
    color: #9ca3af; cursor: pointer; border-radius: 4px; transition: all 0.12s;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 16px; }
.modal-footer {
    padding: 10px 16px; border-top: 1px solid #e5e7eb;
    display: flex; justify-content: flex-end; gap: 8px;
}
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 12.5px; font-weight: 500; color: #4b5563; margin-bottom: 6px; }
.form-group textarea { resize: vertical; min-height: 70px; }

/* 自动完成 */
.autocomplete-container { position: relative; display: inline-block; width: 100%; }
.autocomplete-input { width: 100%; }
.autocomplete-dropdown-global { font-family: inherit; }
.autocomplete-dropdown {
    position: absolute; bottom: 100%; left: 0; right: 0; max-height: 200px;
    overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-bottom: none;
    border-radius: 6px 6px 0 0; box-shadow: 0 -4px 12px rgba(0,0,0,0.15); z-index: 99999; display: none;
}
.autocomplete-dropdown.dropdown-above {
    bottom: 100%; top: auto; border-radius: 6px 6px 0 0; border-bottom: none; border-top: 1px solid #e5e7eb;
}
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 14px; transition: background 0.15s; }
.autocomplete-item:hover, .autocomplete-item.selected { background: #eff6ff; color: #1e40af; }
.autocomplete-no-results { padding: 12px; color: #9ca3af; text-align: center; font-size: 13px; }
.autocomplete-input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* ===== 响应式：四断点 ===== */
@media (max-width: 1024px) {
    .data-table { font-size: 12.5px; }
    .data-table thead th { padding: 8px 6px; font-size: 12px; }
    .data-table tbody td { padding: 7px 6px; font-size: 12.5px; }
    .col-notes { display: none; }
    .col-batch { font-size: 11px; word-break: break-all; white-space: normal; }
}
@media (max-width: 768px) {
    .page-title-section h1 { font-size: 17px; }
    .page-title-section .subtitle { display: none; }
    .form-row { flex-direction: column; gap: 10px; align-items: stretch; }
    .form-field { width: 100%; min-width: 0; }
    .card-body { padding: 12px; }
    .card-header, .modal-header { padding: 8px 12px; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .pagination-container { flex-direction: column; text-align: center; }
    .data-table { font-size: 12px; }
    .data-table thead th { padding: 8px 5px; font-size: 11.5px; }
    .data-table tbody td { padding: 8px 5px; font-size: 12px; }
    .col-check, .col-notes, .col-remain, .col-date, .col-action { display: none; }
    .col-batch { width: 26%; font-size: 10.5px; word-break: break-all; white-space: normal; }
    .col-supplier { width: 24%; }
    .col-material { width: 22%; }
    .col-qty { width: 14%; }
    .col-status { width: 14%; }
}
@media (max-width: 480px) {
    .page-title-section h1 { font-size: 16px; }
    .data-table { font-size: 11.5px; }
    .data-table thead th { padding: 7px 4px; font-size: 11px; }
    .data-table tbody td { padding: 7px 4px; font-size: 11.5px; }
    .col-supplier { display: none; }
    .col-batch { width: 34%; font-size: 10px; word-break: break-all; white-space: normal; }
    .col-material { width: 28%; }
    .col-qty { width: 18%; }
    .col-status { width: 20%; }
}
