/* ============================================================
 * 肥料溯源码管理系统 - 公共样式表
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif; background: #f5f6fa; display: flex; min-height: 100vh; }

/* 左侧导航 */
.sidebar { width: 220px; background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%); color: #fff; flex-shrink: 0; padding-top: 16px; }
.sidebar .logo { text-align: center; padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px; }
.sidebar .logo h2 { font-size: 16px; margin-bottom: 4px; }
.sidebar .logo p { font-size: 11px; opacity: 0.6; }
.sidebar .nav-item { display: flex; align-items: center; padding: 12px 24px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar .nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar .nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #66bb6a; }
.sidebar .nav-icon { margin-right: 10px; font-size: 16px; width: 20px; text-align: center; }

/* 主内容 */
.main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.header { background: #fff; padding: 16px 30px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; }
.header h3 { color: #2e7d32; font-size: 18px; }
.header .user-info { color: #666; font-size: 13px; }
.content { padding: 24px 30px; flex: 1; }

/* 统计卡片 */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; align-items: center; }
.stat-card .icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-right: 14px; flex-shrink: 0; }
.stat-card .info h4 { font-size: 22px; font-weight: 700; color: #2e7d32; }
.stat-card .info p { font-size: 12px; color: #999; margin-top: 2px; }
.bg-blue { background: #e3f2fd; }
.bg-green { background: #e8f5e9; }
.bg-orange { background: #fff3e0; }
.bg-purple { background: #f3e5f5; }
.bg-cyan { background: #e0f7fa; }
.bg-pink { background: #fce4ec; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-header h4 { font-size: 15px; color: #333; }
.card-body { padding: 20px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #f8f9fb; color: #666; padding: 12px 14px; text-align: left; font-weight: 600; border-bottom: 1px solid #e8e8e8; white-space: nowrap; }
tbody td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; color: #333; }
tbody tr:hover { background: #f8f9fb; }

/* 按钮 */
.btn { padding: 8px 18px; border: none; border-radius: 5px; font-size: 13px; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: #2e7d32; color: #fff; }
.btn-primary:hover { background: #1b5e20; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #666; }
.btn-outline:hover { border-color: #2e7d32; color: #2e7d32; }

/* 标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.tag-success { background: #e8f5e9; color: #27ae60; }
.tag-warning { background: #fff3e0; color: #f39c12; }
.tag-info { background: #e3f2fd; color: #1976d2; }
.tag-default { background: #f5f5f5; color: #999; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 13px; color: #555; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; font-family: inherit; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2e7d32; box-shadow: 0 0 0 2px rgba(46,125,50,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 10px; padding: 28px; width: 520px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal h3 { margin-bottom: 20px; color: #2e7d32; font-size: 17px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input, .search-bar select { padding: 7px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.search-bar input { width: 200px; }

/* 分页 */
.pagination { display: flex; gap: 6px; margin-top: 16px; justify-content: flex-end; align-items: center; }
.pagination button { padding: 6px 12px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pagination button:hover { border-color: #2e7d32; color: #2e7d32; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination span { font-size: 12px; color: #666; }

/* 消息 */
.msg { padding: 10px 16px; border-radius: 5px; margin-bottom: 12px; font-size: 13px; display: none; }
.msg-success { background: #e8f5e9; color: #27ae60; border: 1px solid #c8e6c9; }
.msg-error { background: #ffebee; color: #c0392b; border: 1px solid #ffcdd2; }
.msg-info { background: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: #999; font-size: 14px; }
