/* Xroads Portal. Neutral enterprise UI with XRoads41 brand colors (from xroads41.com):
   blue #286FB7 (header, primary), gold #FFB100 (highlights), pink #EE2F53, deep purple #2B1A3E (headings). */
:root {
  --brand-blue: #286fb7;
  --brand-blue-dark: #1f5a96;
  --brand-gold: #ffb100;
  --brand-pink: #ee2f53;
  --brand-purple: #2b1a3e;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f9f9fa;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --accent: #286fb7;
  --accent-hover: #1f5a96;
  --accent-soft: #eaf2fb;
  --heading: #2b1a3e;
  --accent-ink: #ffffff;
  --ok: #15803d; --ok-bg: #f0fdf4; --ok-line: #bbf7d0;
  --warn: #a16207; --warn-bg: #fefce8; --warn-line: #fde68a;
  --bad: #b91c1c; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --info: #1d4ed8; --info-bg: #eff6ff; --info-line: #bfdbfe;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(24, 24, 27, .04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --surface: #141417;
    --surface-2: #1a1a1e;
    --line: #27272a;
    --line-strong: #3f3f46;
    --ink: #ececef;
    --ink-2: #c4c4cc;
    --muted: #8b8b95;
    --accent: #6aa8e8;
    --accent-hover: #8dbdf0;
    --accent-soft: #14253a;
    --heading: #ececef;
    --brand-blue: #1d4f86;
    --accent-ink: #0c0c0e;
    --ok: #4ade80; --ok-bg: #0f2418; --ok-line: #1b4d2e;
    --warn: #facc15; --warn-bg: #2a2410; --warn-line: #4d4214;
    --bad: #f87171; --bad-bg: #2b1414; --bad-line: #5a1f1f;
    --info: #93b4ff; --info-bg: #141f38; --info-line: #24386b;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; color: var(--heading); }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 12px; color: var(--heading); }
h3 { font-size: .875rem; font-weight: 600; margin: 18px 0 8px; color: var(--ink-2); }
p { margin: 0 0 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* Top bar: XRoads41 blue with the white wordmark, as on xroads41.com */
.topbar { background: var(--brand-blue); border-bottom: 3px solid var(--brand-gold); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; font-size: .95rem; margin-right: 8px; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 30px; width: auto; }
.brand-text { display: block; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .35); line-height: 1.2; }
.brand small { display: block; font-weight: 400; color: rgba(255, 255, 255, .78); font-size: .75rem; line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.nav-account { margin-left: auto; }
.nav a, .nav .linklike { color: rgba(255, 255, 255, .88); padding: 6px 10px; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; }
.nav a:hover, .nav .linklike:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .18); color: #fff; }
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-gold); color: #2b1a3e; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.viewas { background: var(--brand-purple); color: #fff; font-size: .85rem; }
.viewas .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.viewas .btn { height: 30px; background: var(--brand-gold); border-color: var(--brand-gold); color: #2b1a3e; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }
.inline { display: inline; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 32px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .table { margin: 0; }
.card.flush > .table td:first-child, .card.flush > .table th:first-child { padding-left: 20px; }
.card.flush > .table td:last-child, .card.flush > .table th:last-child { padding-right: 20px; }
.card.flush > h2.card-title { padding: 16px 20px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px 4px; }
.card-head h2 { margin: 0; }
.card-head.flush-head { padding: 0 0 8px; }
.card.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.card.tile { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.card.tile:hover { border-color: var(--line-strong); text-decoration: none; }
.count { display: inline-block; margin-left: 6px; color: var(--muted); font-weight: 500; font-size: .8rem; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.grid2 > .card { margin-bottom: 0; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.settings { display: grid; gap: 16px; max-width: 760px; }
.settings > .card { margin-bottom: 0; }

.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.hero .actions { margin-top: 8px; }
.lead { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 14px 0; font-size: .9rem; }
.table .empty { padding: 16px 6px; }
.dim { opacity: .5; }
.devnote { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); padding: 8px 10px; border-radius: var(--radius-sm); font-size: .85rem; }
.details-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0; font-size: .9rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1, .page-head h2 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: .875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: .8125rem; }
.btn-lg { height: 42px; width: 100%; font-size: .95rem; }

/* Forms */
.form { display: grid; gap: 14px; }
.form h3 { margin-bottom: 0; }
.form label, .filters label { display: grid; gap: 6px; font-weight: 500; font-size: .8125rem; color: var(--ink-2); }
.form .row, form.row { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 600px) { .form .row, form.row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 38px;
}
@media (min-width: 768px) { input, select, textarea { font-size: .875rem; } }
input:disabled { background: var(--surface-2); color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 6px; }
.check { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: .875rem !important; color: var(--ink) !important; }
.check input { margin-top: 3px; }
.hint { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.err { font-weight: 500; font-size: .8rem; color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 600; font-size: .875rem; padding: 0 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: flex !important; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 12px; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: .875rem; margin-bottom: 8px; }

/* Toggle switches for preferences */
.toggle { display: flex !important; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 400 !important; color: var(--ink) !important; font-size: .875rem !important; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; flex: 0 0 36px; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; cursor: pointer; margin-top: 2px; border: 0; padding: 0; min-height: 0; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle strong { display: block; font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { min-width: 160px; flex: 1 1 160px; }
.filters label.grow { flex: 2 1 260px; }
.filters .btn { flex: 0 0 auto; height: 38px; }

/* Feedback */
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .875rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.flash a { color: inherit; font-weight: 600; text-decoration: underline; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: .72rem; font-weight: 500; line-height: 1.5; vertical-align: middle; white-space: nowrap; border: 1px solid; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.tabs a { padding: 4px 12px; border-radius: 4px; color: var(--ink-2); font-size: .8125rem; font-weight: 500; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.tabs a:hover { text-decoration: none; }

/* Dashboard */
.announcements { display: grid; gap: 8px; margin-bottom: 16px; }
.announcement { margin: 0; background: var(--accent-soft); border: 1px solid var(--info-line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px; }
.announcement summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0; color: var(--ink); list-style: none; }
.announcement summary::-webkit-details-marker { display: none; }
.announcement-title::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); font-size: .75rem; }
.announcement[open] .announcement-title::before { content: "▾"; }
.announcement-title { flex: 1 1 auto; font-weight: 600; }
.announcement-meta { color: var(--muted); font-size: .78rem; font-weight: 400; }
.announcement-body { margin-top: 8px; font-size: .9rem; color: var(--ink-2); }
.quick-actions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 16px; }
.qa { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); box-shadow: var(--shadow); }
.qa:hover { border-color: var(--accent); text-decoration: none; }
.qa strong { font-weight: 600; font-size: .9rem; }
.qa span { color: var(--muted); font-size: .78rem; }
.qa-alert { border-color: var(--brand-gold); background: var(--warn-bg); }
.perk { margin-top: 12px; }
.perk-row { display: flex; justify-content: space-between; gap: 8px; font-size: .875rem; margin-bottom: 4px; }

/* Job board */
.day { margin: 24px 0 10px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.shift-list { display: grid; gap: 8px; }
.shift { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.shift-main { flex: 1 1 260px; min-width: 0; }
.shift-title { font-weight: 600; font-size: .925rem; }
.shift-meta { color: var(--muted); font-size: .8125rem; }
.shift-notes { font-size: .8125rem; margin-top: 4px; color: var(--ink-2); }
.shift-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shift-open { font-size: .8125rem; color: var(--muted); min-width: 52px; }

meter { width: 88px; height: 6px; }
.perk meter { width: 100%; }
meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 3px; height: 6px; }
meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 3px; }
meter.fill-full::-webkit-meter-optimum-value { background: var(--ok); }
meter.fill-low::-webkit-meter-optimum-value { background: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats.compact { margin-bottom: 4px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stats.compact .stat { background: var(--surface-2); }
.stat b { display: block; font-size: 1.375rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .78rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 8px 10px; }
.table td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.actions-cell { white-space: nowrap; }
.clockin input { width: 70px; min-height: 30px; height: 30px; padding: 2px 6px; display: inline-block; margin-right: 4px; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { display: block; border: 0; padding: 3px 10px; text-align: left; }
  .card.flush > .table td:first-child, .card.flush > .table td:last-child { padding-left: 20px; padding-right: 20px; }
  .actions-cell, .nowrap { white-space: normal; }
}

/* Directory */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.contact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.contact-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .8rem; }
.contact-name { font-weight: 600; }
.contact-title { color: var(--muted); font-size: .8125rem; }
.contact-facts { display: grid; grid-template-columns: 96px 1fr; gap: 4px 8px; margin: 0; font-size: .8125rem; }
.contact-facts dt { color: var(--muted); }
.contact-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: .875rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 14px 0 0; font-size: .875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.decision { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.issue-list { display: grid; gap: 10px; }
.issue-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.issue-actions input { width: 240px; display: inline-block; min-height: 30px; height: 30px; padding: 2px 8px; }
/* Paperwork forms */
.doc-body { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 12px 0; font-size: .875rem; line-height: 1.6; color: var(--ink-2); max-height: 420px; overflow-y: auto; }
.doc-body.certification { max-height: none; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid > * { grid-column: 1 / -1; } .form-grid > .half { grid-column: auto; } }
fieldset.radios { padding: 10px 12px; }
@media print {
  .topbar, .viewas, .footer, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 0; box-shadow: none; padding: 0; }
}
[hidden] { display: none !important; }
