/* =========================================================
   DARK MODE — หมวดการเงินแอดมิน (/admin/finance/* · /admin/revenue/*)
   ใช้ token --fb-* จาก dark.css เท่านั้น · บวก = น้ำเงิน · เตือน = เหลือง · อันตราย/ติดลบ = แดง
   หัวเพจน้ำเงิน (hero) คงเดิม แก้เฉพาะชิ้นที่อ่านไม่ออกบนพื้นมืด
   ========================================================= */

/* ---- KPI (Accounting Center): icon tile = น้ำเงินไล่สี ไอคอนขาว ทุกโทน (ตรงกับโหมดสว่าง) ---- */
html[data-theme="dark"]:root .acc-kpi .acc-kpi__label i { color: #fff !important; }
html[data-theme="dark"]:root .acc-kpi--out .acc-kpi__label i,
html[data-theme="dark"]:root .acc-kpi--danger .acc-kpi__label i {
  background: var(--fb-danger-soft) !important;
  color: var(--fb-danger) !important;
  box-shadow: none !important;
}
html[data-theme="dark"]:root .acc-kpi--warn .acc-kpi__label i {
  background: var(--fb-warn-soft) !important;
  color: var(--fb-warn) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .acc-kpi--in .acc-kpi__value,
html[data-theme="dark"] .acc-kpi--profit .acc-kpi__value { color: var(--fb-accent) !important; }
html[data-theme="dark"] .acc-kpi--out .acc-kpi__value,
html[data-theme="dark"] .acc-kpi--neg .acc-kpi__value,
html[data-theme="dark"] .acc-amt-out { color: var(--fb-danger) !important; }
html[data-theme="dark"] .acc-kpi--danger { border-color: rgba(255, 107, 107, 0.4) !important; }

/* ---- ป้าย (pill) ---- */
html[data-theme="dark"] .acc-pill { background: var(--fb-card2) !important; color: var(--fb-text) !important; }
html[data-theme="dark"] .acc-pill--in,
html[data-theme="dark"] .acc-pill--brand,
html[data-theme="dark"] .acc-pill--auto { background: var(--fb-accent-soft) !important; color: var(--fb-accent) !important; }
html[data-theme="dark"] .acc-pill--out { background: var(--fb-danger-soft) !important; color: var(--fb-danger) !important; }
html[data-theme="dark"] .acc-pill--warn { background: var(--fb-warn-soft) !important; color: var(--fb-warn) !important; }
html[data-theme="dark"] .acc-pill--muted { background: var(--fb-card2) !important; color: var(--fb-text2) !important; }

/* ---- กล่องแจ้งเตือน (alert): พื้นการ์ด + ทาบสีอ่อนของโทน · ตัวหนังสือหลักอ่านง่าย ---- */
html[data-theme="dark"] .acc-alert { color: var(--fb-text) !important; }
html[data-theme="dark"] .acc-alert--info,
html[data-theme="dark"] .acc-alert--ok {
  background: linear-gradient(var(--fb-accent-soft), var(--fb-accent-soft)), var(--fb-card) !important;
  border-color: rgba(69, 153, 255, 0.35) !important;
}
html[data-theme="dark"] .acc-alert--info i,
html[data-theme="dark"] .acc-alert--ok i { color: var(--fb-accent) !important; }
html[data-theme="dark"] .acc-alert--warn {
  background: linear-gradient(var(--fb-warn-soft), var(--fb-warn-soft)), var(--fb-card) !important;
  border-color: rgba(247, 185, 40, 0.4) !important;
}
html[data-theme="dark"] .acc-alert--warn i,
html[data-theme="dark"] .acc-alert--warn b { color: var(--fb-warn) !important; }
html[data-theme="dark"] .acc-alert--danger {
  background: linear-gradient(var(--fb-danger-soft), var(--fb-danger-soft)), var(--fb-card) !important;
  border-color: rgba(255, 107, 107, 0.45) !important;
}
html[data-theme="dark"] .acc-alert--danger *,
html[data-theme="dark"] .acc-alert--danger { color: var(--fb-text) !important; }
html[data-theme="dark"] .acc-alert--danger i,
html[data-theme="dark"] .acc-alert--danger b { color: var(--fb-danger) !important; }
html[data-theme="dark"] .acc-alert--danger a,
html[data-theme="dark"] .acc-alert a { color: var(--fb-accent) !important; }

/* ---- dropdown เลือกงวดบน hero น้ำเงิน: เป็นปุ่มกระจกตัวขาว (เดิมพื้นขาว-เทา ตัวหนังสือสว่าง อ่านไม่ออก) ---- */
html[data-theme="dark"] .acc-hero .yd-dd > .btn,
html[data-theme="dark"] .fin-admin-hero .yd-dd > .btn {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  color: #fff !important;
}
html[data-theme="dark"] .acc-hero .yd-dd > .btn *,
html[data-theme="dark"] .fin-admin-hero .yd-dd > .btn * { color: #fff !important; }

/* ---- Income notify: โน้ตในการ์ดสถานะ ---- */
html[data-theme="dark"] .inq-hero__note,
html[data-theme="dark"] .inq-hero__note * { color: var(--fb-text2) !important; }
html[data-theme="dark"] .inq-hero__note .bi { color: var(--fb-accent) !important; }

/* ---- Wallet credits ---- */
html[data-theme="dark"] .wallet-credits-page .wc-chip { background: var(--fb-card2) !important; border-color: var(--fb-line) !important; color: var(--fb-text) !important; }
html[data-theme="dark"] .wallet-credits-page .wc-chip i,
html[data-theme="dark"] .wallet-credits-page .wc-source,
html[data-theme="dark"] .wallet-credits-page .wc-source .bi { color: var(--fb-accent) !important; }
html[data-theme="dark"] .wallet-credits-page .wc-source { background: var(--fb-accent-soft) !important; border-color: rgba(69, 153, 255, 0.3) !important; }
html[data-theme="dark"] .wallet-credits-page .yd-pager,
html[data-theme="dark"] .wallet-credits-page .yd-pager__meta { background: transparent !important; color: var(--fb-text2) !important; }
html[data-theme="dark"] .wallet-credits-page .yd-pager__meta * { color: var(--fb-text2) !important; }

/* ---- Revenue sources: ตัวคั่นในแถบยอดรวม ---- */
html[data-theme="dark"] .rev-total__meta-sep { color: var(--fb-text2) !important; }

/* ---- ป้ายโทนน้ำเงิน: ตัวหนังสือหลัก + ขอบฟ้า (ฟ้าบนพื้นฟ้าจางได้แค่ 4.3:1) ---- */
html[data-theme="dark"] .acc-pill--in,
html[data-theme="dark"] .acc-pill--brand,
html[data-theme="dark"] .acc-pill--auto {
  color: var(--fb-text) !important;
  box-shadow: inset 0 0 0 1px rgba(69, 153, 255, 0.45) !important;
}
html[data-theme="dark"] .acc-pill--in .bi,
html[data-theme="dark"] .acc-pill--brand .bi,
html[data-theme="dark"] .acc-pill--auto .bi { color: var(--fb-accent) !important; }

/* ลิงก์ในกล่องแจ้งเตือน: ตัวหนังสือหลัก + ขีดเส้นใต้ฟ้า */
html[data-theme="dark"] .acc-alert a,
html[data-theme="dark"] .acc-alert--danger a {
  color: var(--fb-text) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--fb-accent) !important;
}

/* ไอคอนหัวตาราง (.table-yd): เดิมฟ้า + opacity .75 จมบนพื้นหัวตาราง */
html[data-theme="dark"]:root .table-yd > thead > tr > th .bi,
html[data-theme="dark"]:root .table-yd thead th i.bi {
  color: var(--fb-text2) !important;
  opacity: 1 !important;
}

/* ป้ายบน hero น้ำเงิน = กระจกขาวเหมือนโหมดสว่าง (กฎป้ายด้านบนห้ามทับ) */
html[data-theme="dark"]:root .acc-hero .acc-pill {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28) !important;
}
html[data-theme="dark"]:root .acc-hero .acc-pill .bi { color: #fff !important; }
html[data-theme="dark"]:root .acc-hero .acc-pill.acc-pill--warn {
  color: #fff !important;
  background: rgba(247, 185, 40, 0.28) !important;
  box-shadow: inset 0 0 0 1px rgba(247, 185, 40, 0.6) !important;
}

html[data-theme="dark"]:root .yd-dash .rev-total__meta-sep,
html[data-theme="dark"]:root .rev-total__meta-sep { color: var(--fb-text2) !important; }
html[data-theme="dark"]:root .yd-dash .rev-total__meta-sep { opacity: 1 !important; }

/* ---- แถบสัดส่วนตามหมวด (.acc-bar): ไอคอนหมวด · ราง · แท่ง ---- */
html[data-theme="dark"]:root .acc-bar__name i,
html[data-theme="dark"]:root .acc-bar--in .acc-bar__name i { background: var(--fb-accent-soft) !important; color: var(--fb-accent) !important; }
html[data-theme="dark"]:root .acc-bar--out .acc-bar__name i { background: var(--fb-danger-soft) !important; color: var(--fb-danger) !important; }
html[data-theme="dark"] .acc-bar__track { background: var(--fb-card2) !important; }
html[data-theme="dark"]:root .acc-bar--in .acc-bar__fill,
html[data-theme="dark"]:root .acc-bar__fill { background: var(--fb-accent-strong) !important; }
html[data-theme="dark"]:root .acc-bar--out .acc-bar__fill { background: var(--fb-danger) !important; }
html[data-theme="dark"] .acc-chart__bars { border-bottom-color: var(--fb-line) !important; }
html[data-theme="dark"]:root .acc-hero .yd-dd > .btn .bi,
html[data-theme="dark"]:root .acc-hero .yd-dd > .btn .yd-dd-label,
html[data-theme="dark"]:root .fin-admin-hero .yd-dd > .btn .bi { color: #fff !important; opacity: 1 !important; }
html[data-theme="dark"]:root .acc-hero .yd-dd > .btn { background: rgba(255, 255, 255, 0.1) !important; }
