/* ═══ ATTENDANCE (KEHADIRAN) ═══════════════════════════════════════════════════
   His Excel attendance sheet, as a screen. Everybody down the side, every day of the
   payroll period across the top.

   ⚠ NO VERTICAL RULES, AND THAT IS THE WHOLE DESIGN. The first build boxed every one
   of a thousand cells in on four sides — "i feel like the design looks outdated", and
   he was right: that is a 1998 spreadsheet, and it is not the language of this app.
   The Projects screen he approved has no boxes at all, only hairlines between rows,
   an ink rule under a column head, section names in the accent, and whitespace doing
   the rest. This screen is built on that, not beside it.

   What holds the columns together instead is the CROSSHAIR — hover anything and its
   row and its column light up. See hrHover() in js/hr.js.

   ⚠ EVERY COLOUR HERE IS A TOKEN. The sweep of 16 Sep turned 678 hand-typed colours
   into 24 named ones; a new screen typing its own hex would start that over, and
   would be invisible the moment dark mode is switched on.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* the screen fills the work panel and never scrolls itself — the grid inside it does */
.hr{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
.hr.hidden{display:none}

/* ── the head ───────────────────────────────────────────────────────────────
   ⚠ THE ARROWS LEAD THE ROW — "make this unmoveable". After the office name and the
   period they walked left and right every time he pressed one, because both of those
   strings change length.
   ⚠ EVERY CONTROL HOLDS ITS SIZE. Without flex-shrink:0 the browser takes the width
   out of whatever it likes on a narrow laptop: the two arrows were squashed to 2px
   and the Excel button was clipped off the end. The eyebrow is the one thing allowed
   to shorten, and it carries the DAY COUNT first so the ellipsis eats the date range
   rather than the number payroll is worked out from. */
.hr-head{flex-shrink:0;display:flex;align-items:flex-end;gap:10px;padding:4px 0 12px}
.hr-ttl{min-width:0;display:flex;flex-direction:column;gap:3px}
.hr-ttl .eyebrow{white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;
  font-variant-numeric:tabular-nums;padding-left:30px}
/* the month, with its two arrows */
.hr-per{display:flex;align-items:center;gap:2px;min-width:0}
/* ⚠ A FIXED MINIMUM, so the right-hand arrow lands in the same place whatever month
   is showing. 224px clears "September 2026", the longest of the twelve, at this size.
   Centred inside it, or a short month leaves the title adrift from its own arrows. */
.hr-ttl h1{font-size:27px;line-height:1.05;min-width:224px;text-align:center;
  font-variant-numeric:tabular-nums;white-space:nowrap}
/* ⚠ NO BORDER AND NO FILL. A bordered box beside a 27px word is a second control
   competing with the thing it belongs to; these are the title's own arrows, at the
   title's own size, and they are quiet until you reach for them. */
.hr-arw{width:30px;height:30px;display:flex;align-items:center;justify-content:center;
  border:0;background:none;padding:0;cursor:pointer;color:var(--ink-faint);
  border-radius:var(--r-control);flex-shrink:0}
.hr-arw:hover{color:var(--ink);background:var(--field)}
.hr-arw:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.hr-arw svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}
.hr-sp{flex:1;min-width:6px}
.hr-head .btn-line,.hr-head .hr-find{flex-shrink:0}
.hr-find{width:190px}

/* ── THE RAIL WEARS THE WALL'S OWN PICTURES ─────────────────────────────────
   "in the rail use the one in huge icons bro wtf why are you inconsistent" — and he
   was right: attendance went in carrying his drawing while the other ten rows were
   hairline glyphs, so the rail had one colour picture and ten line drawings. Every
   app already has a picture, the one on its wall tile, and the rail uses that same
   file now — one picture per app, never two to keep in step. See
   tools/shell/rail-icons.js. Home is the only glyph left, because Home is not an app.
   ⚠ 24px, NOT 20. These are drawings with a calendar grid and a face in them, not
   two strokes; at 20 they turn to mush. The row is 38px, so there is room.
   ⚠ NO ACCENT ON THE ACTIVE ROW. `.nav.active .nav-ic{color:var(--accent)}` tints a
   stroke — it can do nothing to a picture, and a colour icon that cannot show it is
   lit would leave the rail with no way to say where you are. The LIT PILL behind it
   is what says it now, which is what the wall's own tiles do. */
.nav-ic-img{width:26px;height:26px}
.nav-ic-img img{width:24px;height:24px;object-fit:contain;display:block}

/* ── a write that did not land ──────────────────────────────────────────────── */
.hr-trouble{flex-shrink:0;margin:0 0 10px;padding:7px 11px;border-radius:var(--r-control);
  background:var(--accent-soft);color:var(--accent-ink);font-size:12.5px;font-weight:500;
  border:1px solid var(--accent-line)}
.hr-trouble[hidden]{display:none}

/* ── the legend, which is also the colour picker ────────────────────────────
   A dot and a word, the way the app's status pills already are — not five filled
   squares in a bordered strip. The two sentences of instructions that used to sit
   here are gone: he does not want lessons written on his screens. */
.hr-leg{flex-shrink:0;display:flex;align-items:center;gap:3px;padding:0 0 11px;flex-wrap:wrap}
.hr-leg i{width:7px;height:7px;border-radius:50%;display:inline-block;flex-shrink:0}
.hr-leg button{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--ink-soft);
  padding:3px 8px;border-radius:999px;border:1px solid transparent;background:none;cursor:pointer}
.hr-leg button:hover{background:var(--field);color:var(--ink)}
.hr-leg button svg{width:11px;height:11px;stroke:var(--ink-faint);fill:none;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;opacity:0;margin-left:-2px}
.hr-leg button:hover svg{opacity:1}
.hr-leg .ro{color:var(--ink-faint);cursor:default}
.hr-leg .ro:hover{background:none;color:var(--ink-faint)}

/* ── the grid ───────────────────────────────────────────────────────────────── */
.hr-wrap{flex:1;min-height:0;overflow:auto;position:relative}
.hr-wrap table{border-collapse:separate;border-spacing:0;font-size:12px}
.hr-wrap th,.hr-wrap td{border-bottom:1px solid var(--rule-soft);padding:0;text-align:center;
  background:var(--surface)}
/* the editorial rule under a column head — 1.5px in INK, the mark this app puts under
   every set of column names. A grey hairline there reads as a table; this reads as a
   heading. */
.hr-wrap thead th{position:sticky;top:0;z-index:3;background:var(--paper);
  border-bottom:1.5px solid var(--ink);font-weight:500;height:44px;vertical-align:middle}

/* ⚠ FOUR LAYERS, DECLARED IN ONE PLACE. Nothing else in this grid may be given a
   z-index without being added to this list:
     4  the date header's own name cell (the top-left corner)
     3  the date header row
     2  the group heading — ABOVE the names, so a name sliding up goes under it
     1  the name cells  */
.hr-wrap th.nm,.hr-wrap td.nm{position:sticky;left:0;z-index:1;background:var(--paper);
  text-align:left;min-width:176px;max-width:176px;border-right:1px solid var(--rule)}
.hr-wrap thead th.nm{z-index:4}
.hr-wrap td.nm{padding:0 12px;font-size:13.5px;height:32px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
/* ⚠ THE NAME IS THE BUTTON. It was a × drawn only under the pointer, and only on the
   handful of people this screen had added — so on a sheet of technicians there was no
   × anywhere and nothing to say why: "wheres the x?". A name you can press is found
   without being hunted for, and it can answer for every row, including the ones that
   are removed on a different screen entirely. */
.hr-wrap td.nm .who{display:flex;align-items:center;gap:7px;width:100%;border:0;background:none;
  padding:0;font:inherit;color:inherit;text-align:left;cursor:pointer;min-width:0}
.hr-wrap td.nm .who > svg.chev{margin-left:auto;width:13px;height:13px;stroke:var(--ink-faint);
  fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:0;flex-shrink:0}
.hr-wrap tr:hover td.nm .who > svg.chev{opacity:1}
.hr-wrap td.nm .who:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}
/* somebody typed in by hand rather than a login or a technician record: a DOT, not a
   bordered badge — otherwise the name column becomes a row of little boxes. */
.hr-wrap td.nm .tag{width:5px;height:5px;border-radius:50%;background:var(--warn);flex-shrink:0}
/* somebody taken off the sheet, listed in the panel with the way back */
#hrTree .hr-back{color:var(--ink-faint)}
#hrTree .hr-back span{color:var(--accent)!important;font-size:11px!important;opacity:0}
#hrTree .hr-back span svg{display:block;width:15px;height:15px}
#hrTree .hr-back:hover span{opacity:1}

/* ⚠ THE SECTION HEAD STICKS DOWN; THE WORD INSIDE IT STICKS SIDEWAYS. A sticky cell is
   clamped to its own row and this one spans the whole row, so it has nowhere to slide
   and `left:0` on it does nothing: scroll sideways and the heading walks off the left
   edge while its empty band stays. The band is the cell, the word is a sticky span. */
.hr-wrap tr.grp td{background:var(--paper);height:30px;text-align:left;padding:0;
  position:sticky;top:44px;z-index:2;border-bottom:0}
.hr-wrap tr.grp .gl{position:sticky;left:0;display:inline-flex;align-items:center;gap:7px;
  padding:0 12px;line-height:30px;font-size:12px;font-weight:600;color:var(--accent)}
.hr-wrap tr.grp .gl b{font-weight:500;color:var(--ink-faint);font-variant-numeric:tabular-nums}

/* the crosshair — what replaced the gridlines */
.hr-wrap tbody tr:hover td{background:var(--hr-row)}
.hr-wrap tbody tr:hover td.nm{background:var(--hr-rowhi)}
.hr-wrap td.col-hi,.hr-wrap th.col-hi{background:var(--hr-row)}
.hr-wrap thead th.col-hi{background:var(--hr-rowhi)}
.hr-wrap tbody tr:hover td.col-hi{background:var(--hr-cross)}

/* ⚠ NO `position` ON th.d. It was `position:relative`, and because `th.d` outranks
   `thead th` that quietly cancelled the sticky on the whole date row — so scrolling
   down a 37-name office left the grid with no dates on it at all, while the counts
   beside them stayed put. Nothing in these cells is absolutely positioned. */
.hr-wrap th.d{min-width:48px;max-width:48px;cursor:pointer;user-select:none}
.hr-wrap th.d .dd{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.05}
.hr-wrap th.d .dw{font-size:9.5px;color:var(--ink-faint);letter-spacing:.03em;
  text-transform:uppercase;margin-top:1px}
.hr-wrap th.d:hover .dd{color:var(--accent)}
/* ⚠ A WEEKEND IS NOT AN ALARM. Saturday and Sunday were printed in the accent, which
   in this app means late, wrong or urgent — on a month of columns that is sixteen
   false alarms. They are simply quieter than a working day. The accent is today's. */
.hr-wrap th.d.we .dd,.hr-wrap th.d.we .dw{color:var(--ink-faint)}
.hr-wrap th.d.off .dd{text-decoration:line-through;color:var(--ink-faint);font-weight:500}
.hr-wrap th.d.off .dw{color:var(--ink-faint);opacity:.6}
.hr-wrap th.d.today .dd{color:var(--accent)}
.hr-wrap th.d.today .dw{color:var(--accent);opacity:.75}
/* a struck day is a soft column of wash, top to bottom — no borders, no grey block */
.hr-wrap th.d.off,.hr-wrap td.c.off{background:var(--hr-off)}
.hr-wrap tbody tr:hover td.c.off{background:var(--hr-offhi)}

.hr-wrap td.c{height:32px;min-width:48px;max-width:48px;position:relative;font-size:11px;overflow:hidden}
.hr-wrap td.c.live{cursor:cell}
.hr-wrap td.c .auto,.hr-wrap td.c .typed{display:block;padding:0 3px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;line-height:32px;font-size:11px}
.hr-wrap td.c .auto{color:var(--ink-faint);font-weight:400}
.hr-wrap td.c .typed{color:var(--ink);font-weight:500}
/* ⚠ A CHIP INSIDE THE CELL, NOT THE CELL PAINTED IN. A tinted cell edge to edge is
   what a spreadsheet does, and it made two marks side by side look like a merge
   error. The chip floats with air around it and reads as something somebody put
   there. The colours are his to change, so they arrive as variables. */
.hr-wrap td.c .mk{display:block;margin:4px 3px;line-height:24px;border-radius:var(--r-control);
  font-size:11px;font-weight:600;letter-spacing:.01em}
.hr-wrap td.c.m-ijin  .mk{color:var(--m-ijin); background:var(--m-ijin-bg)}
.hr-wrap td.c.m-cuti  .mk{color:var(--m-cuti); background:var(--m-cuti-bg)}
.hr-wrap td.c.m-half  .mk{color:var(--m-half); background:var(--m-half-bg)}
.hr-wrap td.c.m-halfp .mk{color:var(--m-halfp);background:var(--m-halfp-bg)}
.hr-wrap td.c.m-halfs .mk{color:var(--m-halfs);background:var(--m-halfs-bg)}
.hr-wrap td.c.m-sakit .mk{color:var(--m-sakit);background:var(--m-sakit-bg)}
.hr-wrap td.c.m-th    .mk{color:var(--m-th);   background:var(--m-th-bg)}
.hr-wrap td.c.sel{box-shadow:inset 0 0 0 1.5px var(--ink);border-radius:var(--r-control);z-index:1}

/* the counts. ⚠ NOT FROZEN, AND THEY MUST NOT BE — a sticky-right column only ever
   holds itself BACK from scrolling away, it never advances past its own slot in the
   row, so frozen counts sit permanently on top of the last dates of the period and
   nothing can bring those out. They end the row, as they do in his Excel. */
.hr-wrap th.t,.hr-wrap td.t{min-width:36px;max-width:36px;background:var(--paper);
  font-variant-numeric:tabular-nums}
.hr-wrap th.t{font-size:10px;color:var(--ink-faint);font-weight:600;letter-spacing:.02em}
/* the one other vertical rule in the grid, where the days stop and the counting
   starts — a real change of subject */
.hr-wrap th.t.first,.hr-wrap td.t.first{box-shadow:inset 1px 0 0 var(--rule)}
.hr-wrap td.t{font-size:12px;color:var(--ink-soft);height:32px}
.hr-wrap td.t.z{color:var(--ink-faint);opacity:.45}
.hr-wrap td.t.h{font-weight:600;color:var(--ink)}
.hr-wrap tbody tr:hover td.t{background:var(--hr-rowhi)}
.hr-wrap tfoot td{position:sticky;bottom:0;z-index:2;background:var(--paper);
  border-top:1.5px solid var(--ink);border-bottom:0;height:34px;font-size:11.5px;
  color:var(--ink-soft);font-variant-numeric:tabular-nums}
.hr-wrap tfoot td.nm{z-index:3;font-size:12px;font-weight:600;color:var(--ink)}

.hr-empty{padding:60px 24px;text-align:center;color:var(--ink-faint);font-size:13.5px}

/* ── the panel's list ───────────────────────────────────────────────────────
   The rows themselves are .dtab and are dressed by apppanel.css, the same as every
   other app's sections. Only the two small labels between them are this screen's,
   because no other panel has needed a heading inside its list before.
   ⚠ ON THE PAGE IT IS NOT DRAWN AT ALL. This node is borrowed into the panel the
   moment the screen opens; left visible it would also sit under the grid. */
#view-hr > .hr-tree{display:none}
.hr-tree-lbl{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;
  color:var(--ink-faint);padding:12px 9px 5px}
.hr-tree-lbl:first-child{padding-top:2px}
/* the + that opens the group list. ⚠ IT LIVES IN THE HEADING, not as a row under
   the groups — a row would be a fifth kelompok that is not one. The panel rows are
   the app's .dtab and nothing here invents a second look for them. */
.hr-tree-lbl{display:flex;align-items:center;gap:6px}
.hr-tree-lbl .hr-lbl-btn{margin-left:auto;width:18px;height:18px;display:grid;place-items:center;
  border:0;background:none;padding:0;border-radius:var(--r-control);color:var(--ink-faint);cursor:pointer}
.hr-tree-lbl .hr-lbl-btn svg{width:13px;height:13px;stroke:currentColor;fill:none;
  stroke-width:2;stroke-linecap:round}
.hr-tree-lbl .hr-lbl-btn:hover{background:var(--field);color:var(--ink)}
.hr-tree-lbl .hr-lbl-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

/* ── the cell menu ──────────────────────────────────────────────────────────── */
.hr-pop{position:fixed;z-index:60;width:212px;background:var(--surface);border:1px solid var(--rule);
  border-radius:var(--r-card);box-shadow:0 2px 4px rgba(20,18,16,.07),0 16px 34px -16px rgba(20,18,16,.32);
  padding:5px}
.hr-pop .ph{padding:6px 8px 5px;font-size:11px;color:var(--ink-faint);
  border-bottom:1px solid var(--rule-soft);margin-bottom:4px}
.hr-pop .ph b{color:var(--ink);font-weight:600}
.hr-pop button.o{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;
  border-radius:var(--r-control);font-size:13px;text-align:left;color:var(--ink);
  border:0;background:none;cursor:pointer}
.hr-pop button.o:hover{background:var(--field)}
.hr-pop button.o i{width:16px;height:16px;border-radius:4px;flex-shrink:0}
.hr-pop button.o .k{margin-left:auto;font-size:10px;color:var(--ink-faint)}
.hr-pop button.o.danger{color:var(--accent)}
.hr-pop button.o.danger:hover{background:var(--accent-soft)}
/* where a technician or a login is removed — a sentence, because the answer is a
   different screen and there is nothing here to press */
.hr-pop .note{padding:2px 8px 6px;font-size:12px;color:var(--ink-soft);line-height:1.45}
.hr-pop .note b{color:var(--ink);font-weight:600}
.hr-pop .div{height:1px;background:var(--rule-soft);margin:4px 2px}
.hr-pop input{width:100%;height:28px;border:1px solid var(--rule);border-radius:var(--r-control);
  background:var(--field);padding:0 8px;font-size:13px;font-family:inherit;color:var(--ink);outline:0}
.hr-pop input:focus{background:var(--surface);border-color:var(--rule)}
/* a heading INSIDE the menu — the name menu now carries a list of groups under the
   person's name, and the two need telling apart */
.hr-pop .ph2{padding:5px 8px 3px;font-size:11px;color:var(--ink-faint)}
/* the group somebody is already in */
.hr-pop button.o.on{background:var(--field)}
.hr-pop button.o.on .k{color:var(--ink-soft)}

/* ── the group list ─────────────────────────────────────────────────────────── */
/* ⚠ THE THREE DERIVED GROUPS HAVE NO BUTTONS AND NO EXPLANATION. Teknisi, Kantor
   and Sales are worked out from what a person is; a row with nothing to press on it
   says that on its own, and a greyed-out pencil with a sentence beside it is the
   thing this app does not do. */
.hr-gpop .grow{display:flex;align-items:center;gap:7px;padding:4px 8px;
  font-size:13px;color:var(--ink);min-height:28px}
.hr-gpop .grow .gn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hr-gpop .grow .gc{margin-left:auto;font-size:11px;color:var(--ink-faint);
  font-variant-numeric:tabular-nums}
.hr-gpop .grow .gx{width:20px;height:20px;display:grid;place-items:center;flex-shrink:0;
  border:0;background:none;padding:0;border-radius:var(--r-control);
  color:var(--ink-faint);cursor:pointer}
/* ⚠ ALWAYS DRAWN, NEVER ON HOVER. A control that appears only under the pointer is
   the exact mistake the name column made — "wheres the x?" — and this menu is opened
   precisely to press one of them. */
.hr-gpop .grow .gx svg{width:13px;height:13px;stroke:currentColor;fill:none;
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hr-gpop .grow .gx:hover{background:var(--field);color:var(--ink)}
.hr-gpop .grow .gx.danger:hover{background:var(--accent-soft);color:var(--accent)}

/* ── the colour picker ──────────────────────────────────────────────────────── */
.hr-cpop{position:fixed;z-index:60;width:196px;background:var(--surface);border:1px solid var(--rule);
  border-radius:var(--r-card);box-shadow:0 2px 4px rgba(20,18,16,.07),0 16px 34px -16px rgba(20,18,16,.32);
  padding:9px}
.hr-cpop .ph{font-size:11px;color:var(--ink-faint);margin-bottom:7px}
.hr-cpop .ph b{color:var(--ink);font-weight:600}
.hr-cpop .sws{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}
.hr-cpop .sws button{height:22px;border-radius:var(--r-control);border:1px solid var(--rule);cursor:pointer}
.hr-cpop .sws button.on{box-shadow:0 0 0 2px var(--surface),0 0 0 3.5px var(--ink)}
.hr-cpop .own{display:flex;align-items:center;gap:7px;margin-top:9px;padding-top:8px;
  border-top:1px solid var(--rule-soft)}
.hr-cpop .own input[type=color]{width:26px;height:24px;padding:0;border:1px solid var(--rule);
  border-radius:var(--r-control);background:none;cursor:pointer}
.hr-cpop .own span{font-size:12px;color:var(--ink-soft)}
.hr-cpop .own button{margin-left:auto;font-size:11.5px;color:var(--ink-faint);border:0;
  background:none;cursor:pointer}
.hr-cpop .own button:hover{color:var(--accent)}

/* ── the phone ──────────────────────────────────────────────────────────────
   ⚠ A 31-COLUMN GRID IS NOT A PHONE SCREEN. Nothing is drawn for it yet, so rather
   than hand a technician a sheet he cannot use, the tile is not offered on a phone
   (see noPhone in HOME_APPS). This only keeps the head from breaking if one is
   reached some other way. */
@media (max-width:760px){
  .hr-head{flex-wrap:wrap;gap:8px}
  .hr-find{width:100%;order:5}
  .hr-ttl h1{font-size:22px}
}
