/* ============================================================
 * 科润达产品分销 - 卖家后台样式
 * 主界面仿参考系统:纯黑侧栏 + 页签栏 + 绿色操作色
 * ============================================================ */
:root {
  --primary: #26a69a;        /* 主操作青绿(添加客户/立即查询/菜单高亮) */
  --primary-dark: #1f8d82;
  --green: #26a69a;
  --green-dark: #1f8d82;
  --blue: #409eff;           /* 审核按钮蓝 */
  --login-blue: #3b6ef5;     /* 登录页蓝 */
  --text: #333;
  --light: #f0f2f5;
  --border: #e8e8e8;
  --orange: #ff7043;         /* 删除按钮橙 */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: var(--text); background: var(--light); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; outline: none; }

/* ---------- 登录(左蓝右白分栏,保持不变) ---------- */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #eef1f7, #e4e9f2); }
.login-split { display: flex; width: 980px; max-width: 96vw; min-height: 560px; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(30,50,90,.15); }
.login-left { flex: 1.1; background: linear-gradient(135deg, #4a7bf7, #38bdf8); color: #fff; padding: 60px 48px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.login-left h1 { font-size: 34px; letter-spacing: 2px; margin-bottom: 18px; position: relative; z-index: 1; }
.login-left p { font-size: 15px; opacity: .92; line-height: 1.8; position: relative; z-index: 1; }
.login-feat { margin-top: auto; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; font-size: 13px; line-height: 1.7; }
.login-feat .feat-ico { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.circle { position: absolute; border: 2px solid rgba(255,255,255,.18); border-radius: 50%; }
.c1 { width: 200px; height: 200px; top: 40px; left: -60px; }
.c2 { width: 300px; height: 300px; bottom: -80px; right: -60px; }
.c3 { width: 90px; height: 90px; top: 46%; left: 42%; }
.login-right { flex: 1; background: #fff; padding: 72px 56px; display: flex; flex-direction: column; }
.login-right h2 { font-size: 26px; margin-bottom: 34px; }
.login-right label { font-size: 13px; color: #556; margin-bottom: 8px; font-weight: 600; }
.login-right input { border: 1px solid #dde1ea; border-radius: 8px; padding: 13px 14px; margin-bottom: 18px; font-size: 14px; }
.login-right input:focus { border-color: var(--login-blue); }
.login-err { color: #d33; font-size: 13px; min-height: 20px; }
.login-right button { background: var(--login-blue); color: #fff; border: none; border-radius: 8px; padding: 14px 0; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.login-right button:hover { background: #2b55c9; }
.login-right button:disabled { opacity: .6; cursor: not-allowed; }
.login-hint { margin-top: 18px; font-size: 12px; color: #99a; line-height: 1.7; }
@media (max-width: 860px) { .login-left { display: none; } }

/* ---------- 框架:纯黑侧栏 ---------- */
#app-view { display: flex; min-height: 100vh; }
.side { width: 220px; background: #0f1417; color: #eee; position: fixed; top: 0; bottom: 0; z-index: 20; transition: margin-left .2s; overflow-y: auto; }
.side.collapsed { margin-left: -220px; }
.side-brand { padding: 26px 0 20px; text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 3px; color: #fff; }
.menu-group { border-top: 1px solid #1c2226; }
.group-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; font-size: 16px; font-weight: 700; cursor: pointer; user-select: none; }
.group-head .gh-ico { font-size: 17px; }
.group-head .gh-arrow { margin-left: auto; font-size: 12px; transition: transform .2s; }
.menu-group.closed .gh-arrow { transform: rotate(180deg); }
.group-items { background: #141a1e; overflow: hidden; }
.menu-group.closed .group-items { display: none; }
.group-items a { display: block; padding: 15px 22px 15px 40px; font-size: 15px; color: #ccc; }
.group-items a:hover { color: #fff; background: #1b2226; }
.group-items a.active { color: #fff; background: var(--primary); font-weight: 600; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-width: 0; transition: margin-left .2s; }
.main.full { margin-left: 0; }

/* ---------- 页签栏(多页签,可关闭) ---------- */
.tabbar { height: 50px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: stretch; position: sticky; top: 0; z-index: 10; }
.collapse-btn { display: flex; align-items: center; padding: 0 18px; font-size: 22px; color: #333; cursor: pointer; user-select: none; }
.collapse-btn:hover { background: #f5f5f5; }
.tabs { display: flex; align-items: stretch; overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 20px; background: #f5f5f5; border-right: 1px solid var(--border); font-size: 14px; position: relative; white-space: nowrap; }
.tab:first-child { border-left: 1px solid var(--border); }
.tab-home .home-ico { color: #e03131; font-size: 19px; }
.tab.on { background: #fff; }
.tab.on::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #111; }
.tab-x { color: #aaa; font-size: 15px; padding: 0 2px; border-radius: 50%; }
.tab-x:hover { color: #333; background: #e5e5e5; }
.tab-spacer { flex: 1; }
.tab-user { display: flex; align-items: center; padding: 0 20px; font-size: 13px; color: #666; }

.content { padding: 22px 24px 40px; overflow-x: auto; }

/* ---------- 面板 / 卡片 ---------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 18px 20px; margin-bottom: 18px; overflow-x: auto; }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 18px 20px; }
.card .c-label { font-size: 13px; color: #888; }
.card .c-num { font-size: 30px; font-weight: 800; margin-top: 6px; }
.card .c-sub { font-size: 12px; color: #aaa; margin-top: 4px; }
.link-box { display: flex; gap: 10px; align-items: center; }
.link-box input { flex: 1; border: 1px dashed var(--green); background: #f4faf7; border-radius: 4px; padding: 11px 14px; color: #345; font-size: 13px; }

/* ---------- 工具条 / 按钮(绿色主操作) ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { border: 1px solid #ddd; border-radius: 4px; padding: 9px 12px; background: #fff; }
.toolbar .spacer { flex: 1; }
.btn { border: none; border-radius: 4px; padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { background: #fff; border: 1px solid #ddd; color: #555; }
.btn.warn { background: #fff; border: 1px solid #f0c0c0; color: #c33; }
.btn.sm { padding: 5px 12px; font-size: 12px; }

/* ---------- 表格(仿截图:浅边框+复选框+绿色链接) ---------- */
table.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); }
table.grid th, table.grid td { padding: 15px 16px; font-size: 14px; border: 1px solid #efefef; text-align: left; vertical-align: middle; }
table.grid th { background: #fafafa; font-weight: 600; color: #555; white-space: nowrap; }
table.grid tr:hover td { background: #fcfcfc; }
table.grid input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.g-thumb { width: 38px; height: 38px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; vertical-align: middle; margin-right: 8px; }

.glink { color: var(--green); cursor: pointer; }
.glink:hover { text-decoration: underline; }
.glink.red { color: #e03131; }
.ops a { color: var(--green); margin-right: 12px; font-size: 13px; }
.ops a.danger { color: #c33; }
.ops a:hover { text-decoration: underline; }

/* 彩色小按钮(销售订单操作列) */
.btn.blue { background: var(--blue); color: #fff; }
.btn.blue:hover { background: #2f8de6; }
.btn.teal { background: var(--primary); color: #fff; }
.btn.teal:hover { background: var(--primary-dark); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.orange:hover { background: #f25c2e; }
.ops-btn .btn { margin-right: 6px; }
.ord-no { color: var(--blue); }
.ord-no:hover { text-decoration: underline; }
.amt-sum { margin-left: auto; font-size: 13px; color: #666; }
.amt-sum b { color: #e03131; font-size: 15px; }
.prod-row td { background: #fafcfc !important; color: #667; font-size: 12px !important; }
.tip { font-size: 12px; color: #999; margin-top: 12px; }
.pager select { border: 1px solid #ddd; border-radius: 4px; padding: 5px 8px; margin-left: 6px; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 销售订单:左筛选栏 + 双页签 ---------- */
/* 筛选栏横向放置:一条工具栏在表格上方(关键词 + 日期范围 + 查询/重置) */
.ord-filter-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; margin-bottom: 14px; }
.ord-filter-bar .ofb-item { display: flex; align-items: center; gap: 8px; }
.ord-filter-bar label { font-size: 13px; color: #555; white-space: nowrap; }
.ord-filter-bar input { border: 1px solid #ddd; border-radius: 4px; padding: 9px 11px; font-size: 13px; }
.ord-filter-bar input:focus { border-color: var(--primary); outline: none; }
.ord-filter-bar input#o-kw { width: 240px; }
.ord-filter-bar input[type="date"] { width: 148px; }
.ord-filter-bar .ofb-sep { color: #999; }
.ord-filter-bar .ofb-spacer { flex: 1; }
.ord-main { min-width: 0; width: 100%; }
@media (max-width: 768px) {
  .ord-filter-bar { gap: 10px; }
  .ord-filter-bar .ofb-item { flex: 1 1 100%; }
  .ord-filter-bar input#o-kw { flex: 1; width: auto; }
  .ord-filter-bar .ofb-spacer { display: none; }
}
.ord-tabs { display: flex; }
.ord-tabs a { padding: 12px 24px; background: #f5f5f5; border: 1px solid var(--border); border-bottom: none; border-radius: 4px 4px 0 0; margin-right: 4px; font-size: 14px; cursor: pointer; }
.ord-tabs a.on { background: #fff; color: #e03131; font-weight: 700; }
.ord-main .panel { margin-bottom: 0; }

.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 3px; }
.tag.on { background: #e8f7ee; color: var(--green); }
.tag.off { background: #f3f4f6; color: #888; }
.tag.pending { background: #fef3e8; color: var(--orange); }
.tag.done { background: #e8f7ee; color: var(--green); }

.pager { display: flex; gap: 6px; margin-top: 14px; align-items: center; font-size: 13px; color: #888; }
.pager button { border: 1px solid #ddd; background: #fff; border-radius: 4px; padding: 5px 12px; cursor: pointer; }
.pager button.cur { background: var(--green); color: #fff; border-color: var(--green); }

.empty { text-align: center; color: #999; padding: 46px 0; }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,25,40,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 520px; max-width: 94vw; max-height: 88vh; overflow: auto; background: #fff; border-radius: 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.modal-head a { color: #999; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid label { display: block; font-size: 13px; color: #667; margin-bottom: 6px; }
.form-grid input, .form-grid select { width: 100%; border: 1px solid #ddd; border-radius: 4px; padding: 9px 12px; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--green); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-err { color: #c33; font-size: 13px; min-height: 18px; margin-top: 10px; }
.inq-items { background: #fafafa; border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; font-size: 13px; line-height: 2; }

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #111; color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 14px; transition: transform .3s; z-index: 200; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .side { margin-left: -220px; }
  .side.open { margin-left: 0; }
  .main { margin-left: 0; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid.two { grid-template-columns: 1fr; }
}

/* 窄屏:销售订单左筛选栏改为顶部横排 */
@media (max-width: 1360px) {
  .ord-layout { flex-direction: column; }
  .ord-filter { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end; }
  .ord-filter h4 { margin: 0 0 2px; grid-column: 1 / -1; }
  .ord-filter .of-label { margin-bottom: 4px; grid-column: 1 / -1; }
  .ord-filter input { margin-bottom: 0; }
  .of-btns { grid-column: 1 / -1; max-width: 320px; }
}

/* ---------- 订单详情整页(仿总后台) ---------- */
.od-top { display: flex; align-items: center; margin-bottom: 14px; font-size: 14px; }
.od-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.od-cell label { display: block; font-size: 12px; color: #999; margin-bottom: 5px; }
.od-val { font-size: 14px; color: #333; background: #fafafa; border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; min-height: 20px; word-break: break-all; }
@media (max-width: 1100px) { .od-grid { grid-template-columns: repeat(2, 1fr); } }
