/* Call-center portal. Built for speed on a call: large type, high contrast,
   one search box, and every account on one page with a section menu. */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1b2430;
  --muted: #5b6676;
  --line: #dde3ea;
  --brand: #1f4e79;
  --brand-ink: #ffffff;
  --accent: #0b6bcb;
  --ok: #1d7a46;
  --ok-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --bad: #a1262b;
  --bad-bg: #fdecec;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.25rem;
  background: var(--brand); color: var(--brand-ink);
}
.brand { color: var(--brand-ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand small { font-weight: 400; opacity: .8; margin-left: .3rem; }
.hsearch { flex: 1; display: flex; max-width: 640px; }
.hsearch input { flex: 1; border: 0; border-radius: 8px 0 0 8px; padding: .55rem .8rem; font-size: 1rem; }
.hsearch button { border: 0; border-radius: 0 8px 8px 0; padding: 0 1rem; background: #e8eef5; font-weight: 600; cursor: pointer; }
.who { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.who form { margin: 0; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---- cards, forms ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
input[type=text], input[type=search], input[type=password], input:not([type]) {
  width: 100%; padding: .65rem .8rem; font-size: 1rem;
  border: 1px solid #b9c3cf; border-radius: 8px;
}
input:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8cc0f5; outline-offset: 1px; }
button { font: inherit; }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: .7rem 1.4rem; font-weight: 600; cursor: pointer; }
.primary:hover { filter: brightness(.95); }
.wide { width: 100%; margin-top: 1.25rem; }
.alert { background: var(--bad-bg); color: var(--bad); padding: .7rem .9rem; border-radius: 8px; }
.notice { background: var(--ok-bg); color: var(--ok); padding: .7rem .9rem; border-radius: 8px; }
.signin { max-width: 420px; margin: 3rem auto; }

/* ---- start page ---- */
.hero { max-width: 760px; margin: 3rem auto; text-align: center; }
.hero h1 { font-size: 2rem; }
.bigsearch { display: flex; gap: .5rem; margin: 1.25rem 0; }
.bigsearch input { font-size: 1.2rem; padding: .9rem 1rem; }
.tips { list-style: none; padding: 0; color: var(--muted); text-align: left; display: inline-block; }
.tips li { margin: .25rem 0; }

/* ---- search results ---- */
.results { list-style: none; margin: 0; padding: 0; }
.results li a {
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.2rem; margin-bottom: .5rem; color: inherit; text-decoration: none;
}
.results li a:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(11,107,203,.15); }
.results .name { font-weight: 700; font-size: 1.1rem; }
.results .meta { color: var(--muted); grid-column: 1 / -1; }

/* ---- record pages ---- */
.crumbs { margin-bottom: .75rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.layout { display: grid; grid-template-columns: 210px 1fr; gap: 1.25rem; align-items: start; }
.toc { position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: .2rem; }
.toc a { padding: .55rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.toc a:hover, .toc a.here { background: #e3ecf7; color: var(--brand); }
section.card { scroll-margin-top: 5rem; }

dl.fields { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; margin: 0; }
dl.fields dt, dl.fields dd { padding: .45rem 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.fields dt { color: var(--muted); padding-right: 1rem; }
dl.fields dd { font-weight: 500; overflow-wrap: anywhere; }
.empty { color: #9aa4b1; font-weight: 400; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; font-size: .9rem; }

.pill { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #e8eef5; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tabs button { border: 1px solid var(--line); background: #f7f9fb; border-radius: 8px; padding: .4rem .9rem; cursor: pointer; font-weight: 600; }
.tabs button[aria-selected=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-tabpanel][hidden] { display: none; }

.actions { display: flex; gap: .75rem 1.5rem; flex-wrap: wrap; }

@media (max-width: 800px) {
  .top { flex-wrap: wrap; }
  .hsearch { order: 3; flex-basis: 100%; max-width: none; }
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; }
  dl.fields { grid-template-columns: 1fr; }
  dl.fields dt { border-bottom: 0; padding-bottom: 0; }
  .bigsearch { flex-direction: column; }
}

/* ---- added with the account/contact pages ---- */
dl.fields dd { white-space: pre-line; }
.resultshead { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.resultshead h1 { margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.segmented a { padding: .45rem 1rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.segmented a + a { border-left: 1px solid var(--line); }
.segmented a[aria-current] { background: var(--accent); color: #fff; }
.results .title { font-style: italic; }
.results.compact li a { padding: .6rem 1rem; }

.summary { border-top: 5px solid var(--brand); }
.sumhead { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.booktitle { font-size: 1.15rem; font-style: italic; margin: 0; color: var(--muted); }
.pid { text-align: right; }
.pid strong { display: block; font-size: 1.6rem; letter-spacing: .02em; }
.sumgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.25rem 0; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sumgrid > div { display: flex; flex-direction: column; gap: .25rem; align-items: start; }
.sumgrid a.pill { text-decoration: none; font-size: 1rem; }
.actions form { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 0; }
.hint { margin-left: .25rem; }
h2.sub { font-size: 1rem; margin: 1.5rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tabs button.off { text-decoration: line-through; opacity: .7; }
table.steps tr.done td:first-child::before { content: "\2713"; color: var(--ok); font-weight: 700; margin-right: .5rem; }
table.steps tr.todo td:first-child::before { content: "\25CB"; color: #b5bec9; margin-right: .5rem; }
table.steps tr.todo td:first-child { color: var(--muted); }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
tr.cancelled td:nth-child(2) { text-decoration: none; }
@media (max-width: 800px) {
  .sumgrid { grid-template-columns: 1fr 1fr; }
  .sumhead { flex-direction: column; }
  .pid { text-align: left; }
  table.grid { display: block; overflow-x: auto; }
}

/* ---- Ask the Playbook ---- */
.navlinks { display: flex; gap: .25rem; white-space: nowrap; }
.navlinks a { color: var(--brand-ink); text-decoration: none; font-weight: 600; padding: .45rem .7rem; border-radius: 8px; background: rgba(255,255,255,.12); }
.navlinks a:hover { background: rgba(255,255,255,.22); }
textarea { width: 100%; padding: .7rem .8rem; font: inherit; font-size: 1.05rem; border: 1px solid #b9c3cf; border-radius: 8px; resize: vertical; }
.warnline { color: var(--warn); margin: .4rem 0 .9rem; }
.answer .question { font-weight: 700; font-size: 1.1rem; margin: 0 0 .75rem; }
.answertext { white-space: pre-line; }
.quotes { margin-top: 1rem; }
.quotes summary { cursor: pointer; color: var(--muted); font-weight: 600; }
blockquote { margin: .6rem 0; padding: .5rem .9rem; border-left: 4px solid var(--accent); background: #f3f7fc; border-radius: 0 8px 8px 0; white-space: pre-line; }
.vote { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.vote form { display: flex; gap: .4rem; margin: 0; }
.vote button { border: 1px solid var(--line); background: #f7f9fb; border-radius: 8px; padding: .35rem .8rem; cursor: pointer; font-weight: 600; }
.vote .downvote input { width: 18rem; max-width: 60vw; padding: .35rem .6rem; font-size: .9rem; }
.upload { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.upload p { flex-basis: 100%; margin: 0; }
.nowrap { white-space: nowrap; }
.busy { opacity: .6; pointer-events: none; }
.busymsg { color: var(--muted); font-weight: 600; margin-left: .75rem; }
@media (max-width: 800px) { .navlinks { order: 2; } }

/* ---- tickets ---- */
select { width: 100%; padding: .6rem .7rem; font: inherit; border: 1px solid #b9c3cf; border-radius: 8px; background: #fff; }
.actions { align-items: center; }
a.secondary { display: inline-block; padding: .65rem 1.2rem; border: 2px solid var(--accent); border-radius: 8px; color: var(--accent); font-weight: 600; text-decoration: none; }
a.secondary:hover { background: #eef5fd; }
.ticketform { max-width: 640px; }
.actions.spaced { margin-top: 1rem; }

/* ---- supervisor pages, guide ---- */
.adminnav { margin-bottom: 1rem; }
.rowactions { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.rowactions form { margin: 0; }
button.link { color: var(--accent); }
.top button.link { color: inherit; }
.pwbox { background: var(--warn-bg); border: 2px solid #e8c36a; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; }
.pwbox p { margin: .3rem 0; }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; }
.addagent { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.addagent > div { flex: 1 1 14rem; }
.addagent label { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.filters select { width: auto; }
.guidehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.secondarybtn { border: 2px solid var(--accent); background: #fff; color: var(--accent); border-radius: 8px; padding: .5rem 1rem; font-weight: 600; cursor: pointer; }
.guide h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
.guide li { margin: .3rem 0; }
.guide dl.fields { grid-template-columns: minmax(150px, 28%) 1fr; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35rem; font-family: inherit; background: #f7f9fb; }
@media print {
  .top, .secondarybtn { display: none; }
  body { background: #fff; font-size: 11pt; }
  .card { border: 0; padding: 0; margin-bottom: .75rem; break-inside: avoid; }
  main { padding: 0; }
}
