/* Demo interactivity layer (enhance.js). Reuses tokens from styles.css. */
body.g4-lock { overflow: hidden; }
.g4-click { cursor: pointer; }
tr.g4-click:hover td { background: var(--green-pale); }
.job-card.g4-click:hover { border-color: var(--green); }
.g4-muted { color: var(--ink-3); font-size: 12.5px; }
.g4-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.g4-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 6px 0 12px; }

/* Toast */
#g4Toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 700; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
/* Fixed dark surface so the toast stays dark-pill + white-text in BOTH themes.
   (It used var(--ink), which flips to a light colour in dark mode — giving
   white text on a near-white pill, i.e. invisible.) */
.g4-toast { background: #15241b; color: #fff; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.4; box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); animation: g4up .25s ease; border: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--green); }
.g4-toast.out { opacity: 0; transition: opacity .3s; }
@keyframes g4up { from { transform: translateY(10px); opacity: 0; } }

/* Modal */
.g4-backdrop { position: fixed; inset: 0; z-index: 600; background: rgba(13,27,20,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .15s ease; }
.g4-modal { background: var(--card); border-radius: 16px; width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px -12px rgba(0,0,0,.45); }
.g4-mhead { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.g4-mhead h3 { font-size: 17px; }
.g4-msub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.g4-x { border: 0; background: var(--grey-pale); width: 32px; height: 32px; border-radius: 999px; font-size: 20px; line-height: 1; flex-shrink: 0; }
.g4-mbody { padding: 14px 20px; overflow-y: auto; }
.g4-mbody h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 14px 0 8px; }
.g4-mbody h4:first-child { margin-top: 0; }
.g4-mfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.g4-simnote { margin-left: auto; font-size: 11px; color: var(--ink-4); }
.g4-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g4-check { display: flex; gap: 9px; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.g4-check input { accent-color: var(--green); width: 17px; height: 17px; }
.g4-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g4-photo { aspect-ratio: 1; border-radius: 10px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; background: linear-gradient(135deg, #2c7a4b, #14522C); }
.g4-photo.p1 { background: linear-gradient(135deg, #3b6ea5, #1f3f6b); }
.g4-photo.p2 { background: linear-gradient(135deg, #b7791f, #7a4e10); }
.g4-photo small { font-family: 'DM Mono', monospace; font-size: 8.5px; opacity: .8; font-weight: 400; }
.g4-tl { list-style: none; margin: 0; padding: 0 0 0 4px; }
.g4-tl li { display: flex; gap: 10px; padding-bottom: 12px; position: relative; font-size: 12.5px; }
.g4-tl li:not(:last-child)::before { content: ''; position: absolute; left: 8px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.g4-tl .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--green); flex-shrink: 0; margin-top: 4px; }
.g4-tl small { display: block; color: var(--ink-3); font-size: 11px; }
.g4-money { background: var(--green-pale); border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.g4-money span, .g4-money small { display: block; font-size: 11px; color: var(--ink-3); }
.g4-money strong { font-family: 'DM Mono', monospace; font-size: 20px; color: var(--green-dark); }
.g4-bill { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.g4-bill > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.g4-bill > div:last-child { border: 0; }
.g4-bill .tot { background: var(--grey-pale); font-weight: 700; }
.g4-steps { margin-top: 10px; display: grid; gap: 6px; font-size: 13px; }
.g4-steps .done { color: var(--green-dark); font-weight: 600; }
.g4-steps .now { color: var(--ink-3); }
.g4-f { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.g4-f input, .g4-f select, .g4-f textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 16px; font-weight: 400; background: #fff; color: var(--ink); }
.g4-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g4-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.g4-facts > div { background: var(--grey-pale); border-radius: 10px; padding: 9px 12px; }
.g4-facts span { display: block; font-size: 10.5px; color: var(--ink-3); }
.g4-facts b { font-size: 13.5px; }
.g4-att { display: flex; gap: 6px; }
.g4-att span { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--grey-pale); color: var(--ink-4); }
.g4-att .on { background: var(--green); color: #fff; }
.g4-att .off { background: var(--red-pale); color: var(--red); }

/* Queue rows (approvals, escrow, route, applicants) */
.g4-qrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.g4-qrow:last-child { border-bottom: 0; }
.g4-qrow > div { flex: 1; min-width: 0; }
.g4-qrow strong { display: block; font-size: 12.5px; }
.g4-qrow small { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g4-qrow .mono { font-size: 12px; }
.g4-qrow:hover strong { color: var(--green-dark); }
.g4-stop { width: 26px; height: 26px; border-radius: 99px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.g4-shift { width: 100%; justify-content: center; padding: 12px; margin: 6px 0 8px; font-size: 14px; }

/* Dashboard additions */
.g4-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.g4-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 18px; }
.g4-strip > div { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.g4-strip span { font-size: 11.5px; color: var(--ink-3); }
.g4-strip b { display: block; font-size: 12px; margin-top: 6px; }
.g4-bar { height: 7px; background: var(--grey-pale); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.g4-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.g4-feed { list-style: none; margin: 0; padding: 0; }
.g4-feed li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.g4-feed li:last-child { border: 0; }
.g4-feed small { display: block; color: var(--ink-4); font-size: 10.5px; }
.g4-feed li.fresh { animation: g4in .5s ease; background: linear-gradient(90deg, var(--green-pale), transparent); }
@keyframes g4in { from { opacity: 0; transform: translateY(-6px); } }
.g4-live { display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--green); margin-right: 5px; animation: g4blink 1.6s infinite; }
@keyframes g4blink { 50% { opacity: .25; } }

/* Map */
.g4-dot { cursor: pointer; transition: cx 2.6s linear, cy 2.6s linear; }
.g4-pulse { transition: cx 2.6s linear, cy 2.6s linear; transform-box: fill-box; transform-origin: center; animation: g4ring 2s ease-out infinite; }
@keyframes g4ring { from { transform: scale(1); opacity: .8; } to { transform: scale(4); opacity: 0; } }
.g4-agentcard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0 0 18px; }
.g4-agentcard[hidden] { display: none; }
.g4-agentcard > div { flex: 1; min-width: 160px; font-size: 13px; }
.g4-agentcard small { display: block; color: var(--ink-3); font-size: 11px; }

/* Charts */
.g4-hist { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.g4-hist > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.g4-hist i { display: block; width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 3px; }
.g4-hist.alt i { background: var(--blue); }
.g4-hist small { font-size: 10px; color: var(--ink-3); }

@media (max-width: 760px) {
  .g4-row, .g4-strip, .g4-cols, .g4-2 { grid-template-columns: 1fr; }
  .g4-backdrop { align-items: flex-end; padding: 0; }
  .g4-modal { border-radius: 16px 16px 0 0; max-height: 92vh; width: 100%; }
  .g4-simnote { margin-left: 0; width: 100%; }
  #g4Toasts { bottom: 84px; }
  .g4-mfoot .btn { flex: 1; justify-content: center; }
}
