/*
 * The application's one stylesheet, served by Propshaft as-is.
 *
 * The identity is the public site's (website/styles.css next to this repo): the same palette
 * variables, the same system font stack, the same header and brand block, so the app reads as the
 * same product as ascendancillary.com. Keep the two in step by hand; the site is static and has no
 * build to share. reports/show.html.erb keeps its inline styles on purpose: it is rendered without
 * this layout and may be embedded elsewhere.
 */

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-tint: #ecfdf5;
  --accent: #14b8a6;
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }

/* Header, brand and navigation — the site's header with a nav and a signed-in slot added */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--maxw);
  min-height: 60px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
  display: block;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand__name span { color: var(--brand); }

.site-nav {
  display: flex;
  gap: 18px;
}

.site-nav__link {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav__link:hover { color: var(--ink); border-bottom-color: var(--line); }
.site-nav__link[aria-current="page"] { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* Pushed to the right; empty until someone is signed in. */
.site-header__user {
  margin-left: auto;
  color: var(--ink-muted);
}

/* Flash banners — the green "that worked" and the red "that was refused" */

.flash {
  max-width: var(--maxw);
  margin: 16px auto 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.flash--notice { background: var(--brand-tint); border: 1px solid var(--brand); color: var(--brand-dark); }
.flash--alert { background: #fef2f2; border: 1px solid #b91c1c; color: #7f1d1d; }

@media (max-width: 1128px) {
  .flash { margin-left: 24px; margin-right: 24px; }
}

/* Tiles — a grid of linked summaries, for the home and admin pages that come after sign-in */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.tile {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.tile__value { display: block; font-size: 24px; font-weight: 700; }
.tile__label { display: block; color: var(--ink-muted); font-size: 13px; }

/* Admin-style tables: one hairline under the head, a lighter one between rows */

table.admin {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.admin th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

table.admin td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--bg-alt);
  vertical-align: top;
}

.muted { color: var(--ink-muted); }

/* Signed in as … · Sign out — the sign-out is a form (DELETE), shown as a link */

.site-header__sign-out-form { display: inline; }

.site-header__sign-out {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-dark);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The sign-in, refusal and busy pages: one short panel */

.auth-panel {
  max-width: 420px;
  margin: 64px auto;
  padding: 0 24px;
}

.auth-panel__title { margin: 0 0 8px; font-size: 22px; }
.auth-panel__lede { margin: 0 0 24px; color: var(--ink-soft); }

/* PointClickCare's sign-in button. The artwork is theirs and must not be recoloured or stretched
   (their UX guidelines), so the <button> adds nothing visible of its own — no padding, border or
   background — and the image keeps its 229×46 ratio at any width. The three states are three of
   their SVGs, swapped on :hover and :active. */

.pcc-sign-in {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 23px;
  background: none;
  line-height: 0;
  cursor: pointer;
}

.pcc-sign-in:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.pcc-sign-in__state {
  display: block;
  width: 229px;
  max-width: 100%;
  height: auto;
}

.pcc-sign-in__state--hover,
.pcc-sign-in__state--pressed { display: none; }

.pcc-sign-in:hover .pcc-sign-in__state--base { display: none; }
.pcc-sign-in:hover .pcc-sign-in__state--hover { display: block; }

.pcc-sign-in:active .pcc-sign-in__state--base,
.pcc-sign-in:active .pcc-sign-in__state--hover { display: none; }
.pcc-sign-in:active .pcc-sign-in__state--pressed { display: block; }
