/* 鲜品集配管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f5f7fa; color: #333; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 28px; color: #667eea; margin-bottom: 8px; }
.login-header p { color: #999; font-size: 14px; }
.form-group { margin-bottom: 20px; }
.form-group input { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.3s; }
.form-group input:focus { outline: none; border-color: #667eea; }
.form-group select { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; }
.btn-login { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; transition: background 0.3s; }
.btn-login:hover { background: #5568d3; }
.login-footer { text-align: center; margin-top: 20px; color: #999; font-size: 12px; }

/* 后台布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #2c3e50; color: #fff; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid #34495e; }
.sidebar-header h2 { font-size: 18px; }
.sidebar-menu { padding: 10px 0; }
.menu-item { display: block; padding: 12px 20px; color: #bdc3c7; text-decoration: none; transition: all 0.3s; cursor: pointer; }
.menu-item:hover, .menu-item.active { background: #34495e; color: #fff; }
.menu-item i { margin-right: 10px; }
.menu-item .badge { float: right; background: #e74c3c; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 12px; }

.main-content { margin-left: 220px; flex: 1; }
.header { background: #fff; padding: 15px 30px; border-bottom: 1px solid #e8e8e8; display: flex; justify-content: space-between; align-items: center; }
.header-title { font-size: 18px; font-weight: 600; }
.header-user { display: flex; align-items: center; gap: 15px; }
.header-user a { color: #666; text-decoration: none; }
.header-user a:hover { color: #667eea; }

.content { padding: 20px 30px; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.card-title { font-size: 16px; font-weight: 600; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.stat-card .label { color: #999; font-size: 14px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: #333; }
.stat-card .value.green { color: #27ae60; }
.stat-card .value.blue { color: #3498db; }
.stat-card .value.orange { color: #e67e22; }
.stat-card .value.red { color: #e74c3c; }

/* 表格 */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #f8f9fa; font-weight: 600; color: #555; font-size: 14px; }
tr:hover { background: #f8f9fa; }
.table-img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; transition: all 0.3s; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5568d3; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #e67e22; color: #fff; }
.btn-warning:hover { background: #d35400; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 5px; }

/* 表单 */
.toolbar { margin-bottom: 20px; }
.toolbar .btn { margin-right: 10px; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; margin-right: 10px; }
.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.form-group-full { flex: 1; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; color: #555; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-control:focus { outline: none; border-color: #667eea; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23999" d="M6 8L1 3h10z"/></svg>') no-repeat right 10px center; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 分页 */
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; color: #666; text-decoration: none; font-size: 14px; }
.pagination .active { background: #667eea; color: #fff; border-color: #667eea; }

/* 状态标签 */
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; }
.status-pending { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }
.status-rejected { background: #f8d7da; color: #721c24; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }
.status-unpaid { background: #fff3cd; color: #856404; }
.status-paid { background: #d4edda; color: #155724; }
.status-used { background: #cce5ff; color: #004085; }
.status-unused { background: #d4edda; color: #155724; }
.status-expired { background: #e2e3e5; color: #383d41; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar .form-group { margin-bottom: 0; }
.search-bar input, .search-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.search-bar button { white-space: nowrap; }

/* 模态框 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; }
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 8px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 15px 20px; border-bottom: 1px solid #e8e8e8; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px; border-top: 1px solid #e8e8e8; display: flex; justify-content: flex-end; gap: 10px; }

/* 图表容器 */
.chart-container { height: 300px; margin-top: 20px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 15px; }
.empty-state p { font-size: 14px; }

/* 响应式 */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { width: 60px; }
    .sidebar-header h2, .menu-item span { display: none; }
    .main-content { margin-left: 60px; }
    .form-row { flex-direction: column; }
}

/* 图片上传 */
.upload-box {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}
.upload-box:hover {
    border-color: #667eea;
}
.upload-box input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
}
.upload-icon {
    font-size: 32px;
    line-height: 1;
}
.upload-placeholder span:last-child {
    font-size: 12px;
    margin-top: 5px;
}
.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-tip {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 表单行内 */
.form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.form-inline .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}
.form-inline label {
    margin-bottom: 0;
    margin-right: 10px;
    white-space: nowrap;
}
.form-inline .form-control {
    width: auto;
    margin-right: 5px;
}
