﻿/* 切位机票操作台 · 样式 */
:root {
  --bg: #0f1520;
  --panel: #161e2b;
  --panel2: #1d2735;
  --line: #2a3648;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --brand: #3d8bfd;
  --red: #ff4d4f;
  --red-bg: #3a1417;
  --orange: #ff9c2b;
  --orange-bg: #3a2a10;
  --yellow: #f5d642;
  --green: #34c759;
  --green-bg: #10301c;
  --purple: #a06bff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: Consolas, "Courier New", monospace; }
button { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 30% 20%, #17263c 0%, #0f1520 55%); }
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px #0008; }
.login-card .logo { font-size: 34px; text-align: center; color: var(--brand); }
.login-card h1 { font-size: 20px; margin: 6px 0 4px; text-align: center; }
.login-card p { text-align: center; font-size: 12px; margin: 0 0 18px; }
.login-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.login-card input { width: 100%; margin-top: 6px; }
.tip { min-height: 18px; color: var(--red); text-align: center; font-size: 12px; margin: 10px 0 0; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  background: #0d141f; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; min-height: 64px; }
label.field { display: block; font-size: 12px; color: var(--muted); }
label.field > input, label.field > select { margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: #3b4a61; background: #24303f; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2f7cf0; }
.btn.danger { background: #4a1a1c; border-color: #6b2a2e; color: #ff8b8d; }
.btn.danger:hover { background: #5d2124; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
/* 表格里贴着文件名/水单的小按钮（改 / 删），一行放得下 */
.btn.xs { padding: 1px 7px; font-size: 11px; line-height: 1.5; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 左侧导航 ---------- */
.app { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar { flex: 0 0 212px; width: 212px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px;
  padding: 17px 16px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.brand-icon { color: var(--brand); font-size: 18px; flex: none; }
.tabs { display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; flex: 1; overflow-y: auto; }
.tab { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--muted); padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; }
.tab .ico { width: 18px; text-align: center; font-size: 15px; flex: none; }
.tab:hover { color: var(--text); background: #1c2534; }
.tab.active { color: #fff; background: var(--brand); font-weight: 600; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.who-line { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 0 2px; min-height: 18px; }
.live { color: var(--green); font-size: 9px; animation: pulse 2s infinite; flex: none; }
.live.off { color: #666; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; min-width: 0; padding: 20px; }

/* ---------- 套票筛选条 ---------- */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.filterbar select { width: auto; min-width: 300px; max-width: 100%; }

/* ---------- 卡片标题里的搜索框 ---------- */
.searchbox { width: 240px; max-width: 40vw; font-size: 13px; padding: 6px 10px; }
.hidden { display: none !important; }
/* 备注列：给个最大宽度，太长自动换行，别把操作列挤跑 */
.notecell { max-width: 220px; white-space: normal; word-break: break-word; line-height: 1.5; }
/* 借位表里手填的成本/售价：收窄一点，七个数字列才排得下 */
input.xn { width: 76px; min-width: 0; padding: 5px 6px; font-size: 13px; text-align: right; }
/* 这一单位数拆成「自有切位 + 借位」那一行 */
.splits { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }

/* ---------- 通用块 ---------- */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.red .v { color: var(--red); }
.kpi.orange .v { color: var(--orange); }
.kpi.green .v { color: var(--green); }
.kpi.blue .v { color: var(--brand); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }.card > h2 { font-size: 15px; margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; }
.card > h2 .count { font-size: 12px; color: var(--muted); font-weight: 400; }
.card > .body { padding: 14px 16px; }
.card.danger > h2 { background: var(--red-bg); color: #ffb3b4; border-bottom-color: #5a2124; }
.card.warn > h2 { background: var(--orange-bg); color: #ffce8f; border-bottom-color: #553a12; }
.card.flat > .body { padding: 0; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #212c3b; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: #131a26; position: sticky; top: 0; }
/* 列与列之间来一条竖线：一行里横着对数据不串行 */
th + th, td + td { border-left: 1px solid #2b3a4d; }
th + th { border-left-color: #3a4c63; }
tbody tr:hover { background: #1a2431; }
td.wrap, th.wrap { white-space: normal; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow: auto; max-height: 62vh; }
/* 已售机票那几张表：横向不许滚动，永远占满外框（拖动只在外框内重新分配宽度） */
.tbl-scroll.no-x { overflow-x: hidden; }

/* 已售机票：每个套餐一张表。列宽写死按百分比，永远塞得进外框，不会出横向滚动条 */
.tbl-sold { table-layout: fixed; width: 100%; }
.tbl-sold th,
.tbl-sold td { white-space: normal; text-align: center; }
.tbl-sold th,
.tbl-sold td.num { white-space: nowrap; text-align: center; }
/* 列宽拖动把手：贴在表头竖线上，按住左右拖；双击恢复默认 */
.colgrip { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 4; }
.colgrip::after { content: ''; position: absolute; top: 30%; bottom: 30%; left: 4px; width: 1px; background: #3a4c63; }
.colgrip:hover::after { top: 8%; bottom: 8%; background: var(--brand); width: 2px; left: 4px; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }

/* ---------- 浮层图片查看器（看护照 / 看水单）：可拖、可缩放 ---------- */
.imgwin { position: fixed; z-index: 600; display: flex; flex-direction: column;
  right: 32px; bottom: 32px; width: 560px; height: 720px; min-width: 260px; min-height: 200px;
  background: var(--panel); border: 1px solid #33507a; border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0,0,0,.55); resize: both; overflow: hidden; }
.imgwin-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: #16233a; border-bottom: 1px solid var(--line); cursor: move; user-select: none;
  font-size: 12px; color: #cfdcee; white-space: nowrap; }
.imgwin-title { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.imgwin-head .oplink { font-size: 12px; }
.imgwin-body { flex: 1; overflow: auto; background: #0b1119; }
.imgwin-body img { display: block; width: 100%; }
body.img-dragging, body.img-dragging * { cursor: move !important; user-select: none !important; }


.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill.red { background: var(--red); color: #fff; }
.pill.orange { background: var(--orange); color: #231503; }
.pill.yellow { background: var(--yellow); color: #2d2600; }
.pill.green { background: var(--green-bg); color: #7cea9b; border: 1px solid #1e5633; }
.pill.gray { background: #232f3f; color: var(--muted); }
.pill.blue { background: #13305a; color: #8dbcff; border: 1px solid #1d4576; }
.pill.purple { background: #26173f; color: #c3a4ff; border: 1px solid #3d2a63; }
/* 有水单的收款标签本身就是个链接：点它直接看图，别加下划线 */
a.pill { text-decoration: none; cursor: pointer; }
a.pill:hover { filter: brightness(1.25); }

.big-num { font-size: 16px; font-weight: 700; }
.clip-neg { color: var(--red); }
.clip-pos { color: var(--green); }
.clip-o { color: var(--orange); }
/* 定金那两行：备注（定金挪去哪 / 从哪来）用橙色小字，一眼能看见 */
.seatdep-note { margin-top: 1px; color: var(--orange); white-space: normal; }
/* 改定金弹窗里，正在改的那一天高亮 */
.seatdep-cur td { background: #16263d; box-shadow: inset 0 0 0 1px #2f5f96; }
.seatdep-cur td:first-child { border-left: 3px solid #4d9bff; font-weight: 600; }
/* 切位机票 → 明细：套票名下那一行定金信息（总额 / 水单 / 对账） */
.depline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 小标题也要能标红（h4.sec 权重更高，单靠 .clip-neg 盖不住） */
h4.sec.clip-neg { color: var(--red); }
h4.sec.clip-pos { color: var(--green); }
.row-dead { opacity: .6; }
.row-today { background: #2a1113 !important; }
tr.row-today:hover { background: #33151a !important; }

/* ---------- 空状态 ---------- */
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 26px; display: block; margin-bottom: 6px; opacity: .5; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 200; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(980px, 100%);
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 80px #000b; }
.modal.wide { width: min(1500px, 97vw); }
.modal.wide .content { padding: 16px 20px; }

/* ---------- 出票：每位客人一张卡片（宽度按字段实际长度给） ---------- */
.paxlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.paxcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.paxhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
/*                      Given   Family  Gen  Nat  Birthday  PType  Passport  Issuing  Expiry */
.paxgrid { display: grid; gap: 8px 10px; align-items: end;
  grid-template-columns: 1.6fr 1.3fr 66px 84px 150px 116px 148px 108px 150px; }
.pf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pf > span { font-size: 11px; color: var(--muted); line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.pf > input, .pf > select { font-size: 14px; padding: 7px 9px; width: 100%; }
.pf-inline { display: flex; align-items: center; gap: 6px; }
.pf-inline > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pf-inline > input { width: 170px; font-size: 13px; padding: 5px 8px; }
.pf.missing > span { color: var(--orange); font-weight: 600; }
.pf.missing > input { border-color: var(--orange); background: #241a08; }
.req { color: var(--orange); font-size: 10px; font-weight: 700; margin-left: 2px; }

/* ---------- 水单上传框：点选 / 拖进来 / Ctrl+V 粘贴 ---------- */
.slipbox { border: 1px dashed #2c405a; border-radius: 10px; padding: 8px;
  background: #0f1926; cursor: pointer; transition: border-color .12s, background .12s; }
.slipbox:hover { border-color: var(--brand); background: #131f2d; }
.slipbox.drag { border-color: var(--brand); background: #16263a; }
/* 空框（不放提示文字）：给个高度，点一下进入"可粘贴"状态 */
.slipbox.blank { min-height: 76px; }
.slipbox.blank::after { content: ''; display: block; height: 60px; }
.slipbox.blank:focus, .slipbox.blank.ready { outline: none; border-color: var(--brand); background: #16263a; }
.slipempty { font-size: 12px; color: var(--muted); text-align: center; padding: 16px 8px; line-height: 1.7; }
.slipempty b { color: #cfdcee; }
.slipimg { max-width: 100%; max-height: 240px; border-radius: 8px; display: block;
  margin: 0 auto 6px; background: #0a1119; }
.sliphint { font-size: 11px; color: var(--muted); text-align: center; }
/* 上传框上方那行：标签 + 「上传文件」按钮 */
.uploadrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.uploadrow > span { font-weight: 500; color: #cfdcee; }
/* 非图片文件（PDF/Word/Excel）显示成文件条 */
.slipfile { display: flex; align-items: center; gap: 10px; padding: 10px 4px; }
.slipfileic { font-size: 22px; line-height: 1; }
.slipfilename { font-size: 13px; color: #cfdcee; word-break: break-all; }

/* ---------- 多张水单：缩略图并排，每张右上角一个 × ---------- */
.slipbox.multi { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; cursor: default; }
.slipbox.multi.blank { min-height: 0; }
.slipbox.multi.blank::after { display: none; }
.slipcard { position: relative; width: 108px; }
.slipcard .slipimg { max-height: 96px; width: 108px; object-fit: cover; margin: 0; }
.slipcard .slipfileic { display: block; text-align: center; padding: 28px 0; }
.slipdel { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid #6b2a2e; background: #4a1a1c; color: #ff8b8d; font-size: 13px; line-height: 1;
  cursor: pointer; padding: 0; }
.slipdel:hover { background: #6b2a2e; }
.slipno { position: absolute; left: 4px; bottom: 4px; font-size: 10px; color: #cfdcee;
  background: rgba(8, 15, 24, .75); border-radius: 4px; padding: 0 4px; }

/* 收款弹窗里的合计条 / 已有记录 */
.paybanner { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  background: #0f1926; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.paybanner b { color: #e8eef7; font-size: 14px; }
.paylines { display: flex; flex-direction: column; gap: 6px; }
.payline { display: flex; align-items: center; gap: 10px; font-size: 12px;
  background: #0f1926; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.payline[data-editing="1"] { border-color: var(--brand); }
.payline b { color: #e8eef7; }
.slipthumbs { color: #8dbcff; }

/* 表格里每笔收款一行 */
/* 水单图链接：一眼能看出是能点开的图 */
a.sliplink { color: #8dbcff; text-decoration: none; border-bottom: 1px dotted #3d6ba8; padding: 0 1px; }
a.sliplink:hover { color: #b8d4ff; border-bottom-color: #8dbcff; }

/* ---------- 已售机票里的「客户确认 / 客户收款 / 借位确认 / 借位付款」四格 ---------- */
.paycell, .doccell { line-height: 1.5; }
.doccell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 文件名太长就省略后半截，让「改 / 删」稳在第二行（和收款格子的节奏一致） */
.doccell a.sliplink { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docops { margin-top: 2px; display: flex; gap: 8px; }
.payhead { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; white-space: nowrap; }
.paysum { font-size: 12px; font-weight: 600; }
.paysum.ok { color: #7cea9b; }
.paysum.warn { color: var(--orange); }
.paysum.red { color: #ff8b8d; }
.paydue { font-size: 11px; color: var(--muted); }
.payrec {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: 6px; margin-top: 2px; padding-top: 2px; border-top: 1px dashed #212c3b; font-size: 12px;
}
.prec-amt { color: #cfdcee; font-variant-numeric: tabular-nums; }
.prec-imgs { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prec-imgs .sliplink + .sliplink { margin-left: 5px; }
/* 小号文字操作：改 / 删，不加边框，窄列里也干净 */
.oplink { background: none; border: 0; padding: 0 1px; font-size: 11px; color: #8dbcff; cursor: pointer; }
.oplink:hover { text-decoration: underline; }
.oplink.del { color: #ff8b8d; }
.opadd { background: none; border: 0; padding: 1px 0 0; font-size: 11px; color: #5fa8ff; cursor: pointer; }
/* 切位付款两行：定金一行、尾款一行（按「这一天」一份） */
.seatpay-line + .seatpay-line { margin-top: 4px; padding-top: 4px; border-top: 1px solid #212c3b; }
.opadd:hover { text-decoration: underline; }

/* ---------- 二选一的分段按钮（留多久：按小时 / 留到某天某时） ---------- */
.seg { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; background: #0f1926; }
.segbtn { flex: 1; padding: 8px 10px; font-size: 13px; line-height: 1.2;
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  white-space: nowrap; transition: background .12s, color .12s; }
.segbtn + .segbtn { border-left: 1px solid var(--line); }
.segbtn:hover { background: #16212e; color: #cfdcee; }
.segbtn.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 护照重复提醒 ---------- */.dupwarn:empty { display: none; }
.dupline { margin-top: 8px; font-size: 12px; line-height: 1.55; padding: 6px 10px;
  border-radius: 8px; background: #2a1116; border: 1px solid #6b2231; color: #ffb4be; }
.dupline b { color: #fff; }
.dupblock { margin: 10px 0; padding: 10px 12px; border-radius: 10px;
  background: #2a1116; border: 1px solid #6b2231; }
.duphead { font-size: 13px; color: #ffb4be; }
.dupul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #d6c2c6; line-height: 1.8; }

/* ---------- 正在出票：批次卡片 ---------- */
.batchcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; }
.batchhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.batchpax { font-size: 13px; color: #cfdcee; line-height: 1.7; margin-bottom: 4px; }
.batchcard.owecard { border-color: #6b2a2e; background: #2a1417; }

/* ---------- 已出机票：文件夹式折叠 ---------- */
details.fold { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--panel2); overflow: hidden; }
details.fold > summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  cursor: pointer; list-style: none; user-select: none; background: #1a2432; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: var(--brand); font-size: 12px; transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary:hover { background: #22303f; }
details.fold .foldbody { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
details.fold.sub { margin: 0; background: #16202c; }
details.fold.sub > summary { background: #16202c; padding: 9px 12px; }
details.fold.sub > summary:hover { background: #1d2a38; }
details.fold .fdate { font-weight: 700; font-variant-numeric: tabular-nums; }
details.fold table { margin: 0; }

/* 出票日到点提醒（跟首页催命单一个口径） */
details.fold.deadline > summary { background: #2b1114; border-left: 3px solid var(--red); }
details.fold.deadline > summary:hover { background: #351619; }
details.fold.deadline.today > summary { background: #3a1216; }
details.fold.deadline.today > summary:hover { background: #451519; }
details.fold.deadline.dead > summary { background: #221314; }
details.fold.sub.deadline > summary { background: #35171b; }
details.fold.sub.deadline.today > summary { background: #3f1419; }
details.fold.deadline > summary b, details.fold.deadline > summary .fdate { color: #ffb3b4; }
@media (max-width: 1280px) {
  .paxgrid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
}
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal header h3 { margin: 0; font-size: 15px; }
.modal .content { padding: 16px 18px; overflow: auto; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal .close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 改总的 ---------- */
.bulklist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.bulkrow { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bulkrow > input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; }
.bulklabel { flex: 0 0 190px; color: var(--muted); }
.bulkrow > input[type="number"] { width: 160px; font-size: 13px; padding: 6px 9px; opacity: .55; }
.bulkrow > input[type="number"].on { opacity: 1; border-color: var(--brand); background: #16212e; }
.bulkunit { flex: 0 0 auto; }
.bulkscope { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.bulkscope label { display: flex; align-items: center; gap: 8px; color: #cfdcee; }

/* ---------- 机票借位：一家一行，可以加几家 ---------- */
.borrow-line { margin-bottom: 8px; }
.borrow-note { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.borrow-note > input { flex: 1 1 auto; min-width: 0; }

/* ---------- 可搜索下拉（留位选公司） ---------- */
.combo { position: relative; margin-top: 4px; }
.combo > input { width: 100%; padding-right: 26px; }
.combo-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; font-size: 12px; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  max-height: 260px; overflow-y: auto; background: #131f2d; border: 1px solid #2c405a;
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.45); padding: 4px; }
.combo-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #cfdcee; }
.combo-item:hover, .combo-item.hot { background: var(--brand); color: #fff; }
.combo-item .ci-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item .ci-type { flex: 0 0 auto; font-size: 11px; opacity: .85; }
.combo-item .ci-sub { flex: 0 0 auto; font-size: 11px; opacity: .75; }
.combo-empty { padding: 10px; font-size: 12px; color: var(--muted); }

/* ---------- 必填但还没填：标红 ---------- */.needfill { border-color: var(--red) !important; background: #2a1116 !important; box-shadow: 0 0 0 2px rgba(255,80,100,.15); }

/* ---------- 切位日期分段 + 每段价格 ---------- */
.daterow { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; }
.daterow-main { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; flex: 1 1 auto; }
.daterow-del { flex: 0 0 auto; }
.rangesel { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.rangesel > input[type="date"] { width: 160px; }
.wdchips { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.wdchip { width: 32px; height: 30px; border-radius: 8px; cursor: pointer;
  background: #0f1926; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.wdchip:hover { border-color: #3b4a61; color: #cfdcee; }
.wdchip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.wdall { margin-left: 4px; }
.paste-mini { flex: 1 1 260px; max-width: 420px; font-size: 13px; padding: 6px 10px; }
.pricecard { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pricecard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pricerow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.pricerow:last-child { margin-bottom: 0; }
.pricerow .field > input { width: 100%; }
.pricerow.calc { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  background: #0f1926; border: 1px dashed var(--line); border-radius: 8px; padding: 7px 10px; }
.pricerow.calc b { color: #cfe0f5; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .pricerow { grid-template-columns: 1fr 1fr; } }

/* ---------- 表单草稿提示条 ---------- */
.draftbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: #ffd9a0; background: #2a2012; border: 1px solid #6b5320;
  border-left: 3px solid var(--orange); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.draftbar .spacer { flex: 1; }

/* ---------- 时间下拉（小时 : 分钟） ---------- */
.timesel { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; width: 100%; }
.timesel > select { flex: 1 1 0; min-width: 0; font-variant-numeric: tabular-nums; }
.timesep { color: var(--muted); font-weight: 700; flex: 0 0 auto; }

/* ---------- 留位弹窗：按行排版（两列 / 三列） ---------- */
.hrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.hrow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.hrow4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.hrow-time { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.hrow-time .seg { flex: 0 0 auto; }
.hrow-time .in-hours { width: 110px; }
.hrow-time #h_untilWrap { gap: 8px; }
.hrow-time #h_untilWrap > input { width: 150px; font-size: 14px; padding: 7px 9px; }
/* 留票时限只有「哪天 + 几点」两格，排一行 */
.hrow-time.dl-one { display: grid; grid-template-columns: 200px 250px; gap: 10px; align-items: center; }
.hrow-time.dl-one > input { width: 100%; font-size: 14px; padding: 7px 9px; }
.hrow-time.dl-one .timesel { width: 100%; margin-top: 0; }
@media (max-width: 640px) {
  .hrow2, .hrow3, .hrow4 { grid-template-columns: 1fr; }
}
h4.sec { margin: 20px 0 10px; padding-bottom: 6px; font-size: 13px; color: #cfe0f5;
  border-bottom: 1px dashed var(--line); font-weight: 600; }
h4.sec:first-child { margin-top: 0; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hint.warn { color: var(--orange); }
.hint.err { color: var(--red); }

/* ---------- 提示条 ---------- */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  padding: 10px 14px; border-radius: 8px; font-size: 13px; max-width: 460px; box-shadow: 0 10px 30px #0009;
  animation: slidein .18s ease; white-space: pre-wrap; }
.toast.err { border-left-color: var(--red); color: #ffb3b4; }
.toast.ok { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------- 主推产品卡片 ---------- */
.pitch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.pitch { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pitch .top { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 6px; }
.pitch .route { font-weight: 700; font-size: 14px; }
.pitch .meta { font-size: 12px; color: var(--muted); line-height: 1.7; }
.pitch .quote { background: #0d141f; border: 1px dashed var(--line); border-radius: 8px; padding: 8px;
  font-size: 12px; margin: 8px 0; color: #b9c8dd; white-space: pre-wrap; }

/* ---------- 危险度热力 ---------- */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }.heat .cell { border-radius: 8px; padding: 7px 8px; font-size: 11px; border: 1px solid transparent; }
.heat .cell .d { font-weight: 700; font-size: 12px; }
.heat .cell.green { background: #10281a; border-color: #1d5535; }
.heat .cell.yellow { background: #302a0c; border-color: #65571a; }
.heat .cell.red { background: #3a1618; border-color: #6d2629; }
.heat .cell.black { background: #4a0f12; border-color: #8c1a1f; }
.heat .cell.dead { background: #1a1a1a; border-color: #333; opacity: .6; }

/* ---------- 出票表：给航司的列 vs 内部列 ---------- */
th.internal, td.internal { background: #10161f; }
th.internal { color: #6b7c94; }
td.internal { border-left: 1px dashed #243044; }

/* ---------- 小工具 ---------- */
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt4 { margin-top: 4px; }
.mb8 { margin-bottom: 8px; }
.nowrap { white-space: nowrap; }
.dim { opacity: .6; }
.tag { font-size: 11px; background: #232f3f; color: var(--muted); border-radius: 5px; padding: 1px 6px; }
kbd { background: #0d141f; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 11px; }

@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex: none; }
  .sidebar .brand { padding: 12px 14px 8px; border-bottom: none; }
  .tabs { flex-direction: row; overflow-x: auto; padding: 0 12px 10px; gap: 6px; }
  .tab { width: auto; white-space: nowrap; padding: 8px 12px; }
  .tab .ico { display: none; }
  .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between;
    padding: 8px 14px; border-top: 1px solid var(--line); }
  .sidebar-foot .btn { width: auto !important; flex: none; }
  main { padding: 12px; }
}

/* 出确认单：选收款账户（一行一家，紧凑） */
.acclist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.accrow { display: grid; grid-template-columns: 20px minmax(0, 1.5fr) 168px minmax(0, 1fr);
  align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.accrow + .accrow { border-top: 1px solid var(--line); }
.accrow:hover { background: #17222f; }
.accrow input { margin: 0; accent-color: var(--brand); }
.accname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accno { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.accbank { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accrow input:checked ~ .accname { color: var(--brand); }
/* ---------- 售卖数据：留位/确认 的每日·每周·每月·总票统计 ---------- */

/* ---------- 售卖数据：留位/确认 的每日·每周·每月·总票统计 ---------- */
.pwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .pwrap { grid-template-columns: 1fr; } }
.pblock { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #0f1724; min-width: 0; overflow: hidden; }
.pblock h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pblock h4 .kpis { display: flex; gap: 10px; flex-wrap: wrap; }
/* 表格在上、两个排行在下，全部单列排列，避免窄屏挤爆 */
.pblock .pgrid { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.pblock table.mini { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.pblock table.mini col.c-when { width: 40%; }
.pblock table.mini th, .pblock table.mini td { padding: 3px 6px; border-bottom: 1px solid #1b2432; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pblock table.mini th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: left; }
.pblock table.mini th.num, .pblock table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pblock table.mini tr.dim td { color: #55637a; }
.pblock .pranks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.pblock .pranks > div { min-width: 0; overflow: hidden; }
.pblock .pranks .ph { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.pblock .rankrow { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 2px 0; min-width: 0; }
.pblock .rankrow .idx { color: var(--muted); width: 12px; flex: none; }
.pblock .rankrow .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pblock .rankrow b { font-variant-numeric: tabular-nums; flex: none; }
/* 趋势图 + C端/B端 */
.trendsvg { width: 100%; height: auto; display: block; margin-bottom: 10px; background: #0f1724; border: 1px solid var(--line); border-radius: var(--radius); }
.cbgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .cbgrid { grid-template-columns: 1fr; } }
.cbgrid > div { min-width: 0; }
.cbtbl { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.cbtbl th, .cbtbl td { padding: 4px 6px; border-bottom: 1px solid #1b2432; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbtbl th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: right; }
.cbtbl th:first-child { text-align: left; }
.cbtbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cbgrid .pranks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.cbgrid .pranks > div { min-width: 0; overflow: hidden; }
.cbgrid .ph { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.cbgrid .rankrow { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 2px 0; min-width: 0; }
.cbgrid .rankrow .idx { color: var(--muted); width: 12px; flex: none; }
.cbgrid .rankrow .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbgrid .rankrow b { flex: none; font-variant-numeric: tabular-nums; }
/* C端/B端 那两行 + 四个排行 */
.pblock table.mini tr.cbsplit td { border-top: 2px solid #24314a; background: #0c1420; }
.pblock table.mini tr.cbsplit .tag { font-size: 10px; padding: 1px 5px; border-radius: 6px; }
.pblock table.mini tr.cbsplit .tag.c { background: #12325a; color: #8dbcff; }
.pblock table.mini tr.cbsplit .tag.b { background: #3a2a12; color: #f0a04b; }
.pblock .pranks { grid-template-columns: 1fr 1fr; }
/* 每个周期一行汇总：B端 / C端 / 总 × 留位·确认·转化 */
.pblock table.sxtbl { width: 100%; table-layout: fixed; border-collapse: collapse; }
.pblock table.sxtbl th { font-size: 10px; color: var(--muted); font-weight: 600; text-align: right; padding: 2px 3px; white-space: nowrap; }
.pblock table.sxtbl td { font-size: 13px; text-align: right; padding: 6px 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pblock table.sxtbl td.strong, .pblock table.sxtbl th.strong { color: #e8eefb; font-weight: 700; }
.pblock table.sxtbl .sep { border-left: 1px solid #24314a; }
.pblock table.sxtbl td.bcol { color: #f0a04b; }
.pblock table.sxtbl td.ccol { color: #8dbcff; }
.pblock .pranks { margin-top: 8px; }
/* 每个时间段一行：日期 | B/C/总 留位 | B/C/总 确认 | B/C/总 转化 */
.pblock table.sxtbl col.c-when { width: 15%; }
.pblock table.sxtbl th:first-child, .pblock table.sxtbl td:first-child { text-align: left; }
.pblock table.sxtbl tfoot td { border-top: 2px solid #24314a; background: #0c1420; }
.pblock table.sxtbl tr.sumrow td { font-weight: 700; }
/* 排行：全部列出来，超长就内部滚动 */
.pblock .pranks { grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 8px; }
.pblock .rankbox { max-height: 132px; overflow-y: auto; padding-right: 4px; }
.pblock .rankbox::-webkit-scrollbar { width: 6px; }
.pblock .rankbox::-webkit-scrollbar-thumb { background: #2a3648; border-radius: 3px; }
/* 排行六宫格：留位/确认 总 · B端 · C端，各两列三行 */
.pblock .pranks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 8px; align-items: start; }
.pblock .pranks > div { min-width: 0; overflow: hidden; }
.pblock .pranks .ph { font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 留位/确认统计：左边四个块上下排，右边图表 */
.statwrap { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1320px) { .statwrap { grid-template-columns: 1fr; } }
.statleft { display: grid; grid-template-columns: 1fr; gap: 14px; min-width: 0; }
.statright { display: grid; grid-template-columns: 1fr; gap: 12px; min-width: 0; position: sticky; top: 12px; }
@media (max-width: 1320px) { .statright { position: static; } }
.chartbox { border: 1px solid var(--line); border-radius: var(--radius); background: #0f1724; padding: 8px 10px 10px; min-width: 0; }
.chartbox .ch { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.chartbox .trendsvg { border: 0; margin: 0; background: transparent; }
.sharewrap { padding: 6px 2px 2px; }
.sharebar { display: grid; grid-template-columns: 32px 1fr 48px 52px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.sharebar .lbl { color: var(--muted); }
.sharebar .track { height: 10px; background: #16202e; border-radius: 5px; overflow: hidden; display: block; }
.sharebar .track i { display: block; height: 100%; border-radius: 5px; }
.sharebar .track i.fillc { background: #4d9bff; }
.sharebar .track i.fillb { background: #f0a04b; }
.sharebar b { text-align: right; font-variant-numeric: tabular-nums; }
.sharebar .muted { text-align: right; }
/* 留位/确认统计：左右按行配对，图表顶部与左边表格顶部对齐 */
.statgrid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px 16px; align-items: start; }
@media (max-width: 1320px) { .statgrid { grid-template-columns: 1fr; } }
.statgrid > .chartbox { position: sticky; top: 12px; }
@media (max-width: 1320px) { .statgrid > .chartbox { position: static; } }
/* 趋势图图例：线=留位，方块=确认 */
.chlegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 11px; color: #b9c6d8; margin-bottom: 6px; }
.chlegend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.chlegend span.sep { color: #33405a; }
.chlegend i.ln { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.chlegend i.sq { display: inline-block; width: 7px; height: 10px; border-radius: 1.5px; border: 1px solid currentColor; }
