/* HRIS — one stylesheet for the HR console and the staff portal. No build step needed. */
:root {
  --ink: #1f1d1e;
  --ink-2: #4a4647;
  --ink-3: #777273;
  --line: #e4e0df;
  --line-2: #efecea;
  --paper: #f5f3f2;
  --card: #ffffff;
  /* Brand: the logo's red and charcoal. Red is for main actions and highlights only. */
  --brand: #c8161d;
  --brand-2: #a11117;
  --brand-soft: #fbeaea;
  --char: #2b2829;
  --char-2: #1d1b1c;
  --brand-ink: #f1edee;
  --link: #a8151b;
  --accent: #d9902a;
  --blur: 18px;
  --ok: #1f7a4d;
  --ok-bg: #e5f3ea;
  --warn: #9a5b06;
  --warn-bg: #fdf1dc;
  --bad: #a23b3b;
  --bad-bg: #fbe8e6;
  --info: #255d9c;
  --info-bg: #e6eef8;
  --muted-bg: #efeee9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 30, .06), 0 2px 8px rgba(20, 30, 30, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 40px; }
.btn:hover { text-decoration: none; background: #fafaf7; border-color: #d4d1c8; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(200, 22, 29, .32); outline-offset: 1px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { color: var(--bad); border-color: #e7c3bf; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #17623d; }
.btn-sm { padding: .3rem .65rem; min-height: 32px; font-size: .85rem; }
.btn-lg { padding: .9rem 1.4rem; min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.btn-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--link); font-weight: 600; }
.btn-link:hover { background: none; text-decoration: underline; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=month], input[type=search], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #cfccc3; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); min-height: 40px; }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { padding: .4rem; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); vertical-align: -2px; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; color: var(--ink); }
.check input { margin-top: .2rem; flex: none; }
.field { margin-bottom: 1rem; }
.hint { font-size: .82rem; color: var(--ink-3); margin-top: .25rem; }
.error-text { font-size: .84rem; color: var(--bad); margin-top: .25rem; }
.is-invalid { border-color: var(--bad) !important; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font-weight: 700; font-size: 1rem; margin-bottom: .75rem; padding: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.filters .field.wide { max-width: 340px; flex-basis: 240px; }

/* ---------- Cards, tables, badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .6rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf7; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--muted-bg); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.dl { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .88rem; }
.dl dd { margin: 0; overflow-wrap: break-word; min-width: 0; }
.tiles .dl { grid-template-columns: auto minmax(0, 1fr); }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .value { font-size: 1.7rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.stat .label { color: var(--ink-3); font-size: .85rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stats .card { margin: 0; }
.bar { height: 8px; background: var(--muted-bg); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.list li:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: none; }
.person { display: flex; gap: .65rem; align-items: center; min-width: 0; }
.person .who { min-width: 0; }
.person .who > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: #13522f; border-color: #c4e3cf; }
.alert-error { background: var(--bad-bg); color: #7d2525; border-color: #efc9c4; }
.alert-warning { background: var(--warn-bg); color: #6f4204; border-color: #f2d9ad; }
.alert-info { background: var(--info-bg); color: #1d4a7d; border-color: #c9d9ee; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.credentials { background: #fffdf3; border: 2px dashed var(--accent); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.credentials .pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 700; background: #fff; padding: .15rem .5rem; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .6rem .9rem; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pills a { padding: .35rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; font-weight: 600; }
.pills a.active { background: var(--char); color: #fff; border-color: var(--char); }
.pills a:hover { text-decoration: none; }
.pills .count { opacity: .75; font-weight: 500; margin-left: .2rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pagination a, .pagination span { padding: .35rem .7rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .88rem; }
.pagination .current { background: var(--char); color: #fff; border-color: var(--char); }
.pagination .disabled { color: var(--ink-3); }

/* =====================================================================
   HR console layout
   ===================================================================== */
.hr-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.hr-side { background: var(--char); color: var(--brand-ink); padding: 1rem .75rem 2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.hr-brand { display: block; padding: .35rem .5rem 1.1rem; color: #fff; }
.hr-brand:hover { text-decoration: none; }
.hr-brand img { display: block; width: 160px; height: auto; }
.hr-brand small { display: block; margin-top: .45rem; font-weight: 600; color: #b9b1b2; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.hr-nav { list-style: none; margin: 0; padding: 0; }
.hr-nav .group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #9a9293; padding: 1rem .6rem .35rem; font-weight: 700; }
.hr-nav a { display: flex; justify-content: space-between; align-items: center; padding: .45rem .65rem; border-radius: 7px; color: #e6e1e2; font-size: .92rem; }
.hr-nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.hr-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.hr-nav .n { background: var(--brand); color: #fff; border-radius: 99px; font-size: .72rem; font-weight: 800; padding: 0 .45rem; }
.hr-main { min-width: 0; }
.hr-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.hr-top form select { min-height: 36px; padding: .35rem .6rem; width: auto; }
.hr-top .right { display: flex; gap: .75rem; align-items: center; }
.hr-content { padding: 1.5rem; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); margin-top: .2rem; }
.bell { position: relative; display: inline-flex; padding: .35rem; border-radius: 8px; color: var(--ink-2); }
.bell .dot { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .hr-shell { grid-template-columns: 1fr; }
  .hr-side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .hr-side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-toggle { display: inline-flex; }
  .hr-content { padding: 1rem; }
  .hr-top { padding: .6rem 1rem; }
}

/* =====================================================================
   Staff portal layout (mobile first)
   ===================================================================== */
.pt-top { background: var(--char); color: #fff; }
.pt-top-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pt-top a { color: #fff; }
.pt-logo { display: flex; align-items: center; gap: .55rem; font-weight: 750; white-space: nowrap; flex-shrink: 0; }
.pt-logo img { display: block; height: 44px; width: auto; }
.pt-logo:hover { text-decoration: none; }
.pt-nav { display: flex; gap: .15rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pt-nav::-webkit-scrollbar { display: none; }
.pt-top .actions { display: flex; flex-wrap: nowrap; align-items: center; gap: .75rem; flex-shrink: 0; white-space: nowrap; }
.pt-nav a { white-space: nowrap; padding: .45rem .65rem; border-radius: 8px; color: #e9e4e5; font-weight: 600; font-size: .92rem; }
.pt-nav a.active, .pt-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.pt-nav a.active { box-shadow: inset 0 -2px 0 var(--brand); }
.pt-top .bell { color: #fff; }
.pt-main { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.pt-tabbar { display: none; }
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--char) 0%, #3a2627 55%, var(--brand-2) 100%); color: #fff; border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 1.35rem; margin-bottom: .15rem; }
.hero .meta { color: #eadcdc; font-size: .9rem; }
.clock { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 1rem; margin-top: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.clock .now { font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.clock .state { color: #eadcdc; font-size: .9rem; margin-top: .3rem; }
.clock .btn-lg { min-width: 170px; }
.btn-clock-in { background: #fff; color: var(--brand-2); border-color: #fff; }
.btn-clock-in:hover { background: #f8eeee; }
.btn-clock-out { background: var(--accent); color: #2a1a05; border-color: var(--accent); }
.btn-clock-out:hover { background: #b87420; }
.clock-msg { margin-top: .75rem; padding: .6rem .8rem; border-radius: 8px; font-size: .92rem; display: none; }
.clock-msg.ok { display: block; background: #e5f3ea; color: #13522f; }
.clock-msg.err { display: block; background: #fbe8e6; color: #7d2525; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; margin-top: .75rem; }
.week div { text-align: center; padding: .4rem .1rem; border-radius: 8px; background: rgba(255, 255, 255, .08); font-size: .75rem; color: #eadcdc; }
.week div b { display: block; color: #fff; font-size: .82rem; }
.week .today { outline: 2px solid rgba(255, 255, 255, .55); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tiles .card { margin: 0; }
.balance { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.balance:last-child { border-bottom: 0; }
.balance .big { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { text-align: center; font-size: .72rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; padding: .2rem 0; }
.cal .d { min-height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); padding: .3rem .35rem; font-size: .74rem; position: relative; }
.cal .d .n { font-weight: 700; font-size: .8rem; color: var(--ink-2); }
.cal .d .t { display: block; color: var(--ink-3); line-height: 1.25; margin-top: .1rem; }
.cal .d.present { background: #f0f8f3; border-color: #cfe8d8; }
.cal .d.late { background: #fff7e8; border-color: #f2ddb4; }
.cal .d.absent { background: #fdf0ee; border-color: #f1cfca; }
.cal .d.on_leave { background: #eef3fb; border-color: #cddcf0; }
.cal .d.holiday, .cal .d.off, .cal .d.not_employed, .cal .d.upcoming, .cal .d.exempt { background: #f7f6f2; }
.cal .d.today { outline: 2px solid var(--char); }
.cal .blank { background: transparent; border: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
@media (max-width: 960px) {
  .pt-nav { display: none; }
  .pt-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
  .pt-tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem 0 .45rem; font-size: .7rem; color: var(--ink-3); font-weight: 600; }
  .pt-tabbar a.active { color: var(--brand); }
  .pt-tabbar a.active svg { stroke-width: 2.4; }
  .pt-tabbar a:hover { text-decoration: none; }
  .pt-tabbar svg { width: 22px; height: 22px; }
}
@media (max-width: 760px) {
  .clock .btn-lg { width: 100%; }
  .cal .d { min-height: 48px; font-size: .68rem; padding: .2rem; }
  .cal .d .t { display: none; }
  .hero { border-radius: 0; margin: -1.25rem -1rem 1rem; padding: 1.25rem 1rem; }
}

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; background:
  radial-gradient(900px 520px at 0% 0%, #f3d9da 0%, transparent 60%), radial-gradient(800px 420px at 110% 110%, #e6e1e0 0%, transparent 55%), var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(40, 20, 20, .10); padding: 2rem 1.75rem; }
.auth-card .logo { margin-bottom: 1.5rem; }
.auth-card .logo img { display: block; width: 200px; height: auto; }
.auth-card .logo span { display: block; margin-top: .6rem; font-weight: 600; color: var(--ink-3); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.auth-card .btn-primary { width: 100%; }
.qr { background: #fff; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; display: inline-block; }
.qr svg { display: block; width: 180px; height: 180px; }

@media print {
  .hr-side, .hr-top, .pt-top, .pt-tabbar, .no-print { display: none !important; }
  .hr-shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- Release 2: approval timeline, step editor, appraisal form ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem .6rem; }
.timeline li::before { content: ""; position: absolute; left: -1.53rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.timeline li.ok::before { background: var(--ok); border-color: var(--ok); }
.timeline li.bad::before { background: var(--bad); border-color: var(--bad); }
.timeline li.now::before { background: var(--accent); border-color: var(--accent); }
.timeline li.skip { opacity: .6; }
.step-row { display: grid; grid-template-columns: 2.2rem 1.4fr 1.2fr 1fr 1.2fr auto; gap: .5rem; align-items: end; padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.step-row .num { font-weight: 800; color: var(--char); padding-bottom: .55rem; }
@media (max-width: 900px) { .step-row { grid-template-columns: 1fr 1fr; } .step-row .num { grid-column: 1 / -1; padding: 0; } }
.ap-table td { vertical-align: top; }
.ap-table textarea { min-height: 60px; }
.ap-table input[type=number] { max-width: 90px; }
.ap-table td:first-child { min-width: 11rem; }
.ap-table td span.small, .ap-table textarea { min-width: 11rem; display: block; }
.ap-table td { min-width: 4.5rem; }
.score-pill { display: inline-block; min-width: 3.2rem; text-align: center; padding: .15rem .45rem; border-radius: 6px; background: var(--muted-bg); font-weight: 700; font-variant-numeric: tabular-nums; }
.codes { display: flex; flex-wrap: wrap; gap: .35rem .75rem; }
.codes label { display: inline-flex; gap: .3rem; align-items: center; font-weight: 600; margin: 0; }
.stage-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1rem; }
.stage-bar span { padding: .3rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--muted-bg); color: var(--ink-3); }
.stage-bar span.done { background: var(--ok-bg); color: var(--ok); }
.stage-bar span.now { background: var(--char); color: #fff; }
.more-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.more-links a { display: flex; justify-content: space-between; align-items: center; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 600; font-size: .92rem; }
.more-links a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-2); }

/* =====================================================================
   Glass look (Settings > Appearance). Only the frame of the app and the
   dashboards are frosted; tables, forms and reading screens stay solid.
   Without the "glass" class on <body> everything above is solid.
   ===================================================================== */
/* The soft brand background sits on its own fixed layer: same look as a fixed background,
   but the browser does not have to repaint the whole page on every scroll. */
body.glass { background: var(--paper); }
body.glass::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(520px 460px at 0% 0%, rgba(200, 22, 29, .55), transparent 70%),
  radial-gradient(460px 520px at 0% 100%, rgba(161, 17, 23, .30), transparent 70%),
  radial-gradient(900px 520px at 100% -10%, rgba(200, 22, 29, .07), transparent 65%),
  radial-gradient(700px 500px at 70% 110%, rgba(43, 40, 41, .06), transparent 65%); }
body.glass.is-dash::before { background:
  radial-gradient(520px 460px at 0% 0%, rgba(200, 22, 29, .55), transparent 70%),
  radial-gradient(460px 520px at 0% 100%, rgba(161, 17, 23, .30), transparent 70%),
  radial-gradient(620px 420px at 88% 8%, rgba(200, 22, 29, .16), transparent 70%),
  radial-gradient(720px 520px at 55% 95%, rgba(43, 40, 41, .10), transparent 70%); }

/* Frame: dark frosted menus, light frosted top bar */
body.glass .hr-side { background: rgba(24, 22, 23, .88); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%); backdrop-filter: blur(var(--blur)) saturate(150%);
  border-right: 1px solid rgba(255, 255, 255, .08); }
body.glass .hr-top { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: rgba(43, 40, 41, .08); }
body.glass .pt-top { position: sticky; top: 0; z-index: 15; background: rgba(24, 22, 23, .86); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  backdrop-filter: blur(var(--blur)) saturate(150%); border-bottom: 1px solid rgba(255, 255, 255, .08); }
body.glass .pt-tabbar { background: rgba(255, 255, 255, .80); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border-top-color: rgba(43, 40, 41, .08); }

/* Dashboards: frosted cards over the soft brand background */
body.glass.is-dash .card, body.glass.is-dash .more-links a { background: rgba(255, 255, 255, .64); border: 1px solid rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: 0 8px 30px rgba(60, 25, 25, .07), inset 0 1px 0 rgba(255, 255, 255, .7); }
body.glass.is-dash .card { border-radius: 14px; }
body.glass.is-dash .more-links a { background: rgba(255, 255, 255, .55); box-shadow: none; }
body.glass.is-dash .more-links a:hover { background: rgba(255, 255, 255, .85); border-color: rgba(200, 22, 29, .35); }
body.glass.is-dash .stats .card { position: relative; overflow: hidden; }
body.glass.is-dash .stats .card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--brand), var(--brand-2)); opacity: .85; }
body.glass.is-dash .list li, body.glass.is-dash .balance { border-bottom-color: rgba(43, 40, 41, .08); }
body.glass.is-dash .alert { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Portal welcome panel: glossy charcoal-to-red with frosted clock */
body.glass .hero { background: linear-gradient(135deg, rgba(36, 33, 34, .92) 0%, rgba(70, 30, 32, .90) 55%, rgba(161, 17, 23, .88) 100%);
  border: 1px solid rgba(255, 255, 255, .10); box-shadow: 0 14px 40px rgba(60, 20, 20, .18), inset 0 1px 0 rgba(255, 255, 255, .12); }
body.glass .hero::before { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 90, .35), transparent 70%); pointer-events: none; }
body.glass .hero > * { position: relative; }
body.glass .clock, body.glass .week div { background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* Sign-in and error pages */
body.glass .auth { background:
  radial-gradient(700px 520px at 8% 0%, rgba(200, 22, 29, .85), transparent 65%),
  radial-gradient(640px 520px at 100% 100%, rgba(161, 17, 23, .55), transparent 65%),
  radial-gradient(500px 400px at 85% 10%, rgba(255, 255, 255, .06), transparent 70%),
  linear-gradient(160deg, #2b2829, #161415); }
body.glass .auth-card { background: rgba(255, 255, 255, .95); border: 1px solid rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); border-radius: 18px; }

/* Lighter blur on phones (cheaper to draw on low-end Android) */
@media (max-width: 760px) { body.glass { --blur: 10px; } }
/* Browsers without blur, or people who asked for less transparency: near-solid panels */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.glass .hr-side, body.glass .pt-top { background: rgba(29, 27, 28, .97); }
  body.glass .hr-top, body.glass .pt-tabbar, body.glass .auth-card { background: rgba(255, 255, 255, .97); }
  body.glass.is-dash .card, body.glass.is-dash .more-links a { background: rgba(255, 255, 255, .94); }
}
@media (prefers-reduced-transparency: reduce) {
  body.glass .hr-side, body.glass .pt-top { background: var(--char); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.glass .hr-top, body.glass .pt-tabbar, body.glass .auth-card, body.glass.is-dash .card, body.glass.is-dash .more-links a { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print { body.glass { background: #fff; } body.glass::before { display: none; } }

/* Keep red for actions: links inside tables and the top bar read as charcoal, red on hover */
table a:not(.btn), .hr-top .right > a:not(.btn) { color: var(--ink); }
table a:not(.btn):hover, .hr-top .right > a:not(.btn):hover { color: var(--link); }

/* ---------- Profile photos ---------- */
.avatar-img { object-fit: cover; padding: 0; background: var(--muted-bg); display: inline-block; }
.photo-form { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-form-body { flex: 1 1 220px; min-width: 0; }
.photo-form-body .photo-upload { display: inline; }
.photo-form-body .hint { margin-top: .4rem; }
.photo-form label.btn { margin: 0; color: var(--ink); font-size: .85rem; }
.photo-form label.btn.disabled { opacity: .6; pointer-events: none; }
.photo-form .avatar { box-shadow: 0 0 0 3px #fff, 0 2px 10px rgba(0, 0, 0, .12); }
.top-avatar { display: inline-flex; border-radius: 50%; }
.top-avatar .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.hr-top .top-avatar .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }

/* ---------- Clock-in checks ---------- */
.clock-note { margin-top: .6rem; padding: .5rem .75rem; border-radius: 8px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font-size: .88rem; color: #fff; }
.cam-modal { position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 19, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cam-box { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 1.1rem 1.1rem 1rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); max-height: calc(100vh - 32px); overflow: auto; }
.cam-box h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.cam-box p { margin: 0 0 .75rem; color: var(--ink-2); }
.cam-view { position: relative; background: #111; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-view video[hidden] { display: none; }
.cam-msg { color: #eee; padding: 1rem; text-align: center; font-size: .92rem; line-height: 1.4; }
.cam-msg[hidden] { display: none; }
.cam-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.cam-actions .btn-primary { flex: 1 1 100%; min-height: 48px; font-size: 1rem; }
.cam-actions [hidden] { display: none; }
.selfie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.selfie-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; display: flex; flex-direction: column; gap: .55rem; }
.selfie-card.has-flag { border-color: rgba(200, 22, 29, .45); box-shadow: 0 0 0 2px rgba(200, 22, 29, .12); }
.selfie-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.selfie-pair figure { margin: 0; }
.selfie-pair img, .selfie-none { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; display: block; background: var(--line-2); }
.selfie-none { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-3); font-weight: 700; font-size: 1.2rem; }
.selfie-none span { font-size: .72rem; font-weight: 500; margin-top: .2rem; }
.selfie-pair figcaption { font-size: .72rem; color: var(--ink-3); text-align: center; margin-top: .2rem; text-transform: uppercase; letter-spacing: .05em; }
.selfie-meta a { color: var(--ink); }
.flag-line { margin-top: .3rem; font-size: .8rem; font-weight: 600; color: var(--brand-2); }
.flag-line.dismissed { color: var(--ink-3); font-weight: 500; }
.selfie-card form { margin-top: auto; }
