/* Target HR ERP – local prototype styles. No external fonts or scripts.
   Palette: Target brand – Space Cadet navy #20293D, Y In Mn Blue #334D72, Honolulu Blue #0B6DB7,
   Spanish Gray #8D918D. Status colours (ok / warn / error) are used only to signal meaning,
   always together with words. */

:root {
  --bg: #f1f2f4;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #20293d;
  --muted: #4a5360;
  --line: #d9dee5;
  --line-strong: #8d918d;
  --brand: #20293d;
  --brand-2: #334d72;
  --accent: #0b6db7;
  --accent-hover: #095a97;
  --accent-soft: #e6f0f9;
  --accent-text: #ffffff;
  --focus: #0b6db7;
  /* Status colours: green for OK, amber for warnings, red for errors (always shown with words). */
  --ok-bg: #e9f5ee; --ok-text: #14532d; --ok-line: #8ccaa5;
  --warn-bg: #fff6e6; --warn-text: #6b3a00; --warn-line: #e6b062;
  --err-bg: #fdeeee; --err-text: #8a1c1c; --err-line: #e8a0a0;
  --info-bg: #eaf2fa; --info-text: #1d3a5f; --info-line: #9dbfe2;
  --radius: .7rem;
  --radius-sm: .5rem;
  --shadow: 0 1px 2px rgba(32, 41, 61, .06), 0 1px 3px rgba(32, 41, 61, .05);
  --font: "Segoe UI", "Montserrat", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --width: 84rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --surface: #1b2029; --surface-2: #222937; --text: #eef1f5; --muted: #b7c0cc;
    --line: #343c49; --line-strong: #5b6474;
    --brand: #0f1420; --brand-2: #9db7da; --accent: #6fb0f5; --accent-hover: #8cc2ff;
    --accent-soft: #16304d; --accent-text: #0b1220; --focus: #8cc2ff;
    --ok-bg: #12301f; --ok-text: #b9ecc9; --ok-line: #2f7a4d;
    --warn-bg: #3a2a10; --warn-text: #ffd9a3; --warn-line: #a26a1c;
    --err-bg: #3a1717; --err-text: #ffc2c2; --err-line: #a54444;
    --info-bg: #12263d; --info-text: #c2dcfa; --info-line: #36659a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* 14 px base, as in the Payroll tool; slightly larger on phones for readability. */
html { -webkit-text-size-adjust: 100%; font-size: 87.5%; }
@media (max-width: 44rem) { html { font-size: 93.75%; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1rem/1.5 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { color: var(--text); letter-spacing: -.005em; }
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 .3rem; font-weight: 700; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .75rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 0 0 .5rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
strong { font-weight: 650; }
ul { padding-left: 1.25rem; }
li + li { margin-top: .2rem; }

/* Keyboard focus that is always visible */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 20;
  background: var(--surface); color: var(--text); padding: .5rem .75rem; border-radius: var(--radius);
}
.skip-link:focus { top: .5rem; }

/* Shell, as in the Target Payroll tool: a navy bar with the three-logo strip, then the menu as a
   white tab bar with a blue underline on the current page. */
.site-header { position: sticky; top: 0; z-index: 10; }
.site-header .inner {
  background: var(--brand); color: #fff;
  min-height: 3.7rem; padding: .4rem max(1rem, calc((100% - var(--width)) / 2 + 1rem));
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
}
.brand {
  color: #fff; font-weight: 600; text-decoration: none; font-size: 1.2rem; letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: .85rem;
}
.brand:hover { color: #fff; }
.brand .logos { display: flex; gap: .35rem; background: #fff; border-radius: .45rem; padding: .25rem .4rem; }
.brand .logos img { height: 2rem; width: auto; display: block; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-sub { font-size: .8rem; font-weight: 400; color: #9aa6bd; letter-spacing: .02em; }
.user-box { display: flex; align-items: center; gap: .7rem; font-size: .93rem; margin-left: auto; }
.user-box span { opacity: .85; }
.user-box .btn {
  background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35);
  min-height: 2.2rem; padding: .3rem .9rem; font-weight: 500;
}
.user-box .btn:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .5); }
.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); }
/* The tab row scrolls sideways when it doesn't fit, on any screen size. */
.site-nav {
  display: flex; flex-wrap: nowrap; gap: .25rem; overflow-x: auto; scrollbar-width: thin;
  max-width: var(--width); margin: 0 auto; padding: 0 1rem;
}
.site-nav a {
  color: var(--muted); text-decoration: none; padding: .85rem 1rem; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--brand); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--brand); font-weight: 600; border-bottom-color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
}

.synthetic-note {
  margin: 0; padding: .4rem 1rem; font-size: .85rem; text-align: center;
  color: var(--warn-text); background: var(--warn-bg); border-bottom: 1px solid var(--warn-line);
}

main { width: 100%; max-width: var(--width); margin: 0 auto; padding: 1.25rem 1rem 3rem; flex: 1; }

.site-footer {
  border-top: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: .8rem; text-align: center; padding: .9rem 1rem;
}
.site-footer p { margin: 0; }

.breadcrumbs { font-size: .875rem; margin-bottom: .75rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs li + li { margin-top: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--line-strong); }
.breadcrumbs a { color: var(--brand-2); }

.page-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem 1rem;
  margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.page-header > div:first-child { min-width: 0; flex: 1 1 22rem; }
.page-header .lead { color: var(--muted); margin: 0; max-width: 60rem; }
.page-header .actions { margin-top: 0; }
.lead { color: var(--muted); }

/* Cards and sections */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card .card { box-shadow: none; background: var(--surface-2); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
section > h2 { margin-top: .25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 52rem) { .grid-2 { grid-template-columns: 1fr; } }

/* Number tiles, as the Payroll launchpad tiles: plain white, large number, muted label. */
.stat {
  display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.stat .count {
  font-size: 1.85rem; font-weight: 600; line-height: 1.1; display: block; color: var(--brand-2);
  font-variant-numeric: tabular-nums;
}
.stat .label { color: var(--muted); font-size: .93rem; }
.stat:hover { border-color: var(--brand-2); color: inherit; box-shadow: 0 2px 10px rgba(32, 41, 61, .1); }

/* Definition lists: label / value pairs */
.details, main dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0 0 .75rem; }
.details dt, main dl dt { color: var(--muted); font-weight: 500; }
.details dd, main dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 30rem) {
  .details, main dl { grid-template-columns: 1fr; gap: .1rem; }
  .details dd, main dl dd { margin-bottom: .5rem; }
}

/* Notices */
.notice {
  border: 1px solid; border-left-width: 5px; border-radius: var(--radius); padding: .8rem 1rem;
  margin-bottom: 1rem;
}
.notice h2, .notice h3 { margin-bottom: .35rem; color: inherit; }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.notice-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-line); }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.notice-err { background: var(--err-bg); color: var(--err-text); border-color: var(--err-line); }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { margin-bottom: .5rem; }

/* Stage badges – the text always names the stage, colour is only a hint */
.badge {
  display: inline-block; padding: .1rem .6rem; border-radius: 999px; border: 1px solid;
  font-size: .82rem; font-weight: 650; white-space: nowrap;
}
.badge-applied, .badge-screening { background: var(--info-bg); color: var(--info-text); border-color: var(--info-line); }
.badge-interview, .badge-offer { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.badge-hired { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.badge-rejected { background: var(--err-bg); color: var(--err-text); border-color: var(--err-line); }
.badge-withdrawn { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.tag {
  display: inline-block; font-size: .82rem; font-weight: 600; padding: .05rem .5rem;
  border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.tag-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.tag-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-line); }
.tag-err { background: var(--err-bg); color: var(--err-text); border-color: var(--err-line); }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.6rem; padding: .45rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand);
  font: inherit; font-size: .95rem; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--brand); border-color: var(--brand-2); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-danger { background: var(--err-bg); color: var(--err-text); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); color: var(--err-text); filter: brightness(.96); }
@media (prefers-color-scheme: dark) { .btn { color: var(--text); } .btn:hover { color: var(--text); } }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .75rem; }

.field { margin-bottom: 1rem; }
.field label, .field .label, fieldset legend { display: block; font-weight: 650; margin-bottom: .3rem; }
.field .help { color: var(--muted); font-size: .875rem; margin: .25rem 0 0; max-width: 40rem; }
.field .error, .form-errors { color: var(--err-text); font-weight: 600; }
.form-errors { background: var(--err-bg); border: 1px solid var(--err-line); border-radius: var(--radius); padding: .6rem .9rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; max-width: 32rem; min-height: 2.65rem; padding: .45rem .65rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 5rem; }
input:hover, select:hover, textarea:hover { border-color: var(--brand-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"], select[aria-invalid="true"] { border: 2px solid var(--err-line); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
.choices { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .35rem; }
.choices li + li { margin-top: 0; }
.choices label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.choices input { margin-top: .3rem; }

.filters { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; }
.filters .field { margin: 0; }

/* Tables that become cards on small screens */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.card table { border-radius: var(--radius-sm); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
/* Long notes and unbroken words (usernames, references) wrap inside the cell, never off the card. */
td { overflow-wrap: anywhere; }
th {
  font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  color: var(--brand-2); background: var(--surface-2);
}
tbody tr:hover td { background: var(--surface-2); }
/* History tables: fixed columns, the note takes the remaining width and wraps in full. */
table.history-table { table-layout: fixed; }
table.history-table .col-when { width: 9.5rem; }
table.history-table .col-status { width: 30%; }
table.history-table .col-by { width: 10rem; }
.wrap-text { overflow-wrap: anywhere; }
@media (max-width: 44rem) {
  table.history-table, table.history-table tbody { display: block; }
  table.responsive { border: 0; background: transparent; overflow: visible; }
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.responsive tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; background: var(--surface); padding: .25rem 0; }
  table.responsive td { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .5rem; border: 0; padding: .4rem .75rem; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: .875rem; }
  table.responsive tbody tr:hover td { background: transparent; }
}

.pager { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: compact header, the menu becomes one row that scrolls sideways. */
@media (max-width: 44rem) {
  h1 { font-size: 1.4rem; }
  .site-header { position: static; }
  .site-header .inner { padding: .45rem .75rem; gap: .4rem .75rem; }
  .brand { font-size: 1.05rem; gap: .6rem; }
  .brand .logos img { height: 1.6rem; }
  .user-box { font-size: .85rem; }
  .site-nav { padding: 0 .25rem; }
  .site-nav a { padding: .75rem .75rem; }
  main { padding: 1rem .75rem 2.5rem; }
  .card { padding: 1rem; }
  .page-header { align-items: flex-start; }
  .page-header .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
}

@media print {
  .site-header, .synthetic-note, .site-footer, .actions, .skip-link { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* Long status labels in tables wrap on narrow screens. */
.responsive td .tag { white-space: normal; }
