/* ============================================================
   EGE2026 style.css — 深空藍黑 + 金色漸變（對齊 hk-salary-mpf-app 風格）
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: #0c1428;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f1a30; }
::-webkit-scrollbar-thumb { background: #2a3a5c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a6c; }

/* ─── Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #0f1a30 0%, #1b2a4a 100%);
  border-right: 1px solid #2a3a5c;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .15s ease;
}
.sidebar-brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid #2a3a5c;
}
.sidebar-brand h1 {
  font-size: 1.05rem;
  color: #c8a951;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.35;
}
.sidebar-brand .sub { font-size: .72rem; color: #6a7a9a; margin-top: 3px; }
.sidebar-brand .tag { font-size: .7rem; color: #c8a951; opacity: .85; margin-top: 6px; }
.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  color: #8a9aba;
  font-size: .9rem;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: #e0e0e0; background: rgba(200,169,81,.05); }
.nav-item.active {
  color: #c8a951;
  background: rgba(200,169,81,.08);
  border-left-color: #c8a951;
  font-weight: 600;
}
.nav-item .icon { font-size: 1.15rem; width: 24px; text-align: center; }
.nav-item { cursor: pointer; }
/* 2026-10-02：hover 改 pointer（用戶反映 grab 手型怪）。拖拽期間仍然係 grabbing。 */
@media (hover: hover) { .nav-item { cursor: pointer; } .nav-item:active { cursor: grabbing; } }
/* 寬屏（側欄豎排）導航項：靜態禁觸屏滾動 —— touch-action 必須喺按下前已生效，
   拖拽先唔會被瀏覽器滾動打斷（pointerdown 先動態設置係太遲，真實平板會失效） */
@media (min-width: 761px) {
  .sidebar-nav { touch-action: none; }
  .nav-item { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
.nav-item.dragging { opacity: .5; background: rgba(200,169,81,.15); border-left-color: #c8a951; }
.nav-item.drag-over { border-top: 2px solid #c8a951; }
.sidebar-nav .nav-list { display: block; }
.sidebar-nav .drag-hint { font-size: .82rem; color: #7b8cb0; padding: 8px 20px 2px; line-height: 1.55; }
.sidebar-foot { padding: 12px 20px; border-top: 1px solid #2a3a5c; }
.sidebar-foot .ver { font-size: .65rem; color: #4a5a7a; }
.sidebar-foot .copy { font-size: .65rem; color: #4a5a7a; margin-top: 2px; }

/* ─── Sidebar resizer（拖拽把手）─── */
.sidebar-resizer {
  position: absolute;
  top: 0; bottom: 0;
  width: 5px;
  left: 220px;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='M2 16 L9 9 L9 13 L23 13 L23 9 L30 16 L23 23 L23 19 L9 19 L9 23 Z' fill='%23ffffff' stroke='%23111c30' stroke-width='1.6' stroke-linejoin='round'/></svg>") 16 16, col-resize;
  z-index: 30;
  background: transparent;
  transition: background .2s;
}
.sidebar-resizer:hover, .sidebar-resizer:active { background: rgba(200,169,81,.4); }
body.resizing { user-select: none; cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='M2 16 L9 9 L9 13 L23 13 L23 9 L30 16 L23 23 L23 19 L9 19 L9 23 Z' fill='%23ffffff' stroke='%23111c30' stroke-width='1.6' stroke-linejoin='round'/></svg>") 16 16, col-resize; }
/* 拖拽時喺把手中央顯示左右指示（唔靠系統滑鼠主題） */
.sidebar-resizer::before, .sidebar-resizer::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.sidebar-resizer::before {
  left: -9px; transform: translateY(-50%);
  border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  border-right: 9px solid #c8a951;
}
.sidebar-resizer::after {
  right: -9px; transform: translateY(-50%);
  border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  border-left: 9px solid #c8a951;
}
.sidebar-resizer:hover::before, .sidebar-resizer:hover::after,
body.resizing .sidebar-resizer::before, body.resizing .sidebar-resizer::after { opacity: 1; }

/* ─── Main area ─── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.topbar {
  background: #1b2a4a;
  border-bottom: 1px solid #2a3a5c;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}
.topbar h2 { font-size: 1.05rem; color: #c8a951; font-weight: 600; }
.topbar .company { font-size: .8rem; color: #6a7a9a; white-space: nowrap; }
.content {
  flex: 1;
  padding: 24px 28px 60px;
  overflow-y: auto;
}

/* ─── Page title ─── */
.page-title { font-size: 1rem; font-weight: 600; color: #c8a951; margin: 4px 0 14px; }
.page-title:first-child { margin-top: 0; }

/* ─── Cards ─── */
.card {
  background: #1b2a4a;
  border: 1px solid #2a3a5c;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  font-size: 1rem;
  font-weight: 600;
  color: #c8a951;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a3a5c;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hint-text { font-size: .95rem; color: #6a7a9a; margin-bottom: 14px; line-height: 1.6; }

/* ─── KPI grid ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: linear-gradient(135deg, #1b2a4a, #24345a);
  border: 1px solid #2a3a5c;
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
  min-width: 0;               /* 2026-10-13：讓卡片在 grid 內可以縮，唔會被長數字撐爆 */
}
.kpi-card .label { font-size: .8rem; color: #6a7a9a; letter-spacing: .5px; }
.kpi-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c8a951;
  margin-top: 6px;
  overflow-wrap: anywhere;    /* 2026-10-13：極大金額（例：HK$1,234,567,890）會換行，唔會衝出卡片 */
  line-height: 1.25;
}
.kpi-card .value.green { color: #6fcf97; }
.kpi-card .value.red { color: #e07070; }
.kpi-card .value.warn { color: #e0a04a; }

/* ─── Chart（趨勢柱狀圖）─── */
.chart { display: flex; align-items: flex-end; gap: 5px; height: 180px; padding-top: 8px; overflow-x: auto; }
.chart-col { flex: 1; min-width: 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { border-radius: 4px 4px 0 0; width: 62%; min-height: 2px; }
.chart-bar.inc { background: linear-gradient(180deg, #6fcf97, #3d9b6a); }
.chart-bar.exp { background: linear-gradient(180deg, #e07070, #b04a4a); }
.chart-label { font-size: .62rem; color: #6a7a9a; margin-top: 5px; white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: .78rem; color: #8a9aba; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-inc::before { background: #3d9b6a; }
.lg-exp::before { background: #b04a4a; }

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
/* 2026-10-02：同一行 label 長短不一（英文版尤其明顯）會令輸入框高低不齊。
   label 撐滿剩餘高度 → 同一格內所有輸入框底部對齊。 */
.form-group > label { flex: 1 1 auto; }
.form-group label { font-size: .85rem; color: #8a9aba; font-weight: 500; }
.form-group input, .form-group select, .nlp-input, .search-input,
.modal-body input, .modal-body select, .modal-body textarea {
  background: #0f1a30;
  border: 1px solid #2a3a5c;
  border-radius: 6px;
  padding: 9px 12px;
  color: #e0e0e0;
  font-size: .9rem;
  transition: border-color .2s;
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .nlp-input:focus, .search-input:focus,
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  border-color: #c8a951;
  outline: none;
  box-shadow: 0 0 0 3px rgba(200,169,81,.12);
}
.form-group input::placeholder, .nlp-input::placeholder, .search-input::placeholder,
.modal-body input::placeholder, .modal-body textarea::placeholder { color: #4a5a7a; }
.form-group select option { background: #0f1a30; color: #e0e0e0; }
/* 2026-10-02：統一表單控件高度。瀏覽器原生高度唔同（文字框 34px、下拉 36px、日期／月 38px），
   同一行睇落會高低不齊（頂同底唔對）。全部統一 38px（checkbox／radio／textarea 除外）。 */
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.form-group select,
.modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.modal-body select { height: 38px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.btn-gold {
  background: linear-gradient(135deg, #c8a951, #d4b865);
  color: #0f1a30;
}
.btn-gold:hover { background: linear-gradient(135deg, #d4b865, #e0c878); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200,169,81,.3); }
.btn-outline {
  background: transparent;
  border: 1px solid #2a3a5c;
  color: #8a9aba;
}
.btn-outline:hover { border-color: #c8a951; color: #c8a951; }
.btn-danger {
  background: transparent;
  border: 1px solid #5c2a3a;
  color: #cc5555;
}
.btn-danger:hover { background: rgba(204,85,85,.1); }
.btn-mic { background: linear-gradient(135deg, #c8a951, #d4b865); color: #0f1a30; font-size: 1.05rem; padding: 8px 16px; }
.btn-mic.listening { background: #b04a4a; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.btn-sm { padding: 5px 12px; font-size: .75rem; }

/* ─── NLP 預覽 ─── */
.nlp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.nlp-hint { font-size: .9rem; color: #6a7a9a; margin-top: 6px; line-height: 1.6; }
.nlp-input { flex: 1; min-width: 240px; font-size: .95rem; }
.nlp-preview {
  margin-top: 14px;
  background: rgba(200,169,81,.06);
  border: 1px solid rgba(200,169,81,.3);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: .88rem;
}
.nlp-preview .pv-line { margin: 3px 0; color: #c8d4ea; }
.nlp-preview .pv-tag {
  display: inline-block;
  background: #c8a951;
  color: #0f1a30;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  margin-right: 7px;
}
.nlp-preview .pv-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ─── Toolbar & search ─── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar select, .toolbar .btn { flex-shrink: 0; }
.toolbar select {
  background: #0f1a30; border: 1px solid #2a3a5c; border-radius: 6px;
  padding: 8px 10px; color: #e0e0e0; font-size: .85rem;
}
.search-row { margin-bottom: 14px; }

/* ─── Records list ─── */
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #2a3a5c;
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
}
.rec-item:hover { border-color: rgba(200,169,81,.4); }
/* v0.79：交易記錄每行排序號碼（1、2、3…，跨頁連續）*/
.rec-item .idx { min-width: 26px; text-align: right; font-size: .72rem; color: #8a97b5; font-variant-numeric: tabular-nums; }
.rec-item .d { font-size: .75rem; color: #6a7a9a; min-width: 82px; }
.rec-item .t { font-size: .7rem; font-weight: 700; border-radius: 4px; padding: 3px 8px; }
.rec-item .t.exp { background: rgba(224,112,112,.15); color: #e07070; }
.rec-item .t.inc { background: rgba(111,207,151,.15); color: #6fcf97; }
.rec-item .c { font-size: .7rem; background: rgba(200,169,81,.12); border-radius: 4px; padding: 3px 8px; color: #c8a951; }
.rec-item .desc { flex: 1; min-width: 130px; font-size: .86rem; color: #e0e0e0; }
.rec-item .sup { font-size: .72rem; color: #6a7a9a; }
/* v0.22：支付方式獨立成欄（用戶要求「對會計對數有幫助」）—— 唔再同供應商黐埋一齊 */
.rec-item .pay {
  font-size: .7rem;
  color: #8fd4b0;
  background: rgba(111, 207, 151, .10);
  border: 1px solid rgba(111, 207, 151, .30);
  border-radius: 4px;
  padding: 3px 9px;
  white-space: nowrap;
  min-width: 92px;
  text-align: center;
}
.rec-item .pay:empty { display: none; }
/* v0.46 家庭版：成員獨立成欄（同一套藥丸樣式，唔同色以資識別） */
.rec-item .mem {
  font-size: .7rem; color: #9fb8e8; background: rgba(91,141,238,.12);
  border: 1px solid rgba(91,141,238,.35); border-radius: 4px;
  padding: 2px 8px; margin-left: 6px; white-space: nowrap;
}
.rec-item .mem:empty { display: none; }
.rec-item .amt { font-size: .95rem; font-weight: 700; min-width: 88px; text-align: right; }
.rec-item .amt.exp { color: #e07070; }
.rec-item .amt.inc { color: #6fcf97; }
.cyc-flag{
  border: 1px solid #4a6a8a; background: transparent; border-radius: 999px;
  padding: 4px 12px; font-size: .74rem; font-weight: 700; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s; white-space: nowrap;
}
.cyc-flag.is-unpaid{ border-color: rgba(200,169,81,.65); color: #d4b865; }
.cyc-flag.is-unpaid:hover{ background: rgba(200,169,81,.16); }
.cyc-flag.is-paid{ border-color: rgba(111,207,151,.55); color: #6fcf97; }
.cyc-flag.is-paid:hover{ background: rgba(111,207,151,.16); }
.rec-del { border: 1px solid #5c2a3a; background: transparent; color: #cc5555; border-radius: 5px; padding: 5px 10px; cursor: pointer; font-size: .72rem; transition: background .2s; }
.rec-del:hover { background: rgba(204,85,85,.12); }
.rec-del.bk-btn { border-color: #2a3a5c; color: #c8a951; }
.rec-del.bk-btn:hover { background: rgba(200,169,81,.08); }

/* ─── Pager ─── */
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 16px; font-size: .8rem; color: #8a9aba; }
.pager .btn:disabled { opacity: .4; cursor: default; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 30px 20px; color: #4a5a7a; font-size: .92rem; }

/* ─── Bar list（統計）─── */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-name { width: 108px; font-size: .8rem; color: #8a9aba; flex-shrink: 0; }
.bar-track { flex: 1; background: #0f1a30; border-radius: 5px; height: 24px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #c8a951, #e0c878); min-width: 4px; }
.bar-fill.green { background: linear-gradient(90deg, #3d9b6a, #6fcf97); }
.bar-fill.red { background: linear-gradient(90deg, #b04a4a, #e07070); }
.bar-val { width: 108px; text-align: right; font-size: .8rem; font-weight: 700; color: #e0e0e0; flex-shrink: 0; }
.bar-pct { width: 40px; text-align: right; font-size: .7rem; color: #6a7a9a; flex-shrink: 0; }

/* ─── Backup ─── */
.backup-status { display: flex; flex-direction: column; gap: 8px; font-size: .92rem; margin-bottom: 14px; color: #8a9aba; line-height: 1.6; }
.backup-status b { color: #c8a951; }

/* ─── 類別管理 ─── */
.cat-manage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cat-col { border: 1px solid #2a3a5c; border-radius: 8px; padding: 14px; background: rgba(255,255,255,.02); }
.cat-col-title { font-size: .85rem; font-weight: 600; color: #c8a951; margin-bottom: 10px; }
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #0f1a30; border-radius: 6px; }
.cat-row .cat-name { flex: 1; font-size: .8rem; color: #e0e0e0; }
.cat-row .cat-del { border: 0; background: transparent; color: #cc5555; cursor: pointer; font-size: .85rem; padding: 2px 6px; border-radius: 4px; }
.cat-row .cat-del:hover { background: rgba(204,85,85,.15); }
.rec-item .ct-total { color: #c8a951 !important; font-weight: 600; }
.dash-toolbar { flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-toolbar .dash-lbl { color: #c8d4ea; font-size: .82rem; font-weight: 600; margin-right: 2px; }
.dash-toolbar select, .dash-toolbar input[type=date] { height: 34px; padding: 4px 10px; background: #0f1a30; border: 1px solid #2a3a5c; border-radius: 8px; color: #eaf0fb; font-size: .82rem; }
.dash-toolbar select:focus, .dash-toolbar input[type=date]:focus { border-color: #c8a951; outline: none; }
.dash-toolbar .dash-sep { color: #8fa3c8; }
/* ⚠️ app 會把 input[type=date] 包入 .date-field（display:block; width:100%）——
   喺工具列內要改回 inline，否則會撐滿整行逼到斷行 */
.dash-toolbar .date-field { display: inline-block; width: auto; }
.dash-toolbar .date-field input[type=date] { width: 152px; }
/* 2026-10-09：交易記錄頁「日期 由／至」篩選（同一道理，工具列內要 inline） */
/* 2026-10-09：交易記錄頁「日期 由／至」—— 獨立一行（塞入 flex 工具列會被 blockify + 換行，
   追過一輪先發現純粹係 flex 正常行為）。⚠️ .date-field 要有 width:auto 否則全寬。 */
.flt-range-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; max-width: 100%; }
.flt-range-row .date-field { width: auto; min-width: 0; flex: 0 0 auto; position: relative; }
/* 日期欄要同其他輸入框同一套深色主題（原本落到瀏覽器預設白底，同版面唔夾） */
.flt-range-row input[type=date], .flt-range-row input[type=month], .flt-range-row input[type=datetime-local] {
  height: 34px; padding: 4px 10px; background: #0f1a30; border: 1px solid #2a3a5c;
  border-radius: 8px; color: #eaf0fb; font-size: .82rem; width: 134px; min-width: 0;
}
.flt-range-row input[type=date]:focus, .flt-range-row input[type=month]:focus { border-color: #c8a951; outline: none; }
.flt-lbl { font-size: 13px; color: #8794A8; }
.flt-sep { font-size: 13px; color: #8794A8; }
.dash-range { margin-left: auto; color: #c8a951; font-size: .82rem; font-weight: 600; background: rgba(200,169,81,.10); border: 1px solid rgba(200,169,81,.35); border-radius: 999px; padding: 4px 12px; }
.cat-row.pay-row { gap: 6px; }
.cat-row .pay-acct { flex: 0 0 auto; height: 30px; font-size: .72rem; padding: 2px 6px; background: #0f1a30; border: 1px solid #2a3a5c; border-radius: 6px; color: #c8d4ea; max-width: 190px; }
.cat-row .pay-acct:focus { border-color: #c8a951; outline: none; }
.cat-row .cat-edit { border: 0; background: transparent; color: #c8a951; cursor: pointer; font-size: .85rem; padding: 2px 6px; border-radius: 4px; }
.cat-row .cat-edit:hover { background: rgba(200,169,81,.15); }
.cat-add-row { display: flex; gap: 6px; }
.cat-add-row input {
  flex: 1; background: #0f1a30; border: 1px solid #2a3a5c; border-radius: 6px;
  padding: 7px 10px; color: #e0e0e0; font-size: .8rem;
}
.cat-add-row input:focus { border-color: #c8a951; outline: none; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: #1b2a4a;
  border: 1px solid #2a3a5c;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #2a3a5c;
}
.modal-head h3 { color: #c8a951; font-size: 1rem; }
.modal-x { border: 0; background: transparent; color: #6a7a9a; font-size: 1rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.modal-x:hover { color: #e0e0e0; background: rgba(255,255,255,.05); }
.modal-body { padding: 18px 20px; font-size: .88rem; line-height: 1.7; color: #c8d4ea; }
.modal-body .m-line { margin: 4px 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; border-top: 1px solid #2a3a5c; }

/* ─── About ─── */
.about p { margin: 7px 0; font-size: .83rem; line-height: 1.7; color: #8a9aba; }
.about .warn-text { color: #e0a04a; }
.about .ver-text { margin-top: 14px; font-size: .7rem; color: #4a5a7a; }

/* ─── 手機／平板（≤900px）：頂部橫向導航，內容全寬 ─── */
@media screen and (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100% !important; flex-direction: column; overflow: visible; border-right: 0; border-bottom: 1px solid #2a3a5c; }
  .sidebar-brand { border-bottom: 0; padding: 10px 14px 4px; }
  .sidebar-brand h1 { font-size: .95rem; }
  .sidebar-brand .sub, .sidebar-brand .tag { font-size: .68rem; }
  .sidebar-nav { flex: none; display: block; }
  .sidebar-nav .nav-list { display: flex; flex-direction: row; gap: 2px; overflow-x: auto; padding: 6px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sidebar-nav .nav-list::-webkit-scrollbar { height: 0; }
  .nav-item { padding: 8px 12px; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; flex-shrink: 0; }
  .nav-item.active { border-left: 0; border-bottom-color: #c8a951; }
  .sidebar-nav .drag-hint { display: none; }
  .sidebar-lang { padding: 4px 14px 10px; margin-top: 0; border-top: 0; }
  .sidebar-lang .btn { width: auto; padding: 6px 14px; }
  .sidebar-foot { display: none; }
  .sidebar-resizer { display: none; }
  .content { padding: 16px 14px 70px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 6px; }
  .topbar h2 { font-size: .9rem; }
  .cat-manage { grid-template-columns: 1fr; }
  .kpi-card .value { font-size: 1.2rem; }
  .chart { height: 140px; }
  /* 表格／名錄等寬內容：容許橫向滾動，唔好撐爆版面 */
  .table-wrap, .rec-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 560px; }
}

/* ─── 開單（v0.3）─── */
.bill-type-row { display: flex; gap: 12px; margin-bottom: 14px; }
.bill-type {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #2a3a5c; border-radius: 20px;
  padding: 8px 16px; font-size: .85rem; color: #8a9aba;
  cursor: pointer; transition: all .2s;
}
.bill-type:has(input:checked) { border-color: #c8a951; color: #c8a951; background: rgba(200,169,81,.08); }
.bill-type input { accent-color: #c8a951; cursor: pointer; }
.chk-row { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: #8a9aba; cursor: pointer; }
.chk-row input { accent-color: #c8a951; cursor: pointer; }

/* 收據／報價單 A4 紙張預覽（白紙黑字，與深色界面形成對比） */
.bill-sheet {
  background: #ffffff;
  color: #000000;
  border: 1px solid #6a7a9a;
  border-radius: 4px;
  padding: 30px 34px;
  max-width: 620px;
  margin: 0 auto;
  font-family: "Microsoft JhengHei", "PMingLiU", "Noto Sans TC", sans-serif;
  line-height: 1.55;
}
.bill-sheet * { color: #000000; }
.bs-head { text-align: center; margin-bottom: 22px; }
.bs-company { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; }
.bs-company-en { font-size: .82rem; font-weight: 700; letter-spacing: 1px; color: #333 !important; margin-top: 1px; }
.bs-sub { font-size: .72rem; color: #333 !important; margin-top: 2px; }
.bs-title {
  text-align: center; font-size: 1.55rem; font-weight: 800;
  letter-spacing: 12px; margin-bottom: 18px;
  border-bottom: 2px solid #333; padding-bottom: 10px;
}
.bs-meta { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 10px; }
.bs-row { display: flex; gap: 8px; font-size: .9rem; padding: 5px 0; }
.bs-row .k { flex-shrink: 0; color: #333 !important; }
.bs-row .v { flex: 1; }
.bs-amount-wrap { border-top: 1px solid #999; border-bottom: 1px solid #999; margin: 12px 0; padding: 12px 0; }
.bs-amount { display: flex; justify-content: space-between; align-items: baseline; }
.bs-amount .lab { font-size: .85rem; }
.bs-amount .num { font-size: 1.7rem; font-weight: 800; }
.bs-cn { font-size: .78rem; color: #222 !important; margin-top: 6px; text-align: right; }
.bs-sign { display: flex; gap: 40px; margin-top: 34px; font-size: .82rem; }
.bs-sign .sig { flex: 1; border-top: 1px solid #555; padding-top: 6px; text-align: center; color: #333 !important; }
.bs-foot { text-align: center; margin-top: 30px; font-size: .8rem; color: #333 !important; }
/* 粮單（薪金單）明細表格 */
.bs-salary-table { border: 1px solid #999; margin: 12px 0; }
.bs-st-row { display: flex; justify-content: space-between; padding: 8px 10px; font-size: .88rem; border-bottom: 1px dashed #bbb; }
.bs-st-row:last-child { border-bottom: 0; }
.bs-st-row span:first-child { color: #333 !important; }
.bs-st-row span:last-child { font-weight: 600; text-align: right; }

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #ffffff !important; }
  body * { visibility: hidden !important; }
  #billPreview, #billPreview * { visibility: visible !important; }
  /* 唔打印嘅區域徹底隱藏（display:none 唔佔位）——唔會再逼出第 2 頁空白 */
  .sidebar, .sidebar-resizer, .topbar,
  .content > section:not(#bill),
  #bill .page-title,
  #bill .card:not(:has(#billPreview)),
  #bill .card #billPrevEmpty,
  #bill .card #billActions { display: none !important; }
  /* 單據卡：淨低佢一個，佔滿一頁 */
  #bill .card:has(#billPreview) {
    display: block !important;
    background: #ffffff !important;
    border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important; padding: 0 !important;
  }
  #billPreview {
    display: block !important;
    position: static !important;
    width: 100% !important; max-width: none !important;
    margin: 0 !important; border: 0 !important; border-radius: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
  .bill-sheet { border: 0 !important; }
}
@media screen and (max-width: 900px) {
  .bill-sheet { padding: 18px 16px; }
  .bs-sign { flex-direction: column; gap: 14px; }
}

/* ─── 開單項目明細（可加可減） ─── */
.bill-lines-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; gap: 10px; }
.form-section-label { font-size: .88rem; font-weight: 600; color: #c8a951; }
.btn-sm { padding: 6px 12px; font-size: .75rem; }
.bill-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bill-line { display: flex; gap: 8px; align-items: center; }
.bill-line .bl-name { flex: 1; min-width: 140px; }
.bill-line .bl-qty { width: 64px; }
.bill-line .bl-price { width: 100px; }
.bill-line input {
  background: #0f1a30; border: 1px solid #2a3a5c; border-radius: 6px;
  padding: 8px 10px; color: #e0e0e0; font-size: .82rem;
}
.bill-line input:focus { border-color: #c8a951; outline: none; }
.bill-line .bl-sub { width: 92px; text-align: right; font-size: .82rem; color: #c8a951; font-weight: 600; flex-shrink: 0; }
.bill-line .bl-del {
  border: 1px solid #5c2a3a; background: transparent; color: #cc5555;
  border-radius: 5px; width: 30px; height: 34px; cursor: pointer; flex-shrink: 0; font-size: .75rem;
}
.bill-line .bl-del:hover { background: rgba(204,85,85,.12); }
.amount-group { margin-bottom: 12px; }
.amount-group input { font-size: 1.05rem; font-weight: 700; color: #c8a951; }
.amount-group input[readonly] { background: rgba(200,169,81,.06); border-color: rgba(200,169,81,.35); }
.hint-text { font-size: .95rem; color: #6a7a9a; }

/* 收據／報價單內嘅項目明細行 */
.bs-items { margin: 10px 0 4px; }
.bs-items-head, .bs-items-row { display: flex; gap: 10px; font-size: .82rem; }
.bs-items-head { font-weight: 700; border-bottom: 2px solid #555; padding: 4px 0; }
.bs-items-row { border-bottom: 1px dotted #aaa; padding: 4px 0; }
.bs-items-head span:nth-child(1), .bs-items-row span:nth-child(1) { flex: 3; }
.bs-items-head span:nth-child(2), .bs-items-row span:nth-child(2) { flex: 1; text-align: right; }
.bs-items-head span:nth-child(3), .bs-items-row span:nth-child(3) { flex: 2; text-align: right; }
.bs-items-head span:nth-child(4), .bs-items-row span:nth-child(4) { flex: 2; text-align: right; }
@media screen and (max-width: 900px) {
  .bill-lines-head { flex-direction: column; align-items: flex-start; }
  .bill-line { flex-wrap: wrap; }
  .bill-line .bl-name { min-width: 100%; order: -1; }
  .bill-line .bl-qty, .bill-line .bl-price { flex: 1; }
}
.input-with-btn{display:flex;gap:6px;align-items:center;}
.input-with-btn input{flex:1;min-width:0;}
.dl-btn{padding:8px 12px;border:1px solid #2a3a5c;border-radius:6px;background:#0f1a30;color:#c8a951;cursor:pointer;font-size:.8rem;flex-shrink:0;}
.dl-btn:hover{border-color:#c8a951;background:rgba(200,169,81,.08);}
.hint-text{font-size:.95rem;color:#6a7a9a;margin-top:2px;}



.name-arrow{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNCcgaGVpZ2h0PSc4Jz48cGF0aCBkPSdNMSAxbDYgNiA2LTYnIHN0cm9rZT0nIzkwYTRjOCcgc3Ryb2tlLXdpZHRoPScyJyBmaWxsPSdub25lJy8+PC9zdmc+");background-repeat:no-repeat;background-position:right 12px center;background-size:14px 8px;padding-right:38px;cursor:pointer;-webkit-appearance:none;appearance:none;}

.name-arrow-wrap{position:relative;display:block;}
.name-arrow-wrap input{padding-right:38px;-webkit-appearance:none;appearance:none;cursor:pointer;}
.name-arrow-wrap::after{content:"▾";position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#90a4c8;font-size:14px;pointer-events:none;}

/* 電話可加可減（上圖樣式：每行輸入框+紅✕、底部新電話+➤加） */
.tel-row{display:flex;gap:6px;align-items:center;margin-bottom:6px}
.tel-row input{flex:1;min-width:0}
.tel-del{width:34px;min-height:34px;border:1px solid #c0392b;border-radius:6px;background:rgba(192,57,43,.12);color:#e74c3c;font-size:.85rem;cursor:pointer;flex-shrink:0}
.tel-del:hover{background:#c0392b;color:#fff}
.tel-add-row{display:flex;gap:8px;margin-top:8px;align-items:center}
.tel-add-row .tel-new{flex:1;min-width:0}

/* 出糧 MPF 行 */
.mpf-line{margin-top:8px;font-size:.78rem;color:#90a4c8}
.mpf-line b{color:#c8a951}
/* 月歷圖標：深色主題下原黑色 → 白色 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator{filter:invert(1);cursor:pointer}

/* ─── 平板／觸屏優化（2026-09-08） ─── */
/* 觸屏粗指針（手指/觸控筆）加大按鈕同輸入區，防 iOS 聚焦自動縮放 */
@media (pointer: coarse) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 16px; }
  .btn, .btn-outline, .btn-danger, .btn-gold, .btn-mic { min-height: 44px; padding: 10px 18px; font-size: .95rem; }
  .btn-sm { min-height: 40px; padding: 8px 14px; font-size: .82rem; }
  .rec-del { min-height: 38px; padding: 7px 12px; font-size: .8rem; }
  input, select, textarea { font-size: 16px !important; }  /* 16px 以上先唔會喺 iOS 聚焦時自動 zoom */
  .search-input { min-height: 42px; }
  .nav-item { padding: 15px 20px; font-size: .95rem; }
  .nav-item .icon { font-size: 1.3rem; width: 30px; }
  .form-group label { font-size: .85rem; }
  .sidebar-resizer { width: 12px; }  /* 觸屏把手加粗，容易揸 */
  .sidebar-resizer:hover, .sidebar-resizer:active { background: rgba(200,169,81,.35); }
  .rec-item { padding: 14px 14px; gap: 8px; }
  .kpi-card { padding: 14px; }
  .pager button { min-height: 40px; padding: 8px 14px; }
  .page-title { font-size: 1.15rem; }
}
/* 觸屏禁長按彈系統選單（導航/列表操作區） */
@media (pointer: coarse) {
  .nav-item, .btn, .btn-outline, .btn-danger, .rec-del, .toolbar button { -webkit-touch-callout: none; }
}

/* ⚠️ 2026-10-03：`hidden` 屬性要真正隱藏得成。
   瀏覽器預設只有 `[hidden]{display:none}`（優先級極低），任何自訂 display
   （例：`.date-field{display:block}`）都會蓋過它 → 元素明明 hidden=true 仍然顯示。
   實測後果：英文模式下，被隱藏嘅日期欄 wrapper 照樣佔位，入面嘅 YYYY-MM-DD
   提示（絕對定位）就疊喺「查詢」掣上面（桌面／平板／手機都中）。
   加 !important 一次過修正所有同類情況。 */
[hidden] { display: none !important; }

/* ─── 授權狀態（2026-09-08） ─── */
.lic-free { color: #d18a3a; }
.lic-pro  { color: #41b883; }

/* ─── 日期欄位：英文模式自訂佔位（2026-09-22） ───
   原生 input[type=date] 嘅「年/月/日」係跟瀏覽器語言，唔跟頁面語言；
   英文模式下把空欄位嘅原生文字變透明，改用 YYYY-MM-DD 提示。 */
.date-field { position: relative; display: block; width: 100%; }
/* 2026-10-09：日期提示文字垂直居中（配合 34px 高嘅輸入框） */
.date-ph { line-height: 34px; }
.date-ph {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: #4a5a7a; font-size: .9rem; font-family: inherit;
  display: none; line-height: 1; white-space: nowrap;
}
html[lang="en"] input[type="date"]:not([data-filled])::-webkit-datetime-edit { color: transparent; }
html[lang="en"] input[type="month"]:not([data-filled])::-webkit-datetime-edit { color: transparent; }
html[lang="en"] input[type="datetime-local"]:not([data-filled])::-webkit-datetime-edit { color: transparent; }

/* ==== 2026-09-24 新增：首次啟動提示橫幅 ==== */
.setup-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 12px 14px; border: 1px solid #f5b301; border-radius: 10px;
  background: rgba(245, 179, 1, .10); color: #ffd166; font-size: 14px; line-height: 1.5; }
.setup-banner span { flex: 1 1 320px; }
.setup-banner[hidden], #bUnsettledRow[hidden] { display: none !important; }
/* ==== 已開單據：「未收錢」標記 ==== */
#billList .pay.warn { color: #f5b301; border-color: #f5b301; }

/* ==== 2026-09-24 v0.7：繁英切換鈕固定在側欄（設定下面），唔參與導航拖拽排序 ==== */
.sidebar-lang { padding: 10px 14px 2px; margin-top: 8px; border-top: 1px solid rgba(200, 169, 81, .22); }
.sidebar-lang .btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 6px; }




/* ==== v0.46 家庭版：資產負債表 A4 打印 ====
   ⚠️ 深色主題直接印會用晒墨而且底色會變白 → 打印時轉白底黑字，只印 KPI ＋ 資產 ＋ 負債。 */
@media print {
  body.print-netw .content > section#netw { display: block !important; }
  body.print-netw .content > section:not(#netw) { display: none !important; }
  body.print-netw #billPreview, body.print-netw #billPreview * { visibility: hidden !important; }
  body.print-netw #netw, body.print-netw #netw * { visibility: visible !important; }
  body.print-netw #netw, body.print-netw #netw * {
    -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important;
  }
  body.print-netw .sidebar, body.print-netw .sidebar-resizer, body.print-netw .topbar,
  body.print-netw .setup-banner, body.print-netw .nw-print-hide,
  body.print-netw #netw .card:not(.nw-print), body.print-netw #netw .hint-text { display: none !important; }
  body.print-netw #netw { background: #ffffff !important; color: #111111 !important; padding: 0 !important; }
  body.print-netw #netw .card {
    background: #ffffff !important; border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; padding: 0 !important; margin: 0 0 16px !important;
  }
  body.print-netw #netw .card-header {
    color: #1b2a4a !important; background: #ffffff !important; font-size: 13px !important;
    border-bottom: 1.5px solid #1b2a4a !important; padding: 0 0 6px !important; margin-bottom: 8px !important;
  }
  body.print-netw #netw .kpi-grid { display: flex !important; gap: 10px !important; margin-bottom: 14px !important; }
  body.print-netw #netw .kpi-card {
    background: #f4f7fb !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important;
    padding: 8px 10px !important; flex: 1 !important;
  }
  body.print-netw #netw .kpi-card .label { color: #5c6a7e !important; font-size: 10px !important; }
  body.print-netw #netw .kpi-card .value { font-size: 15px !important; color: #1b2a4a !important; }
  body.print-netw #netw .kpi-card .value.green { color: #0d6b3f !important; }
  body.print-netw #netw .kpi-card .value.red { color: #b3261e !important; }
  body.print-netw #netw .nw-row {
    display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important;
    border-bottom: 1px solid #d7dee8 !important; padding: 4px 0 !important;
  }
  /* ⚠️ 打印頁寬 794px 會觸發手機版 media query（flex-wrap:wrap + order），令金額跌行、自動行倒轉 → 全部打回原狀 */
  body.print-netw #netw .nw-row > .nw-name { flex: 1 1 auto !important; order: 0 !important; min-width: 0 !important; }
  body.print-netw #netw .nw-row .nw-in { order: 0 !important; flex-shrink: 0 !important; }
  body.print-netw #netw .nw-row .nw-auto { order: 0 !important; margin-left: auto !important; }
  body.print-netw #netw .nw-row .nw-tag { order: 0 !important; margin-left: 0 !important; }
  body.print-netw #netw .nw-row.auto { background: #ffffff !important; }
  body.print-netw #netw .nw-row .nw-name { color: #111111 !important; font-size: 11.5px !important; }
  body.print-netw #netw .nw-row.auto .nw-name { color: #1b2a4a !important; }
  body.print-netw #netw input.nw-in {
    border: 0 !important; background: transparent !important; color: #111111 !important;
    font-size: 11.5px !important; width: 130px !important; padding: 0 !important; text-align: right !important;
  }
  body.print-netw #netw .nw-auto, body.print-netw #netw .nw-tag { color: #1b2a4a !important; font-size: 11.5px !important; }
  body.print-netw #netw .nw-tag { background: #e8eef7 !important; border: 1px solid #cbd5e1 !important; }
  body.print-netw #netw .nw-total { border-top: 2px solid #1b2a4a !important; color: #111111 !important; font-size: 12.5px !important; }
  body.print-netw #netw .cat-edit, body.print-netw #netw .cat-del,
  body.print-netw #netw .rec-del, body.print-netw #netw .nw-btns { display: none !important; }
  body.print-netw #netw .page-title { color: #1b2a4a !important; font-size: 16px !important; margin-bottom: 10px !important; }
}

/* ==== v0.46 家庭版：資產負債表 ==== */
.nw-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #1a2540; }
.nw-row > .nw-name { flex: 1; min-width: 0; font-size: .86rem; }
.nw-row .nw-in { width: 148px; flex-shrink: 0; background: #0e1a30; border: 1px solid #2a3a5c; border-radius: 6px;
  color: #e0e0e0; padding: 7px 9px; font-family: inherit; font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; }
.nw-row .nw-in:focus { outline: 0; border-color: #c8a951; }
.nw-row.auto { background: rgba(91,141,238,.06); border-radius: 6px; padding-left: 8px; padding-right: 8px; }
.nw-row.auto .nw-name { color: #9fb8e8; }
.nw-auto { font-size: .86rem; font-weight: 600; color: #9fb8e8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nw-tag { font-size: .66rem; padding: 2px 7px; border-radius: 9px; background: rgba(91,141,238,.18); color: #8bb0ff; flex-shrink: 0; }
.nw-total { display: flex; justify-content: space-between; padding: 11px 0 0; margin-top: 6px;
  border-top: 2px solid #c8a951; font-size: .95rem; font-weight: 700; }
@media (max-width: 760px) {
  .nw-row { flex-wrap: wrap; }
  .nw-row .nw-in { width: 110px; }
  .nw-row > .nw-name { flex: 1 1 100%; order: 1; }
  .nw-row .nw-in { order: 2; }
  .nw-row .cat-edit, .nw-row .cat-del { order: 3; }
  .nw-row.auto .nw-auto { margin-left: auto; }
}

/* ==== v0.46 家庭版：週期帳單 ==== */
.bud-over { color: #e07070; }
.bud-total { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #2a3a5c; font-size: .86rem; font-weight: 600; }
.bud-total.warn { color: #e0a04a; }
.budget-edit-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #1a2540; }
.budget-edit-row > span { flex: 1; font-size: .86rem; min-width: 0; }
.budget-edit-row input { width: 132px; flex-shrink: 0; background: #0e1a30; border: 1px solid #2a3a5c; border-radius: 6px; color: #e0e0e0; padding: 7px 9px; font-family: inherit; font-size: .85rem; }
.budget-edit-row input:focus { outline: 0; border-color: #c8a951; }
.cyc-main { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1e2c4a; }
.cyc-main:last-child { border-bottom: 0; }
.cyc-d { width: 54px; text-align: center; background: #14203a; border: 1px solid #2a3a5c; border-radius: 7px; padding: 5px 0; flex-shrink: 0; }
.cyc-d b { display: block; font-size: .95rem; color: #c8a951; line-height: 1.15; }
.cyc-d span { font-size: .62rem; color: #4a5a7a; }
.cyc-d.soon { border-color: #e07070; }
.cyc-d.soon b { color: #e07070; }
.cyc-info { flex: 1; min-width: 0; }
.cyc-name { font-size: .88rem; }
.cyc-sub { font-size: .72rem; color: #6a7a9a; margin-top: 2px; }
.cyc-amt { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.cyc-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
@media (max-width: 760px) {
  .budget-edit-row input { width: 96px; }
  .cyc-main { flex-wrap: wrap; }
  .cyc-acts { margin-left: auto; }
}

/* ==== v0.9.1：出糧列出糧算式獨佔一行，唔會擠走改／刪按鈕 ==== */
#payList .rec-item .pay-detail { flex: 1 1 100%; order: 9; line-height: 1.65; }

/* v0.10：交易記錄列「已收／已付 日期」徽章 */
.rec-item .t.paid { background: rgba(111, 207, 151, .15); color: #6fcf97; }

/* v0.10.1：對話窗日期欄（白底 bug：唔在 .form-group 底下所以冇繼承樣式；日曆圖示被反白 → 白底上睇唔到）*/
.modal-body input[type="date"], .modal-body input[type="month"] { max-width: 210px; }

/* ==== 2026-10-01 v0.11：員工目錄分頁（數字員工接上初版）====
   沿用本系統色票：深空藍黑 #0c1428／卡 #1b2a4a／邊框 #2a3a5c／金 #c8a951
   一律唔引入其他產品嘅風格。 */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; margin-bottom: 26px; }
.staff-card {
  background: #1b2a4a; border: 1px solid #2a3a5c; border-radius: 10px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s;
}
.staff-card:hover { border-color: rgba(200,169,81,.45); }
.staff-card.soon { opacity: .62; }
.staff-head { display: flex; align-items: center; gap: 12px; }
.staff-avatar {
  width: 44px; height: 44px; flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.4rem;
  background: linear-gradient(135deg, #24345a, #1b2a4a);
  border: 1px solid #2a3a5c; border-radius: 10px;
}
.staff-info { flex: 1; min-width: 0; }
.staff-name { font-size: .98rem; font-weight: 700; color: #c8a951; }
.staff-role { font-size: .85rem; color: #6a7a9a; margin-top: 2px; }
.staff-badge {
  font-size: .66rem; font-weight: 700; border-radius: 20px; padding: 4px 10px; white-space: nowrap;
  background: rgba(111,207,151,.15); color: #6fcf97; border: 1px solid rgba(111,207,151,.35);
}
.staff-badge.soon { background: rgba(224,160,74,.12); color: #e0a04a; border-color: rgba(224,160,74,.35); }
.staff-live {
  font-size: .88rem; color: #8a9aba; background: #0f1a30;
  border: 1px solid #2a3a5c; border-radius: 6px; padding: 7px 11px;
  display: flex; align-items: baseline; gap: 7px;
}
.staff-live b { color: #c8a951; font-size: .95rem; }
.staff-sec { display: flex; flex-direction: column; gap: 5px; }
.staff-sec-t { font-size: .74rem; font-weight: 700; color: #8a9aba; letter-spacing: .3px; }
.staff-sec-t.no { color: #e07070; }
.staff-ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.staff-ul li { font-size: .9rem; color: #c8d4ea; line-height: 1.55; padding-left: 13px; position: relative; }
.staff-ul li::before { content: "\00b7"; position: absolute; left: 3px; color: #6a7a9a; font-weight: 700; }
.staff-go { margin-top: auto; width: 100%; justify-content: center; }
.staff-go:disabled { opacity: .45; cursor: default; }

/* 協作鏈 */
.chain-list { display: flex; flex-direction: column; gap: 10px; }
.chain-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid #2a3a5c; border-radius: 8px; padding: 11px 14px;
  background: rgba(255,255,255,.02);
}
.chain-name { font-size: .82rem; font-weight: 700; color: #c8a951; min-width: 96px; }
.chain-flow { font-size: .8rem; color: #c8d4ea; }
.chain-flow b { color: #c8a951; }
.chain-gate {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px;
  background: rgba(224,160,74,.10); border: 1px solid rgba(224,160,74,.35);
  color: #e0a04a; font-size: .92rem; line-height: 1.6;
}
@media screen and (max-width: 900px) { .staff-grid { grid-template-columns: 1fr; } }

/* ==== 2026-10-02：修正「電話」欄輸入框比其他欄低 12px ====
   原因：.tel-list 空嘅仍佔一個 flex 格（+4px gap），而 .tel-add-row 自己又有 margin-top:8px
   → 4+8 = 12px 偏差。修法：空 list 唔佔位 + .form-group 內唔要 margin-top。 */
.form-group .tel-list:empty { display: none; }
.form-group .tel-add-row { margin-top: 0; }

/* ==== v0.12：出糧 MPF「規則設定」面板 ==== */
.rules-line { color: #c8a951; font-weight: 600; margin-top: 10px; }
.rules-box { margin-top: 14px; border-top: 1px solid #2a3a5c; padding-top: 10px; }
.rules-box > summary {
  cursor: pointer; font-size: .92rem; color: #8a9aba; font-weight: 600;
  padding: 7px 0; list-style: none; outline: none;
}
.rules-box > summary::-webkit-details-marker { display: none; }
.rules-box > summary::before { content: "\25B8 \0020"; color: #6a7a9a; }
.rules-box[open] > summary::before { content: "\25BE \0020"; }
.rules-box > summary:hover { color: #c8a951; }
.rules-body { padding: 8px 0 2px; }
.rules-note { font-size: .9rem; color: #6a7a9a; line-height: 1.7; margin-bottom: 14px; }


/* ==================================================================
   單據版面 v2 —— 「經典企業」風格（2026-10-08 用戶批准）
   白底為主、深藍只用於線／表頭／合計；左品牌、右單號；無密集格線。
   ⚠️ 尾加覆蓋，唔改舊規則（cascade 勝出，可隨時移除本段還原）。
   ⚠️ print-color-adjust：瀏覽器預設唔印背景色，唔加嘅話深藍表頭會變白。
   ================================================================== */
.bill-sheet {
  background: #ffffff;
  color: #16202e;
  padding: 26px 30px 22px;
  font-size: 13px;
  line-height: 1.5;
}
/* 頂部：左品牌 ／ 右單號資料 */
.bs-top { display: flex; justify-content: space-between; align-items: flex-start;
          gap: 20px; border-bottom: 3px solid #1b2a4a; padding-bottom: 12px; margin-bottom: 16px; }
.bs-brand { min-width: 0; }
.bill-sheet .bs-company { font-size: 17px; font-weight: 800; color: #1b2a4a; line-height: 1.3; letter-spacing: .2px; }
.bill-sheet .bs-company-en { font-size: 10.5px; font-weight: 400; color: #5c6a7e; letter-spacing: .4px; margin-top: 2px; }
.bill-sheet .bs-sub { font-size: 10.5px; color: #5c6a7e; margin-top: 3px; line-height: 1.65; }
.bs-meta-box { text-align: right; flex: 0 0 auto; }
.bill-sheet .bs-doc { font-size: 19px; font-weight: 800; color: #1b2a4a;
                      letter-spacing: 1px; white-space: nowrap; margin-bottom: 5px; }
.bill-sheet .bs-meta-line { font-size: 11px; color: #5c6a7e; line-height: 1.7; white-space: nowrap; }
.bill-sheet .bs-meta-line .mk { color: #5c6a7e; margin-right: 6px; }
.bill-sheet .bs-meta-line .mv { color: #16202e; font-weight: 700; }

/* 資料行 */
.bill-sheet .bs-row { display: flex; gap: 10px; font-size: 12px; padding: 4px 0; }
.bill-sheet .bs-row .k { flex: 0 0 auto; color: #5c6a7e; }
.bill-sheet .bs-row .v { flex: 1; font-weight: 600; }

/* 項目明細 */
.bill-sheet .bs-items { margin: 14px 0 2px; }
.bill-sheet .bs-items-head, .bill-sheet .bs-items-row { display: flex; gap: 10px; font-size: 11.5px; }
.bill-sheet .bs-items-head { background: #1b2a4a; font-weight: 700; padding: 8px 10px; border-radius: 3px 3px 0 0; }
.bill-sheet .bs-items-head span { color: #ffffff; }
.bill-sheet .bs-items-row { padding: 9px 10px; border-bottom: 1px solid #e3e8ef; }
.bill-sheet .bs-items-row:nth-child(even) { background: #f4f7fb; }
.bill-sheet .bs-items-head span:nth-child(1), .bill-sheet .bs-items-row span:nth-child(1) { flex: 3; }
.bill-sheet .bs-items-head span:nth-child(2), .bill-sheet .bs-items-row span:nth-child(2) { flex: 1; text-align: right; }
.bill-sheet .bs-items-head span:nth-child(3), .bill-sheet .bs-items-row span:nth-child(3) { flex: 2; text-align: right; }
.bill-sheet .bs-items-head span:nth-child(4), .bill-sheet .bs-items-row span:nth-child(4) { flex: 2; text-align: right; }

/* 金額區 */
.bill-sheet .bs-amount-wrap { margin: 16px 0 0; display: flex; flex-direction: column;
                              align-items: flex-end; border: 0; padding: 0; }
.bill-sheet .bs-amount { display: flex; align-items: baseline; gap: 18px;
                         border-top: 2px solid #1b2a4a; border-bottom: 2px solid #1b2a4a; padding: 9px 4px; }
.bill-sheet .bs-amount .lab { font-size: 12px; color: #5c6a7e; }
.bill-sheet .bs-amount .num { font-size: 20px; font-weight: 800; color: #1b2a4a; white-space: nowrap; }
.bill-sheet .bs-cn { font-size: 11px; color: #5c6a7e; margin-top: 6px; text-align: right; }

/* 簽名 */
.bill-sheet .bs-sign { display: flex; gap: 36px; margin-top: 30px; }
.bill-sheet .bs-sign .sig { flex: 1; border-top: 1px solid #cdd6e2; padding-top: 6px;
                            font-size: 11px; color: #5c6a7e; text-align: center; }

/* 頁腳 */
.bill-sheet .bs-foot { text-align: center; margin-top: 22px; font-size: 11px; color: #5c6a7e;
                       border-top: 1px solid #e3e8ef; padding-top: 10px; }

/* 糧單明細表 */
.bill-sheet .bs-salary-table { border: 1px solid #e3e8ef; border-radius: 3px; margin: 14px 0; overflow: hidden; }
.bill-sheet .bs-st-row { display: flex; justify-content: space-between; padding: 8px 12px;
                         font-size: 12px; border-bottom: 1px solid #e3e8ef; }
.bill-sheet .bs-st-row:nth-child(even) { background: #f4f7fb; }
.bill-sheet .bs-st-row:last-child { border-bottom: 0; }
.bill-sheet .bs-st-row span:first-child { color: #5c6a7e; }
.bill-sheet .bs-st-row span:last-child { font-weight: 700; text-align: right; }

/* 舊標題樣式停用（改用 .bs-doc 喺右上） */
.bill-sheet .bs-title { display: none; }

/* ⚠️ 打印：強制出底色，否則深藍表頭／交替行底會變白 */
@media print {
  .bill-sheet, .bill-sheet * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .bill-sheet .bs-items-head { background: #1b2a4a !important; }
  .bill-sheet .bs-items-head span { color: #ffffff !important; }
  .bill-sheet .bs-items-row:nth-child(even) { background: #f4f7fb !important; }
  .bill-sheet .bs-st-row:nth-child(even) { background: #f4f7fb !important; }
  .bill-sheet .bs-top { border-bottom-color: #1b2a4a !important; }
}


/* ==================== 損益表（P&L）— 沿用「經典企業」風格 2026-10-08 ==================== */
.pl-sheet {
  background: #ffffff; color: #16202e; border-radius: 6px;
  padding: 26px 30px 22px; max-width: 620px; margin: 0 auto;
  font-family: "Microsoft JhengHei", "PMingLiU", "Noto Sans TC", sans-serif;
  font-size: 13px; line-height: 1.5;
}
.pl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  border-bottom: 3px solid #1b2a4a; padding-bottom: 12px; margin-bottom: 8px; }
.pl-brand { min-width: 0; }
.pl-co { font-size: 17px; font-weight: 800; color: #1b2a4a; line-height: 1.3; }
.pl-co-en { font-size: 10.5px; color: #5c6a7e; letter-spacing: .4px; margin-top: 2px; }
.pl-sub { font-size: 10.5px; color: #5c6a7e; margin-top: 3px; line-height: 1.6; }
.pl-meta { text-align: right; flex: 0 0 auto; }
.pl-ttl { font-size: 19px; font-weight: 800; color: #1b2a4a; letter-spacing: 1px; white-space: nowrap; margin-bottom: 5px; }
.pl-mline { font-size: 11px; color: #5c6a7e; line-height: 1.7; white-space: nowrap; }
.pl-empty { padding: 40px 0; text-align: center; color: #8b98a8; font-size: 13px; }
.pl-sec { margin-top: 16px; }
.pl-sec-h { font-size: 12.5px; font-weight: 800; color: #1b2a4a; padding-bottom: 5px; border-bottom: 1px solid #cdd6e2; }
.pl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 2px; font-size: 12.5px; }
.pl-row .k { color: #3a4a5e; min-width: 0; }
.pl-row .v { color: #16202e; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-sub-tot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 8px 2px 4px; margin-top: 4px; font-size: 12.5px; font-weight: 800;
  color: #1b2a4a; border-top: 1px solid #1b2a4a; }
.pl-sub-tot span:last-child { white-space: nowrap; }
.pl-net { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 13px 4px; margin-top: 18px; font-size: 17px; font-weight: 800; color: #1b2a4a;
  border-top: 2px solid #1b2a4a; border-bottom: 2px solid #1b2a4a; }
.pl-net span:last-child { white-space: nowrap; }
.pl-margin { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 7px 4px 0; font-size: 11.5px; color: #5c6a7e; }
.pl-margin span:last-child { white-space: nowrap; font-weight: 700; color: #1b2a4a; }
.pl-note { margin-top: 18px; padding-top: 10px; border-top: 1px solid #e3e8ef;
  font-size: 10.5px; color: #7a8798; line-height: 1.8; }
#print-only-pl { display: none; }

@media print {
  /* ⚠️ 原有規則 .content > section:not(#bill){display:none!important} 會連 #pnl 都收埋，
     所以要**明確**把 #pnl 及報表紙卡片撐返出嚟（specificity 要高過原規則） */
  body.print-pnl .content > section#pnl { display: block !important; }
  body.print-pnl .content > section#pnl .card#pnlCard { display: block !important; }
  body.print-pnl .content > section#pnl #pnlSheetBox { display: block !important; }
  body.print-pnl #billPreview, body.print-pnl #billPreview * { visibility: hidden !important; }
  body.print-pnl #pnlSheet, body.print-pnl #pnlSheet * { visibility: visible !important; }
  body.print-pnl .content > section:not(#pnl) { display: none !important; }
  body.print-pnl #pnl .page-title,
  body.print-pnl #pnl .card:not(#pnlCard),
  body.print-pnl #pnl .hint-text,
  body.print-pnl #pnl .toolbar { display: none !important; }
  body.print-pnl #pnlCard {
    display: block !important; background: #ffffff !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    margin: 0 !important; padding: 0 !important;
  }
  #pnlSheet, #pnlSheet * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ==================== 銀行總匯 2026-10-08 ==================== */
.bank-card { position: relative; padding-left: 16px !important; }
.bank-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; background: #c8a951; }
.bank-card.cash::before { background: #4ade80; }
.bank-card.wallet::before { background: #38bdf8; }
.bank-card.sav::before { background: #4da3ff; }
.bank-card.cur::before { background: #a78bfa; }
.bank-card.cc::before { background: #f87171; }
.bank-card.oth::before { background: #93a3bd; }
.bank-card .bank-no { font-size: 10.5px; color: #93a3bd; letter-spacing: .3px; margin-top: 2px; }
.bank-card .bank-rows { margin-top: 10px; padding-top: 9px; border-top: 1px solid #2a3a5c; font-size: 11.5px; color: #93a3bd; line-height: 1.85; }
.bank-card .bank-rows b { float: right; font-weight: 700; }
.bank-card .bank-rows b.grn { color: #4ade80; }
.bank-card .bank-rows b.rd { color: #f87171; }
.acct-no { font-size: 10.5px; color: #93a3bd; }
.acct-add-row { flex-wrap: wrap; }
.acct-add-row input, .acct-add-row select { min-width: 150px; }
.bank-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
.bank-table th { background: #1b2a4a; color: #fff; text-align: left; padding: 9px 10px; font-weight: 700; font-size: 11.5px; }
.bank-table th.r, .bank-table td.r { text-align: right; }
.bank-table td { padding: 8px 10px; border-bottom: 1px solid #24334f; font-variant-numeric: tabular-nums; }
.bank-table tr:nth-child(even) td { background: #16233d; }
.bank-table .open-row td { background: #12203a !important; color: #a9bbd8; }
.bank-table td.grn { color: #4ade80; }
.bank-table td.rd { color: #f87171; }


/* ==================== 出入賬明細表：窄屏可橫向滑（2026-10-08）====================
   8 欄表在手機（390px）放唔落，之前會被卡片切死（量到出界 171px）→ 改為可橫向滑動 */
#bankFlow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#bankFlow .bank-table { min-width: 660px; }
@media (max-width: 700px) {
  #bankFlow { margin: 0 -6px; }
  .bank-table th, .bank-table td { padding: 7px 8px; white-space: nowrap; }
}

/* ==== v0.49 週期帳單：今期交咗未 ==== */
.cyc-badge { display:inline-block; font-size:.68rem; padding:2px 8px; border-radius:10px; white-space:nowrap; margin-top:3px; }
.cyc-badge.due { background:rgba(233,90,90,.16); color:#ff9a9a; border:1px solid rgba(233,90,90,.45); }
.cyc-badge.ok  { background:rgba(72,199,142,.14); color:#7ee2b0; border:1px solid rgba(72,199,142,.38); }

/* v0.51 內部轉賬標籤色 */
.t.tr { background: rgba(120,140,255,.18); color: #8ea2ff; }
.amt.tr { color: #a8b6ff; }

/* ================= v0.68 總覽：各戶口結餘一覽（逐個戶口，含支付寶／微信等電子錢包）================= */
.acct-bal-list { display: flex; flex-direction: column; }
.ab-group { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
            margin: 13px 0 3px; font-size: .76rem; color: #8fa3c8; letter-spacing: .3px; }
.ab-group:first-child { margin-top: 0; }
.ab-group b { font-size: .82rem; color: #c8a951; font-variant-numeric: tabular-nums; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed #24365a; }
.ab-row:last-of-type { border-bottom: 0; }
.ab-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #8a7f6a; }
.ab-dot.cash { background: #4a9be0; }
.ab-dot.wallet { background: #38bdf8; }
.ab-dot.sav { background: #3d9b6a; }
.ab-dot.cur { background: #6f7fbf; }
.ab-dot.cc { background: #e07070; }
.ab-dot.other { background: #8a7f6a; }
.ab-name { font-size: .9rem; font-weight: 600; }
.ab-meta { font-size: .73rem; color: #6a7a9a; }
.ab-val { margin-left: auto; font-size: .95rem; font-weight: 700; color: #e8eefc; font-variant-numeric: tabular-nums; }
.ab-val.neg { color: #e07070; }
.ab-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
            margin-top: 10px; padding-top: 12px; border-top: 1px solid #2a3a5c; font-size: .88rem; font-weight: 700; }
.ab-total b { font-size: 1.05rem; color: #c8a951; font-variant-numeric: tabular-nums; }
.ab-total b.neg { color: #e07070; }

/* ================= v0.70：空狀態引導掣 ＋ 上手指精靈 ================= */
.empty-state .es-sub { font-size: 12.5px; color: #5f7095; margin-top: 6px; line-height: 1.6; }
.empty-state .es-btn { margin-top: 16px; margin-bottom: 4px; }
.wiz-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; font-size: 13.5px; }
.wiz-num { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #c8a951; color: #1b2a4a;
           align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: 0 0 22px; }
#onboardWiz .modal-body input { width: 100%; }
#onboardWiz .modal-box { max-width: 560px; }

/* ===================== v0.71 操作小幫手（純本機問答） ===================== */
.help-box { max-width: 680px; width: 92%; display: flex; flex-direction: column; max-height: 86vh; }
.help-box .modal-body { overflow-y: auto; }
#helpQ { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #33456b; background: #101d36; color: #e8eefc; font-size: 13.5px; }
#helpQ:focus { outline: none; border-color: #c8a951; }
.help-cats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 4px; }
.help-cats-label { font-size: 12px; color: #7d8db0; margin-right: 2px; }
.help-cats-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.help-chip { background: #16233d; border: 1px solid #2c3d61; color: #b9c6e0; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.help-chip:hover { border-color: #c8a951; color: #f0dfae; }
.help-chip.on { background: #2a2410; border-color: #c8a951; color: #f0dfae; }
.help-sec { font-size: 12px; color: #7d8db0; margin: 10px 0 6px; }
.help-list { max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.help-item { border: 1px solid #22304d; border-radius: 8px; margin-bottom: 6px; background: #121e35; }
.help-item.open { border-color: #c8a951; }
.help-q { padding: 10px 12px; font-size: 13.5px; color: #dfe7f7; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.help-q:hover { color: #f0dfae; }
.help-sign { color: #c8a951; flex: 0 0 auto; }
.help-a { padding: 0 12px 12px; font-size: 13px; color: #b9c6e0; line-height: 1.8; }
.help-go { margin-top: 10px; }
.help-none { font-size: 13px; color: #b9c6e0; line-height: 1.75; padding: 6px 2px; }
.help-more { font-size: 12px; color: #8b9abc; padding: 3px 2px 8px; }
.help-foot { padding: 10px 16px; border-top: 1px solid #22304d; font-size: 12px; color: #7d8db0; flex: 0 0 auto; }

/* ===== v0.83：🔢 計算機（家庭版）===== */
.calc-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.calc-main { flex: 1 1 320px; max-width: 440px; }
.calc-hist { flex: 1 1 280px; min-width: 260px; }
.calc-display { font-size: 2rem; font-weight: 700; text-align: right; padding: 12px 16px 2px;
  color: #e6ecf7; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; }
.calc-display.err { color: #e07070; font-size: 1.05rem; }
.calc-expr { text-align: right; padding: 0 16px 10px; min-height: 18px; font-size: .8rem; color: #8a97b5; }
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 14px 12px; }
.calc-btn { padding: 13px 0; font-size: 1.1rem; font-weight: 600; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid #2a3a5c; color: #e6ecf7; transition: background .12s, transform .06s; }
.calc-btn:hover { background: rgba(255,255,255,.1); }
.calc-btn:active { transform: scale(.97); }
.calc-btn.fn { color: #c8a951; background: rgba(200,169,81,.1); border-color: rgba(200,169,81,.3); }
.calc-btn.op { color: #6fcf97; background: rgba(111,207,151,.12); border-color: rgba(111,207,151,.3); }
.calc-btn.eq { background: #c8a951; color: #16233d; border-color: #c8a951; }
.calc-actions { display: flex; gap: 10px; padding: 0 14px 10px; flex-wrap: wrap; }
.calc-hist-list { max-height: 430px; overflow-y: auto; }
.calc-hrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(42,58,92,.5); }
.calc-hrow:last-child { border-bottom: none; }
.calc-hexpr { flex: 1; font-size: .78rem; color: #8a97b5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-hval { font-size: 1rem; font-weight: 700; color: #e6ecf7; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .calc-main, .calc-hist { flex: 1 1 100%; max-width: none; } }

/* ===== v0.84：💱 匯率換算（計算機頁）===== */
.fx-card { flex: 1 1 100%; margin-top: 16px; }
.fx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.fx-row.fx-small { font-size: .82rem; color: #8a97b5; }
.fx-amt { width: 130px; padding: 9px 10px; font-size: 1.05rem; font-weight: 700; text-align: right;
  background: rgba(255,255,255,.05); border: 1px solid #2a3a5c; border-radius: 9px; color: #e6ecf7;
  font-variant-numeric: tabular-nums; }
.fx-cur { padding: 9px 10px; font-size: .95rem; background: rgba(255,255,255,.05); border: 1px solid #2a3a5c;
  border-radius: 9px; color: #e6ecf7; }
.fx-arrow { color: #c8a951; font-size: 1.1rem; }
.fx-result { font-size: 1.35rem; font-weight: 700; color: #c8a951; font-variant-numeric: tabular-nums; }
.fx-rate { color: #8a97b5; }
.fx-manual { width: 110px; padding: 6px 8px; font-size: .9rem; text-align: right;
  background: rgba(255,255,255,.05); border: 1px solid #2a3a5c; border-radius: 8px; color: #e6ecf7; }
.btn.btn-xs { padding: 5px 10px; font-size: .78rem; }
.fx-chk { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #8a97b5; }
.fx-chk input { accent-color: #c8a951; }
.fx-ts { color: #6b7a99; font-size: .76rem; }

/* ===== v0.85：原生下拉清單／日期選擇器跟深色主題（修正白底白字）=====
   問題：<select> 彈出嘅清單由瀏覽器／系統繪製，唔受控於 select 本身嘅 background；
   加上全 app 冇聲明 color-scheme → 系統用淺色畫，導致白底白字睇唔到。
   修法：① 喺 :root 聲明 color-scheme: dark（連日期選擇器、捲軸一齊跟）；
         ② 為所有 <select> 嘅 <option> 明寫深底淺字（Chrome 支援）。 */
:root { color-scheme: dark; }
select option,
.form-group select option,
.modal-body select option,
.toolbar select option,
.dash-toolbar select option,
.fx-cur option { background-color: #0f1a30; color: #e0e0e0; }
select optgroup { background-color: #0f1a30; color: #c8a951; font-weight: 700; }
input[type=date] { color-scheme: dark; }
