/* ============================================================
   平山合信竹编工艺加工厂 ERP系统 - 公共样式
   商务深蓝色企业风格
   ============================================================ */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 主色调 */
    --primary: #1a3c6e;
    --primary-light: #2c5f9e;
    --primary-dark: #0d2b4e;
    
    /* 强调色 */
    --accent: #e8763a;
    --accent-hover: #d66a30;
    
    /* 背景色 */
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #0d2b4e 0%, #1a3c6e 100%);
    
    /* 文字色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;
    
    /* 边框色 */
    --border-color: #e4e7eb;
    --border-light: #f0f2f5;
    
    /* 状态色 */
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --info: #1890ff;
    
    /* 表格 */
    --table-stripe: #f8fafc;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    /* 侧边栏 */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;
    
    /* 顶栏 */
    --topbar-height: 60px;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* 过渡 */
    --transition: all 0.3s ease;
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-main);
    height: 100%;
    line-height: 1.5;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* ==================== 登录页样式 ==================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d2b4e 0%, #1a3c6e 50%, #2c5f9e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--bg-sidebar);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.login-logo i {
    font-size: 36px;
    color: var(--text-white);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 15px 10px 42px;
    font-size: 14px;
    transition: var(--transition);
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.1);
}

.login-form .input-icon {
    position: relative;
}

.login-form .input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
}

.login-form .btn-login {
    width: 100%;
    height: 46px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.login-form .btn-login:hover {
    background: var(--accent-hover);
}

.login-form .remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.login-form .remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.login-form .remember-me input {
    margin-right: 6px;
    cursor: pointer;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 12px;
}

/* ==================== 主布局 ==================== */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    color: var(--text-white);
}

.sidebar-logo i {
    font-size: 28px;
    margin-right: 10px;
}

.sidebar-logo span {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-menu {
    padding: 10px 0;
}

.menu-section {
    margin-bottom: 5px;
}

.menu-title {
    padding: 8px 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item {
    position: relative;
}

.menu-item > a,
.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item > a:hover,
.menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-white);
}

.menu-item.active > a,
.menu-link.active {
    background: rgba(255,255,255,0.15);
    color: var(--text-white);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.menu-item > a i,
.menu-link i {
    font-size: 18px;
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

.menu-item > a .menu-arrow,
.menu-link .menu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.menu-item.open > a .menu-arrow,
.menu-link.open .menu-arrow {
    transform: rotate(90deg);
}

/* 子菜单 */
.submenu {
    display: none;
    background: rgba(0,0,0,0.15);
}

.menu-item.open > .submenu,
.submenu.show {
    display: block;
}

.submenu-item a {
    display: block;
    padding: 10px 20px 10px 56px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
}

.submenu-item a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-white);
}

.submenu-item.active a {
    color: var(--text-white);
    background: rgba(255,255,255,0.1);
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航 ==================== */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.topbar-toggle {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-right: 15px;
    display: none;
}

.topbar-toggle i {
    font-size: 20px;
    color: var(--text-secondary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding: 0 8px;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--text-secondary);
}

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

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-light);
}

.notification-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn i {
    font-size: 20px;
    color: var(--text-secondary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-topbar {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-topbar i {
    font-size: 18px;
    color: var(--text-secondary);
}

.btn-topbar:hover {
    background: var(--bg-main);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.user-dropdown-item:hover {
    background: var(--bg-main);
}

.user-dropdown-item i {
    font-size: 16px;
    color: var(--text-secondary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

/* ==================== 页面内容区 ==================== */
.page-content {
    flex: 1;
    padding: 20px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== 统计卡片 ==================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.stat-icon i {
    font-size: 26px;
    color: var(--text-white);
}

.stat-icon.blue {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, var(--accent) 0%, #f5a623 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

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

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

.card-header .card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--table-stripe);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

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

.data-table thead {
    background: var(--bg-main);
}

.data-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background: var(--table-stripe);
}

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

.data-table tbody td {
    padding: 12px 15px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table .sortable {
    cursor: pointer;
    user-select: none;
}

.data-table .sortable:hover {
    color: var(--primary);
}

.data-table .sort-icon {
    margin-left: 5px;
    font-size: 11px;
    color: var(--text-light);
}

.data-table .sort-asc .sort-icon,
.data-table .sort-desc .sort-icon {
    color: var(--primary);
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

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

.form-control {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.1);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-main);
    cursor: not-allowed;
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row > div {
    padding: 0 10px;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 30px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-check input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

/* 输入组 */
.input-group {
    display: flex;
    position: relative;
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .input-group-append {
    display: flex;
}

.input-group .input-group-text {
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    gap: 6px;
}

.btn i {
    font-size: 14px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--text-white);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-white);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: var(--text-white);
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-success {
    background: var(--success);
    color: var(--text-white);
}

.btn-success:hover {
    background: #3db811;
    color: var(--text-white);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #e63c3e;
    color: var(--text-white);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-primary);
}

.btn-warning:hover {
    background: #e69a10;
}

.btn-secondary {
    background: var(--text-light);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: #888;
    color: var(--text-white);
}

.btn-white {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-white:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.btn-link {
    background: transparent;
    color: var(--primary-light);
    padding: 4px 8px;
}

.btn-link:hover {
    color: var(--primary);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon i {
    font-size: 14px;
}

/* ==================== 状态标签 ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.status-badge.pending,
.status-badge.draft {
    background: #fff7e6;
    color: #fa8c16;
}

.status-badge.success,
.status-badge.approved,
.status-badge.active {
    background: #f6ffed;
    color: #52c41a;
}

.status-badge.danger,
.status-badge.rejected,
.status-badge.cancelled {
    background: #fff2f0;
    color: #ff4d4f;
}

.status-badge.info,
.status-badge.processing {
    background: #e6f7ff;
    color: #1890ff;
}

.status-badge.default,
.status-badge.disabled {
    background: #f5f5f5;
    color: #8c8c8c;
}

/* 订单状态 */
.order-status-0 { background: #fff7e6; color: #fa8c16; }
.order-status-1 { background: #e6f7ff; color: #1890ff; }
.order-status-2 { background: #fff1f0; color: #fa541c; }
.order-status-3 { background: #f9f0ff; color: #722ed1; }
.order-status-4 { background: #f6ffed; color: #52c41a; }
.order-status-5 { background: #f5f5f5; color: #8c8c8c; }

/* 报价单状态 */
.quote-status-0 { background: #fff7e6; color: #fa8c16; }
.quote-status-1 { background: #f6ffed; color: #52c41a; }
.quote-status-2 { background: #f5f5f5; color: #8c8c8c; }
.quote-status-3 { background: #e6f7ff; color: #1890ff; }

/* ==================== 搜索栏 ==================== */
.search-bar {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.search-bar .form-row {
    align-items: flex-end;
}

.search-bar .form-group {
    margin-bottom: 0;
}

.search-actions {
    display: flex;
    gap: 10px;
}

/* Tabs */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-tabs .nav-link .badge {
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    background: var(--text-light);
    color: var(--text-white);
}

.nav-tabs .nav-link.active .badge {
    background: var(--primary);
}

/* ==================== 分页 ==================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination .page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Modal ==================== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 弹窗内的表格 */
.modal-table {
    font-size: 13px;
}

.modal-table th {
    background: var(--bg-main);
    font-weight: 500;
}

.modal-table td {
    vertical-align: middle;
}

/* ==================== 警告/提示框 ==================== */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 15px;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

.alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #fa8c16;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-danger {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* Toast 提示 */
.toast-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    max-width: 420px !important;
}

.erp-toast {
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important;
    padding: 16px 20px 14px !important;
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 300px !important;
    max-width: 420px !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: toastSlideIn 0.35s ease !important;
    position: relative !important;
    overflow: hidden !important;
    border-left: 4px solid #ccc !important;
}

.erp-toast.success { border-left-color: #28a745; }
.erp-toast.error { border-left-color: #dc3545; }
.erp-toast.warning { border-left-color: #ffc107; }
.erp-toast.info { border-left-color: #17a2b8; }

.erp-toast.paused .toast-progress-bar {
    animation-play-state: paused !important;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-break: break-word;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover { color: #333; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.06);
}

.toast-progress-bar {
    height: 100%;
    animation: toastShrink linear forwards;
}

.erp-toast.success .toast-progress-bar { background: rgba(40,167,69,0.4); }
.erp-toast.error .toast-progress-bar { background: rgba(220,53,69,0.4); }
.erp-toast.warning .toast-progress-bar { background: rgba(255,193,7,0.5); }
.erp-toast.info .toast-progress-bar { background: rgba(23,162,184,0.4); }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastShrink {
    from { width: 100%; }
    to { width: 0%; }
}

.erp-toast i {
    font-size: 22px;
    flex-shrink: 0;
}

.erp-toast.success i { color: #28a745; }
.erp-toast.error i { color: #dc3545; }
.erp-toast.warning i { color: #ffc107; }
.erp-toast.info i { color: #17a2b8; }

/* ==================== 加载状态 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading-inline .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ==================== 图表容器 ==================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 15px;
    color: var(--border-color);
}

.empty-state h4 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==================== 图片上传 ==================== */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: rgba(26,60,110,0.02);
}

.image-upload-area i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.image-upload-area p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.image-upload-area .upload-hint {
    font-size: 12px;
    color: var(--text-light);
}

.uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.uploaded-image-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.uploaded-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-image-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uploaded-image-item .cover-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    border-radius: 3px;
}

/* ==================== 库存预警 ==================== */
.stock-warning {
    color: var(--danger);
    font-weight: 500;
}

.stock-low {
    background: #fff2f0;
    color: #ff4d4f;
}

/* ==================== 操作按钮组 ==================== */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* ==================== 步骤条 ==================== */
.step-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.step-item {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.step-item::after {
    content: '';
    position: absolute;
    left: 24px;
    right: 0;
    top: 50%;
    height: 2px;
    background: var(--border-color);
}

.step-item:last-child::after {
    display: none;
}

.step-item.completed::after {
    background: var(--success);
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 1;
}

.step-item.completed .step-icon {
    background: var(--success);
    color: white;
}

.step-item.active .step-icon {
    background: var(--primary);
    color: white;
}

.step-label {
    margin-left: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.step-item.active .step-label {
    color: var(--primary);
    font-weight: 500;
}

/* ==================== 明细表格 ==================== */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.detail-table th,
.detail-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 13px;
}

.detail-table th {
    background: var(--bg-main);
    font-weight: 500;
    color: var(--text-primary);
}

.detail-table tfoot td {
    font-weight: 600;
    background: var(--table-stripe);
}

/* ==================== 树形结构 ==================== */
.tree-view {
    padding-left: 0;
    list-style: none;
}

.tree-node {
    margin: 2px 0;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.tree-node-content:hover {
    background: var(--bg-main);
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: var(--text-light);
    font-size: 12px;
}

.tree-toggle.has-children {
    cursor: pointer;
}

.tree-icon {
    margin-right: 8px;
    color: var(--accent);
}

.tree-label {
    flex: 1;
}

.tree-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: var(--transition);
}

.tree-node-content:hover .tree-actions {
    opacity: 1;
}

.tree-children {
    padding-left: 30px;
    list-style: none;
    margin-top: 5px;
    display: none;
}

.tree-node.open > .tree-children {
    display: block;
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .topbar,
    .page-header,
    .search-bar,
    .card-header .card-actions,
    .action-buttons,
    .pagination-wrapper,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
    }
    
    .card-body {
        padding: 20px 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    /* A4打印优化 */
    @page {
        size: A4;
        margin: 15mm;
    }
}

.print-only {
    display: none;
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-bar .form-row > div {
        margin-bottom: 10px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table thead th,
    .data-table tbody td {
        padding: 8px 10px;
    }
}

/* ==================== 辅助类 ==================== */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-light) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-accent { background-color: var(--accent) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }

.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }
.font-weight-700 { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }

.ml-1 { margin-left: 5px !important; }
.ml-2 { margin-left: 10px !important; }
.mr-1 { margin-right: 5px !important; }
.mr-2 { margin-right: 10px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 5px !important; }
.p-2 { padding: 10px !important; }
.p-3 { padding: 15px !important; }
.p-4 { padding: 20px !important; }

.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }

.flex-1 { flex: 1; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.w-100 { width: 100% !important; }
.cursor-pointer { cursor: pointer; }

/* 金额显示 */
.amount {
    font-family: 'Menlo', 'Monaco', monospace;
    font-weight: 500;
}

.amount-large {
    font-size: 18px;
    color: var(--accent);
}

/* 文件上传框 */
.file-upload-wrapper {
    position: relative;
}

.file-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 复选框树 */
.checkbox-tree {
    padding-left: 0;
    list-style: none;
}

.checkbox-tree-item {
    margin: 3px 0;
}

.checkbox-tree-item label {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.checkbox-tree-item label:hover {
    background: var(--bg-main);
}

.checkbox-tree-item label input {
    margin-right: 8px;
}

.checkbox-tree-children {
    padding-left: 24px;
    list-style: none;
}

/* 标签页内容切换 */
.tab-content > .tab-pane {
    display: none;
}

.tab-content > .active {
    display: block;
}

/* 金额计算显示 */
.calculation-box {
    background: var(--table-stripe);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.calculation-row:last-child {
    border-bottom: none;
}

.calculation-row.total {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid var(--primary);
    border-bottom: none;
}

/* 详情面板 */
.detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.detail-panel-header {
    padding: 12px 15px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.detail-panel-body {
    padding: 15px;
}

.detail-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
}
