/* SE HRIS Handover Portal - one stylesheet, no build step.
   Palette matches handover/hris-process-guide.html so the portal and the
   documents it serves read as one set. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #65717f;
  --line: #d9dee5;
  --brand: #b42318;
  --brand-dark: #7a1110;
  --accent: #0f766e;
  --warn: #9a5b13;
  --warn-soft: #fdf4e7;
  --code: #111827;
  --soft: #eef2f7;
  --ok: #13795b;
  --ok-soft: #e8f5ef;
  --brand-soft: #fdeceb;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
}

h1, h2, h3, h4 { margin: 0; letter-spacing: 0; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
p { margin: 0 0 10px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12px; }

code, kbd, pre {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}
code {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}
pre {
  background: var(--code);
  color: #e5e7eb;
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  margin: 0;
}
pre code { background: none; border: 0; color: inherit; padding: 0; font-size: inherit; }

/* ---------- shell ---------- */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

nav.main { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
nav.main a {
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
nav.main a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
nav.main a.active { background: var(--brand-soft); color: var(--brand-dark); }
nav.main form { margin: 0; }

.who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); }

main.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 22px 72px; }
main.narrow { max-width: 880px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .subtitle { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.panel-body { padding: 18px; }
.panel-body > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.metric strong { display: block; font-size: 26px; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 12px; }

.notice {
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 14px 0;
  font-size: 13px;
}
.notice.ok { border-color: var(--ok); background: var(--ok-soft); }
.notice.bad { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- tags & pills ---------- */

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d4; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbd; }
.tag.bad { background: var(--brand-soft); color: var(--brand-dark); border-color: #f3c9c6; }
.tag.accent { background: #e6f4f2; color: var(--accent); border-color: #bfdedb; }

/* ---------- progress ---------- */

.bar { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.bar.lg { height: 10px; }
.bar > i.full { background: var(--ok); }

.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0); }
.ring.full { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--soft) 0); }
.ring > b { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

/* ---------- stage list ---------- */

.stage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.stage-row:last-child { border-bottom: 0; }
.stage-row:hover { background: #fbfcfd; text-decoration: none; }
.stage-row .num {
  width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--soft); color: var(--muted); font-weight: 700; font-size: 13px;
}
.stage-row.complete .num { background: var(--ok-soft); color: var(--ok); }
.stage-row.in-progress .num { background: var(--warn-soft); color: var(--warn); }
.stage-row .meta { flex: 1; min-width: 0; }
.stage-row .meta strong { display: block; font-size: 14px; }
.stage-row .meta span { color: var(--muted); font-size: 12.5px; }
.stage-row .count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- task cards ---------- */

.task {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 14px;
  overflow: hidden;
  scroll-margin-top: 80px;
}
.task[data-status="done"] { border-color: #bfe3d4; }
.task[data-status="blocked"] { border-color: #f3c9c6; }
.task[data-status="doing"] { border-color: #f0dcbd; }

.task-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfdfe;
}
.task-head .idx { font-size: 12px; color: var(--muted); font-weight: 700; padding-top: 2px; min-width: 22px; }
.task-head .title { flex: 1; min-width: 0; }
.task-head .title strong { font-size: 15px; display: block; }
.task-head .title .sub { color: var(--muted); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }

.task-body { padding: 16px; }
.task-body > :first-child { margin-top: 0; }
.task-body ul, .task-body ol { margin: 0 0 12px; padding-left: 22px; }
.task-body li { margin-bottom: 5px; }
.task-body table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.task-body th, .task-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.task-body th { background: var(--soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.task-body blockquote { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.task-body blockquote > :last-child { margin-bottom: 0; }

.cmd { position: relative; margin: 0 0 14px; }
.cmd button.copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.12); color: #e5e7eb; border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px; font-size: 11px; padding: 3px 8px; cursor: pointer;
}
.cmd button.copy:hover { background: rgba(255,255,255,.22); }

.expect, .proof-label { font-size: 13px; margin-bottom: 12px; }
.expect { border-left: 3px solid var(--accent); background: #e9f4f3; padding: 10px 13px; border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- screenshots ---------- */

.shot { margin: 0 0 16px; }
/* Direct child only: the caption's "see it live" link is an <a> too. */
.shot > a { display: block; line-height: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.shot > a:hover { border-color: var(--accent); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.shot figcaption > span:first-child { flex: 1; min-width: 200px; }
.shot-live {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}
.shot-live:hover { border-bottom-color: var(--accent); text-decoration: none; }
.shot-missing {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--soft);
}

.refs { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.refs code { font-size: 11.5px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.links a { font-size: 12px; border: 1px solid var(--line); background: var(--panel); padding: 4px 10px; border-radius: 999px; color: var(--accent); }
.links a:hover { background: var(--soft); text-decoration: none; }

/* ---------- task controls ---------- */

.task-foot { border-top: 1px solid var(--line); background: #fcfdfe; padding: 14px 16px; }
.status-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.status-group button {
  font: inherit; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.status-group button:hover { background: var(--soft); }
.status-group button[aria-pressed="true"][data-value="todo"] { background: var(--soft); color: var(--text); border-color: #c8d0da; }
.status-group button[aria-pressed="true"][data-value="doing"] { background: var(--warn-soft); color: var(--warn); border-color: #f0dcbd; }
.status-group button[aria-pressed="true"][data-value="done"] { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d4; }
.status-group button[aria-pressed="true"][data-value="blocked"] { background: var(--brand-soft); color: var(--brand-dark); border-color: #f3c9c6; }
.saved { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.saved.bad { color: var(--brand); }

label.field { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 5px; }
label.field code { text-transform: none; letter-spacing: 0; font-weight: 400; }
textarea, input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
textarea { min-height: 72px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
textarea:focus, input:focus, select:focus { outline: 2px solid #cfe3e1; outline-offset: 1px; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 8px 15px; border-radius: 6px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { font-size: 12px; padding: 5px 10px; }

/* ---------- tables ---------- */

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: middle; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fbfcfd; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroller { overflow-x: auto; }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--soft); border: 1px solid var(--line); }
.dot.done { background: var(--ok); border-color: var(--ok); }
.dot.doing { background: #e3b169; border-color: #d9a350; }
.dot.blocked { background: var(--brand); border-color: var(--brand); }
.dots { display: flex; gap: 3px; flex-wrap: wrap; }

/* ---------- auth ---------- */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.error { color: var(--brand); font-size: 12.5px; margin-top: 5px; }

/* ---------- docs ---------- */

.doc-frame { width: 100%; height: calc(100vh - 150px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.doc-card { display: block; padding: 16px 18px; color: inherit; }
.doc-card:hover { text-decoration: none; background: #fbfcfd; }
.doc-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.doc-card span { color: var(--muted); font-size: 12.5px; }

.md-body { max-width: 900px; margin: 0 auto; padding: 28px 24px 80px; }
.md-body h1 { margin: 28px 0 12px; }
.md-body h2 { margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md-body h3 { margin: 20px 0 8px; }
.md-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md-body th { background: var(--soft); }
.md-body pre { margin-bottom: 16px; }
.md-body ul, .md-body ol { padding-left: 24px; }

/* ---------- misc ---------- */

.flash { padding: 11px 15px; border-radius: var(--radius); background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe3d4; font-size: 13px; margin-bottom: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.timeline li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 13px; padding: 18px; text-align: center; }

@media (max-width: 900px) {
  .grid[style*="1.8fr"] { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 720px) {
  .topbar-inner { padding: 10px 16px; flex-wrap: wrap; }
  .brand span { display: none; }
  .page-head > div:last-child { text-align: left !important; min-width: 0 !important; }
  nav.main { width: 100%; margin-left: 0; }
  .who { border-left: 0; padding-left: 0; }
  main.wrap { padding: 20px 16px 60px; }
  .doc-frame { height: calc(100vh - 210px); }
}

@media print {
  header.topbar, .task-foot, nav.main { display: none; }
  body { background: #fff; }
  .panel, .task { box-shadow: none; }
}
