/*
 * Foodmax 风格 UI v2 (2026-08-03)
 * 用户反馈: 亮绿太亮 → Tailwind green 沉稳
 * 参考图: /Users/wufan/.claude/image-cache/.../3,5,6.png
 */

:root {
  /* Tailwind green (沉稳绿) */
  --foodmax-green: #22c55e;
  --foodmax-green-hover: #16a34a;
  --foodmax-green-active: #15803d;      /* 链接文字用深绿 */
  --foodmax-green-light: #f0fdf4;       /* green-50 浅背景 */
  --foodmax-green-border: #bbf7d0;      /* green-200 边框 */
  --foodmax-header-bg: #fafafa;
  --foodmax-border: #e8e8e8;
  --foodmax-text-primary: #262626;
  --foodmax-text-secondary: #595959;
  --foodmax-text-tertiary: #8c8c8c;
}

/* ============================================
 * 侧栏整体宽度收窄 · 08-03 用户: 缩 1/3 (288 → 200px)
 * 注意 Unfold 侧栏双层结构:
 *   外层 wrapper: class="w-[288px]" flex 占位, 撑开 gap
 *   内层 #nav-sidebar: fixed 定位 w-[288px]
 * 必须两层同时改, 否则外层 288 - 内层 200 = 88px 空白 gap
 * ============================================ */
/* 外层 wrapper (flex 占位) */
div[class*="w-[288px]"] {
  width: 200px !important;
}
/* 内层 fixed sidebar */
#nav-sidebar,
aside#nav-sidebar {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
}

/* 侧栏内部搜索框 / 菜单项 padding 微调防挤 */
#nav-sidebar input[type="search"] {
  font-size: 12px !important;
}
h2.select-none,
nav ol a,
nav a[href^="/admin/"] {
  padding-left: 12px !important;
  padding-right: 8px !important;
}
/* 二级项 padding 从 28px 缩到 24px (仍缩进对齐, 但省 4px 空间) */
nav ol a,
nav a[href^="/admin/"] {
  padding-left: 24px !important;
}
nav a.bg-base-100.text-primary-600,
nav a[class*="text-primary-600"][class*="font-semibold"],
nav a.text-primary-600[class*="bg-base-100"] {
  padding-left: 24px !important;  /* 跟未选中一致, 位置不移动 */
}

/* ============================================
 * 侧栏顶部 site logo · Foodmax 风格 (2026-08-03 v3)
 * 顶部 tab 已去 brand, 品牌回到左上角侧栏顶部
 * ============================================ */
#nav-sidebar-inner > div:first-of-type {
  height: 52px !important;
  min-height: 52px !important;
  margin-bottom: 8px !important;
  padding-left: 16px !important;
  padding-right: 12px !important;
  border-bottom-color: var(--foodmax-border) !important;
}
/* 内层 flex 容器高度对齐
 * 08-03 用户反馈: logo 距文字太远 → gap 10 → 6, 强制 justify-start 防 unfold justify-between 撑开
 */
#nav-sidebar-inner > div:first-of-type > div {
  height: 42px !important;
  padding: 0 !important;
  gap: 6px !important;
  justify-content: flex-start !important;
}
/* 图标块: 换成 Foodmax 绿渐变 + 显示"哈"字 */
#nav-sidebar-inner > div:first-of-type a[href="/admin/"].bg-primary-600 {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-radius: 6px !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
/* 08-03 用户反馈: logo 小图标不清晰 → 16 → 20px, 加粗 material weight */
#nav-sidebar-inner > div:first-of-type .material-symbols-outlined {
  font-size: 20px !important;
  color: #fff !important;
  font-variation-settings: 'FILL' 1, 'wght' 500 !important;
}
/* 品牌文字 */
#site-name {
  margin: 0 !important;
}
#site-name a {
  color: var(--foodmax-green) !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  text-decoration: none !important;
}

/* ============================================
 * 全站 UI 颜色规范 v1 (2026-08-04 用户: 统一色规则)
 * 数值本身默认中性色 (深灰), 只有语义"好坏"数据才用绿/红
 * 通用规则:
 *   - 增长/达成/成功  → 绿 #16a34a  (green-600)
 *   - 下降/未达/失败  → 红 #dc2626  (red-600)
 *   - 待处理/进行中   → 蓝 #2563eb  (blue-600)
 *   - 需注意/警告     → 黄 #d97706  (amber-600)
 *   - 中性/正常数值   → 深灰 #262626
 * ============================================ */
:root {
  --color-up:    #16a34a;   /* 绿 · 增长/达成/成功 */
  --color-down:  #dc2626;   /* 红 · 下降/未达/失败 */
  --color-info:  #2563eb;   /* 蓝 · 待处理/进行中 */
  --color-warn:  #d97706;   /* 黄 · 需注意/警告 */
  --color-mute:  #6b7280;   /* 灰 · 中性/未激活 */
  --color-value: #262626;   /* 数值默认色 */
}
/* 值 · 语义 */
.value-up, .text-up   { color: var(--color-up) !important; font-weight: 600; }
.value-down, .text-down { color: var(--color-down) !important; font-weight: 600; }
.value-warn, .text-warn { color: var(--color-warn) !important; font-weight: 600; }
.value-info, .text-info { color: var(--color-info) !important; font-weight: 600; }
.value-mute, .text-mute { color: var(--color-mute) !important; }

/* 徽章 · 通用 */
.badge-success { background: #dcfce7 !important; color: #16a34a !important; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-danger  { background: #fee2e2 !important; color: #dc2626 !important; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-warning { background: #fef3c7 !important; color: #d97706 !important; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-info    { background: #dbeafe !important; color: #2563eb !important; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-neutral { background: #f3f4f6 !important; color: #6b7280 !important; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }

/* ============================================
 * 状态徽章 (status_badge) 不换行 · 防"已入 / 库"两行
 * ============================================ */
td span[style*="background"],
td span[style*="color:white"],
td span[style*="border-radius"],
th span[style*="background"] {
  white-space: nowrap !important;
  display: inline-block !important;
  min-width: max-content;
}
/* 徽章所在 td 最小宽度 */
td.field-status_badge,
td.field-carrier_badge,
td[class*="_badge"] {
  min-width: 80px !important;
}

/* ============================================
 * 全站字体缩小 · 对齐 Foodmax (2026-08-03)
 * ============================================ */
body, body.antialiased {
  font-size: 13px !important;
  line-height: 1.5 !important;
}
nav a, nav h2, aside a, aside h2 {
  font-size: 13px !important;
}
th, td,
#result_list thead th, #result_list tbody td,
table.min-w-full th, table.min-w-full td {
  font-size: 13px !important;
}
#result_list thead th { padding: 10px 14px !important; }
#result_list tbody td { padding: 10px 14px !important; }
label, .form-row label { font-size: 13px !important; }
input, textarea, select { font-size: 13px !important; }
button, input[type="submit"], input[type="button"], .button { font-size: 13px !important; }
h1, .content h1 { font-size: 20px !important; }
h2 { font-size: 16px !important; }
h3 { font-size: 14px !important; }
.breadcrumbs { font-size: 12px !important; }
.paginator { font-size: 12px !important; }
.paginator a, .paginator .this-page { padding: 4px 10px !important; }

/* ============================================
 * 顶部 tab 栏 · Foodmax 风格 v2
 * ============================================ */
.foodmax-top-nav {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid var(--foodmax-border);
  padding: 0 24px;
  height: 52px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}
.foodmax-top-nav .brand {
  display: flex;
  align-items: center;
  padding-right: 36px;
  text-decoration: none;
  color: var(--foodmax-green);
}
.foodmax-top-nav .brand-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  line-height: 28px;
  margin-right: 10px;
}
.foodmax-top-nav .brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--foodmax-green);
}
.foodmax-top-nav a.tab {
  display: flex;
  align-items: center;
  color: var(--foodmax-text-secondary);
  padding: 0 20px;
  height: 100%;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.foodmax-top-nav a.tab:hover {
  color: var(--foodmax-green);
}
.foodmax-top-nav a.tab.active {
  color: var(--foodmax-green);
  background: var(--foodmax-green-light);
  border-bottom-color: var(--foodmax-green);
  font-weight: 600;
}
.foodmax-top-nav .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--foodmax-text-secondary);
}
.foodmax-top-nav .user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foodmax-text-primary);
}
.foodmax-top-nav .avatar {
  width: 26px; height: 26px;
  background: var(--foodmax-green);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-weight: 600;
  font-size: 12px;
}
.foodmax-top-nav .logout-btn {
  color: var(--foodmax-text-tertiary);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--foodmax-border);
  border-radius: 4px;
  transition: all 0.15s;
}
.foodmax-top-nav .logout-btn:hover {
  color: var(--foodmax-green);
  border-color: var(--foodmax-green);
  background: var(--foodmax-green-light);
}

/* ============================================
 * 侧栏 · 一级分组 & 二级项选中样式 (Foodmax 风格)
 * ============================================ */

/* 一级分组标题 (h2) — 增大左侧留白 + 图标间距 */
h2.select-none {
  cursor: pointer;
  padding: 10px 12px 10px 16px !important;  /* 左 16px 留白 */
  margin: 0 !important;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--foodmax-text-primary) !important;
}
h2.select-none:hover {
  background-color: var(--foodmax-green-light) !important;
  color: var(--foodmax-green-active) !important;
}
/* 大分类前的 material line icon */
h2.select-none .nav-icon,
h2.select-none .material-symbols-outlined {
  font-size: 20px !important;
  color: var(--foodmax-text-secondary) !important;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24 !important;
  transition: color 0.15s;
}
h2.select-none:hover .nav-icon,
h2.select-none.active .nav-icon {
  color: var(--foodmax-green) !important;
}

/* 二级项也增大左侧留白 (小分类无 icon) */
nav ol a,
nav a[href^="/admin/"] {
  padding-left: 24px !important;   /* 08-03 侧栏缩窄后同步调整 (原 28) */
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  font-size: 13px !important;
}

/* 二级项选中: Unfold 用 bg-base-100 text-primary-600 font-semibold
 * 08-03 用户要求 (对齐 Image 5): 只加固定底色, 字体位置不变, 去左边框
 */
nav a.bg-base-100.text-primary-600,
nav a[class*="text-primary-600"][class*="font-semibold"],
nav a.text-primary-600[class*="bg-base-100"] {
  background: var(--foodmax-green-light) !important;
  color: var(--foodmax-green-active) !important;
  font-weight: 600 !important;
  border-left: none !important;
  padding-left: 24px !important;   /* 08-03 跟未选中态一致, 位置不移动 */
  border-radius: 6px !important;
}

/* 二级项 hover 也变浅绿 */
nav a[href^="/admin/"]:hover:not(.bg-base-100) {
  background: rgba(34, 197, 94, 0.06) !important;
  color: var(--foodmax-green) !important;
}

/* ============================================
 * 列表页 · 表头/表格/悬停行
 * ============================================ */
#result_list thead th,
table.min-w-full thead th,
.table-fixed thead th,
th.column-code, th.field-code,
th[class*="field-"] {
  background: var(--foodmax-header-bg) !important;
  color: var(--foodmax-text-primary) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--foodmax-border) !important;
}

/* 表格行悬停浅绿 */
#result_list tbody tr:hover,
table tbody tr:hover {
  background: var(--foodmax-green-light) !important;
  transition: background-color 0.15s;
}

/* 08-03 v2: 列表页 td 内容 3 行截断
 * v1 bug: display:-webkit-box 覆盖 table-cell 布局导致所有列塌陷到第一列
 * v2 fix: 只对 td 加 max-width + word-break, 不动 display
 */
#result_list tbody td,
table.min-w-full tbody td {
  max-width: 280px;   /* 08-03 v3: 240 → 280 防 batch 号 (BAT00135 冷冻榴莲果酱DZ 剩18702.000kg) 换行 */
  word-break: break-word;
  vertical-align: top;
}

/* 表格里可点击的链接: 深绿字 */
#result_list tbody td a,
table tbody td a {
  color: var(--foodmax-green-active) !important;
  font-weight: 500 !important;
  transition: color 0.15s;
}
#result_list tbody td a:hover,
table tbody td a:hover {
  color: var(--foodmax-green) !important;
  text-decoration: underline;
}

/* ============================================
 * "+ 新建" 按钮 · Foodmax 位置 (右上明显)
 * Unfold addlink 默认圆形小按钮 → 改成大长条绿按钮 + 文字
 * ============================================ */
/* 08-04 override: 走 templates/unfold/helpers/add_link.html 自定义模板
 * 用 .foodmax-addbtn class 替代 .addlink 避免与 Unfold Tailwind class 冲突
 */
/* ============================================
 * 08-04 v3 · 顶部横排过滤器 (走 template override + Foodmax 图 3 风格)
 * templates/admin/filter.html 输出 label+select
 * templates/unfold/helpers/change_list_filter.html 简化容器
 * ============================================ */
/* v6 · 单一 panel 布局 (PM 最终版) */
/* 隐藏 date_hierarchy (跟 filter 日期重复) */
ul[class*="toplinks"], ul.toplinks { display: none !important; }
/* 隐藏原 object-tools 位置 (new 按钮已被 JS 移到 toolbar) */
.object-tools { min-height: 0 !important; padding: 0 !important; margin: 0 !important; }
.object-tools:empty, .object-tools:has(.foodmax-addbtn) { display: none !important; }

/* toolbar = filter panel (v9 · 纵向: filter grid + 底部一行 4 按钮) */
#toolbar.foodmax-unified-toolbar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px !important;
  padding: 18px 20px !important;
  background: #fff !important;
  border: 1px solid var(--foodmax-border) !important;
  border-radius: 8px !important;
  margin-bottom: 14px !important;
  /* 用户明确诉求 (2026-08-04 图 53): filter panel 占满全宽, 跟下方表格同宽 */
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}
/* toolbar 的父容器约束了宽度, 强制父级也 stretch */
#toolbar.foodmax-unified-toolbar,
.changelist-form-container > div:has(> #toolbar) {
  width: 100% !important;
}

/* filter grid 5 列 (对齐 ledger 布局) */
#changelist-filter.foodmax-filter-topbar {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 16px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  z-index: auto !important;
  inset: auto !important;
  backdrop-filter: none !important;
}
/* 窄屏降级 */
@media (max-width: 1400px) {
  #changelist-filter.foodmax-filter-topbar { grid-template-columns: repeat(4, 1fr) !important; }
}
@media (max-width: 1100px) {
  #changelist-filter.foodmax-filter-topbar { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 800px) {
  #changelist-filter.foodmax-filter-topbar { grid-template-columns: repeat(2, 1fr) !important; }
}

/* 底部按钮行 (一行 4 按钮: 搜索/重置/导出 + 新建靠右) */
.foodmax-bottom-actions {
  display: flex !important;
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px dashed var(--foodmax-border);
  margin-top: 4px;
  width: 100% !important;    /* 关键: 占满 filter panel 全宽, margin-left:auto 才有空间推开 */
  box-sizing: border-box;
}
/* 新建按钮强制靠右, margin-left:auto 在 flex 里天然靠右 (需 bottom-actions width:100%) */
.foodmax-bottom-actions .foodmax-addbtn,
.foodmax-bottom-actions a.addlink {
  margin-left: auto !important;
}
.foodmax-bottom-actions:empty { display: none; }

/* 搜索按钮 (绿色主按钮, 主 CTA) */
.foodmax-search-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  height: 34px;
  background: var(--foodmax-green);
  color: #fff !important;
  border: 1px solid var(--foodmax-green);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.foodmax-search-btn:hover {
  background: var(--foodmax-green-hover);
  border-color: var(--foodmax-green-hover);
  color: #fff !important;
}

/* v8: 去搜索框相关 CSS (v7 遗留), 用 display:none 隐藏 */
#changelist-search { display: none !important; }

/* 重置按钮 */
.foodmax-filter-reset {
  padding: 0 14px;
  height: 34px;
  line-height: 32px;
  border: 1px solid var(--foodmax-border);
  border-radius: 6px;
  color: var(--foodmax-text-secondary);
  text-decoration: none;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.foodmax-filter-reset:hover {
  color: var(--foodmax-green);
  border-color: var(--foodmax-green);
  background: var(--foodmax-green-light);
}

/* 新建按钮在 toolbar 里保持之前 addbtn 样式 (高度对齐) */
.foodmax-right-actions .foodmax-addbtn,
.foodmax-right-actions a.addlink {
  height: 34px !important;
}

/* 导入 Excel 按钮 (跟导出同风格) */
.foodmax-import-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 34px;
  background: #f9fafb;
  color: var(--foodmax-text-primary);
  border: 1px solid var(--foodmax-border);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.foodmax-import-btn:hover {
  background: var(--foodmax-green-light);
  color: var(--foodmax-green);
  border-color: var(--foodmax-green);
}

/* 导出 Excel 按钮 (灰底) */
.foodmax-export-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 34px;
  background: #f9fafb;
  color: var(--foodmax-text-primary);
  border: 1px solid var(--foodmax-border);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.foodmax-export-btn:hover {
  background: var(--foodmax-green-light);
  color: var(--foodmax-green);
  border-color: var(--foodmax-green);
}
.foodmax-filter-item {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.foodmax-filter-item label {
  font-size: 12px;
  color: var(--foodmax-text-secondary);
  font-weight: 500;
  margin: 0;
}
.foodmax-filter-select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--foodmax-border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--foodmax-text-primary);
  min-height: 32px;
  cursor: pointer;
  appearance: menulist;
  min-width: 140px;
}
.foodmax-filter-select:focus {
  border-color: var(--foodmax-green) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2) !important;
}
/* 隐藏"过滤器"按钮 + 抽屉关闭区 */
a[x-on\:click="filterOpen = true"] { display: none !important; }
#changelist-filter-close { display: none !important; }

/* 08-04 用户: 隐藏面包屑 (首页 / M4 加工 / 01·加工单)
 * 顶部 tab + 侧栏已明确指示当前位置, 面包屑冗余显示为浅灰小字反而像"被遮挡"
 */
.container > ul.flex.flex-wrap > li.text-xs,
.container:has(> ul > li.text-xs) {
  display: none !important;
}

/* ============================================
 * form-row 3 列布局强化 (2026-08-04)
 * Unfold 默认 lg:grid-cols-3 只在 ≥1024px 生效, 窗口窄退化单列 → 页面很长
 * 改成 md 断点 (≥768px) 就 3 列, sm (≥640px) 2 列
 * ============================================ */
@media (min-width: 640px) {
  .form-row.grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 20px !important;
  }
}
@media (min-width: 900px) {
  .form-row.grid.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
/* 单字段行 (fields=('a',)) 不强制多列 */
.form-row.grid.lg\:grid-cols-3 > .field:only-child,
.form-row.grid.lg\:grid-cols-3.field-remark,
.form-row.grid.lg\:grid-cols-3.field-description {
  grid-column: 1 / -1 !important;
}

/* object-tools 容器 · Unfold 无样式 → 显式布局
 * 08-04 用户反馈: sticky 定位会遮挡下方面包屑, 改成正常流靠右
 */
.object-tools {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  padding: 8px 24px 12px !important;
  gap: 8px !important;
  background: transparent !important;
}
/* 无 object-tools 时不显示占位 */
.object-tools:empty { display: none !important; }

/* 主按钮 (新建 + 兜底 addlink 未走 template override 的场景) */
a.foodmax-addbtn,
.foodmax-addbtn,
a.addlink {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--foodmax-green) !important;
  color: #fff !important;
  padding: 0 18px !important;
  width: auto !important;
  min-width: 90px !important;
  height: 36px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.25) !important;
  transition: all 0.15s !important;
  gap: 6px !important;
  white-space: nowrap !important;
  margin: 0 !important;   /* 覆盖 Unfold -my-1 */
}
a.foodmax-addbtn:hover,
.foodmax-addbtn:hover,
a.addlink:hover {
  background: var(--foodmax-green-hover) !important;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(34, 197, 94, 0.35) !important;
}
.foodmax-addbtn-icon {
  font-size: 18px !important;
  line-height: 1 !important;
  color: #fff !important;
}

/* ============================================
 * Django admin 原生分页 · Foodmax 风格
 * (Django admin change_list.html 有 .paginator)
 * ============================================ */
.paginator {
  padding: 14px 20px !important;
  background: #fafafa !important;
  border-top: 1px solid var(--foodmax-border) !important;
  border-radius: 0 0 8px 8px !important;
  margin-top: 12px !important;
  color: var(--foodmax-text-secondary);
  font-size: 13px;
}
.paginator a, .paginator .this-page {
  display: inline-block;
  padding: 5px 12px !important;
  margin: 0 3px !important;
  color: var(--foodmax-text-secondary) !important;
  border: 1px solid var(--foodmax-border) !important;
  background: #fff !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  transition: all 0.15s;
}
.paginator .this-page {
  background: var(--foodmax-green) !important;
  color: #fff !important;
  border-color: var(--foodmax-green) !important;
  font-weight: 600;
}
.paginator a:hover {
  color: var(--foodmax-green) !important;
  border-color: var(--foodmax-green) !important;
  background: var(--foodmax-green-light) !important;
}
.paginator a.showall {
  color: var(--foodmax-green-active) !important;
  border-color: var(--foodmax-green-border) !important;
}

/* ============================================
 * 通用按钮 · 查询/重置/确认 (form submit)
 * ============================================ */
input[type="submit"].default,
button.default,
.submit-row input[type="submit"] {
  background: var(--foodmax-green) !important;
  border: 1px solid var(--foodmax-green) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 8px 20px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  transition: all 0.15s;
}
input[type="submit"].default:hover,
button.default:hover {
  background: var(--foodmax-green-hover) !important;
  border-color: var(--foodmax-green-hover) !important;
}

/* ============================================
 * 面包屑 (breadcrumbs)
 * ============================================ */
.breadcrumbs, div.breadcrumbs {
  background: transparent !important;
  padding: 12px 20px !important;
  border-bottom: 1px solid var(--foodmax-border) !important;
  font-size: 13px !important;
  color: var(--foodmax-text-tertiary);
}
.breadcrumbs a {
  color: var(--foodmax-green-active) !important;
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }

/* ============================================
 * 输入框 / 复选框 focus
 * ============================================ */
input:focus:not([type="checkbox"]):not([type="radio"]),
textarea:focus, select:focus {
  border-color: var(--foodmax-green) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2) !important;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  accent-color: var(--foodmax-green) !important;
}

/* 顶栏通知铃铛 (2026-08-05) */
.foodmax-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}
.foodmax-bell .bell-icon {
  position: relative;
  display: inline-flex;
  padding: 6px;
  color: var(--foodmax-text-primary);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}
.foodmax-bell .bell-icon:hover { background: #f3f4f6; color: var(--foodmax-green); }
.foodmax-bell .bell-badge {
  position: absolute;
  top: 0; right: 0;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}
.foodmax-bell .bell-dropdown {
  position: absolute;
  top: 100%; right: 0;
  margin-top: 4px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--foodmax-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
}
.foodmax-bell .bell-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--foodmax-border);
  background: var(--foodmax-green-light);
  color: var(--foodmax-green-dark);
}
.foodmax-bell .bell-list { padding: 4px 0; }
.foodmax-bell .bell-item a {
  display: block;
  padding: 8px 14px;
  color: var(--foodmax-text-primary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
}
.foodmax-bell .bell-item a:hover { background: #f9fafb; }
.foodmax-bell .bell-item.unread { background: #fefce8; }
.foodmax-bell .bell-approval a { background: #fef3c7 !important; font-weight: 500; }
.foodmax-bell .bell-approval a:hover { background: #fde68a !important; }
.foodmax-bell .bell-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.foodmax-bell .bell-time {
  float: right;
  color: #9ca3af;
  font-size: 11px;
}
.foodmax-bell .bell-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}
.foodmax-bell .bell-footer {
  display: flex;
  border-top: 1px solid var(--foodmax-border);
}
.foodmax-bell .bell-footer a {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--foodmax-green-dark);
  text-decoration: none;
  border-right: 1px solid var(--foodmax-border);
}
.foodmax-bell .bell-footer a:last-child { border-right: none; }
.foodmax-bell .bell-footer a:hover { background: var(--foodmax-green-light); }
