/* Module M07 · Rủi ro và chất lượng — "Sự cố" redone on the module menu (M07-01, design frame SuCo) with "Cảnh báo rủi ro
   trong vụ việc" (M07-03), incidents.js. Loaded after modnav.css on index.html. Every rule is under .m07, the class
   incidents.js puts on #view-incidents only when CDLAF_FEATURES.ui('m07') is on: with the switch off nothing here applies.
   The page's own tokens (--surface, --line, --accent…), so light and dark follow the app; Verdana from the page. */

/* the counts by status above the list, then a financial impact, past due; "+ Báo cáo sự cố" at the end */
.m07 .m07-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; min-width: 0; }
.m07 .m07-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 520px; min-width: 0; }
.m07 .m07-chip { font: inherit; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); cursor: pointer; white-space: nowrap; }
.m07 .m07-chip b { font-size: 13px; }
.m07 .m07-chip:hover { border-color: var(--muted); }
.m07 .m07-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.m07 .m07-chip.warn b { color: var(--warn); }
.m07 .m07-chip.bad b { color: var(--danger); }
.m07 .m07-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.m07 .m07-sep { width: 1px; align-self: stretch; min-height: 24px; background: var(--line); margin: 0 2px; }
.m07 .m07-top > .btn { width: auto; flex: none; min-height: 44px; margin-left: auto; }

/* one incident: the line above the title, the steps, the summary */
.m07 .m07-title { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.m07 .m07-title > div:first-child { display: grid; gap: 2px; flex: 1 1 320px; min-width: 0; }
.m07 .m07-title .note { margin: 0; font-size: 12px; }
.m07 .m07-title h2 { margin: 0; font-size: 18px; }
.m07 .m07-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.m07 .m07-steps li { flex: 1 1 120px; min-width: 0; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.m07 .m07-steps li.done { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); color: var(--ok); }
.m07 .m07-steps li.now { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.m07 .m07-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.m07 .m07-sum > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.m07 .m07-sum > div > span:first-child { font-size: 12px; color: var(--muted); }
.m07 .m07-sum .btn-link { text-align: left; }
.m07 .ic-decide .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.m07 .m07-dnote { font-size: 12px; margin: 0; flex: 1 1 260px; }

/* M07-03: the open risk alerts of the matters, read only; a row opens its matter */
.m07 .m07-risk { margin-top: 16px; }
.m07 .m07-rhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.m07 .m07-rhead h2 { margin: 0; font-size: 15px; }
.m07 .m07-code { font-size: 11px; font-weight: 700; color: var(--accent); }
.m07 .m07-risks { min-width: 760px; }
.m07 .m07-risks td { vertical-align: middle; }
.m07 .m07-risks th:nth-child(1) { width: 110px; } .m07 .m07-risks th:nth-child(2) { width: 150px; min-width: 0; } .m07 .m07-risks th:nth-child(3) { width: 200px; }
.m07 .m07-risks th:nth-child(4) { min-width: 260px; } .m07 .m07-risks th:nth-child(5) { width: 150px; } .m07 .m07-risks th:nth-child(6) { width: 100px; }
.m07 .m07-risks .note { display: block; margin: 2px 0 0; font-size: 12px; }

/* one incident: "Lịch sử và trao đổi" as a table */
.m07 .m07-log { min-width: 640px; }
.m07 .m07-log th:nth-child(1) { width: 140px; } .m07 .m07-log th:nth-child(2) { width: 160px; min-width: 0; } .m07 .m07-log th:nth-child(3) { width: 190px; }
.m07 .m07-log tr.k-comment td:nth-child(3) b { color: var(--accent); }
.m07 .m07-lempty td { text-align: center; padding: 10px; }
@media (max-width: 760px) {
  .m07 .m07-risks, .m07 .m07-log { min-width: 0; }
  .m07 .m07-sep { display: none; }
  .m07 .m07-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }   /* one row that scrolls sideways */
  .m07 .m07-top > .btn { flex: 1 1 100%; }
}
