/* Revel CPA brand tokens, fonts (Adelle Sans) and base type come from revel.css (Revel CPA Design System). */
@import url('/static/brand/revel.css');

:root {
  /* App aliases onto the Revel tokens */
  --app-bg: var(--paper-off);
  --card: var(--paper);
  --line: var(--ink-100);
  --muted: var(--ink-500);
  /* White on #EA580C is 3.56:1, under 4.5:1 for body-size text, so text and button fills use the
     design system's darker orange (#C44A0A, 4.85:1). Bright orange is for the logo, rules and focus. */
  --action: var(--link-hover);
  --action-hover: #A33D08;
  --ok: var(--success); --warn-ink: #8A5A00; --err: var(--danger);
  --radius-card: var(--r-lg);
  --radius-field: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--app-bg); font-size: 15px; }
a { color: var(--action); }
a:hover { color: var(--action-hover); }
h1 { font-size: 1.9rem; margin: .2em 0 .5em; }
h2 { font-size: 1.25rem; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; margin: 0 0 .5em; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; } .wrap.wide { max-width: 1320px; }
.muted { color: var(--muted); font-weight: 400; } .warn { color: var(--warn-ink); font-weight: 700; }
:focus-visible { outline: 2px solid var(--revel-orange); outline-offset: 2px; }

/* Header */
header.top { background: var(--paper); border-bottom: var(--bw) solid var(--ink-100); box-shadow: inset 0 -4px 0 var(--revel-orange); }
header.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; padding-bottom: 4px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink-900); }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font-size: var(--t-micro); font-weight: 700; letter-spacing: var(--ls-loose); text-transform: uppercase;
  color: var(--ink-500); border-left: var(--bw) solid var(--ink-200); padding-left: 14px; line-height: 1.2; }
header nav { display: flex; gap: 20px; flex: 1; }
header nav a { color: var(--ink-900); text-decoration: none; font-weight: 700; font-size: .95rem; }
header nav a:hover { color: var(--action); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.logout { display: flex; gap: 12px; align-items: center; } .logout .who { color: var(--ink-500); font-size: .9rem; }
main { padding: 28px 16px 48px; }
footer { color: var(--ink-500); font-size: .85rem; padding-bottom: 32px; }

/* Cards */
.card { background: var(--card); border: var(--bw) solid var(--ink-100); border-radius: var(--radius-card); padding: 24px; margin-bottom: 18px; }
.card.narrow { max-width: 480px; margin: 32px auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.list { display: grid; gap: 12px; }
.row-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; margin: 0; transition: border-color 120ms ease; }
.row-link:hover { border-color: var(--ink-900); color: inherit; }

/* Buttons (design system: bold, app UI uses --r-md radius) */
button, .button { background: var(--action); color: var(--paper); border: var(--bw) solid var(--action); border-radius: var(--r-md);
  padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease; }
button:hover, .button:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--paper); }
button:active, .button:active { transform: scale(.98); }
button.secondary, .button.secondary { background: transparent; color: var(--ink-900); border-color: var(--ink-900); }
button.secondary:hover, .button.secondary:hover { background: var(--ink-900); color: var(--paper); }
button.link { background: none; border: none; padding: 0; color: var(--action); font-weight: 700; text-decoration: underline;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
button.link:hover { background: none; color: var(--action-hover); }
button.icon { background: var(--paper); color: var(--ink-500); border-color: var(--ink-200); padding: 7px 12px; border-radius: var(--radius-field); }
button.icon:hover { background: var(--revel-orange-10); color: var(--action); border-color: var(--action); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field span { font-weight: 700; font-size: .85rem; color: var(--ink-700); } .field em { color: var(--err); font-style: normal; }
.field small { color: var(--ink-500); }
input, select, textarea { font: inherit; padding: 10px 12px; border: var(--bw) solid var(--ink-200); border-radius: var(--radius-field);
  background: var(--paper); color: var(--ink-900); width: 100%; transition: border-color 120ms, box-shadow 120ms; }
input::placeholder, textarea::placeholder { color: var(--ink-300); }
input:focus, select:focus, textarea:focus { border-color: var(--revel-orange); box-shadow: 0 0 0 3px var(--revel-orange-25); outline: none; }
textarea { resize: vertical; }
.check, .confirm { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 14px; }
.check input, .confirm input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--action); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
input.copy { font-family: var(--font-mono); font-size: .85rem; }

/* Messages */
.flash { padding: 12px 16px; border-radius: var(--radius-field); margin-bottom: 18px; border: var(--bw) solid; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-info { background: var(--revel-blue-10); border-color: var(--revel-blue-25); }
.flash-ok { background: #E8F4EE; border-color: #B7DCC8; }
.flash-warn { background: var(--revel-cream-25); border-color: var(--revel-cream); }
.flash-error { background: #FBEAE6; border-color: #EDB5A9; }

/* Status pills */
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: .75rem; font-weight: 700;
  background: var(--revel-gray-50); color: var(--ink-700); white-space: nowrap; border: 1px solid var(--ink-100); }
.badge-submitted { background: var(--revel-blue-10); color: var(--revel-blue); border-color: var(--revel-blue-25); }
.badge-in_review { background: var(--revel-orange-10); color: #9A3A07; border-color: var(--revel-orange-25); }
.badge-final { background: #E8F4EE; color: #176B47; border-color: #B7DCC8; }

/* Interview */
.steps { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; background: var(--app-bg); padding: 10px 0; margin-bottom: 8px; }
.steps a { padding: 7px 14px; border-radius: var(--r-pill); background: var(--paper); border: var(--bw) solid var(--ink-200);
  text-decoration: none; font-size: .85rem; font-weight: 700; color: var(--ink-900); }
.steps a:hover { border-color: var(--ink-900); color: var(--ink-900); }
.step { scroll-margin-top: 64px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.readonly input, .readonly textarea, .readonly select { background: var(--revel-gray-25); color: var(--ink-700); }
.readonly [data-remove], .readonly [data-add-hat] { display: none; }

.hat { position: relative; border: var(--bw) solid var(--ink-100); border-radius: var(--r-md); padding: 14px 54px 0 14px; margin-bottom: 12px; background: var(--revel-cream-10); }
.hat-main, .hat-admin { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.hat .grow { flex: 1 1 200px; } .hat .hours { flex: 0 0 110px; } .hat-main button.icon { position: absolute; top: 12px; right: 12px; }
.hat .skill { flex: 1 1 100%; } .hat .skill select { max-width: 360px; }
.hat-admin { border-top: 1px dashed var(--ink-200); padding-top: 12px; }
.hat-admin .field:first-child { flex: 0 0 140px; }
.rate-out { flex: 0 0 210px; display: flex; flex-direction: column; padding-top: 22px; font-size: .9rem; }
.rate-out small { color: var(--ink-500); }
.hat-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.total strong { font-size: 1.1rem; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; background: var(--paper);
  border: var(--bw) solid var(--ink-200); border-radius: var(--radius-card); }
.actions.sticky { position: sticky; bottom: 12px; box-shadow: var(--shadow-md); }
.actions .confirm { margin: 0; flex: 1 1 260px; }

/* Results */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: var(--bw) solid var(--ink-100); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 3px; }
.stat span { color: var(--ink-500); font-size: .72rem; font-weight: 700; letter-spacing: var(--ls-loose); text-transform: uppercase; }
.stat strong { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: var(--ls-snug); }
.stat small { color: var(--ink-500); }
.cards:first-of-type .stat:first-child { border-color: var(--ink-900); }
.stat.chosen { border-color: var(--revel-orange); box-shadow: inset 0 0 0 1.5px var(--revel-orange); }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }
thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: var(--ls-loose); color: var(--ink-500); font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot th { border-top: var(--bw-bold) solid var(--ink-900); border-bottom: 0; font-size: 1rem; font-weight: 800; }
.note { color: var(--ink-500); font-size: .8rem; margin-top: 2px; }
.list-table { background: var(--paper); border: var(--bw) solid var(--ink-100); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.list-table tbody tr:hover { background: var(--revel-cream-10); }
.list-table tbody tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; } .filters input { flex: 1 1 240px; width: auto; } .filters select { width: auto; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.admin-grid aside { position: sticky; top: 12px; }
aside ul { padding-left: 18px; margin: 0 0 10px; } .log { list-style: none; padding: 0 !important; font-size: .85rem; }
.log li { padding: 3px 0; } .log span { color: var(--ink-500); margin-right: 4px; }

/* Report */
.report { background: var(--paper); border: var(--bw) solid var(--ink-100); border-radius: var(--radius-card); padding: 36px; }
.report h1 { font-size: 2.1rem; font-weight: 800; letter-spacing: var(--ls-snug); }
.report h2 { margin-top: 30px; font-size: .78rem; font-weight: 700; letter-spacing: var(--ls-loose); text-transform: uppercase;
  color: var(--action); border-bottom: var(--bw) solid var(--ink-100); padding-bottom: 6px; }
.draft-banner { background: var(--revel-cream-25); border: var(--bw) solid var(--revel-cream); color: #6B4E12; font-weight: 700;
  text-align: center; padding: 8px; border-radius: var(--radius-field); margin-bottom: 20px; }
.report-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.report-logo { height: 34px; width: auto; margin-bottom: 6px; }
.report-meta { text-align: right; font-size: .9rem; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; margin: 20px 0 24px; }
.report-grid span { display: block; font-size: .72rem; font-weight: 700; color: var(--ink-500); text-transform: uppercase; letter-spacing: var(--ls-loose); }
.factors dt { font-weight: 700; margin-top: 12px; } .factors dd { margin: 3px 0 0; white-space: pre-wrap; }
.method { font-size: .88rem; color: var(--ink-700); } .prewrap { white-space: pre-wrap; }
.signoff { display: flex; gap: 40px; margin-top: 32px; padding-top: 16px; border-top: var(--bw) solid var(--ink-100); }

@media (max-width: 820px) {
  .grid2, .report-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; } .admin-grid aside { position: static; }
  .report { padding: 20px; } .report-head { flex-direction: column; } .report-meta { text-align: left; }
  .brand span { display: none; }
}
@media print {
  header.top, footer, .no-print { display: none; }
  body { background: #fff; } main { padding: 0; } .wrap { max-width: none; }
  .report { border: 0; padding: 0; } .cards { grid-template-columns: repeat(4, 1fr); }
  tr { break-inside: avoid; }
}

/* Role ideas (expandable, no pop-up) */
.ideas { border: var(--bw) solid var(--revel-cream); background: var(--revel-cream-25); border-radius: var(--r-md); padding: 0 16px; margin-bottom: 16px; }
.ideas summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--ink-900); }
.ideas summary:hover { color: var(--action); }
.ideas[open] summary { border-bottom: 1px solid var(--revel-cream); margin-bottom: 10px; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 24px; padding-bottom: 12px; }
.ideas-group h4 { font-size: .72rem; font-weight: 700; letter-spacing: var(--ls-loose); text-transform: uppercase; color: var(--action); margin: 10px 0 4px; }
.ideas-group ul { list-style: none; margin: 0; padding: 0; }
.ideas-group li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--revel-cream-50); }
.ideas-group li div { display: flex; flex-direction: column; font-size: .9rem; }
.ideas-group li span { color: var(--ink-500); font-size: .82rem; }
button.small { padding: 5px 12px; font-size: .8rem; border-radius: var(--r-sm); flex: none; }
button.small:disabled { opacity: .55; cursor: default; background: transparent; color: var(--ink-500); border-color: var(--ink-200); }
.tip { margin: 0 0 14px; }
