/* OEG HR
   Visual language taken from oegglobal.com: the same brand blue and navy, the
   same Plus Jakarta Sans / Inter pairing, the same 8px radius and quiet
   borders. Mobile first - every layout below starts single-column and opens
   up at 700px and 1000px. */

:root {
  --navy:        #102237;   /* oegglobal footer   */
  --blue:        #1a5789;   /* oegglobal primary  */
  --blue-hover:  #206bab;
  --blue-dark:   #14456d;
  --light-blue:  #e8f1f8;
  --steel:       #8c99a6;
  --warm-gray:   #f7f5f3;
  --ink:         #1d2630;
  --muted:       #73808c;
  --border:      #e1e5ea;
  --bg:          #f4f6f8;
  --card:        #ffffff;
  --ok:          #12805c;
  --ok-bg:       #e7f5ef;
  --warn:        #9a6b00;
  --warn-bg:     #fdf4e0;
  --danger:      #c0392b;
  --danger-bg:   #fdeceb;
  --radius:      8px;
  --shadow:      0 1px 2px rgba(16,34,55,.06), 0 4px 16px rgba(16,34,55,.05);
  /* aliases kept so page-level inline styles written against the
     earlier palette keep working */
  --line:        #e1e5ea;
  --accent:      #1a5789;
  --head:        "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --body:        "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--blue); }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.97);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 8px 14px;
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.pagetitle {
  flex: 1; min-width: 0; font: 700 16px/1.2 var(--head); color: var(--navy);
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 6px; border-left: 1px solid var(--border); margin-left: 2px;
}
.me {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy);
  padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent;
}
.me:hover { background: var(--light-blue); border-color: #d6e4f0; }
.me .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  font: 700 13px/30px var(--head); text-align: center; flex: none;
}
.me .me-name { font-weight: 600; font-size: 13.5px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell { position:relative; margin-left:auto; margin-right:10px; font-size:18px; color:var(--muted); text-decoration:none; line-height:1 }
.bell.has { color:var(--blue) }
.bell-n { position:absolute; top:-8px; right:-12px; background:var(--danger); color:#fff; font-size:10.5px; font-weight:700; border-radius:999px; padding:1px 6px; line-height:1.3 }
.pill-admin {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--light-blue); color: var(--blue);
  font: 600 10.5px/1.7 var(--body); text-transform: uppercase; letter-spacing: .04em;
}
@media (max-width: 560px) { .me .me-name, .me .pill-admin { display: none; } .pagetitle { font-size: 15px; } }

/* the menu button: three lines, becoming a cross while the drawer is open */
.burger {
  flex: none; width: 42px; height: 38px; border: 1px solid var(--border);
  background: #fff; border-radius: var(--radius); cursor: pointer; position: relative;
}
.burger:hover { background: var(--light-blue); }
.burger span, .burger span::before, .burger span::after {
  content: ""; position: absolute; left: 11px; width: 18px; height: 2px;
  background: var(--navy); border-radius: 2px; transition: .18s;
}
.burger span { top: 18px; }
.burger span::before { top: -6px; left: 0; }
.burger span::after  { top:  6px; left: 0; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

/* while the drawer is open its own close button is the way to shut it; the
   cross the menu button would turn into is the same control twice */
body.menu-open .burger { visibility: hidden; }

/* the drawer: one menu for every screen size, grouped by what the screens are for */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,34,55,.45);
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(300px, 88vw);
  background: #fff; box-shadow: 8px 0 30px rgba(16,34,55,.18);
  transform: translateX(-104%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
body.menu-open { overflow: hidden; }
/* On a desktop the open menu pushes the page aside rather than covering it,
   and stays where it was left from screen to screen; on a phone it slides
   over the page behind a backdrop. */
@media (min-width: 961px) {
  body { transition: padding-left .22s ease; }
  body.no-anim, body.no-anim .drawer { transition: none; }
  body.menu-open { overflow: auto; padding-left: min(300px, 88vw); }
  body.menu-open .drawer-backdrop { display: none; }
  .drawer { box-shadow: none; border-right: 1px solid var(--border); }
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.drawer-head img { height: 28px; width: auto; }
.drawer-close {
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 22px; line-height: 1; color: var(--navy); cursor: pointer;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 10px 12px; }
.drawer-section {
  margin: 12px 8px 4px; font: 600 10.5px/1.6 var(--body); color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.drawer-body a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius); margin: 1px 0;
  color: var(--navy); text-decoration: none; font-weight: 500; font-size: 14.5px;
}
.drawer-body a:hover { background: var(--light-blue); color: var(--blue); }
.drawer-body a.here { background: var(--blue); color: #fff; }
.drawer-body a.here .step { background: rgba(255,255,255,.22); color: #fff; }
.drawer-body a.out { color: var(--muted); font-weight: 400; }
/* the numbered badge that marks the three pipeline modules */
.drawer-body .step {
  flex: none; width: 20px; height: 20px; border-radius: 5px;
  background: var(--light-blue); color: var(--blue);
  font: 700 11px/20px var(--head); text-align: center;
}
.drawer-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.drawer-foot b { color: var(--navy); font-size: 14px; }

/* ---------------------------------------------------------------- layout */

main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 64px; }

.page-head { margin: 6px 0 18px; }
.page-head .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 11.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 10px;
}
.page-head .eyebrow .step {
  width: 20px; height: 20px; border-radius: 5px; background: var(--blue); color: #fff;
  font: 700 11px/20px var(--head); text-align: center; letter-spacing: 0;
}
.page-head h2 { margin: 0 0 6px; font-size: 26px; color: var(--navy); }
.page-head p  { margin: 0; color: var(--muted); max-width: 74ch; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card > h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.card > h3 + p.muted { margin-top: 0; }

/* how-to panel: used liberally, one per page and one per tricky control */
.howto {
  background: var(--light-blue); border: 1px solid #cfe1f0;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
}
.howto h4 {
  margin: 0 0 8px; font-size: 13.5px; color: var(--blue-dark);
  text-transform: uppercase; letter-spacing: .05em;
}
.howto p, .howto li { margin: 4px 0; font-size: 14px; color: #2b4d68; }
.howto ol, .howto ul { margin: 6px 0 0; padding-left: 20px; }
.howto b { color: var(--blue-dark); }
details.howto > summary {
  cursor: pointer; font: 600 13.5px/1.4 var(--body); color: var(--blue-dark);
  text-transform: uppercase; letter-spacing: .05em; list-style: none;
}
details.howto > summary::before { content: "▸ "; }
details.howto[open] > summary::before { content: "▾ "; }
details.howto[open] > summary { margin-bottom: 8px; }

/* ---------------------------------------------------------------- pieces */

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 200px; }
.spread { justify-content: space-between; }
.gap { gap: 10px; }

button, .btn {
  font: 500 14px/1 var(--body); padding: 10px 15px; min-height: 40px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: #fff; color: var(--navy); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; transition: .15s;
}
button:hover, .btn:hover { border-color: var(--steel); background: var(--warm-gray); }
button.primary, .btn.primary {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
button.danger, .btn.danger { color: var(--danger); border-color: #f0c8c4; background: #fff; }
button.danger:hover { background: var(--danger-bg); }
button:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font: 14px var(--body); padding: 10px 12px; min-height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,87,137,.13);
}
.search { flex: 1 1 220px; }
select { flex: 0 1 auto; width: auto; min-width: 130px; }
input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none;
  accent-color: var(--blue); vertical-align: middle;
}
input[type="file"] { padding: 8px 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; color: var(--navy); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.count { color: var(--muted); font-size: 13px; }
.linky { background: none; border: 0; padding: 0; min-height: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 13.5px; }

.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--warm-gray); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat b { display: block; font: 700 22px/1.2 var(--head); color: var(--navy); }
.stat span { font-size: 12.5px; color: var(--muted); }
@media (min-width: 700px) { .summary { grid-template-columns: repeat(4, 1fr); } }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font: 600 11.5px/1.7 var(--body); background: var(--warm-gray); color: var(--muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.tag.ok, .tag.ready, .tag.shortlisted { background: var(--ok-bg); color: var(--ok); border-color: #bfe3d4; }
.tag.notready, .tag.pri { background: var(--warn-bg); color: var(--warn); border-color: #f0dcb0; }
.tag.rejected, .tag.danger { background: var(--danger-bg); color: var(--danger); border-color: #f3cdc9; }
.tag.src, .tag.feed { background: var(--light-blue); color: var(--blue); border-color: #cfe1f0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.warnbox {
  background: var(--warn-bg); border: 1px solid #f0dcb0; border-left: 4px solid #d9a520;
  border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: 14px;
}
.warnbox.ok    { background: var(--ok-bg);     border-color: #bfe3d4; border-left-color: var(--ok); }
.warnbox.error { background: var(--danger-bg); border-color: #f3cdc9; border-left-color: var(--danger); }
.error { color: var(--danger); }

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

.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
/* On a desktop the wrapper is not a scroll box: a scroll box would stop the
   heading row sticking to the page. Tables fit at desktop widths (the rare
   one that does not scrolls with the page); phones and tablets keep the
   sideways swipe. */
@media (min-width: 900px) { body .scroller, body .scrollx { overflow: visible; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font: 600 12px/1.4 var(--body); text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--warm-gray); white-space: nowrap;
  position: sticky; top: var(--topbar-h, 60px); z-index: 1;
  box-shadow: 0 1px 0 var(--border);   /* the border-bottom does not travel with a sticky cell */
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--blue); }
tbody tr:hover, table tr:hover { background: #fafbfc; }
td .who { font-weight: 600; color: var(--navy); }

.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pager button { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.pager button.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------------------------------------------------------------- module cards (home) */

.modules { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .modules { grid-template-columns: repeat(3, 1fr); } }

.module {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; text-decoration: none; color: inherit;
  border-top: 3px solid var(--blue); transition: .18s;
}
.module:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(16,34,55,.11); border-color: #c8d6e2; }
.module .n {
  width: 30px; height: 30px; border-radius: 7px; background: var(--blue); color: #fff;
  font: 700 15px/30px var(--head); text-align: center;
}
.module h3 { margin: 4px 0 0; font-size: 17px; color: var(--navy); }
.module p  { margin: 0; font-size: 14px; color: var(--muted); flex: 1; }
.module .go { font-weight: 600; font-size: 14px; color: var(--blue); }

.flow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-top: 6px;
}
.flow b { color: var(--navy); font-weight: 600; }
.flow .arr { color: var(--steel); }

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

.two { display: grid; gap: 16px; grid-template-columns: 1fr; }
.two > * { min-width: 0; }   /* a wide table scrolls inside its card, not the page */
@media (min-width: 900px) { .two { grid-template-columns: 1.35fr 1fr; } }

.bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-inner { height: 100%; background: var(--blue); transition: width .3s; }

.job { border-bottom: 1px solid var(--border); padding: 14px 0; }
.job:last-child { border-bottom: 0; }
.job-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.job-title { font: 700 16px var(--head); color: var(--navy); }
.job-meta { color: var(--muted); font-size: 13px; }
.seats { font: 700 15px var(--head); color: var(--blue); white-space: nowrap; }
.site-name { font-weight: 600; color: var(--navy); }
.meta { color: var(--muted); font-size: 13px; }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.wa { background: #25d366; border-color: #25d366; color: #fff; font-weight: 600; }
.wa:hover { background: #1fb955; border-color: #1fb955; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fff; }
.wrap { max-width: 620px; margin: 0 auto; }
.hp { position: absolute; left: -9999px; }
.mark { display: none; }
.pri { font-weight: 600; }

/* ---------------------------------------------------------------- login */

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, var(--navy) 0%, #17406a 55%, var(--blue) 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 12px;
  box-shadow: 0 18px 50px rgba(16,34,55,.32); padding: 30px 26px;
}
.login-card img { height: 42px; width: auto; margin-bottom: 20px; }
.login-card h2 { margin: 0 0 4px; font-size: 20px; color: var(--navy); }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.login-card button { width: 100%; margin-top: 6px; }
.login-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- help */

.help-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .help-grid { grid-template-columns: 230px 1fr; align-items: start; } }
.toc { position: sticky; top: 74px; }
.toc a {
  display: block; padding: 7px 10px; border-radius: 6px; font-size: 14px;
  color: var(--navy); text-decoration: none;
}
.toc a:hover { background: var(--light-blue); color: var(--blue); }
.help h3 {
  margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 18px; color: var(--navy); scroll-margin-top: 78px;
}
.help h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.help h4 { margin: 16px 0 4px; font-size: 14.5px; color: var(--navy); }
.help p, .help li { color: #38434f; }
.help ol, .help ul { padding-left: 20px; }
.help li { margin: 5px 0; }
.help code {
  background: var(--warm-gray); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.faq { border-left: 3px solid var(--border); padding-left: 14px; margin: 14px 0; }

/* ------------------------------------------- phones: a table becomes cards */
/* A table marked .cards, whose cells carry data-label, is shown one card per
   row below 640px: nothing to swipe sideways for, every field labelled. The
   header row (tr.head) is not needed - each cell names itself. */
@media (max-width: 640px) {
  .scroller.cards { overflow: visible; margin: 0; padding: 0; }
  table.cards { min-width: 0; display: block; }
  table.cards tbody, table.cards tr { display: block; }
  table.cards tr.head { display: none; }
  table.cards tr {
    border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
    margin: 10px 0; background: #fff;
  }
  table.cards tr.closed { background: var(--warm); }
  table.cards td { display: block; padding: 6px 0; border: 0; min-width: 0 !important; }
  table.cards td[data-label]::before {
    content: attr(data-label); display: block; color: var(--muted);
    font: 600 11px/1.4 var(--body); text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: 3px;
  }
  table.cards td.actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }
  table.cards td.actions button { flex: 1 1 auto; }
  /* controls above a list stack, full width, and buttons suit a thumb */
  .row > select, .row > .search, .row > input { flex: 1 1 100%; min-width: 0; width: 100%; }
  button, .btn { min-height: 42px; }
  button.small, .btn.small { min-height: 38px; }
  .inp, select.inp { min-height: 40px; }
  .fillrow { grid-template-columns: 1fr 1fr; }
}

/* the 'who is in this position' row under a vacancy: no row chrome of its own,
   and on a phone it sits under the card like any other cell */
tr.who-row > td { border-top: 0; padding-top: 0; }
tr.who-row > td:empty, tr.who-row > td > div:empty { display: none; }
@media (max-width: 700px) { table.cards tr.who-row { display: block; } table.cards tr.who-row > td { display: block; } }

/* ---------------------------------------------------------------- colour
   A warmer palette on top of the brand blue: teal, amber, violet and coral
   for accents, stat tiles, module badges and the menu sections, so the app
   reads as more than blue and white while every control keeps its meaning
   (green = done, amber = look, red = wrong). */
:root {
  --teal: #0e8a7b;  --teal-bg: #e3f5f1;  --teal-line: #b9e3da;
  --amber: #c96f12; --amber-bg: #fff1df; --amber-line: #f5d6ad;
  --violet: #6b4fc3; --violet-bg: #eeeafb; --violet-line: #d5cbf3;
  --coral: #d4525a; --coral-bg: #fdeaeb;
  --sky-bg: #e8f1f8;
}
/* a thin band of colour across the top bar and the menu head */
.topbar::before, .drawer-head::before {
  content: ""; display: block; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--teal) 25% 50%, var(--amber) 50% 75%, var(--violet) 75% 100%);
}
.topbar { position: sticky; overflow: visible; }
.drawer-head { position: relative; }
.topbar-inner { padding-top: 12px; }
/* menu: each section its own colour, the module badges too */
.drawer-section:nth-of-type(1) { color: var(--teal); }
.drawer-section:nth-of-type(2) { color: var(--violet); }
.drawer-section:nth-of-type(3) { color: var(--amber); }
.drawer-body a:nth-of-type(2) .step { background: var(--teal-bg); color: var(--teal); }
.drawer-body a:nth-of-type(3) .step { background: var(--sky-bg); color: var(--blue); }
.drawer-body a:nth-of-type(4) .step { background: var(--violet-bg); color: var(--violet); }
.drawer-body a:hover { background: var(--teal-bg); color: var(--teal); }
.drawer-body a.here { background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff; }
/* the eyebrow step badges on page heads follow the same colours */
.page-head .eyebrow .step { background: linear-gradient(135deg, var(--blue), var(--teal)); }
/* stat tiles: four colours, a coloured figure and a top accent */
.summary .stat { border-top: 3px solid var(--blue); background: #fff; }
.summary .stat:nth-child(1) { border-top-color: var(--blue);   background: linear-gradient(180deg, var(--sky-bg), #fff 70%); }
.summary .stat:nth-child(1) b { color: var(--blue); }
.summary .stat:nth-child(2) { border-top-color: var(--teal);   background: linear-gradient(180deg, var(--teal-bg), #fff 70%); }
.summary .stat:nth-child(2) b { color: var(--teal); }
.summary .stat:nth-child(3) { border-top-color: var(--amber);  background: linear-gradient(180deg, var(--amber-bg), #fff 70%); }
.summary .stat:nth-child(3) b { color: var(--amber); }
.summary .stat:nth-child(4) { border-top-color: var(--violet); background: linear-gradient(180deg, var(--violet-bg), #fff 70%); }
.summary .stat:nth-child(4) b { color: var(--violet); }
/* home: the three modules */
.modules .module:nth-child(1) { border-top: 4px solid var(--teal); }
.modules .module:nth-child(1) .n { background: var(--teal-bg); color: var(--teal); }
.modules .module:nth-child(1) .go { color: var(--teal); }
.modules .module:nth-child(2) { border-top: 4px solid var(--blue); }
.modules .module:nth-child(3) { border-top: 4px solid var(--violet); }
.modules .module:nth-child(3) .n { background: var(--violet-bg); color: var(--violet); }
.modules .module:nth-child(3) .go { color: var(--violet); }
/* the how-to panel, warmer */
.howto { background: linear-gradient(135deg, var(--sky-bg), var(--teal-bg)); border-color: var(--teal-line); border-left-color: var(--teal); }
.howto h4 { color: var(--teal); }
/* tags: sources in teal, progress in violet, attention in amber */
.tag.src, .tag.feed { background: var(--teal-bg); color: var(--teal); border-color: var(--teal-line); }
.tag.notready, .tag.pri { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.tag.portal { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.warnbox { border-left-color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
/* primary buttons: a little depth */
button.primary, .btn.primary { background: linear-gradient(135deg, var(--blue), var(--teal)); border-color: transparent; }
button.primary:hover, .btn.primary:hover { background: linear-gradient(135deg, var(--blue-hover), var(--teal)); border-color: transparent; }
/* table heads: a faint tint instead of grey */
th { background: #f3f7fb; color: #4a5a6b; }
tbody tr:hover, table tr:hover { background: #f6fbfa; }
/* the sign-in card */
.login-card h2 { color: var(--teal); }
.login-card { border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--blue), var(--teal), var(--amber), var(--violet)) 1; }

/* ---------------------------------------------------------------- palettes
   Chosen on My profile and remembered per person. Each palette sets the
   four accent colours; everything above is written against the tokens, so
   nothing else changes. `ocean` is the default. */
[data-palette="sunset"] {
  --blue: #c2410c; --blue-hover: #d9531e; --blue-dark: #9a3412; --accent: #c2410c;
  --light-blue: #fdebe2; --sky-bg: #fdebe2;
  --teal: #d4525a; --teal-bg: #fdeaeb; --teal-line: #f5c6c9;
  --amber: #b58900; --amber-bg: #fff6d6; --amber-line: #f1dd8f;
  --violet: #7c3aed; --violet-bg: #efe9fd; --violet-line: #d6c7f8;
}
[data-palette="forest"] {
  --blue: #1b6b3a; --blue-hover: #21834a; --blue-dark: #145430; --accent: #1b6b3a;
  --light-blue: #e6f4ea; --sky-bg: #e6f4ea;
  --teal: #0e7c86; --teal-bg: #e1f3f5; --teal-line: #b6e0e5;
  --amber: #a16207; --amber-bg: #fdf3dc; --amber-line: #f1dba1;
  --violet: #4f46e5; --violet-bg: #e9e8fd; --violet-line: #cbc9f7;
}
[data-palette="plum"] {
  --blue: #6b21a8; --blue-hover: #7e2fc0; --blue-dark: #55178a; --accent: #6b21a8;
  --light-blue: #f1e8fa; --sky-bg: #f1e8fa;
  --teal: #be185d; --teal-bg: #fbe7f0; --teal-line: #f3bfd6;
  --amber: #c2410c; --amber-bg: #fdebe2; --amber-line: #f6c9b3;
  --violet: #0e8a7b; --violet-bg: #e3f5f1; --violet-line: #b9e3da;
}
[data-palette="slate"] {
  /* the original blue and white */
  --teal: #1a5789; --teal-bg: #e8f1f8; --teal-line: #cfe1f0;
  --amber: #1a5789; --amber-bg: #e8f1f8; --amber-line: #cfe1f0;
  --violet: #1a5789; --violet-bg: #e8f1f8; --violet-line: #cfe1f0;
}
[data-palette="slate"] .topbar::before, [data-palette="slate"] .drawer-head::before { background: var(--blue); }
[data-palette="slate"] .howto { background: var(--light-blue); border-color: #cfe1f0; border-left-color: var(--blue); }
[data-palette="slate"] .howto h4 { color: var(--blue-dark); }
[data-palette="slate"] button.primary, [data-palette="slate"] .btn.primary { background: var(--blue); }
[data-palette="slate"] .drawer-body a.here { background: var(--blue); }

/* ---------------------------------------------------------------- dark mode
   data-theme="dark" on <html>; "system" follows the device. Every surface
   that was white or near-white takes the card colour; the accent tints
   become deep versions of themselves so tags and panels keep their meaning. */
[data-theme="dark"] {
  --bg: #0f1620; --card: #172232; --ink: #e6edf5; --muted: #9fb0c3; --border: #2a3a4e;
  --navy: #e6edf5; --warm-gray: #1c2938; --steel: #6b7b8e;
  --light-blue: #17324a; --sky-bg: #17324a;
  --teal-bg: #10322f; --teal-line: #1e5a53;
  --amber-bg: #3a2a12; --amber-line: #6a4a1c;
  --violet-bg: #2a2347; --violet-line: #4a3f7a;
  --ok: #4ade80; --ok-bg: #12352a; --warn: #fbbf24; --warn-bg: #3a2c10; --danger: #f87171; --danger-bg: #3d1c1c;
  --coral-bg: #3d1c1c; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
  --line: #2a3a4e;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .topbar { background: rgba(23,34,50,.97); }
[data-theme="dark"] .drawer, [data-theme="dark"] .drawer-close, [data-theme="dark"] button, [data-theme="dark"] .btn,
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea, [data-theme="dark"] .box,
[data-theme="dark"] .summary .stat, [data-theme="dark"] .burger { background: var(--card); color: var(--ink); border-color: var(--border); }
[data-theme="dark"] button:hover, [data-theme="dark"] .btn:hover { background: var(--warm-gray); border-color: var(--steel); }
[data-theme="dark"] button.danger, [data-theme="dark"] .btn.danger { background: var(--card); border-color: #7a3a3a; }
[data-theme="dark"] th { background: #1c2938; color: var(--muted); }
[data-theme="dark"] tbody tr:hover, [data-theme="dark"] table tr:hover { background: #1c2938; }
[data-theme="dark"] .howto { background: linear-gradient(135deg, var(--sky-bg), var(--teal-bg)); color: var(--ink); }
[data-theme="dark"] .howto p, [data-theme="dark"] .howto li { color: #c9d6e3; }
[data-theme="dark"] .summary .stat:nth-child(n) { background: var(--card); }
[data-theme="dark"] .card, [data-theme="dark"] .module { background: var(--card); }
[data-theme="dark"] .drawer-body a { color: var(--ink); }
[data-theme="dark"] .drawer-body a:hover { background: var(--teal-bg); }
[data-theme="dark"] .tag { background: var(--warm-gray); color: var(--muted); border-color: var(--border); }
[data-theme="dark"] .tag.ok { background: var(--ok-bg); color: var(--ok); border-color: #1e5a3f; }
[data-theme="dark"] .tag.notready, [data-theme="dark"] .tag.pri { background: var(--amber-bg); color: var(--warn); border-color: var(--amber-line); }
[data-theme="dark"] .tag.rejected, [data-theme="dark"] .tag.danger { background: var(--danger-bg); color: var(--danger); border-color: #7a3a3a; }
[data-theme="dark"] .warnbox { color: var(--ink); }
[data-theme="dark"] .login-card, [data-theme="dark"] .modal, [data-theme="dark"] .sheet { background: var(--card); color: var(--ink); }
[data-theme="dark"] code { background: #1c2938; color: #c9d6e3; }
[data-theme="dark"] a { color: #7fb3e0; }
[data-theme="dark"] .drawer-body a.here { color: #fff; }
[data-theme="dark"] button.primary, [data-theme="dark"] .btn.primary { color: #fff; background: linear-gradient(135deg, var(--blue), var(--teal)); border-color: transparent; }
[data-theme="dark"] .pager button.on { background: var(--blue); color: #fff; }

/* the appearance picker on My profile */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--card); font-weight: 500; }
.swatch.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky-bg); }
.swatch i { display: inline-block; width: 12px; height: 22px; border-radius: 3px; }
.swatch .dots { display: inline-flex; gap: 2px; }
