/* ===========================================================================
   ABC Corp HR Platform.

   One light world, taken from the logo artwork and nothing else: the near-black
   the wordmark is set in, the grey of the tower strokes, and the teal of the
   star. Light is chosen from the use scene, not from habit - this is read at a
   desk under office light, and on a phone outdoors at a site at 10am, where a
   dark interface is the harder one to read.

   The shell is a fixed rail on the left and a content column beside it. The rail
   holds the identity and the whole of the navigation, so the content column is
   free to be only content, and a page's own heading never competes with a row
   of tabs above it.
   =========================================================================== */

:root {
  /* --- taken from the artwork ------------------------------------------- */
  --ink: #0c0c0d;           /* the wordmark's black */
  --ink-2: #26282c;         /* headings on light, one step back from the mark */
  --rule-grey: #9a9b9f;     /* the tower strokes beside the C */
  --teal: #3fa0a9;          /* the star */
  --teal-deep: #1f5b61;     /* teal dark enough for text on white (7.2:1) */
  --teal-bright: #6ad3dd;
  --teal-tint: #eef7f8;
  --teal-line: #cbe6e9;

  /* --- surfaces ---------------------------------------------------------- */
  --canvas: #f4f5f7;        /* the page behind the cards */
  --surface: #ffffff;       /* cards, the rail */
  --surface-2: #fafbfc;     /* table heads, inset panels */
  --line: #e5e7eb;
  --line-soft: #f0f1f4;

  /* --- text -------------------------------------------------------------- */
  --muted: #62666e;         /* 6.4:1 on white */
  /* Lifted from #8a8f98, which only reached 3.25:1. The floor for body and
     placeholder text is 4.5:1, and this carries both - the rail's group
     labels and every input placeholder in the app. */
  --muted-2: #6b7078;       /* 4.98:1 on white */

  /* --- status ------------------------------------------------------------ */
  --ok: #0f6b50;
  --ok-bg: #e6f5ef;
  --ok-line: #bfe3d4;
  --warn: #8a5406;
  --warn-bg: #fdf4e3;
  --warn-line: #f0dcb4;
  --bad: #a52019;
  --bad-bg: #fdeceb;
  --bad-line: #f3c9c6;
  --info: var(--teal-deep);
  --info-bg: var(--teal-tint);
  --info-line: var(--teal-line);

  /* --- geometry ---------------------------------------------------------- */
  --rail: 244px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Offset and blur, never a zero-offset halo: these read as a card lifted a
     millimetre off the canvas, which is all the depth this interface needs. */
  --shadow-sm: 0 1px 2px rgba(12, 12, 13, .04), 0 1px 3px rgba(12, 12, 13, .05);
  --shadow: 0 1px 2px rgba(12, 12, 13, .04), 0 8px 24px -8px rgba(12, 12, 13, .12);
  --shadow-lg: 0 2px 4px rgba(12, 12, 13, .05), 0 24px 56px -16px rgba(12, 12, 13, .22);

  /* Legacy names, kept so older rules keep resolving to the one palette. */
  --navy: var(--ink);
  --navy-700: var(--ink-2);
  --navy-50: var(--teal-tint);
  --gold: var(--teal);
  --gold-soft: var(--teal-tint);
  --card: var(--surface);
  --bg: var(--canvas);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 .5rem;
  line-height: 1.18;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.012em;
  color: var(--ink);
}
h1 { font-size: 1.75rem; font-weight: 400; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .92rem; }
p { margin: 0 0 .7rem; }

a { color: var(--teal-deep); }
a:hover { color: var(--ink); }

/* ===========================================================================
   Shell
   =========================================================================== */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

/* --------------------------------------------------------------- the rail */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.rail-head { padding: 1.4rem 1.25rem 1.1rem; }
.rail-head a { display: block; text-decoration: none; }
.rail-head img { width: 118px; height: auto; display: block; }
.rail-head .sub {
  margin-top: .55rem;
  font-family: var(--display);
  font-size: .6rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal-deep);
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: .3rem .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* A section label inside the rail names a group of destinations. It is not a
   kicker: nothing follows it that could have carried the name itself. */
.rail-group {
  font-family: var(--display);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted-2);
  padding: 1.1rem .75rem .35rem;
}
.rail-group:first-child { padding-top: .2rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .56rem .75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: .9rem;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background-color .14s ease, color .14s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item:hover { background: var(--line-soft); color: var(--ink); }

.nav-item.active {
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-weight: 600;
}
/* The star is the only saturated thing in the logo, so the only saturated mark
   in the interface is the one that says where you are. */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -.75rem;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--teal);
}
.nav-item .count {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  padding: .05rem .4rem;
}

.rail-foot {
  border-top: 1px solid var(--line);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.rail-foot .avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  font-family: var(--display); font-size: .78rem; font-weight: 500; letter-spacing: .04em;
}
.rail-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.rail-foot .who b { display: block; font-size: .84rem; color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot .who span { font-size: .72rem; color: var(--muted); }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  cursor: pointer; flex: none;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: #d4d7dd; }
/* Signing out is the one destructive control in the chrome, so it is the one
   that warns on hover. The menu toggle beside it must not. */
#logoutBtn:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* ------------------------------------------------------- the content column */
.content { min-width: 0; display: flex; flex-direction: column; }

/* Phone chrome. Hidden on a desktop, where the rail is always present. */
.topbar {
  display: none;
  align-items: center;
  gap: .6rem;
  padding: .55rem .8rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar img { height: 30px; width: auto; }
.topbar .spacer { flex: 1; }

main { padding: 1.6rem 1.75rem 3rem; max-width: 1400px; width: 100%; }

.page { display: none; }
.page.active { display: block; }

/* More space above a heading than below it, so a section reads as beginning
   rather than as floating between two equal gaps. */
.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .lede { color: var(--muted); font-size: .92rem; max-width: 68ch; margin: 0; }

/* The scrim behind the rail when it opens as a drawer on a phone. */
.rail-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(12, 12, 13, .42);
  z-index: 35;
}
.rail-scrim.open { display: block; }

/* ===========================================================================
   Cards and sections
   =========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card > h2, .card > h3 { display: flex; align-items: center; gap: .5rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head .spacer { flex: 1; }
.card-head h2, .card-head h3 { margin: 0; }

.subtle { color: var(--muted); font-size: .86rem; }

.grid { display: grid; gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* 142px rather than a rounder number: it is the largest minimum at which the
   six-stat attendance strip still fits one row beside the rail on a laptop.
   Wider and the sixth wraps alone, which reads as a mistake. */
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem .95rem;
  box-shadow: var(--shadow-sm);
}
/* The same strip appears inside the employee card, where the container is
   narrower; without this the sixth stat wraps onto a row of its own. */
.modal .grid.stats { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.modal .stat .value { font-size: 1.6rem; }

.stat .label {
  font-family: var(--display); font-size: .63rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); font-weight: 600;
}
.stat .value {
  font-family: var(--display); font-size: 1.95rem; font-weight: 300;
  line-height: 1.12; letter-spacing: -.02em; color: var(--ink);
  font-variant-numeric: tabular-nums; margin: .15rem 0 .1rem;
}
.stat .foot { font-size: .76rem; color: var(--muted); }
.stat.ok .value { color: var(--ok); }
.stat.bad .value { color: var(--bad); }
.stat.warn .value { color: var(--warn); }
/* For a stat whose value is a name rather than a figure. */
.stat.text .value { font-size: 1.02rem; font-weight: 500; line-height: 1.32; padding: .2rem 0; }

/* ===========================================================================
   Punch panel
   =========================================================================== */

.punch-panel { text-align: center; padding: 1.9rem 1.2rem 1.5rem; }
.punch-date { color: var(--muted); margin-bottom: .3rem; font-size: .9rem; }
.punch-clock {
  font-family: var(--display); font-size: 3.6rem; font-weight: 200;
  line-height: 1; letter-spacing: -.03em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.day-banner {
  display: inline-block; margin: .7rem 0 1.1rem;
  background: var(--teal-tint); border: 1px solid var(--teal-line); color: var(--teal-deep);
  border-radius: 999px; padding: .25rem .85rem; font-size: .8rem; font-weight: 500;
}
.punch-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.punch-btn {
  min-width: 190px; padding: .95rem 1.4rem;
  border: 0; border-radius: var(--radius);
  font-family: var(--display); font-size: .92rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: #fff; cursor: pointer;
  transition: translate .16s cubic-bezier(.2, .8, .3, 1), box-shadow .16s ease, filter .16s ease;
}
.punch-btn.in { background: var(--ink); box-shadow: 0 2px 4px rgba(12,12,13,.12), 0 12px 24px -10px rgba(12,12,13,.5); }
.punch-btn.out { background: var(--bad); box-shadow: 0 2px 4px rgba(165,32,25,.12), 0 12px 24px -10px rgba(165,32,25,.5); }
.punch-btn:not(:disabled):hover { translate: 0 -2px; filter: brightness(1.08); }
.punch-btn:not(:disabled):active { translate: 0 0; }
.punch-btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; box-shadow: none; }

.punch-meta {
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft);
}
.punch-meta div { text-align: center; }
.punch-meta .k {
  font-family: var(--display); font-size: .62rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); font-weight: 600;
}
.punch-meta .v { font-weight: 600; font-size: 1.02rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ===========================================================================
   Forms
   =========================================================================== */

label {
  display: block; margin-bottom: .28rem;
  font-size: .76rem; font-weight: 600; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
}
label .req { color: var(--bad); }
label .subtle { text-transform: none; letter-spacing: 0; font-weight: 400; }

input, select, textarea {
  width: 100%;
  padding: .52rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:hover, select:hover, textarea:hover { border-color: #d4d7dd; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(63, 160, 169, .16);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 86px; resize: vertical; }
input[type=file] { padding: .38rem .5rem; font-size: .85rem; }
input[type=file]::file-selector-button {
  font: inherit; font-size: .8rem; font-weight: 600;
  margin-right: .6rem; padding: .3rem .6rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); color: var(--ink); cursor: pointer;
}

.field { margin-bottom: .85rem; }
.row { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
legend { font-family: var(--display); font-size: 1rem; font-weight: 500; color: var(--ink); padding: 0 0 .5rem; }
.check { display: flex; align-items: center; gap: .45rem; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 500; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: .88rem; }

/* ===========================================================================
   Buttons
   =========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease, translate .14s ease;
}
.btn:hover { background: #26282c; color: #fff; }
.btn:active { translate: 0 1px; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: #d4d7dd; }
.btn.gold { background: var(--teal); color: #062326; }
.btn.gold:hover { background: var(--teal-bright); color: #062326; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #8c1a14; }
.btn.ghost.danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn.ghost.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: .3rem .6rem; font-size: .79rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ===========================================================================
   Tables
   =========================================================================== */

.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.card .table-wrap { border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: var(--surface-2);
  font-family: var(--display);
  font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
  position: sticky; top: 0; z-index: 1;
}
th, td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--teal-tint); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }

/* ===========================================================================
   Badges, chips, alerts
   =========================================================================== */

.badge {
  display: inline-flex; align-items: center;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .7rem; font-weight: 600; letter-spacing: .03em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.PRESENT, .badge.APPROVED, .badge.COMPLETED, .badge.ACTIVE, .badge.ok {
  background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge.ABSENT, .badge.REJECTED, .badge.BLOCKED, .badge.INACTIVE, .badge.bad {
  background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge.LATE, .badge.HALF_DAY, .badge.MISSING_PUNCH_OUT, .badge.PENDING, .badge.IN_PROGRESS, .badge.warn {
  background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.WEEKLY_OFF, .badge.HOLIDAY, .badge.ON_LEAVE, .badge.PLANNED, .badge.info {
  background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge.YET_TO_PUNCH_IN { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.UPCOMING { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge.LOCKED { background: var(--ink); color: #fff; }
.badge.DRAFT { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.chip {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px; padding: .16rem .6rem;
  font-size: .72rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: .32rem;
}
.chip svg { width: 13px; height: 13px; flex: none; opacity: .75; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .45rem; }

/* A chip that does something. It keeps the chip's shape so a list of them
   still reads as a set, and earns a pointer and a hover so it does not look
   like a label you cannot press. */
.chip-btn {
  font: inherit; font-size: .72rem; font-weight: 500; cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.chip-btn:hover { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

.alert {
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  margin-bottom: .85rem;
  font-size: .87rem;
  border: 1px solid;
}
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.alert.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.alert:empty { display: none; }

.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; font-size: .89rem; }

/* ===========================================================================
   Lists
   =========================================================================== */

.list-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .9rem; margin-bottom: .55rem; background: var(--surface);
  transition: border-color .14s ease;
}
.list-item:hover { border-color: #d4d7dd; }
.list-item .li-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.list-item .li-head .spacer { flex: 1; }
.list-item .li-body { font-size: .87rem; color: var(--muted); margin-top: .35rem; white-space: pre-wrap; }

.credential-box {
  background: var(--teal-tint); border: 1px dashed var(--teal);
  border-radius: var(--radius); padding: .9rem;
  font-family: "Consolas", ui-monospace, monospace;
  color: var(--ink);
}
.credential-box b { font-size: 1.1rem; }

.copy-link { display: flex; gap: .4rem; }
.copy-link input { font-family: "Consolas", ui-monospace, monospace; font-size: .78rem; }

/* ===========================================================================
   Employee card
   =========================================================================== */

/* The Employee ID in the directory is the way into the full record, so it has
   to read as something you can press. */
.link-id {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--teal-deep);
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .22em; letter-spacing: .02em;
}
.link-id:hover { color: var(--ink); text-decoration-thickness: 2px; }

.card-hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.card-avatar {
  width: 62px; height: 62px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  font-family: var(--display); font-size: 1.35rem; font-weight: 400; letter-spacing: .05em;
}
.card-name { font-family: var(--display); font-size: 1.5rem; font-weight: 500; line-height: 1.15; color: var(--ink); }

.card-block { margin-top: 1.3rem; }
.card-block h4 {
  font-family: var(--display); font-size: .64rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .18em; color: var(--muted);
  margin: 0 0 .55rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
.card-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .45rem 1.5rem; }
.card-field { font-size: .88rem; display: flex; gap: .5rem; align-items: baseline; }
.card-field > span { color: var(--muted); flex: none; min-width: 124px; }
.card-field > b { word-break: break-word; color: var(--ink); font-weight: 600; }
.card-address { font-size: .88rem; margin-bottom: .5rem; }
.card-address > span { color: var(--muted); display: block; font-size: .76rem; }

/* A task line in the daily-reports view carries a Delete button. */
.rep-task { font-size: .86rem; padding: .45rem 0; border-top: 1px solid var(--line-soft); }
.rep-task .li-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.rep-task .li-head .spacer { flex: 1; }

/* ===========================================================================
   Modals
   =========================================================================== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12, 12, 13, .45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 1rem; z-index: 60; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg);
  margin: 2rem 0;
  animation: modal-in .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modal-in { from { translate: 0 8px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal header { padding: .95rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; }
.modal header h2 { margin: 0; }
.modal header .spacer { flex: 1; }
.modal .body { padding: 1.1rem; }
.modal footer { padding: .9rem 1.1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.modal .x { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0 .2rem; }
.modal .x:hover { color: var(--ink); }

/* ===========================================================================
   Sign-in and the public joining form
   =========================================================================== */

.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(760px 420px at 50% -8%, var(--teal-tint), transparent 72%),
    var(--canvas);
}
.auth-card {
  width: 100%; max-width: 392px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.1rem 1.75rem 1.6rem;
  box-shadow: var(--shadow);
}
.auth-card .logo { text-align: center; margin-bottom: 1.8rem; }
.auth-card .logo img { width: 150px; height: auto; }
.auth-card .logo .sub { margin-top: .7rem; }
.auth-card .btn { width: 100%; padding: .72rem; font-size: .84rem; letter-spacing: .12em; text-transform: uppercase; }
.auth-foot { text-align: center; margin: 1.2rem 0 0; color: var(--muted); font-size: .82rem; }

.public-wrap { max-width: 820px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.public-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 2rem 1rem 1.7rem;
  text-align: center;
}
.public-head img { width: 168px; height: auto; }

/* ===========================================================================
   Salary slip
   =========================================================================== */

.slip { background: var(--surface); max-width: 820px; margin: 1.25rem auto; padding: 1.7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: .9rem; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.slip-head .co { font-family: var(--display); font-size: 1.35rem; font-weight: 500; color: var(--ink); }
.slip-title { text-align: center; font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin-bottom: 1rem; font-size: .76rem; }
.slip table { font-size: .85rem; }
.slip .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .4rem 1.2rem; margin-bottom: 1rem; font-size: .86rem; }
.slip .kv div span { color: var(--muted); display: inline-block; min-width: 108px; }
.slip .net { background: var(--ink); color: #fff; padding: .85rem 1rem; border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: 1rem; flex-wrap: wrap; }
.slip .net .amt { font-family: var(--display); font-size: 1.6rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.slip .words { font-size: .82rem; color: var(--muted); margin-top: .5rem; font-style: italic; }
.slip-foot { margin-top: 1.5rem; font-size: .74rem; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: .8rem; }

/* The report reminder. It sits above the page content rather than inside a
   card, because it is about the whole app rather than about what you are
   looking at. */
.alert.reminder {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem .9rem;
}
.alert.reminder b { font-weight: 700; }
.alert.reminder .btn { margin-left: auto; }
/* Named colours rather than currentColor: inside the button currentColor is
   the button's own text colour, so a solid fill built from it paints the
   background and the label the same shade. */
.alert.warn .btn.sm { background: var(--warn); color: #fff; border-color: transparent; }
.alert.warn .btn.sm:hover { background: #6f4305; color: #fff; }
.alert.bad .btn.sm { background: var(--bad); color: #fff; border-color: transparent; }
.alert.bad .btn.sm:hover { background: #8c1a14; color: #fff; }
.alert.reminder .btn.ghost.sm { background: transparent; color: inherit; border-color: currentColor; }
.alert.reminder .btn.ghost.sm:hover { background: rgba(0, 0, 0, .06); color: inherit; }
.alert.reminder .subtle { color: inherit; opacity: .8; }

/* The salary slip stands on its own page, with a slim bar that does not print. */
.slip-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .7rem 1.1rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.slip-bar .spacer { flex: 1; }
.slip-bar img { display: block; height: auto; }

/* The HR policy PDF viewer. */
#policyViewer { max-height: 78vh; }
.pdf-fallback { text-align: center; padding: 2.5rem 1rem; }
.pdf-fallback p { color: var(--muted); font-size: .9rem; margin: 0 0 .9rem; }

/* ===========================================================================
   Adaptation
   =========================================================================== */

@media print {
  .no-print, .rail, .topbar, .rail-scrim { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  main { padding: 0; }
  .slip { border: 0; box-shadow: none; margin: 0; max-width: none; }
}

/* Below this the rail costs more room than it earns, so it becomes a drawer
   and the identity moves into a slim bar at the top. */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(282px, 84vw);
    translate: -100% 0;
    transition: translate .22s cubic-bezier(.2, .8, .3, 1);
    box-shadow: var(--shadow-lg);
  }
  .rail.open { translate: 0 0; }
  main { padding: 1.1rem .9rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rail { transition: none; }
  * { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .punch-clock { font-size: 2.9rem; }
  .punch-btn { min-width: 100%; }
  .grid.stats { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }
  .stat .value { font-size: 1.6rem; }
  th, td { padding: .5rem .55rem; }
  .card { padding: 1rem; }
  .card-fields { grid-template-columns: 1fr; }
  .card-field > span { min-width: 104px; }
  #policyViewer { height: 60vh; }
  .modal { margin: .5rem 0; }
}
