/* S04 T5 — Trợ lý cá nhân (IT-019 P1 / P1d / P2 / P2d / P3). Tokens --ux-* only; shared cards / toggles from s19-people.css.
   The page frame follows Báo cáo (s19-reports.css): same workspace and, on phones, the rail as a row of tabs. */
#app-screen:is([data-view="bot"], [data-view="approvals"]) .workspace:has(> .s19p-page) { padding: 0; background: var(--ux-bg); overflow: hidden; display: flex; flex-direction: column; }
.s19p-pg:has(.s19a-sub) > * { flex-shrink: 0; }
.s19a-tabs { display: inline-flex; align-self: flex-start; border: 1px solid var(--ux-border-strong); border-radius: 8px; overflow: hidden; background: var(--ux-surface); }
.s19a-tabs button { height: 30px; padding: 0 10px; border: 0; background: none; color: var(--ux-text); font-size: 12.5px; font-weight: 600; border-right: 1px solid var(--ux-border); }
.s19a-tabs button:last-child { border-right: 0; }
.s19a-tabs button[aria-selected="true"] { background: var(--ux-sel); color: var(--ux-link); font-weight: 700; }
.s19a-sub { display: flex; border: 1px solid var(--ux-border-strong); border-radius: 8px; overflow: hidden; background: var(--ux-surface); }
.s19a-sub button { height: 30px; padding: 0 10px; border: 0; background: none; color: var(--ux-text); font-size: 12.5px; font-weight: 600; border-right: 1px solid var(--ux-border); display: inline-flex; align-items: center; gap: 4px; }
.s19a-sub button[aria-selected="true"] { background: var(--ux-sel); color: var(--ux-link); font-weight: 700; }
.s19a-sub .n { font-weight: 700; }
.s19a-tabs button:focus-visible, .s19a-sub button:focus-visible { outline: 2px solid var(--ux-primary); outline-offset: -2px; }
.s19a-warn { border-color: var(--ux-warn); background: var(--ux-warn-soft); color: var(--ux-text); }

.s19a-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.s19a-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s19a-f > b { color: var(--ux-text); }
.s19a-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.s19a-fc { width: 100%; box-sizing: border-box; }
#app-screen .s19a-fc select { max-width: none; flex: 1; }
.s19a-fc select { flex: 1; min-width: 0; border: 0; background: none; color: var(--ux-text); font: inherit; font-size: 13px; appearance: none; padding-right: 22px; height: 34px; }
.s19a-in { height: 36px; padding: 0 10px; border: 1px solid var(--ux-border-strong); border-radius: 8px; background: var(--ux-input, var(--ux-surface)); color: var(--ux-text); font: inherit; font-size: 13px; min-width: 0; flex: 1 1 160px; }
.s19a-in:focus { outline: none; border-color: var(--ux-primary); }
.s19a-in:disabled { background: var(--ux-disabled-bg); color: var(--ux-muted); }
.s19a-code { flex: 0 1 140px; letter-spacing: 2px; }
.s19a-tm { flex: 0 0 auto; width: 96px; text-align: center; }
.s19a-pv { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; box-sizing: border-box; border: 1px solid var(--ux-border-strong); border-radius: 8px; background: var(--ux-surface); justify-content: space-between; min-width: 0; }
.s19a-ok { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--ux-surface); border: 1px solid currentColor; color: var(--ux-ok); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.s19a-link { border: 0; background: none; padding: 0 2px; color: var(--ux-text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.s19a-link:hover { color: var(--ux-link); text-decoration: underline; }
.s19a-link:focus-visible { outline: 2px solid var(--ux-primary); outline-offset: 2px; border-radius: 4px; }

.s19a-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s19a-chip { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--ux-border); background: var(--ux-surface-2); color: var(--ux-text-2); font-size: 12px; font-weight: 600; }
.s19a-chip:hover { background: var(--ux-hover); }
.s19a-chip.pk[aria-pressed="true"] { background: var(--ux-sel); border-color: var(--ux-primary); color: var(--ux-link); }
.s19a-chip:focus-visible, .s19a-day:focus-visible { outline: 2px solid var(--ux-primary); outline-offset: 2px; }
.s19a-ta { width: 100%; min-height: 140px; resize: vertical; padding: 10px; border: 1px solid var(--ux-border-strong); border-radius: 8px; background: var(--ux-input, var(--ux-surface)); color: var(--ux-text); font: inherit; font-size: 13px; line-height: 20px; box-sizing: border-box; }
.s19a-ta:focus { outline: none; border-color: var(--ux-primary); }
.s19a-vers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ux-border); border-radius: 8px; overflow: hidden; }
.s19a-vers li { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-bottom: 1px solid var(--ux-border); font-size: 12.5px; color: var(--ux-text); }
.s19a-vers li:last-child { border-bottom: 0; }
.s19a-qerr { color: var(--ux-danger); border-left-color: var(--ux-danger); }

.s19a-seg { display: flex; align-self: stretch; }
/* selected text on --ux-sel: --ux-link keeps ≥ 4.5 in Dark (--ux-primary gives 3.7) */
.s19a-seg button[aria-checked="true"] { color: var(--ux-link); }
.s19a-seg button { height: 32px; font-size: 12.5px; }
.s19a-days { display: flex; flex-wrap: wrap; gap: 6px; }
.s19a-day { height: 28px; min-width: 36px; padding: 0 8px; border-radius: 14px; border: 1px dashed var(--ux-border-strong); background: var(--ux-surface); color: var(--ux-muted); font-size: 12px; font-weight: 650; }
.s19a-day[aria-pressed="true"] { border-style: solid; border-color: var(--ux-primary); background: var(--ux-sel); color: var(--ux-link); }
.s19a-sum { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--ux-surface-2); border: 1px solid var(--ux-border); font-size: 12px; font-weight: 600; color: var(--ux-text-2); white-space: nowrap; }
.s19a-money { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 200px; min-width: 0; font-size: 12px; color: var(--ux-text-2); }
.s19a-money .s19a-in { width: 100%; }
.s19a-bar { height: 6px; border-radius: 3px; background: var(--ux-surface-2); border: 1px solid var(--ux-border); overflow: hidden; }
.s19a-bar i { display: block; height: 100%; background: var(--ux-primary); }
.s19a-price { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; padding: 8px; border: 1px dashed var(--ux-border-strong); border-radius: 8px; }
.s19a-price b { color: var(--ux-text-2); }
.s19a-price .s19a-money { flex: 1 1 150px; }

.s19a-files { list-style: none; margin: 0; padding: 0; }
.s19a-files li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ux-border); min-width: 0; }
.s19a-files li .s3-col { min-width: 0; }
.s19a-files li b { overflow-wrap: anywhere; }
.s19a-files svg { color: var(--ux-text-2); flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* P2 / P2d tables */
.s19a-tw { overflow-x: auto; }
.s19a-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--ux-text); }
.s19a-tb th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ux-muted); padding: 8px 10px; border-bottom: 1px solid var(--ux-border); white-space: nowrap; }
.s19a-tb td { padding: 8px 10px; border-bottom: 1px solid var(--ux-border); vertical-align: top; }
.s19a-tb tr:last-child td { border-bottom: 0; }
.s19a-tb td.t { white-space: nowrap; color: var(--ux-text-2); }
.s19a-tb td.w { white-space: nowrap; }
.s19a-tb td.q, .s19a-tb td.a { overflow-wrap: anywhere; }
.s19a-lr { cursor: pointer; }
.s19a-lr:hover td { background: var(--ux-hover); }
.s19a-lr:focus-visible { outline: 2px solid var(--ux-primary); outline-offset: -2px; }
.s19a-ld td { background: var(--ux-surface-2); font-size: 12px; color: var(--ux-text-2); display: table-cell; }
.s19a-ld td span { display: inline-block; margin-right: 14px; }
.s19a-ld[hidden] { display: none; }
.s19a-res { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.s19a-res.ok { color: var(--ux-ok); }
.s19a-res.warn { color: var(--ux-warn); }
.s19a-res.bad { color: var(--ux-danger); }
.s19a-res.info { color: var(--ux-text-2); }
.s19a-res.mu { color: var(--ux-muted); font-weight: 600; }
.s19a-nav { width: 32px; justify-content: center; padding: 0; }

.s19a-dlgbox { background: var(--ux-surface); border: 1px solid var(--ux-border); border-radius: 12px; box-shadow: var(--ux-shadow); width: min(640px, 100%); max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.s19a-pre { margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow: auto; font: inherit; font-size: 13px; line-height: 20px; color: var(--ux-text); }

@media (max-width: 760px) {
  .s19a-cols { grid-template-columns: minmax(0, 1fr); }
  .s19a-sub { overflow-x: auto; }
  .s19a-sub button { flex: none; height: 36px; }
  .s19a-tabs button { height: 36px; }
  .s19a-in { height: 40px; }
  .s19a-pv { min-height: 40px; }
  .s19a-tb thead { display: none; }
  .s19a-tb, .s19a-tb tbody, .s19a-tb tr, .s19a-tb td { display: block; width: 100%; box-sizing: border-box; }
  .s19a-tb tr.s19a-lr, .s19a-al tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 10px; border-bottom: 1px solid var(--ux-border); }
  .s19a-tb td { border: 0; padding: 0; }
  .s19a-tb tr.s19a-lr td.q, .s19a-tb tr.s19a-lr td.a, .s19a-al td:nth-child(n + 3) { grid-column: 1 / -1; }
  .s19a-tb td.w { white-space: normal; }
  .s19a-ld td { display: block; padding: 8px 10px; }

  /* mobile shell: rail as a row of labelled tabs (as Báo cáo / personnel pages) */
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) { flex-direction: column; height: 100dvh; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) > .sidebar { width: 100%; min-width: 0; height: auto; flex: none; border: 0; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) .sidebar-hero { padding: 0; background: var(--ux-surface); }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) .sidebar-hero > :not(#shell-nav),
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) .sidebar-scroll { display: none; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav { display: flex; flex-flow: row nowrap; align-items: center; gap: 12px; height: 44px; padding: 0 14px; margin: 0; overflow-x: auto; scrollbar-width: none; background: var(--ux-surface); border-bottom: 1px solid var(--ux-border); }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav > :not(button[data-view], #rail-utils) { display: none; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #rail-utils { display: contents; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #rail-utils > button { width: 34px; height: 34px; padding: 7px; flex: none; display: grid; place-items: center; position: relative; background: transparent; color: var(--ux-text-2); border: 0; box-shadow: none; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav button[data-view] { width: auto; height: 44px; padding: 0 2px; flex: none; background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--ux-text-2); font-size: 12px; font-weight: 500; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav button[data-view] .nav-icon { display: none; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav button[data-view] span { position: static; width: auto; height: auto; clip-path: none; overflow: visible; white-space: nowrap; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav button[data-view].active { color: var(--ux-primary); font-weight: 650; border-bottom-color: var(--ux-primary); background: transparent; box-shadow: none; width: auto; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) #shell-nav button.active::before { display: none; }
  #app-screen:is([data-view="bot"], [data-view="approvals"]):has(.s19p-page) .workspace { flex: 1; min-height: 0; display: flex; }
}

/* S04 T6 — Hàng chờ duyệt (IT-019 H1 / H1d / H3): cards of the questions, Đồng ý / Không / Sửa lời. */
.s19p-pg:has(.s19aq-bar) > * { flex-shrink: 0; }
.s19aq-bar { display: flex; align-items: center; gap: 8px; }
.s19aq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.s19aq-card .s19p-cb { gap: 8px; }
.s19aq-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.s19aq-av { width: 24px; height: 24px; border-radius: 12px; background: var(--ux-sel); color: var(--ux-link); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.s19aq-cat { height: 20px; padding: 0 8px; border-radius: 10px; background: var(--ux-surface-2); border: 1px solid var(--ux-border); color: var(--ux-text-2); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.s19aq-title { font-size: 13.5px; color: var(--ux-text); overflow-wrap: anywhere; }
.s19aq-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.s19aq-f > b, .s19aq-f label b { color: var(--ux-text-2); }
.s19aq-orig { border-left: 3px solid var(--ux-border-strong); padding: 6px 10px; background: var(--ux-surface-2); border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--ux-text-2); white-space: pre-line; overflow-wrap: anywhere; }
.s19aq-prop { border: 1px solid var(--ux-border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ux-text); overflow-wrap: anywhere; }
.s19aq-ta { min-height: 72px; }
.s19aq-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.s19aq-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--ux-border); border-radius: 14px; background: var(--ux-surface); color: var(--ux-text-2); font: inherit; font-size: 12px; white-space: nowrap; }
.s19aq-pill svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
button.s19aq-pill { cursor: pointer; }
button.s19aq-pill:hover { background: var(--ux-hover); }
@media (max-width: 760px) {
  .s19aq-grid { grid-template-columns: minmax(0, 1fr); }
  .s19aq-acts .s3-btn { flex: 1; justify-content: center; height: 40px; }
  .s19aq-pill { display: none; }
}
