/* Greenhouse brand: olive on cream, Chapeau (Nunito fallback), rounded cards. */
:root {
  --gh-olive: #585828;
  --gh-cream: #F8F8E8;
  --gh-olive-muted: #809060;
  --gh-sage: #D8E0C0;
  --gh-sky: #D8F0F8;
  --gh-white: #FFFFFF;
  --gh-brown: #8A5A2B;
  --gh-forest: #3D4824;         /* deeper green for the sign-in wordmark */          /* on-brand warm brown for problems instead of red */
  --gh-font: 'Chapeau', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--gh-cream); color: var(--gh-olive); font-family: var(--gh-font); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--gh-font); margin: 0 0 12px; }
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
a { color: var(--gh-olive); }
small, .muted { color: var(--gh-olive-muted); font-size: 13px; }

/* ----- header + tabs ----- */
.top { background: var(--gh-olive); color: var(--gh-cream); }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gh-cream); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand svg { width: 34px; height: 28px; }
.top-meta { margin-left: auto; font-size: 13px; text-align: right; opacity: .9; }
.top-meta a { color: var(--gh-cream); }
.tabs { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { color: var(--gh-cream); text-decoration: none; padding: 10px 16px; border-radius: 12px 12px 0 0; font-weight: 600; white-space: nowrap; opacity: .85; }
.tabs a.active { background: var(--gh-cream); color: var(--gh-olive); opacity: 1; }
.tabs a .count { background: var(--gh-sage); color: var(--gh-olive); border-radius: 999px; padding: 0 8px; font-size: 12px; margin-left: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

/* ----- cards ----- */
.card { background: var(--gh-white); border: 1px solid var(--gh-sage); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card.soft { background: var(--gh-sage); border-color: var(--gh-sage); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice { display: block; text-decoration: none; transition: transform .1s ease; }
.choice:hover { transform: translateY(-2px); border-color: var(--gh-olive-muted); }
.choice h3 { margin-bottom: 4px; }

/* ----- forms ----- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 14px; }
label .req { color: var(--gh-olive-muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=date], select, textarea {
  font: inherit; color: var(--gh-olive); background: var(--gh-cream); border: 1px solid var(--gh-sage);
  border-radius: 10px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gh-olive-muted); outline-offset: 1px; }
input:disabled, select:disabled { opacity: .6; }
textarea { min-height: 70px; }
fieldset { border: 1px solid var(--gh-sage); border-radius: 12px; padding: 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.parts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tier-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 8px; }

/* ----- buttons ----- */
.btn { display: inline-block; font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; text-decoration: none; background: var(--gh-olive); color: var(--gh-cream); }
.btn.secondary { background: var(--gh-sage); color: var(--gh-olive); }
.btn.ghost { background: transparent; color: var(--gh-olive); border: 1px solid var(--gh-sage); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: wait; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

/* ----- messages + statuses ----- */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600; }
.flash.ok { background: var(--gh-sage); }
.flash.warn, .flash.error { background: #F3E6D6; color: var(--gh-brown); }
.issues { background: #F3E6D6; color: var(--gh-brown); border-radius: 12px; padding: 14px 18px; }
.issues li { margin-bottom: 6px; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--gh-sage); white-space: nowrap; }
.pill.needs_changes, .pill.sync_failed, .pill.ai_review_error, .pill.error { background: #F3E6D6; color: var(--gh-brown); }
.pill.awaiting_approval, .pill.partial { background: var(--gh-sky); }
.pill.synced, .pill.success { background: var(--gh-olive); color: var(--gh-cream); }

/* ----- tables ----- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--gh-olive-muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--gh-sage); }
td { padding: 10px; border-bottom: 1px solid var(--gh-sage); vertical-align: top; }
tr:nth-child(even) td { background: rgba(216, 224, 192, .25); }
.table-wrap { overflow-x: auto; }
.old { text-decoration: line-through; color: var(--gh-olive-muted); }

/* ----- change form ----- */
.change-row { border: 1px solid var(--gh-sage); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.change-row.on { border-color: var(--gh-olive-muted); background: rgba(216, 224, 192, .2); }
.change-row .current { color: var(--gh-olive-muted); font-size: 14px; }
.change-row .editor { margin-top: 12px; display: none; }
.change-row.on .editor { display: block; }
.question { border-bottom: 1px solid var(--gh-sage); padding: 12px 0; }
.question[hidden] { display: none; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0; }
.radio-row label { font-weight: 400; display: flex; gap: 6px; align-items: center; }

.search-results { margin-top: 12px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results a:hover { background: var(--gh-sage); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--gh-sage); }

/* ----- sign-in page ----- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gh-cream);
         padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login .card { max-width: 440px; text-align: center; }
.login-card { width: 100%; max-width: 472px; background: var(--gh-white); border: 1px solid var(--gh-sage); border-radius: 14px;
              padding: 60px 38px 44px; text-align: center; }
.lockup { display: inline-flex; align-items: flex-end; gap: 8px; color: var(--gh-olive); margin-bottom: 64px; }
.lockup-mark { width: 80px; height: 66px; flex: none; }
.lockup-words { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; padding-bottom: 2px; }
.lockup-name { font-weight: 800; font-size: 27px; letter-spacing: -0.01em; color: var(--gh-forest); }
.lockup-product { font-weight: 700; font-size: 14.5px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 4px; color: var(--gh-forest); }
.login-btn { display: block; background: var(--gh-olive); color: var(--gh-cream); text-decoration: none; font-weight: 600; font-size: 16px;
             border-radius: 8px; padding: 12px 20px; }
.login-btn:hover { filter: brightness(1.08); }
.login-btn:focus-visible { outline: 3px solid var(--gh-olive-muted); outline-offset: 2px; }
.login-note { margin: 18px 0 0; font-size: 13.5px; color: var(--gh-olive-muted); }

.overlay { position: fixed; inset: 0; background: rgba(88, 88, 40, .55); display: none; align-items: center; justify-content: center; z-index: 10; }
.overlay.on { display: flex; }
.overlay .card { max-width: 380px; text-align: center; }

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .top-meta { margin-left: 0; text-align: left; }
  .tier-row { grid-template-columns: 1fr 100px auto; }
}

/* ----- admin sub-tabs + audit log ----- */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; }
.subtabs a { text-decoration: none; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--gh-sage); }
.subtabs a.active { background: var(--gh-olive); color: var(--gh-cream); border-color: var(--gh-olive); }
.audit-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.audit-filters .actions { grid-column: 1 / -1; }
table.audit td { font-size: 14px; }
.nowrap { white-space: nowrap; }
.pill.cat-access, .pill.cat-admin { background: #F3E6D6; color: var(--gh-brown); }
.pill.cat-approval, .pill.cat-cin7 { background: var(--gh-olive); color: var(--gh-cream); }
.pill.cat-review { background: var(--gh-sky); }

/* ----- overview: one source of truth ----- */
.truth { background: var(--gh-olive); color: var(--gh-cream); border-color: var(--gh-olive); padding: 26px 28px; }
.truth h2 { color: var(--gh-cream); font-size: 26px; text-wrap: balance; }
.truth p, .truth li { max-width: 72ch; }
.truth a { color: var(--gh-cream); }
.truth ul { padding-left: 20px; margin-bottom: 0; }
.truth li { margin-bottom: 6px; }
.truth-label { display: inline-block; background: var(--gh-cream); color: var(--gh-olive); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 12px; margin-bottom: 12px; }

/* ----- possible duplicate warning ----- */
.dup-warning { background: #F3E6D6; border-color: #E6CFB3; color: var(--gh-brown); }
.dup-warning h3 { color: var(--gh-brown); }
.dup-warning a { color: var(--gh-brown); }
.dup-warning li { margin-bottom: 8px; }
.dup-live { margin-top: 8px; background: #F3E6D6; color: var(--gh-brown); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: grid; gap: 4px; }
.dup-live.blocking { border: 2px solid var(--gh-brown); }
.dup-live a { color: var(--gh-brown); }
.dup-live .muted { color: var(--gh-brown); opacity: .85; }
.dup-lock { margin-top: 18px; background: #F3E6D6; color: var(--gh-brown); border: 2px solid var(--gh-brown); border-radius: 10px; padding: 10px 14px; font-weight: 700; }

/* ----- change request checklist ----- */
.stack { display: grid; gap: 14px; }
.question-group { border-top: 2px solid var(--gh-sage); padding-top: 14px; margin-top: 14px; }
.question-group h3 { margin-bottom: 4px; }
.approver-info { margin: 0; display: grid; gap: 4px 0; }
.approver-info dt { font-weight: 700; margin-top: 10px; }
.approver-info dd { margin: 0; }
td.group-row { font-weight: 700; background: var(--gh-sage) !important; }
.approver-note { background: #F3E6D6; color: var(--gh-brown); border-left: 4px solid var(--gh-brown); border-radius: 8px; padding: 8px 12px; margin: 6px 0; font-size: 14px; }
.approver-note-text { color: var(--gh-brown); font-weight: 600; }
.bia-table td { font-size: 14px; }
.bia-table .note-box { min-height: 44px; min-width: 180px; font-size: 14px; }
.answer-no { color: var(--gh-brown); }

/* ----- my requests: filters + pages ----- */
.list-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.list-filters .actions { align-self: end; padding-bottom: 2px; }
.pager { align-items: center; }
.page-link, .page-current { display: inline-block; min-width: 32px; text-align: center; padding: 4px 8px; border-radius: 8px; }
.page-link { text-decoration: none; border: 1px solid var(--gh-sage); }
.page-current { background: var(--gh-olive); color: var(--gh-cream); font-weight: 700; }
