/* Pratt IT Workorder — styled to the Pratt Customer Facing Design System.
   Tokens are copied from the system's colors_and_type.css; keep them in step with it rather than
   eyedropping new hexes. Rules of the system: Inter 400/700/800 only, headings 800 caps,
   radius 0, no shadows, Sky is the click and Green is the commit. */
:root {
  --pratt-green: #00AE4D;
  --pratt-blue:  #003DA6;
  --pratt-navy:  #001F5B;
  --pratt-sky:   #00A6E0;
  --pratt-ink:   #000000;
  --pratt-paper: #F2F2F2;
  --pratt-ash:   #CFD2D3;
  --pratt-steel: #5B6670;
  --pratt-white: #FFFFFF;
  --fg-1: var(--pratt-ink);
  --fg-2: #231F20;
  --fg-3: var(--pratt-steel);
  --rule: var(--pratt-ash);
  --action: var(--pratt-sky);
  --action-hover: #0090C4;
  --commit: var(--pratt-green);
  --commit-hover: #009341;
  --link: var(--pratt-blue);
  --alert: #C4341F;
  --font-sans: 'Inter', "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --w-measure: 1100px;
  --t-hover: 150ms ease;
  --ground: linear-gradient(170deg, #001F5B 0%, #004E8C 60%, #00893F 100%);
  color-scheme: light;
}
* { box-sizing: border-box; border-radius: 0; }
html, body { background: var(--pratt-white); }
body { overflow-x: clip; }   /* full-bleed bands use 100vw, which includes the vertical scrollbar */
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.5; color: var(--fg-1); display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--pratt-white); border: 1px solid var(--rule); padding: 10px 12px; color: var(--fg-2); }
input:focus, select:focus, textarea:focus { border-color: var(--action); outline: none; box-shadow: inset 0 0 0 1px var(--action); }
h1, h2, h3 { font-weight: 800; text-transform: uppercase; letter-spacing: normal; color: var(--fg-1); }
h1 { margin: 0 0 8px; font-size: 45px; line-height: 54px; }
h2 { margin: 36px 0 12px; font-size: 24px; line-height: 28.8px; }
.k-navy { color: var(--pratt-navy); } .k-sky { color: var(--pratt-sky); } .k-green { color: var(--pratt-green); }

/* Buttons — hierarchy by fill alone. Plain buttons are the Sky click; .primary marks a form commit (Green). */
button, a.button, .ms-btn {
  display: inline-block; font-size: 16px; font-weight: 700; line-height: 1; border: 0; padding: 13px 30px;
  background: var(--action); color: #fff; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-hover);
}
button:hover, a.button:hover { background: var(--action-hover); }
button.primary { background: var(--commit); text-transform: none; padding: 11px 24px; }
button.primary:hover { background: var(--commit-hover); }
button.quiet { background: var(--pratt-paper); color: var(--fg-2); text-transform: none; padding: 12px 24px; }
button.quiet:hover { background: var(--pratt-ash); }
button.link { background: none; color: var(--link); padding: 0 4px; text-transform: none; font-weight: 700; }
button:disabled:not(.is-busy), button:disabled:not(.is-busy):hover { background: var(--pratt-paper); color: #A8B0B6; cursor: default; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }   /* author display rules (header, forms) would otherwise override the attribute */
.muted { color: var(--fg-3); }
.small { font-size: 14px; }
.error { color: var(--alert); font-weight: 700; }

/* ---------- Header stack: navy utility bar, brand bar, corrugated flute ---------- */
header#top { color: #fff; }
.util { background: var(--pratt-navy); min-height: 49px; padding: 5px 24px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; font-size: 14px; font-weight: 700; }
.util button { background: var(--pratt-sky); font-size: 14px; padding: 8px 18px; text-transform: none; }
.util button:hover { background: var(--action-hover); }
.role { background: var(--pratt-green); color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 4px 10px; }
.mainbar { min-height: 80px; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; background: linear-gradient(100deg, #00351F 0%, #005E37 45%, #003DA6 100%); }
.brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; }
.brand img { width: 260px; height: auto; display: block; }
.wordmark { font-size: 24px; font-weight: 800; letter-spacing: normal; white-space: nowrap; }
.wordmark b { color: var(--pratt-green); font-weight: 800; }
.wordmark--light { color: var(--fg-2); }
.brand .wordmark b { color: #fff; }   /* the header artwork is the all-white lockup */
.product { font-size: 14px; font-weight: 800; text-transform: uppercase; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .5); }
nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
nav a { position: relative; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; padding: 6px 0; transition: color var(--t-hover); }
nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 0; height: 2px; background: var(--pratt-sky); transition: left var(--t-hover), right var(--t-hover); }
nav a:hover, nav a.active { color: var(--pratt-sky); }
nav a:hover::after, nav a.active::after { left: 0; right: 0; }
.flute { height: 12px; background-image: repeating-linear-gradient(90deg, var(--pratt-green) 0 1px, transparent 1px 4px, var(--pratt-sky) 4px 5px, transparent 5px 8px); }

main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: calc(var(--w-measure) + 48px); margin: 0 auto; padding: 40px 24px 72px; }

/* ---------- Full-bleed section band: photo (when present) over the brand gradient ---------- */
.band { margin: -40px calc(50% - 50vw) 36px; padding: 64px 24px; text-align: center; color: #fff; background-color: var(--pratt-navy); background-size: cover; background-position: center; }
.band h1 { color: #fff; font-size: 55px; line-height: 1.12; letter-spacing: -.015em; max-width: 20ch; margin: 0 auto; text-wrap: balance; }
.band p { color: #D8E2F0; font-size: 18px; line-height: 24px; max-width: 56ch; margin: 16px auto 28px; }
.home-band { background-image: linear-gradient(rgba(0, 31, 91, .55), rgba(0, 31, 91, .55)), url("img/home-band.jpg"), var(--ground); }
.home-band h1 { font-size: 44px; }
.home-band h1 .k-sky { font-size: 1.6em; line-height: 1; }

/* ---------- Sign-in ---------- */
.signin-band { flex: 1; margin: -40px calc(50% - 50vw) -72px; padding: 10vh 24px; display: flex; align-items: flex-start; justify-content: flex-start;
  background: linear-gradient(90deg, rgba(0, 31, 91, .35), rgba(0, 31, 91, 0) 60%), url("img/signin-hero.jpg") center / cover, var(--ground); }
.signin { width: 100%; max-width: 440px; margin-left: max(0px, calc((100vw - var(--w-measure)) / 2)); background: #fff; padding: 36px 32px; border-top: 6px solid var(--pratt-green); }
.signin .logo-2c { width: 240px; height: auto; display: block; margin-bottom: 24px; }
.signin h1 { font-size: 30px; line-height: 36px; }
.signin-form { display: grid; gap: 10px; margin-top: 20px; }
.signin-form label { font-size: 14px; font-weight: 700; }
.signin-form button { justify-self: start; }
.ms-btn { width: 100%; margin-top: 20px; }
.demo-note { margin-top: 24px; font-size: 14px; color: var(--fg-3); border-top: 1px solid var(--rule); padding-top: 14px; }

/* ---------- Home: stat counters ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px; margin: 0 0 24px; background: var(--rule); border: 2px solid var(--rule); }
.tile { display: grid; gap: 4px; padding: 20px 22px; background: #fff; color: var(--fg-3); font-size: 14px; font-weight: 700; text-transform: uppercase; text-decoration: none; transition: background-color var(--t-hover); }
.tile:hover { background: var(--pratt-paper); }
.tile-n { font-size: 45px; line-height: 54px; font-weight: 800; color: var(--pratt-navy); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inline-search, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { margin: 20px 0; }
.empty { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--pratt-navy); color: #fff; }
.empty img { width: 120px; height: auto; display: block; }
.empty p { margin: 0; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--pratt-navy); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-size: 14px; font-weight: 800; text-transform: uppercase; color: var(--fg-1); background: var(--pratt-paper); }
td:nth-child(2) { white-space: normal; min-width: 220px; }
td a { font-weight: 700; }
tbody tr:hover { background: #F7F8F8; }
td.overdue, span.overdue { color: var(--alert); font-weight: 700; }

/* ---------- Status and priority tags (square, never pills) ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; line-height: 1.2; color: #fff; background: var(--pratt-steel); }
.st-open { background: var(--pratt-sky); }
.st-in-progress { background: var(--pratt-blue); }
.st-waiting-on-user { background: #fff; color: var(--pratt-steel); box-shadow: inset 0 0 0 2px var(--pratt-steel); }
.st-resolved { background: var(--pratt-green); }
.st-closed { background: var(--pratt-ash); color: var(--fg-2); }
.prio { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 7px; line-height: 1.2; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--rule); }
.prio-p1 { color: #fff; background: var(--alert); box-shadow: none; }
.prio-p2 { color: var(--pratt-navy); box-shadow: inset 0 0 0 2px var(--pratt-navy); }

/* ---------- Ticket page ---------- */
.back { align-self: flex-start; display: inline-block; margin-bottom: 16px; font-size: 14px; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.ticket-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.tid { font-size: 14px; font-weight: 800; color: var(--fg-3); }
.ticket-title { font-size: 30px; line-height: 36px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin: 20px 0; padding: 20px 22px; background: var(--pratt-paper); }
.facts dt { color: var(--fg-3); font-size: 14px; font-weight: 700; text-transform: uppercase; } .facts dd { margin: 2px 0 0; color: var(--fg-2); overflow-wrap: anywhere; }
.desc { white-space: pre-wrap; max-width: 75ch; }
.tech-panel { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; max-width: 620px; padding: 20px 22px; background: #fff; border: 1px solid var(--rule); border-top: 6px solid var(--pratt-navy); }
.tech-panel h2 { grid-column: 1 / -1; margin: 0 0 4px; font-size: 18px; line-height: 24px; color: var(--pratt-navy); }
.tech-panel label { font-size: 14px; font-weight: 700; }
.tech-panel > button, .tech-panel > .error { grid-column: 2; justify-self: start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--rule); }
.ev { position: relative; margin: 0 0 18px; }
.ev::before { content: ""; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; background: var(--pratt-ash); }
.ev-comment::before { background: var(--pratt-sky); } .ev-status::before { background: var(--pratt-green); } .ev-assigned::before { background: var(--pratt-navy); }
.ev-head { font-size: 14px; color: var(--fg-2); } .ev-head strong { font-weight: 700; } .ev-head time { color: var(--fg-3); margin-left: 8px; }
.ev-body { margin: 8px 0 0; padding: 12px 14px; background: var(--pratt-paper); white-space: pre-wrap; max-width: 75ch; }
.comment-form { display: grid; gap: 10px; max-width: 640px; margin-top: 20px; }
.comment-form label { font-size: 14px; font-weight: 700; }
.comment-form button { justify-self: start; }

/* ---------- Knowledge base ---------- */
.kb-group { margin-bottom: 8px; }
.kb-group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.kb-group li { border-bottom: 1px solid var(--rule); padding: 10px 0; }
.kb-group a { font-weight: 700; text-decoration: none; }
.kb-group a:hover { text-decoration: underline; }
.md { max-width: 75ch; }
.md h3, .md h4, .md h5 { margin: 24px 0 8px; font-size: 18px; line-height: 24px; }
.md code { background: var(--pratt-paper); padding: 1px 5px; font-size: .92em; }
.md li { margin-bottom: 4px; }

/* ---------- Ask IT ---------- */
.chat-log { display: flex; flex-direction: column; gap: 12px; min-height: 45vh; max-height: 62vh; overflow-y: auto; padding: 16px; background: var(--pratt-paper); margin: 16px 0; }
.msg { max-width: 760px; padding: 12px 16px; }
.msg.me { align-self: flex-end; background: var(--pratt-navy); color: #fff; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: #fff; color: var(--fg-2); border-left: 4px solid var(--pratt-sky); }
.msg .md p { margin: 0 0 8px; } .msg .md p:last-child { margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; background: var(--pratt-navy); color: #fff; text-decoration: none; }
.badge.ticket { background: var(--pratt-green); }
.badge:hover { background: var(--pratt-sky); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; } .chat-form textarea { flex: 1; resize: none; line-height: 1.4; min-height: 84px; max-height: 200px; overflow-y: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; } .page-head h1 { margin: 0; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.starter { background: var(--pratt-white); color: var(--pratt-navy); border: 1px solid var(--pratt-ash); padding: 8px 12px; font-weight: 700; text-transform: none; text-align: left; }
.starter:hover { border-color: var(--action); color: var(--action); }

/* ---------- Footer: true black, Ash legal bar ---------- */
footer#foot { background: #000; color: #fff; }
.foot-cols { max-width: calc(var(--w-measure) + 48px); margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.foot-cols h4 { margin: 0 0 10px; font-size: 14px; line-height: 21px; font-weight: 800; text-transform: uppercase; color: var(--pratt-ash); }
.foot-cols a, .foot-cols p { display: block; margin: 0; color: #fff; font-size: 14px; line-height: 26px; text-decoration: none; }
.foot-cols a:hover { color: var(--pratt-green); }
.legal { background: var(--pratt-ash); color: var(--fg-2); font-size: 12px; line-height: 1.5; padding: 14px 24px; text-align: center; }

@media (max-width: 760px) {
  h1 { font-size: 30px; line-height: 36px; }
  .band h1 { font-size: 36px; }
  .brand img { width: 180px; }
  .product { display: none; }
  .signin { margin-left: 0; }
  .tech-panel { grid-template-columns: 1fr; } .tech-panel > button, .tech-panel > .error { grid-column: 1; }
}

/* ---------- Loading and response feedback ---------- */
/* Progress stripe: the brand flute, sliding, pinned to the top edge while any request runs. */
#progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  background-image: repeating-linear-gradient(90deg, var(--pratt-green) 0 12px, var(--pratt-sky) 12px 24px); background-size: 48px 4px; }
body.busy #progress { opacity: 1; animation: stripe 600ms linear infinite; }
@keyframes stripe { to { background-position: 48px 0; } }

/* Placeholder blocks while a page loads. */
.skeleton { display: grid; gap: 12px; padding: 4px 0; }
.sk { background: linear-gradient(90deg, var(--pratt-paper) 0%, #E4E7E8 50%, var(--pratt-paper) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.sk-title { height: 44px; width: 45%; margin-bottom: 12px; }
.sk-row { height: 44px; }
.sk-row:nth-child(odd) { width: 92%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* A list being refreshed in place dims until the new results land, then fades in. */
.results { transition: opacity 150ms ease; }
.results.is-refreshing { opacity: .45; pointer-events: none; }
.count { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--fg-3); text-transform: uppercase; }
.enter { animation: enter 280ms ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Button in flight: keeps its color, shows a ring spinner, ignores presses.
   The one round shape in the system: a square spinner reads as a wobbling box, not progress. */
button.is-busy { cursor: progress; }
button.is-busy::after { content: ""; display: inline-block; box-sizing: border-box; width: 16px; height: 16px; margin-left: 10px; vertical-align: -3px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%;
  animation: spin 650ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Something just changed: a pale green wash that fades back. */
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background-color: #CFF3DE; } to { background-color: transparent; } }
.pill.flash { animation: pop 500ms ease-out; }
@keyframes pop { 40% { transform: scale(1.18); } }

/* Chat typing indicator: three square dots. */
.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; background: var(--pratt-sky); animation: dot 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* Toasts: square, bottom right, brand grounds. */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 14px 18px; background: var(--pratt-navy); color: #fff; font-size: 14px; font-weight: 700; border-left: 6px solid var(--pratt-green); cursor: pointer; animation: toast-in 220ms ease-out; }
.toast-bad { border-left-color: var(--alert); }
.toast-info { border-left-color: var(--pratt-sky); }
.toast.leaving { opacity: 0; transform: translateX(12px); transition: opacity 250ms ease, transform 250ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  body.busy #progress { opacity: 1; }
}
