/* HR module: time and attendance (الحضور والانصراف). Every class is prefixed time-. The House palette: black #26231f, gold #bdb797 / #9a9265, cream #f4eedc, paper #fffdf8. */

.time-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.time-badge { font-size: 11px; background: var(--ui-gold); color: #26231f; border-radius: 99px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; font-weight: 600; }
.time-badge:empty { display: none; }
.time-daylabel { font-family: var(--ui-serif); font-size: 17px; }
.time-wrap { overflow-x: auto; }
.time-pad { padding: 14px 16px; }
.time-t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-t sup { font-size: 9px; color: var(--ui-gold-2); margin-inline-start: 2px; }
.time-warn { color: var(--ui-warn); }
.time-bad { color: var(--ui-bad); }
.time-acts { white-space: nowrap; }
.time-acts .btn { margin: 2px 0; }

/* figures: the day at a glance */
.time-figs, .time-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 1px; background: var(--ui-line); border: 1px solid var(--ui-line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.time-figs > div, .time-sum > div { background: var(--ui-card); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.time-figs b, .time-sum b { font-family: var(--ui-serif); font-size: 26px; line-height: 1.1; }
.time-sum b { font-size: 21px; }
.time-figs span, .time-sum span { font-size: 12px; color: var(--ui-ink-2); }
.time-figs > .ok b { color: var(--ui-ok); }
.time-figs > .warn { background: var(--ui-warn-bg); }
.time-figs > .warn b { color: var(--ui-warn); }
.time-figs > .bad { background: var(--ui-bad-bg); }
.time-figs > .bad b { color: var(--ui-bad); }

/* the day sheet */
table.time-day td, table.time-month td, table.time-ot td { vertical-align: top; }
table.time-day th, table.time-month th, table.time-ot th { position: static; white-space: nowrap; }
.time-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(38, 35, 31, .25); }
.time-where { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.time-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.time-punches { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; font-size: 11.5px; color: var(--ui-muted); }
.time-punches span { white-space: nowrap; cursor: default; }
.time-punches span.out { color: var(--ui-bad); }

/* the month: an employee's calendar */
tr.time-exp > td { background: #fbf8ef; padding: 14px 16px; }
.time-calnav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.time-calnav b { font-family: var(--ui-serif); font-size: 18px; }
.time-cal { border: 1px solid var(--ui-line); border-radius: 12px; overflow: hidden; background: var(--ui-line); }
.time-cal-h { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #26231f; color: #f3ecda; font-size: 12px; }
.time-cal-h span { padding: 8px 10px; }
.time-cal-b { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.time-cd { background: var(--ui-card); min-height: 104px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; border-inline-start: 3px solid transparent; font-size: 12px; min-width: 0; }
.time-cd.blank { background: #f7f3e8; }
.time-cd-h { display: flex; align-items: center; gap: 5px; min-width: 0; }
.time-cd-h b { font-family: var(--ui-serif); font-size: 16px; }
.time-cd-h i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.time-cd-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-cd .tag { align-self: flex-start; }
.time-cd-x { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.time-cd-n { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--ui-ink-2); }
.time-cd.today { box-shadow: inset 0 0 0 2px var(--ui-gold-2); }
.time-cd.st-present { border-inline-start-color: var(--ui-ok); }
.time-cd.st-late { border-inline-start-color: #c08a2e; }
.time-cd.st-absent { border-inline-start-color: var(--ui-bad); background: #fdf4f2; }
.time-cd.st-leave, .time-cd.st-mission, .time-cd.st-remote { border-inline-start-color: var(--ui-gold-2); background: #fbf8ef; }
.time-cd.st-rest, .time-cd.st-holiday { background: repeating-linear-gradient(45deg, #f4efe1, #f4efe1 4px, #fbf8ef 4px, #fbf8ef 8px); }
.time-cd.st-off, .time-cd.st-untracked { opacity: .55; }

/* the roster */
.time-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 12px; margin-bottom: 10px; }
.time-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.time-chip { display: inline-block; background: var(--c, #bdb797); color: var(--i, #26231f); border: 1px solid var(--c, #bdb797); border-radius: 6px; padding: 2px 7px; font-size: 11.5px; line-height: 1.5; white-space: nowrap; }
.time-chip.faint { background: #fffdf8; color: var(--ui-ink-2); border-style: dashed; }
.time-chip.rest { background: #efe9da; color: var(--ui-muted); border-color: #e3dccb; }
.time-chip.lv { background: #6d6641; color: #fff; border-color: #6d6641; }
table.time-roster { border-collapse: collapse; width: 100%; font-size: 12px; background: var(--ui-card); }
table.time-roster th, table.time-roster td { border: 1px solid #efe9da; padding: 0; text-align: center; }
table.time-roster thead th { background: #26231f; color: #f3ecda; font-weight: 500; padding: 7px 4px; line-height: 1.3; }
table.time-roster thead th small { color: var(--ui-gold); font-size: 10.5px; }
table.time-roster thead th.off { background: #3a352e; color: #a9a283; }
table.time-roster thead th.today { box-shadow: inset 0 -3px 0 var(--ui-gold); }
table.time-roster tbody th { text-align: start; padding: 6px 10px; white-space: nowrap; background: #fffdf8; font-weight: 500; position: sticky; inset-inline-start: 0; z-index: 1; }
table.time-roster thead th:first-child { position: sticky; inset-inline-start: 0; z-index: 2; }
td.time-rc button { width: 100%; min-height: 54px; border: 0; background: none; cursor: pointer; padding: 5px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; }
td.time-rc button:hover { background: #faf5e6; }
td.time-rc small { font-size: 10.5px; color: var(--ui-ink-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.time-rc.k-rest, td.time-rc.k-holiday { background: repeating-linear-gradient(45deg, #f7f3e8, #f7f3e8 4px, #fffdf8 4px, #fffdf8 8px); }
td.time-rc.today { box-shadow: inset 0 0 0 2px var(--ui-gold); }
td.time-rc.off { background: #f1ede3; }
table.time-roster.compact td.time-rc button { min-height: 34px; padding: 3px 1px; }
table.time-roster.compact .time-chip { padding: 1px 5px; min-width: 20px; }
table.time-roster.compact thead th { min-width: 30px; padding: 5px 1px; font-size: 11px; }
.time-mark { font-style: normal; color: var(--ui-gold-2); line-height: .6; }
.time-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; max-height: 190px; overflow: auto; border: 1px solid var(--ui-line); border-radius: 8px; padding: 8px 10px; background: #fff; }
table.time-shifts input[type=color] { width: 44px; height: 32px; padding: 2px; }
table.time-shifts input[type=number] { width: 90px; }
table.time-shifts td.c { text-align: center; }
table.time-shifts input[type=radio] { width: 16px; height: 16px; accent-color: var(--ui-ink); }

/* imports and rules */
table.time-cols { max-width: 520px; margin-bottom: 12px; }
.time-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--ui-line); border-radius: 10px; }
.time-scroll table.grid th { position: sticky; top: 0; }
table.time-sites input { min-width: 90px; }
table.time-sites td:first-child { min-width: 220px; }

/* the dashboard card */
.time-wfigs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--ui-line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.time-wfigs a { background: #fbf8ef; padding: 9px 6px; text-align: center; display: flex; flex-direction: column; text-decoration: none; }
.time-wfigs b { font-family: var(--ui-serif); font-size: 21px; line-height: 1.1; }
.time-wfigs span { font-size: 11px; color: var(--ui-ink-2); }
.time-wfigs a.ok b { color: var(--ui-ok); }
.time-wfigs a.warn { background: var(--ui-warn-bg); }
.time-wfigs a.warn b { color: var(--ui-warn); }
.time-wfigs a.bad { background: var(--ui-bad-bg); }
.time-wfigs a.bad b { color: var(--ui-bad); }
.time-wh { margin-top: 8px; }

/* the kiosk: the office computer, the whole screen, black and gold */
body.time-kiosk-on { overflow: hidden; }
.time-kiosk { position: fixed; inset: 0; z-index: 90; background: radial-gradient(ellipse at top, #34302a 0%, #26231f 55%, #1b1916 100%); color: #f4eedc; display: flex; flex-direction: column; font-family: var(--ui-font); user-select: none; }
.time-kiosk header { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid #3a352e; }
.time-kiosk header img { height: 44px; }
.time-kiosk header b { display: block; font-family: var(--ui-serif); font-size: 22px; color: #f6f1e3; }
.time-kiosk header small { color: var(--ui-gold); font-size: 12px; letter-spacing: .06em; }
.time-kiosk header .grow { flex: 1; }
.time-kiosk header button, .time-kiosk header a { background: none; border: 1px solid #4a443a; color: #d9d3c3; border-radius: 8px; padding: 7px 14px; font-size: 13px; text-decoration: none; cursor: pointer; font-family: inherit; }
.time-kiosk header button:hover, .time-kiosk header a:hover { border-color: var(--ui-gold); color: #fff; }
.time-k-main { flex: 1; display: grid; grid-template-columns: 1fr minmax(360px, 460px); gap: 40px; align-items: center; padding: 24px 56px; min-height: 0; }
.time-k-clock { display: flex; flex-direction: column; gap: 10px; }
.time-k-clock b { font-family: var(--ui-serif); font-size: clamp(64px, 11vw, 150px); line-height: 1; color: #f6f1e3; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.time-k-clock span { font-size: clamp(18px, 2.2vw, 28px); color: var(--ui-gold); }
.time-k-pad, .time-k-done { background: rgba(255, 253, 248, .04); border: 1px solid #3a352e; border-radius: 20px; padding: 22px; }
.time-k-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.time-k-fields button { background: #1b1916; border: 1px solid #3a352e; border-radius: 12px; padding: 10px 14px; text-align: start; color: #f4eedc; cursor: pointer; font-family: inherit; min-height: 74px; }
.time-k-fields button span { display: block; font-size: 12.5px; color: #a9a283; }
.time-k-fields button b { display: block; font-size: 30px; letter-spacing: .08em; min-height: 40px; font-variant-numeric: tabular-nums; }
.time-k-fields button.on { border-color: var(--ui-gold); box-shadow: 0 0 0 3px rgba(189, 183, 151, .25); }
.time-k-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-k-keys button { height: 66px; border-radius: 14px; border: 1px solid #3a352e; background: #fffdf8; color: #26231f; font-size: 28px; font-family: var(--ui-serif); cursor: pointer; }
.time-k-keys button:active { transform: scale(.97); background: var(--ui-cream); }
.time-k-keys button[data-k=back], .time-k-keys button[data-k=next] { background: #3a352e; color: #f4eedc; font-family: var(--ui-font); font-size: 18px; }
.time-k-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.time-k-acts button { height: 78px; border-radius: 16px; font-size: 28px; font-weight: 700; cursor: pointer; font-family: var(--ui-font); border: 0; }
.time-k-acts .in { background: var(--ui-gold); color: #1d1b17; }
.time-k-acts .out { background: #f4eedc; color: #26231f; }
.time-k-acts button:active { transform: scale(.98); }
.time-k-msg { margin-top: 14px; min-height: 22px; font-size: 15px; color: #d9d3c3; text-align: center; line-height: 1.6; }
.time-k-msg.bad { color: #f0b3a8; }
.time-k-done { text-align: center; padding: 34px 24px; }
.time-k-done .mark { width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 46px; background: var(--ui-gold); color: #1d1b17; }
.time-k-done.out .mark { background: #f4eedc; }
.time-k-done.warn .mark { background: #c08a2e; color: #fff; }
.time-k-done .who { font-family: var(--ui-serif); font-size: 30px; margin: 4px 0; color: #f6f1e3; }
.time-k-done .what { font-size: 20px; color: var(--ui-gold); margin: 4px 0; line-height: 1.6; }
.time-k-done .at { font-family: var(--ui-serif); font-size: 72px; line-height: 1.1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.time-k-done .day { color: #a9a283; font-size: 15px; margin: 0; }
.time-k-done .warn { color: #f0c98a; font-size: 15px; margin: 10px 0 0; }
@media (max-width: 900px) {
  .time-k-main { grid-template-columns: 1fr; padding: 16px; gap: 16px; overflow-y: auto; }
  .time-k-clock { text-align: center; }
  .time-kiosk header { padding: 12px 16px; }
  .time-cal-b, .time-cal-h { grid-template-columns: repeat(7, minmax(44px, 1fr)); }
  .time-cd { min-height: 70px; padding: 4px; }
  .time-cd-x, .time-cd-n, .time-cd-h span { display: none; }
  .time-wfigs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .time-wfigs a { padding: 8px 2px; }
  .time-wfigs span { font-size: 10.5px; line-height: 1.25; }
}
@media print { .time-kiosk { display: none !important; } }

/* ---------------------------------------------------------------- 2026-10-24: both screens, desktop and phone */
.time-nav { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.time-nav input[type=date] { width: auto; }
table.time-day td:nth-child(2) { white-space: nowrap; }
.time-sn { white-space: nowrap; }
/* The month's figures: nine in a 3 × 3 block, never one alone beside an empty one. */
.time-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.time-sum:has(> div:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.time-cal-h .time-ds { display: none; }
.time-cal-h b { font-weight: 500; }
.time-cal-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-cd.blank { background: #f7f3e8; }
.time-cd.today { box-shadow: inset 0 0 0 2px var(--ui-gold-2); }
.time-st { display: inline-flex; max-width: 100%; }
.time-st .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The kiosk: the number box spans the keypad when there is no PIN box beside it; the header keeps one line. */
.time-k-fields.one { grid-template-columns: 1fr; }
.time-kiosk header .k-short { display: none; }
.time-kiosk header button, .time-kiosk header a { white-space: nowrap; }
.time-k-brand { min-width: 0; }
.time-k-brand b, .time-k-brand small { white-space: nowrap; }
.time-k-keys { direction: ltr; }
@media (max-width: 760px) {
  .time-nav { flex-wrap: wrap; }
  .list-tools .time-nav { flex: 1 1 100%; }
  /* The calendar on a phone: short day names, and each day's state as a coloured mark instead of a word. */
  .time-cal-h { font-size: 11px; }
  .time-cal-h span { padding: 6px 2px; text-align: center; }
  .time-cal-h .time-dl { display: none; }
  .time-cal-h .time-ds { display: inline; }
  .time-cal-b, .time-cal-h { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
  .time-cd { min-height: 52px !important; padding: 4px 3px !important; align-items: center; overflow: hidden; border-inline-start-width: 0; }
  .time-cd-h { justify-content: center; }
  .time-cd-h b { font-size: 14px; }
  .time-cd-h i { display: none; }
  .time-st { width: 10px; height: 10px; border-radius: 50%; overflow: hidden; background: #d8d0b8; margin-top: 2px; }
  .time-st .tag, .time-st.small { display: none; }
  .time-cd.st-present .time-st { background: var(--ui-ok); }
  .time-cd.st-late .time-st { background: #c08a2e; }
  .time-cd.st-absent .time-st { background: var(--ui-bad); }
  .time-cd:is(.st-leave, .st-mission, .st-remote) .time-st { background: var(--ui-gold-2); }
  .time-cd:is(.st-rest, .st-holiday) .time-st { background: transparent; box-shadow: inset 0 0 0 1.5px #b5ad91; }
  .time-cd:is(.st-scheduled, .st-expected) .time-st { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ui-gold-2); }
  .time-cd:is(.st-off, .st-untracked) .time-st { background: #e3dccb; }
  .time-calnav { justify-content: space-between; }
  .time-calnav .time-nl { display: none; }
  .time-calnav .btn { min-width: 40px; justify-content: center; }
  .time-sum b { font-size: 18px; }
  .time-sum > div { padding: 9px 10px; }
  /* The kiosk on a phone: the keypad on the first screen, the brand and the way out on one line. */
  .time-k-main { align-content: start; }
  .time-k-clock b { font-size: 56px; }
  .time-kiosk header img { height: 30px; }
  .time-kiosk header b { font-size: 16px; }
  .time-kiosk header small { display: none; }
  .time-kiosk header #k-full { display: none; }
  .time-kiosk header .k-long { display: none; }
  .time-kiosk header .k-short { display: inline; }
  .time-k-pad, .time-k-done { padding: 16px; }
  .time-k-keys button { height: 58px; }
  .time-k-acts button { height: 66px; font-size: 24px; }
}
.time-k-msg { text-wrap: balance; }

/* ---------------------------------------------------------------- second review, 2026-10-24 */
/* A status keeps its pill on one line. */
table.time-day td .tag, table.time-month td .tag { white-space: nowrap; }
/* The day's controls stand at one height: the arrows, the date and the button beside them. */
.time-nav .df-box, .time-nav input[type=date], .time-nav select { height: 32px; padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
.time-nav .df-box { min-width: 8.5em; }
.list-tools .time-nav ~ .btn.small, .time-nav .btn.small { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; }
.time-figs span { text-wrap: balance; }
/* The keypad speaks in one face: the digits in the same sans as «Next» and the two buttons, in even columns. */
.time-k-keys button { font-family: var(--ui-font); font-variant-numeric: tabular-nums; font-weight: 500; }
/* The calendar's key: on a phone the days are marks, and the key says what each mark is. */
.time-key { display: none; }
@media (max-width: 760px) {
  /* One row on a phone: the arrows (their words hidden), the date between them. */
  .time-nav { flex-wrap: nowrap; }
  .time-nav .time-nl { display: none; }
  .time-nav .btn { flex: none; min-width: 40px; justify-content: center; }
  .time-nav > :not(.btn) { flex: 1 1 auto; min-width: 0; }
  .time-nav .df-wrap { display: flex; }
  .time-nav .df-box, .time-nav select { width: 100%; min-width: 0; }
  .time-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--ui-ink-2); }
  .time-key span { display: inline-flex; align-items: center; gap: 6px; }
  .time-key i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #d8d0b8; }
  .time-key i.k-present { background: var(--ui-ok); }
  .time-key i.k-late { background: #c08a2e; }
  .time-key i.k-absent { background: var(--ui-bad); }
  .time-key i.k-leave { background: var(--ui-gold-2); }
  .time-key i.k-rest { background: transparent; box-shadow: inset 0 0 0 1.5px #b5ad91; }
  .time-key i.k-scheduled { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ui-gold-2); }
  .time-key i.k-off { background: #e3dccb; }
  /* The attendance tab's two buttons stand together on their own row under the heading. */
  .time-tabh > .grow { display: none; }
  .time-tabb { display: flex; gap: 8px; flex: 1 1 100%; }
  .time-tabb .btn { flex: 1 1 0; justify-content: center; }
}
.time-tabb { display: inline-flex; gap: 6px; }
@media (max-width: 760px) { .time-cd .time-st.small { display: inline-flex; font-size: 0; } }
/* On a phone the day sheet scrolls sideways anyway: the employee's name keeps a readable width. */
@media (max-width: 760px) { table.time-day td:first-child { min-width: 170px; } }
@media (max-width: 760px) {
  #view table.time-day td:first-child { min-width: 170px; }
  #view .time-nav .btn { min-width: 40px; }
}

/* ---------------------------------------------------------------- third review, 2026-10-24 */
/* The day sheet on a phone: each employee is a card (name, status and punches, shift, then the figures two by two,
   each under its own name, and «Correct day» at the foot) instead of a table that ran off the screen. */
.time-l { display: none; }
@media (max-width: 760px) {
  #view .hrm .time-wrap:has(> table.time-day) { overflow: visible; -webkit-mask-image: none; mask-image: none; padding: 0 14px; }
  #view .hrm table.time-day, #view .hrm table.time-day tbody { display: block; width: 100%; }
  #view .hrm table.time-day thead { display: none; }
  #view .hrm table.time-day tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--ui-line); }
  #view .hrm table.time-day tr:last-child { border-bottom: 0; }
  #view .hrm table.time-day td { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; }
  #view .hrm table.time-day td:first-child, #view .hrm table.time-day td.time-c-st, #view .hrm table.time-day td.time-c-shift, #view .hrm table.time-day td.time-c-fix { grid-column: 1 / -1; min-width: 0; }
  #view .hrm table.time-day td.time-c-fix .btn { width: 100%; justify-content: center; }
  #view .hrm table.time-day .time-l { display: block; font-size: 11.5px; color: var(--ui-muted); margin-bottom: 1px; }
}
@media (max-width: 760px) { #view .hrm table.time-day td.time-nil { display: none; } }
@media (max-width: 760px) { #view .hrm table.time-day td:first-child .hrm-emp { flex-direction: column; align-items: flex-start; } }
