/* M00 Trang chủ chung, the new screens (CDLAF_FEATURES.ui('m00')): Trang chủ (m00home.js), Tổng quan (partner.js), the
   bell's panel (bell.js). Loaded after modnav.css. Every rule is under a class only the new screens draw (.m00-home is
   put on the homepage only while the switch is on), so with the switch off the pages are as before. */

/* ---------------------------------------------------------------- shared parts */
.m00-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 4px 0 18px; }
.m00-head-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.m00-kicker { font-size: 12px; color: var(--muted); }
.m00-title { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 700; color: var(--ink); }
.m00-sub { font-size: 13px; color: var(--muted); }
.m00-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.m00-acts .btn, .m00-ask > .btn, .m00-lc-form .btn { width: auto; }   /* .btn-primary is full width elsewhere */
.m00-acts .btn-primary { padding: 6px 14px; font-size: 13px; }
.m00-acts .hp-cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.m00-acts .hp-btn { min-height: 40px; padding: 0 16px; border-radius: 6px; font-size: 13px; }
.m00-acts .hp-btn.hp-gold { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.m00-acts .hp-btn.hp-line { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.m00-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.m00-card[hidden] { display: none; }
.m00-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.m00-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.m00-code { flex: none; font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.m00-note { margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.m00-todo-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.m00-todo-row .m00-code { width: 60px; }
.m00-todo-row:hover .m00-todo-main b, .m00-todo-row:focus-visible .m00-todo-main b { color: var(--accent); }
.m00-todo-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.m00-todo-row > svg { flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.m00-todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.m00-todo-main b { font-size: 13px; overflow-wrap: anywhere; }
.m00-todo-main span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.m00-todo-main span.warn { color: var(--warn); }
.m00-todo-main span.bad { color: var(--danger); }
.m00-tag { flex: none; max-width: 40%; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.m00-tag.due { background: var(--accent-soft); color: var(--accent); }
.m00-tag.soon { background: var(--warn-soft); color: var(--warn); }
.m00-all { align-self: flex-start; margin-top: 6px; }

/* ---------------------------------------------------------------- Trang chủ (M00-01) */
.m00-home .hp-hero, .m00-home .hp-lc, .m00-home #hp-pipe .hp-mt-todo { display: none; }   /* given way to the parts on top */
.m00-home > .m00-main, .m00-home > .mn-home, .m00-home > .m00-cats { margin-bottom: 20px; }
.m00-main { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.m00-main > .m00-todo { flex: 2 1 420px; }
.m00-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.m00-draft { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.m00-draft b { font-size: 13px; } .m00-draft span { font-size: 12px; color: var(--muted); }
.m00-draft .m00-more { font-weight: 700; color: var(--accent); }
.m00-draft:hover { border-color: var(--accent); }
.m00-lc-form { display: flex; flex-direction: column; gap: 10px; }
.m00-lc-l { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.m00-lc-l textarea { font: inherit; font-size: 13px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; }
.m00-lc-form .btn { align-self: flex-start; }
.m00-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m00-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunken);
  color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.m00-chip b { color: var(--accent); }
.m00-chip:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- Tổng quan (M00-02) */
.m00-ov { display: flex; flex-direction: column; gap: 16px; }
.m00-ov .m00-head { margin-bottom: 0; }
.m00-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.m00-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.m00-kpi b { font-size: 28px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.m00-kpi-l { font-size: 13px; } .m00-kpi small { font-size: 11.5px; color: var(--muted); }
.m00-kpi.warn b { color: var(--warn); } .m00-kpi.bad b { color: var(--danger); }
.m00-kpi:hover, .m00-kpi:focus-visible { border-color: var(--accent); }
.m00-ov .m00-card .hp-stages { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.m00-ask { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.m00-ask .m00-todo-row { border-top: 0; flex: 1; min-width: 0; }
.m00-ask > .btn, .m00-ask > .pt-assign-acts { flex: none; }
/* "Khối lượng việc": this month / this week, one line a person, the hours charged and not charged as a two-part bar */
.m00-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.m00-seg button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; padding: 5px 12px; cursor: pointer; }
.m00-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.m00-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.m00-loadbox[aria-busy="true"] .ic-mwrap { opacity: .5; }
.m00-loadbox .ic-mwrap { width: 0; min-width: 100%; }   /* the table scrolls inside its box, the page does not grow wider */
.m00-loadtable td .m00-note { display: block; margin: 0; font-size: 12px; }
/* the columns at set widths, the person's name taking the rest; below 760px wide the box scrolls */
.m00-loadtable { table-layout: fixed; min-width: 900px; }
.m00-loadtable th { white-space: normal; vertical-align: bottom; }
.m00-loadtable th:nth-child(2) { width: 80px; } .m00-loadtable th:nth-child(3) { width: 112px; } .m00-loadtable th:nth-child(4) { width: 96px; }
.m00-loadtable th:nth-child(5) { width: 104px; } .m00-loadtable th:nth-child(6) { width: 112px; } .m00-loadtable th:nth-child(7) { width: 112px; }
.m00-loadtable th:nth-child(8) { width: 112px; }
.m00-loadtable .c-n { text-align: right; font-variant-numeric: tabular-nums; } .m00-loadtable td.c-n { white-space: nowrap; }   /* headings may wrap */
@media (max-width: 760px) { .m00-loadtable { table-layout: auto; min-width: 0; } }   /* lines become cards (gridtable) */
.m00-bar2 { display: flex; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.m00-bar2 .b { background: var(--accent); } .m00-bar2 .n { background: var(--gold); } .m00-bar2 .i { background: var(--muted); }

/* ---------------------------------------------------------------- the bell's panel (M00-04) */
.m00-bell-head .m00-code { margin-right: auto; margin-left: 8px; }
.m00-bell-when { display: inline-flex; align-items: baseline; gap: 4px; }
.m00-bell-hint { margin: 0; padding: 10px 14px; font-size: 12px; color: var(--muted); }

/* the bell of admin.html (bell.js admin()): the same look as index.html's, which admin.html's styles do not have */
.m00-abell { position: relative; margin-left: auto; }
.m00-abell[hidden] { display: none; }
body.mn-on .wrap > header > .m00-abell:not([hidden]) + #mn-user { margin-left: 0; }   /* the bell and the person's menu side by side, at the right */
.m00-abell-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.m00-abell-btn:hover, .m00-abell-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.m00-abell-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.m00-abell-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.m00-abell-n { position: absolute; top: -5px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.m00-abell-n[hidden] { display: none; }
.m00-abell-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 55; width: min(400px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(0 0 0 / .16); }
.m00-abell-panel[hidden] { display: none; }
.m00-abell .bell-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.m00-abell .bell-head .btn-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.m00-abell .bell-list { list-style: none; margin: 0; padding: 0; }
.m00-abell .bell-item { display: grid; gap: 2px; width: 100%; padding: 10px 14px 10px 26px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; position: relative; }
.m00-abell .bell-item:hover { background: var(--sunken); }
.m00-abell .bell-item.unread { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.m00-abell .bell-item.unread::before { content: ""; position: absolute; left: 11px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.m00-abell .bell-item b { font-size: 13.5px; }
.m00-abell .bell-item .note { margin: 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.m00-abell .bell-empty { padding: 18px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.bell-item .note.m00-bell-away { color: var(--warn); }   /* "Mở ở …": a page of another portal */

@media (max-width: 600px) {
  .m00-title { font-size: 20px; }
  /* a line: the code on the left, the text, its tag under the text, the arrow on the right */
  .m00-todo-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 16px; column-gap: 12px; row-gap: 4px; }
  .m00-todo-row .m00-code { width: auto; grid-column: 1; grid-row: 1 / span 2; }
  .m00-todo-row .m00-todo-main { grid-column: 2; grid-row: 1; }
  .m00-todo-row .m00-tag { grid-column: 2; grid-row: 2; justify-self: start; max-width: none; }
  .m00-todo-row > svg { grid-column: 3; grid-row: 1 / span 2; }
  .m00-ask { flex-wrap: wrap; gap: 0 10px; padding-bottom: 8px; }
  .m00-ask .m00-todo-row { flex-basis: 100%; }   /* the button goes under the line */
  .m00-ask > .btn, .m00-ask > .pt-assign-acts { margin-left: 64px; }
  .m00-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m00-loadtable .c-n, .m00-loadtable td:first-child { width: auto; min-width: 0; text-align: left; }   /* lines become cards (gridtable) */
  .m00-kpi b { font-size: 22px; }
}
