/* SYT & WST Executive Dashboard V2 — one stylesheet, no framework.
   Light (default): soft white cards, bright palette. Dark: [data-theme=dark]. */
:root {
  color-scheme: light;
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f5f7fb;
  --line: #e4e9f2;
  --line-2: #d5dce8;
  --ink: #16213a;
  --ink-2: #44506a;
  --muted: #7a859c;
  --accent: #2a78d6;
  --accent-ink: #fff;
  --side-a: #1f6fd6;
  --side-b: #1553b0;
  /* bright palette (fixed meaning) */
  --blue: #2a78d6;  --blue-soft: #e3effd;
  --green: #12a150; --green-soft: #dff5e8;
  --red: #e0414f;   --red-soft: #fde6e8;
  --yellow: #eda100;--yellow-soft: #fdf1d3;
  --orange: #eb6834;--orange-soft: #fde8de;
  --purple: #7b5ce0;--purple-soft: #ece7fc;
  --teal: #13a89e;  --teal-soft: #dcf4f2;
  --pink: #e2588f;  --pink-soft: #fce4ee;
  --shadow: 0 1px 2px rgba(22,33,58,.04), 0 10px 28px -14px rgba(22,33,58,.22);
  --shadow-lg: 0 2px 4px rgba(22,33,58,.05), 0 18px 40px -18px rgba(22,33,58,.35);
  --radius: 18px;
  --side-w: 260px;
  --font: "Inter", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --panel: #131b2e;
  --panel-2: #19233a;
  --line: #243049;
  --line-2: #2e3c5c;
  --ink: #e8edf6;
  --ink-2: #b6c0d4;
  --muted: #8291ad;
  --accent: #4a92ea;
  --side-a: #12306a;
  --side-b: #0d2250;
  --blue: #4a92ea;  --blue-soft: rgba(74,146,234,.16);
  --green: #2bb866; --green-soft: rgba(43,184,102,.16);
  --red: #ec5a66;   --red-soft: rgba(236,90,102,.16);
  --yellow: #f2b632;--yellow-soft: rgba(242,182,50,.16);
  --orange: #f07c4c;--orange-soft: rgba(240,124,76,.16);
  --purple: #9a85ef;--purple-soft: rgba(154,133,239,.18);
  --teal: #2cc2b6;  --teal-soft: rgba(44,194,182,.16);
  --pink: #ec74a3;  --pink-soft: rgba(236,116,163,.16);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -14px rgba(0,0,0,.7);
  --shadow-lg: 0 18px 40px -18px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { flex: none; display: block; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--pink); } .dots i:nth-child(2) { background: var(--yellow); } .dots i:nth-child(3) { background: var(--teal); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; overflow-y: auto;
  background: linear-gradient(180deg, var(--side-a), var(--side-b)); color: #fff;
}
.side::-webkit-scrollbar { width: 6px; } .side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 9px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 16px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--side-b);
  background: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.45);
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand-sub { font-size: 12px; opacity: .8; }
.ver { display: inline-block; font-size: 10px; font-weight: 800; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: #3a2a00; margin-left: 3px; }
.side-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px;
  color: rgba(255,255,255,.86); font-weight: 500; font-size: 13.5px; min-height: 40px;
}
.nav-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.is-active { background: #fff; color: var(--side-b); font-weight: 700; box-shadow: 0 6px 16px -8px rgba(0,0,0,.4); }
.nav-group summary {
  list-style: none; cursor: pointer; padding: 14px 12px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.62); display: flex; align-items: center;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(45deg); }
.tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid currentColor; opacity: .7; flex: none; }
.side-foot { border-top: 1px solid rgba(255,255,255,.18); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #fff; color: var(--side-b); flex: none; }
.me-txt { flex: 1; min-width: 0; }
.me-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .icon-btn { border-color: rgba(255,255,255,.3); color: #fff; background: transparent; }
.side .side-close { display: none; }
.side .icon-btn:hover { background: rgba(255,255,255,.15); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--ink); box-shadow: var(--shadow); }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: block; }
:root[data-theme="dark"] .when-light { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 30px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px);
}
.top-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.top-title h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title h1 b { color: var(--accent); }
.top-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.menu-btn { display: none; }
.lang, .src { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; box-shadow: var(--shadow); }
.lang button, .src a {
  border: 0; background: transparent; color: var(--muted); font: 700 12px var(--font); padding: 6px 10px;
  border-radius: 9px; cursor: pointer; min-height: 30px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.lang button.is-on { background: var(--blue-soft); color: var(--blue); }
.src a.is-on { background: var(--accent); color: #fff; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.src a:not(.is-on) .live { background: var(--muted); box-shadow: none; }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 30px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.fld > span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fld input, .fld select {
  height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--ink); font: 500 13.5px var(--font); padding: 0 12px; width: 100%;
}
.fld select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.fld input:focus, .fld select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fld-date { max-width: 180px; }

.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: 11px; font: 700 13px var(--font); cursor: pointer; white-space: nowrap;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); box-shadow: 0 8px 18px -10px var(--accent); }
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--panel); color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { color: var(--ink); box-shadow: var(--shadow); }
.btn-block { width: 100%; height: 46px; font-size: 14.5px; }

/* ---------- content ---------- */
.content { padding: 20px 30px 44px; display: flex; flex-direction: column; gap: 20px; max-width: 1680px; width: 100%; }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px; font-weight: 600; }
.banner .ic { margin-top: 1px; }
.banner.is-critical { background: var(--red-soft); color: var(--ink); } .banner.is-critical .ic { color: var(--red); }
.banner.is-warning { background: var(--yellow-soft); color: var(--ink); } .banner.is-warning .ic { color: var(--yellow); }
.banner.is-info { background: var(--blue-soft); color: var(--ink); } .banner.is-info .ic { color: var(--blue); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-head p { margin-top: 3px; }
.link { color: var(--accent); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.count { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); }

/* tone helpers */
.t-blue { --c: var(--blue); --cs: var(--blue-soft); }
.t-green { --c: var(--green); --cs: var(--green-soft); }
.t-red { --c: var(--red); --cs: var(--red-soft); }
.t-yellow { --c: var(--yellow); --cs: var(--yellow-soft); }
.t-orange { --c: var(--orange); --cs: var(--orange-soft); }
.t-purple { --c: var(--purple); --cs: var(--purple-soft); }
.t-teal { --c: var(--teal); --cs: var(--teal-soft); }
.t-pink { --c: var(--pink); --cs: var(--pink-soft); }

/* stat cards (image-4 style) */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.stat {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s; min-width: 0;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-top { display: flex; align-items: center; gap: 12px; }
.stat-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--cs); color: var(--c); flex: none; }
.stat-lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.stat-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta { font-weight: 800; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: var(--panel-2); color: var(--muted); }

/* KPI rings (image-1 style) */
.rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ring-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); min-width: 0; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { stroke: var(--line); }
.ring .val { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring-txt { min-width: 0; }
.ring-txt h3 { font-size: 14px; }
.ring-txt p { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* grids */
.row { display: grid; gap: 20px; }
.row-a { grid-template-columns: 1.15fr 1fr; }
.row-b { grid-template-columns: 1.3fr 1fr 1fr; }

/* today's attendance segmented bar (image-5 style) */
.seg-bar { display: flex; gap: 3px; height: 16px; margin: 6px 0 16px; }
.seg-bar i { display: block; height: 100%; min-width: 4px; background: var(--c); }
.seg-bar i:first-child { border-radius: 8px 0 0 8px; } .seg-bar i:last-child { border-radius: 0 8px 8px 0; } .seg-bar i:only-child { border-radius: 8px; }
.seg-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg-legend a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--cs); }
.seg-legend b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seg-legend span { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.seg-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.co-list { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.co-row { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; }
.co-row:hover { background: var(--panel-2); }
.co-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.co-meta span { color: var(--muted); }
.co-meta strong { color: var(--ink); }
.mini { display: flex; gap: 2px; height: 10px; }
.mini i { display: block; height: 100%; min-width: 3px; background: var(--c); }
.mini i:first-child { border-radius: 5px 0 0 5px; } .mini i:last-child { border-radius: 0 5px 5px 0; } .mini i:only-child { border-radius: 5px; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 170px; height: 170px; flex: none; margin: 0 auto; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 22; }
.donut .seg:hover { stroke-width: 26; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 24px; font-weight: 800; }
.donut-c span { font-size: 11.5px; color: var(--muted); }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.donut-legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.donut-legend b { font-variant-numeric: tabular-nums; }
.c1 { --c: #2a78d6; } .c2 { --c: #eb6834; } .c3 { --c: #1baf7a; } .c4 { --c: #eda100; } .c5 { --c: #e87ba4; } .c6 { --c: #9aa3b5; }
:root[data-theme="dark"] .c1 { --c: #3987e5; } :root[data-theme="dark"] .c2 { --c: #d95926; } :root[data-theme="dark"] .c3 { --c: #199e70; }
:root[data-theme="dark"] .c4 { --c: #c98500; } :root[data-theme="dark"] .c5 { --c: #d55181; } :root[data-theme="dark"] .c6 { --c: #5d6680; }

/* trend */
.trend { width: 100%; height: auto; display: block; overflow: visible; }
.trend .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.trend .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.trend .area { fill: url(#tg); }
.trend .line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend .pt circle { fill: var(--teal); stroke: var(--panel); stroke-width: 2.5; }
.trend .pt circle.nodata { fill: var(--muted); stroke: none; opacity: .5; }
.trend .pt .hit { fill: transparent; }
.trend .pt:hover .hit { fill: var(--teal-soft); }
.trend .val-label { fill: var(--ink); font-size: 12.5px; font-weight: 800; font-family: var(--font); }
#tg .s1 { stop-color: var(--teal); stop-opacity: .35; } #tg .s2 { stop-color: var(--teal); stop-opacity: 0; }

/* lists (activity / leave) */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--cs); color: var(--c); flex: none; font-weight: 800; font-size: 13px; }
.feed-txt { flex: 1; min-width: 0; }
.feed-txt b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-txt small { color: var(--muted); font-size: 11.5px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--cs); color: var(--c); white-space: nowrap; }
.time { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { display: grid; place-items: center; gap: 8px; padding: 30px 0; color: var(--muted); text-align: center; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--ink); color: var(--panel); padding: 7px 11px; border-radius: 9px; font-size: 12px; font-weight: 700;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-lg);
}
.tip.on { opacity: 1; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--panel-2); white-space: nowrap; }
.tbl th:first-child { border-radius: 10px 0 0 10px; } .tbl th:last-child { border-radius: 0 10px 10px 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl td a:hover { color: var(--accent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 800; color: var(--red); }
.tbl .rate-col { width: 210px; }
.rate { display: flex; align-items: center; gap: 10px; }
.meter { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; flex: 1; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.rate span { width: 50px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tbl tr.is-hidden { display: none; }
.more { margin-top: 14px; }

/* module tiles (image-3 style) */
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel-2); color: var(--muted); min-width: 250px; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 13.5px var(--font); width: 100%; }
.mod-group + .mod-group { margin-top: 22px; }
.mod-group h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.mod-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 20px 10px 16px; min-height: 150px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 6px 0 -2px var(--line-2), var(--shadow); transition: transform .14s, box-shadow .14s;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 0 -4px var(--line-2), var(--shadow-lg); }
.tile-ic {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  box-shadow: 0 10px 20px -10px var(--c);
}
.tile b { font-size: 13px; font-weight: 800; line-height: 1.3; }
.tile small { font-size: 11px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tag { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.tile.is-v2 .tag { color: var(--green); opacity: 1; background: var(--green-soft); border-color: transparent; }
.tile.is-hidden { display: none; }
.foot-note { text-align: center; }

/* people page */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); min-height: 36px; }
.seg a:hover { background: var(--panel-2); }
.seg a.is-on { background: var(--accent); color: #fff; }
.head-tools { display: flex; flex-wrap: wrap; gap: 10px; }

/* login */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff;
  background: radial-gradient(700px 400px at 100% 0%, rgba(255,255,255,.18), transparent 60%), linear-gradient(160deg, #2a86e8, #1553b0 70%);
}
.login-art .brand-sub { opacity: .8; }
.art-copy h1 { font-size: 42px; line-height: 1.12; max-width: 12ch; }
.art-copy p { margin-top: 12px; opacity: .85; font-size: 15px; }
.art-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.art-cards div { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 16px; padding: 14px 16px; min-width: 120px; backdrop-filter: blur(6px); animation: float 5s ease-in-out infinite; }
.art-cards div:nth-child(2) { animation-delay: .8s } .art-cards div:nth-child(3) { animation-delay: 1.6s }
.art-cards b { display: block; font-size: 24px; }
.art-cards span { font-size: 12px; opacity: .85; }
.art-cards i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 390px; display: flex; flex-direction: column; gap: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { font-size: 28px; }
.login-card .fld { max-width: none; }
.login-card .fld input { height: 46px; font-size: 15px; }
.login-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.center-msg { max-width: 460px; margin: 15vh auto; padding: 0 16px; text-align: center; display: flex; flex-direction: column; gap: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .row-b { grid-template-columns: 1fr 1fr; } .row-b > :first-child { grid-column: 1 / -1; } }
@media (max-width: 1200px) { .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row-a { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .side { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.side-open .side { transform: none; }
  .scrim { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(10,20,40,.45); }
  body.side-open .scrim { display: block; }
  .side .side-close, .menu-btn { display: inline-grid; }
  .row-b { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 24px 20px; gap: 18px; }
  .art-copy h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .filters { margin: 0 16px; padding: 12px; }
  .content { padding: 16px 16px 36px; gap: 16px; }
  .top-title h1 { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat-ic { width: 38px; height: 38px; border-radius: 12px; }
  .stat-val { font-size: 24px; }
  .rings { grid-template-columns: 1fr; }
  .ring { width: 76px; height: 76px; }
  .fld, .fld-date { max-width: none; flex-basis: calc(50% - 5px); min-width: 0; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 132px; }
  .tile-ic { width: 52px; height: 52px; }
  .search { min-width: 0; width: 100%; }
  .card-head > .search, .head-tools { width: 100%; }
  .tbl .rate-col { width: 120px; }
  .seg { width: 100%; }
  .seg a span { display: none; } .seg a.is-on span { display: inline; }
  .seg-legend b { font-size: 18px; }
  #ppl thead { display: none; }
  #ppl, #ppl tbody, #ppl tr, #ppl td { display: block; width: 100%; }
  #ppl tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  #ppl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  #ppl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
}
/* ---------- data check (HR vs TigerSoft) ---------- */
.t-gray { --c: var(--muted); --cs: var(--panel-2); }
.banner.is-good { background: var(--green-soft); color: var(--ink); } .banner.is-good .ic { color: var(--green); }
a.banner:hover { box-shadow: var(--shadow); }
.month-nav { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.month-nav b { font-size: 14px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.month-nav .icon-btn { width: 36px; height: 36px; }
.flip svg { transform: scaleX(-1); }
.emp-search { margin-left: auto; min-width: 300px; }
.verdict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.verdict div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--cs); }
.verdict b { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--c); font-variant-numeric: tabular-nums; }
.verdict span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.person .banner { margin-bottom: 14px; }
.why { font-size: 12px; color: var(--ink-2); margin-top: 5px; max-width: 520px; line-height: 1.45; }
.time.is-late { color: var(--red); }
.example { display: grid; grid-template-columns: 1fr auto 1fr 1fr; align-items: stretch; gap: 10px; margin: 16px 0 8px; }
.ex-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.ex-col small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.ex-col b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex-col b.is-late { color: var(--red); }
.ex-arrow { display: grid; place-items: center; color: var(--muted); }
.howto { margin: 14px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.bars { width: 100%; height: auto; display: block; overflow: visible; }
.bars .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.bars .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.bars .bar path { fill: var(--red); opacity: .38; }
.bars .bar.is-on path, .bars .bar:hover path { opacity: 1; }
.bars .bar .hit { fill: transparent; }
.bars .bar:hover .hit { fill: var(--red-soft); }
.bars .val-label { fill: var(--ink); font-size: 12.5px; font-weight: 800; font-family: var(--font); }
.seg .n { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); color: var(--ink-2); }
.seg a.is-on .n { background: rgba(255,255,255,.22); color: #fff; }
.alert-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.alert-link:hover { box-shadow: var(--shadow); }
@media (max-width: 1200px) { .example { grid-template-columns: 1fr 1fr; } .ex-arrow { display: none; } }
@media (max-width: 640px) {
  .emp-search { min-width: 0; width: 100%; margin-left: 0; }
  .verdict { grid-template-columns: 1fr; }
  .verdict b { font-size: 22px; }
  .example { grid-template-columns: 1fr; }
  .alert-link span { display: none; }
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  .tbl.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; text-align: right; }
  .tbl.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .tbl.cards td .why { text-align: right; }
}
/* ---------- employee register ---------- */
.sync-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 -4px; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.emp { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); transition: box-shadow .14s, transform .14s; min-width: 0; }
.emp:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.emp-ph { position: relative; flex: none; width: 64px; height: 76px; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-soft), var(--teal-soft)); color: var(--accent); font-size: 26px; font-weight: 800; }
.emp-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.emp-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.emp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.emp-code { font-size: 12px; color: var(--muted); font-weight: 700; }
.emp-name { font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-pos { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: 12px; }
.emp dt { color: var(--muted); }
.emp dd { margin: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (max-width: 640px) { .emp-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
