:root {
  --primary: #1463f3;
  --primary-dark: #1250cc;
  --primary-soft: #deebff;
  --bg: #f0f5ff;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #637894;
  --border: #dbe5f5;
  --green: #079b50;
  --green-soft: #dcf7e8;
  --red: #ed354f;
  --red-soft: #ffe2e7;
  --orange: #c77408;
  --orange-soft: #fff0cf;
  --shadow: 0 3px 10px rgba(30, 83, 165, 0.065);
  --shadow-lg: 0 8px 30px rgba(28, 50, 92, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 58px;
  --topbar-h: 52px;
  --maxw: 480px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #e6eaf1; color: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.ui-icon { display: block; width: 24px; height: 24px; flex: none; }
input, select, textarea { font-family: inherit; }

/* 手机外框：在大屏上居中显示为手机，在手机上铺满 */
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; background: var(--bg);
  position: relative; box-shadow: 0 0 40px rgba(0,0,0,.12); overflow: hidden; }
@media (max-width: 520px) { #app { box-shadow: none; } }

/* ---------- 登录/注册 ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, #1d6fe0 0%, #0a3d8f 100%); padding: 28px 22px; }
.auth-logo { text-align: center; color: #fff; margin-bottom: 26px; }
.auth-logo .big { font-size: 23px; font-weight: 700; }
.auth-logo .small { font-size: 13px; opacity: .85; margin-top: 8px; }
.auth-card { background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2); padding: 24px 20px; }
.auth-title { text-align: center; font-size: 21px; font-weight: 700; color: var(--text); }
.auth-subtitle { text-align: center; font-size: 13px; color: var(--muted); margin: 7px 0 22px; }
.auth-actions { display: flex; justify-content: flex-end; margin: -5px 0 14px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13px; margin-top: 17px; }
.text-btn { padding: 0; border: 0; background: none; color: var(--primary); font-size: inherit; cursor: pointer; }
.register-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.register-type { min-width: 0; padding: 13px 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); color: var(--text); }
.register-type b, .register-type span { display: block; }
.register-type b { font-size: 14px; margin-bottom: 5px; }
.register-type span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.register-type.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.register-type.active b { color: var(--primary); }
.auth-tabs { display: flex; margin-bottom: 18px; background: #f2f4f8; border-radius: 10px; padding: 4px; }
.auth-tabs button { flex: 1; background: none; border: none; padding: 9px; font-size: 15px;
  color: var(--muted); border-radius: 7px; }
.auth-tabs button.active { color: var(--primary); background: #fff; font-weight: 600; box-shadow: var(--shadow); }
.demo-tip { background: var(--primary-soft); border-radius: 10px; padding: 11px 13px; font-size: 13px; color: #2a5db0; margin-top: 14px; line-height: 1.7; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
.field label .req { color: var(--red); }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 72px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a0b3' fill='none' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.btn { background: var(--primary); color: #fff; border: none; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; transition: transform .12s, box-shadow .15s, opacity .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 2px 8px rgba(37,99,235,.22); }
.btn:active { transform: scale(.975); opacity: .92; }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; box-shadow: none; font-weight: 500; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: none; font-weight: 500; }
.btn-ghost:active { background: #f5f7fb; }
.btn-danger { background: var(--red); box-shadow: 0 2px 8px rgba(239,71,89,.22); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border: 1px solid var(--border); border-radius: 18px; font-size: 14px;
  background: #fff; user-select: none; transition: all .12s; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.2); }

/* ---------- 顶栏 + 内容 + 底部 Tab ---------- */
.topbar { height: var(--topbar-h); background: linear-gradient(120deg, #2f6df2, #1d4ed8); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(29,78,216,.18); }
.topbar h2 { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.topbar .left { display: flex; align-items: center; gap: 8px; }
.topbar .back { font-size: 28px; line-height: 1; background: none; border: none; color: #fff; padding: 0 6px 2px 0; cursor: pointer; }
.topbar .back:active { opacity: .6; }
.topbar .bell { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; background: none; border: 0; color: inherit; }
.topbar .bell:active { background: var(--primary-soft); }
.topbar .bell .badge { position: absolute; top: -6px; right: -8px; background: #ff4d4f; color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; text-align: center; line-height: 16px; padding: 0 3px; }

.content { padding: 16px; padding-bottom: calc(var(--tabbar-h) + 24px); min-height: calc(100vh - var(--topbar-h)); }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--maxw);
  height: var(--tabbar-h); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex;
  z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 11px; transition: color .15s; }
.tabbar a .ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 28px; border-radius: 10px; transition: background .15s; }
.tabbar a .ui-icon { width: 23px; height: 23px; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar a.active .ico { background: var(--primary-soft); }
.tabbar a:focus-visible, .menu-item:focus-visible, .bell:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }

/* ---------- 卡片/统计 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 15px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat .value { font-size: 22px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat .value.green { color: var(--green); } .stat .value.red { color: var(--red); }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat.span2 { grid-column: span 2; }
.stat.hero { background: linear-gradient(125deg, #2f6df2 0%, #1d4ed8 100%); color: #fff; box-shadow: 0 8px 24px rgba(29,78,216,.28); }
.stat.hero .label, .stat.hero .sub { color: rgba(255,255,255,.82); }
.stat.hero .value { color: #fff; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 15px; overflow: hidden; }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-body { padding: 15px 16px; }

.list-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px; margin-bottom: 11px; transition: transform .12s, box-shadow .15s, background .12s; }
.list-card:active { background: #fbfcff; }
.lc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lc-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.lc-sub { color: var(--muted); font-size: 13px; line-height: 1.65; }
.lc-metrics { display: flex; gap: 9px; margin-top: 13px; }
.lc-metrics > div { flex: 1; background: var(--bg); border-radius: 11px; padding: 10px 9px; text-align: center; }
.lc-metrics .m-label { font-size: 11px; color: var(--muted); }
.lc-metrics .m-value { font-size: 15px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.lc-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.lc-row .k { color: var(--muted); }

.tag { display: inline-block; padding: 2.5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.orange { background: var(--orange-soft); color: #d98307; }
.tag.gray { background: #eef1f6; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.green-t { color: var(--green); } .red-t { color: var(--red); }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar input, .toolbar select { padding: 9px 11px; font-size: 14px; }
.toolbar .grow { flex: 1; }

/* 小表格（弹层内，可横向滚动） */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfd; font-size: 12px; }

/* ---------- 全屏弹层（底部上滑 / 全屏） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal { background: var(--card); width: 100%; max-width: var(--maxw); border-radius: 22px 22px 0 0;
  max-height: 93vh; display: flex; flex-direction: column; animation: sheetup .28s cubic-bezier(.22,.9,.3,1); box-shadow: var(--shadow-lg); }
@keyframes sheetup { from { transform: translateY(100%); } }
.modal-head { padding: 18px 18px 13px; background: var(--card); border-bottom: 1px solid var(--border); display: flex;
  justify-content: space-between; align-items: center; position: relative; flex-shrink: 0; border-radius: 22px 22px 0 0; }
.modal-head::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px; background: #dde3ec; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .close { background: none; border: none; font-size: 25px; color: var(--muted); line-height: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border);
  display: flex; gap: 10px; flex-shrink: 0; }
.modal-foot .btn { flex: 1; }
.grid2, .grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-classify-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.project-classify-grid .field { min-width: 0; }
.project-classify-grid select { min-width: 0; padding-left: 9px; padding-right: 24px; font-size: 13px; background-position: right 8px center; }
.worker-basic-row { display: grid; grid-template-columns: 1.05fr .7fr 1.45fr; gap: 10px; }
.worker-basic-row .field { min-width: 0; }
.worker-basic-row input, .worker-basic-row select { padding-left: 9px; padding-right: 9px; }
.worker-insurance-row { display: grid; grid-template-columns: 1fr 1.15fr 1.15fr; gap: 10px; }
.worker-insurance-row .field { min-width: 0; }
.worker-insurance-row input, .worker-insurance-row select { padding-left: 8px; padding-right: 8px; }
.worker-work-row { display: grid; grid-template-columns: .8fr 1fr 1.2fr; gap: 10px; }
.worker-work-row .field { min-width: 0; }
.worker-work-row input, .worker-work-row select { padding-left: 8px; padding-right: 8px; }
.multi-select { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.multi-select summary { padding: 12px; font-size: 15px; cursor: pointer; list-style-position: inside; }
.multi-select > div { padding: 4px 12px 10px; border-top: 1px solid var(--border); }
.multi-select label { display: flex; align-items: center; gap: 9px; padding: 8px 0; margin: 0; color: var(--text); font-size: 14px; }
.multi-select input[type="checkbox"] { width: 18px; height: 18px; padding: 0; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 20px 0 11px;
  padding-left: 11px; position: relative; display: flex; justify-content: space-between; align-items: center; }
.section-title::before { content: ''; position: absolute; left: 0; top: 1px; bottom: 1px; width: 3.5px; border-radius: 3px; background: var(--primary); }
.section-title:first-child { margin-top: 0; }
.section-select { width: auto; min-width: 92px; padding: 6px 28px 6px 9px; border-radius: 9px; font-size: 11px; font-weight: 500; background-color: #fff; }
.chart-card .bar-n { min-width: 68px; text-align: right; white-space: nowrap; }
.rank-no { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; margin-right:7px; border-radius:7px; background:var(--primary-soft); color:var(--primary); font-size:11px; font-weight:800; vertical-align:middle; }
.rank-no.risk { background:#fff0ee; color:var(--red); }
.filter-row.expense-filter-row { display: grid; grid-template-columns: 1fr 1fr 1.22fr 1fr; gap: 10px; overflow: visible; padding-bottom: 4px; }
.expense-filter-row .fchip { width: 100%; min-width: 0; max-width: none; margin: 0; padding-left: 16px; padding-right: 32px; font-size: 14px; box-shadow: 0 3px 12px rgba(30, 65, 110, .05); }
.filter-row.income-filter-row { display: grid; grid-template-columns: 1fr 1fr 1.22fr 1.22fr; gap: 10px; overflow: visible; padding-bottom: 4px; }
.income-filter-row .fchip { width: 100%; min-width: 0; max-width: none; margin: 0; padding-left: 16px; padding-right: 32px; font-size: 14px; box-shadow: 0 3px 12px rgba(30, 65, 110, .05); }
.income-progress { height: 6px; margin-top: 10px; border-radius: 6px; overflow: hidden; background: #edf1f6; }
.income-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #18a058, #34c873); }
@media (max-width: 680px) { .filter-row.expense-filter-row, .filter-row.income-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .expense-filter-row .fchip, .income-filter-row .fchip { padding-left: 13px; font-size: 13px; } }
.dash-filter-card { margin-bottom: 12px; padding: 14px; border: 1px solid #dce8fb; border-radius: 14px; background: linear-gradient(135deg, #f8fbff 0%, #f3f7ff 100%); box-shadow: 0 5px 18px rgba(28, 82, 151, .07); }
.dash-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-filter-head b { display: block; font-size: 14px; color: var(--text); }
.dash-filter-head div > span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.dash-filter-scope { flex: none; max-width: 55%; padding: 5px 9px; border-radius: 999px; background: #e7f0ff; color: var(--primary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-filter-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 9px; }
.dash-filter-grid .field { min-width: 0; margin: 0; }
.dash-filter-grid select, .dash-filter-grid input { background-color: #fff; }
.dash-filter-hint { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #d5e1f2; color: var(--muted); font-size: 11px; }
@media (max-width: 560px) { .dash-filter-grid { grid-template-columns: 1fr 1fr; } .dash-filter-grid .field:first-child { grid-column: 1 / -1; } .dash-filter-head { align-items: flex-start; } }
.cash-flow-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin-top: 11px; }
.cash-flow-col { min-width: 0; padding: 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.cash-flow-title { margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.cash-flow-metrics { display: grid; }
.cash-flow-metrics > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.cash-flow-metrics span { color: #64748b; font-size: 12px; }
.cash-flow-metrics b { min-width: 0; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cash-flow-metrics > div:last-child { margin-top: 4px; padding: 9px 8px; border: 0; border-radius: 8px; background: #fff5f3; }
.cash-flow-metrics > div:last-child span { color: var(--text); font-weight: 600; }
.reconcile-card { margin-top: 10px; border-left: 3px solid var(--green); box-shadow: none; background: #f3fbf6; }

.item-row { display: grid; gap: 6px; align-items: center; margin-bottom: 8px; }
.item-row.labor { grid-template-columns: 1.6fr 1fr 1fr 24px; }
.item-row input { padding: 8px 9px; font-size: 13px; }
.item-row .del { background: none; border: none; color: var(--red); font-size: 20px; }
.item-row .total { display: none; }

/* 采购单材料行 */
.po-item { display: grid; grid-template-columns: 1.4fr 1.1fr 0.8fr 0.7fr 0.9fr 22px; gap: 5px; align-items: center; margin-bottom: 7px; }
.po-item input { padding: 8px 7px; font-size: 13px; }
.po-item .del { background: none; border: none; color: var(--red); font-size: 19px; cursor: pointer; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; line-height: 1.7; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,.94);
  color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 1000; max-width: 90%; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); animation: slidein .2s; font-size: 14px; font-weight: 500; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }
@keyframes slidein { from { opacity: 0; transform: translate(-50%, -10px); } }

.uploader { border: 1.5px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center;
  color: var(--muted); font-size: 14px; }
.uploader:active { border-color: var(--primary); color: var(--primary); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs .th { position: relative; width: 70px; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th .x { position: absolute; top: 0; right: 0; background: rgba(0,0,0,.55); color: #fff;
  width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 13px; }

/* 悬浮主操作按钮 */
.fab { position: fixed; bottom: calc(var(--tabbar-h) + 16px); right: 0; z-index: 40;
  width: 100%; max-width: var(--maxw); pointer-events: none; }
.fab .fab-btn { position: absolute; right: 16px; pointer-events: auto; background: var(--primary); color: #fff;
  border: none; border-radius: 28px; height: 50px; padding: 0 22px; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(37,99,235,.42); display: flex; align-items: center; gap: 6px; }

/* 提醒下拉 */
.reminders { position: absolute; top: var(--topbar-h); right: 0; left: 0; max-width: var(--maxw); margin: 0 auto;
  background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 50; max-height: 60vh; overflow-y: auto; border-radius: 0 0 14px 14px; }
.reminders .r { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; gap: 10px; }
.reminders .r .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.reminder-heading, .reminder-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reminder-heading { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.reminder-heading span, .reminder-read-state { font-size: 11px; color: #64748b; }
.reminder-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reminder-title { margin-bottom: 4px; }
.reminder-read-state { flex: none; }
.reminder-read-state.is-unread { color: var(--primary); font-weight: 600; }
.dot.danger { background: var(--red); } .dot.warn { background: var(--orange); } .dot.info { background: var(--primary); }

/* 更多/我的 页 */
.menu-group { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 15px; transition: background .12s; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-item .ico { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.menu-item .ico .ui-icon { width: 21px; height: 21px; }
.menu-item .arrow { display: flex; margin-left: auto; color: #aab6c6; }
.menu-item .arrow .ui-icon { width: 16px; height: 16px; }
.menu-item#logout .ico { color: #dc5262; background: #fff1f2; }
.menu-cat { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 6px 4px 9px; letter-spacing: .4px; }
.menu-cat .ui-icon { width: 16px; height: 16px; }
.menu-item .m-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; padding: 0 5px; }
.menu-item .m-badge + .arrow { margin-left: 8px; }
.profile-head { background: linear-gradient(125deg, #2f6df2, #1d4ed8); color: #fff; border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; position: relative; box-shadow: 0 8px 24px rgba(29,78,216,.26); }
.profile-head .prof-avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; overflow: hidden; }
.profile-head .prof-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head .prof-info { flex: 1; min-width: 0; }
.profile-head .prof-edit { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 4px; font-size: 12px; opacity: .85; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 10px; }
.profile-head .prof-edit .ui-icon { width: 13px; height: 13px; }
.profile-head .name { font-size: 19px; font-weight: 700; }
.profile-head .meta { opacity: .85; font-size: 13px; margin-top: 5px; }

/* 日历 */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head > b, .cal-head > button:nth-child(2) { min-width: 0; text-align: center; }
.cal-head > button:first-child, .cal-head > button:last-child { flex: 0 0 auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.cal-cell { min-width: 0; aspect-ratio: 1; border-radius: 9px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 14px; background: #f5f7fa; color: var(--text); }
.cal-cell.cal-empty { background: transparent; padding: 0; }
.cal-cell.has { background: #e8f1fd; color: var(--primary); font-weight: 600; cursor: pointer; }
.cal-cell.has:active { background: #d6e6fb; }
.cal-cell.sel { background: var(--primary); color: #fff; }
.cal-cell .badge2 { font-size: 9px; font-weight: 500; margin-top: 1px; line-height: 1; }
/* 紧凑日历 */
.cal-sm .cal-grid { gap: 3px; }
.cal-sm .cal-cell { aspect-ratio: auto; height: 34px; font-size: 12px; border-radius: 6px; }
.cal-sm .cal-cell .badge2 { font-size: 8px; }
.cal-sm .cal-wd { font-size: 10px; padding: 0; }
.cal-sm .cal-head { margin-bottom: 6px; }
.cal-toggle { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; }
.cal-toggle:active { background: #fafbfd; }

/* 手写签名板 */
.sig-canvas { width: 100%; height: 130px; border: 1px dashed #c4cdde; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.quote-settings-card { margin:12px 0 10px; padding:14px; border:1px solid #dbe6f5; border-radius:16px; background:linear-gradient(145deg,#f8fbff 0%,#fff 72%); box-shadow:0 5px 18px rgba(39,82,138,.06); }
.quote-settings-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:13px; }
.quote-settings-head > div { display:flex; align-items:baseline; gap:8px; }
.quote-settings-head b { font-size:15px; color:var(--text); }
.quote-settings-head span { font-size:11px; color:var(--muted); }
.quote-settings-head .quote-private-badge { flex:none; padding:3px 8px; border-radius:20px; color:#52719d; background:#eaf2fd; }
.quote-settings-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quote-setting-item { min-width:0; padding:11px; border:1px solid #e5ebf4; border-radius:12px; background:#fff; }
.quote-setting-item > label { display:block; margin-bottom:7px; color:#445269; font-size:12px; font-weight:600; }
.quote-setting-item small { display:block; margin-top:6px; color:#98a4b7; font-size:10px; }
.percent-input { height:42px; display:flex; align-items:center; overflow:hidden; border:1px solid #d9e1ed; border-radius:10px; background:#f9fbfd; }
.percent-input:focus-within { border-color:var(--primary); box-shadow:0 0 0 3px rgba(21,89,184,.09); background:#fff; }
.percent-input span,.percent-input b { flex:none; color:#708099; font-size:14px; }
.percent-input span { padding-left:12px; }
.percent-input b { padding-right:12px; }
.percent-input input { min-width:0; height:40px; padding:0 7px; border:0; outline:0; box-shadow:none; background:transparent; text-align:center; font-size:16px; font-weight:700; }
.quote-tax-control { min-height:42px; display:flex; align-items:center; gap:10px; }
.switch-control { display:flex; align-items:center; gap:7px; white-space:nowrap; cursor:pointer; }
.switch-control input { position:absolute; opacity:0; pointer-events:none; }
.switch-track { position:relative; width:38px; height:22px; border-radius:20px; background:#cbd4e1; transition:.2s; }
.switch-track::after { content:""; position:absolute; width:18px; height:18px; left:2px; top:2px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.22); transition:.2s; }
.switch-control input:checked + .switch-track { background:var(--primary); }
.switch-control input:checked + .switch-track::after { transform:translateX(16px); }
.switch-control b { color:#445269; font-size:13px; }
.quote-tax-control select { min-width:92px; height:42px; padding:8px 27px 8px 10px; border-radius:10px; }
.quote-apply-btn { width:100%; margin-top:12px; height:42px; border-radius:11px; }
.quote-settings-note { margin-top:10px; padding-top:10px; border-top:1px dashed #dfe6f0; color:#8491a5; font-size:11px; line-height:1.5; }
@media (max-width:560px) { .quote-settings-card { padding:12px; } .quote-settings-row { grid-template-columns:1fr 1fr; gap:8px; } .quote-setting-item { padding:9px; } .quote-tax-control { align-items:flex-start; flex-direction:column; gap:5px; } .quote-tax-control select { width:100%; height:36px; } .quote-settings-head > div span { display:none; } }
.draft-notice { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; margin-bottom:10px; border-radius:10px; background:var(--primary-soft); color:var(--primary); font-size:12px; }
.draft-notice button { border:0; background:transparent; color:var(--red); white-space:nowrap; font-size:12px; cursor:pointer; }

/* 工资支付日历状态 */
.cal-cell.wp-paid { background: #e7f6ec; color: #1a8a4a; cursor: default; }
.cal-cell.wp-unpaid { background: #fff1e2; color: #c2790f; cursor: pointer; font-weight: 600; }
.cal-cell.wp-unpaid:active { background: #ffe6cc; }
.cal-cell.wp-sel { background: var(--primary); color: #fff; box-shadow: 0 0 0 2px rgba(21,89,184,.25); }
.cal-cell.wp-paid .badge2, .cal-cell.wp-unpaid .badge2, .cal-cell.wp-sel .badge2 { font-size: 8px; }

/* 看板 环形图卡 */
.chart-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 12px; }
.chart-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.chart-row { display: flex; align-items: center; gap: 18px; }
.chart-donut { position: relative; width: 116px; height: 116px; flex: 0 0 auto; }
.donut-svg { width: 116px; height: 116px; display: block; }
.chart-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.chart-center .ct-top { font-size: 19px; font-weight: 800; line-height: 1.1; }
.chart-center .ct-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.chart-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-legend .leg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chart-legend .leg .dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.chart-legend .leg .leg-l { flex: 1; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-legend .leg b { font-weight: 700; }

/* 看板 待办瓦片 */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.todo-tile { background: #fff4ed; border: 1px solid #fcd9c2; border-radius: 11px; padding: 10px 6px; text-align: center; cursor: pointer; }
.todo-tile:active { background: #ffe9da; }
.todo-tile .tt-n { font-size: 22px; font-weight: 800; color: #d2691e; }
.todo-tile .tt-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 看板 工种分布条 */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.bar-row .bar-l { width: 84px; flex: 0 0 auto; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; height: 8px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.bar-row .bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #1559b8, #3b82e6); border-radius: 5px; }
.bar-row .bar-n { width: 22px; text-align: right; flex: 0 0 auto; font-weight: 600; }

/* 工人状态卡左边色条 */
.wk-card { border-left: 3px solid transparent; }
.wk-card.st-on { border-left-color: var(--green); }
.wk-card.st-stby { border-left-color: var(--orange); }
.wk-card.st-off { border-left-color: #b9c0cc; opacity: .72; }

/* 项目筛选行（横向一排，可滑动，药丸式 chip） */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 8px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.filter-row::-webkit-scrollbar { display: none; }
.fchip {
  flex: 0 0 auto; appearance: none; -webkit-appearance: none; outline: none;
  border: 1px solid #e4e8ef; background-color: #f6f8fb; color: #4a5568;
  font-size: 13px; font-weight: 600; cursor: pointer; height: 34px;
  padding: 0 30px 0 13px; border-radius: 17px; max-width: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a94a6' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  transition: all .15s;
}
.fchip:active { transform: scale(.97); }
.fchip.on {
  background-color: #e9f1fd; border-color: #a9caf2; color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231559b8' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  box-shadow: 0 1px 4px rgba(21,89,184,.12);
}

/* 语音录入按钮（录音中） */
.btn-rec { background: var(--red) !important; animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(214,69,55,.4); } 50% { box-shadow: 0 0 0 6px rgba(214,69,55,0); } }

/* 开关 Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cdd4df; border-radius: 26px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* 日历式时间选择 */
.tp-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; font-size: 18px; }
.tp-nav { border: none; background: #f0f3f8; width: 40px; height: 40px; border-radius: 10px; font-size: 22px; color: var(--primary); cursor: pointer; line-height: 1; }
.tp-nav:active { background: #e2e8f2; }
.tp-whole { width: 100%; border: 1px solid #e4e8ef; background: var(--bg); border-radius: 10px; padding: 11px 0; font-size: 14px; font-weight: 600; color: #444; cursor: pointer; margin-bottom: 12px; }
.tp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.tp-m { min-width: 0; border: 1px solid #e4e8ef; background: var(--bg); border-radius: 10px; padding: 14px 2px; font-size: 14px; font-weight: 600; color: #444; cursor: pointer; }
.tp-m:active { background: #eef2f8; }
.tp-whole.sel, .tp-m.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.tp-m.has { border-color: #a9caf2; background: var(--primary-soft); color: var(--primary); line-height: 1.2; }
.tp-m.has.sel { background: var(--primary); color: #fff; }

/* 利润预警卡 */
.warn-card { border: 1px solid #f7cdd2; box-shadow: 0 2px 12px rgba(239,71,89,.1); }
.warn-banner { background: var(--red-soft); color: #d23a4d; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 8px 11px; margin-bottom: 8px; }

/* 营收 总额/明细 小分段 */
.rev-seg { display: inline-flex; gap: 2px; background: #eef1f6; border-radius: 8px; padding: 2px; margin-left: 8px; vertical-align: middle; float: right; }
.rev-seg button { border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.rev-seg button.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 更多信息折叠头 */
.more-toggle { padding: 12px 0 4px; cursor: pointer; font-size: 14px; color: var(--primary); }
.more-toggle:active { opacity: .7; }

/* 次级小标题 */
.section-sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 6px; display: flex; align-items: center; justify-content: space-between; }

/* 分段切换（团队/我的） */
.seg-tabs { display: flex; background: #eaeef4; border-radius: 12px; padding: 4px; margin-bottom: 15px; gap: 4px; }
.seg-tabs button { flex: 1; border: none; background: transparent; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 9px; cursor: pointer; transition: all .15s; }
.seg-tabs button.active { background: var(--card); color: var(--primary); box-shadow: 0 2px 6px rgba(28,50,92,.1); }

/* 最终结算金额卡 */
.settle-card { background: linear-gradient(135deg, #fff8ec, #fffdf8); border: 1px solid #f6e3bf; border-radius: 12px; margin-bottom: 10px; }
.settle-amount { font-size: 24px; font-weight: 800; color: #b9770e; margin-top: 4px; }
.settle-none { font-size: 13px; font-weight: 500; color: var(--muted); }

/* 收/支双卡看板 */
.pay-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pay-col { background: var(--card); border-radius: 12px; padding: 12px 13px; box-shadow: var(--shadow); }
.pay-col .pay-h { font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.pay-col .pay-go { font-size: 12px; color: var(--primary); font-weight: 600; }
.pay-col .pay-main { font-size: 22px; font-weight: 800; margin: 6px 0 8px; }
.pay-col .pay-main small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 5px; }
.pay-col .pay-sub { display: flex; gap: 14px; border-top: 1px dashed #eceff4; padding-top: 7px; }
.pay-col .pay-sub > div { font-size: 12px; color: var(--muted); }
.pay-col .pay-sub b { display: block; font-size: 14px; color: var(--text, #222); margin-top: 1px; }
.pay-col .pay-sub b.red-t { color: var(--red); }
.pay-sub3 { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; }
.pay-sub3 > div { min-width: 0; font-size: 12px; color: var(--muted); }
.pay-sub3 b { display: block; margin-top: 2px; color: var(--text); font-size: 13px; white-space: nowrap; }
.pay-col .pay-sub3 { grid-template-columns:1fr; gap:0 !important; }
.pay-col .pay-sub3 > div { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:32px; border-bottom:1px solid #f0f3f7; }
.pay-col .pay-sub3 > div:last-child { border-bottom:0; }
.pay-col .pay-sub3 span { flex:none; }
.pay-col .pay-sub3 b { min-width:0; margin:0; overflow:visible; text-align:right; font-size:15px; font-variant-numeric:tabular-nums; letter-spacing:-.15px; }
@media (max-width:560px) { .pay-board { grid-template-columns:1fr; } }

/* 支付明细行 */
.pay-detail-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid #f2f4f8; cursor: pointer; }
.pay-detail-row:last-child { border-bottom: none; }
.pay-detail-row:active { background: #fafbfd; }
.pay-detail-row .pdl { font-size: 14px; font-weight: 600; }
.pay-detail-row .pdr { font-size: 13px; }
.pay-detail-row .pdr .arrow { color: var(--muted); margin-left: 2px; }

/* 项目周期卡 */
.period-card { display: flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--primary-soft), #f7fbff); border: 1px solid #d8e8fb; border-radius: 12px; padding: 12px 10px; margin-bottom: 12px; }
.period-card .pc-item { flex: 1; text-align: center; }
.period-card .pc-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.period-card .pc-value { font-size: 14px; font-weight: 700; color: var(--text, #222); }
.period-card .pc-arrow { color: #9bbbe6; font-size: 14px; flex: 0 0 auto; }

/* 参与工人列表 */
.worker-part { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.wp-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 11px; padding: 9px 12px; box-shadow: var(--shadow); }
.wp-ava { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1559b8, #3b82e6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.wp-main { flex: 1; min-width: 0; }
.wp-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.wp-job { font-size: 10.5px; font-weight: 500; color: var(--primary); background: #e8f1fd; border-radius: 5px; padding: 1px 6px; }
.wp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wp-wage { font-size: 15px; font-weight: 700; color: var(--red); flex: 0 0 auto; }

/* 打卡明细折叠 */
.punch-arrow { display: inline-block; color: var(--muted); font-weight: 700; transition: transform .15s; margin-left: 2px; }
.punch-card:active { background: #fafbfd; }
.day-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--primary-soft); border: 1px solid #d8e8fb; border-radius: 11px; padding: 11px 13px; margin: 6px 0 8px; cursor: pointer; font-size: 14px; }
.day-bar:active { background: #e2eefb; }
.day-bar .day-toggle { font-size: 13px; color: var(--primary); font-weight: 600; white-space: nowrap; }

/* 小号统计卡（两排各三个） */
.stat-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 15px; }
.stat-mini { background: var(--card); border-radius: 12px; padding: 11px 6px; box-shadow: var(--shadow); text-align: center; }
.stat-mini .label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-mini .value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* 工时紧凑行 */
.wh-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px;
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 6px; font-size: 13px; }
.wh-row .h { font-weight: 700; font-size: 15px; }

/* 聊天 */
.chat-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--card); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.chat-row:active { background: #fafbfd; }
.chat-row .ava { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.chat-row .meta { flex: 1; min-width: 0; }
.chat-row .meta .t { font-weight: 600; font-size: 15px; }
.chat-row .meta .p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-row .when { font-size: 11px; color: var(--muted); flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.chat-room { position: fixed; top: var(--topbar-h); left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--maxw); height: calc(100dvh - var(--topbar-h) - var(--tabbar-h)); display: flex; flex-direction: column; overflow: hidden; background: var(--bg); z-index: 10; }
.chat-head { flex: none; background: var(--bg); padding: 10px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.chat-msgs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.chat-msgs > .msg { flex: none; }
.msg-text { white-space: pre-wrap; }
.chat-status { display: flex; flex: none; align-items: center; justify-content: space-between; padding: 8px 14px; background: #fff5e6; color: #946116; font-size: 12px; }
.chat-status button { border: 0; background: none; color: var(--primary); padding: 4px 8px; }
.chat-new { flex: none; align-self: center; margin: 0 0 8px; padding: 7px 14px; border: 1px solid #d9e5fa; border-radius: 20px; background: #fff; color: var(--primary); font-size: 12px; }
.chat-status[hidden], .chat-new[hidden] { display: none; }
.thumbs .chat-image { width: 120px; height: 120px; padding: 0; background: #fff; }
.msg { max-width: 76%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word; position: relative; }
.msg.in { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: #95ec69; border-top-right-radius: 4px; }
.msg.sys { align-self: center; background: #e9edf3; color: var(--muted); font-size: 13px; max-width: 92%; border-radius: 10px; }
.msg .who { font-size: 11px; color: var(--primary); margin-bottom: 3px; }
.msg .time { font-size: 10px; color: rgba(0,0,0,.35); margin-top: 4px; text-align: right; }
.chat-composer { flex: none; min-height: 0; max-height: 65%; overflow-y: auto; background: #fff; border-top: 1px solid var(--border); }
.chat-input { padding: 10px 12px; display: flex; align-items: flex-end; gap: 8px; }
.chat-input textarea { flex: 1; min-width: 0; width: 0; min-height: 42px; max-height: 104px; padding: 10px 12px; border: 1px solid #e5eaf2; border-radius: 13px; background: var(--bg); font-size: 15px; line-height: 20px; resize: none; overflow-y: auto; }
.chat-input textarea:focus { outline: none; border-color: #a9c4fa; background: #fff; }
.chat-add { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 42px; border: 0; border-radius: 12px; background: transparent; color: #64748b; }
.chat-add[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.chat-add[aria-expanded="true"] .ui-icon { transform: rotate(45deg); }
.chat-send { flex: none; height: 42px; min-width: 60px; padding: 0 12px; border-radius: 13px; font-size: 14px; }
.chat-send:disabled { opacity: 1; background: #eaf0f9; color: #8da3c4; box-shadow: none; cursor: default; }
.chat-tools { padding: 4px 12px 12px; border-top: 1px solid var(--border); }
.chat-tools[hidden], .quick-bar[hidden], .chat-pending[hidden] { display: none; }
.chat-tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 0 4px; }
.chat-tool-grid button { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; background: none; color: #64748b; font-size: 12px; }
.chat-tool-grid button > span { display: flex; align-items: center; justify-content: center; width: 48px; height: 46px; border: 1px solid #e8edf5; border-radius: 14px; color: var(--primary); background: #f5f8fc; }
.chat-tool-grid button:active > span { background: var(--primary-soft); }
.chat-pending { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 0; }
.chat-pending-file { display: flex; align-items: center; gap: 7px; flex: none; max-width: 210px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: #64748b; }
.chat-pending-file img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.chat-pending-file > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-pending-file button { flex: none; border: 0; background: #f1f4f8; color: #64748b; padding: 4px; border-radius: 7px; }
.chat-pending-file button .ui-icon { width: 16px; height: 16px; }
.chat-keyboard-open .tabbar { display: none; }
.chat-keyboard-open .chat-composer { padding-bottom: env(safe-area-inset-bottom); }
.unread-badge { display: inline-block; background: var(--red); color: #fff; font-size: 10px; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; text-align: center; padding: 0 4px; margin-top: 3px; }
.quick-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.quick-bar .chip { white-space: nowrap; font-size: 12px; padding: 7px 12px; background: var(--bg); }
.file-card { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin-top: 6px; color: var(--text); font-size: 13px; min-width: 170px; max-width: 230px; }
.file-card:active { background: var(--bg); }
.contact-gh { display: flex; justify-content: space-between; align-items: center; padding: 9px 8px 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; }
.contact-row .ava { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-row:active { background: var(--bg); }
.tabbar a { position: relative; }
.tabbar a .tbadge { position: absolute; top: 3px; left: calc(50% + 7px); background: var(--red); color: #fff; font-size: 9px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 9px; text-align: center; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }

/* Personal photos and company profile */
.avatar-editor { display:flex; flex-direction:column; align-items:center; gap:10px; padding:12px 0 22px; }
.avatar-edit-button { width:88px; height:88px; padding:0; border:1px solid #e6e9ee; border-radius:20px; background:#f0f2f5; color:#b1bac8; overflow:hidden; cursor:pointer; }
.avatar-edit-button img { width:100%; height:100%; object-fit:cover; display:block; }
.avatar-edit-button svg { width:70%; height:70%; margin:15%; display:block; }
.avatar-edit-caption { color:var(--muted); font-size:12px; }
.avatar-source-actions { display:grid; gap:8px; }
.profile-head { background:#fff; color:var(--text); box-shadow:none; border:1px solid var(--border); padding:22px 18px; }
.profile-head .prof-edit { background:#f3f5f7; color:var(--muted); }
.profile-head .prof-avatar { background:#f0f2f5; border-radius:14px; color:#a1acbb; }
.profile-head .avatar-editor { padding:0; flex:0 0 auto; }
.profile-head .avatar-edit-button { width:64px; height:64px; border-radius:14px; }
.profile-head .avatar-edit-caption { display:none; }
.company-profile-note { color:var(--muted); font-size:12px; line-height:1.6; margin:8px 0 14px; }
.company-profile-note summary { cursor:pointer; padding:6px 0; }
.company-profile-note > div { padding:6px 0; }

/* The team entry always displays that team's code. */
.join-code-heading { text-align:center; margin:2px 0 12px; overflow-wrap:anywhere; }
.join-code-heading b { display:block; font-size:19px; margin-bottom:5px; }
.join-code-image { display:flex; justify-content:center; margin:10px 0 14px; }
.join-code-image img { display:block; width:240px; height:auto; max-width:100%; background:#fff; border:1px solid var(--border); border-radius:12px; }
.join-code-placeholder { min-height:240px; display:flex; align-items:center; justify-content:center; color:var(--muted); }
.join-code-help { color:var(--muted); font-size:13px; line-height:1.7; text-align:center; }
.join-code-expiry { color:var(--muted); font-size:12px; text-align:center; margin-top:8px; }
.join-code-actions { display:flex; justify-content:center; margin-top:14px; }
.join-code-preview-label { text-align:center; font-size:12px; color:#9a6700; background:#fff8e6; border-radius:8px; padding:7px 10px; }
.join-code-error { color:var(--red); text-align:center; padding:36px 12px; }
.team-unassigned-link { color:var(--red); min-height:32px; text-decoration:underline; text-underline-offset:3px; }

/* Complete worker archive */
.worker-archive-modal, .archive-preview-modal { max-width:var(--maxw); height:100vh; height:100dvh; max-height:100vh; max-height:100dvh; border-radius:0; }
.worker-archive-modal .modal-head, .archive-preview-modal .modal-head { border-radius:0; padding:calc(6px + env(safe-area-inset-top)) 12px 6px; gap:6px; }
.worker-archive-modal .modal-head::before, .archive-preview-modal .modal-head::before { display:none; }
.worker-archive-modal .modal-head h3, .archive-preview-modal .modal-head h3 { flex:1; }
.worker-archive-modal .modal-head .close, .archive-preview-modal .modal-head .close { order:-1; width:44px; min-height:44px; font-size:32px; color:var(--text); }
.worker-archive-modal .modal-body { background:var(--bg); padding:12px; }
.worker-archive-modal .modal-head h3 { font-size:17px; }
.archive-hero { background:#fff; border:1px solid #e7edf5; border-radius:16px; padding:16px 16px 0; overflow:hidden; }
.archive-person { display:flex; gap:14px; align-items:center; }
.archive-avatar { width:56px; height:64px; border-radius:12px; flex-shrink:0; background:#eaf1fc; color:#3763a8; display:flex; align-items:center; justify-content:center; font-size:25px; font-weight:600; overflow:hidden; }
.archive-avatar img { width:100%; height:100%; object-fit:cover; }
.archive-person-info { min-width:0; }
.archive-person-info h3 { font-size:21px; line-height:1.3; margin:0 0 7px; overflow-wrap:anywhere; }
.archive-person-info p { margin:7px 0 0; color:#64748b; font-size:13px; overflow-wrap:anywhere; }
.archive-badges { display:flex; flex-wrap:wrap; gap:5px; }
.archive-badges .tag { font-size:11px; margin:0; }
.archive-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; border-top:1px solid var(--border); padding:10px 0; margin-top:14px; }
.archive-summary span { display:block; color:#7c899c; font-size:12px; margin-bottom:2px; }
.archive-summary b, .archive-summary button { font-size:13px; line-height:1.5; font-weight:600; overflow-wrap:anywhere; }
.archive-summary b { display:flex; align-items:center; min-height:44px; }
.archive-summary button { border:0; padding:0; min-height:44px; min-width:44px; background:none; color:var(--primary); cursor:pointer; }
.archive-completeness { font-size:12px; color:#a16b14; background:#fff8ea; padding:8px 16px; margin:0 -16px; }
.archive-completeness.complete { color:#54826c; background:#f0f8f3; }
.archive-tabs { position:sticky; top:-12px; z-index:2; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:8px 0; background:var(--bg); margin:4px 0 0; }
.archive-tabs button { min-width:0; min-height:44px; padding:10px 0; border:0; border-bottom:2px solid transparent; background:none; color:#718096; font-size:14px; font-weight:500; cursor:pointer; }
.archive-tabs button[aria-selected=true] { color:var(--primary); border-bottom-color:var(--primary); font-weight:700; }
.archive-tabs button:focus-visible, .archive-file:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.archive-panel[hidden] { display:none; }
.archive-section { background:#fff; border:1px solid #e9edf4; border-radius:15px; padding:17px; margin-bottom:12px; }
.archive-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; }
.archive-section-head h4 { margin:0; font-size:15px; font-weight:650; }
.archive-count { font-size:11px; color:#718198; background:#f1f5fa; border-radius:6px; padding:3px 7px; white-space:nowrap; }
.archive-fields { margin:0; }
.archive-fields > div { display:grid; grid-template-columns:84px minmax(0,1fr); align-items:start; gap:12px; min-width:0; padding:12px 0; border-bottom:1px solid var(--border); }
.archive-fields > div:first-child { padding-top:0; }
.archive-fields > div:last-child { border-bottom:0; padding-bottom:0; }
.archive-fields dt, .archive-field-label { font-size:13px; color:#7c899c; line-height:1.7; margin:0; }
.archive-fields dd { margin:0; font-size:14px; color:#334155; line-height:1.6; text-align:right; overflow-wrap:anywhere; }
.archive-field-label { margin-top:20px; }
.archive-muted { color:#7c899c; font-size:12px; line-height:1.6; }
.archive-chips { display:flex; flex-wrap:wrap; gap:7px; }
.archive-chips span { background:#f0f5fd; color:#5273a3; font-size:12px; padding:6px 10px; border-radius:7px; }
.archive-wage { padding:15px; background:#f2f6fd; border-radius:10px; margin-bottom:18px; }
.archive-wage > span { display:block; font-size:12px; color:#7c899c; margin-bottom:6px; }
.archive-wage strong { color:#2a5dae; font-size:25px; font-weight:650; }
.archive-wage small { font-size:11px; color:#8390a3; font-weight:400; }
.archive-inline-link { color:var(--primary); border:0; background:none; padding:16px 0 0; cursor:pointer; font-size:12px; }
.archive-details summary { cursor:pointer; font-size:13px; color:#64748b; }
.archive-details[open] summary { margin-bottom:16px; }
.archive-account { display:flex; gap:8px; margin-top:6px; }
.archive-account input { min-width:0; font-size:13px; }
.archive-account button { flex-shrink:0; }
.archive-management { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:14px; }
.archive-management button { font-size:13px; min-height:44px; padding:10px 4px; }
.archive-files { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.archive-file { border:1px solid #e7edf5; padding:0 0 11px; background:#fff; border-radius:11px; text-align:left; min-width:0; overflow:hidden; cursor:pointer; color:var(--text); }
.archive-file:disabled { cursor:default; opacity:.6; }
.archive-file-thumb { height:110px; display:flex; align-items:center; justify-content:center; background:#f2f5fa; margin-bottom:10px; overflow:hidden; }
.archive-file-thumb img { width:100%; height:100%; object-fit:contain; }
.archive-file-icon { font-size:16px; letter-spacing:.8px; font-weight:600; color:#6282b2; background:#fff; border:1px solid #dce5f1; border-radius:7px; padding:14px 10px; }
.archive-file-title, .archive-file-name, .archive-file-action { display:block; margin:0 11px; }
.archive-file-title { font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.archive-file-name { font-size:12px; color:#8491a4; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; margin-top:4px; }
.archive-file-action { font-size:13px; color:var(--primary); margin-top:10px; }
.archive-image-unavailable::after { content:'图片暂不可用'; font-size:11px; color:#7c899c; }
.archive-empty { font-size:12px; color:#95a1b2; line-height:1.8; text-align:center; padding:22px 12px; border:1px dashed #e5eaf1; border-radius:10px; background:#fafbfd; }
.archive-certificate + .archive-certificate { border-top:1px solid var(--border); margin-top:15px; padding-top:15px; }
.archive-certificate > b { font-size:13px; display:block; margin-bottom:10px; }
.archive-certificate > span { display:block; margin-bottom:10px; }
.archive-review-counts { display:grid; grid-template-columns:repeat(3,1fr); background:#f5f8fc; border-radius:10px; padding:13px 0; margin-bottom:12px; text-align:center; }
.archive-review-counts strong, .archive-review-counts span { display:block; }
.archive-review-counts strong { font-size:20px; margin-bottom:5px; }
.archive-review-counts span { font-size:11px; color:#8996a8; }
.archive-record { padding:14px 0; border-bottom:1px solid var(--border); }
.archive-record:last-child { border-bottom:0; }
.archive-record > div:first-child { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:13px; }
.archive-record time { font-size:11px; color:#8a97a9; }
.archive-record p { font-size:13px; line-height:1.7; margin:9px 0; overflow-wrap:anywhere; }
.archive-record .archive-files { margin-top:12px; }
.archive-preview-modal .modal-body { padding:12px; }
.archive-preview-modal .btn-sm, .worker-archive-modal .btn-sm { min-height:44px; }
.worker-archive-modal .modal-foot .btn, .archive-preview-modal .modal-foot .btn { min-height:48px; }
.archive-preview-toolbar { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:#8190a5; }
.archive-preview-name { color:#7b899e; font-size:12px; overflow-wrap:anywhere; text-align:center; margin:12px 0; }
.archive-attachment-stage { background:#f1f4f8; border:1px solid #e9eef5; border-radius:10px; overflow:auto; max-height:54vh; min-height:170px; }
.archive-preview-image { display:block; width:100%; max-width:none; height:auto; margin:0 auto; }
.archive-pdf { display:block; border:0; width:100%; height:54vh; background:#fff; }
.archive-preview-zoom { display:flex; justify-content:center; gap:10px; margin-top:12px; }
.archive-preview-note { text-align:center; margin:10px 0 0; }
.archive-preview-modal [hidden] { display:none; }
.location-map { margin: 14px 0; padding: 12px; border: 1px solid var(--border, #e7ebf2); border-radius: 16px; background: #fff; }
.location-map-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.location-map-title span, .location-map-note { font-size: 11px; color: var(--muted); }
.location-map-canvas { height: 230px; border-radius: 12px; overflow: hidden; background: #f2f5f9; isolation: isolate; z-index: 0; }
.location-map-placeholder { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.location-map-status, .location-map-project, .location-map-distance, .location-map-network { font-size: 12px; line-height: 1.7; margin-top: 6px; overflow-wrap: anywhere; }
.location-map-status { color: #167247; }
.location-map-status.error, .location-map-network { color: #a66000; }
.location-map-network:empty { display: none; }
.location-map-project { color: var(--muted); }
.location-map-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.location-map-actions a { font-size: 12px; }
.location-map-pin span { display: block; width: 20px; height: 20px; border-radius: 50%; background: #2463eb; border: 3px solid white; box-shadow: 0 1px 6px #0005; box-sizing: border-box; }
.location-map-pin.site span { background: #ec8a20; border-radius: 5px; }
.location-map .leaflet-control-attribution { font-size: 10px; }
.site-camera-field { margin: 14px 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; }
.site-camera-field p, .site-camera-status { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 8px 0; }
.site-camera-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.site-camera-thumbs:empty { display: none; }
.site-camera-preview { border: 0; padding: 0; background: #eff3f8; border-radius: 8px; width: 100%; overflow: hidden; }
.site-camera-preview img { width: 100%; height: 105px; object-fit: cover; display: block; }
.site-camera-stage { border-radius: 12px; overflow: hidden; background: #101923; min-height: 220px; }
.site-camera-stage video { display: block; width: 100%; max-height: 48vh; object-fit: contain; }
.site-camera-review, .site-camera-full { display: block; width: 100%; height: auto; }
.site-camera-review { max-height: 55vh; object-fit: contain; }
.site-camera-modal [hidden] { display: none !important; }
.site-camera-controls { display: flex; gap: 8px; }
.site-camera-modal { z-index: 120; }
.project-quote-shortcut { margin-top: 12px; }
.project-quote-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: var(--primary-soft); border: 1px solid #d6e5ff; border-radius: 14px; margin-bottom: 12px; }
.project-quote-heading { margin-bottom: 16px; }
.project-quote-heading > b { display: block; font-size: 19px; margin-bottom: 8px; }
.quote-view-row { margin-bottom: 10px; }
.quote-view-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--muted); margin: 8px 0; }
.project-quote-total { border-radius: 14px; background: var(--primary-soft); padding: 12px 16px; margin: 16px 0; }
.project-quote-total strong { font-size: 22px; color: var(--primary); }
.project-quote-modal .modal-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-budget-summary { cursor: default; }
.project-budget-summary > summary { display: flex; align-items: center; gap: 8px; min-height: 34px; color: var(--primary); font-size: 12px; cursor: pointer; list-style: none; }
.project-budget-summary > summary::-webkit-details-marker { display: none; }
.project-budget-summary > summary::after { content: '⌄'; margin-left: auto; font-size: 13px; }
.project-budget-summary[open] > summary::after { content: '⌃'; margin-left: 0; }
.budget-summary-value { display: none; margin-left: auto; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.project-budget-summary[open] .budget-summary-value { display: block; }
.project-budget-content { padding-top: 2px; }
.project-budget-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.project-budget-row > b { margin-left: auto; font-variant-numeric: tabular-nums; }
.project-budget-edit { border: 0; background: transparent; color: var(--primary); font: inherit; padding: 8px 0 8px 10px; cursor: pointer; white-space: nowrap; }
.project-budget-track { height: 4px; border-radius: 4px; background: rgba(100, 120, 150, .12); overflow: hidden; margin: 8px 0; }
.project-budget-track > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.project-budget-track > span.over-budget { background: var(--red); }
.project-budget-source { font-size: 11px; line-height: 1.6; color: var(--muted); }
.project-budget-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; min-height: 28px; }
.expense-attachments { margin-top: 4px; }
.expense-attachments > summary { color: var(--primary); cursor: pointer; font-size: 12px; min-height: 34px; display: flex; align-items: center; gap: 6px; list-style: none; }
.expense-attachments > summary::-webkit-details-marker { display: none; }
.expense-attachments > summary::after { content: '⌄'; }
.expense-attachments[open] > summary::after { content: '⌃'; }
.expense-attachment-list { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.expense-attachment { flex: 0 0 76px; width: 76px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; padding: 0; background: white; cursor: pointer; color: var(--primary); }
.expense-attachment > img, .expense-attachment > span { display: block; width: 100%; height: 62px; object-fit: cover; }
.expense-attachment > span { display: grid; place-items: center; font-size: 15px; background: var(--bg); }
.expense-attachment > small { display: block; padding: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.project-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 10px; border-radius: 12px; background: var(--bg); margin-bottom: 10px; }
.project-overview > div { min-width: 0; }
.project-overview span, .project-overview small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.project-overview b { display: block; margin: 4px 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.project-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.project-actions > .btn { flex: 1; padding: 10px 8px; font-size: 13px; }
.project-fold { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.project-fold > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.project-fold > summary::-webkit-details-marker { display: none; }
.project-fold > summary::after { content: '⌄'; margin-left: auto; color: var(--muted); }
.project-fold[open] > summary::after { content: '⌃'; }
.project-fold-hint { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.project-fold > summary:has(.project-fold-hint)::after { margin-left: 0; }
.project-fold-content { padding-bottom: 8px; }
.project-fold-content .lc-row { gap: 14px; }
.project-link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.project-link-row > span { flex-shrink: 0; }
.project-link-row > b { text-align: right; font-size: 12px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.project-link-row:disabled { cursor: default; opacity: 1; }
.project-records .project-link-row:last-child, .project-fold-content .project-link-row:last-child { border-bottom: 0; }
.project-detail-modal .section-title, .project-expense-modal .section-title { margin: 16px 0 8px; }
.project-section-title > small { color: var(--muted); font-weight: 400; margin-left: auto; font-size: 11px; }
.project-cost-help { margin: -4px 0 6px; color: var(--muted); font-size: 11px; }
.project-cost-help > summary { cursor: pointer; padding: 6px 0; }
.project-cost-help p { margin: 4px 0 8px; line-height: 1.7; }
.project-cost-card { border: 1px solid; border-radius: 12px; padding: 2px 12px; margin-bottom: 8px; }
.cost-labor { background: #f2f7ff; border-color: #d9e6fb; }
.cost-material { background: #fff8ec; border-color: #fae4bf; }
.cost-other { background: #f1faf3; border-color: #d5edd9; }
.project-cost-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 0; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.project-cost-head > span { font-size: 14px; font-weight: 600; flex-shrink: 0; }
.project-cost-head > b { margin-left: auto; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.project-cost-head > i { font-size: 18px; font-style: normal; color: var(--muted); }
.project-detail-modal .pay-col { padding: 10px; box-shadow: none; border: 1px solid var(--border); }
.project-detail-modal .pay-board { grid-template-columns: 1fr; }
.project-detail-modal .pay-col .pay-sub3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; }
.project-detail-modal .pay-col .pay-sub3 > div { display: block; border-bottom: 0; min-height: 0; }
.project-detail-modal .pay-col .pay-sub3 b { font-size: 12px; white-space: normal; overflow-wrap: anywhere; text-align: left; margin-top: 3px; }
.project-detail-modal .modal-foot .btn { font-size: 13px; padding: 10px 5px; }
.project-expense-modal .list-card { padding: 12px; border-radius: 12px; box-shadow: none; border: 1px solid var(--border); }
.project-expense-modal .lc-top > div:last-child { flex-shrink: 0; }
.project-expense-modal .btn-sm { padding: 7px 10px; }

/* Keep project list/detail amounts precise and readable on narrow screens. */
.project-financial-summary > div { min-width: 0; }
.project-financial-summary .m-label, .project-financial-summary .m-value { display: block; }
.project-financial-summary .m-value { font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.project-financial-summary small { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.project-tax-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 6px 0 10px; }
@media (max-width: 360px) {
  .lc-metrics.project-financial-summary { gap: 5px; }
  .lc-metrics.project-financial-summary > div { padding: 10px 4px; }
  .project-financial-summary .m-value { font-size: 12px; }
}

/* Keep native mobile date controls inside their column. */
.deduction-modal .deduction-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.deduction-modal .field { min-width: 0; }
.deduction-modal input, .deduction-modal select, .deduction-modal textarea { min-width: 0; max-width: 100%; font-size: 16px; }
.deduction-modal input[type="date"] { display: block; appearance: none; min-height: 46px; }
.deduction-modal input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
@media (max-width: 480px) { .deduction-modal .deduction-fields { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Expense ledger: readable amounts and wrapping filter values at every viewport. */
.expense-page-note { margin: 0 2px 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.expense-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; padding: 18px; margin-bottom: 14px; background: #fff; border: 1px solid #e7edf6; border-radius: 16px; box-shadow: 0 4px 16px #263c6010; }
.expense-stats > div { min-width: 0; }
.expense-stats span, .expense-stats small { display: block; color: var(--muted); font-size: 12px; }
.expense-stats strong, .expense-stats b { display: block; margin-top: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.expense-stats strong { font-size: 26px; color: #243b66; }
.expense-stats b { font-size: 17px; }
.expense-stat-total { grid-column: 1 / -1; padding-bottom: 14px; border-bottom: 1px solid #edf1f7; }
.expense-stat-total small { margin-top: 6px; font-size: 11px; }
.filter-row.expense-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.expense-filter { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 10px 28px 10px 12px; border: 1px solid #e4eaf3; border-radius: 12px; background: #fff; }
.expense-filter::after { content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid #94a0b3; border-bottom: 1.5px solid #94a0b3; transform: translateY(-70%) rotate(45deg); }
.expense-filter-label { font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.expense-filter-value { font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.expense-filter .fchip { position: absolute; inset: 0; opacity: 0; height: 100%; width: 100%; max-width: none; cursor: pointer; font-size: 16px; }
.expense-filter.on { border-color: #abc7ff; background: #f1f6ff; }
.expense-filter.on .expense-filter-value { color: var(--primary); }
.expense-filter:focus-within { outline: 2px solid #98bafb; outline-offset: 1px; }
.expense-category-summary { margin: 0 0 16px; padding: 16px; background: #fff; border: 1px solid #e7edf6; border-radius: 16px; }
.expense-summary-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 6px; }
.expense-summary-heading b { font-size: 14px; }
.expense-summary-heading > span { color: var(--muted); font-size: 10px; }
.expense-category + .expense-category { border-top: 1px solid #edf1f7; }
.expense-category summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) 10px; gap: 8px; align-items: center; padding: 13px 0; cursor: pointer; list-style: none; }
.expense-category summary::-webkit-details-marker { display: none; }
.expense-category-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.expense-category-name small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 5px; }
.expense-category summary > b { font-size: 14px; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.expense-category-chevron { color: #98a6bb; font-size: 15px; }
.expense-category[open] .expense-category-chevron { transform: rotate(180deg); }
.expense-category-track { height: 3px; background: #edf3ff; border-radius: 3px; overflow: hidden; }
.expense-category-track > span { display: block; height: 100%; background: #5c8eff; }
.expense-subcategories { padding: 7px 0 10px; }
.expense-subcategories > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: 12px; }
.expense-subcategories span { color: #78869c; overflow-wrap: anywhere; }
.expense-subcategories b { text-align: right; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.expense-detail-card .lc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 12px; }
.expense-detail-card .lc-top > div { min-width: 0; overflow-wrap: anywhere; }
.expense-detail-card > .lc-sub { margin-top: 8px; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .expense-stats b { font-size: 15px; }
  .expense-category-summary { padding: 13px; }
  .expense-category summary { grid-template-columns: minmax(0, 1fr) 10px; gap: 4px; }
  .expense-category summary > b { grid-row: 2; text-align: left; padding-top: 3px; }
  .expense-category-chevron { grid-column: 2; grid-row: 1 / 3; }
  .expense-detail-card .lc-top { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .expense-detail-card .lc-top > div:last-child { text-align: left !important; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
}
