/* Northwind Payroll Support -- dense, quiet, built for reading numbers. */

:root {
  --ink: #16181d;
  --muted: #6b7280;
  --faint: #9aa1ac;
  --line: #e2e5ea;
  --line-strong: #c7ccd4;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #1f4e79;
  --accent-soft: #eaf1f8;
  --ok: #146c2e;
  --ok-soft: #e8f5ec;
  --warn: #8a5300;
  --warn-soft: #fdf3e2;
  --bad: #a3131f;
  --bad-soft: #fdeced;
  --radius: 7px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 22px; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
/* Wraps onto a second line rather than letting the right-hand block slide over
   the nav links and make them unclickable on a narrow window. */
.topbar .wrap {
  display: flex; align-items: center; gap: 14px 22px;
  min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px;
}
.brand {
  font-weight: 700; font-size: 16px; color: var(--accent); text-decoration: none;
  letter-spacing: -.01em; white-space: nowrap; flex: 0 0 auto;
}
.brand span { font-weight: 400; color: var(--muted); }
.topbar nav { display: flex; gap: 16px; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap;
  padding: 5px 2px; border-bottom: 2px solid transparent;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.who {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  margin-left: auto; flex: 0 0 auto; flex-wrap: wrap;
}
.who .name { color: var(--muted); white-space: nowrap; }
.who .out { color: var(--muted); text-decoration: none; white-space: nowrap; }
.who .out:hover { color: var(--bad); }

@media (max-width: 720px) {
  .who .name { display: none; }
  .topbar .wrap { gap: 10px 16px; }
}

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent);
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.role { background: #eef0f3; color: #4b5563; }

main.wrap { padding-top: 26px; padding-bottom: 60px; }

/* ---------- headings ---------- */
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.015em; }
h2 { font-size: 16px; margin: 30px 0 10px; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.page-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .spacer { flex: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.card.tight { padding: 13px 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }

/* ---------- stat tiles ---------- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .value.neg { color: var(--bad); }
.stat .note { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
tr.neg td.num.amount { color: var(--bad); }
tbody tr:hover { background: #fafbfc; }
tr.rejected td { opacity: .45; text-decoration: line-through; }
tfoot td { font-weight: 650; border-top: 2px solid var(--line-strong); border-bottom: none; }
.table-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
input[type=text], input[type=date], input[type=number], input[type=email],
input[type=password], select, textarea {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent);
}
input[readonly] { background: #f4f5f7; color: var(--muted); }
textarea { min-height: 84px; resize: vertical; font-family: inherit; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 120px; margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); }
.check input { width: auto; }
.check label { margin: 0; font-size: 13.5px; color: var(--ink); }

/* ---------- buttons ---------- */
button, .btn {
  display: inline-block; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 550;
  border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.35;
}
button:hover, .btn:hover { background: #f3f5f7; }
.btn-primary, button.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover, button.primary:hover { background: #1a4368; }
button.danger, .btn-danger { color: var(--bad); border-color: #e6b8bc; }
button.danger:hover { background: var(--bad-soft); }
button.small, .btn.small { padding: 4px 9px; font-size: 12.5px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- flash / callouts ---------- */
.flash {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 14px; border: 1px solid;
}
.flash.ok { background: var(--ok-soft); border-color: #bfe0c8; color: var(--ok); }
.flash.warn { background: var(--warn-soft); border-color: #ecd6ab; color: var(--warn); }
.flash.bad { background: var(--bad-soft); border-color: #f0c2c6; color: var(--bad); }

.note-box {
  background: #fbfcfd; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 11px 14px; border-radius: 0 5px 5px 0; font-size: 13.5px; color: #384151;
  margin-bottom: 16px;
}
.note-box.warn { border-left-color: #d79a2b; background: var(--warn-soft); }
.note-box.bad { border-left-color: var(--bad); background: var(--bad-soft); }

/* ---------- status chips ---------- */
.status { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.status-collecting { background: #eef0f3; color: #4b5563; }
.status-in_review { background: var(--warn-soft); color: var(--warn); }
.status-pending_approval { background: var(--accent-soft); color: var(--accent); }
.status-approved { background: var(--ok-soft); color: var(--ok); }
.status-released { background: var(--ok-soft); color: var(--ok); }
.status-rejected { background: var(--bad-soft); color: var(--bad); }
.status-draft { background: #eef0f3; color: #6b7280; }
.status-submitted { background: var(--accent-soft); color: var(--accent); }
.status-returned { background: var(--bad-soft); color: var(--bad); }
.status-accepted { background: var(--ok-soft); color: var(--ok); }
.status-proposed { background: #eef0f3; color: #6b7280; }
.status-amended { background: var(--warn-soft); color: var(--warn); }

/* ---------- login ---------- */
.login-shell { max-width: 380px; margin: 9vh auto; }
.login-shell h1 { text-align: center; margin-bottom: 4px; }
.login-shell .sub { text-align: center; }

/* ---------- misc ---------- */
a { color: var(--accent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.foot { padding: 20px 22px; color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); }
.empty { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }
pre.mail {
  background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px;
  padding: 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; margin: 0;
}
details.rowform { margin: 0; }
details.rowform > summary { cursor: pointer; color: var(--accent); font-size: 12.5px; list-style: none; }
details.rowform > summary::-webkit-details-marker { display: none; }
details.rowform > summary::before { content: "edit"; }
details.rowform[open] > summary::before { content: "close"; }
details.rowform > div { padding: 12px; background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px; margin-top: 8px; }
.filelist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.filelist li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 9px; align-items: center; }
.filelist li:last-child { border-bottom: none; }
.filelist .sz { color: var(--faint); font-size: 12px; margin-left: auto; }
