/* AceJoyStar — giao diện tài khoản HĐQT (board), tông ngà / vàng.
   Chỉ có tác dụng khi <body class="board">: app.js thêm class này khi ME.account_type === 'board'.
   Nạp SAU /shared/ui.css trong public/app/index.html:  <link rel="stylesheet" href="/app/board/board.css">
   Phần 1 đổi màu các thành phần sẵn có (header, nav, card, nút, chip, avatar).
   Phần 2 là các khối riêng của HĐQT, tiền tố bd- (markup mẫu trong board-demo.html). */

/* ============ 1. Màu và thành phần sẵn có ============ */
body.board {
  --bg: #FBF7EE; --card: #FFFFFF; --line: #F1E6CC; --line2: #E6D6AE;
  --ink: #1E1A16; --ink2: #3A332B; --muted: #8A7E66;
  --brand: #C59A3C; --btn: #A57A1E; --brand-ink: #8A6416; --brand-soft: #FBF1D8; --brand-soft2: #FFF9EA;
  --gold-1: #E9CB82; --gold-2: #B8892E; --gold-3: #D8B45E; --gold-4: #F4DFA6; --gold-ring: #D9B565; --gold-text: #7A5A12;
  --gold-grad: linear-gradient(90deg, var(--gold-3), var(--gold-4), var(--gold-3));
}
body.board { background: #F3EDE0; }
body.board #shell { background: var(--bg) url(/app/board/silk.svg) no-repeat center top / 100% 300px; }
body.board header.top { background: transparent; border-bottom: 0; }
body.board header.top .pill.brand { display: none; }
body.board header.top .row.grow > b { font-size: 19px !important; white-space: nowrap; } /* "Nhân sự" → thay bằng nhãn chức danh */
body.board header.top .row.grow { min-width: 0; flex-wrap: nowrap; gap: 8px; } /* a long title (Co-Chairman) shortens with … instead of running under the bell */
/* small phones, or a long title (Co-Chairman…) on a normal phone: the logo already says AceJoyStar, the title label keeps its full width */
@media (max-width: 380px) { body.board header.top .row.grow > b { display: none; } }
@media (max-width: 430px) { body.board.bd-long header.top .row.grow > b { display: none; } }
body.board #view { background: transparent; }

/* nhãn chức danh cạnh logo: <span class="bd-title"><img src="/app/board/crown.svg" alt="">Chairman</span> */
.bd-title { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 1; min-width: 0; max-width: 130px; padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--gold-text); background: linear-gradient(90deg, #FBEFCF, #FFF8E6); border: 1px solid #EBD39A;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-title img { width: 15px; height: 10px; flex-shrink: 0; }

/* avatar: viền vàng đôi; tài khoản HĐQT có thêm huy hiệu vương miện (.bd-me) */
body.board #avatarBtn { background: linear-gradient(135deg, #C9A24D, #F1DCA0) !important; color: #3B2A08 !important; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold-ring); overflow: visible !important; position: relative; }
body.board #avatarBtn img { border-radius: 50%; }
body.board .avatar { background: #FBF3DF; color: var(--gold-text); }
body.board .avatar.lg { background: linear-gradient(135deg, #C9A24D, #F1DCA0); color: #3B2A08; }
.bd-ring { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold-ring); }
.bd-me { position: relative; overflow: visible !important; }
.bd-me::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px #fff;
  background: url(/app/board/crown.svg) no-repeat center / 11px 8px, linear-gradient(135deg, #C9962E, #F4DFA6); filter: saturate(1.1); }
.bd-me.has-img img { border-radius: 50%; }
.avatar.lg.bd-me::after { width: 24px; height: 24px; background-size: 14px 10px, auto; }

/* thanh dưới: tab đang chọn màu vàng + quầng sáng */
body.board nav.bottom { background: #fff; border-top-color: #F0E8D6; }
body.board nav.bottom button.on { color: var(--btn); background: radial-gradient(ellipse at center, #FBEFCF 0%, rgba(251,239,207,0) 72%); }
body.board nav.bottom button:active { background: #FBF6EA; }

/* thẻ, nút, chip, ô chọn */
body.board .card { border-color: #EFE3C6; box-shadow: 0 6px 20px rgba(150,110,30,.06); }
body.board .btn:not(.sec):not(.ghost):not(.danger) { background: var(--gold-grad); color: #4A3508; box-shadow: 0 4px 12px rgba(184,138,46,.25); }
body.board .btn.sec { border-color: #E6D6AE; }
body.board .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.board .chip { white-space: nowrap; flex-shrink: 0; }
body.board .chip.on, body.board .seg button.on { background: var(--gold-grad); color: #4A3508; border-color: var(--gold-3); }
body.board .pill.brand { background: #FBEFCF; color: var(--gold-text); }
body.board .note { background: #FBF6EA; }
body.board .bar > span { background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); }
body.board :focus-visible { outline-color: var(--gold-2); }
body.board label.cb input { accent-color: var(--btn); }

/* ============ 2. Khối riêng của HĐQT ============ */

/* --- Hôm nay: lời chào --- */
.bd-hero { display: flex; align-items: center; gap: 6px; min-height: 150px; }
.bd-hero h1 { font-size: 27px; line-height: 1.15; letter-spacing: -.4px; }
.bd-hero p { margin: 6px 0 0; font-size: 13.5px; color: #6E6558; line-height: 1.4; }
.bd-hero > img { width: 132px; height: 132px; object-fit: contain; flex-shrink: 0; margin-right: -6px; filter: drop-shadow(0 10px 14px rgba(160,100,20,.18)); }
.bd-tag { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #4A3508; background: var(--gold-grad); }

/* --- ô lối tắt: dùng lại markup tile sẵn có, chỉ đổi khung --- */
.bd-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bd-tiles > * { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 18px;
  background: #fff; border: 1px solid #F2ECDF; box-shadow: 0 4px 14px rgba(120,90,30,.06); font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.bd-tiles .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #FBF3DF; color: #9A7420; } /* Danh bạ · Lịch · Album: một tông vàng (Tommy chọn 21/10) */
.bd-tiles .count { position: absolute; top: -7px; right: -2px; font-size: 10px; font-weight: 700; color: #fff; background: #E9564A; padding: 2px 7px; border-radius: 99px; }

/* --- thẻ "AceJoyStar hôm nay": vòng có mặt + 3 dòng sự kiện --- */
.bd-today { padding: 0; overflow: hidden; background: linear-gradient(180deg, #FFFBF1 0%, #fff 55%); border: 1.2px solid #E9D4A2 !important; border-radius: 20px; }
.bd-today .bd-th { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 0; }
.bd-today .bd-th b { font-size: 16px; } .bd-today .bd-th span, .bd-today .bd-th a { font-size: 11.5px; color: #9A8C6E; font-weight: 600; text-decoration: none; }
.bd-main { display: flex; align-items: center; gap: 16px; padding: 10px 16px 12px; }
.bd-donut { position: relative; width: 96px; height: 96px; flex-shrink: 0; border-radius: 50%;
  /* --p = tỉ lệ có mặt (0–100), đặt bằng style="--p:83" */
  background: conic-gradient(var(--gold-2) 0, var(--gold-1) calc(var(--p, 0) * 1%), #F4EAD2 0); }
.bd-donut::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #FFFCF4; }
.bd-donut > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bd-donut b { font-size: 25px; color: var(--gold-text); line-height: 1; } .bd-donut small { font-size: 10.5px; color: #9A8C6E; margin-top: 3px; }
.bd-legend { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.bd-legend > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4A4236; }
.bd-legend i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; } .bd-legend b { margin-left: auto; font-size: 15px; color: var(--ink); }
.bd-legend .l1 { background: #C59A3C; } .bd-legend .l2 { background: #E6CF9A; } .bd-legend .l3 { background: #F1E6CC; border: 1px solid #E2D2A8; }
.bd-rows { margin: 0 16px; border-top: 1px solid #F1E4C3; }
.bd-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F7F0DF; font-size: 12.5px; color: #4A4236; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.bd-row:last-child { border-bottom: 0; }
.bd-row .e { width: 30px; height: 30px; border-radius: 10px; background: #FBF3DF; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.bd-row b { color: var(--ink); } .bd-row .r { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--btn); white-space: nowrap; }
.bd-row .d { width: 40px; flex-shrink: 0; text-align: center; border-radius: 10px; background: #FBF3DF; padding: 4px 0; line-height: 1.05; }
.bd-row .d b { display: block; font-size: 15px; color: var(--gold-text); } .bd-row .d small { font-size: 9.5px; color: #9A8C6E; font-weight: 700; }
.bd-row .sub { display: block; color: #9A8C6E; font-size: 11.5px; }

/* --- Công ty → Tổng quan: thanh theo công ty + 3 số --- */
.bd-bars { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 9px; }
.bd-bar { font-size: 12.5px; color: #4A4236; } .bd-bar .t { display: flex; justify-content: space-between; margin-bottom: 4px; } .bd-bar .t b { color: var(--ink); }
.bd-bar .tr { height: 8px; border-radius: 99px; background: #F4EAD2; overflow: hidden; }
.bd-bar .tr i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); }
.bd-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 16px; border-top: 1px solid #F1E4C3; }
.bd-kpis > div { padding: 10px 0 12px; text-align: center; font-size: 11px; color: #9A8C6E; } .bd-kpis > div + div { border-left: 1px solid #F1E4C3; }
.bd-kpis b { display: block; font-size: 19px; color: var(--gold-text); margin-bottom: 2px; }
.bd-people { display: flex; gap: 10px; padding: 12px 16px 14px; overflow-x: auto; }
.bd-people > * { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 58px; flex-shrink: 0; font-size: 10.5px; color: #4A4236; text-align: center; line-height: 1.2; }
.bd-people .avatar { width: 42px; height: 42px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.2px #E2C681; }

/* --- Joy Up: ví có hộp quà --- */
.bd-wallet { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 20px;
  background: linear-gradient(180deg, #FFFBF1 0%, #fff 70%); border: 1.2px solid #E9D4A2; box-shadow: 0 6px 20px rgba(150,110,30,.08); }
.bd-wallet > img:first-child { width: 70px; height: 70px; object-fit: contain; flex-shrink: 0; }
.bd-wallet .lbl { font-size: 12px; color: #8A7A55; font-weight: 600; }
.bd-wallet .n { font-size: 26px; font-weight: 700; color: #8A6416; } .bd-wallet .n small { font-size: 13px; color: #8A7A55; font-weight: 500; }
.bd-wallet .btn { margin-top: 8px; min-height: 36px; padding: 0 14px; font-size: 13px; }
.bd-wallet::after { content: ""; position: absolute; right: 0; bottom: -2px; width: 118px; height: 118px; background: url(/app/board/gift.svg) no-repeat center / contain; pointer-events: none; }
.bd-wallet > .grow { position: relative; z-index: 1; }

/* --- Joy Up: top 3 có vương miện vàng / bạc / đồng --- */
.bd-podium { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 18px; }
.bd-podium::before { content: "✦         ✦               ✦          ✦"; position: absolute; left: 0; right: 0; top: 0; text-align: center; color: #E3C47D; font-size: 10px; white-space: pre; }
.bd-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; }
.bd-pod .crown { width: 22px; height: 16px; margin-bottom: -2px; -webkit-mask: url(/app/board/crown.svg) no-repeat center / contain; mask: url(/app/board/crown.svg) no-repeat center / contain; }
.bd-pod .who { position: relative; }
.bd-pod .avatar { width: 52px; height: 52px; border-radius: 50%; font-size: 15px; }
.bd-pod .rk { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.bd-pod small { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }
.bd-pod .step { width: 100%; border-radius: 12px 12px 4px 4px; display: flex; justify-content: center; padding-top: 6px; font-weight: 700; font-size: 15px; }
.bd-pod.g .crown { background: linear-gradient(90deg, #C9962E, #F4DFA6); width: 28px; height: 20px; } .bd-pod.g .avatar { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px #D9B565; } .bd-pod.g .rk { background: #C9962E; } .bd-pod.g .step { height: 80px; background: linear-gradient(#FBEFCF, #FFF9EA); color: #8A6416; }
.bd-pod.s .crown { background: linear-gradient(90deg, #A9A498, #E5E1D6); } .bd-pod.s .avatar { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #C9C4B8; } .bd-pod.s .rk { background: #A9A498; } .bd-pod.s .step { height: 58px; background: linear-gradient(#F3F1EC, #FBFAF7); color: #6E685C; }
.bd-pod.b .crown { background: linear-gradient(90deg, #A9703E, #E7C3A0); } .bd-pod.b .avatar { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #C99A72; } .bd-pod.b .rk { background: #B07A4C; } .bd-pod.b .step { height: 44px; background: linear-gradient(#F8ECE0, #FDF8F3); color: #8A5A30; }

/* --- Joy Up: dòng tặng Joy (avatar trái, thời gian phải); .vip = Joy do HĐQT tặng --- */
.bd-kudo { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid #F2ECDF; border-radius: 16px; padding: 11px 12px; font-size: 12.5px; line-height: 1.45; }
.bd-kudo .avatar { width: 36px; height: 36px; font-size: 12px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.2px #E2C681; }
.bd-kudo .why { display: inline-block; margin-top: 5px; font-size: 11px; color: #7A5A14; background: #FBF1D8; padding: 2px 9px; border-radius: 99px; }
.bd-kudo .tm { float: right; font-size: 10.5px; color: #A89C84; margin-top: 6px; }
.bd-kudo.vip { border: 1.4px solid #E3C47D; background: linear-gradient(135deg, #FFFBF0, #fff); }
/* Joy do HĐQT tặng trong app của nhân viên (article.card của kudoCard): mọi người đều thấy khung vàng */
.card.vip { border: 1.4px solid #E3C47D !important; background: linear-gradient(135deg, #FFFBF0, #fff); }
/* nhãn chức danh trong dòng chữ: <span class="bd-chip">★ Chairman</span> */
.bd-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #5A410A; background: linear-gradient(90deg, #D8B45E, #F4DFA6); margin: 0 3px; vertical-align: 1px; white-space: nowrap; }

/* --- Tôi: thẻ hồ sơ + 3 số Joy --- */
.bd-prof { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px;
  background: linear-gradient(180deg, #FFF8E6 0%, #fff 100%); border: 1.2px solid #E9D4A2; }
.bd-prof::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: url(/app/board/silk.svg) no-repeat center bottom / 100% 200px; opacity: .8; }
.bd-prof::after { content: ""; position: absolute; right: 14px; top: 12px; width: 26px; height: 18px; background: url(/app/board/crown.svg) no-repeat center / contain; opacity: .85; }
.bd-prof > * { position: relative; z-index: 1; }
.bd-prof .avatar.lg { width: 68px; height: 68px; box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--gold-ring); }
.bd-prof .name { font-size: 19px; font-weight: 700; } .bd-prof .role { font-size: 13px; color: #7A6E58; margin-top: 2px; }
.bd-prof .bd-chip { margin: 8px 0 0; font-size: 11.5px; padding: 5px 11px; }
.bd-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1.2px solid #E9D4A2; border-radius: 18px; }
.bd-stats > div { padding: 11px 0; text-align: center; font-size: 11px; color: #9A8C6E; } .bd-stats > div + div { border-left: 1px solid #F1E4C3; }
.bd-stats b { display: block; font-size: 18px; color: var(--gold-text); margin-bottom: 1px; }
body.board .list-item .ic, .bd-ic { width: 34px; height: 34px; border-radius: 11px; background: #FBF3DF; color: #9A7420; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
