/* 车队系统样式 — 淡绿主题（spec090，与仓库系统统一） */
:root {
  --bg: #f0f7f0;
  --card-bg: #ffffff;
  --primary: #2e7d32;
  --primary-dark: #256528;
  --primary-light: #e8f5e9;
  --accent: #4caf50;
  --text: #1b2e1b;
  --muted: #6b8a6b;
  --border: #d5e8d4;
  --due: #d32f2f;
  --soon: #f9a825;
  --ok: #2e7d32;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
.hidden { display: none !important; }
.err { color: var(--due); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* 登录 */
.page { min-height: 100vh; }
.login-box { max-width: 360px; margin: 16vh auto; padding: 28px 20px; background: var(--card-bg); border-radius: 14px; box-shadow: 0 6px 24px rgba(46,125,50,.12); text-align: center; }
.login-box h1 { font-size: 22px; margin-bottom: 22px; color: var(--primary); }
.login-box input { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; min-height: 48px; }
.btn-primary { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; min-height: 48px; }
.btn-primary:active { background: var(--primary-dark); }

/* 顶栏 */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar .title { font-weight: 600; font-size: 17px; flex: 1; }
.user-info { font-size: 13px; opacity: .9; }
.btn-text { background: none; border: none; color: #fff; font-size: 14px; cursor: pointer; min-height: 40px; }

/* tabs */
.tabs { display: flex; overflow-x: auto; background: var(--card-bg); border-bottom: 1px solid var(--border); position: sticky; top: 53px; z-index: 9; -webkit-overflow-scrolling: touch; }
.tab { padding: 16px 14px; white-space: nowrap; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; min-height: 56px; display: flex; align-items: center; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.content { padding: 12px; padding-bottom: 40px; max-width: 1100px; margin: 0 auto; }
.card { background: var(--card-bg); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(46,125,50,.06); border: 1px solid var(--border); }
.card h3 { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.tag.due { background: #fdecea; color: var(--due); }
.tag.soon { background: #fff4e5; color: var(--soon); }
.tag.ok { background: var(--primary-light); color: var(--ok); }
.tag.unknown { background: #f0f0f0; color: #888; }
.tag.info { background: var(--primary-light); color: var(--primary); }
.tag.muted { background: #f0f0f0; color: #888; }

/* 配置中心：线路勾选 + 补贴行 */
.chk-box { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; max-height: 200px; overflow-y: auto; }
.chk-line { display: flex; align-items: center; gap: 8px; padding: 9px 2px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.chk-line:last-child { border-bottom: none; }
.chk-line input { width: 20px; height: 20px; }
.chk-line span { flex: 1; }
.sub-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.sub-row .sub-type { flex: 1; }
.sub-row .sub-amount { width: 110px; }
.sub-row .btn { width: 44px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary-light); color: var(--primary); font-weight: 600; }
tr:active { background: var(--bg); }

input, select, textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; width: 100%; min-height: 44px; background: #fff; color: var(--text); }
input[type=number] { width: 110px; }
input[type=date] { min-height: 44px; }
label { font-size: 13px; color: var(--muted); display: block; margin: 6px 0 3px; }
.btn { padding: 10px 16px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; background: var(--primary-light); color: var(--primary); min-height: 44px; }
.btn:active { background: #d4ead4; }
.btn.blue { background: var(--primary); color: #fff; }
.btn.blue:active { background: var(--primary-dark); }
.btn.green { background: var(--accent); color: #fff; }
.btn.red { background: var(--due); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 13px; min-height: 38px; }
.btn[disabled] { opacity: .5; }

.subtabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.subtab { padding: 8px 14px; border-radius: 18px; background: var(--primary-light); font-size: 13px; color: var(--primary); cursor: pointer; min-height: 38px; display: flex; align-items: center; }
.subtab.active { background: var(--primary); color: #fff; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-box { background: var(--card-bg); width: 100%; max-width: min(92vw, 480px); max-height: 88vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 16px; }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; padding: 14px; min-height: 48px; font-size: 15px; }

/* 待办横幅 */
.todo { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 8px; margin-bottom: 8px; gap: 8px; }
.todo.due { background: #fdecea; }
.todo.soon { background: #fff4e5; }
.todo.info { background: var(--primary-light); }
.todo .muted { font-size: 12px; word-break: break-all; }

/* 工资明细项 */
.item-line { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.item-line input { flex: 1; }
.item-line .kind { width: 60px; }
.item-line .amt { width: 100px; }
.item-line .del { width: 44px; color: var(--due); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 200; max-width: 90vw; text-align: center; }

.empty { text-align: center; color: #aaa; padding: 30px; }
.fab { position: fixed; right: 16px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 26px; box-shadow: 0 4px 12px rgba(46,125,50,.4); cursor: pointer; z-index: 8; }

/* ── 移动端 / 平板适配（spec090） ── */
@media (max-width: 768px) {
  html { font-size: 17px; }
  .content { padding: 10px; padding-bottom: 80px; }
  .topbar .title { font-size: 16px; }
  .tab { padding: 14px 12px; font-size: 14px; }
  .btn { min-height: 48px; }
  .btn.sm { min-height: 42px; }
  input, select, textarea { min-height: 48px; font-size: 16px; } /* 16px 防 iOS 缩放 */

  /* 表格 → 卡片式：每个 thead 隐藏，每行变卡片，单元格按 data-label 展示 */
  table { font-size: 14px; }
  thead { display: none; }
  tbody tr { display: block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(46,125,50,.05); }
  tbody td { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px dashed var(--border); padding: 8px 2px; text-align: right; }
  tbody td:last-child { border-bottom: none; }
  /* 无 data-label 的单元格退化为纯内容 */
  tbody td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: 0 0 auto; }
  /* 保留行内按钮的宽度 */
  tbody td .btn { min-height: 40px; }
}
