/* ===== 全局样式 ===== */
:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --accent: #d4a373;
    --accent-light: #e9c46a;
    --bg: #f5f5f0;
    --bg-card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #dfe6e9;
    --danger: #d63031;
    --danger-light: #ff7675;
    --success: #00b894;
    --warning: #fdcb6e;
    --info: #74b9ff;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ===== 布局 ===== */
#app { display: flex; height: 100vh; }

/* ===== 侧边栏 ===== */
#sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar-header i { font-size: 28px; color: var(--accent); }
.sidebar-header h2 { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.sidebar-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }

/* ===== 客户管理模块 ===== */
.phone-tag { display: inline-block; padding: 2px 8px; margin: 2px; background: rgba(116,185,255,0.1); color: #0984e3; border-radius: 12px; font-size: 12px; }
.dynamic-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.dynamic-row .form-control { flex: 1; }
.btn-delete-sm { width: 28px; height: 28px; padding: 0; border: none; background: rgba(214,48,49,0.1); color: var(--danger); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: var(--transition); }
.btn-delete-sm:hover { background: var(--danger); color: white; }
.required { color: var(--danger); margin-left: 2px; }
.customer-detail { }
.detail-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.detail-section:last-child { border-bottom: none; }
.detail-section h4 { font-size: 15px; color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.detail-section h4 i { font-size: 14px; }
.detail-row { display: flex; padding: 6px 0; font-size: 14px; }
.detail-label { width: 80px; color: var(--text-light); flex-shrink: 0; }
.detail-value { color: var(--text); flex: 1; }

/* ===== 权限树 ===== */
.perm-tree-container { background: var(--bg); padding: 16px; border-radius: 8px; max-height: 400px; overflow-y: auto; }
.perm-group { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.perm-group-header { background: rgba(45,106,79,0.06); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.perm-menu-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary); }
.perm-menu-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.perm-group-body { padding: 8px 14px 8px 40px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.perm-action-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text); padding: 4px 0; }
.perm-action-label input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); }

/* ===== SKU编码 & 条码 ===== */
.sku-code { font-family: 'Courier New', monospace; font-size: 12px; background: rgba(45,106,79,0.08); padding: 2px 8px; border-radius: 4px; color: var(--primary); letter-spacing: 0.5px; }
.barcode-modal { }
.barcode-tabs { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.barcode-tab { flex: 1; padding: 10px; border: none; background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 600; transition: var(--transition); }
.barcode-tab.active { background: var(--primary); color: white; }
.barcode-label-preview { display: flex; justify-content: center; margin-bottom: 16px; }
.label-card { width: 220px; padding: 12px; text-align: center; border: 2px solid var(--border); border-radius: 8px; background: white; }
.label-product-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.label-spec { font-size: 11px; color: var(--text-light); }
.label-price { font-size: 16px; font-weight: 700; color: var(--danger); margin: 4px 0; }
.label-barcode-wrap { overflow: hidden; }
.label-barcode-wrap svg, .label-qrcode-wrap img { display: block; margin: 4px auto; max-width: 100%; height: auto; }
.label-qrcode-wrap canvas { display: none !important; }
.label-sku-code { font-size: 10px; color: var(--text-muted); margin-top: 4px; font-family: monospace; }
.barcode-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; color: rgba(255,255,255,0.75);
    text-decoration: none; border-radius: var(--radius-sm);
    transition: var(--transition); font-size: 15px; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-item.active { background: rgba(255,255,255,0.2); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.nav-item i { width: 22px; text-align: center; font-size: 17px; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 12px; color: rgba(255,255,255,0.5); text-align: center; }

/* ===== 用户信息区域 ===== */
.user-info {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    gap: 10px;
    position: relative;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}
.user-detail {
    flex: 1;
    min-width: 0;
}
.user-name {
    font-size: 13px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}
.user-detail-clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: var(--transition);
}
.user-detail-clickable:hover {
    background: rgba(255,255,255,0.1);
}
.user-menu-arrow {
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    transition: transform 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}
.user-menu-arrow.show {
    transform: rotate(180deg);
}
.user-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 8px;
    right: 8px;
    background: #ffffff !important;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 4px 0;
    margin-bottom: 4px;
    z-index: 9999;
    color: #2d3436 !important;
}
.user-dropdown.show {
    display: block;
}
.user-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #2d3436 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}
.user-dropdown-item:hover {
    background: #f5f5f0;
}
.user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: #636e72 !important;
    font-size: 13px;
}
.user-dropdown-danger {
    color: #e74c3c !important;
}
.user-dropdown-danger i {
    color: #e74c3c !important;
}
.user-dropdown-danger:hover {
    background: rgba(231,76,60,0.08);
}
.user-dropdown-divider {
    height: 1px;
    background: #dfe6e9;
    margin: 4px 0;
}
.btn-logout {
    display: none;
}

/* ===== 主内容区 ===== */
#main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

#top-bar {
    background: var(--bg-card); padding: 16px 32px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative; z-index: 100; overflow: visible;
}
#page-title { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.user-info { display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 14px; }
.user-info i { font-size: 24px; color: var(--primary); }

/* ===== 顶部栏用户下拉菜单 ===== */
.user-info-dropdown {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.user-info-dropdown:hover {
    background: rgba(0,0,0,0.04);
}
.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}
.user-name-top {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.user-info-dropdown .user-menu-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: 4px;
}
.user-info-dropdown .user-menu-arrow.show {
    transform: rotate(180deg);
}
.user-info-dropdown .user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    bottom: auto;
    left: auto;
    right: 0;
    min-width: 180px;
    background: #ffffff !important;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    padding: 4px 0;
    margin-top: 8px;
    margin-bottom: 0;
    z-index: 9999;
    color: #2d3436 !important;
}
.user-info-dropdown .user-dropdown.show {
    display: block;
}
.user-info-dropdown .user-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #2d3436 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}
.user-info-dropdown .user-dropdown-item:hover {
    background: #f5f5f0;
}
.user-info-dropdown .user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: #636e72 !important;
    font-size: 13px;
}
.user-info-dropdown .user-dropdown-danger {
    color: #e74c3c !important;
}
.user-info-dropdown .user-dropdown-danger i {
    color: #e74c3c !important;
}
.user-info-dropdown .user-dropdown-danger:hover {
    background: rgba(231,76,60,0.08);
}
.user-info-dropdown .user-dropdown-divider {
    height: 1px;
    background: #dfe6e9;
    margin: 4px 0;
}

#module-container { flex: 1; overflow-y: auto; padding: 24px 32px; }

/* ===== 加载状态 ===== */
.loading-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 80px 20px; color: var(--text-muted);
}
.loading-state i { font-size: 40px; margin-bottom: 12px; color: var(--primary); }
.loading-state p { font-size: 14px; }

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 17px; font-weight: 600; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 24px; }

.stat-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px;
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.stat-card.green::before { background: var(--success); }
.stat-card.blue::before { background: var(--info); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.red::before { background: var(--danger); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.green { background: rgba(0,184,148,0.12); color: var(--success); }
.stat-icon.blue { background: rgba(116,185,255,0.12); color: var(--info); }
.stat-icon.orange { background: rgba(212,163,115,0.15); color: var(--accent); }
.stat-icon.red { background: rgba(214,48,49,0.12); color: var(--danger); }

.stat-info h3 { font-size: 13px; color: var(--text-light); font-weight: 500; margin-bottom: 4px; }
.stat-info .value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-info .trend { font-size: 12px; margin-top: 4px; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: var(--transition); display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.3px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ===== 表格 ===== */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg); padding: 14px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
tbody tr:hover { background: rgba(45,106,79,0.04); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.selected-row { background: rgba(45,106,79,0.06); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.form-control {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition);
    background: var(--bg-card); color: var(--text); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,0.1); }
select.form-control {
    appearance: none;
    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='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
    z-index: 1000; backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal-content {
    background: var(--bg-card); border-radius: var(--radius); width: 90%; max-width: 600px;
    max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; color: var(--primary-dark); }
.modal-close { width: 36px; height: 36px; border: none; background: none; font-size: 22px; color: var(--text-light); cursor: pointer; border-radius: 8px; transition: var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* ===== Toast通知 ===== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 14px 24px; border-radius: var(--radius-sm); color: white; font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    display: flex; align-items: center; gap: 10px; min-width: 280px;
}
.toast.toast-success { background: #00a884; }
.toast.toast-error { background: #d63031; }
.toast.toast-warning { background: #d35400; }
.toast.toast-info { background: #2d6a9f; }

/* ===== 搜索和过滤 ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; transition: var(--transition); flex: 1; max-width: 400px; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,106,79,0.1); }
.search-box i { color: var(--text-muted); font-size: 14px; }
.search-box input { border: none; background: none; padding: 10px; font-size: 14px; width: 100%; outline: none; color: var(--text); }
.filter-group { display: flex; gap: 10px; align-items: center; }
.filter-group select {
    padding: 8px 32px 8px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; background: var(--bg-card); appearance: none; cursor: pointer; color: var(--text);
    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='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.toolbar-actions { display: flex; gap: 10px; align-items: center; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag-tea { background: rgba(0,184,148,0.12); color: #00b894; }
.tag-utensil { background: rgba(212,163,115,0.15); color: #b07d4b; }
.tag-green { background: rgba(0,184,148,0.12); color: var(--success); }
.tag-red { background: rgba(214,48,49,0.12); color: var(--danger); }
.tag-gray { background: rgba(127,140,141,0.12); color: #636e72; }
.tag-yellow { background: rgba(253,203,110,0.2); color: #e17055; }
.tag-blue { background: rgba(116,185,255,0.12); color: #0984e3; }
.tag-orange { background: rgba(212,163,115,0.15); color: #b07d4b; }
.tag-purple { background: rgba(162,155,254,0.12); color: #6c5ce7; }
.tag-gray { background: rgba(178,190,195,0.2); color: #636e72; }

/* ===== 订单状态标签 ===== */
.status-pending { background: rgba(253,203,110,0.2); color: #e17055; }
.status-paid { background: rgba(116,185,255,0.12); color: #0984e3; }
.status-processing { background: rgba(162,155,254,0.12); color: #6c5ce7; }
.status-shipped { background: rgba(0,184,148,0.12); color: var(--success); }
.status-completed { background: rgba(0,184,148,0.2); color: #00b894; }
.status-cancelled { background: rgba(178,190,195,0.2); color: #636e72; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 56px; margin-bottom: 16px; color: var(--border); }
.empty-state h3 { font-size: 18px; color: var(--text-light); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== 动画 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== 仪表盘 ===== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-placeholder { height: 300px; background: linear-gradient(135deg, rgba(45,106,79,0.03), rgba(45,106,79,0.08)); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; }

/* ===== 快捷操作 ===== */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.quick-action-btn {
    padding: 16px; background: var(--bg); border: 2px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); text-align: center; color: var(--text);
}
.quick-action-btn:hover { border-color: var(--primary); background: rgba(45,106,79,0.05); transform: translateY(-2px); }
.quick-action-btn i { font-size: 24px; color: var(--primary); margin-bottom: 8px; display: block; }
.quick-action-btn span { font-size: 13px; font-weight: 600; }

/* ===== 最近记录 ===== */
.recent-list { list-style: none; }
.recent-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-item-info { display: flex; align-items: center; gap: 12px; }
.recent-item-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.recent-item-icon.purchase { background: rgba(116,185,255,0.12); color: var(--info); }
.recent-item-icon.sale { background: rgba(0,184,148,0.12); color: var(--success); }
.recent-item-details h4 { font-size: 14px; font-weight: 600; }
.recent-item-details p { font-size: 12px; color: var(--text-light); }
.recent-item-amount { font-size: 15px; font-weight: 700; }
.recent-item-amount.income { color: var(--success); }
.recent-item-amount.expense { color: var(--danger); }

/* ===== 库存预警 ===== */
.alert-list { list-style: none; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(214,48,49,0.05); border-radius: var(--radius-sm); margin-bottom: 8px; border-left: 3px solid var(--danger); }
.alert-item i { color: var(--danger); font-size: 18px; }
.alert-item-info { flex: 1; }
.alert-item-info h4 { font-size: 14px; font-weight: 600; }
.alert-item-info p { font-size: 12px; color: var(--text-light); }

/* ===== 操作按钮组 ===== */
.action-btns { display: flex; gap: 6px; }
.action-btns .btn-icon { width: 32px; height: 32px; font-size: 13px; }
.btn-edit { background: rgba(116,185,255,0.15); color: var(--info); border: none; }
.btn-edit:hover { background: var(--info); color: white; }
.btn-delete { background: rgba(214,48,49,0.1); color: var(--danger); border: none; }
.btn-delete:hover { background: var(--danger); color: white; }
.btn-view { background: rgba(45,106,79,0.1); color: var(--primary); border: none; }
.btn-view:hover { background: var(--primary); color: white; }

/* ===== 分页 ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; }
.pagination button { width: 36px; height: 36px; border: 2px solid var(--border); background: var(--bg-card); border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); transition: var(--transition); }
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.page-numbers { display: flex; gap: 4px; align-items: center; }

/* ===== 简易柱状图 ===== */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 20px 0; border-bottom: 2px solid var(--border); }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; max-width: 48px; border-radius: 6px 6px 0 0; transition: height 0.6s ease; min-height: 4px; }
.bar.purchase-bar { background: linear-gradient(180deg, var(--info), #5fa8f5); }
.bar.sale-bar { background: linear-gradient(180deg, var(--success), #55efc4); }
.bar-label { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.bar-value { font-size: 11px; font-weight: 600; color: var(--text); }

/* ===== 进度条 ===== */
.stock-bar-container { display: flex; align-items: center; gap: 10px; }
.stock-bar { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.stock-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.stock-bar-fill.high { background: var(--success); }
.stock-bar-fill.medium { background: var(--warning); }
.stock-bar-fill.low { background: var(--danger); }
.stock-bar-text { font-size: 13px; font-weight: 600; min-width: 40px; text-align: right; }

/* ===== 订单详情 ===== */
.order-detail {}
.order-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.order-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { }
.info-item label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 2px; }
.info-item span { font-size: 14px; font-weight: 500; }
.order-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; margin-top: 12px; border-top: 2px solid var(--border); font-size: 16px; }
.order-total strong { color: var(--primary); font-size: 20px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    #sidebar { width: 70px; }
    #sidebar .nav-item span, #sidebar h2, #sidebar .sidebar-footer p { display: none; }
    #sidebar .sidebar-header { justify-content: center; }
    #sidebar .nav-item { justify-content: center; padding: 14px; }
    #main-content { margin-left: 70px; }
    #module-container { padding: 16px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .order-info-grid { grid-template-columns: 1fr; }
}

/* ===== 系统管理模块 ===== */
.system-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg);
    border-radius: 12px;
}
.tab-btn {
    flex: 1;
    padding: 14px 28px;
    border: 2px solid transparent;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.04);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
}
.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), #6c5ce7);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}
.tab-btn i {
    font-size: 16px;
}
.dict-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
    background: var(--bg);
    border-radius: 10px;
    flex-wrap: wrap;
}
.dict-tab {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dict-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(67, 97, 238, 0.04);
}
.dict-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(67, 97, 238, 0.2);
}

/* ===== 商品导入 ===== */
.import-steps { display: flex; flex-direction: column; gap: 20px; }
.import-step { display: flex; gap: 16px; align-items: flex-start; }
.import-step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.import-step-content { flex: 1; }
.import-step-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.import-step-content p { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.import-upload-area { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 24px; text-align: center; cursor: pointer; transition: var(--transition); }
.import-upload-area:hover { border-color: var(--primary); background: rgba(45,106,79,0.04); }
.import-upload-area i { font-size: 28px; color: var(--primary); display: block; margin-bottom: 8px; }
.import-upload-area span { font-size: 13px; color: var(--text-light); }
.import-tips { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--text-light); }
.import-tips li { padding: 3px 0; padding-left: 16px; position: relative; }
.import-tips li::before { content: '•'; position: absolute; left: 0; color: var(--primary); }
.import-tips code { background: rgba(45,106,79,0.08); padding: 1px 6px; border-radius: 4px; font-size: 12px; color: var(--primary); }
.import-result-card { padding: 16px; border-radius: var(--radius-sm); margin-top: 8px; }
.import-result-card.all-success { background: rgba(0,184,148,0.08); border: 1px solid rgba(0,184,148,0.2); }
.import-result-card.has-errors { background: rgba(253,203,110,0.1); border: 1px solid rgba(253,203,110,0.3); }
.import-result-summary { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.import-result-summary i { font-size: 20px; }
.import-result-card.all-success .import-result-summary i { color: var(--success); }
.import-result-card.has-errors .import-result-summary i { color: var(--warning); }
.import-result-errors { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.08); }
.import-result-errors p { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.import-result-errors ul { list-style: none; padding: 0; margin: 0; max-height: 150px; overflow-y: auto; }
.import-result-errors li { font-size: 12px; color: var(--danger); padding: 2px 0; padding-left: 14px; position: relative; }
.import-result-errors li::before { content: '×'; position: absolute; left: 0; font-weight: 700; }