/* Super Dashboard design system.
   Tokens first (light, then dark for the system setting and for an explicit choice), then
   the shell, components, and page patterns. Components only ever use tokens. */

:root {
  --bg: #f2f5fb;
  --bg-glow-1: rgba(59, 130, 246, .10);
  --bg-glow-2: rgba(16, 185, 129, .07);
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef2f9;
  --border: #e4e9f2;
  --border-strong: #cfd8e7;
  --text: #0e1b32;
  --text-2: #2f3e58;
  --muted: #64728b;
  --faint: #94a0b6;

  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-soft: #eaf1ff;
  --brand-line: #c7d8fe;
  --brand-grad: linear-gradient(135deg, #4f8cff 0%, #2563eb 55%, #1e40af 100%);
  --focus: 0 0 0 3px rgba(37, 99, 235, .32);

  --high: #d92d20;       --high-soft: #fdeceb;   --high-line: #f8c9c5;
  --medium: #b45309;     --medium-soft: #fef3e2; --medium-line: #f7d9a8;
  --info: #1d4ed8;       --info-soft: #eaf1ff;   --info-line: #c7d8fe;
  --ok: #047857;         --ok-soft: #e4f6ee;     --ok-line: #b5e5cf;
  --demo: #6d28d9;       --demo-soft: #f1ebfe;   --demo-line: #dacbfb;
  --warn-row: #fffaf0;   --bad-row: #fff5f4;

  --c1: #2563eb; --c2: #10b981; --c3: #f59e0b; --c4: #8b5cf6; --c5: #ef4444; --c6: #06b6d4;
  --t-blue: #2563eb;   --t-blue-bg: #e8f0ff;
  --t-green: #059669;  --t-green-bg: #e3f7ef;
  --t-red: #e11d48;    --t-red-bg: #ffe8ee;
  --t-amber: #d97706;  --t-amber-bg: #fff2dd;
  --t-violet: #7c3aed; --t-violet-bg: #f0e9ff;
  --t-cyan: #0891b2;   --t-cyan-bg: #e0f6fb;

  --side-bg: linear-gradient(180deg, #0a1835 0%, #0d214b 48%, #0a1835 100%);
  --side-text: #c3cfea;
  --side-muted: #7186b0;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: linear-gradient(95deg, #3b7bff 0%, #2563eb 100%);
  --side-border: rgba(255, 255, 255, .07);

  --topbar-bg: rgba(255, 255, 255, .78);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(14, 27, 50, .05);
  --shadow: 0 1px 2px rgba(14, 27, 50, .04), 0 6px 22px -10px rgba(14, 27, 50, .12);
  --shadow-lg: 0 18px 48px -18px rgba(14, 27, 50, .30);
  --font: "IBM Plex Sans Thai", "IBM Plex Sans", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070f1f; --bg-glow-1: rgba(59, 130, 246, .14); --bg-glow-2: rgba(16, 185, 129, .06);
    --surface: #0f1a2e; --surface-2: #132038; --surface-3: #192842; --border: #1f2f4d; --border-strong: #2b3e63;
    --text: #e8eef9; --text-2: #c3cfe4; --muted: #8e9cb9; --faint: #64739a;
    --brand: #6b9bff; --brand-strong: #8db2ff; --brand-soft: rgba(107, 155, 255, .13); --brand-line: rgba(107, 155, 255, .35);
    --focus: 0 0 0 3px rgba(107, 155, 255, .40);
    --high: #ff7a70; --high-soft: rgba(255, 122, 112, .13); --high-line: rgba(255, 122, 112, .35);
    --medium: #fbbf5a; --medium-soft: rgba(251, 191, 90, .12); --medium-line: rgba(251, 191, 90, .32);
    --info: #8db2ff; --info-soft: rgba(107, 155, 255, .13); --info-line: rgba(107, 155, 255, .35);
    --ok: #4fd1a1; --ok-soft: rgba(79, 209, 161, .12); --ok-line: rgba(79, 209, 161, .32);
    --demo: #b9a2ff; --demo-soft: rgba(185, 162, 255, .13); --demo-line: rgba(185, 162, 255, .32);
    --warn-row: rgba(251, 191, 90, .07); --bad-row: rgba(255, 122, 112, .07);
    --c1: #6b9bff; --c2: #34d399; --c3: #fbbf24; --c4: #a78bfa; --c5: #f87171; --c6: #22d3ee;
    --t-blue: #8db2ff; --t-blue-bg: rgba(107, 155, 255, .15); --t-green: #4fd1a1; --t-green-bg: rgba(79, 209, 161, .14);
    --t-red: #fb7185; --t-red-bg: rgba(251, 113, 133, .14); --t-amber: #fbbf5a; --t-amber-bg: rgba(251, 191, 90, .14);
    --t-violet: #b9a2ff; --t-violet-bg: rgba(185, 162, 255, .15); --t-cyan: #5ee0f5; --t-cyan-bg: rgba(94, 224, 245, .13);
    --side-bg: linear-gradient(180deg, #060d1c 0%, #0a1731 50%, #060d1c 100%);
    --topbar-bg: rgba(15, 26, 46, .78);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 48px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070f1f; --bg-glow-1: rgba(59, 130, 246, .14); --bg-glow-2: rgba(16, 185, 129, .06);
  --surface: #0f1a2e; --surface-2: #132038; --surface-3: #192842; --border: #1f2f4d; --border-strong: #2b3e63;
  --text: #e8eef9; --text-2: #c3cfe4; --muted: #8e9cb9; --faint: #64739a;
  --brand: #6b9bff; --brand-strong: #8db2ff; --brand-soft: rgba(107, 155, 255, .13); --brand-line: rgba(107, 155, 255, .35);
  --focus: 0 0 0 3px rgba(107, 155, 255, .40);
  --high: #ff7a70; --high-soft: rgba(255, 122, 112, .13); --high-line: rgba(255, 122, 112, .35);
  --medium: #fbbf5a; --medium-soft: rgba(251, 191, 90, .12); --medium-line: rgba(251, 191, 90, .32);
  --info: #8db2ff; --info-soft: rgba(107, 155, 255, .13); --info-line: rgba(107, 155, 255, .35);
  --ok: #4fd1a1; --ok-soft: rgba(79, 209, 161, .12); --ok-line: rgba(79, 209, 161, .32);
  --demo: #b9a2ff; --demo-soft: rgba(185, 162, 255, .13); --demo-line: rgba(185, 162, 255, .32);
  --warn-row: rgba(251, 191, 90, .07); --bad-row: rgba(255, 122, 112, .07);
  --c1: #6b9bff; --c2: #34d399; --c3: #fbbf24; --c4: #a78bfa; --c5: #f87171; --c6: #22d3ee;
  --t-blue: #8db2ff; --t-blue-bg: rgba(107, 155, 255, .15); --t-green: #4fd1a1; --t-green-bg: rgba(79, 209, 161, .14);
  --t-red: #fb7185; --t-red-bg: rgba(251, 113, 133, .14); --t-amber: #fbbf5a; --t-amber-bg: rgba(251, 191, 90, .14);
  --t-violet: #b9a2ff; --t-violet-bg: rgba(185, 162, 255, .15); --t-cyan: #5ee0f5; --t-cyan-bg: rgba(94, 224, 245, .13);
  --side-bg: linear-gradient(180deg, #060d1c 0%, #0a1731 50%, #060d1c 100%);
  --topbar-bg: rgba(15, 26, 46, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 48px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, var(--bg-glow-1), transparent 60%),
                    radial-gradient(900px 420px at 10% 110%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { color: var(--text); text-wrap: balance; }
h1 { font-size: 1.62rem; line-height: 1.25; font-weight: 700; letter-spacing: -.012em; margin: 0 0 .25rem; }
h2 { font-size: 1.06rem; line-height: 1.35; font-weight: 600; margin: 0 0 .8rem; }
h3 { font-size: .98rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: .25rem 0 .75rem; }
small, .muted { color: var(--muted); }
code { font-family: "IBM Plex Mono", Consolas, monospace; font-size: .86em; background: var(--surface-3); padding: .05rem .35rem; border-radius: 6px; color: var(--text-2); }
::selection { background: var(--brand-line); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.side :focus-visible { outline-color: #fff; }
.ico { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }
.num, td.num, th.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---- shell ----------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side-bg); color: var(--side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.1rem .85rem 1rem; display: flex; flex-direction: column; gap: .2rem; scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent; border-right: 1px solid var(--side-border);
}
.side .brand { display: flex; align-items: center; gap: .7rem; color: #fff; padding: .2rem .45rem 1rem; line-height: 1.2; }
.side .brand:hover { text-decoration: none; color: #fff; }
.side .brand b { display: block; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.side .brand small { display: block; color: var(--side-muted); font-size: .76rem; margin-top: .15rem; }
.side .back { display: inline-flex; align-items: center; gap: .3rem; color: var(--side-muted); font-size: .84rem; padding: .1rem .6rem .5rem; }
.side .back:hover { color: #fff; text-decoration: none; }
.side .cat-title { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 600; padding: .35rem .6rem .6rem; font-size: .98rem; }
.side .cat-title .ico { color: #8fb4ff; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; gap: .65rem; align-items: center; color: var(--side-text); padding: .55rem .7rem; border-radius: 11px;
  font-size: .93rem; font-weight: 450; transition: background .15s, color .15s; position: relative;
}
.side nav a .ico { opacity: .8; }
.side nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side nav a.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: 0 8px 22px -8px rgba(37, 99, 235, .8); }
.side nav a.active .ico { opacity: 1; }
.side nav .group { color: var(--side-muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; margin: 1rem .7rem .35rem; text-transform: uppercase; }
.side nav .dot { width: 6px; height: 6px; border-radius: 50%; background: #3d5182; }
.side .count { background: #f59e0b; color: #1f1300; border-radius: 999px; padding: 0 .45rem; font-size: .74rem; font-weight: 700; line-height: 1.5; }
.side-foot { margin-top: auto; padding: .9rem .6rem .2rem; border-top: 1px solid var(--side-border); font-size: .76rem; color: var(--side-muted); line-height: 1.45; }
.side-foot b { color: var(--side-text); font-weight: 600; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; gap: .75rem; align-items: center; padding: .7rem 2rem;
  background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border); min-height: 66px;
}
.topbar form { margin: 0; }
.icon-btn.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 1rem 0 2.6rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .93rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 2px solid transparent; border-color: var(--brand-line); box-shadow: var(--focus); background: var(--surface); }
.crumbs { display: flex; gap: .45rem; align-items: center; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.top-actions { display: flex; gap: .45rem; align-items: center; margin-left: auto; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; list-style: none;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn .pip {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop[open] > summary { background: var(--surface-3); }
.pop-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: min(380px, 92vw); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .6rem; animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .55rem; font-weight: 600; }
.pop-head a { font-size: .84rem; font-weight: 500; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; }
.apps a { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; font-size: .8rem; line-height: 1.3; color: var(--text-2); padding: .75rem .3rem; border-radius: 12px; }
.apps a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.apps a.planned { opacity: .55; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.notes a { display: grid; grid-template-columns: 34px 1fr; gap: .65rem; padding: .55rem .5rem; border-radius: 12px; color: var(--text); }
.notes a:hover { background: var(--surface-2); text-decoration: none; }
.notes b { font-weight: 600; font-size: .9rem; display: block; }
.notes small { font-size: .8rem; }
.notes .empty { padding: .8rem .6rem; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .3rem; border-radius: 14px; cursor: pointer; }
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .95rem;
  color: #fff; background: var(--brand-grad); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand-line);
}
.avatar.sm { width: 32px; height: 32px; font-size: .82rem; box-shadow: none; }
.user-chip .who { line-height: 1.25; text-align: left; }
.user-chip .who b { display: block; font-size: .9rem; font-weight: 600; color: var(--text); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { font-size: .76rem; }
.menu-list { display: grid; gap: 2px; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .6rem; border-radius: 10px; border: 0; background: none;
  color: var(--text-2); font: inherit; font-size: .9rem; cursor: pointer; text-align: left;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-sep { height: 1px; background: var(--border); margin: .35rem .2rem; }
.menu-field { padding: .4rem .6rem .6rem; display: grid; gap: .4rem; }
.menu-field select { width: 100%; }

.demo-banner {
  margin: 1rem 2rem 0; padding: .6rem 1rem; border-radius: 12px; font-size: .86rem; line-height: 1.5;
  background: var(--demo-soft); color: var(--text-2); border: 1px solid var(--demo-line);
}
.demo-banner.real { background: var(--ok-soft); border-color: var(--ok-line); }
.content { padding: 1.6rem 2rem 3.5rem; width: 100%; max-width: 1600px; }

/* ---- page header ------------------------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; }
.page-head .muted { font-size: .93rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hero { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.hero-title { display: flex; gap: 1rem; align-items: center; }
.hero-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--brand-grad); box-shadow: 0 12px 28px -10px rgba(37, 99, 235, .65); flex: none; }
.hero h1 { font-size: 1.85rem; margin: 0; }
.hero .sub { color: var(--muted); font-size: .95rem; }
.hero-tag { text-align: center; }
.hero-tag b { display: block; font-size: 1.12rem; font-weight: 600; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-tag small { font-size: .76rem; letter-spacing: .02em; }
.date-chip { display: inline-flex; align-items: center; gap: .5rem; height: 42px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .9rem; box-shadow: var(--shadow-sm); white-space: nowrap; }
.date-chip .ico { color: var(--brand); }

/* ---- cards & grids --------------------------------------------------------------------- */
.grid { display: grid; gap: 1.15rem; }
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: 1.15rem; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card-head > div { min-width: 0; }
.card-head .sub { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; margin-top: .1rem; }
.card-head .more { font-size: .84rem; font-weight: 500; white-space: nowrap; padding: .25rem .65rem; border-radius: 8px; background: var(--brand-soft); }
.card-head .more:hover { text-decoration: none; }
.ch { display: flex; gap: .7rem; align-items: center; }
.ch-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.stat .value { font-size: 1.65rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .label { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.stat .value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.card.stat { position: relative; overflow: hidden; }
.card.stat::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-grad); opacity: .85; }

/* tints for icon tiles */
.t-blue { color: var(--t-blue); background: var(--t-blue-bg); }
.t-green { color: var(--t-green); background: var(--t-green-bg); }
.t-red { color: var(--t-red); background: var(--t-red-bg); }
.t-amber { color: var(--t-amber); background: var(--t-amber-bg); }
.t-violet { color: var(--t-violet); background: var(--t-violet-bg); }
.t-cyan { color: var(--t-cyan); background: var(--t-cyan-bg); }

/* ---- KPI cards ---------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.15rem; }
@media (min-width: 1760px) { .kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi {
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: .25rem .9rem; align-items: start; padding: 1.1rem 1.15rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-line); text-decoration: none; color: var(--text); }
.kpi-icon { grid-row: span 3; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; }
.kpi-label { font-size: .84rem; color: var(--muted); font-weight: 500; line-height: 1.35; }
.kpi-value { font-size: 1.85rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font-size: .85rem; font-weight: 600; color: var(--muted); margin-left: .2rem; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 700; font-size: .78rem; padding: .05rem .4rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--ok); background: var(--ok-soft); }
.delta.bad { color: var(--high); background: var(--high-soft); }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.kpi .spark-line { position: absolute; right: 1.1rem; top: 2.45rem; width: 32%; max-width: 140px; height: 30px; opacity: .8; pointer-events: none; }
.kpi .spark-line path { stroke-width: 2.2; }

/* ---- tables ------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -.2rem; padding: 0 .2rem; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { padding: .62rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; letter-spacing: .01em; }
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.muted td { color: var(--muted); }
tr.warn td { background: var(--warn-row); }
tr.bad td { background: var(--bad-row); }
tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
table.bordered th, table.bordered td { border: 1px solid var(--border); }
table.bordered th { text-align: center; white-space: normal; }
th.sub { font-weight: 500; font-size: .76rem; }

/* ---- badges, deltas ---------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .08rem .55rem; font-size: .74rem; font-weight: 600; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; line-height: 1.5; }
.badge.high { background: var(--high-soft); color: var(--high); border-color: var(--high-line); }
.badge.medium { background: var(--medium-soft); color: var(--medium); border-color: var(--medium-line); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.demo { background: var(--demo-soft); color: var(--demo); border-color: var(--demo-line); }
.badge.neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.up { color: var(--high); font-weight: 600; }
.down { color: var(--ok); font-weight: 600; }

/* ---- bars & progress ----------------------------------------------------------------------- */
.bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.bar .s1 { background: linear-gradient(90deg, var(--c1), color-mix(in srgb, var(--c1) 70%, #fff)); }
.bar .s2 { background: var(--c2); }
.bar .s3 { background: var(--c3); }
.bar .s4 { background: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.marker-wrap { position: relative; }
.marker { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text); border-radius: 2px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 110px; gap: .6rem; align-items: center; font-size: .9rem; margin: .35rem 0; }
.hbar .track { background: var(--surface-3); border-radius: 6px; height: 14px; overflow: hidden; }
.hbar .fill { background: linear-gradient(90deg, var(--c1), color-mix(in srgb, var(--c1) 65%, #fff)); height: 100%; border-radius: 6px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; }
.spark span { flex: 1; background: color-mix(in srgb, var(--c1) 45%, transparent); border-radius: 3px 3px 0 0; min-height: 1px; }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.progress.small { height: 6px; }

/* ---- buttons & forms ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; padding: .4rem .95rem;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 11px; font: inherit;
  font-size: .9rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.3;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { border-color: var(--brand-line); background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(37, 99, 235, .75), inset 0 1px 0 rgba(255, 255, 255, .18); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.danger { color: var(--high); border-color: var(--high-line); }
.btn.danger:hover { background: var(--high-soft); }
.btn.small { min-height: 30px; padding: .15rem .65rem; font-size: .82rem; border-radius: 9px; }
.btn.big { justify-content: center; font-size: 1.12rem; font-weight: 700; padding: .9rem 1rem; min-height: 54px; }
.btn.link { border: none; background: none; color: var(--brand); padding: 0; min-height: 0; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  font: inherit; font-size: .92rem; padding: .45rem .7rem; min-height: 38px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--brand); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--brand); width: 1.05rem; height: 1.05rem; vertical-align: -3px; }
input[type=number] { width: 7rem; }
input[type=file] { padding: .35rem; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.1rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364728b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center;
}
input.qty { width: 5.5rem; text-align: right; }
textarea { width: 100%; min-height: 4.5rem; }
label { display: block; font-size: .84rem; color: var(--muted); margin-bottom: .3rem; font-weight: 500; }
label:has(> input[type=checkbox]) { color: var(--text-2); }
.field { margin-bottom: .9rem; }
.field input, .form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem 1.1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }
.action-bar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: .9rem 1.1rem; margin: 1.15rem 0;
  background: linear-gradient(90deg, var(--brand-soft), transparent); border: 1px solid var(--brand-line); border-radius: var(--radius);
}
.action-bar .hint { color: var(--text-2); font-size: .9rem; margin-right: auto; }

.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid; font-size: .92rem; animation: pop .2s ease-out; }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: .5rem; flex: none; background: currentColor; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.flash.error { background: var(--high-soft); color: var(--high); border-color: var(--high-line); }

.finding { border-left: 4px solid var(--border-strong); padding: .7rem .9rem; margin-bottom: .65rem; background: var(--surface-2); border-radius: 0 12px 12px 0; }
.finding.high { border-color: var(--high); }
.finding.medium { border-color: var(--c3); }
.finding.info { border-color: var(--c1); }
.finding .t { font-weight: 600; }
.finding .d { font-size: .88rem; color: var(--muted); margin-top: .2rem; }

.timeline { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.timeline li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .4rem .7rem; font-size: .85rem; }
.timeline li.done { border-color: var(--ok-line); background: var(--ok-soft); }
.timeline li b { display: block; font-size: .76rem; color: var(--muted); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.note { background: var(--medium-soft); border: 1px solid var(--medium-line); border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; color: var(--text-2); }
.questions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.questions a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .9rem; font-size: .88rem; color: var(--text-2); box-shadow: var(--shadow-sm); }
.questions a:hover { border-color: var(--brand-line); color: var(--brand); text-decoration: none; }
details > summary { cursor: pointer; }
.month-nav { display: flex; gap: .75rem; align-items: center; margin: 0 0 1.15rem; }
.month-nav b { font-size: 1.02rem; }

/* ---- home dashboard patterns ------------------------------------------------------------- */
.dash-row { display: grid; gap: 1.15rem; margin-bottom: 1.15rem; }
.dash-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-3b { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.dash-col { display: grid; gap: 1.15rem; align-content: start; }
.dash-row > .card, .dash-col > .card { margin-top: 0; }
.chart-card { display: flex; flex-direction: column; }
.chart-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: auto; padding-top: 1rem; }
.chart-stats div { padding: .7rem .85rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.chart-stats small { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }
.chart-stats small i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-stats b { display: block; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 5; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .series { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .end-label { font-size: 11.5px; font-weight: 700; fill: #fff; font-family: var(--font); }
.chart-wrap { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; justify-content: center; font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 18px; height: 3px; border-radius: 3px; display: inline-block; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal .dow { text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; padding: .3rem 0; }
.cal .day { min-height: 46px; border-radius: 10px; padding: .3rem .35rem; background: var(--surface-2); font-size: .8rem; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.cal .dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal .dots i { width: 7px; height: 7px; border-radius: 50%; }
.cal .dots i.holiday { background: var(--t-red); } .cal .dots i.receive { background: var(--t-green); }
.cal .dots i.issue { background: var(--t-blue); } .cal .dots i.expiry { background: var(--t-amber); } .cal .dots i.check { background: var(--t-violet); }
.upcoming { list-style: none; margin: .8rem 0 0; padding: .7rem 0 0; border-top: 1px solid var(--border); display: grid; gap: .45rem; }
.upcoming li { display: grid; grid-template-columns: 54px 1fr; gap: .6rem; align-items: center; font-size: .85rem; }
.upcoming .ud { font-weight: 600; font-size: .78rem; color: var(--muted); text-align: center; padding: .15rem 0; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.upcoming .ut { display: flex; gap: .45rem; align-items: center; min-width: 0; }
.upcoming .ut i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.upcoming .ut span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .day.out { background: transparent; color: var(--faint); }
.cal .day.today { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal .day.today .dn { color: var(--brand); font-weight: 700; }
.cal .dn { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal .ev { display: block; font-size: .66rem; line-height: 1.25; padding: 1px 4px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.holiday { background: var(--t-red-bg); color: var(--t-red); }
.cal .ev.receive { background: var(--t-green-bg); color: var(--t-green); }
.cal .ev.expiry { background: var(--t-amber-bg); color: var(--t-amber); }
.cal .ev.issue { background: var(--t-blue-bg); color: var(--t-blue); }
.cal .ev.check { background: var(--t-violet-bg); color: var(--t-violet); }
.cal-head { display: flex; justify-content: center; align-items: center; gap: .8rem; font-weight: 600; margin-bottom: .5rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .76rem; color: var(--muted); margin-top: .6rem; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: .3rem; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li a { display: grid; grid-template-columns: 38px 52px 1fr 16px; gap: .7rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--border); color: var(--text); }
.feed li:last-child a { border-bottom: 0; }
.feed li a:hover { text-decoration: none; background: var(--surface-2); border-radius: 10px; }
.feed .f-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.feed .f-time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .f-body { min-width: 0; }
.feed .f-body b { display: block; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .f-body small { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .ico.go { color: var(--faint); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.issues a { display: grid; grid-template-columns: 22px 1fr auto; gap: .6rem; align-items: center; padding: .55rem .75rem; border-radius: 11px; color: var(--text); background: var(--surface-2); border: 1px solid transparent; }
.issues a:hover { text-decoration: none; border-color: var(--border-strong); }
.issues .high { background: var(--high-soft); }
.issues .high .ico { color: var(--high); }
.issues .medium .ico { color: var(--medium); }
.issues .info .ico { color: var(--info); }
.issues .n { font-weight: 700; color: var(--high); font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.issues .medium .n { color: var(--medium); }
.issues .info .n { color: var(--info); }
.issues .t { font-size: .88rem; min-width: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li a { display: grid; grid-template-columns: 20px 1fr auto; gap: .7rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--border); color: var(--text); }
.checklist li:last-child a { border-bottom: 0; }
.checklist li a:hover { text-decoration: none; }
.checklist li a:hover .ct { color: var(--brand); }
.checklist .box { width: 18px; height: 18px; border-radius: 6px; border: 1.8px solid var(--border-strong); }
.checklist .ct { font-size: .88rem; font-weight: 500; min-width: 0; }
.checklist .ct small { display: block; font-weight: 400; font-size: .78rem; }
.checklist .due { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.checklist .due.late { color: var(--high); font-weight: 600; }
.checklist .empty { padding: .8rem .2rem; color: var(--muted); }
.inbox-list { list-style: none; margin: 0; padding: 0; display: grid; }
.inbox-list a { display: grid; grid-template-columns: 30px 1fr auto; gap: .7rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: .88rem; }
.inbox-list li:last-child a { border-bottom: 0; }
.inbox-list a:hover { text-decoration: none; color: var(--brand); }
.inbox-list .i-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.count-pill { min-width: 28px; text-align: center; padding: .05rem .5rem; border-radius: 8px; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }

/* category tiles */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.75rem 0 .9rem; }
.section-title h2 { font-size: 1.15rem; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.tile {
  display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; color: var(--text); box-shadow: var(--shadow); min-width: 0; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-line); text-decoration: none; color: var(--text); }
.tile h3 { font-size: 1.06rem; margin: .2rem 0 0; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.tile.planned { background: var(--surface-2); box-shadow: none; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.tile-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-grad); color: #fff; flex: none; box-shadow: 0 10px 22px -12px rgba(37, 99, 235, .8); }
.tile.planned .tile-icon { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.tile-icon.big { width: 58px; height: 58px; border-radius: 17px; }
.tile-foot { display: grid; gap: .4rem; margin-top: .5rem; font-size: .82rem; }
.tile-go { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }
.tile-metrics { margin: .3rem 0 0; display: grid; gap: .35rem; flex: 1; }
.tile-metrics div { display: flex; justify-content: space-between; gap: .75rem; border-top: 1px dashed var(--border); padding-top: .35rem; }
.tile-metrics dt { color: var(--muted); font-size: .85rem; }
.tile-metrics dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.tile-planned { display: grid; gap: .35rem; font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .1rem .55rem; font-size: .84rem; color: var(--text-2); }
.chips.small span { font-size: .76rem; padding: 0 .45rem; }
.cat-head { display: flex; gap: 1rem; align-items: center; }
.roadmap { margin: 0; padding-left: 1.4rem; display: grid; gap: .7rem; }
.mods { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.mods.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.mods li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .4rem; padding: .5rem 0; border-top: 1px solid var(--border); font-size: .92rem; }
.mods li .mark { font-weight: 700; color: var(--faint); }
.mods li.ready .mark { color: var(--ok); }
.mods li.planned b { font-weight: 600; color: var(--text-2); }
.mods .muted { font-size: .83rem; }
.links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.links-list a { display: inline-flex; gap: .35rem; align-items: center; font-weight: 600; }
td.pending { color: var(--muted); font-size: .82rem; }
.home-top { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: .75rem; align-items: center; border-top: 1px solid var(--border); padding: .6rem 0; }
.tasks li:first-child { border-top: 0; }
.tasks li a { flex: 1; min-width: 0; display: grid; color: var(--text); }
.tasks li a:hover { text-decoration: none; }
.tasks li a:hover .task-title { color: var(--brand); }
.task-cat { font-size: .76rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; }
.task-title { font-weight: 600; }
.task-detail { font-size: .85rem; color: var(--muted); }
.task-age { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-age.late { color: var(--medium); font-weight: 600; }
.tasks .empty { color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: .8rem; }

/* search results */
.results { list-style: none; margin: 0; padding: 0; display: grid; }
.results a { display: grid; grid-template-columns: 38px 1fr auto; gap: .8rem; align-items: center; padding: .7rem .4rem; border-bottom: 1px solid var(--border); color: var(--text); }
.results a:hover { background: var(--surface-2); text-decoration: none; border-radius: 10px; }
.results b { font-weight: 600; }
.results mark { background: color-mix(in srgb, var(--c3) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* attendance and other category pages */
.freshness { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.clock-card { max-width: 560px; }
.clock-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.clock-buttons form, .clock-buttons .btn { width: 100%; }
.plain-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .92rem; }
.sheet h2 { margin-bottom: .2rem; }

/* ---- login ---------------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 3rem 3.2rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 400px at 20% 10%, rgba(94, 179, 255, .35), transparent 60%),
              radial-gradient(600px 500px at 90% 90%, rgba(16, 185, 129, .22), transparent 60%),
              linear-gradient(160deg, #0a1835 0%, #102a63 55%, #0a1835 100%);
}
.login-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.login-art > * { position: relative; }
.login-brand { display: flex; align-items: center; gap: .8rem; font-weight: 700; font-size: 1.15rem; }
.login-brand small { display: block; font-weight: 400; font-size: .82rem; color: #a9bbe2; }
.login-art h1 { color: #fff; font-size: 2.35rem; line-height: 1.2; margin: 2.5rem 0 1rem; max-width: 15ch; letter-spacing: -.02em; }
.login-art p { color: #c3d0ee; max-width: 46ch; font-size: 1rem; }
.login-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .8rem; max-width: 460px; }
.login-points li { display: grid; grid-template-columns: 40px 1fr; gap: .8rem; align-items: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px; padding: .65rem .8rem; backdrop-filter: blur(6px); }
.login-points .ico-wrap { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #9cc4ff; }
.login-points b { display: block; font-weight: 600; font-size: .94rem; }
.login-points small { color: #a9bbe2; font-size: .82rem; }
.login-foot { font-size: .8rem; color: #8ea2cf; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1rem, 4vw, 3.5rem); gap: 1.2rem; }
.login-panel h2 { font-size: 1.4rem; margin: 0; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.6rem; }
.login-card .card-head { margin-bottom: .6rem; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; max-height: 46vh; overflow: auto; padding: .15rem; }
.user-grid button {
  display: grid; grid-template-columns: 34px 1fr; gap: .1rem .6rem; align-items: center; width: 100%; text-align: left; padding: .55rem .65rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.user-grid button:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.user-grid button.primary { border-color: var(--brand); background: var(--brand-soft); }
.user-grid button .avatar { grid-row: span 2; }
.user-grid button span { font-size: .86rem; font-weight: 600; line-height: 1.3; }
.user-grid button small { font-size: .74rem; line-height: 1.3; }
.login-wrap { max-width: 1050px; margin: 2rem auto; padding: 0 1rem; }

/* ---- responsive ----------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .dash-3 { grid-template-columns: minmax(0, 1fr); }
  .dash-3b { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-top { grid-template-columns: 1fr; }
  .hero-tag { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side:target { transform: none; }
  .side:target + .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 12, 26, .5); backdrop-filter: blur(2px); }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: .6rem 1rem; gap: .5rem; }
  .crumbs, .user-chip .who { display: none; }
  .content { padding: 1.1rem 1rem 3rem; }
  .demo-banner { margin: .8rem 1rem 0; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 2rem 1.5rem; }
  .login-art h1 { font-size: 1.7rem; margin-top: 1.4rem; }
  .login-points { display: none; }
}
@media (max-width: 720px) {
  .kpis, .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .kpi .spark-line { display: none; }
  .chart-stats { grid-template-columns: 1fr; }
  .kpi { grid-template-columns: 1fr; padding: .9rem; }
  .kpi-icon { grid-row: auto; width: 40px; height: 40px; border-radius: 12px; }
  .dash-3, .dash-3b, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .tiles, .mods.two-col { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 80px; }
  .hero h1 { font-size: 1.4rem; }
  .hero-icon { width: 46px; height: 46px; }
  h1 { font-size: 1.35rem; }
  .search { max-width: none; }
  .search input { height: 40px; }
  .top-actions .hide-sm { display: none; }
  .feed li a { grid-template-columns: 34px 1fr 16px; }
  .feed .f-time { display: none; }
  .cal .day { min-height: 38px; }
  /* Tables not wrapped in .table-wrap scroll inside their card instead of widening the page. */
  .card > table, .card > form > table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .side, .topbar, .demo-banner, .no-print, .scrim { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .card, .kpi, .tile { box-shadow: none; }
}

/* ==== Design review refinements (visual director, tested against live pages) ==== */
/* 1 page head */
.page-head { align-items: center; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.page-head > div:first-child:not(.actions) { flex: 1 1 26rem; min-width: 0; }
.page-head h1, .hero h1 { font-size: 1.75rem; line-height: 1.25; letter-spacing: -.01em; margin: 0; }
.page-head h1 .badge { vertical-align: .35em; margin-left: .35rem; }
.page-head > div:first-child > .muted { font-size: .93rem; margin-top: .25rem; max-width: 80ch; }
.hero-icon { width: 52px; height: 52px; border-radius: 16px; }
.content[data-cat] > .page-head { position: relative; padding-left: 68px; min-height: 52px; }
.content[data-cat] > .page-head::before { content: ""; position: absolute; left: 0; top: 0; width: 52px; height: 52px; border-radius: 16px;
  background: var(--cat-grad, var(--brand-grad)); box-shadow: 0 12px 26px -14px rgba(14, 27, 50, .55); }
.content[data-cat] > .page-head::after { content: ""; position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; background: #fff;
  -webkit-mask: var(--cat-icon) center / contain no-repeat; mask: var(--cat-icon) center / contain no-repeat; }
[data-cat="supplies"] { --cat-grad: linear-gradient(135deg, #4f8cff, #1d4ed8); }
[data-cat="time"]     { --cat-grad: linear-gradient(135deg, #22d3ee, #0e7490); }
[data-cat="energy"]   { --cat-grad: linear-gradient(135deg, #f59e0b, #c2410c); }

/* 2 stat */
.stat { display: flex; flex-direction: column; gap: .3rem; }
.stat .label { order: -1; margin: 0; font-size: .84rem; font-weight: 500; color: var(--muted); line-height: 1.4; }
.stat .value { font-size: 1.85rem; letter-spacing: -.02em; line-height: 1.15; }
.card.stat { padding: 1.1rem 1.2rem 1.05rem; }
.card.stat::after { content: none; }
.card.stat .value { margin-top: auto; }

/* 3 card head */
.card > h2:first-child { margin-bottom: 1rem; }
.card-head > a:last-child:not(.btn):not(.more) { font-size: .84rem; font-weight: 500; white-space: nowrap; padding: .25rem .7rem; border-radius: 8px; background: var(--brand-soft); }
.card-head > a:last-child:not(.btn):hover { text-decoration: none; }
.card-head > small:last-child { font-size: .8rem; color: var(--muted); text-align: right; max-width: 45%; line-height: 1.4; }

/* 4 */
.grid.cols-2, .grid.cols-3 { align-items: start; }

/* 6 tables */
td code, td.nowrap, td:has(> .badge:only-child) { white-space: nowrap; }
table.bordered th, table.bordered td { border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table.bordered { border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
table.energy-year tbody td:nth-child(-n+2), table.energy-year tfoot td:first-child { white-space: nowrap; }
table.energy-year :is(tbody, tfoot) td:first-child, table.energy-year thead tr:first-child th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.energy-year thead tr:first-child th:first-child { background: var(--surface-2); }

/* 7 links */
tbody td a:not(.btn), .hbar > a { color: var(--text); font-weight: 500; }
tbody tr:hover td a:not(.btn), .hbar > a:hover { color: var(--brand); }

/* 8 demo */
.badge.demo { background: transparent; border: 1px dashed var(--demo-line); color: var(--demo); font-weight: 500; }
tbody .badge.demo, .tile-metrics .badge.demo { font-size: 0; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--demo); vertical-align: .45em; margin-left: .3rem; }
.demo-banner { margin: .9rem 2rem 0; padding: .4rem .85rem; font-size: .82rem; color: var(--muted); background: transparent; border: 1px dashed var(--demo-line); border-radius: 10px; }
.demo-banner b { color: var(--text-2); }

/* 9 type */
.badge, .delta, .kpi-foot, .cal-legend, .chips.small span, .side .count, .user-grid button small, .cal .dow { font-size: .8rem; }
.side nav .group { font-size: .8rem; letter-spacing: 0; text-transform: none; color: #8a9bc3; font-weight: 600; margin: 1.1rem .7rem .4rem; }
.side nav a { font-weight: 500; }
td code, code { font-family: var(--font); font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--surface-3); padding: .08rem .45rem; border-radius: 6px; }

/* 10 controls */
:root { --control-h: 40px; }
.btn, select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { min-height: var(--control-h); }
.btn.small { min-height: 32px; }
:is(.page-head, .inline-form) .btn.small { min-height: var(--control-h); padding-inline: 1rem; }
form.card.form-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .85rem 1rem; }
form.card.form-grid > div { flex: 1 1 190px; min-width: 0; }
form.card.form-grid > div:has(> .btn) { flex: 0 0 auto; }

/* 11 spark */
@media (min-width: 721px) {
  .kpi:has(.spark-line) { grid-template-columns: 52px minmax(0, 1fr) minmax(64px, 30%); }
  .kpi-icon { grid-column: 1; grid-row: 1 / span 3; }
  .kpi-label, .kpi-foot { grid-column: 2 / -1; }
  .kpi-value { grid-column: 2; grid-row: 2; }
  .kpi .spark-line { position: static; grid-column: 3; grid-row: 2; align-self: center; width: 100%; max-width: none; height: 36px; }
}

/* 15 empty */
:root { --empty-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13.5 5.6 5.3A2 2 0 0 1 7.5 4h9a2 2 0 0 1 1.9 1.3L21 13.5'/%3E%3Cpath d='M3 13.5V18a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4.5h-5l-1.5 2.5h-5L8 13.5H3Z'/%3E%3C/svg%3E"); }
tbody td[colspan].muted { text-align: center; padding: 1.75rem 1rem 1.5rem; font-size: .9rem; color: var(--muted); background: transparent; }
tbody td[colspan].muted::before { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto .55rem; background: var(--faint);
  -webkit-mask: var(--empty-ico) center / contain no-repeat; mask: var(--empty-ico) center / contain no-repeat; }
table:has(> tbody > tr:only-child > td[colspan].muted) thead { display: none; }

/* 16 month nav */
.month-nav { display: inline-flex; align-items: center; gap: 2px; padding: 4px; margin: 0 0 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.month-nav .btn.small { min-height: 34px; border-color: transparent; background: transparent; color: var(--text-2); border-radius: 10px; }
.month-nav .btn.small:hover { background: var(--surface-3); }
.month-nav b { min-width: 9.5rem; text-align: center; font-size: .98rem; font-weight: 600; }

/* 17 findings */
.finding { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: .7rem .9rem .7rem 2.3rem; }
.finding::before { content: ""; position: absolute; left: .95rem; top: 1.1rem; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.finding.high { background: var(--high-soft); border-color: var(--high-line); }
.finding.high::before { background: var(--high); box-shadow: 0 0 0 4px color-mix(in srgb, var(--high) 18%, transparent); }
.finding.medium { border-color: var(--border); }
.finding.medium::before { background: var(--c3); }
.finding.info { border-color: var(--border); }
.finding.info::before { background: var(--c1); }
.finding .t { font-size: .93rem; line-height: 1.45; }
.finding .d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .84rem; }

/* 18 budget */
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem 1.25rem; margin-top: .55rem; }
.legend span { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.legend i { flex: none; margin: 0; width: 9px; height: 9px; border-radius: 50%; }
.bar { height: 12px; }
.marker { width: 3px; height: 22px; top: -5px; border-radius: 3px; box-shadow: 0 0 0 2px var(--surface); }

/* dark mode: separate sidebar from page, visible row tints (both dark entry points) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --side-bg: linear-gradient(180deg, #0c1938 0%, #10224a 50%, #0c1938 100%);
    --side-border: rgba(255, 255, 255, .08);
    --warn-row: rgba(251, 191, 90, .11); --bad-row: rgba(255, 122, 112, .11);
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --side-bg: linear-gradient(180deg, #0c1938 0%, #10224a 50%, #0c1938 100%);
  --side-border: rgba(255, 255, 255, .08);
  --warn-row: rgba(251, 191, 90, .11); --bad-row: rgba(255, 122, 112, .11);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
}

/* 5 one spacing rhythm */
:root { --gap: 1.25rem; --card-pad: 1.25rem 1.4rem; }
.grid, .dash-row, .dash-col, .tiles, .kpis { gap: var(--gap); }
.dash-row, .kpis { margin-bottom: var(--gap); }
.card { padding: var(--card-pad); }
.card + .card { margin-top: var(--gap); }
.content > :where(.card, .grid, .kpis, .dash-row, .tiles) + :where(.card, .grid, .kpis, .dash-row, .tiles) { margin-top: var(--gap); }
.dash-3 { align-items: start; }
.chart-stats { margin-top: 0; padding-top: 0; margin-bottom: 1rem; }

/* 12 chart end labels readable in both themes; phone sizes */
.chart .end-pill { fill: var(--surface); stroke-width: 2; }
.chart .end-label { fill: var(--text); }
@media (max-width: 720px) { .chart .axis { font-size: 22px; } .chart .series { stroke-width: 4; } .chart .end-pill, .chart .end-label { display: none; } }

/* 19 phone */
@media (max-width: 720px) {
  .grid.cols-4:has(> .stat), .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .card.stat { padding: .85rem .95rem; }
  .stat .value { font-size: 1.4rem; }
  .table-wrap > table { min-width: 640px; }
  .search input::placeholder { color: transparent; }
  .demo-banner { margin: .7rem 1rem 0; }
  .page-head h1, .hero h1 { font-size: 1.35rem; }
}
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .demo-banner { margin: .8rem 1rem 0; } }

/* 20 category colour identity */
[data-cat="core"] { --cat-grad: linear-gradient(135deg, #a78bfa, #6d28d9); }
[data-cat="finance"] { --cat-grad: linear-gradient(135deg, #34d399, #047857); }
[data-cat="hrd"] { --cat-grad: linear-gradient(135deg, #fb7185, #be123c); }
.tile:not(.planned) .tile-icon, .apps a:not(.planned) .tile-icon { background: var(--cat-grad, var(--brand-grad)); }

/* 21 avatars by role */
.avatar[data-role="director"] { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.avatar[data-role="head"] { background: linear-gradient(135deg, #22d3ee, #0e7490); }
.avatar[data-role="store"], .avatar[data-role="procurement"] { background: linear-gradient(135deg, #34d399, #047857); }
.avatar[data-role="finance"] { background: linear-gradient(135deg, #fbbf24, #b45309); }
.avatar[data-role="auditor"], .avatar[data-role="admin"] { background: linear-gradient(135deg, #94a3b8, #334155); }

/* 22 login */
.login-panel { align-items: center; }
.login-panel > * { width: 100%; max-width: 540px; }
.login-card form .field:first-of-type { margin-top: 1.1rem; }
.user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 42vh; }
@media (min-width: 961px) { .login-art { position: sticky; top: 0; height: 100vh; } }
@media (max-width: 520px) { .user-grid { grid-template-columns: 1fr; } }
.user-grid .group-label { grid-column: 1 / -1; font-size: .8rem; font-weight: 600; color: var(--muted); margin: .5rem .1rem 0; }

/* 23 background glow without fixed attachment (smooth scrolling) */
body { background: var(--bg); background-attachment: scroll; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1200px 500px at 85% -10%, var(--bg-glow-1), transparent 60%),
              radial-gradient(900px 420px at 10% 110%, var(--bg-glow-2), transparent 60%); }
.demo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--demo); vertical-align: .1em; }

/* ==== Accessibility review (WCAG 2.2 AA): tokens, focus, drawer, menus, calendar, chart ==== */
:root {
  --focus-ring: #2563eb;
  --muted: #5b6880; --faint: #7d889e; --high: #c4281c;
  --t-green: #047857; --t-red: #be123c; --t-amber: #b45309; --t-cyan: #0e7490; --t-blue: #1d4ed8;
  --t-neutral: #5b6880; --t-neutral-bg: #eef2f9;
  --brand-grad: linear-gradient(135deg, #2f6bee 0%, #2563eb 55%, #1e40af 100%);
  --side-active: linear-gradient(95deg, #2f6bee 0%, #2563eb 100%);
  --side-muted: #8a9cc2;
  --c2: #059669; --c3: #d97706;
  --input-line: #7e8ca3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --focus-ring: #8db2ff; --faint: #8390ae; --input-line: #566c9a; --t-neutral: #8e9cb9; --t-neutral-bg: #192842;
    --c2: #34d399; --c3: #fbbf24; --muted: #8e9cb9; --high: #ff7a70;
    --t-green: #4fd1a1; --t-red: #fb7185; --t-amber: #fbbf5a; --t-cyan: #5ee0f5; --t-blue: #8db2ff; }
}
:root[data-theme="dark"] { --focus-ring: #8db2ff; --faint: #8390ae; --input-line: #566c9a; --t-neutral: #8e9cb9; --t-neutral-bg: #192842;
  --c2: #34d399; --c3: #fbbf24; --muted: #8e9cb9; --high: #ff7a70;
  --t-green: #4fd1a1; --t-red: #fb7185; --t-amber: #fbbf5a; --t-cyan: #5ee0f5; --t-blue: #8db2ff; }
.t-neutral { color: var(--t-neutral); background: var(--t-neutral-bg); }
input, select, textarea, .checklist .box { border-color: var(--input-line); }
::placeholder { color: var(--muted); opacity: 1; }
.mods li .mark { color: var(--muted); }
.hero-tag b { background: none; color: var(--brand); }
.side nav .dot { background: #5a6fa3; }
.icon-btn .pip { background: #dc2626; font-size: .72rem; min-width: 20px; height: 20px; }
.apps a.planned { opacity: 1; color: var(--muted); }
html { scroll-padding-top: 80px; scroll-padding-bottom: 16px; }
:root { font-size: 93.75%; }
.side-foot, .side .brand small, .user-chip .who small, th.sub, .chart-stats small, .upcoming .ud { font-size: .8rem; }

/* skip link */
.skip { position: fixed; left: 1rem; top: .75rem; z-index: 100; padding: .6rem 1rem; border-radius: 10px; background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-lg); transform: translateY(-200%); }
.skip:focus { transform: none; }
#main:focus { outline: none; }

/* off-canvas drawer: the hidden drawer leaves the tab order; close button; works without JS via :target */
.nav-close { display: none; }
@media (max-width: 960px) {
  .side { visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  .side:target, .nav-open .side { transform: none; visibility: visible; transition: transform .22s ease; }
  .side:target + .scrim, .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(5, 12, 26, .5); backdrop-filter: blur(2px); }
  .nav-open body { overflow: hidden; }
  .side .nav-close { display: inline-flex; position: absolute; top: 1rem; right: .75rem; color: var(--side-text); }
}
/* popover menus fit the phone screen */
@media (max-width: 720px) {
  .top-actions .pop-panel, .hero .pop-panel { position: fixed; top: 64px; left: 16px; right: 16px; width: auto !important; max-height: calc(100dvh - 80px); overflow: auto; }
}

/* KPI cards never clip: size the number to the card */
.kpi { container-type: inline-size; }
@container (max-width: 330px) { .kpi .spark-line { display: none; } }
.kpi .kpi-value { font-size: clamp(1.25rem, 11.5cqi, 1.85rem); white-space: normal; }
.kpi .kpi-value.small-value { font-size: clamp(1.05rem, 8cqi, 1.3rem); }
.kpi-value small { white-space: nowrap; }
.kpi.empty .kpi-value { color: var(--muted); }
.kpi.empty .kpi-foot { color: var(--text-2); font-weight: 500; }

/* tasks first */
.tasks-strip { margin-bottom: var(--gap); }
.checklist.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.75rem; }
.checklist li a { grid-template-columns: 34px 1fr auto; }
.checklist .task-ico { width: 34px; height: 34px; border-radius: 10px; }
.checklist .due:empty { display: none; }
@media (max-width: 900px) { .checklist.two-col { grid-template-columns: minmax(0, 1fr); } }

/* first-run steps */
.setup { margin-bottom: var(--gap); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.steps a { display: flex; gap: .65rem; align-items: center; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .9rem; }
.steps a:hover { border-color: var(--brand-line); text-decoration: none; }
.step-mark { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: var(--brand-soft); color: var(--brand); }
.steps li.done .step-mark { background: var(--ok-soft); color: var(--ok); }
.steps li.done span:not(.step-mark):not(.sr) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
@media (max-width: 900px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* rows of cards */
.dash-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .dash-2 { grid-template-columns: minmax(0, 1fr); } }
.cost-card { margin-top: var(--gap); }
.empty-note { padding: 2.5rem 0; text-align: center; }
.feed-row { display: grid; grid-template-columns: 38px 52px 1fr 16px; gap: .7rem; align-items: center; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.feed li:last-child .feed-row { border-bottom: 0; }
.feed .f-body b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-go { margin-top: auto; padding-top: .5rem; }

/* chart: one for desktop, one for phone; a data table for screen readers and keyboards */
.chart-sm { display: none; }
@media (max-width: 720px) { .chart-lg { display: none; } .chart-sm { display: block; } .chart-sm .axis { font-size: 15px; } }
.chart-data { margin-top: .8rem; }
.chart-data summary { font-size: .85rem; color: var(--brand); font-weight: 500; }
.chart-data table { margin-top: .6rem; }

/* calendar as a real table */
.cal-nav { width: 34px; height: 34px; }
.cal-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: .82rem; }
.cal-table th { background: none; border: 0; padding: .3rem 0; text-align: center; color: var(--muted); font-size: .8rem; }
.cal-table td { border: 0; height: 46px; padding: .3rem .35rem; vertical-align: top; background: var(--surface-2); border-radius: 10px; }
.cal-table tbody tr:hover td { background: var(--surface-2); }
.cal-table td.out, .cal-table tbody tr:hover td.out { background: transparent; }
.cal-table td.today, .cal-table tbody tr:hover td.today { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-table td.today .dn { color: var(--brand); font-weight: 700; }
.cal-table .dn { display: block; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-table .dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.cal-table .dots i { width: 7px; height: 7px; border-radius: 50%; }
.cal-table .dots i.holiday { background: var(--t-red); }
.cal-table .dots i.receive { background: var(--t-green); }
.cal-table .dots i.issue { background: var(--t-blue); }
.cal-table .dots i.expiry { background: var(--t-amber); }
.cal-table .dots i.check { background: var(--t-violet); }
.cal-table .dots i.training { background: var(--t-cyan); }
@media (max-width: 720px) { .cal-table td { height: 38px; } }

/* tables: keyboard-scrollable regions, sticky first column on phones */
.table-wrap:focus-visible { outline-offset: -2px; }
tbody th[scope="row"] { background: transparent; color: var(--text); font-weight: 500; font-size: .9rem; white-space: normal; }
tfoot th[scope="row"] { background: var(--surface-2); color: var(--text); }
@media (max-width: 720px) {
  .table-wrap th:first-child, .table-wrap td:first-child { min-width: 9rem; position: sticky; left: 0; background: var(--surface); z-index: 1; }
}

/* touch */
@media (pointer: coarse) {
  .icon-btn, .cal-nav { width: 44px; height: 44px; }
  .btn, .btn.small, input:not([type=checkbox]):not([type=radio]), select { min-height: 44px; }
  .card-head .more { padding: .55rem .8rem; }
  .side nav a { min-height: 44px; }
  .questions a { padding: .55rem 1rem; }
  input[type=checkbox], input[type=radio] { width: 1.5rem; height: 1.5rem; }
}

/* login landmark and phone order */
@media (max-width: 960px) { .login-panel { order: -1; } }
@media (max-height: 480px) { .topbar { position: static; } }

/* Windows High Contrast */
@media (forced-colors: active) {
  .side nav a.active, .cal-table td.today { outline: 2px solid Highlight; outline-offset: -2px; }
  .cal-table .dots i, .cal-legend i, .legend i, .chart-legend i, .upcoming .ut i, .icon-btn .pip, .demo-dot { forced-color-adjust: none; }
}
@media (prefers-reduced-motion: reduce) { a.kpi:hover, .tile:hover { transform: none; } }

/* printing: always dark ink on paper */
@media print {
  :root:root:root { --bg: #fff; --surface: #fff; --surface-2: #f7f9fd; --surface-3: #eef2f9; --text: #0e1b32; --text-2: #2f3e58;
    --muted: #5b6880; --border: #d5dce8; --brand: #1d4ed8; color-scheme: light; }
  body::before { display: none; }
  .table-wrap { overflow: visible; }
  .card, .kpi, .tile, tr { break-inside: avoid; }
  .content { max-width: none; padding: 0; }
  .kpi .spark-line, .pop, .cal-head .icon-btn, .nav-close, .skip, .chart-data { display: none !important; }
  a { color: inherit; }
}

/* layout fixes after review round */
.dash-row > .card, .dash-col > .card, .grid > .card, .dash-row > .card + .card { margin-top: 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* status chips (queues) */
.chips-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.chips-nav a { display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: .3rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-sm); }
.chips-nav a:hover { border-color: var(--brand-line); text-decoration: none; color: var(--text); }
.chips-nav a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips-nav .n { min-width: 22px; text-align: center; padding: 0 .4rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: .78rem; font-weight: 700; }
.chips-nav a.on .n { background: rgba(255, 255, 255, .22); color: #fff; }

/* annual inspection: one-tap result buttons, one save */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; border: 0; margin: 0 0 .35rem; padding: 0; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; min-height: 32px; padding: .15rem .7rem; border-radius: 999px; border: 1px solid var(--input-line);
  font-size: .82rem; color: var(--text-2); background: var(--surface); }
.seg input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.seg .seg-ok input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg .seg-damaged input:checked + span, .seg .seg-unused input:checked + span { background: var(--medium); border-color: var(--medium); color: #fff; }
.seg .seg-missing input:checked + span { background: var(--high); border-color: var(--high); color: #fff; }
.seg-note { width: 100%; max-width: 22rem; min-height: 34px; font-size: .85rem; }
.sticky-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: .8rem; padding: .75rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* stepper and sign-off summary */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 0 0 1.1rem; padding: 0; font-size: .9rem; color: var(--muted); }
.stepper li { display: inline-flex; align-items: center; gap: .5rem; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--surface-3); color: var(--muted); }
.stepper li.done { color: var(--text-2); } .stepper li.done span { background: var(--ok-soft); color: var(--ok); }
.stepper li.now { color: var(--text); font-weight: 600; } .stepper li.now span { background: var(--brand); color: #fff; }
.verify-card { border-color: var(--medium-line); margin-bottom: var(--gap); }
.verify-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.verify-facts div { padding: .7rem .85rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.verify-facts dt { font-size: .8rem; color: var(--muted); }
.verify-facts dd { margin: .15rem 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.verify-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; justify-content: space-between; }
.check-line { display: inline-flex; gap: .55rem; align-items: center; margin: 0; color: var(--text-2); font-size: .92rem; }
@media (max-width: 720px) { .verify-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* empty states and breadcrumbs */
.empty-state { text-align: center; padding: 2.5rem 1.5rem; display: grid; justify-items: center; gap: .4rem; }
.empty-state .hero-icon { margin-bottom: .6rem; }
.empty-state h2 { margin: 0; font-size: 1.2rem; }
.empty-state p { max-width: 56ch; margin: 0 0 .6rem; }
.crumbs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); margin: -.3rem 0 .9rem; }
.crumbs-bar a { color: var(--muted); }
.crumbs-bar a:hover { color: var(--brand); }
.crumbs-bar [aria-current] { color: var(--text-2); font-weight: 500; }

.row-action > summary { list-style: none; }
.row-action > summary::-webkit-details-marker { display: none; }
.row-action[open] > summary { display: none; }

input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--border); cursor: not-allowed; }
.progress-card { margin-bottom: var(--gap); }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.progress-card .progress { height: 10px; }

/* ---- HRD: people avatars, organisation tree and chart, mixes, matrices ---------------------- */
.pa { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700;
  font-size: .95rem; color: #fff; background: var(--cat-grad, var(--brand-grad)); }
.pa.sm { width: 28px; height: 28px; font-size: .78rem; }
.pa.lg { width: 72px; height: 72px; font-size: 1.7rem; box-shadow: 0 12px 28px -14px rgba(14, 27, 50, .6); }
.who-cell { display: inline-flex; align-items: center; gap: .55rem; }
.org-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .org-grid { grid-template-columns: minmax(0, 1fr); } }
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.tree details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem; padding: .45rem .5rem;
  border-radius: 10px; font-weight: 600; font-size: .93rem; }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary:hover { background: var(--surface-2); }
.tree details > summary .ico { color: var(--muted); transition: transform .15s ease; }
.tree details[open] > summary .ico { transform: rotate(90deg); }
.tree ul { list-style: none; margin: .1rem 0 .35rem 1rem; padding: 0 0 0 .7rem; border-left: 2px solid var(--border); display: grid; gap: 1px; }
.tree ul a { display: flex; justify-content: space-between; gap: .5rem; padding: .32rem .5rem; border-radius: 8px; color: var(--text-2); font-size: .9rem; }
.tree ul a:hover { background: var(--brand-soft); color: var(--brand-strong); text-decoration: none; }
.tree .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 500; white-space: nowrap; }
.orgchart { overflow-x: auto; padding: .25rem .1rem .6rem; }
.orgchart:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
.oc-top { display: flex; justify-content: center; position: relative; padding-bottom: 1.2rem; }
.oc-top::after { content: ""; position: absolute; bottom: 0; left: 50%; height: 1.2rem; border-left: 2px solid var(--border-strong); }
.oc-node { display: flex; gap: .65rem; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: .65rem .8rem; box-shadow: var(--shadow-sm); min-width: 0; }
.oc-node b { display: block; line-height: 1.3; font-size: .93rem; }
.oc-node small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.oc-node.lead { background: var(--cat-grad, var(--brand-grad)); color: #fff; border: 0; padding: .8rem 1.1rem; box-shadow: var(--shadow-lg); }
.oc-node.lead small { color: rgba(255, 255, 255, .88); }
.oc-node.lead .pa { background: rgba(255, 255, 255, .22); }
.oc-node .pa.sm { background: var(--brand-soft); color: var(--brand); }
.oc-divs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: .75rem; position: relative; padding-top: 1.2rem; }
.oc-divs::before { content: ""; position: absolute; top: 0; border-top: 2px solid var(--border-strong);
  left: calc((100% - (var(--n) - 1) * .75rem) / (2 * var(--n))); right: calc((100% - (var(--n) - 1) * .75rem) / (2 * var(--n))); }
.oc-div { position: relative; min-width: 0; }
.oc-div::before { content: ""; position: absolute; top: -1.2rem; left: 50%; height: 1.2rem; border-left: 2px solid var(--border-strong); }
.oc-depts { list-style: none; margin: .55rem 0 0 .9rem; padding: 0 0 0 .85rem; border-left: 2px solid var(--border); display: grid; gap: .45rem; }
.oc-depts li { position: relative; }
.oc-depts li::before { content: ""; position: absolute; left: -.85rem; top: 50%; width: .75rem; border-top: 2px solid var(--border); }
.oc-dept { display: flex; align-items: center; gap: .5rem; padding: .5rem .65rem; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); }
.oc-dept:hover { border-color: var(--brand-line); background: var(--brand-soft); text-decoration: none; }
.oc-dept b { display: block; font-size: .88rem; line-height: 1.3; }
.oc-dept small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.oc-count { display: grid; justify-items: end; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.oc-count em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--medium); background: var(--medium-soft);
  border-radius: 999px; padding: 0 .4rem; margin-top: .1rem; white-space: nowrap; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin: .2rem 0 .8rem; }
.stack span { height: 100%; }
.stack span + span { box-shadow: -2px 0 0 var(--surface); }
.mix-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.mix-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem .2rem; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.mix-list li:last-child { border-bottom: 0; }
.mix-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix-list b { font-variant-numeric: tabular-nums; }
.mix-list .muted { width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }
table.matrix th.rot { vertical-align: bottom; white-space: nowrap; }
table.matrix th[scope="row"] { font-weight: 500; white-space: nowrap; }
.cellq { display: inline-block; min-width: 2.8rem; padding: .15rem .4rem; border-radius: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.cellq small { font-weight: 500; color: var(--muted); }
.cellq.met { background: var(--ok-soft); color: var(--ok); }
.cellq.short { background: var(--medium-soft); color: var(--medium); }
.cellq.over { background: var(--info-soft); color: var(--info); }
.hbar .fill { display: block; }
.oc-node .up, .oc-node small .up { font-weight: 600; }
.oc-dept { padding: .45rem .55rem; }
.oc-depts { margin-left: .6rem; padding-left: .7rem; }
.oc-depts li::before { left: -.7rem; width: .6rem; }
.org-tree-card { display: none; }
@media (max-width: 760px) {
  .org-chart-card { display: none; }
  .org-tree-card { display: block; }
}

/* ---- HRD: job architecture ---------------------------------------------------------------- */
.jobs-grid { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(240px, 300px); gap: var(--gap, 1.15rem); align-items: start; }
@media (max-width: 1320px) { .jobs-grid { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); } .jobs-grid > .dash-col { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .jobs-grid, .jobs-grid > .dash-col { grid-template-columns: minmax(0, 1fr); } }
.tree-filter { width: 100%; margin-bottom: .6rem; }
.tree ul a.on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.fn-head { display: flex; gap: .9rem; align-items: flex-start; }
.fn-head h2 { margin: 0; font-size: 1.3rem; }
.fn-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #fff;
  background: var(--cat-grad, var(--brand-grad)); box-shadow: 0 12px 26px -14px rgba(14, 27, 50, .55); }
.fn-desc { margin: .45rem 0 0; color: var(--text-2); max-width: 70ch; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 1.1rem 0 .4rem; }
@media (max-width: 700px) { .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini { border: 1px solid var(--border); border-radius: 14px; padding: .65rem .8rem; display: grid; gap: .1rem; background: var(--surface-2); }
.mini span { color: var(--muted); font-size: .8rem; }
.mini b { font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mini small { color: var(--muted); font-size: .78rem; }
h3.sec { font-size: .95rem; margin: 1.2rem 0 .6rem; color: var(--text-2); }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: .55rem; }
@media (max-width: 760px) { .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ladder li + li::before { content: none; } }
.ladder li { position: relative; min-width: 0; }
.ladder li + li::before { content: "›"; position: absolute; left: -.42rem; top: 50%; transform: translate(-50%, -50%); color: var(--faint); font-size: 1.1rem; }
.ladder a { display: grid; gap: .1rem; height: 100%; padding: .6rem .75rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.ladder a:hover { border-color: var(--brand-line); text-decoration: none; }
.ladder li.has a { background: var(--brand-soft); border-color: var(--brand-line); }
.ladder b { font-size: .92rem; }
.ladder small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.step-foot { display: flex; justify-content: space-between; gap: .4rem; font-size: .76rem; color: var(--text-2); font-weight: 600; margin-top: .25rem; }
.needs { display: flex; flex-wrap: wrap; gap: .4rem; }
.need { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .3rem .22rem .65rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .84rem; color: var(--text); }
a.need:hover { border-color: var(--brand-line); text-decoration: none; }
.need .nv { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-strong); font-weight: 700; font-size: .78rem; }
.need.crit { border-color: var(--high-line); background: var(--high-soft); }
.need.crit .nv { background: var(--high); color: #fff; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.doc-list li { display: flex; gap: .6rem; align-items: center; }
.doc-list b { display: block; font-size: .9rem; font-weight: 600; }
.doc-list small { display: block; font-size: .78rem; }
.ft { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: .68rem; font-weight: 700;
  color: var(--t-red); background: var(--t-red-bg); letter-spacing: .02em; }
.tools a { display: flex; align-items: center; gap: .6rem; }
.vladder { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--border); display: grid; gap: .45rem; }
.vladder li { position: relative; }
.vladder li::before { content: ""; position: absolute; left: calc(-.9rem - 6px); top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); transform: translateY(-50%); }
.vladder li.here::before { background: var(--brand); border-color: var(--brand); }
.vladder a { display: grid; padding: .45rem .65rem; border-radius: 10px; color: var(--text); }
.vladder a:hover { background: var(--surface-2); text-decoration: none; }
.vladder li.here a { background: var(--brand-soft); }
.vladder b { font-size: .92rem; }
.vladder small { color: var(--muted); font-size: .78rem; }
.req-table td { vertical-align: top; }
.req-table select { min-width: 11rem; }
.lvl-hint { display: block; font-size: .78rem; margin-top: .15rem; max-width: 60ch; }
.add-row td { background: var(--surface-2); }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; }
.req-list li { display: flex; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.req-list li:last-child { border-bottom: 0; }
.lvl { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.lvl .dots { display: inline-flex; gap: 3px; }
.lvl .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); }
.lvl.b-high .dots i.on { background: var(--ok); border-color: var(--ok); }
.lvl.b-mid .dots i.on { background: var(--medium); border-color: var(--medium); }
.lvl.b-low .dots i.on { background: var(--high); border-color: var(--high); }
.lvl b { font-variant-numeric: tabular-nums; font-size: .9rem; }
.lvl small { color: var(--muted); font-size: .8rem; }
.stack-form { display: grid; gap: .3rem; }
.stack-form label:not(.check-line) { font-size: .86rem; font-weight: 500; color: var(--text-2); margin-top: .35rem; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; max-height: 420px; overflow-y: auto; }
.copy-box { margin-top: 1rem; }
.copy-box summary { cursor: pointer; font-size: .86rem; }
.copy-box form { margin-top: .6rem; }
.filters { margin-bottom: 1rem; }
.stack-form select, .stack-form input:not([type=checkbox]), .stack-form textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.lvl.req .dots i.on { background: var(--brand); border-color: var(--brand); }
.needs-group { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .5rem .6rem; align-items: start; }
.needs-group > span { font-size: .82rem; color: var(--muted); padding-top: .3rem; }

/* ---- HRD: competency and skill libraries -------------------------------------------------- */
.note-bar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .75rem 1rem; margin-bottom: var(--gap, 1.15rem);
  border-radius: 14px; border: 1px solid var(--demo-line); background: var(--demo-soft); color: var(--text-2); font-size: .9rem; }
.note-bar .ico { color: var(--demo); }
.lib-grid { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start; }
@media (max-width: 1000px) { .lib-grid { grid-template-columns: minmax(0, 1fr); } }
.cat-list { display: grid; gap: .3rem; }
.cat-list a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.cat-list a .ch-icon { width: 34px; height: 34px; border-radius: 10px; }
.cat-list a b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.cat-list a:hover { background: var(--surface-2); text-decoration: none; }
.cat-list a.on { background: var(--brand-soft); border-color: var(--brand-line); }
.cat-list a.on b { color: var(--brand-strong); }
.lib-head { display: flex; gap: .9rem; align-items: flex-start; flex-wrap: wrap; }
.lib-head h2 { margin: 0; font-size: 1.35rem; }
.lib-head .tags { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.lib-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.lib-def { margin: 0; padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); color: var(--text-2); max-width: 90ch; }
.level-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
@media (max-width: 1100px) { .level-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.level-cards li { border-radius: 14px; padding: .7rem .75rem .8rem; border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.level-cards li::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; }
.level-cards li.t-red::before { background: var(--t-red); }
.level-cards li.t-amber::before { background: var(--t-amber); }
.level-cards li.t-blue::before { background: var(--t-blue); }
.level-cards li.t-green::before { background: var(--t-green); }
.level-cards li.t-violet::before { background: var(--t-violet); }
.level-cards .ln { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-weight: 700; margin-right: .4rem; }
.level-cards li.t-red .ln { background: var(--t-red-bg); color: var(--t-red); }
.level-cards li.t-amber .ln { background: var(--t-amber-bg); color: var(--t-amber); }
.level-cards li.t-blue .ln { background: var(--t-blue-bg); color: var(--t-blue); }
.level-cards li.t-green .ln { background: var(--t-green-bg); color: var(--t-green); }
.level-cards li.t-violet .ln { background: var(--t-violet-bg); color: var(--t-violet); }
.level-cards b { font-size: .92rem; }
.level-cards p { margin: .5rem 0 0; font-size: .84rem; color: var(--text-2); line-height: 1.5; }
.lib-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; }
@media (max-width: 800px) { .lib-two { grid-template-columns: minmax(0, 1fr); } }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.ticks li { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; }
.ticks .ico { color: var(--ok); flex: none; margin-top: .1rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .8rem; }
.tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong);
  font-size: .78rem; margin: 0 .2rem .2rem 0; }
.link-stats { list-style: none; margin: 0; padding: 0; display: grid; }
.link-stats li { display: flex; gap: .55rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.link-stats li:last-child { border-bottom: 0; }
.link-stats .ico { color: var(--muted); }
.link-stats b { font-variant-numeric: tabular-nums; }
tbody tr.sel td { background: var(--brand-soft); }
.level-edit { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.level-edit legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.level-edit .ln { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft);
  color: var(--brand-strong); font-weight: 700; font-size: .8rem; }
.level-edit textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 1000px) { .level-edit { grid-template-columns: minmax(0, 1fr); } }
form.card.form-grid > .wide { flex-basis: 100%; }
.lib-grid > .card, .jobs-grid > .card, .org-grid > .card { margin-top: 0; }

/* ---- HRD: บุคลากร 360° --------------------------------------------------------------------- */
.pa.xl { width: 92px; height: 92px; font-size: 2.2rem; border-radius: 26px; box-shadow: 0 16px 34px -16px rgba(14, 27, 50, .6); }
.p360-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); margin-bottom: var(--gap, 1.15rem); }
@media (max-width: 1100px) { .p360-top { grid-template-columns: minmax(0, 1fr); } }
.p360-top > .card { margin-top: 0; }
.p360-id { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; position: relative; overflow: hidden; }
.p360-id::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--cat-grad, var(--brand-grad)); }
.p360-id h1 { margin: 0; font-size: 1.6rem; line-height: 1.25; }
.p360-pos { color: var(--text-2); font-weight: 500; margin-top: .2rem; }
.p360-facts { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: .9rem 0 0; }
.p360-facts > div { display: grid; grid-template-columns: auto auto; column-gap: .45rem; align-items: center; }
.p360-facts .ico { grid-row: span 2; color: var(--brand); }
.p360-facts dt { font-size: .76rem; color: var(--muted); }
.p360-facts dd { margin: 0; font-weight: 600; font-size: .92rem; }
.p360-nav { display: flex; gap: .4rem; margin-left: auto; align-self: flex-start; }
.p360-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .55rem; align-content: center; }
.p360-actions a { display: grid; justify-items: center; text-align: center; gap: .2rem; padding: .8rem .5rem; border-radius: 14px; color: var(--text);
  border: 1px solid var(--border); background: var(--surface-2); }
.p360-actions a:hover { border-color: var(--brand-line); text-decoration: none; transform: translateY(-1px); }
.p360-actions a .ico { width: 40px; height: 40px; padding: 9px; border-radius: 12px; box-sizing: border-box; }
.p360-actions a.t-violet .ico { background: var(--t-violet-bg); color: var(--t-violet); }
.p360-actions a.t-blue .ico { background: var(--t-blue-bg); color: var(--t-blue); }
.p360-actions a.t-green .ico { background: var(--t-green-bg); color: var(--t-green); }
.p360-actions a.t-cyan .ico { background: var(--t-cyan-bg); color: var(--t-cyan); }
.p360-actions a.t-amber .ico { background: var(--t-amber-bg); color: var(--t-amber); }
.p360-actions b { font-size: .86rem; }
.p360-actions small { font-size: .74rem; color: var(--muted); }
.p360-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 1.15rem); align-items: start; }
@media (max-width: 1250px) { .p360-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .p360-grid { grid-template-columns: minmax(0, 1fr); } }
.p360-grid > .card { margin-top: 0; }
.lvbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 120px) 2.9rem; gap: .65rem; align-items: center; padding: .38rem 0; font-size: .9rem; }
.lvbar .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvbar .nm small { display: block; color: var(--muted); font-size: .76rem; }
.lvbar .track { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); }
.lvbar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.lvbar .fill.b-high { background: var(--ok); }
.lvbar .fill.b-mid { background: var(--c3); }
.lvbar .fill.b-low { background: var(--high); }
.lvbar .req { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); opacity: .75; }
.lvbar .val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lvbar .val small { color: var(--muted); font-weight: 500; }
.lvbar.short .val { color: var(--high); }
.crit-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--high); vertical-align: 2px; }
.gap-list { list-style: none; margin: 0; padding: 0; display: grid; }
.gap-list li { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.gap-list li:last-child { border-bottom: 0; }
.gap-list small { display: block; font-size: .78rem; }
.gap-n { font-variant-numeric: tabular-nums; color: var(--high); font-size: 1.05rem; }
.career-line { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); display: grid; gap: .55rem; }
.career-line li { position: relative; }
.career-line li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); }
.career-line li.now::before { background: var(--brand); border-color: var(--brand); }
.career-line b { display: block; font-size: .92rem; }
.career-line small { color: var(--muted); font-size: .78rem; }
.mini-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
h2.sec-h { font-size: 1.05rem; margin: .4rem 0 .7rem; }
h2.sec-h:not(:first-child) { margin-top: 1.4rem; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.note-list li { border: 1px solid var(--border); border-radius: 14px; padding: .75rem .9rem; background: var(--surface-2); }
.note-list li.done { opacity: .8; }
.note-list p { margin: .45rem 0 0; white-space: pre-line; }
.note-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.note-follow { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-top: .55rem; font-size: .85rem; color: var(--text-2); }
.score-cell { display: inline-flex; align-items: center; gap: .5rem; }
.score-cell .progress { width: 90px; }
.score-cell b { font-variant-numeric: tabular-nums; font-size: .88rem; }

/* ---- HRD: competency assessment ------------------------------------------------------------ */
.my-work { margin-bottom: var(--gap, 1.15rem); }
.my-work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .7rem; }
.work-tile { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); }
a.work-tile:hover { border-color: var(--brand-line); text-decoration: none; }
.work-tile b { display: block; }
.work-tile small { display: block; font-size: .8rem; }
.work-tile.done { background: var(--ok-soft); border-color: var(--ok-line); }
.team-names { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin-top: .3rem; font-size: .86rem; }
.stage-track { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
@media (max-width: 900px) { .stage-track { grid-template-columns: minmax(0, 1fr); } }
.stage-track li { display: grid; justify-items: center; text-align: center; gap: .3rem; position: relative; padding-top: .1rem; }
.stage-track li + li::before { content: ""; position: absolute; top: 18px; right: calc(50% + 22px); width: calc(100% - 44px + .4rem); height: 3px;
  border-radius: 3px; background: var(--border); }
.stage-track li.st-done + li::before, .stage-track li.st-done::before { background: var(--ok); }
@media (max-width: 900px) { .stage-track li + li::before { content: none; } .stage-track li { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; } }
.st-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-3);
  color: var(--muted); border: 2px solid var(--border-strong); position: relative; z-index: 1; }
.st-done .st-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.st-current .st-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.st-late .st-dot { background: var(--medium); border-color: var(--medium); color: #fff; }
.stage-track b { font-size: .88rem; }
.stage-track small { font-size: .76rem; color: var(--muted); }
.stage-edit { display: grid; gap: .5rem; margin-top: .6rem; }
.stage-edit form { flex-wrap: wrap; }
.st-name { min-width: 12rem; font-size: .88rem; }
.form-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.form-list li { display: flex; gap: .7rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 14px; }
.form-list b { display: block; font-size: .92rem; }
.form-list small { display: block; font-size: .78rem; }
.fl-n { display: grid; justify-items: end; }
.fl-n b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.fl-n small { color: var(--muted); font-size: .74rem; }
.sbar { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: .7rem; align-items: center; margin: .45rem 0; font-size: .88rem; }
.sbar .sb-name small { display: block; color: var(--muted); font-size: .76rem; }
.sb-track { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.sb-track span { display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 600; min-width: 0; }
.histo { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; height: 190px; align-items: end; padding-top: .4rem; }
.hcol { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; justify-items: center; align-items: end; gap: .25rem; }
.hb { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--c1), color-mix(in srgb, var(--c1) 55%, var(--surface))); min-height: 3px; align-self: end; }
.hv { font-weight: 700; font-size: .86rem; font-variant-numeric: tabular-nums; }
.hl { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.histo-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .9rem; }
.histo-stats div { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .7rem; display: grid; }
.histo-stats span { color: var(--muted); font-size: .78rem; }
.histo-stats b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.assess-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.assess-row { border: 1px solid var(--border); border-radius: 14px; padding: .75rem .9rem; }
.ar-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ar-head > .grow { min-width: 14rem; }
.ar-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; align-items: center; }
.ar-meta .need { font-size: .78rem; }
.lvpick { display: inline-flex; gap: 4px; border: 0; margin: 0; padding: 0; flex-wrap: wrap; }
.lvpick label { cursor: pointer; position: relative; }
.lvpick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lvpick span { display: grid; justify-items: center; min-width: 4.6rem; padding: .35rem .4rem; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); line-height: 1.2; }
.lvpick span b { font-size: 1rem; }
.lvpick span small { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.lvpick label.is-req span { border-style: dashed; border-color: var(--brand); }
.lvpick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.lvpick input:checked + span.b-high { background: var(--ok); border-color: var(--ok); color: #fff; }
.lvpick input:checked + span.b-mid { background: var(--c3); border-color: var(--c3); color: #fff; }
.lvpick input:checked + span.b-low { background: var(--high); border-color: var(--high); color: #fff; }
.lvpick input:checked + span small { color: rgba(255, 255, 255, .9); }
.ar-result { min-width: 10rem; }
.ar-more { margin-top: .45rem; }
.ar-more summary { cursor: pointer; font-size: .82rem; color: var(--brand); }
.ar-levels { margin: .5rem 0 .4rem; padding-left: 0; list-style: none; display: grid; gap: .25rem; font-size: .84rem; color: var(--text-2); }
.ar-levels li.is-req { color: var(--text); background: var(--brand-soft); border-radius: 8px; padding: .15rem .4rem; }
.ar-note { width: 100%; max-width: 40rem; font-size: .86rem; }
.sec-label { display: block; font-weight: 600; margin: .4rem 0 .3rem; }

/* ---- HRD: competency and skill matrices --------------------------------------------------- */
.filter-bar label { display: inline-flex; align-items: center; gap: .3rem; }
.filter-bar label .ico { color: var(--brand); }
.mx-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
table.mx { border-collapse: separate; border-spacing: 0; font-size: .86rem; }
table.mx thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); vertical-align: bottom; }
table.mx tr.mx-groups th { top: 0; text-align: center; font-size: .78rem; color: var(--brand-strong); background: var(--brand-soft);
  border-bottom: 1px solid var(--brand-line); }
table.mx tr.mx-groups + tr th { top: 30px; }
table.mx .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 15rem; max-width: 17rem; text-align: left; font-weight: 400; }
table.mx thead .stick { z-index: 3; background: var(--surface-2); }
table.mx tbody tr:hover .stick, table.mx tbody tr:hover td { background: var(--surface-2); }
.mx-col { min-width: 4.6rem; max-width: 6.5rem; text-align: center; white-space: normal; font-weight: 600; font-size: .76rem; line-height: 1.25; }
.mx-col span { display: block; }
.mx-col small { display: block; color: var(--muted); font-weight: 400; font-size: .7rem; margin-top: .15rem; }
.mx-cell { text-align: center; padding: .3rem .25rem; }
.mx-dept { font-size: .8rem; color: var(--text-2); white-space: nowrap; }
.mc { display: inline-grid; grid-auto-flow: column; align-items: baseline; justify-content: center; gap: 1px; min-width: 2.7rem; padding: .18rem .35rem;
  border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.mc small { font-size: .68rem; font-weight: 600; opacity: .75; }
.mc.s-meets { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.mc.s-short1 { background: var(--medium-soft); color: var(--medium); border-color: var(--medium-line); }
.mc.s-short2 { background: var(--high-soft); color: var(--high); border-color: var(--high-line); }
.mc.s-unrated { background: var(--surface); color: var(--muted); border: 1px dashed var(--border-strong); }
.mc.s-extra { background: var(--surface-3); color: var(--text-2); }
.mc.s-none { color: var(--faint); min-width: 0; }
.mc.crit { box-shadow: inset 0 -2px 0 currentColor; }
.mx-legend .mc { width: 14px; height: 14px; min-width: 0; padding: 0; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: .35rem; }
.mx-legend i.mc { font-style: normal; }
.pair-chart { display: grid; grid-template-columns: repeat(var(--cols), minmax(56px, 1fr)); gap: .5rem; align-items: end; overflow-x: auto; padding-top: 1.2rem; }
.pc { display: grid; gap: .35rem; justify-items: center; min-width: 0; }
.pc-bars { display: flex; gap: 4px; align-items: flex-end; height: 170px; width: 100%; justify-content: center; }
.pb { position: relative; width: 40%; max-width: 26px; border-radius: 7px 7px 3px 3px; min-height: 3px; }
.pb.cur { background: var(--ok); }
.pb.req { background: var(--c1); }
.pb em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .7rem; font-weight: 700;
  color: var(--text-2); padding-bottom: 2px; white-space: nowrap; }
.pc-label { font-size: .74rem; color: var(--muted); text-align: center; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.donut-wrap { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center; justify-content: center; }
.donut-wrap > .mix-list { flex: 1 1 220px; min-width: 0; }
.donut { flex: none; }
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut span { position: relative; display: grid; justify-items: center; line-height: 1.15; text-align: center; }
.donut b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.donut small { color: var(--muted); font-size: .76rem; max-width: 80px; }
.top-gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.top-gaps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 90px 3rem; gap: .55rem; align-items: center; font-size: .9rem; }
.top-gaps .rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--high-soft); color: var(--high); font-weight: 700; font-size: .82rem; }
.top-gaps small { display: block; font-size: .76rem; }
.tg-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tg-bar span { display: block; height: 100%; background: var(--high); border-radius: 999px; }
.top-gaps b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar.total { border-top: 1px dashed var(--border); padding-top: .5rem; margin-top: .6rem; }
.cov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cov-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .6rem; align-items: center; font-size: .9rem; }
.cov-list b { font-variant-numeric: tabular-nums; }
.cov-bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cov-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 60%, var(--surface))); }
.cov-list li.total { border-top: 1px dashed var(--border); padding-top: .7rem; }
.cov-list li.total .cov-bar span { background: var(--brand-grad); }

/* ---- HRD: gap analysis -------------------------------------------------------------------- */
.ring-kpi { position: relative; }
.ring-kpi .ring { grid-row: 1 / span 3; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.ring-kpi .ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring-kpi .ring span { position: relative; font-size: .78rem; font-weight: 700; color: var(--brand-strong); }
table.compact th, table.compact td { padding: .45rem .5rem; }
.rank-chip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong);
  font-weight: 700; font-size: .8rem; }
svg.quad { width: 100%; height: auto; display: block; }
svg.quad rect { stroke: var(--surface); stroke-width: 2; }
svg.quad .q-keep { fill: var(--t-blue-bg); }
svg.quad .q-urgent { fill: var(--t-red-bg); }
svg.quad .q-watch { fill: var(--surface-2); }
svg.quad .q-plan { fill: var(--t-amber-bg); }
svg.quad .q-label { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
svg.quad .q-label.urgent { fill: var(--t-red); }
svg.quad .axis { font-size: 10px; fill: var(--muted); }
svg.quad .pt circle { stroke: var(--surface); stroke-width: 2; }
svg.quad .pt-urgent circle { fill: var(--high); }
svg.quad .pt-keep circle { fill: var(--c1); }
svg.quad .pt-plan circle { fill: var(--medium); }
svg.quad .pt-watch circle { fill: var(--muted); }
svg.quad .pt-label { font-size: 9.5px; fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.gap-size { display: inline-grid; place-items: center; min-width: 2rem; padding: .1rem .45rem; border-radius: 8px; background: var(--high-soft); color: var(--high);
  font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.rec-list li { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 14px; }
.rec-list b { display: block; font-size: .92rem; }
.rec-list small { display: block; font-size: .78rem; line-height: 1.4; }
.rec-n { display: grid; justify-items: end; }
.rec-n b { font-size: 1.2rem; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.rec-n small { color: var(--muted); font-size: .72rem; }
.top-gaps.tall li { grid-template-columns: 26px minmax(0, 1fr) auto; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.top-gaps.tall li:last-child { border-bottom: 0; }
.rec-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; }
.rec-grid li { display: flex; gap: .7rem; align-items: center; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 14px; }
.rec-grid b { display: block; font-size: .92rem; }
.rec-grid small { display: block; font-size: .78rem; line-height: 1.4; }

/* ---- HRD: training ------------------------------------------------------------------------ */
tbody tr.bad td { background: var(--bad-row); }
.train-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start;
  margin-bottom: var(--gap, 1.15rem); }
.train-grid > .card { margin-top: 0; }
@media (max-width: 1300px) { .train-grid { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); } .train-grid > .card:last-child { grid-column: 1 / -1; } }
@media (max-width: 860px) { .train-grid { grid-template-columns: minmax(0, 1fr); } }
.sess-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.sess-cards a { display: flex; gap: .8rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
.sess-cards a:hover { border-color: var(--brand-line); background: var(--surface-2); text-decoration: none; }
.sess-cards b { display: block; font-size: .92rem; line-height: 1.35; }
.sess-cards small { display: block; font-size: .78rem; }
.sess-date { width: 52px; height: 56px; border-radius: 12px; display: grid; place-items: center; align-content: center; flex: none;
  background: var(--brand-soft); color: var(--brand-strong); line-height: 1.05; }
.sess-date b { font-size: 1.35rem; }
.sess-date small { font-size: .7rem; font-weight: 600; }
.seat { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.seat-bar { flex: 1; max-width: 160px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.seat-bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); }
.seat small { color: var(--muted); font-size: .74rem; white-space: nowrap; }
table.tcal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; }
table.tcal th { font-size: .74rem; color: var(--muted); font-weight: 600; padding: .2rem; text-align: center; }
table.tcal td { vertical-align: top; height: 84px; padding: .25rem; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
table.tcal.compact td { height: 56px; }
table.tcal td.out { background: transparent; opacity: .45; }
table.tcal td.today { box-shadow: inset 0 0 0 2px var(--brand); }
table.tcal .dn { display: block; font-size: .76rem; font-weight: 600; color: var(--text-2); }
.ev { display: block; font-size: .68rem; line-height: 1.25; padding: .1rem .3rem; margin-top: 2px; border-radius: 5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: #fff; }
a.ev:hover { text-decoration: none; filter: brightness(1.1); }
.ev-inhouse, i.ev-inhouse { background: var(--c1); }
.ev-online, i.ev-online { background: var(--c2); }
.ev-external, i.ev-external { background: var(--c4); }
.ev-more { font-size: .66rem; color: var(--muted); }
.legend i.ev-inhouse, .legend i.ev-online, .legend i.ev-external { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.mini-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.mini-feed li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .6rem; font-size: .86rem; }
.mf-time { color: var(--muted); font-size: .76rem; }
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.fu-list li { display: grid; gap: .4rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 12px; }
.fu-list b { display: block; font-size: .9rem; }
.fu-list small { display: block; font-size: .78rem; }
.stars { font-weight: 700; color: var(--t-amber); }
.stars::before { content: "★ "; }
.doc-link { display: inline-flex; align-items: center; gap: .2rem; font-size: .76rem; margin-left: .3rem; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick-list label { display: flex; gap: .6rem; align-items: center; padding: .45rem .6rem; cursor: pointer; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list small { display: block; font-size: .76rem; }
.roster select, .roster input { min-width: 0; }
.roster .qty { width: 4.2rem; }
.mandatory-box { border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem 1rem; display: grid; gap: .7rem; }
.mandatory-box legend { font-weight: 600; padding: 0 .3rem; }
.aud-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.aud-lists select { width: 100%; }
.cmp { display: inline-block; min-width: 4.4rem; padding: .18rem .4rem; border-radius: 8px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.cmp.s-valid { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.cmp.s-due { background: var(--medium-soft); color: var(--medium); border-color: var(--medium-line); }
.cmp.s-expired { background: var(--high-soft); color: var(--high); border-color: var(--high-line); }
.cmp.s-never { background: var(--surface); color: var(--muted); border: 1px dashed var(--border-strong); }
.legend i.cmp { min-width: 0; width: 14px; height: 14px; padding: 0; border-radius: 4px; margin-right: .35rem; vertical-align: -2px; }
.booked { display: block; font-size: .66rem; color: var(--brand); margin-top: 2px; }
.must-list { list-style: none; margin: 0; padding: 0; display: grid; }
.must-list li { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.must-list li:last-child { border-bottom: 0; }
.must-list small { display: block; font-size: .76rem; }
.rate-card { margin-bottom: var(--gap, 1.15rem); }
.rate-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem 0; border-top: 1px dashed var(--border); }
.rate-row:first-of-type { border-top: 0; }
.rate-row input[name=note] { flex: 1 1 14rem; }
table.tcal.compact .ev { font-size: 0; height: 5px; padding: 0; margin-top: 3px; border-radius: 3px; }
table.tcal.compact .ev-more { display: none; }

/* ---- HRD: TNA and the annual plan ------------------------------------------------------------- */
.plan-status { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; padding: .9rem 1.1rem; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); margin-bottom: var(--gap, 1.15rem); box-shadow: var(--shadow-sm); }
.plan-status b { display: block; }
.plan-status small { display: block; font-size: .82rem; }
.ps-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.plan-status.st-draft .ps-icon { background: var(--surface-3); color: var(--muted); }
.plan-status.st-submitted { border-color: var(--medium-line); background: var(--medium-soft); }
.plan-status.st-submitted .ps-icon { background: var(--medium); color: #fff; }
.plan-status.st-approved { border-color: var(--ok-line); background: var(--ok-soft); }
.plan-status.st-approved .ps-icon { background: var(--ok); color: #fff; }
.src { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.src-gap { background: var(--t-violet-bg); color: var(--t-violet); }
.src-mandatory { background: var(--t-red-bg); color: var(--t-red); }
.src-idp { background: var(--t-green-bg); color: var(--t-green); }
.src-request { background: var(--t-blue-bg); color: var(--t-blue); }
.src-manual { background: var(--surface-3); color: var(--text-2); }
.quarters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .quarters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qcol { display: grid; gap: .2rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.qcol small { font-size: .76rem; }
.qn { font-size: .86rem; font-weight: 600; margin-top: .2rem; }
.qb { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: .3rem; }
.qb span { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }

/* ---- HRD: OJT and IDP ------------------------------------------------------------------------- */
.t-neutral { color: var(--text-2); background: var(--surface-3); }
.ch-icon.sm { width: 28px; height: 28px; border-radius: 8px; }
.text-high { color: var(--high); font-weight: 600; }
.cell-sub { display: block; font-size: .76rem; margin-top: .15rem; }
.progress.warn span { background: linear-gradient(90deg, var(--high), color-mix(in srgb, var(--high) 60%, #fff)); }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; padding: .75rem 1rem; margin-bottom: var(--gap, 1.15rem);
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; color: var(--text-2); }
.callout > span { flex: 1 1 18rem; min-width: 0; }
.callout.warn { border-color: var(--medium-line); background: var(--medium-soft); }
.callout.warn > .ico { color: var(--medium); }
.table-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .8rem; }
.table-tools input[type=search] { flex: 1 1 16rem; min-width: 0; }
.idp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 1.15rem); align-items: start; margin-bottom: var(--gap, 1.15rem); }
.idp-grid > .card, .idp-grid > .dash-col > .card:first-child { margin-top: 0; }
@media (max-width: 1180px) { .idp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .idp-grid { grid-template-columns: minmax(0, 1fr); } }
.mix-702010 { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 1rem 0 .5rem; background: var(--surface-3); }
.mix-702010 span { display: block; height: 100%; }
.m70 { background: var(--t-green); } .m20 { background: var(--t-violet); } .m10 { background: var(--t-blue); }
.legend i.m70, .legend i.m20, .legend i.m10 { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.idp-table td:first-child { min-width: 15rem; }
.idp-table .goal-cell { min-width: 16rem; }
.idp-table td:nth-child(3) { min-width: 7rem; }
.idp-table td:nth-child(4) { min-width: 9.5rem; }
.donut.lg { width: 168px; height: 168px; }
.donut.lg::before { inset: 24px; }
.donut.lg small { max-width: 96px; }

/* vertical timeline of the yearly cycle */
.vtl { list-style: none; margin: 0; padding: 0; display: grid; }
.vtl li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: .7rem; position: relative; padding-bottom: 1rem; }
.vtl li:last-child { padding-bottom: 0; }
.vtl li:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.vtl li.vt-done:not(:last-child)::before { background: var(--ok); }
.vt-dot { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface);
  border: 2px solid var(--border-strong); color: #fff; position: relative; z-index: 1; }
.vt-done .vt-dot { background: var(--ok); border-color: var(--ok); }
.vt-now .vt-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.vt-today .vt-dot { background: var(--surface); border-color: var(--brand); border-style: dashed; box-shadow: none; }
.vt-date { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.vt-body b { display: block; font-size: .9rem; }
.vt-body small { display: block; font-size: .78rem; color: var(--muted); }
.vt-now .vt-body b { color: var(--brand); }
.vt-today .vt-body b { color: var(--text-2); font-style: italic; }

/* methods and goals */
.meth-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.meth-list li { display: flex; gap: .65rem; align-items: center; }
.meth-list .ch-icon { width: 34px; height: 34px; border-radius: 10px; }
.ml-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.ml-top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ml-bar { display: block; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: .3rem; }
.ml-bar span { display: block; height: 100%; border-radius: 999px; }
.ml-bar .t-blue { background: var(--t-blue); } .ml-bar .t-green { background: var(--t-green); } .ml-bar .t-amber { background: var(--t-amber); }
.ml-bar .t-violet { background: var(--t-violet); } .ml-bar .t-red { background: var(--t-red); } .ml-bar .t-cyan { background: var(--t-cyan); }
.ml-bar .t-neutral { background: var(--border-strong); }
.mix-note { font-size: .8rem; margin: .8rem 0 0; padding-top: .6rem; border-top: 1px dashed var(--border); }
.goal-list, .due-list, .who-list, .sugg-list, .idp-items { list-style: none; margin: 0; padding: 0; display: grid; }
.goal-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.goal-list li:last-child { border-bottom: 0; }
.goal-list b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gl-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.due-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.due-list li:last-child { border-bottom: 0; }
.due-list a { color: var(--text); min-width: 0; }
.due-list a:hover { text-decoration: none; color: var(--brand); }
.due-list b { display: block; font-size: .86rem; font-weight: 600; line-height: 1.35; }
.due-list small { display: block; font-size: .76rem; }
.dl-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--medium-soft); color: var(--medium); }
.dl-ico.soon { background: var(--high-soft); color: var(--high); }
.dl-days { font-size: .8rem; font-weight: 700; color: var(--medium); white-space: nowrap; }
.dl-days.soon { color: var(--high); }
.who-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.who-list li:last-child { border-bottom: 0; }
.goal-cell { max-width: 30rem; font-size: .88rem; line-height: 1.5; }
.goal-kind { display: inline-block; margin-right: .35rem; padding: .05rem .5rem; border-radius: 999px; background: var(--t-green-bg); color: var(--t-green);
  font-size: .72rem; font-weight: 600; white-space: nowrap; }
.meth-chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }

/* one plan */
.goal-text { margin: 0; font-size: 1.02rem; line-height: 1.6; white-space: pre-line; }
.idp-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .45rem .8rem; align-items: center; padding: .75rem 0;
  border-bottom: 1px solid var(--border); }
.idp-items li:last-child { border-bottom: 0; }
.idp-items li.empty-row { display: block; }
.it-main b { display: block; font-size: .94rem; line-height: 1.4; }
.it-main small { display: block; font-size: .78rem; }
.it-evidence { display: inline-flex !important; align-items: center; gap: .3rem; margin-top: .25rem; padding: .1rem .5rem; border-radius: 8px;
  background: var(--ok-soft); color: var(--ok); }
.it-done .it-main b { color: var(--text-2); }
.it-due { font-size: .8rem; color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.it-due small { display: block; font-size: .72rem; font-weight: 700; }
.it-due.late { color: var(--high); }
.it-done .it-due { color: var(--ok); }
.it-act { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.it-act .row-action[open] { flex-basis: 100%; }
@media (max-width: 760px) {
  .idp-items li { grid-template-columns: auto minmax(0, 1fr); }
  .it-due { grid-column: 2; text-align: left; }
  .it-act { grid-column: 1 / -1; justify-content: flex-start; }
}
.sugg-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.sugg-list li:last-child { border-bottom: 0; }
.sugg-list li > .grow { min-width: 0; flex: 1 1 16rem; }
.sugg-list b { display: block; font-size: .9rem; line-height: 1.4; }
.sugg-list small { display: block; font-size: .78rem; }
.sugg-pick { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.sugg-pick input { width: 18px; height: 18px; flex: none; }
.review-box { padding: .2rem 0 .9rem; }
.review-box + .review-box { border-top: 1px dashed var(--border); padding-top: .9rem; }
.review-box h3 { margin: 0 0 .4rem; font-size: .92rem; }
.rv-note { margin: 0 0 .25rem; white-space: pre-line; font-size: .9rem; }
.review-box .stack-form { margin-top: .4rem; }
.goal-kinds { border: 0; padding: 0; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.goal-opt { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem .35rem .4rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-size: .88rem; }
.goal-opt input { position: absolute; opacity: 0; pointer-events: none; }
.goal-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.goal-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.idp-new .card + .card { margin-top: var(--gap, 1.15rem); }
.idp-new textarea { width: 100%; }

/* OJT */
.ojt-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ojt-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.ojt-list li:last-child { border-bottom: 0; }
.ojt-list li > .grow { flex: 1 1 14rem; min-width: 0; }
.ojt-list b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.4; }
.ojt-list small { display: block; font-size: .78rem; }
.oj-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2);
  font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ojt-list li.done .oj-mark { background: var(--ok); color: #fff; }
.ojt-list li.done b { color: var(--text-2); }
.tpl { border: 1px solid var(--border); border-radius: 14px; padding: .7rem .9rem; }
.tpl + .tpl { margin-top: .6rem; }
.tpl summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; }
.tpl summary .muted { font-size: .82rem; }
.tpl[open] summary { margin-bottom: .6rem; }
.topics { margin: 0 0 .8rem; padding-left: 1.3rem; font-size: .88rem; color: var(--text-2); display: grid; gap: .15rem; }
.rv-form > summary { list-style: none; }
.rv-form > summary::-webkit-details-marker { display: none; }
.rv-form[open] > summary { display: none; }
.ev-prev { margin: 0 0 .8rem; padding: .6rem .75rem; border-radius: 12px; background: var(--medium-soft); border: 1px solid var(--medium-line); font-size: .86rem; color: var(--text-2); }
.ev-prev b { display: block; color: var(--medium); font-size: .82rem; }
.form-hint { display: block; margin-top: .45rem; font-size: .8rem; }
.plan-status > .grow { flex: 1 1 15rem; min-width: 0; }
.plan-status > form, .plan-status > .row-action { flex: none; }

/* ---- HRD: requests and approvals ---------------------------------------------------------------- */
.stage-track[style*="--steps"] { grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); }
@media (max-width: 900px) { .stage-track[style*="--steps"] { grid-template-columns: minmax(0, 1fr); } }
.req-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start;
  margin-bottom: var(--gap, 1.15rem); }
.req-grid > .card, .req-grid > .dash-col > .card:first-child { margin-top: 0; }
@media (max-width: 1100px) { .req-grid { grid-template-columns: minmax(0, 1fr); } }
.req-grid .seg-links { margin: 0 0 1.2rem; }
.fd-stat { margin-top: .15rem; padding: .05rem .5rem; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: .72rem;
  font-weight: 600; font-variant-numeric: tabular-nums; }
.fd-stat.slow { color: var(--high); }
.fd-stat.none { color: var(--muted); font-weight: 500; }
.type-sum { margin-top: 1rem; }
.type-sum td, .type-sum th { padding-top: .45rem; padding-bottom: .45rem; }
.req-no-cell { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }
.req-table td.pick { width: 2rem; }
.req-table .req-step { min-width: 9rem; }
.seg-links { display: inline-flex; flex-wrap: wrap; gap: .3rem; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-links a { padding: .25rem .75rem; border-radius: 999px; font-size: .8rem; color: var(--text-2); }
.seg-links a:hover { text-decoration: none; color: var(--text); }
.seg-links a.on { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }
.card-head:has(> .seg-links) { flex-wrap: wrap; }
.card-head > .seg-links { flex: none; max-width: 100%; }
.flow-diagram { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; gap: 1.6rem; align-items: stretch; }
.fd-step { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; align-content: start; gap: .3rem; text-align: center; position: relative;
  padding: 1rem .6rem .9rem; border-radius: 16px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.fd-step:not(:last-child)::after { content: ""; position: absolute; right: -1.25rem; top: 50%; width: .9rem; height: .9rem; transform: translateY(-50%);
  background: var(--border-strong); -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat;
  --arrow: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M5 12h14M13 6l6 6-6 6" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E'); }
.fd-step b { color: var(--text); font-size: .92rem; line-height: 1.3; }
.fd-step small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.fd-step.optional { border-style: dashed; }
.fd-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.fd-count { position: absolute; top: -.6rem; right: -.4rem; padding: .1rem .5rem; border-radius: 999px; background: var(--high); color: #fff !important;
  font-size: .74rem; font-weight: 700; box-shadow: var(--shadow-sm); }
.fd-count:hover { text-decoration: none; filter: brightness(1.08); }
@media (max-width: 760px) {
  .flow-diagram { flex-direction: column; gap: 1.3rem; }
  .fd-step { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; column-gap: .8rem; padding: .7rem .8rem; }
  .fd-step .fd-icon { grid-row: span 2; width: 40px; height: 40px; }
  .fd-step:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -1.1rem; transform: translateX(-50%) rotate(90deg); }
}
.fd-note { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0 0; padding: .6rem .8rem; border-radius: 12px; background: var(--info-soft);
  color: var(--text-2); font-size: .82rem; }
.fd-note .ico { color: var(--info); flex: none; margin-top: .1rem; }
.box-list { list-style: none; margin: 0; padding: 0; display: grid; }
.box-list a { display: flex; align-items: center; gap: .7rem; padding: .55rem .15rem; border-bottom: 1px dashed var(--border); color: var(--text); font-size: .88rem; }
.box-list li:last-child a { border-bottom: 0; }
.box-list a:hover { text-decoration: none; color: var(--brand); }
.box-n { min-width: 2.2rem; text-align: center; padding: .1rem .5rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  font-variant-numeric: tabular-nums; }
.box-list a.zero { color: var(--muted); }
.box-list a.zero .box-n { background: var(--surface-3); color: var(--muted); font-weight: 600; }
.act-feed { list-style: none; margin: 0; padding: 0; display: grid; }
.act-feed li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: .65rem; position: relative; padding-bottom: .85rem; font-size: .86rem; }
.act-feed li:last-child { padding-bottom: 0; }
.act-feed li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.af-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: .2rem; background: var(--border-strong); position: relative; z-index: 1;
  box-shadow: 0 0 0 3px var(--surface); }
.af-approve .af-dot { background: var(--ok); }
.af-submit .af-dot { background: var(--brand); }
.af-return .af-dot { background: var(--medium); }
.af-cancel .af-dot { background: var(--muted); }
.act-feed b { font-weight: 600; }
.act-feed small { display: block; font-size: .76rem; margin-top: .1rem; }
.af-note { display: block; color: var(--text-2); font-size: .84rem; margin-top: .15rem; }
.act-feed.wide li { font-size: .9rem; }
.req-table .req-title { min-width: 14rem; max-width: 24rem; }
.req-type { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .86rem; }
.step-name { display: block; font-size: .86rem; font-weight: 600; }
.row-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem; min-width: 12.5rem; }
.row-acts .row-action[open] { flex-basis: 100%; order: 3; }
.row-acts .row-action[open] form { justify-content: flex-end; }
.req-no { font-weight: 500; color: var(--muted); font-size: .8em; font-variant-numeric: tabular-nums; }
.route-list { margin: 0; padding-left: 1.3rem; display: grid; gap: .55rem; }
.route-list b { display: block; font-size: .9rem; }
.route-list small { display: block; color: var(--muted); font-size: .78rem; }
.check-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .5rem; }
.check-list li { display: flex; gap: .55rem; align-items: flex-start; font-size: .87rem; line-height: 1.45; }
.check-list li .ico { flex: none; margin-top: .1rem; }
.check-list li.ok .ico { color: var(--ok); }
.check-list li.warn .ico { color: var(--medium); }
.budget-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ok), var(--c3)); }
.budget-note { margin: .5rem 0 0; font-size: .84rem; color: var(--text-2); }
.kv dd.pre { white-space: pre-line; }
.cancel-box { margin-top: 1rem; }
.seg-field { border: 0; padding: 0; margin: 0; }
.seg-field legend { font-size: .86rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; padding: 0; }
.req-form .card + .card, .req-form .dash-col > .card + .card { margin-top: var(--gap, 1.15rem); }
.req-form textarea { width: 100%; }
.filters .filter-actions { display: flex; align-items: flex-end; }
@media (max-width: 760px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { margin-top: .4rem; } }

/* ---- HRD: performance ------------------------------------------------------------------------- */
.lv-badge { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.lv-0 { --lv: var(--ok); } .lv-1 { --lv: var(--c1); } .lv-2 { --lv: var(--c6); } .lv-3 { --lv: var(--c3); } .lv-4 { --lv: var(--high); }
.lv-badge { color: var(--lv); background: color-mix(in srgb, var(--lv) 13%, transparent); }
.perf-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: stretch;
  margin-bottom: var(--gap, 1.15rem); }
.perf-grid > .card { margin-top: 0; }
@media (max-width: 1250px) { .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .perf-grid > .card:first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .perf-grid { grid-template-columns: minmax(0, 1fr); } }
.lv-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; align-items: end; height: 230px; padding-top: .4rem; }
.lvb { display: grid; grid-template-rows: auto 1fr auto auto auto; justify-items: center; height: 100%; gap: .2rem; text-align: center; }
.lvb b { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--text); }
.lvb-bar { width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 10px 10px 4px 4px; overflow: hidden; }
.lvb-bar span { display: block; width: 100%; min-height: 3px; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lv) 75%, #fff), var(--lv)); }
.lvb small { font-size: .74rem; line-height: 1.25; }
.lvb small:first-of-type { color: var(--text-2); font-weight: 600; }
.lvb-b { color: var(--muted); font-size: .68rem !important; }
.nine { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: .35rem; }
.nine-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .74rem; color: var(--muted); text-align: center; }
.nine-x { grid-column: 2; font-size: .74rem; color: var(--muted); text-align: center; }
.nine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.nb { position: relative; min-height: 66px; border-radius: 10px; padding: .35rem .45rem; display: grid; align-content: start; gap: .1rem;
  background: color-mix(in srgb, var(--nb) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--nb) 28%, transparent); }
.nb-star { --nb: var(--ok); } .nb-rise { --nb: var(--c2); } .nb-core { --nb: var(--c1); } .nb-watch { --nb: var(--c3); } .nb-risk { --nb: var(--high); }
.nb-name { font-size: .66rem; line-height: 1.2; color: var(--text-2); }
.nb b { font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--text); }
.nb-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.nb-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--nb); opacity: .85; }
.pf-table td:first-child { min-width: 13rem; }
.pf-table .delta { margin-left: .35rem; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.rank-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.rank-list .rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok);
  font-weight: 700; font-size: .82rem; }
.rank-list .rank.low { background: var(--high-soft); color: var(--high); }
.score-pill { padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.score-pill.ok { background: var(--ok-soft); color: var(--ok); }
.score-pill.high { background: var(--high-soft); color: var(--high); }
.goal-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.goal-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: .6rem; align-items: start; }
.goal-checks b { font-size: .88rem; }
.goal-checks small { display: block; font-size: .76rem; margin-bottom: .3rem; }
.gc-mark { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.goal-checks li.met .gc-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.gc-pct { font-variant-numeric: tabular-nums; }
.perf-entry .score-in, .score-in { width: 5.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.perf-entry select { min-width: 5.6rem; }
.perf-entry input[name^="note_"] { min-width: 8rem; width: 100%; }
.perf-entry tr.locked td { background: var(--surface-2); }
.perf-entry td:first-child { min-width: 13rem; }
small.pre { white-space: pre-line; }
.perf-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.perf-hist li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) 2.6rem auto; gap: .55rem; align-items: center; font-size: .86rem; }
.ph-round { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.ph-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ph-bar span { display: block; height: 100%; border-radius: 999px; background: var(--lv); }
.perf-hist b { text-align: right; font-variant-numeric: tabular-nums; }
.dev-now { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.dev-now li { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; }
.dev-now small { display: block; font-size: .76rem; }
.dev-now .progress { margin: .35rem 0 .2rem; }
.pa.is-demo { position: relative; }
.pa.is-demo::after { content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--demo);
  box-shadow: 0 0 0 2px var(--surface); forced-color-adjust: none; }

/* ---- HRD: career path ------------------------------------------------------------------------- */
.career-grid { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start;
  margin-bottom: var(--gap, 1.15rem); }
.career-grid > .card, .career-main > .card:first-child { margin-top: 0; }
.career-main { display: grid; gap: var(--gap, 1.15rem); min-width: 0; }
.career-main > .card { margin: 0; }
.career-sub { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start; }
.career-sub > .card, .career-sub > .dash-col > .card:first-child { margin-top: 0; }
@media (max-width: 1250px) { .career-sub { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .career-grid { grid-template-columns: minmax(0, 1fr); } }
.career-sub .crit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .career-sub .crit-grid { grid-template-columns: minmax(0, 1fr); } }
.more-row { margin: .7rem 0 0; font-size: .86rem; }
.fam-list { display: grid; gap: .3rem; }
.fam-list details { border-radius: 12px; }
.fam-list summary { display: flex; align-items: center; gap: .55rem; padding: .45rem .4rem; border-radius: 10px; cursor: pointer; font-size: .9rem; font-weight: 600; list-style: none; }
.fam-list summary::-webkit-details-marker { display: none; }
.fam-list summary:hover { background: var(--surface-2); }
.fam-list summary b { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; }
.fam-list a { display: flex; align-items: center; gap: .5rem; padding: .38rem .6rem .38rem 2.6rem; border-radius: 10px; color: var(--text-2); font-size: .86rem; }
.fam-list a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.fam-list a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.fam-list .n { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.career-ladder { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); gap: 1.4rem; }
.career-ladder li { position: relative; display: grid; gap: .45rem; color: var(--t-blue); background: none; }
.career-ladder li.t-green { color: var(--t-green); } .career-ladder li.t-amber { color: var(--t-amber); } .career-ladder li.t-violet { color: var(--t-violet); }
.career-ladder li.t-red { color: var(--t-red); } .career-ladder li.t-cyan { color: var(--t-cyan); }
.career-ladder li:not(:last-child)::after { content: ""; position: absolute; right: -1.1rem; top: 46px; width: .8rem; height: .8rem; background: var(--border-strong);
  -webkit-mask: var(--arrow-r) center / contain no-repeat; mask: var(--arrow-r) center / contain no-repeat;
  --arrow-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.career-ladder a { display: grid; justify-items: center; text-align: center; gap: .2rem; padding: .9rem .5rem; border-radius: 16px; color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent); background: color-mix(in srgb, currentColor 8%, var(--surface)); }
.career-ladder a:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.career-ladder li.on a { outline: 2px solid currentColor; outline-offset: 2px; }
.career-ladder b { color: var(--text); font-size: .92rem; line-height: 1.3; }
.career-ladder small { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.cl-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 16%, transparent); }
.cl-n { margin-top: .2rem; padding: .05rem .55rem; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: .74rem; font-weight: 600; }
.cl-foot { text-align: center; font-size: .74rem; color: var(--muted); }
@media (max-width: 760px) {
  .career-ladder { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .career-ladder li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -1rem; transform: translateX(-50%) rotate(90deg); }
}
.ready-card { margin-bottom: var(--gap, 1.15rem); }
.ready-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 760px) { .ready-parts { grid-template-columns: minmax(0, 1fr); } }
.rp { display: grid; gap: .3rem; padding: .8rem .9rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.rp.met { border-color: var(--ok-line); background: var(--ok-soft); }
.rp-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-2); font-weight: 600; }
.rp b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.rp small { font-size: .76rem; }
.rp-gaps { margin: .8rem 0 0; font-size: .86rem; color: var(--text-2); }
.crit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1250px) { .crit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .crit-grid { grid-template-columns: minmax(0, 1fr); } }
.crit-grid h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; font-size: .86rem; color: var(--text-2); }
.crit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .84rem; }
.crit-list li { display: flex; align-items: center; gap: .4rem; }
.crit-list li b { min-width: 1.6rem; text-align: center; padding: .02rem .4rem; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; }
.crit-list.plain li { display: block; line-height: 1.45; }
.crit-list.plain li b { background: none; padding: 0; color: var(--text); font-size: inherit; }
.crit-list small { display: block; font-size: .74rem; }
.band-bar { display: flex; height: 18px; min-width: 9rem; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.band-bar span { display: grid; place-items: center; color: #fff; font-size: .68rem; font-weight: 700; min-width: 16px; }
.bb-now { background: var(--ok); } .bb-1y { background: var(--c1); } .bb-2y { background: var(--c3); } .bb-dev { background: var(--high); }
.gap-cell { max-width: 22rem; }
.gap-chip { display: inline-flex; align-items: center; gap: .3rem; margin: .1rem .2rem .1rem 0; padding: .08rem .5rem; border-radius: 999px;
  background: var(--high-soft); color: var(--high); font-size: .74rem; }
.gap-chip b { font-variant-numeric: tabular-nums; }
.cmap td:first-child, .cmap td:nth-child(2) { min-width: 11rem; }
.career-grid > .card:first-child { position: sticky; top: 84px; }
@media (max-width: 860px) { .career-grid > .card:first-child { position: static; } }

/* ---- HRD: talent / 9-box ---------------------------------------------------------------------- */
.bx-lead { --bx: var(--ok); } .bx-star { --bx: var(--c2); } .bx-strong { --bx: var(--c6); } .bx-hipo { --bx: var(--c4); }
.bx-core { --bx: var(--c1); } .bx-expert { --bx: var(--muted); } .bx-develop { --bx: var(--c3); } .bx-watch { --bx: var(--medium); }
.bx-improve { --bx: var(--high); }
.talent-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--gap, 1.15rem); align-items: start;
  margin-bottom: var(--gap, 1.15rem); }
.talent-grid > .card, .talent-grid > .dash-col > .card:first-child { margin-top: 0; }
@media (max-width: 1150px) { .talent-grid { grid-template-columns: minmax(0, 1fr); } }
.nine9 { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: .5rem; }
.n9-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.n9-x { grid-column: 2; text-align: center; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.n9-rows { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.n9-ylab, .n9-xlab { font-size: .76rem; color: var(--muted); align-self: center; text-align: center; }
.n9-ylab { writing-mode: vertical-rl; transform: rotate(180deg); }
.n9 { display: grid; align-content: space-between; gap: .5rem; min-height: 118px; padding: .7rem .75rem; border-radius: 14px;
  background: color-mix(in srgb, var(--bx) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bx) 30%, transparent); }
.n9.pool { border-width: 2px; }
.n9.on { outline: 3px solid color-mix(in srgb, var(--bx) 55%, transparent); outline-offset: 1px; }
.n9-head { display: grid; justify-items: center; text-align: center; gap: .1rem; color: var(--text); }
.n9-head:hover { text-decoration: none; }
.n9-head b { font-size: .92rem; line-height: 1.3; }
.n9-head span { font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.n9-faces { display: flex; justify-content: center; align-items: center; min-height: 30px; }
.face { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-left: -6px; font-size: .74rem; font-weight: 700;
  color: #fff; background: var(--bx); border: 2px solid var(--surface); }
.face:first-child { margin-left: 0; }
.face:hover { text-decoration: none; transform: translateY(-2px); }
.face.sel { box-shadow: 0 0 0 3px var(--brand); }
.face.more { background: var(--surface-3); color: var(--text-2); font-size: .7rem; }
.tag { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--bx) 85%, var(--text)); background: color-mix(in srgb, var(--bx) 15%, transparent); }
.pa.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.sel-who { display: flex; gap: .9rem; align-items: center; margin-bottom: .9rem; }
.sel-who b { display: block; font-size: 1.05rem; }
.sel-who small { display: block; font-size: .8rem; }
.sel-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.sel-tiles > div { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .55rem .65rem; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); }
.sel-tiles small { flex-basis: 100%; font-size: .74rem; color: var(--muted); }
.sel-tiles b { font-variant-numeric: tabular-nums; font-size: .9rem; }
.sel-h { margin: 1rem 0 .45rem; font-size: .9rem; }
.sel-actions { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; font-size: .86rem; color: var(--text-2); }
.sel-ready { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.sel-ready .progress { margin: .3rem 0; }
.sel-ready small { display: block; font-size: .76rem; }
.sel-ready b { font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--brand); }
.talent-table tr.sel td { background: var(--brand-soft); }
.talent-table .plan-cell { max-width: 18rem; font-size: .86rem; }
@media (max-width: 600px) { .n9 { min-height: 92px; padding: .5rem; } .n9-head b { font-size: .78rem; } .face { width: 24px; height: 24px; font-size: .64rem; } }

/* ---- HRD: succession -------------------------------------------------------------------------- */
.succ-grid { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr) minmax(0, 330px); gap: var(--gap, 1.15rem); align-items: start;
  margin-bottom: var(--gap, 1.15rem); }
.succ-grid > .card, .succ-grid > .dash-col > .card:first-child { margin-top: 0; }
@media (max-width: 1300px) { .succ-grid { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); } .succ-grid > .dash-col { grid-column: 1 / -1; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap, 1.15rem); } .succ-grid > .dash-col > .card { margin-top: 0; } }
@media (max-width: 860px) { .succ-grid, .succ-grid > .dash-col { grid-template-columns: minmax(0, 1fr); } }
.role-list { display: grid; gap: .15rem; }
.role-list h3 { display: flex; align-items: center; gap: .45rem; margin: .7rem 0 .3rem; font-size: .8rem; color: var(--text-2); }
.role-list h3:first-child { margin-top: 0; }
.role-list h3 .n { margin-left: auto; color: var(--muted); font-weight: 500; }
.role-list a { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: 10px; color: var(--text); font-size: .86rem; }
.role-list a:hover { background: var(--surface-2); text-decoration: none; }
.role-list a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.role-list .n { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rk-high { background: var(--high); } .rk-medium { background: var(--c3); } .rk-low { background: var(--c1); } .rk-none { background: var(--ok); }
.chain { display: grid; justify-items: center; gap: 1.3rem; padding: .4rem 0; }
.chain-top { display: flex; gap: .8rem; align-items: center; padding: .8rem 1.1rem; border-radius: 16px; border: 1px solid var(--brand-line);
  background: var(--brand-soft); position: relative; }
.chain-top b { display: block; font-size: 1rem; }
.chain-top small { display: block; font-size: .8rem; margin-bottom: .25rem; }
.chain-top::after { content: ""; position: absolute; left: 50%; bottom: -1.3rem; width: 2px; height: 1.3rem; background: var(--border-strong); }
.pa.vacant { background: var(--surface-3); color: var(--muted); }
.chain-succ { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem;
  position: relative; }
.chain-succ::before { content: ""; position: absolute; top: -.65rem; left: 16%; right: 16%; height: 2px; background: var(--border-strong); }
.chain-succ li { position: relative; display: grid; justify-items: center; text-align: center; gap: .3rem; padding: .9rem .7rem; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface-2); }
.chain-succ li::before { content: ""; position: absolute; top: -.65rem; left: 50%; width: 2px; height: .65rem; background: var(--border-strong); }
.chain-succ b { font-size: .92rem; line-height: 1.3; }
.chain-succ small { font-size: .76rem; line-height: 1.35; }
.cs-order { font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: none; }
.cs-hint { color: var(--text-2); }
.empty-chain { display: flex; gap: .45rem; align-items: center; color: var(--high); font-size: .9rem; }
.reason-list { list-style: none; margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: var(--high-soft); display: grid; gap: .3rem;
  font-size: .84rem; color: var(--high); }
.reason-list li { display: flex; gap: .4rem; align-items: center; }
.risk-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.rt { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rt) 30%, transparent);
  background: color-mix(in srgb, var(--rt) 10%, var(--surface)); color: var(--text); }
.rt:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.rt.on { outline: 2px solid var(--rt); outline-offset: 1px; }
.rt small { font-size: .78rem; color: var(--rt); font-weight: 700; }
.rt b { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rt span { font-size: .76rem; color: var(--muted); }
.rt-high { --rt: var(--high); } .rt-medium { --rt: var(--medium); } .rt-low { --rt: var(--c1); } .rt-none { --rt: var(--ok); }
.cov-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 2.6rem 2.4rem; gap: .5rem; align-items: center; padding: .35rem 0; font-size: .84rem; }
.cov-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cov-track span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.cov-track span.low { background: var(--c3); }
.cov-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cov-row small { text-align: right; font-size: .74rem; }
.funnel-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 2rem 2.6rem; gap: .6rem; align-items: center; padding: .45rem 0; font-size: .88rem; }
.fr-track { height: 22px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.fr-track span { display: block; height: 100%; border-radius: 8px; }
.funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.issue-list li { display: flex; gap: .6rem; align-items: center; font-size: .87rem; }
.il-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .74rem; font-weight: 700; color: #fff;
  background: var(--c3); }
.issue-list li.lv0 .il-n { background: var(--high); }
.issue-list li.lv2 .il-n { background: var(--c1); }
.succ-table td:first-child { min-width: 12rem; }
.succ-table .gap-plan { max-width: 20rem; font-size: .86rem; }
.succ-edit, .cand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.succ-edit li { position: relative; padding: .8rem .9rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.se-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.se-form { margin: 0; padding: 0; box-shadow: none; border: 0; background: none; }
.se-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.se-remove { position: absolute; right: .9rem; bottom: .8rem; }
.cand-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.cand-list li:last-child { border-bottom: 0; }
.cand-list li > .who-cell { flex: 1 1 14rem; min-width: 0; }
.cand-facts { display: grid; justify-items: end; gap: .1rem; }
.cand-facts small { font-size: .74rem; }

/* ---- HRD: documents --------------------------------------------------------------------------- */
.chip-sep { width: 1px; align-self: stretch; margin: .2rem .3rem; background: var(--border); }
.doc-name { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.doc-name small { display: block; font-size: .76rem; }
.doc-table td:first-child { min-width: 16rem; }
.doc-table td:nth-child(2) { font-size: .84rem; }
.kind-tag { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.doc-acts { min-width: 0; flex-wrap: nowrap; }
.ver-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ver-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; position: relative; padding: .7rem 0 .7rem 1.6rem;
  border-left: 2px solid var(--border); margin-left: .45rem; }
.vl-dot { position: absolute; left: -7px; top: 1.05rem; width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong);
  box-shadow: 0 0 0 3px var(--surface); }
.ver-list li.now .vl-dot { background: var(--ok); }
.ver-list li > .grow { flex: 1 1 18rem; min-width: 0; }
.ver-list small { display: block; font-size: .78rem; }

/* ---- HRD: turnover ---------------------------------------------------------------------------- */
.turn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 1.15rem); align-items: start; margin-bottom: var(--gap, 1.15rem); }
.turn-grid > .card { margin-top: 0; }
@media (max-width: 1250px) { .turn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .turn-grid { grid-template-columns: minmax(0, 1fr); } }
.month-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .3rem; align-items: end; height: 190px; }
.mb { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: .2rem; }
.mb b { font-size: .8rem; font-variant-numeric: tabular-nums; min-height: 1em; }
.mb-bar { width: 100%; max-width: 26px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px 6px 3px 3px; overflow: hidden; }
.mb-bar span { display: block; width: 100%; background: linear-gradient(180deg, color-mix(in srgb, var(--high) 70%, #fff), var(--high));
  border-radius: 6px 6px 3px 3px; }
.mb small { font-size: .66rem; color: var(--muted); }
.type-chips { list-style: none; margin: .9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.work-table tr.total td { border-top: 2px solid var(--border); background: var(--surface-2); }
.work-table td:first-child { min-width: 11rem; }
.up-when { display: grid; justify-items: end; gap: .15rem; }
.up-when small { font-size: .74rem; }
.note-cell { max-width: 18rem; font-size: .84rem; color: var(--text-2); }

/* ---- HRD: notification centre ----------------------------------------------------------------- */
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; }
.notice-list a { display: flex; align-items: center; gap: .7rem; padding: .7rem .4rem; border-bottom: 1px solid var(--border); color: var(--text); }
.notice-list li:last-child a { border-bottom: 0; }
.notice-list a:hover { background: var(--surface-2); text-decoration: none; }
.notice-list b { display: block; font-size: .9rem; font-weight: 500; line-height: 1.4; }
.notice-list li.unread b { font-weight: 700; }
.notice-list small { display: block; font-size: .78rem; }
.notice-list li.urgent b { color: var(--high); }
.nl-time { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.nl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
@media (max-width: 720px) {
  .notice-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: .7rem; row-gap: .2rem; }
  .notice-list a > .ch-icon { grid-row: 1 / span 2; }
  .notice-list .nl-time { grid-column: 2; grid-row: 2; }
  .notice-list .nl-dot { grid-column: 3; grid-row: 1; margin-top: .45rem; }
}
.notice-more { display: block; text-align: center; padding: .7rem 0 .2rem; font-size: .86rem; font-weight: 600; }
.notice-list .empty-row { padding: 1rem .4rem; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.rule-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .86rem; }
.rule-list li:last-child { border-bottom: 0; }
.rule-list b { display: block; font-weight: 600; }
.rule-list small { display: block; font-size: .74rem; }
.rule-list li.off { opacity: .6; }
.rl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.rule-list li.off .rl-dot { background: var(--border-strong); }
.rules-table tr.off td { opacity: .65; }
.rules-table td:nth-child(3) { max-width: 18rem; font-size: .84rem; }
.chan-icons { display: inline-flex; gap: .25rem; }
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--focus-ring, var(--brand)); outline-offset: 2px; }
.nowrap { white-space: nowrap; }
.notes.news { margin-bottom: .4rem; }

/* ---- HRD: reports and analytics ------------------------------------------------------------------ */
.print-only { display: none; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .84em; letter-spacing: .01em; }
.rp-filter-form { display: grid; gap: .7rem; }
.rp-filter-form label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--text-2); min-width: 0; }
.rp-filter-form select { width: 100%; min-width: 0; }
.rp-filter-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .2rem; }
.rp-filter-actions .btn.primary { flex: 1 1 auto; justify-content: center; }
.rp-filter-form.compact { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); align-items: end; }
.rp-filter-form.compact .rp-filter-actions { margin: 0; flex-wrap: nowrap; }
.rp-filter-bar { padding: 1rem 1.2rem; }
.rp-filter-bar + * { margin-top: var(--gap); }
.rp-scope { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .7rem 0 0; font-size: .84rem; }
.rp-scope .ico { color: var(--muted); }

.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--gap); align-items: start; margin: var(--gap) 0; }
.rp-grid > .card + .card { margin-top: 0; }
.rp-charts { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem; }
.rp-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; }
.rp-fig { margin: 0; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.rp-fig figcaption { display: grid; gap: .1rem; margin-bottom: .6rem; }
.rp-fig figcaption b { font-size: .92rem; }
.rp-fig figcaption small { font-size: .76rem; }
.rp-fig .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-fig .chart .axis { font-size: 13px; }
@media (max-width: 720px) { .rp-fig .chart .axis { font-size: 17px; } }
.cell-bar { display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-end; min-width: 8.5rem; }
.cell-bar .cb-track { flex: 1; max-width: 6rem; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cell-bar .cb-track i { display: block; height: 100%; border-radius: 3px; background: var(--c1); }
.cell-bar.low .cb-track i { background: var(--high); }
.cell-bar.mid .cb-track i { background: var(--c3); }
.cell-bar.ok .cb-track i { background: var(--c2); }
.cell-bar b { font-weight: 600; min-width: 2.8rem; text-align: right; }
.rp-stack { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.rp-stack li { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 3.4rem; gap: .55rem; align-items: center; font-size: .82rem; }
.rs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-3); }
.rs-bar i { display: block; height: 100%; }
.rs-bar .s-high { background: var(--high); }
.rs-bar .s-mid { background: var(--c3); }
.rs-bar .s-low { background: var(--c1); }
.rs-n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rp-idp .donut { width: 128px; height: 128px; }
.rp-idp .donut::before { inset: 19px; }
.rp-idp .donut b { font-size: 1.35rem; }
.rp-idp .mix-list li { font-size: .84rem; padding: .3rem .1rem; }
.rp-minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.rp-mini { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i l" "i v" "d d" "e e"; column-gap: .6rem; row-gap: .1rem;
  align-content: space-between; padding: .8rem .85rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.rp-mini .ch-icon { grid-area: i; width: 34px; height: 34px; border-radius: 10px; }
.rp-mini > small { grid-area: l; font-size: .76rem; color: var(--muted); }
.rp-mini > b { grid-area: v; font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rp-mini > b small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.rp-mini > .delta { grid-area: d; justify-self: start; margin-top: .4rem; }
.rp-mini > em { grid-area: e; font-style: normal; font-size: .74rem; color: var(--muted); margin-top: .25rem; }
.rp-foot { font-size: .8rem; margin: .8rem 0 0; }
.rp-top { list-style: none; margin: 0; padding: 0; display: grid; }
.rp-top a { display: flex; align-items: center; gap: .65rem; padding: .7rem .2rem; border-bottom: 1px solid var(--border); color: var(--text); }
.rp-top li:last-child a { border-bottom: 0; }
.rp-top a:hover { text-decoration: none; background: var(--surface-2); }
.rp-top b { display: block; font-size: .88rem; line-height: 1.35; }
.rp-top .grow small { display: block; font-size: .74rem; line-height: 1.4; margin-top: .1rem; }
.rt-n { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--t-amber-bg); color: var(--t-amber); }
.rp-top li:nth-child(1) .rt-n { background: var(--t-amber); color: #fff; }
.rt-last { display: grid; justify-items: end; font-size: .76rem; white-space: nowrap; text-align: right; }
.rt-last small { font-size: .68rem; }
.rp-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.rp-set { display: flex; gap: .7rem; align-items: center; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 14px; color: var(--text);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.rp-set:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow); }
.rp-set b { display: block; font-size: .9rem; }
.rp-set small { display: block; font-size: .74rem; line-height: 1.4; }
.rp-list { min-width: 54rem; }
.rp-list td { vertical-align: middle; }
.rp-list .row-acts { min-width: 0; flex-wrap: nowrap; }

.rp-cat { margin-top: var(--gap); }
.rp-cat-grid { columns: 2 30rem; column-gap: var(--gap); margin-top: var(--gap); }
.rp-cat-card { break-inside: avoid; margin: 0 0 var(--gap); display: block; }
.content .rp-cat-card + .rp-cat-card { margin-top: 0; }
.rp-cat-card .rp-cat-title small { margin-left: auto; font-size: .76rem; font-weight: 500; }
.rp-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rp-rows li { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.rp-rows li .ch-icon { margin-top: .1rem; }
.rp-rows .grow { min-width: 0; }
.rp-rows .grow > a b { font-size: .92rem; }
.rp-rows .grow .badge { margin-left: .2rem; }
.rp-rows small { display: block; font-size: .78rem; line-height: 1.5; margin-top: .15rem; }
.rr-acts { display: flex; gap: .35rem; flex: none; }
.rp-cat-title { display: flex; align-items: center; gap: .6rem; font-size: 1.02rem; margin: 0 0 .7rem; }
.rp-cat-title .ch-icon { width: 32px; height: 32px; border-radius: 10px; }
.rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr)); gap: var(--gap); }
.rp-cards > .card + .card { margin-top: 0; }
.rp-card { display: flex; flex-direction: column; gap: .45rem; }
.rp-card h3 { margin: .15rem 0 0; font-size: 1rem; line-height: 1.4; }
.rp-card h3 a { color: var(--text); }
.rp-card p { margin: 0; font-size: .84rem; line-height: 1.55; flex: 1; }
.rc-top { display: flex; align-items: center; gap: .55rem; }
.rc-top .badge { margin-left: auto; }
.rc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .35rem; }
.rc-acts small { font-size: .74rem; }

.rp-sched > .card + .card { margin-top: var(--gap); }
.rp-due { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.rp-due > li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem 1rem; align-items: center; padding: .7rem .85rem;
  border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 12px; background: var(--surface); }
.rp-due > li.overdue { border-left-color: var(--high); background: var(--bad-row); }
.rp-due > li.empty-row { display: block; border: 0; padding: .5rem 0; background: none; }
.rd-main b { display: block; font-size: .92rem; }
.rd-main small { display: block; font-size: .78rem; }
.rd-due { display: grid; justify-items: end; gap: .15rem; }
.rd-due small { font-size: .74rem; }
.rd-acts { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: flex-start; }
.rd-send > summary { list-style: none; cursor: pointer; }
.rd-send > summary::-webkit-details-marker { display: none; }
.rd-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-top: .55rem; padding: .7rem; border-radius: 10px; background: var(--surface-2); }
.rd-form label { display: grid; gap: .2rem; font-size: .78rem; font-weight: 600; }
.rp-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.2rem 0 .9rem; }
.rp-sched-list { display: grid; gap: .65rem; }
.rp-sched-row { padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; margin-bottom: .6rem; }
.rs-head b { font-size: .95rem; }
.rs-head small { flex-basis: 100%; font-size: .78rem; }
.rp-periods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.rp-periods.months { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.rp-periods li { position: relative; display: grid; gap: .05rem; padding: .4rem .5rem; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: .76rem; min-width: 0; }
.rp-periods .pl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-periods .pv { display: flex; align-items: center; gap: .2rem; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-periods li.ps-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.rp-periods li.ps-ok .pv { color: var(--ok); }
.rp-periods li.ps-medium { background: var(--medium-soft); border-color: var(--medium-line); }
.rp-periods li.ps-medium .pv { color: var(--medium); }
.rp-periods li.ps-high { background: var(--high-soft); border-color: var(--high-line); }
.rp-periods li.ps-high .pv { color: var(--high); font-weight: 600; }
.rp-periods li.ps-info { background: var(--info-soft); border-color: var(--info-line); }
.rp-periods li.ps-info .pv { color: var(--info); font-weight: 600; }
.ps-undo { position: absolute; top: 2px; right: 2px; margin: 0; opacity: 0; transition: opacity .15s; }
.rp-periods li:hover .ps-undo, .ps-undo:focus-within { opacity: 1; }
.ps-undo .btn.link { color: var(--muted); padding: 2px; }
.rs-edit { margin-top: .5rem; }
.rs-edit > summary { list-style: none; cursor: pointer; font-size: .8rem; display: inline-flex; }
.rs-edit > summary::-webkit-details-marker, .rp-add > summary::-webkit-details-marker { display: none; }
.rp-sched-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; align-items: end; margin-top: .6rem; padding: .8rem;
  border-radius: 12px; background: var(--surface-2); }
.rp-sched-form label { display: grid; gap: .2rem; font-size: .78rem; font-weight: 600; min-width: 0; }
.rp-sched-form input, .rp-sched-form select { width: 100%; min-width: 0; }
.rp-form-acts { display: flex; flex-wrap: wrap; gap: .45rem; }
.rp-add { margin-top: 1rem; }
.rp-add > summary { list-style: none; cursor: pointer; display: inline-flex; }

.rp-export { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.rp-export > .card + .card { margin-top: 0; }
.rp-pdpa { margin-bottom: 1rem; }
.rp-datasets { list-style: none; margin: 0; padding: 0; display: grid; }
.rp-datasets li { display: flex; align-items: center; gap: .8rem; padding: .65rem .1rem; border-bottom: 1px dashed var(--border); }
.rp-datasets li:last-child { border-bottom: 0; }
.rp-datasets b { display: block; font-size: .9rem; }
.rp-datasets small { display: block; font-size: .76rem; line-height: 1.45; }
.rp-all { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.rp-code { display: inline-block; vertical-align: .3em; margin-right: .3rem; padding: .1rem .5rem; border-radius: 8px; font-size: .78rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .02em; }
.rp-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; margin: var(--gap) 0; }
.rp-chip { display: grid; gap: .15rem; align-content: start; padding: .85rem 1rem; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.rc-label { font-size: .78rem; color: var(--muted); }
.rp-chip b { font-size: 1.45rem; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; background: none; }
.rp-chip b small { font-size: .74rem; font-weight: 500; color: var(--muted); }
.rp-chip b.text-value { font-size: 1.05rem; line-height: 1.4; }
.rp-table td:first-child:not(.person) { min-width: 9.5rem; }
.rp-chip > small { font-size: .74rem; line-height: 1.4; }
.rp-chip b.t-blue { color: var(--t-blue); }
.rp-chip b.t-green { color: var(--t-green); }
.rp-chip b.t-red { color: var(--t-red); }
.rp-chip b.t-amber { color: var(--t-amber); }
.rp-chip b.t-violet { color: var(--t-violet); }
.rp-chip b.t-cyan { color: var(--t-cyan); }
.rp-table-card + .rp-table-card { margin-top: var(--gap); }
.rp-scroll { max-height: 70vh; overflow: auto; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.rp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: .76rem; white-space: nowrap; }
.rp-table th.num, .rp-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-table td.person { min-width: 13rem; }
.rp-table tbody tr:hover td { background: var(--surface-2); }
.rp-empty { margin: .4rem 0; }
.rp-note { display: flex; gap: .45rem; align-items: flex-start; font-size: .8rem; margin: 1rem 0 0; }
.rp-note .ico { flex: none; margin-top: .15rem; }
.rp-related { margin-top: calc(var(--gap) * 1.4); }
.rp-related h2 { font-size: .95rem; margin: 0 0 .6rem; }
.rp-rel-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.rp-rel-list a { display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem .45rem .5rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: .84rem; }
.rp-rel-list a:hover { text-decoration: none; border-color: var(--brand-line); }
.rp-rel-list b { display: block; font-weight: 600; }
.rp-rel-list small { display: block; font-size: .7rem; }

.exec-sheet { margin-top: var(--gap); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem; display: grid; gap: 1.25rem; }
.ex-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--text); }
.ex-head h2 { margin: .25rem 0 .2rem; font-size: 1.45rem; line-height: 1.3; text-wrap: balance; }
.ex-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.ex-kicker { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: var(--t-amber); }
.ex-org { display: grid; justify-items: end; text-align: right; font-size: .9rem; }
.ex-org small { color: var(--muted); font-size: .78rem; }
.ex-demo { display: flex; align-items: center; gap: .4rem; margin: -.4rem 0 0; padding: .45rem .75rem; border-radius: 10px; font-size: .8rem;
  background: var(--demo-soft); color: var(--demo); border: 1px dashed var(--demo-line); }
.ex-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.ex-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i l" "v v" "s s"; gap: .35rem .6rem; align-content: start;
  padding: .85rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.ex-tile .ch-icon { grid-area: i; width: 32px; height: 32px; border-radius: 9px; }
.et-label { grid-area: l; align-self: center; font-size: .8rem; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.et-value { grid-area: v; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .45rem; font-size: 1.55rem; font-weight: 700;
  line-height: 1.2; font-variant-numeric: tabular-nums; }
.et-value small { font-size: .74rem; font-weight: 500; color: var(--muted); }
.et-value .delta { font-size: .72rem; }
.et-sub { grid-area: s; font-size: .74rem; line-height: 1.45; }
.ex-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; }
.ex-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ex-block { min-width: 0; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; }
.ex-block h3 { display: flex; align-items: center; gap: .45rem; margin: 0 0 .7rem; font-size: .95rem; }
.ex-block h3 .ico { color: var(--muted); }
.ex-issues { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; counter-reset: iss; }
.ex-issues li { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; line-height: 1.5; counter-increment: iss; }
.ex-issues li::before { content: counter(iss); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 700; background: var(--medium-soft); color: var(--medium); margin-top: .05rem; }
.ex-issues li.lv0::before { background: var(--high-soft); color: var(--high); }
.ex-issues li a { flex: none; font-size: .76rem; white-space: nowrap; }
.ex-good { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.ex-good li { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; line-height: 1.5; }
.ex-good li .ico { flex: none; color: var(--ok); margin-top: .15rem; }
.ex-dist { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--surface-3); }
.ex-dist i { display: block; height: 100%; }
.ex-legend { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .78rem; }
.ex-legend li { display: flex; align-items: center; gap: .3rem; }
.ex-legend i { width: 9px; height: 9px; border-radius: 3px; }
.ex-small { font-size: .78rem; margin: .5rem 0 0; }
.ex-big { margin: 0; font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ex-big small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.ex-mini-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .2rem; }
.ex-mini-list li { display: flex; align-items: baseline; gap: .35rem; font-size: .82rem; padding: .25rem 0; border-bottom: 1px dashed var(--border); }
.ex-mini-list li:last-child { border-bottom: 0; }
.ex-mini-list b { font-variant-numeric: tabular-nums; }
.ex-table th[scope="row"] { font-weight: 600; text-align: left; white-space: nowrap; }
.ex-table td.hc { font-weight: 600; }
.hc-ok { background: var(--ok-soft); color: var(--ok); }
.hc-mid { background: var(--medium-soft); color: var(--medium); }
.hc-low { background: var(--high-soft); color: var(--high); }
.ex-table td.hc small { font-weight: 500; opacity: .8; }
.hc-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin: 0 .15rem 0 .5rem; }
.ex-foot { font-size: .74rem; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--border); padding-top: .8rem; }

@media (max-width: 1360px) {
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
  .rp-top { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); column-gap: 1rem; }
  .rp-top li:last-child a { border-bottom: 1px solid var(--border); }
}
@media (max-width: 1100px) {
  .rp-charts, .rp-lower { grid-template-columns: minmax(0, 1fr); }
  .ex-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-two, .ex-three { grid-template-columns: minmax(0, 1fr); }
  .rp-export { grid-template-columns: minmax(0, 1fr); }
  .rp-periods.months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rp-due > li { grid-template-columns: minmax(0, 1fr); }
  .rd-due { justify-items: start; }
  .rd-acts { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .rp-minis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
  .rp-mini { padding: .7rem; }
  .rp-mini > b { font-size: 1.1rem; }
  .rp-stack li { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) 2.8rem; }
  .rp-periods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-periods.months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exec-sheet { padding: 1.1rem 1rem; border-radius: var(--radius); }
  .ex-tiles { gap: .5rem; }
  .ex-tile { padding: .7rem; }
  .et-value { font-size: 1.25rem; }
  .ex-org { justify-items: start; text-align: left; }
  .rp-filter-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-filter-form.compact .rp-filter-actions { grid-column: 1 / -1; }
}
@media print {
  .print-only { display: block; }
  .no-print, .crumbs-bar, .chips-nav, .rp-filter-bar, .rp-related, .ps-undo, .rs-edit, .rp-add { display: none !important; }
  .rp-print-head { display: grid; gap: .15rem; margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 2px solid #0e1b32; font-size: 11pt; }
  .rp-print-head span { font-size: 9pt; color: #5b6880; }
  .rp-scroll { max-height: none; overflow: visible; }
  .rp-table { font-size: 8.5pt; }
  .rp-table thead th { position: static; }
  .rp-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rp-chip, .exec-sheet, .ex-block, .ex-tile { box-shadow: none; }
  .exec-sheet { border: 0; padding: 0; margin: 0; gap: .8rem; }
  .ex-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ex-two { grid-template-columns: 1.25fr 1fr; }
  .ex-three { grid-template-columns: repeat(3, 1fr); }
  .ex-block, .ex-tile { break-inside: avoid; }
  .ex-head h2 { font-size: 16pt; }
  .et-value { font-size: 15pt; }
  .hc-ok, .hc-mid, .hc-low, .rs-bar i, .ex-dist i, .ex-demo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 portrait; margin: 12mm; }
}

/* ---- HRD: overview dashboard and settings ------------------------------------------------------- */
.date-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .3rem .85rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: .86rem; font-weight: 500; box-shadow: var(--shadow-sm); white-space: nowrap; }
.date-chip .ico { color: var(--muted); }
.create-menu > summary { cursor: pointer; }
.create-menu .pop-panel { width: min(300px, 92vw); }
.create-menu .menu-list a .ico { color: var(--brand); flex: none; }
.hd-kpis .kpi-foot { gap: .3rem .45rem; }
.hd-kpis .kf-note { flex-basis: 100%; line-height: 1.4; }
.hd-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .9fr); gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.hd-row > .card + .card { margin-top: 0; }
.hd-row:last-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hd-trend .legend { display: none; }
.hd-sum { list-style: none; margin: .7rem 0 0; padding: .7rem 0 0; border-top: 1px dashed var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1rem; }
.hd-sum li { display: flex; align-items: center; gap: .45rem; font-size: .82rem; min-width: 0; }
.hd-sum li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hd-sum i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hd-sum b { font-variant-numeric: tabular-nums; }
.hd-tcal td { height: 50px; }
.hd-upcoming { list-style: none; margin: .8rem 0 0; padding: .7rem 0 0; border-top: 1px dashed var(--border); display: grid; gap: .45rem; }
.hd-upcoming li { display: grid; grid-template-columns: 5.6rem 10px minmax(0, 1fr); gap: .55rem; align-items: baseline; font-size: .84rem; }
.hd-upcoming .hu-day { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-upcoming .hu-day small { display: block; font-size: .7rem; }
.hd-upcoming i { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.hd-upcoming a { color: var(--text); }
.hd-upcoming li.muted { display: block; }
.ev-ojt, i.ev-ojt { background: var(--c6); }
.ev-deadline, i.ev-deadline { background: var(--c3); color: #3a2300; }
.ev-holiday, i.ev-holiday { background: var(--c5); }
.legend.hd-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.legend.hd-legend i { width: 10px; height: 10px; border-radius: 3px; }
.hd-issue-list, .hd-inbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.hd-issue-list a { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 12px; color: var(--text);
  background: var(--medium-soft); border: 1px solid var(--medium-line); }
.hd-issue-list li.lv0 a { background: var(--high-soft); border-color: var(--high-line); }
.hd-issue-list a:hover { text-decoration: none; filter: brightness(.98); }
.hi-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--medium); }
.hd-issue-list li.lv0 .hi-ico { color: var(--high); }
.hd-issue-list .grow { font-size: .86rem; line-height: 1.4; min-width: 0; }
.hd-issue-list b { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--medium); }
.hd-issue-list li.lv0 b { color: var(--high); }
.hd-issue-list small { font-size: .74rem; color: var(--muted); min-width: 2.6rem; }
.hd-issue-list .empty-row, .hd-inbox-list .empty-row { padding: .6rem 0; }
.hd-inbox-list a { display: flex; align-items: center; gap: .65rem; padding: .55rem .4rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: .88rem; }
.hd-inbox-list li:last-child a { border-bottom: 0; }
.hd-inbox-list a:hover { text-decoration: none; background: var(--surface-2); border-radius: 10px; }
.hb-n { min-width: 30px; padding: .1rem .5rem; border-radius: 999px; text-align: center; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums;
  background: var(--brand); color: #fff; }
.hb-n.zero { background: var(--surface-3); color: var(--muted); font-weight: 600; }
.hd-sub { font-size: .86rem; margin: .4rem 0 .4rem; color: var(--text-2); }
@media (max-width: 720px) { .hd-trend .chart .axis { font-size: 15px; } }
@media (max-width: 1360px) {
  .hd-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-row > .hd-feed { grid-column: 1 / -1; }
  .hd-row:last-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-row:last-child > .hd-inbox { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hd-row, .hd-row:last-child { grid-template-columns: minmax(0, 1fr); }
  .legend.hd-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd-tcal td { height: 44px; }
}

.st-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--gap); align-items: start; }
.st-main > .card + .card { margin-top: var(--gap); }
.st-side > .card + .card { margin-top: var(--gap); }
.st-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: .6rem 1.2rem; align-items: center; padding: .9rem 0;
  border-top: 1px solid var(--border); }
.st-field:first-of-type { border-top: 0; padding-top: .2rem; }
.st-text { display: grid; gap: .2rem; }
.st-text b { font-size: .92rem; }
.st-text small { font-size: .8rem; line-height: 1.5; }
.st-input { display: flex; align-items: center; gap: .55rem; }
.st-input > input { width: 8rem; text-align: right; font-variant-numeric: tabular-nums; }
.st-input small { font-size: .76rem; white-space: nowrap; }
.st-bounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; width: 100%; }
.st-bound { display: grid; gap: .2rem; font-size: .74rem; font-weight: 600; color: var(--text-2); text-align: center; }
.st-bound input { width: 100%; text-align: center; font-variant-numeric: tabular-nums; }
.st-main .sticky-save { margin-top: var(--gap); }
.st-cycle li { align-items: flex-start; }
@media (max-width: 1100px) { .st-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .st-field { grid-template-columns: minmax(0, 1fr); }
  .st-input > input { width: 100%; }
}

/* ---- Finance (การเงินและบัญชี) ----------------------------------------------------------------- */
.fin-funds { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.fin-funds > .card + .card { margin-top: 0; }
.fin-fund { display: grid; gap: .7rem; align-content: start; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.fin-fund:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: var(--shadow-lg); }
.ff-head { display: flex; align-items: center; gap: .7rem; }
.ff-head b { display: block; font-size: .98rem; }
.ff-head small { display: block; font-size: .76rem; }
.ff-total { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.ff-total small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.ff-parts { list-style: none; margin: 0; padding: .6rem 0 0; border-top: 1px dashed var(--border); display: grid; gap: .3rem; }
.ff-parts li { display: flex; justify-content: space-between; gap: .6rem; font-size: .78rem; }
.ff-parts li span { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-parts li b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.fin-table { width: 100%; font-size: .88rem; }
.fin-table th.num, .fin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-table tfoot th, .fin-table tfoot td { border-top: 2px solid var(--border-strong); font-weight: 700; }
.fin-table tr.off td { opacity: .6; }
.fin-table tr.fin-reversed td { color: var(--muted); }
.fin-table tr.fin-reversed td:nth-child(4) { text-decoration: line-through; text-decoration-color: var(--border-strong); }
.fin-table .fin-in { color: var(--ok); }
.fin-table .fin-out { color: var(--high); }
.fin-table tr.fin-carry td { background: var(--surface-2); font-style: italic; }
.fin-lines td.fin-cr { padding-left: 2.2rem; }
.fin-filter { padding: 1rem 1.2rem; }
.fin-filter + * { margin-top: var(--gap); }
.fin-filter-form { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; }
.fin-filter-form label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--text-2); min-width: 0; }
.fin-filter-form select, .fin-filter-form input { min-width: 0; max-width: 100%; }
.fin-filter-form label:has(select[name=account]) { flex: 1 1 14rem; }
.fin-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.fin-sum > div { display: grid; gap: .1rem; padding: .7rem .85rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.fin-sum small { font-size: .76rem; color: var(--muted); }
.fin-sum b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fin-sum .in b { color: var(--ok); }
.fin-sum .out b { color: var(--high); }
.fin-sum .end { background: var(--brand-soft); border-color: var(--brand-line); }
.fin-check { display: flex; align-items: center; gap: .45rem; margin: .8rem 0 0; font-size: .86rem; font-weight: 600; }
.fin-check.ok { color: var(--ok); }
.fin-check.bad { color: var(--high); }
.fin-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem 1.2rem; margin: 0 0 1rem; }
.fin-meta div { display: grid; gap: .1rem; }
.fin-meta dt { font-size: .76rem; color: var(--muted); }
.fin-meta dd { margin: 0; font-weight: 600; }
.fin-inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.fin-inline-form label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; flex: 1 1 20rem; }
.fin-note { display: flex; align-items: center; gap: .4rem; font-size: .82rem; margin: .8rem 0 0; }
.fin-form { display: grid; gap: 1rem; }
.fin-form label { display: grid; gap: .25rem; font-size: .82rem; font-weight: 600; color: var(--text-2); min-width: 0; }
.fin-form-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.fin-form-row > label { flex: 0 1 14rem; }
.fin-form-row > label.grow { flex: 1 1 20rem; }
.fin-wide input { width: 100%; }
.fin-open-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.fin-open-grid fieldset { border: 1px solid var(--border); border-radius: 14px; padding: .6rem 1rem 1rem; margin: 0; display: grid; gap: .5rem; min-width: 0; }
.fin-open-grid legend { font-weight: 700; padding: 0 .35rem; }
.fin-amount { grid-template-columns: minmax(0, 1fr) 9.5rem; align-items: center; gap: .6rem; }
.fin-amount span { font-weight: 500; font-size: .84rem; color: var(--text); }
.fin-amount small { display: block; font-size: .72rem; font-weight: 400; }
.fin-amount input { text-align: right; font-variant-numeric: tabular-nums; width: 100%; }
.fin-adjust select { width: 100%; min-width: 9rem; }
.fin-adjust input { width: 8rem; text-align: right; }
.fin-adjust input.fin-desc { width: 100%; min-width: 11rem; text-align: left; }
.fin-adjust tfoot th, .fin-adjust tfoot td { padding: .7rem .6rem; border-top: 2px solid var(--border-strong); font-size: .9rem; }
.fin-adjust tfoot td.num b { display: inline-block; min-width: 8rem; padding-right: .75rem; }
.fin-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; align-items: end; }
.fin-grid2 label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--text-2); min-width: 0; }
.fin-grid2 .span2 { grid-column: 1 / -1; }
.fin-grid2 input, .fin-grid2 select { width: 100%; }
.fin-check-label { display: flex !important; align-items: center; gap: .45rem; font-weight: 500 !important; }
.fin-check-label input { width: auto !important; }
.fin-edit > summary, .fin-add > summary { list-style: none; cursor: pointer; display: inline-flex; }
.fin-edit > summary::-webkit-details-marker, .fin-add > summary::-webkit-details-marker { display: none; }
.fin-edit[open] form { margin-top: .6rem; padding: .8rem; border-radius: 12px; background: var(--surface-2); min-width: 26rem; }
.fin-add { margin-top: 1rem; }
.fin-add[open] form { margin-top: .7rem; padding: .9rem; border-radius: 12px; background: var(--surface-2); }
.fin-roles li { align-items: flex-start; }
@media (max-width: 1100px) { .fin-open-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .fin-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-grid2 { grid-template-columns: minmax(0, 1fr); }
  .fin-edit[open] form { min-width: 0; }
  .fin-amount { grid-template-columns: minmax(0, 1fr) 7.5rem; }
}

/* finance: forms, documents (receipt, daily cash report) */
.fin-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem 1rem; align-items: end; }
.fin-grid3 .span2 { grid-column: span 2; }
.fin-grid3 .span3 { grid-column: 1 / -1; }
.fin-grid3 input, .fin-grid3 select { width: 100%; }
.fin-subnav { margin-top: -.3rem; }
.fin-subnav a { min-height: 32px; font-size: .82rem; }
.fin-deposit-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.fin-attention { border-color: var(--demo-line); }
.fin-doc { position: relative; max-width: 52rem; margin: var(--gap) auto; padding: 2rem 2.2rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 1rem; }
.fin-doc.cancelled::after { content: "ยกเลิก"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 5rem; font-weight: 800;
  color: var(--high); opacity: .14; transform: rotate(-18deg); pointer-events: none; }
.fd-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; padding-bottom: 1rem; border-bottom: 2px solid var(--text); }
.fd-head b { display: block; font-size: 1.1rem; }
.fd-head small { display: block; color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.fd-title { text-align: right; }
.fd-title h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.fd-title dl { margin: 0; display: grid; gap: .15rem; font-size: .88rem; }
.fd-title dl div { display: flex; gap: .6rem; justify-content: flex-end; }
.fd-title dt { color: var(--muted); }
.fd-title dd { margin: 0; font-weight: 600; }
.fd-payer, .fd-method { margin: 0; font-size: .92rem; }
.fd-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fd-table th, .fd-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: left; }
.fd-table thead th { background: var(--surface-2); font-size: .8rem; }
.fd-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-table tfoot th, .fd-table tfoot td { border-top: 2px solid var(--border-strong); border-bottom: 0; }
.fd-table tr.fd-diff th, .fd-table tr.fd-diff td { color: var(--high); }
.fd-signs { display: flex; justify-content: flex-end; gap: 2rem; margin-top: 1.5rem; }
.fd-signs.three { justify-content: space-between; }
.fd-signs > div { display: grid; justify-items: center; gap: .2rem; min-width: 12rem; text-align: center; font-size: .88rem; }
.fd-line { display: block; width: 100%; min-height: 2.2rem; border-bottom: 1px dotted var(--text-2); position: relative; }
.fd-line em { position: absolute; left: 0; right: 0; bottom: .2rem; font-size: .72rem; color: var(--ok); font-style: normal; }
.fd-signs small { color: var(--muted); }
.fd-demo { margin: 0; text-align: center; font-size: .8rem; color: var(--demo); }
.fd-head.center { flex-direction: column; align-items: center; text-align: center; gap: .15rem; }
.fd-doc-title { margin: 0; font-size: 1.4rem; }
.fd-inline { display: inline !important; font-size: inherit !important; color: var(--text); }
.fd-fill { display: inline-block; min-width: 8rem; padding: 0 .3rem; border-bottom: 1px dotted var(--text-2); font-weight: 600; text-indent: 0; }
.fd-statement { margin: 0; font-size: .95rem; line-height: 2; text-indent: 2.5rem; }
.fd-blank td { height: 2.2rem; }
.fin-daily-acts { max-width: 52rem; margin: 0 auto var(--gap); display: grid; gap: var(--gap); }
.fin-daily-acts > .card + .card { margin-top: 0; }
.fin-sign { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
@media (max-width: 720px) {
  .fin-grid3 { grid-template-columns: minmax(0, 1fr); }
  .fin-grid3 .span2 { grid-column: auto; }
  .fin-doc { padding: 1.2rem 1rem; }
  .fd-head { flex-direction: column; }
  .fd-title { text-align: left; }
  .fd-title dl div { justify-content: flex-start; }
  .fd-signs, .fd-signs.three { flex-direction: column; align-items: stretch; }
}
@media print {
  .fin-doc { box-shadow: none; border: 0; max-width: none; padding: 0; }
  .fin-doc ~ * { display: none !important; }
}

/* finance: receivables from health schemes (ลูกหนี้ค่ารักษา) */
.fin-in { color: var(--ok); }
.fin-out { color: var(--high); }
.fin-ar th[scope="row"] { font-weight: 600; white-space: nowrap; }
.fin-ar tfoot th, .fin-ar tfoot td { border-top: 2px solid var(--border-strong); font-weight: 700; }
.fin-age-col { width: 22%; min-width: 9rem; }
.fin-age { display: flex; height: .7rem; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.fin-age i { display: block; height: 100%; }
.fin-age i + i { box-shadow: -1px 0 0 var(--surface); }
.ag0 { background: var(--t-green); }
.ag1 { background: var(--t-cyan); }
.ag2 { background: var(--t-amber); }
.ag3 { background: var(--t-red); opacity: .7; }
.ag4 { background: var(--t-red); }
.fin-age-legend { display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .72rem; font-weight: 500; color: var(--muted); }
.fin-age-legend span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.fin-age-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; }
.fin-fy select { min-height: 36px; font-size: .85rem; }
.card-head:has(> .fin-fy) { flex-wrap: wrap; }
.fin-fill { display: inline-flex; gap: .4rem; align-items: center; justify-content: flex-end; }
.fin-collect input { width: 9rem; }
.fin-follow li { align-items: center; }
.fin-claim-grid tr.fin-group-start > * { border-top: 2px solid var(--border); }
.fin-claim-grid tbody th { white-space: nowrap; vertical-align: top; padding-top: .9rem; }
.fin-claim-grid input[name^="cases_"] { width: 6rem; }
.callout > .ico + span a, .callout span a { font-weight: 600; }
@media (max-width: 720px) {
  .fin-age-col { min-width: 7rem; }
}
.fin-period { display: grid; gap: .2rem; align-self: end; padding-bottom: .55rem; }
.fin-period small { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.fin-period b { font-size: 1.05rem; }
section.fin-sum + .card { margin-top: var(--gap); }
.tasks-more { margin-top: .7rem; }
.tasks-more > summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--brand); width: fit-content; }
.tasks-more[open] > summary { margin-bottom: .6rem; }

/* finance: payables and payment vouchers (เจ้าหนี้และใบสำคัญจ่าย) */
.fin-payee-group { border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem; display: grid; gap: .55rem; }
.fin-payee-group + .fin-payee-group { margin-top: .7rem; }
.fin-payee-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.fin-payee-head > div { flex: 1 1 14rem; min-width: 0; display: grid; }
.fin-payee-head small { font-size: .78rem; }
.fin-payee-head > b { font-variant-numeric: tabular-nums; }
.fin-payee-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .86rem; }
.fin-payee-items li { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; padding-top: .35rem; border-top: 1px dashed var(--border); }
.fin-payee-items .mono { font-size: .78rem; color: var(--muted); }
.fin-payee-items .grow { flex: 1 1 14rem; min-width: 0; }
.fin-payee-items .num { font-variant-numeric: tabular-nums; margin-left: auto; }
.fin-voucher-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-steps { list-style: none; margin: 0 auto var(--gap); padding: 0; max-width: 52rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.fin-steps li { display: grid; justify-items: center; text-align: center; gap: .15rem; padding: .6rem .4rem; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); }
.fin-steps .dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--muted);
  font-weight: 700; font-size: .8rem; }
.fin-steps li.done .dot { background: var(--ok); color: #fff; }
.fin-steps li.now { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.fin-steps li.now .dot { background: var(--brand); color: var(--brand-ink); }
.fin-steps b { font-size: .88rem; }
.fin-steps small { font-size: .74rem; }
.fd-signs.four { justify-content: space-between; flex-wrap: wrap; }
.fd-signs.four > div { min-width: 10rem; flex: 1 1 10rem; }
.fin-danger > summary { cursor: pointer; font-weight: 600; color: var(--high); }
.fin-danger[open] > summary { margin-bottom: .7rem; }
.fd-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.fd-parties section { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; }
.fd-parties h3 { margin: 0 0 .35rem; font-size: .82rem; color: var(--muted); font-weight: 600; }
.fd-parties p { margin: .1rem 0; font-size: .9rem; }
.fin-fy input { min-height: 36px; font-size: .85rem; width: 14rem; max-width: 100%; }
@media (max-width: 720px) {
  .fin-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-parties { grid-template-columns: minmax(0, 1fr); }
  .fin-voucher-sum { grid-template-columns: minmax(0, 1fr); }
}
.fin-doc { min-width: 0; overflow-wrap: anywhere; }
.fd-table td, .fd-table th { overflow-wrap: anywhere; }
.fd-table .num { overflow-wrap: normal; }
.fd-table tfoot th, .fd-table tbody td, .fd-table thead th { white-space: normal; }
.fd-table td.nowrap { white-space: nowrap; overflow-wrap: normal; }

/* finance: payroll (บัญชีเงินเดือน) */
.fin-sub { margin: 1.1rem 0 .4rem; font-size: .95rem; }
.fin-payroll .fin-edit[open] form { min-width: 30rem; }
.fd-list { margin: 0; display: grid; gap: .3rem; font-size: .9rem; }
.fd-list div { display: flex; justify-content: space-between; gap: 1rem; }
.fd-list dt { color: var(--text-2); }
.fd-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.fd-list .total { border-top: 1px solid var(--border); padding-top: .35rem; font-weight: 700; }
@media (max-width: 720px) { .fin-payroll .fin-edit[open] form { min-width: 0; } }

/* finance: projects (ทะเบียนโครงการ) */
.fin-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: var(--gap); }
.fin-projects > .card { margin-top: 0; }
.fin-project { display: grid; gap: .45rem; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.fin-project:hover { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.fp-head { display: flex; align-items: center; gap: .5rem; font-size: .78rem; }
.fp-head .badge { margin-left: auto; }
.fp-name { font-size: 1rem; line-height: 1.45; }
.fp-bars { display: grid; gap: .35rem; margin-top: .2rem; }
.fp-bars > div { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: .5rem; }
.fp-bars small { font-size: .75rem; color: var(--muted); }
.fp-bar { display: block; height: .5rem; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.fp-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.fp-bar.time i { background: var(--t-violet); }
.fp-bar.over i { background: var(--high); }
.fp-bar.done i { background: var(--ok); }
.rule-list .fp-bar { margin-top: .35rem; max-width: 22rem; }
.fp-foot { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--text-2); border-top: 1px solid var(--border); padding-top: .5rem; }
.fp-foot span:last-child { margin-left: auto; }

/* finance: bank statements and reconciliation */
.fin-bank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.fin-bank-cards > .card { margin-top: 0; }
.fin-bank { display: grid; gap: .7rem; align-content: start; }
.fb-head { display: flex; gap: .7rem; align-items: center; }
.fb-head > div { display: grid; min-width: 0; }
.fb-head small { font-size: .78rem; }
.fb-figs { margin: 0; display: grid; gap: .3rem; font-size: .86rem; }
.fb-figs div { display: flex; justify-content: space-between; gap: .8rem; }
.fb-figs dt { color: var(--muted); }
.fb-figs dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.fb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.fin-stmt tr.fin-open > td { background: var(--warn-row); }
.fin-suggest { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .82rem; padding: .25rem 0; }
.fin-suggest > span { flex: 1 1 14rem; min-width: 0; }
.fin-inline-mini { display: inline; }
.fd-table tr.fd-sub td { font-size: .78rem; color: var(--muted); padding-top: .2rem; padding-bottom: .2rem; padding-left: 1.4rem; }
.fd-table tr.fd-total th, .fd-table tr.fd-total td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.fin-asof { display: flex; gap: .4rem; align-items: center; }
.fin-asof input { min-height: 36px; }

/* finance: reports and indicators */
.fin-report { max-width: 46rem; }
.fin-group > summary { cursor: pointer; }
.fin-group ul { margin: .4rem 0 .2rem 1rem; padding: 0; list-style: none; display: grid; gap: .2rem; font-size: .8rem; color: var(--muted); }
.fin-group li { display: flex; justify-content: space-between; gap: 1rem; }
.fin-risk { display: grid; grid-template-columns: 13rem 1fr; gap: 1.2rem; align-items: center; }
.fr-score { display: grid; justify-items: center; gap: .2rem; padding: 1.1rem; border-radius: 16px; text-align: center; color: var(--ok);
  background: var(--ok-soft); border: 1px solid var(--ok-line); }
.fr-score small { font-size: .78rem; color: var(--text-2); }
.fr-score b { font-size: 3.2rem; line-height: 1; }
.fr-score span { font-size: .82rem; font-weight: 600; color: var(--text); }
.fr-score.fr-l1, .fr-score.fr-l2 { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.fr-score.fr-l3, .fr-score.fr-l4 { color: var(--medium); background: var(--medium-soft); border-color: var(--medium-line); }
.fr-score.fr-l5, .fr-score.fr-l6, .fr-score.fr-l7 { color: var(--high); background: var(--high-soft); border-color: var(--high-line); }
.fr-body h2 { margin: 0 0 .3rem; font-size: 1.1rem; }
.fr-body p { margin: 0 0 .7rem; font-size: .84rem; }
.fin-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.fin-tests > .card { margin-top: 0; }
.fin-test { display: grid; gap: .35rem; border-top: 4px solid var(--ok); }
.fin-test.fail { border-top-color: var(--high); }
.ft-head { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); }
.ft-value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ft-value small { font-size: .85rem; font-weight: 600; color: var(--muted); }
@media (max-width: 720px) { .fin-risk { grid-template-columns: minmax(0, 1fr); } }
.fin-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.fin-forms > .card { margin-top: 0; display: flex; flex-direction: column; gap: .6rem; }
.fm-head { display: flex; gap: .7rem; align-items: flex-start; }
.fm-head h2 { margin: 0 0 .1rem; font-size: 1rem; }
.fm-head > div { min-width: 0; }
.fm-when { display: block; font-size: .8rem; line-height: 1.45; }
.fm-recent { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; font-size: .84rem; }
.fm-recent li { min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.fm-recent a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-recent .num { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-recent .badge { flex: none; }
.fm-acts { margin-top: auto; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; padding-top: .2rem; }
.fin-cert-lines input { width: 100%; min-width: 0; }
.fin-cert-lines th:nth-child(1) { width: 11rem; }
.fin-cert-lines th:nth-child(3) { width: 9rem; }
.fin-cert-lines th:nth-child(4) { width: 11rem; }
.fin-cert-lines th:nth-child(5) { width: 3rem; }
.fin-report-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.fin-report-links a { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px;
  color: inherit; text-decoration: none; }
.fin-report-links a:hover { border-color: var(--brand); background: var(--surface-2); }
.fin-report-links a > svg { flex: none; margin-top: .1rem; color: var(--brand); }
.fin-report-links span { display: grid; gap: .1rem; min-width: 0; }
.fin-report-links small { font-size: .78rem; }

/* finance: month-end close */
.fin-close-bar { width: 12rem; max-width: 40%; }
.fin-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.fin-checklist li { display: flex; align-items: center; gap: .8rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 12px; }
.fin-checklist li .grow { display: grid; min-width: 0; }
.fin-checklist li small { font-size: .78rem; }
.fin-checklist li.done { background: var(--ok-soft); border-color: var(--ok-line); }
.fin-checklist li.na { opacity: .6; }
.fc-dot { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--muted);
  font-weight: 700; font-size: .78rem; }
.fin-checklist li.done .fc-dot { background: var(--ok); color: #fff; }
.fin-close-ctl { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.fin-used tbody th, .fin-used tfoot th { white-space: normal; font-weight: 600; }
.fin-used .fu-split { display: none; font-weight: 400; font-size: .76rem; }
@media (max-width: 560px) {
  .table-wrap > table.fin-used { min-width: 0; }
  .fin-used .split { display: none; }
  .fin-used .fu-split { display: block; }
}

/* finance: dashboard (แดชบอร์ดการเงิน) */
.fin-risk-mini { display: flex; flex-direction: column; gap: .8rem; }
.frm-score { display: flex; align-items: baseline; gap: .7rem; padding: .8rem 1rem; border-radius: 14px; color: var(--ok);
  background: var(--ok-soft); border: 1px solid var(--ok-line); }
.frm-score b { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.frm-score span { font-weight: 600; font-size: .92rem; color: var(--text); }
.frm-score.fr-l1, .frm-score.fr-l2 { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.frm-score.fr-l3, .frm-score.fr-l4 { color: var(--medium); background: var(--medium-soft); border-color: var(--medium-line); }
.frm-score.fr-l5, .frm-score.fr-l6, .frm-score.fr-l7 { color: var(--high); background: var(--high-soft); border-color: var(--high-line); }
.frm-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .82rem; }
.frm-tests li { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.frm-tests .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.frm-tests b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.frm-tests .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.frm-tests li.fail .dot { background: var(--high); }
.frm-tests li.fail b { color: var(--high); }
.fin-issues .t { display: grid; gap: .1rem; }
.fin-issues .t small { font-size: .76rem; line-height: 1.4; }
.fin-issues .n { color: var(--muted) !important; }
.fin-fundlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.fin-fundlist a { display: flex; align-items: center; gap: .8rem; padding: .55rem .4rem; border-bottom: 1px solid var(--border); color: var(--text); }
.fin-fundlist li:last-child a { border-bottom: 0; }
.fin-fundlist a:hover { text-decoration: none; background: var(--surface-2); }
.fin-fundlist .grow { display: grid; min-width: 0; }
.fin-fundlist small { font-size: .76rem; }
.fin-fundlist .num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.fin-bars li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: .7rem; font-size: .84rem; }
.fin-bars .fb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.fin-bars .fb-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.fin-bars .fb-track i { display: block; height: 100%; border-radius: 999px; background: var(--t-green); }
.fin-bars.red .fb-track i { background: var(--t-red); }
.fin-bars .fb-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.fin-bars .fb-val small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
@media (max-width: 560px) {
  .fin-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .fin-bars .fb-track { grid-column: 1 / -1; grid-row: 2; }
}
.fin-pcode { display: inline-block; min-width: 2.6rem; font-family: var(--mono, ui-monospace, monospace); font-size: .78rem; color: var(--muted); }

/* finance: financial plan (แผนทางการเงิน Planfin) */
.plan-list { margin: .2rem 0 1rem 1.2rem; display: grid; gap: .25rem; font-size: .9rem; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.plan-steps li { display: flex; gap: .55rem; align-items: flex-start; padding: .6rem .65rem; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.plan-steps li.done { background: var(--ok-soft); border-color: var(--ok-line); }
.plan-steps li.now { background: var(--medium-soft); border-color: var(--medium-line); box-shadow: 0 0 0 2px var(--medium-line); }
.ps-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 700;
  background: var(--surface-3); color: var(--muted); }
.plan-steps li.done .ps-dot { background: var(--ok); color: #fff; }
.plan-steps li.now .ps-dot { background: var(--medium); color: #fff; }
.ps-text { display: grid; gap: .1rem; min-width: 0; }
.ps-text b { font-size: .82rem; line-height: 1.35; }
.ps-text small { font-size: .72rem; line-height: 1.35; }
.plan-step-acts { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .9rem; }
@media (max-width: 1100px) { .plan-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plan-steps { grid-template-columns: minmax(0, 1fr); } }
.dcoh-big { display: flex; align-items: baseline; gap: .6rem; padding: .7rem 1rem; border-radius: 14px; margin-bottom: .6rem; border: 1px solid; }
.dcoh-big b { font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.dcoh-big span { font-weight: 600; color: var(--text); }
.dcoh-big.high { color: var(--high); background: var(--high-soft); border-color: var(--high-line); }
.dcoh-big.medium { color: var(--medium); background: var(--medium-soft); border-color: var(--medium-line); }
.dcoh-big.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.plan-table { font-size: .82rem; }
.plan-table .mono, .plan-table th.mono { white-space: nowrap; }
.plan-table td.plan-name { min-width: 15rem; max-width: 24rem; }
.plan-table td.plan-name b { font-weight: 600; }
.plan-table td.plan-name small { display: block; font-size: .74rem; line-height: 1.4; margin-top: .15rem; }
.plan-why { color: var(--text-2); padding-left: .55rem; border-left: 2px solid var(--border-strong); }
.plan-why.missing { color: var(--high); border-left-color: var(--high); }
.plan-note-edit { margin-top: .2rem; }
.plan-note-edit > summary { font-size: .72rem; color: var(--brand); cursor: pointer; list-style: none; }
.plan-note-edit > summary::-webkit-details-marker { display: none; }
.plan-card .table-wrap > table { min-width: 60rem; }
.plan-table th, .plan-table td { vertical-align: top; }
.plan-table td.hist { color: var(--text-2); }
.plan-table tr.plan-sec th { background: var(--surface-2); font-weight: 700; text-align: left; }
.plan-table tr.plan-sum th, .plan-table tr.plan-sum td { font-weight: 700; border-top: 1px solid var(--border-strong); }
.plan-table td.plan-note { min-width: 14rem; font-size: .78rem; }
.plan-table td.plan-note .fin-edit { margin-top: .25rem; }
.plan-table tr.tone-watch td:first-child { box-shadow: inset 3px 0 0 var(--high); }
.plan-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
.plan-pct.watch { color: var(--high); }
.plan-pct.good { color: var(--ok); }
.plan-pct.ok { color: var(--text-2); }
.plan-hist th[scope="row"] { font-weight: 500; }
.plan-bands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.plan-bands .pband { display: grid; gap: .15rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid; }
.plan-bands .pband b { font-size: 1.05rem; }
.plan-bands .pband span { font-size: .82rem; color: var(--text); }
.plan-bands .pband small { font-size: .76rem; font-weight: 600; }
.plan-bands .pband.high { color: var(--high); background: var(--high-soft); border-color: var(--high-line); }
.plan-bands .pband.medium { color: var(--medium); background: var(--medium-soft); border-color: var(--medium-line); }
.plan-bands .pband.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
@media (max-width: 720px) { .plan-bands { grid-template-columns: minmax(0, 1fr); } }
.plan-now { margin: 0 0 .7rem; font-size: .9rem; }
.plan-priority { margin: 0 0 0 1.3rem; display: grid; gap: .35rem; font-size: .86rem; }
.plan-priority li small { display: block; font-size: .78rem; }
.plan-sheet td.mono { width: 3.2rem; color: var(--muted); }
.plan-sheet tr.plan-risk td { background: var(--surface-2); }
.plan-prefill { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.plan-edit input { width: 100%; min-width: 0; }
.plan-edit input[name^="why_"] { text-align: left; }
.plan-edit input[name^="amt_"] { text-align: right; font-variant-numeric: tabular-nums; }
.plan-edit td:nth-child(4) { min-width: 9rem; }
.plan-edit td:nth-child(6) { min-width: 14rem; }
.fin-add { margin-top: .8rem; }
.fin-add[open] form { margin-top: .6rem; }

/* finance: after-hours clinics (คลินิกพิเศษนอกเวลา) */
.clinic-item { display: grid; gap: .5rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.clinic-item:last-of-type { border-bottom: 0; }
.clinic-item > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.clinic-item > header small { flex-basis: 100%; font-size: .8rem; }
.clinic-item.off { opacity: .65; }
.clinic-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.clinic-acts .fin-edit[open] { flex-basis: 100%; }
.clinic-team { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; display: grid; gap: .45rem; margin: 0; min-width: 0; }
.clinic-team legend { padding: 0 .3rem; font-size: .86rem; font-weight: 600; }
.fin-grid3 .clinic-team label.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: .55rem; font-size: .9rem; }
.fin-grid3 .clinic-team label.check input { width: auto; flex: none; margin: 0; }
.clinic-team .check small { font-size: .76rem; }
.clinic-extra { display: grid; gap: .25rem; font-size: .84rem; max-width: 30rem; }


/* ---- งานจัดซื้อจัดจ้าง (procurement, deck page 28) ------------------------------------------------------- */
.callout.danger { border-color: var(--high-line); background: var(--high-soft); }
.callout.danger > .ico { color: var(--high); }
.proc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.proc-bars li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(4rem, 1fr) auto; align-items: center; gap: .75rem; font-size: .88rem; }
.proc-bars li .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-bars .num { font-variant-numeric: tabular-nums; text-align: right; min-width: 6.5rem; }
.proc-bar { display: block; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.proc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--t-violet), var(--brand)); }
.proc-top { margin-bottom: 1.15rem; }
.proc-filter { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.proc-filter .chips-nav { margin: 0; }
.proc-search { display: flex; flex-wrap: nowrap; gap: .5rem; align-items: center; flex: 1 1 30rem; justify-content: flex-end; }
.proc-search input[type=search] { flex: 1 1 14rem; min-width: 0; max-width: 22rem; }
.proc-search select { flex: 0 1 12rem; }
.proc-vlist { padding: .35rem 1.1rem; }
.proc-vrow { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.6fr); gap: .5rem 1.25rem; align-items: center;
  padding: .9rem 0; border-bottom: 1px solid var(--border); }
.proc-vrow:last-child { border-bottom: 0; }
.proc-vrow.off .pv-name { color: var(--muted); }
.pv-main { min-width: 0; }
.pv-name { font-weight: 600; font-size: 1rem; color: var(--text); }
.pv-name:hover { color: var(--brand); }
.pv-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.pv-tags .badge .ico { margin-right: .1rem; }
.pv-goods { display: block; margin-top: .3rem; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-id { display: grid; gap: .1rem; min-width: 0; font-size: .86rem; }
.pv-id small { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.pv-money div { display: grid; gap: .1rem; min-width: 0; }
.pv-money dt { font-size: .74rem; color: var(--muted); }
.pv-money dd { margin: 0; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-money .pv-owed { color: var(--medium); }
.proc-none { padding: 1rem 0; margin: 0; }
.proc-two { margin: 1.15rem 0; }
.proc-dl { display: grid; gap: .6rem; margin: 0; }
.proc-dl > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; font-size: .9rem; }
.proc-dl dt { color: var(--muted); font-size: .84rem; }
.proc-dl dd { margin: 0; overflow-wrap: anywhere; }
.proc-tick { align-self: center; padding-top: 1.1rem; }
.proc-hint { display: flex; gap: .45rem; align-items: flex-start; font-size: .84rem; margin: 0; }
.proc-hint .ico { flex: none; margin-top: .15rem; color: var(--brand); }
@media (max-width: 900px) {
  .proc-vrow { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .pv-money { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .5rem .65rem; border-radius: 12px; background: var(--surface-2); }
  .proc-search { justify-content: stretch; flex-wrap: wrap; }
  .proc-search input[type=search] { max-width: none; }
  .proc-dl > div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .proc-tick { padding-top: 0; }
}
@media (max-width: 520px) {
  .proc-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .proc-bars .proc-bar { grid-column: 1 / -1; order: 3; }
  .pv-money dd { font-size: .84rem; }
}
.callout.info { border-color: var(--info-line); background: var(--info-soft); }
.callout.info > .ico { color: var(--info); }
.proc-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.15rem; align-items: start; margin-bottom: 1.15rem; }
.proc-grid > * { margin: 0; }
.proc-clist { padding: .35rem 1.1rem; }
.proc-crow { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, .8fr) auto; gap: .5rem 1rem; align-items: center;
  padding: .85rem 0; border-bottom: 1px solid var(--border); color: inherit; }
.proc-crow:last-child { border-bottom: 0; }
.proc-crow:hover { text-decoration: none; }
.proc-crow:hover .pc-main b { color: var(--brand); }
.pc-kind { justify-self: start; white-space: normal; text-align: left; }
.pc-main .badge, .pc-state .badge { justify-self: start; }
.pc-state .badge { justify-self: end; }
.pc-main, .pc-people { display: grid; gap: .15rem; min-width: 0; }
.pc-main small, .pc-people small { font-size: .78rem; }
.pc-people { font-size: .88rem; }
.pc-state { display: grid; justify-items: end; gap: .25rem; }
.pc-state small { font-size: .76rem; }
.pc-wait { color: var(--medium); font-weight: 600; }
.proc-load .proc-bars li { grid-template-columns: minmax(0, 1.5fr) minmax(3rem, 1fr) auto; }
.proc-load .num small { font-weight: 400; }
.proc-rules { display: flex; gap: .55rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: .84rem; color: var(--text-2); }
.proc-rules .ico { flex: none; margin-top: .15rem; color: var(--brand); }
.proc-members select, .proc-members input { width: 100%; min-width: 9rem; }
.proc-members td:first-child { min-width: 16rem; }
.proc-mlist { list-style: none; margin: 0; padding: 0; display: grid; }
.proc-mlist li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; gap: .5rem .9rem; align-items: center; padding: .7rem 0;
  border-bottom: 1px solid var(--border); }
.proc-mlist li:last-child { border-bottom: 0; }
.pm-no { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-size: .82rem; }
.pm-role { font-size: .84rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.pm-decl form { margin: 0; }
.proc-duty { line-height: 1.7; margin: 0 0 .7rem; }
.proc-small { font-size: .84rem; }
.proc-small > div { grid-template-columns: 6rem minmax(0, 1fr); }
.proc-sign { margin-bottom: 1.15rem; }
.proc-wait { display: flex; gap: .4rem; align-items: center; margin: 0 0 1.15rem; }
.proc-mine { align-items: center; }
.proc-mine form { margin: 0; }
.proc-withdraw[open] { flex-basis: 100%; }
.proc-withdraw > summary { list-style: none; }
@media (max-width: 1100px) {
  .proc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .proc-crow { grid-template-columns: minmax(0, 1fr) auto; }
  .proc-crow .pc-kind { grid-column: 1 / -1; }
  .proc-crow .pc-people { grid-column: 1; }
  .proc-mlist li { grid-template-columns: 2rem minmax(0, 1fr); }
  .proc-mlist .pm-role, .proc-mlist .pm-decl { grid-column: 2; }
}
.plan-steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.proc-plan-acts { margin-top: .9rem; display: grid; gap: .6rem; }
.proc-plan-acts p { margin: 0; display: flex; gap: .4rem; align-items: center; }
.proc-act { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: center; }
.proc-act .grow { flex: 1 1 18rem; color: var(--text-2); font-size: .9rem; }
.proc-act form { margin: 0; }
.proc-return > summary { list-style: none; }
.proc-return[open] { flex-basis: 100%; }
.proc-return[open] > summary { margin-bottom: .5rem; }
.proc-plan-acts p.proc-pub { display: block; color: var(--ok); font-weight: 600; }
.proc-pub .ico { vertical-align: -3px; margin-right: .3rem; }
.proc-quarters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; align-items: end; }
.pq { display: grid; gap: .2rem; justify-items: center; text-align: center; font-size: .86rem; }
.pq small { font-size: .76rem; }
.pq-bar { width: 100%; max-width: 5rem; height: 9rem; display: flex; align-items: flex-end; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); overflow: hidden; }
.pq-bar i { display: flex; align-items: flex-end; width: 100%; background: var(--brand-soft); border-top: 2px solid var(--brand-line); }
.pq-bar i b { display: block; width: 100%; background: linear-gradient(180deg, var(--brand), var(--t-violet)); }
.proc-h3 { font-size: .9rem; margin: 1rem 0 .5rem; }
.proc-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.proc-chips li { padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; }
.proc-lines { display: grid; }
.proc-line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: .6rem 1.2rem; align-items: center;
  padding: .9rem 0; border-bottom: 1px solid var(--border); }
.proc-line:last-child { border-bottom: 0; }
.proc-line.cancelled { opacity: .6; }
.proc-line.cancelled .pl-main b { text-decoration: line-through; }
.proc-line.late { background: linear-gradient(90deg, var(--bad-row), transparent 60%); }
.pl-main { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; }
.pl-main > div { min-width: 0; }
.pl-main small { display: block; margin-top: .3rem; font-size: .8rem; }
.pl-seq { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3);
  font-weight: 700; font-size: .82rem; color: var(--text-2); }
.pl-state { display: grid; gap: .3rem; justify-items: start; min-width: 0; }
.pl-money dd { white-space: normal; overflow-wrap: anywhere; }
.pl-state small { font-size: .76rem; }
.pl-state .fp-bar { width: 100%; }
.pl-acts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.proc-line-edit { grid-column: 1 / -1; padding: .9rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.proc-add { margin-top: 1rem; }
.proc-add > summary { list-style: none; display: inline-flex; }
.proc-add[open] > summary { margin-bottom: .8rem; }
.proc-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.proc-history li { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; padding-left: .9rem; border-left: 3px solid var(--brand-line); }
.proc-history small { font-size: .78rem; }
.ph-note { flex-basis: 100%; font-size: .86rem; color: var(--text-2); }
.proc-start { display: grid; gap: .55rem; justify-items: center; }
.proc-start .fin-check-label { font-size: .9rem; }
.proc-pr-plan { margin-top: .35rem; }
.proc-pr-plan select { max-width: 100%; }
@media (max-width: 900px) {
  .plan-steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proc-line { grid-template-columns: minmax(0, 1fr); }
  .pl-money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proc-quarters { gap: .5rem; }
  .pq-bar { height: 7rem; }
}
.proc-jlist { padding: .35rem 1.1rem; }
.proc-jrow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head head" "title money next";
  gap: .35rem 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); color: inherit; align-items: center; }
.proc-jrow:last-child { border-bottom: 0; }
.proc-jrow:hover { text-decoration: none; }
.proc-jrow:hover .pj-title b { color: var(--brand); }
.pj-head { grid-area: head; display: flex; flex-wrap: wrap; gap: .3rem; }
.pj-title { grid-area: title; display: grid; gap: .15rem; min-width: 0; }
.pj-title small { font-size: .78rem; }
.pj-money { grid-area: money; display: grid; gap: .05rem; justify-items: end; text-align: right; }
.pj-money small { font-size: .76rem; }
.pj-next { grid-area: next; display: grid; justify-items: end; text-align: right; }
.pj-next small { font-size: .76rem; }
.proc-note { display: flex; gap: .4rem; align-items: flex-start; font-size: .84rem; margin: 1rem 0 0; color: var(--text-2); }
.proc-note .ico { flex: none; margin-top: .15rem; color: var(--brand); }
.proc-side { display: grid; gap: 1.15rem; align-content: start; }
.proc-side > .card { margin: 0; }
.proc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.proc-steps > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .8rem; padding: .2rem 0 1rem; position: relative; }
.proc-steps > li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.proc-steps > li:last-child::before { display: none; }
.proc-steps > li.done::before { background: var(--ok-line); }
.proc-steps .ps-dot { width: 28px; height: 28px; }
.proc-steps li.done .ps-dot { background: var(--ok); color: #fff; }
.proc-steps li.now .ps-dot { background: var(--medium); color: #fff; box-shadow: 0 0 0 4px var(--medium-soft); }
.pst { display: grid; gap: .35rem; min-width: 0; padding-top: .2rem; }
.pst > b { font-size: .92rem; }
.pst > small { font-size: .8rem; }
.pst .badge { justify-self: start; }
.pst form { margin: .2rem 0 0; }
.proc-bids { margin: .2rem 0; }
.proc-award { padding: .7rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.proc-appoint { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
@media (max-width: 760px) {
  .proc-jrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head head" "title title" "money next"; }
  .pj-money { justify-items: start; text-align: left; }
}

/* ---- the hospital's logo (โลโก้โรงพยาบาลเขาฉกรรจ์): shown on white, as the hospital uses it ---------------------- */
.brand-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 13px; background: #fff;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(14, 27, 50, .06); }
.brand-mark img { width: 36px; height: auto; display: block; }
.login-logo { display: inline-flex; padding: .85rem 1.25rem; border-radius: 20px; background: #fff;
  box-shadow: 0 22px 48px -22px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .5); }
.login-logo img { width: min(250px, 62vw); height: auto; display: block; }
.login-logo + .login-brand { margin-top: 1.3rem; }
.hero-icon.hero-brand { background: #fff; border: 1px solid var(--border); box-shadow: 0 14px 30px -16px rgba(14, 27, 50, .45); }
.hero-icon.hero-brand img { width: 42px; height: auto; display: block; }
.login-top-logo { display: none; }
@media (max-width: 960px) {
  .login-top-logo { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: .9rem 1rem; border-radius: 20px; background: #fff;
    box-shadow: var(--shadow); border: 1px solid var(--border); }
  .login-top-logo img { width: min(220px, 64vw); height: auto; display: block; }
  .login-top-logo span { font-size: .8rem; font-weight: 600; color: #2f3e58; letter-spacing: .02em; }
}


/* ---- TOR และราคากลาง (S5) ------------------------------------------------------------------------------------ */
.proc-ref { display: flex; flex-wrap: wrap; gap: .8rem 2rem; padding: .85rem 1rem; margin-bottom: .9rem; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); }
.proc-ref > div { display: grid; gap: .1rem; min-width: 0; }
.proc-ref b { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.proc-ref small { font-size: .78rem; }
.proc-chosen td { background: var(--ok-soft); }
.proc-inline { display: inline-flex; margin: 0 0 0 .3rem; vertical-align: middle; }
.proc-last { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .9rem; }
.proc-last > span { flex: 1 1 16rem; }
.proc-tor { padding: .9rem 0 1rem; border-bottom: 1px solid var(--border); display: grid; gap: .6rem; }
.proc-tor:last-of-type { border-bottom: 0; }
.proc-tor > header { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.proc-tor > header small { flex-basis: 100%; font-size: .8rem; }
.proc-tor.replaced > header b { color: var(--muted); text-decoration: line-through; }
.proc-tor-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.65; padding: .8rem 1rem; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); max-height: 22rem; overflow: auto; }
.proc-tor > .btn { justify-self: start; }
.proc-warn { display: flex; gap: .4rem; align-items: center; margin: 0; font-size: .86rem; color: var(--medium); }
.proc-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.proc-comments li { padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: .3rem; }
.proc-comments li > b { margin-right: .3rem; }
.proc-comments p { margin: 0; font-size: .88rem; overflow-wrap: anywhere; }
.proc-comments .badge { justify-self: start; }

/* ==== หน้าเจ้าหน้าที่ (staff.kckapp.com): phone first, a tab bar at the bottom, the same tokens ==================== */
body.st { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
.st-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; min-height: 60px;
  padding: .45rem max(16px, env(safe-area-inset-right, 0px)) .45rem max(16px, env(safe-area-inset-left, 0px));
  background: var(--topbar-bg); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border); }
.st-brand { display: flex; align-items: center; gap: .65rem; color: var(--text); flex: none; }
.st-brand:hover { text-decoration: none; }
.st-brand b { display: block; font-size: 1rem; line-height: 1.2; }
.st-brand small { display: block; font-size: .74rem; color: var(--muted); }
.st-nav { display: none; gap: .15rem; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; min-width: 0; }
.st-nav a { padding: .42rem .7rem; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: .88rem; white-space: nowrap; }
.st-nav a:hover { background: var(--surface-2); text-decoration: none; }
.st-nav a.active { background: var(--brand-soft); color: var(--brand); }
.st-top-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex: none; }
.st-top .user-chip .who { display: none; }
.st-top .pop-panel { right: 0; }
.st-demo { margin: .6rem 16px 0; padding: .35rem .8rem; font-size: .78rem; color: var(--muted); border: 1px dashed var(--demo-line); border-radius: 10px; }
.st-main { max-width: 1040px; margin: 0 auto; padding: 1rem 16px 2rem; }
.st-main > .card { margin: 0 0 1.05rem; }
.st-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -10px 26px -18px rgba(14, 27, 50, .35); }
.st-tabs a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 58px; padding: .35rem .15rem; font-size: .7rem;
  color: var(--muted); text-align: center; line-height: 1.25; }
.st-tabs a:hover { text-decoration: none; color: var(--text); }
.st-tabs a.active { color: var(--brand); font-weight: 600; }
@media (min-width: 900px) {
  body.st { padding-bottom: 0; }
  .st-tabs { display: none; }
  .st-nav { display: flex; }
  .st-top .user-chip .who { display: block; }
}
.st-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; padding: 1.3rem 1.4rem; margin-bottom: 1.1rem;
  border-radius: var(--radius-lg); background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-lg); }
.st-hero h1 { font-size: 1.4rem; margin: .15rem 0 .3rem; line-height: 1.3; text-wrap: balance; }
.st-hero small, .st-hero p, .st-hero .muted { color: rgba(255, 255, 255, .9); }
.st-hero p { margin: 0; }
.st-today { display: grid; gap: .2rem; align-content: start; padding: .9rem 1rem; border-radius: 16px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26); }
.st-today b { font-size: 1.65rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.st-today small { font-size: .8rem; }
.st-today-label { display: inline-flex; gap: .35rem; align-items: center; font-size: .84rem; }
.st-hero-btn { margin-top: .55rem; justify-self: start; background: #fff; color: #1d4ed8; border-color: transparent; }
.st-hero-btn:hover { background: #f1f5ff; color: #1e40af; }
@media (max-width: 700px) {
  .st-hero { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; }
  .st-hero h1 { font-size: 1.22rem; }
}
.st-h2 { font-size: 1rem; margin: 1.2rem 0 .7rem; }
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.st-tile { display: grid; gap: .25rem; align-content: start; min-height: 128px; padding: 1rem; border-radius: var(--radius); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.st-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.st-tile b { font-size: 1rem; }
.st-tile small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.st-tile-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: .35rem; }
@media (max-width: 700px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } .st-tile { min-height: 116px; padding: .85rem; } }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; }
.st-list li > a, .st-list li > div { display: flex; align-items: center; gap: .75rem; padding: .7rem .1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.st-list li:last-child > a, .st-list li:last-child > div { border-bottom: 0; }
.st-list li > a:hover { text-decoration: none; background: var(--surface-2); }
.st-list .grow { flex: 1 1 auto; min-width: 0; }
.st-list b { display: block; font-size: .93rem; font-weight: 600; overflow-wrap: anywhere; }
.st-list small { display: block; font-size: .8rem; }
.st-li-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.st-empty { display: flex; gap: .5rem; align-items: center; color: var(--muted); margin: .3rem 0; }
.st-foot { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; align-items: center; margin: 1.4rem 0 .4rem; font-size: .85rem; color: var(--muted); }
.st-head { margin: .2rem 0 1rem; }
.st-head h1 { font-size: 1.35rem; margin: 0 0 .2rem; text-wrap: balance; }
.st-head p { margin: 0; }
.st-narrow { max-width: 540px; }
.st-hint { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--muted); font-size: .85rem; }
.st-wide { width: 100%; min-height: 46px; justify-content: center; }

/* ==== หน้าผู้รับบริการ (kckapp.com): calm, large type, the blue and green of the hospital logo ===================== */
body.pub { background: var(--surface); background-image: none; }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
.pub-top { position: sticky; top: 0; z-index: 30; background: var(--topbar-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); }
.pub-bar { display: flex; align-items: center; gap: 1.1rem; min-height: 70px; }
.pub-logo { display: inline-flex; padding: .3rem .55rem; border-radius: 12px; background: #fff; flex: none; }
.pub-logo img { height: 44px; width: auto; display: block; }
.pub-nav { display: flex; gap: .15rem; flex: 1 1 auto; min-width: 0; }
.pub-nav a { padding: .45rem .7rem; border-radius: 10px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.pub-nav a:hover, .pub-nav a.active { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.pub-staff { margin-left: auto; display: inline-flex; gap: .3rem; align-items: center; flex: none; padding: .38rem .75rem; border-radius: 999px;
  font-size: .85rem; color: var(--muted); border: 1px solid var(--border); }
@media (max-width: 900px) {
  .pub-bar { flex-wrap: wrap; gap: .3rem .8rem; padding-block: .5rem; }
  .pub-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
  .pub-logo img { height: 38px; }
}
.pub-demo { padding: .35rem 16px; text-align: center; font-size: .8rem; color: var(--demo); background: var(--demo-soft); }
.pub-hero { padding: 3rem 0 2.6rem; border-bottom: 1px solid var(--border);
  background: radial-gradient(900px 380px at 90% 0%, var(--t-green-bg), transparent 65%), linear-gradient(170deg, var(--brand-soft), transparent 70%); }
.pub-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.pub-kicker { margin: 0 0 .5rem; color: var(--t-green); font-weight: 600; }
.pub-hero h1 { margin: 0 0 .8rem; font-size: clamp(1.7rem, 3.6vw, 2.55rem); line-height: 1.25; text-wrap: balance; }
.pub-lead { max-width: 60ch; margin: 0 0 1.4rem; font-size: 1.07rem; color: var(--text-2); }
.pub-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.pub-btn { min-height: 48px; padding-inline: 1.15rem; font-size: 1rem; }
.pub-hero-card { padding: 1.3rem 1.4rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.pub-hero-card h2 { display: flex; gap: .5rem; align-items: center; margin: 0 0 .8rem; font-size: 1.1rem; }
.pub-hours { display: grid; gap: .55rem; margin: 0; }
.pub-hours div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; padding-bottom: .55rem; border-bottom: 1px dashed var(--border); }
.pub-hours dt { font-weight: 600; }
.pub-hours dd { margin: 0; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pub-emergency { display: flex; gap: .45rem; align-items: center; margin: 1rem 0 0; padding: .6rem .8rem; border-radius: 12px;
  background: var(--high-soft); color: var(--high); font-size: .92rem; }
@media (max-width: 860px) { .pub-hero { padding: 1.8rem 0; } .pub-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 1.3rem; } }
.pub-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1rem; padding-block: 2rem; }
.pub-block { display: grid; gap: .45rem; align-content: start; padding: 1.3rem; border-radius: var(--radius-lg); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.pub-block:hover { border-color: var(--brand-line); transform: translateY(-2px); text-decoration: none; }
.pub-block b { font-size: 1.1rem; }
.pub-block > span:not(.pub-block-icon):not(.pub-more) { color: var(--text-2); font-size: .93rem; }
.pub-block-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; }
.pub-more { display: inline-flex; gap: .2rem; align-items: center; margin-top: .3rem; color: var(--brand); font-weight: 600; }
.pub-contact { padding-block: 1rem 2.5rem; }
.pub-contact h2 { font-size: 1.35rem; }
.pub-contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pub-card { display: flex; gap: .8rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.pub-card > .ico { flex: none; margin-top: .2rem; color: var(--brand); }
.pub-card > div { min-width: 0; }
.pub-card p { margin: .2rem 0 0; overflow-wrap: anywhere; }
@media (max-width: 860px) { .pub-contact-grid { grid-template-columns: minmax(0, 1fr); } }
.pub-foot { margin-top: 2rem; padding: 2.2rem 0 1rem; background: #0a1835; color: #c3cfea; }
.pub-foot a, .pub-foot b { color: #fff; }
.pub-foot ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.pub-foot p { display: flex; gap: .4rem; align-items: center; margin: .35rem 0; }
.pub-foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.pub-copy { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; color: #8ea0c6; }
@media (max-width: 760px) { .pub-foot-grid { grid-template-columns: minmax(0, 1fr); } }
.pub-doc { max-width: 880px; padding-block: 2rem 3rem; }
.pub-doc h1 { font-size: 1.7rem; line-height: 1.3; text-wrap: balance; }
.pub-doc h2 { margin-top: 1.8rem; font-size: 1.15rem; }
.pub-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pub-table th, .pub-table td { padding: .6rem .5rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.pub-table th { background: var(--surface-2); font-weight: 600; }
/* บัญชีผู้ใช้: the one-time password shown once */
.acct-temp { border-color: var(--ok-line); }
.acct-pw { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; margin: 0 0 .5rem; font-size: 1.05rem; }
.acct-pw b { padding: .2rem .55rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); letter-spacing: .04em; }

/* ---- ลาหยุด (staff page) and the leave desk ------------------------------------------------------------------- */
.st-back { display: inline-flex; gap: .2rem; align-items: center; margin-bottom: .4rem; font-size: .88rem; }
.lv-bal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.lv-card { display: grid; gap: .25rem; align-content: start; padding: .95rem 1rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.lv-card b { font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lv-card b small { font-size: .82rem; font-weight: 500; color: var(--muted); }
.lv-card > small { font-size: .78rem; line-height: 1.45; }
.lv-label { display: inline-flex; gap: .35rem; align-items: center; font-size: .84rem; color: var(--text-2); font-weight: 600; }
.lv-main { background: linear-gradient(150deg, var(--t-green-bg), var(--surface) 70%); border-color: var(--ok-line); }
.lv-main b { color: var(--ok); }
.lv-meter { display: block; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: .15rem 0; }
.lv-meter i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.lv-meter.near i { background: var(--medium); }
.lv-meter.over i { background: var(--high); }
.lv-note { display: flex; gap: .4rem; align-items: center; font-size: .84rem; color: var(--muted); margin: 0 0 1rem; }
@media (max-width: 900px) { .lv-bal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } .lv-card b { font-size: 1.45rem; } }
.lv-form { display: grid; gap: .85rem; }
.lv-form label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 500; }
.lv-form input, .lv-form select, .lv-form textarea { width: 100%; }
.lv-kinds { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.lv-kinds legend { font-size: .9rem; font-weight: 600; margin-bottom: .45rem; }
.lv-kind { position: relative; display: block !important; }
.lv-kind input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lv-kind > span { display: grid; gap: .2rem; height: 100%; padding: .7rem .8rem; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); font-weight: 400; transition: border-color .12s ease, background .12s ease; }
.lv-kind > span .ico { color: var(--brand); }
.lv-kind b { font-size: .92rem; }
.lv-kind small { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.lv-kind input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.lv-kind input:focus-visible + span { box-shadow: var(--focus); }
@media (max-width: 700px) { .lv-kinds { grid-template-columns: minmax(0, 1fr); } }
.lv-dates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 600px) { .lv-dates { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .lv-dates > label:last-child { grid-column: 1 / -1; } }
.lv-check { display: flex !important; gap: .5rem; align-items: flex-start; font-weight: 400 !important; }
.lv-check input { width: auto !important; margin-top: .3rem; }
.lv-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.lv-detail > .card { margin: 0; }
@media (max-width: 860px) { .lv-detail { grid-template-columns: minmax(0, 1fr); } }
.lv-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: 1rem; }
.lv-acts form { margin: 0; }
.lv-h2 { font-size: 1rem; margin: 0 0 .8rem; }
.lv-decide { margin-top: 1rem; }
.lv-decide-form { display: grid; gap: .8rem; margin-top: .9rem; }
.lv-decide-form label { display: grid; gap: .3rem; font-size: .9rem; }
.lv-choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.lv-choice legend { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; width: 100%; }
.lv-choice label { display: inline-flex !important; gap: .4rem; align-items: center; font-size: .95rem; }
.lv-stats td, .lv-stats th { white-space: nowrap; }
.lv-carry { display: inline-flex; gap: .3rem; align-items: center; justify-content: flex-end; margin: 0; }
.lv-carry input { width: 4.2rem; text-align: right; }
.lv-carry input.lv-unset { border-style: dashed; color: var(--muted); }
.lv-policies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.lv-policies > .card { margin: 0; display: grid; gap: .6rem; }
.lv-policies label { display: grid; gap: .25rem; font-size: .86rem; }

/* ---- แจ้งซ่อม (staff page) and the maintenance queue ----------------------------------------------------------- */
.rp-teams { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rp-teams .lv-kind > span { align-content: center; justify-items: center; text-align: center; min-height: 84px; }
.rp-teams .lv-kind b { font-size: .84rem; font-weight: 600; }
@media (max-width: 700px) { .rp-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.rp-badges:empty { display: none; }
.rp-due { display: flex; gap: .5rem; align-items: center; padding: .65rem .9rem; margin-bottom: 1rem; border-radius: 12px; font-size: .9rem;
  background: var(--info-soft); color: var(--info); border: 1px solid var(--info-line); }
.rp-due.late { background: var(--high-soft); color: var(--high); border-color: var(--high-line); }
.rp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: .7rem; margin-top: 1rem; }
.rp-photos figure { margin: 0; }
.rp-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); display: block; }
.rp-photos figcaption { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.rp-stars { color: #f5a524; letter-spacing: .08em; }
.rp-stars span { color: var(--border-strong); }
.rp-rate { border: 0; margin: 0; padding: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.rp-rate legend { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; float: left; width: 100%; }
.rp-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rp-rate label { font-size: 2.1rem; line-height: 1; cursor: pointer; color: var(--border-strong); padding: 0 .1rem; }
.rp-rate input:checked ~ label, .rp-rate label:hover, .rp-rate label:hover ~ label { color: #f5a524; }
.rp-rate input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 6px; }
.rp-steps { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.rp-steps form { margin: 0; }
.rp-finish { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
tr.warn-row td { background: var(--warn-row); }

/* ---- ขอเอกสาร (staff page) ------------------------------------------------------------------------------------- */
.st-quick { display: flex; gap: .75rem; align-items: center; padding: .85rem 1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.st-quick:hover { text-decoration: none; border-color: var(--brand-line); }
.st-quick > .ico:first-child { color: var(--brand); flex: none; }
.st-quick span { flex: 1 1 auto; min-width: 0; }
.st-quick b { display: block; }
.st-quick small { display: block; color: var(--muted); font-size: .8rem; }
.dr-track { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem;
  font-size: .78rem; color: var(--muted); text-align: center; }
.dr-track li { display: grid; gap: .35rem; justify-items: center; }
.dr-track li span { width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); }
.dr-track li.done span { background: var(--ok); }
.dr-track li.now span { background: var(--brand); }
.dr-track li.done, .dr-track li.now { color: var(--text-2); font-weight: 600; }
.dr-ready { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }

/* ---- ลงเวลาทำงาน (staff page) ---------------------------------------------------------------------------------- */
.ck-card { display: grid; gap: 1rem; }
.ck-now { display: grid; gap: .2rem; }
.ck-label { display: inline-flex; gap: .35rem; align-items: center; font-size: .86rem; color: var(--text-2); font-weight: 600; }
.ck-now b { font-size: 2.2rem; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ck-now small { color: var(--muted); font-size: .82rem; }
.ck-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.ck-buttons form { margin: 0; }
.ck-btn { width: 100%; min-height: 64px; font-size: 1.1rem; justify-content: center; border-radius: 16px; }
.ck-note { display: flex; gap: .4rem; align-items: flex-start; margin: 0; font-size: .82rem; }
.ck-note .ico { flex: none; margin-top: .15rem; }
.ck-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.ck-sum > div { display: grid; gap: .1rem; padding: .6rem .7rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.ck-sum b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.ck-sum small { font-size: .74rem; color: var(--muted); }
.ck-sum .warn b { color: var(--high); }
.ck-days li > div { align-items: center; }
.ck-day { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; align-content: center; line-height: 1.05;
  font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--text-2); }
.ck-day small { font-size: .66rem; font-weight: 500; }
.ck-day.present { background: var(--ok-soft); color: var(--ok); }
.ck-day.leave, .ck-day.duty { background: var(--info-soft); color: var(--info); }
.ck-day.absent { background: var(--high-soft); color: var(--high); }
.ck-day.weekend, .ck-day.holiday { background: var(--surface-2); color: var(--faint); }

/* ---- หลักฐานการทำงาน and ตัวชี้วัด ------------------------------------------------------------------------------ */
.ev-round { display: flex; gap: .45rem; align-items: center; padding: .6rem .9rem; margin-bottom: 1rem; border-radius: 12px; font-size: .9rem;
  background: var(--t-cyan-bg); color: var(--t-cyan); }
.ev-round b { font-size: 1.05rem; }
.ev-detail { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .8rem; }
.kp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: .85rem; margin-bottom: 1.1rem; }
.kp-card { position: relative; display: grid; gap: .3rem; align-content: start; padding: 1rem 1.05rem; border-radius: var(--radius); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-left: 5px solid var(--border-strong); min-width: 0; }
.kp-card:hover { text-decoration: none; border-color: var(--brand-line); }
.kp-card.met { border-left-color: var(--ok); }
.kp-card.near { border-left-color: var(--medium); }
.kp-card.miss { border-left-color: var(--high); }
.kp-top { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.kp-top b { flex: 1 1 12rem; font-size: .95rem; line-height: 1.4; }
.kp-val { font-size: 1.8rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kp-val small { font-size: .82rem; font-weight: 500; color: var(--muted); }
.kp-sub { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.kp-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: .2rem; }
.kp-spark i { flex: 1 1 0; min-width: 3px; max-width: 14px; border-radius: 3px 3px 0 0; background: var(--brand-line); }
.kp-spark i:last-child { background: var(--brand); }
.kp-spark.sm { height: 22px; width: 110px; }
.kp-due { display: inline-flex; gap: .3rem; align-items: center; justify-self: start; margin-top: .2rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600; background: var(--medium-soft); color: var(--medium); }

/* ---- หน้าผู้รับบริการ: forms, news, booking and donations --------------------------------------------------------- */
.pub-wide { max-width: 1120px; }
.pub-pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.pub-list { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .45rem; }
.pub-list li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pub-list .ico { color: var(--brand); flex: none; }
.pub-form { display: grid; gap: .9rem; max-width: 640px; margin-top: 1.2rem; }
.pub-form label { display: grid; gap: .35rem; font-weight: 500; }
.pub-form input, .pub-form select, .pub-form textarea { width: 100%; font-size: 1rem; min-height: 46px; }
.pub-check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; }
.pub-check input { width: 22px !important; min-height: 22px !important; height: 22px; margin-top: .15rem; flex: none; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pub-hero-img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius-lg); margin: 1rem 0; }
.pub-posts { display: grid; gap: 1rem; margin-top: 1rem; }
.pub-post { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1rem; padding: .9rem; border-radius: var(--radius); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.pub-post:hover { text-decoration: none; border-color: var(--brand-line); }
.pub-post img { width: 160px; height: 110px; object-fit: cover; border-radius: 12px; }
.pub-post-icon { width: 160px; height: 110px; border-radius: 12px; display: grid; place-items: center; background: var(--t-amber-bg); color: var(--t-amber); }
.pub-post-body { display: grid; gap: .25rem; align-content: start; min-width: 0; }
.pub-post-body small { color: var(--muted); font-size: .8rem; }
.pub-post-body b { font-size: 1.08rem; line-height: 1.4; }
.pub-post-body span { color: var(--text-2); font-size: .92rem; }
@media (max-width: 600px) { .pub-post { grid-template-columns: minmax(0, 1fr); } .pub-post img, .pub-post-icon { width: 100%; height: 160px; } }
.bk-day { display: flex; gap: .5rem; align-items: baseline; margin: 1.6rem 0 .7rem; font-size: 1.15rem; }
.bk-day small { color: var(--muted); font-weight: 500; font-size: .9rem; }
.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .8rem; }
.bk-slot { display: grid; gap: .3rem; padding: 1rem 1.1rem; border-radius: var(--radius); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); box-shadow: var(--shadow); }
a.bk-slot:hover { text-decoration: none; border-color: var(--brand); background: var(--brand-soft); }
.bk-slot.full { opacity: .55; }
.bk-slot small { color: var(--muted); font-size: .8rem; }
.bk-time { display: inline-flex; gap: .35rem; align-items: center; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-left { font-size: .85rem; font-weight: 600; color: var(--ok); }
.bk-left.low { color: var(--medium); }
.bk-chosen { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .8rem 1rem; border-radius: 14px; background: var(--brand-soft);
  color: var(--brand-strong); margin: .5rem 0 .3rem; }
.bk-ticket { display: grid; gap: .6rem; justify-items: center; text-align: center; padding: 2rem 1.4rem; margin: 1rem 0 1.5rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.bk-ticket h1, .bk-ticket h2 { margin: 0; }
.bk-ticket p { margin: 0; }
.bk-ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.bk-numbers { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: center; margin: .6rem 0; }
.bk-numbers > div { display: grid; gap: .1rem; }
.bk-numbers small { color: var(--muted); }
.bk-numbers b { font-size: 2.4rem; line-height: 1.1; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.dn-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; margin: 1rem 0 1.5rem; }
@media (max-width: 860px) { .dn-grid { grid-template-columns: minmax(0, 1fr); } }
.dn-account, .dn-thanks { padding: 1.2rem 1.3rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dn-account h2, .dn-thanks h2 { display: flex; gap: .5rem; align-items: center; margin: 0 0 .8rem; font-size: 1.15rem; }
.dn-acc { display: grid; gap: .1rem; padding: .75rem .9rem; margin-bottom: .6rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.dn-acc b { font-size: 1.45rem; letter-spacing: .04em; }
.dn-acc small { color: var(--muted); }
.dn-demo { color: var(--high) !important; font-weight: 600; }
.dn-qr { margin: .8rem 0; text-align: center; }
.dn-qr img { width: min(260px, 80%); border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: .4rem; }
.dn-qr figcaption { font-size: .82rem; color: var(--muted); }
.dn-safe { display: flex; gap: .4rem; align-items: flex-start; font-size: .84rem; color: var(--text-2); margin: .8rem 0 0; }
.dn-names { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; max-height: 320px; overflow: auto; }
.dn-names li { display: flex; justify-content: space-between; gap: .6rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.dn-names small { color: var(--muted); }
.dn-form { max-width: 760px; }
.dn-two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 600px) { .dn-two { grid-template-columns: minmax(0, 1fr); } }
/* An element the page hides (data-show-for and the like) stays hidden whatever display its class gives it. */
[hidden] { display: none !important; }

/* Sign-in made easy for everyone (7 Oct 2026): one-tap Google button, show-password eye, keyboard-language hints */
.login-google { display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; min-height: 50px; margin-top: 1rem;
  padding: .6rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 1.02rem; text-decoration: none; box-shadow: var(--shadow-sm); }
.login-google:hover { background: var(--surface-2); border-color: var(--brand); text-decoration: none; }
.login-google:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.login-google .g-logo { flex: none; }
.login-or { display: flex; align-items: center; gap: .7rem; margin: 1.1rem 0 0; color: var(--muted); font-size: .85rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-help { font-size: .85rem; margin: .9rem 0 0; }
.pw-field { position: relative; }
.pw-field input { width: 100%; padding-right: 3rem; }
.pw-reveal { position: absolute; top: 50%; right: .3rem; transform: translateY(-50%); display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; }
.pw-reveal:hover, .pw-reveal[aria-pressed="true"] { color: var(--brand); }
.pw-reveal:focus-visible { outline: 2px solid var(--brand); }
.kbd-hint { margin: .4rem 0 0; padding: .45rem .65rem; border-radius: var(--radius); background: var(--medium-soft); color: var(--medium); border: 1px solid var(--medium-line);
  font-size: .85rem; line-height: 1.45; }
.st-google { margin-top: 1rem; }
.st-google-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.st-google-head h2 { margin: 0; font-size: 1.1rem; }

/* Contracts (S6): one segment per installment in the list, the fine line under an installment */
.ct-bar { display: flex; gap: 3px; margin-top: .35rem; max-width: 16rem; }
.ct-bar i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.ct-bar i.accepted { background: var(--ok); }
.ct-bar i.delivered { background: var(--medium); }
.ct-bar i.late, .ct-bar i.rejected { background: var(--high); }
.ct-fine { display: block; margin-top: .25rem; color: var(--high); font-size: .85rem; }
.ct-fine b { font-variant-numeric: tabular-nums; }

/* ---- ติดตามการมาสาย 5 ขั้น (/time/late) ---- */
.late-flow { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; counter-reset: none; }
.late-flow a { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; align-items: center;
  padding: .75rem .9rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); min-height: 100%; }
.late-flow a:hover { border-color: var(--brand-line); text-decoration: none; }
.late-flow li:not(:last-child) a::after { content: ""; position: absolute; right: -.45rem; top: 50%; width: .5rem; height: 2px; background: var(--border-strong); }
.late-flow .lf-no { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--brand-soft); color: var(--brand); }
.late-flow .lf-label { font-size: .86rem; color: var(--text-2); line-height: 1.25; }
.late-flow .lf-n { font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.late-flow li.on a { border-color: var(--brand); background: var(--brand-soft); }
.late-flow li.on .lf-no { background: var(--brand); color: #fff; }
.late-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: .35rem; }
.late-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); }
.late-dots i.done { background: var(--ok); border-color: var(--ok); }
.late-dots i.now { background: var(--brand); border-color: var(--brand); }
.late-stepper li > div { display: grid; line-height: 1.2; }
.late-stepper li > div small { font-size: .76rem; font-weight: 400; }
.late-stepper li.skip { opacity: .45; }
.late-check { margin: .2rem 0 .9rem 1.1rem; padding: 0; display: grid; gap: .25rem; color: var(--text-2); }
.late-alt { margin-top: .9rem; }
.late-alt summary { cursor: pointer; color: var(--text-2); font-size: .9rem; }
.late-alt form { margin-top: .6rem; }
.late-measures { border: 0; padding: 0; margin: 0 0 .9rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .9rem; }
.late-measures legend { font-weight: 600; margin-bottom: .35rem; padding: 0; }
.late-measures label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; margin: 0; padding: .45rem .6rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.late-measures label.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.late-measures input { margin-top: .2rem; }
.late-meter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.late-meter > div { display: grid; gap: .1rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.late-meter b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.late-meter.good > div:last-child { border-color: var(--ok-line); background: var(--ok-soft); }
.late-meter.bad > div:last-child { border-color: var(--high-line); background: var(--high-soft); }
.late-record { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
.late-record dt { font-weight: 600; color: var(--text-2); }
.late-record dd { margin: 0; }
.late-log { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.late-log li { display: grid; gap: .05rem; padding-left: .75rem; border-left: 2px solid var(--border); font-size: .9rem; }
@media (max-width: 900px) {
  .late-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .late-flow li:not(:last-child) a::after { display: none; }
  .late-flow li:last-child { grid-column: span 2; }
  .late-measures, .late-meter { grid-template-columns: minmax(0, 1fr); }
  .late-record { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .late-record dd { margin-bottom: .5rem; }
}

/* ---- การแจ้งเตือน (/me/notify, /core/notify) ---- */
.st-form { display: grid; gap: .7rem; }
.st-form .check-line { align-items: flex-start; line-height: 1.45; }
.st-form .check-line input { margin-top: .25rem; }
.st-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.st-steps { margin: .2rem 0 .9rem 1.2rem; padding: 0; display: grid; gap: .3rem; }
.st-code { margin: .4rem 0 .1rem; text-align: center; font-size: 2.2rem; font-weight: 700; letter-spacing: .18em;
  font-variant-numeric: tabular-nums; color: var(--brand); background: var(--brand-soft); border-radius: 14px; padding: .5rem; }
.ch-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.ch-state > div { padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: .3rem; }
.ch-state code { font-size: .82rem; word-break: break-all; }
@media (max-width: 900px) { .ch-state { grid-template-columns: minmax(0, 1fr); } }
.late-measures.pm-checks { grid-template-columns: minmax(0, 1fr); }

/* ---- รายงานพลังงาน Green Office / ISO 50001 ---- */
.en-chart { width: 100%; height: auto; display: block; }
.en-grid { stroke: var(--border); stroke-width: 1; }
.en-axis { fill: var(--muted); font-size: 11px; }
.en-bar { fill: var(--t-amber); opacity: .85; }
.en-base { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-dasharray: 5 4; }
.en-dot { fill: var(--surface); stroke: var(--text-2); stroke-width: 2; }
.en-form { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.en-settings summary { cursor: pointer; }
@media print { .en-form, .en-settings form, .page-head .actions { display: none; } .en-chart { min-width: 0; } }

/* ---- GS1 label scan on the receiving form ---- */
.gs1-scan { width: 11rem; font-family: ui-monospace, Consolas, monospace; }
.gs1-note { display: block; font-size: .78rem; min-height: 1em; }

/* ---- ผู้ช่วย AI (/ai) ---- */
.ai-ask textarea { width: 100%; box-sizing: border-box; font-size: 1.02rem; }
.ai-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-top: .6rem; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.chip-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: .3rem .8rem;
  font: inherit; font-size: .84rem; cursor: pointer; }
.chip-btn:hover:not(:disabled) { border-color: var(--brand-line); color: var(--text); }
.chip-btn:disabled { opacity: .5; cursor: default; }
.ai-answer { margin-top: 1rem; }
.ai-text { white-space: pre-wrap; line-height: 1.7; }
.ai-chart { margin: 1rem 0 .4rem; }
.ai-chart figcaption { font-weight: 600; margin-bottom: .3rem; }
.ai-chart svg { width: 100%; height: auto; display: block; }
.ai-bar { fill: var(--t-violet); opacity: .85; }
.ai-dot { fill: var(--surface); stroke: var(--t-violet); stroke-width: 2; }
.ai-line { fill: none; stroke: var(--t-violet); stroke-width: 2.5; }

/* ---- QR ลงชื่อเข้าอบรม ---- */
.qr-show { text-align: center; }
.qr-box { width: min(420px, 100%); margin: 0 auto; background: #fff; padding: .5rem; border-radius: 12px; }
.qr-box svg { width: 100%; height: auto; display: block; }

/* ---- ตรวจนับรายล็อต ---- */
tr.count-lot td:first-child { padding-left: 1.8rem; font-size: .9rem; }
tr.count-lot td { background: var(--surface-2); }

/* type to find an item on a line */
.sel-filter { display: block; width: 100%; max-width: 22rem; margin-bottom: .3rem; font-size: .88rem; }

/* ---- เข้าสู่ระบบ 2 ขั้น ---- */
.code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-codes { list-style: none; padding: 0; margin: .6rem 0 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.mfa-codes li { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; text-align: center; padding: .4rem; border: 1px dashed var(--border-strong); border-radius: 8px; }
.mfa-key { font-size: 1rem; letter-spacing: .08em; word-break: break-all; }
.login-single { grid-template-columns: minmax(0, 1fr) !important; }

/* เริ่มใช้งานระบบจริง (/core/start) */
.sg-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: var(--gap); }
.sg-progress { display: grid; gap: .45rem; flex: 1 1 280px; min-width: 0; }
.sg-big { font-size: 1.9rem; line-height: 1; }
.sg-group { margin-bottom: var(--gap); }
.sg-list { list-style: none; margin: 0; padding: 0; }
.sg-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .85rem 0; border-top: 1px solid var(--border); }
.sg-list li:first-child { border-top: 0; }
.sg-list .step-mark { margin-top: .1rem; }
.sg-list li.done .step-mark { background: var(--ok-soft); color: var(--ok); }
.sg-list li.done .sg-title { color: var(--muted); }
.sg-title { font-weight: 600; }
.sg-why { font-size: .86rem; margin-top: .15rem; }
.sg-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.sg-meta span:first-child { display: inline-flex; gap: .3rem; align-items: center; }
@media (max-width: 560px) { .sg-list li { grid-template-columns: 26px minmax(0, 1fr); } .sg-act { grid-column: 2; } }
.sg-home { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; justify-content: space-between; margin-bottom: var(--gap); }
.sg-home .bar { width: min(260px, 100%); }

/* นำเข้ารายชื่อบุคลากร: one-time password slips, cut apart and handed out */
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.slip { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: .8rem .9rem; display: grid; gap: .25rem; break-inside: avoid; }
.slip .who { font-weight: 700; }
.slip .pw { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .04em; }
.slip small { color: var(--muted); }
@media print {
  .slips-print { border: 0; padding: 0; }
  .slips { grid-template-columns: repeat(2, 1fr); }
  .slip { border-color: #555; color: #000; }
}
.dept-edit { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .7rem; display: grid; gap: .6rem; }
.dept-edit summary { cursor: pointer; font-weight: 600; color: var(--brand); }

/* ตั้งผู้ดูแลระบบครั้งแรก: the sign-in panel alone, centred */
.login.setup-admin { grid-template-columns: minmax(0, 1fr); }
.setup-admin .login-top-logo { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: .9rem 1rem; border-radius: 20px; background: #fff; }
.setup-admin .login-top-logo img { width: min(260px, 70vw); height: auto; }
.setup-admin .login-card { width: min(460px, 100%); }
.mfa-switch { margin-bottom: var(--gap); }
.mfa-modes { display: grid; gap: .5rem; }
.mfa-mode { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.mfa-mode.on { border-color: var(--brand-line); background: var(--brand-soft); }
.mfa-mode input { margin-top: .3rem; }
.mfa-mode span { display: grid; gap: .1rem; min-width: 0; }
.mfa-mode small { font-size: .82rem; }
.mfa-modes .btn { justify-self: start; }
/* วันหยุดราชการทั้งปี */
.hol-grid { align-items: start; }
.hol-one { margin-top: .8rem; flex-wrap: wrap; }
.hol-draft { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .1rem; }
.hol-draft label { display: grid; grid-template-columns: auto 5.5rem minmax(0, 1fr); gap: .55rem; align-items: start; padding: .4rem .2rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.hol-draft li.have label { color: var(--muted); }
.hol-lines { width: 100%; font: inherit; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
/* งานสารบรรณ */
.sb-form label { display: grid; gap: .3rem; }
.sb-send { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem 1rem; }
.sb-send legend { font-weight: 600; padding: 0 .3rem; }
.sb-number { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: .01em; }
.sb-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem 1.2rem; margin: 0; }
.sb-meta dt { font-size: .8rem; color: var(--muted); }
.sb-meta dd { margin: 0; font-weight: 500; }
.sb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sb-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: .7rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.sb-steps li:first-child { border-top: 0; }
.sb-steps .dot { width: 12px; height: 12px; border-radius: 50%; margin: .35rem auto 0; background: var(--ok); }
.sb-steps li.waiting .dot { background: var(--medium); box-shadow: 0 0 0 4px var(--medium-soft); }
.sb-steps .what { font-weight: 600; }
.sb-steps .instr { margin: .2rem 0 0; padding: .4rem .6rem; border-left: 3px solid var(--brand-line); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.sb-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem 1rem; }
.sb-pick select[multiple] { min-height: 9rem; }
/* ยานพาหนะและห้องประชุม */
.fl-sub { font-size: .9rem; margin: .8rem 0 .3rem; color: var(--muted); font-weight: 600; }
.fl-choose { border: 0; padding: 0; margin: 0; display: grid; gap: .35rem; }
.fl-choose legend { font-weight: 600; margin-bottom: .3rem; }
.fl-choose label { display: flex; gap: .55rem; align-items: center; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.fl-choose label.busy { opacity: .6; cursor: not-allowed; }
.fl-week td, .fl-week th { vertical-align: top; min-width: 7.5rem; }
.fl-week .today { background: var(--brand-soft); }
.fl-booking { font-size: .82rem; padding: .3rem .4rem; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--brand); margin-bottom: .3rem; display: grid; gap: .1rem; }
.fl-free { font-size: .8rem; }
/* ร้องเรียน (หน้าผู้รับบริการ) และความเสี่ยง */
.pub-fieldset { border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; display: grid; gap: .7rem; margin: 0; }
.pub-fieldset legend { font-weight: 600; padding: 0 .3rem; }
.pub-reply { text-align: left; margin-top: .8rem; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--ok); }
.pub-reply p { margin: .3rem 0; white-space: pre-line; }
.rk-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; }
.rk-grades label { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400; }
.rk-grades label b { min-width: 1.2rem; }
.rk-grades label.serious { border-color: var(--high-line, var(--border)); }
.rk-sev { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 8px; font-weight: 700; background: var(--surface-3); }
.rk-sev.high { background: var(--high-soft); color: var(--high); }
.rk-sev.mid { background: var(--medium-soft); color: var(--medium); }
.rk-bars { display: grid; gap: .35rem; }
.rk-bars div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem; gap: .6rem; align-items: center; font-size: .86rem; }
.rk-bars .bar span { background: var(--brand); }
.rk-text { white-space: pre-line; margin: .2rem 0 0; }
/* colours of the three categories added 8 ต.ค. 2569 */
[data-cat="saraban"] { --cat-grad: linear-gradient(135deg, #60a5fa, #1e40af); }
[data-cat="fleet"] { --cat-grad: linear-gradient(135deg, #2dd4bf, #0f766e); }
[data-cat="risk"] { --cat-grad: linear-gradient(135deg, #f87171, #b91c1c); }
/* คู่มือการใช้งาน */
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.help-card { display: grid; gap: .45rem; align-content: start; color: var(--text); }
.help-card:hover { text-decoration: none; border-color: var(--brand-line); }
.help-card h2 { margin: 0; font-size: 1.05rem; }
.help-card p { margin: 0; font-size: .88rem; }
.help-card .badge { justify-self: start; }
.help-steps ol { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .8rem; }
.help-steps li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .7rem; align-items: start; font-size: 1.02rem; }
.help-n { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
/* ความคืบหน้าการพัฒนาระบบ */
.pg-bar { height: 12px; }
.pg-bar span, .pg-legend i { display: inline-block; height: 100%; }
.pg-built { background: var(--ok); } .pg-data { background: var(--brand); } .pg-external { background: var(--medium); }
.pg-legend { display: flex; gap: .4rem .9rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); }
.pg-legend i { width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; margin-right: .2rem; }
.pg-sections { display: grid; gap: .2rem; }
.pg-sec { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 4.5rem; gap: .9rem; align-items: center; padding: .55rem .2rem;
  border-top: 1px solid var(--border); color: var(--text); }
.pg-sec:first-child { border-top: 0; } .pg-sec:hover { text-decoration: none; background: var(--surface-2); }
.pg-name, .pg-num { display: grid; gap: .05rem; } .pg-num { text-align: right; }
@media (max-width: 640px) { .pg-sec { grid-template-columns: minmax(0, 1fr) 4rem; } .pg-sec .pg-bar { grid-column: 1 / -1; grid-row: 2; } }
@media print { .pg-table { break-inside: auto; } }
.pg-table .card-head, .sg-group .card-head, #pg-sec + .pg-legend { flex-wrap: wrap; gap: .4rem .8rem; }
.pg-table .card-head .badge, .sg-group .card-head .badge { white-space: normal; }
section[aria-labelledby="pg-sec"] .card-head { flex-wrap: wrap; gap: .4rem .8rem; }
/* การประชุมและติดตามมติ (8–9 ต.ค. 2569) */
[data-cat="meet"] { --cat-grad: linear-gradient(135deg, #a78bfa, #6d28d9); }
.mt-section { margin: 0 0 1.1rem; }
.mt-section > h3 { margin: 0 0 .45rem; font-size: .98rem; display: flex; gap: .5rem; align-items: baseline; }
.mt-section > h3 .n { color: var(--muted); font-weight: 600; min-width: 4.2rem; }
.mt-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.mt-item { border: 1px solid var(--border); border-radius: 12px; padding: .65rem .8rem; display: grid; gap: .35rem; min-width: 0; }
.mt-item .mt-title { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-weight: 600; }
.mt-item .mt-title .no { color: var(--muted); font-weight: 600; }
.mt-item .mt-text { white-space: pre-line; margin: 0; font-size: .9rem; color: var(--text-2); overflow-wrap: anywhere; }
.mt-item .mt-res { white-space: pre-line; margin: 0; padding: .45rem .6rem; border-left: 3px solid var(--brand); background: var(--brand-soft);
  border-radius: 0 8px 8px 0; font-size: .92rem; overflow-wrap: anywhere; }
.mt-item details > summary { cursor: pointer; font-size: .86rem; color: var(--brand); }
.mt-item details[open] > summary { margin-bottom: .45rem; }
.mt-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.mt-acts li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.mt-acts li .grow { flex: 1 1 12rem; min-width: 0; }
.mt-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; list-style: none; margin: 0; padding: 0; }
.mt-people li { display: flex; gap: .5rem; align-items: center; justify-content: space-between; padding: .4rem .6rem; border: 1px solid var(--border);
  border-radius: 10px; font-size: .88rem; min-width: 0; }
.mt-people li span { min-width: 0; overflow-wrap: anywhere; }
.mt-people small { display: block; color: var(--muted); font-size: .76rem; }
.mt-steps { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; font-size: .82rem; }
.mt-steps span { padding: .2rem .55rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.mt-steps span.on { background: var(--brand); color: #fff; }
.mt-steps span.done { background: var(--ok-soft, var(--brand-soft)); color: var(--ok); }
.mt-rec-att { display: grid; gap: .35rem; }
.mt-rec-att > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 12rem); gap: .5rem; align-items: center; font-size: .9rem;
  padding: .3rem 0; border-top: 1px solid var(--border); }
.mt-rec-att .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.mt-rec-att .seg label { position: relative; padding: .25rem .55rem; cursor: pointer; font-size: .82rem; margin: 0; }
.mt-rec-att .seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mt-rec-att .seg label:has(input:checked) { background: var(--brand); color: #fff; }
.mt-rec-att .seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 640px) { .mt-rec-att > div { grid-template-columns: minmax(0, 1fr); } }
.mt-rec-item textarea { width: 100%; }
.mt-item details { min-width: 0; }
.mt-item details[open] { flex: 1 1 100%; }
.mt-item .form-grid, #people .form-grid, #agenda .form-grid, section[aria-labelledby="mt-ch"] .form-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.mt-filters { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: end; }
.mt-filters > label:not(.check-line) { display: grid; gap: .25rem; flex: 1 1 12rem; min-width: 0; }
.mt-filters select { width: 100%; max-width: 100%; min-width: 0; }
/* สิ่งแวดล้อมและขยะติดเชื้อ (9 ต.ค. 2569) */
[data-cat="env"] { --cat-grad: linear-gradient(135deg, #4ade80, #15803d); }
.ev-legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .78rem; color: var(--muted); }
.ev-legend i, .ev-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .25rem; vertical-align: -1px; }
.ev-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; align-items: end; height: 220px; padding-top: 1.2rem; }
.ev-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-width: 0; text-align: center; }
.ev-col .ev-stack { align-self: end; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; min-height: 2px;
  background: var(--surface-3); }
.ev-col .ev-stack i { display: block; width: 100%; }
.ev-n { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.ev-m { font-size: .7rem; color: var(--muted); margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .ev-bars { gap: .2rem; height: 180px; } .ev-n { display: none; } .ev-m { font-size: .62rem; } }
@media (max-width: 720px) { .kpis.three { grid-template-columns: minmax(0, 1fr); } }
/* ==== แอปบนหน้าจอโทรศัพท์ (9 ต.ค. 2569): bottom bars on phones, a back button inside the app, the install hint ==== */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
.app-back[hidden] { display: none !important; }
.app-back { flex: none; margin-left: -6px; }
.app-tabs { display: none; }
@media (max-width: 899px) {
  .app-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--surface); border-top: 1px solid var(--border); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    box-shadow: 0 -10px 26px -18px rgba(14, 27, 50, .35); }
  .app-tabs a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 58px; padding: .35rem .15rem; font-size: .7rem;
    color: var(--muted); text-align: center; line-height: 1.25; -webkit-tap-highlight-color: transparent; }
  .app-tabs a:hover { text-decoration: none; color: var(--text); }
  .app-tabs a.active { color: var(--brand); font-weight: 600; }
  .app-tabs a:active, .st-tabs a:active { transform: scale(.94); }
  body.pub { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  body:has(.dash-tabs) .main { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  input, select, textarea { font-size: max(16px, 1em); }        /* no zooming in when a field is tapped on iPhone */
}
/* inside the app (opened from the home screen): no rubber-band showing white, room for the phone's notch */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  .topbar, .st-top, .pub-top { padding-top: max(.45rem, env(safe-area-inset-top, 0px)); }
  .pub-demo, .st-demo { display: none; }
  a, button { -webkit-tap-highlight-color: transparent; }
  body { -webkit-user-select: none; user-select: none; }
  main, main * { -webkit-user-select: text; user-select: text; }
}
.install-hint { display: flex; gap: .8rem; align-items: center; padding: .8rem .9rem; margin: 0 0 var(--gap, 1rem); border: 1px solid var(--brand-line, var(--border));
  background: var(--brand-soft); border-radius: 16px; }
.install-hint[hidden] { display: none; }
.install-hint img { width: 52px; height: 52px; border-radius: 12px; flex: none; box-shadow: 0 4px 12px -4px rgba(14, 27, 50, .35); }
.install-hint .ih-text { display: grid; gap: .15rem; flex: 1 1 auto; min-width: 0; font-size: .88rem; line-height: 1.45; color: var(--text-2); }
.install-hint .ih-text > b { color: var(--text); font-size: .95rem; }
.install-hint .ih-share { display: inline-grid; place-items: center; vertical-align: -3px; color: var(--brand); }
.install-hint .ih-actions { display: flex; gap: .3rem; align-items: center; flex: none; }
.pub .install-hint { margin-top: 1rem; }
/* the message when there is no signal */
body.app-offline { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 1.5rem; }
body.app-offline main { max-width: 26rem; text-align: center; display: grid; gap: .8rem; justify-items: center; }
body.app-offline h1 { margin: .4rem 0 0; font-size: 1.35rem; }
body.app-offline p { margin: 0; color: var(--text-2); }
@media (display-mode: standalone) and (max-width: 899px) {
  .pub-nav { display: none; }                                    /* the bottom bar carries it inside the app */
  .pub-bar { min-height: 58px; }
}
