/* =====================================================================
 * HUB AgendaGest — app do funcionário/professor (hub.agendagest.test)
 * Mesmos tokens e componentes do Gestor (gestor.css: g-btn, g-card, g-chip, g-input…),
 * em casca mobile-first: barra superior + navegação inferior. Prefixo h-.
 * ===================================================================== */

:root {
    --h-bottom: 64px;
    --h-ok: #16a34a;
    --h-warn: #d97706;
    --h-info: #2563eb;
}

/* o atributo hidden tem que vencer qualquer display de classe (botões, avisos, passos do login) */
[hidden] { display: none !important; }

body.h-body { background: var(--g-bg-soft); min-height: 100vh; }

/* ---------------- Casca ---------------- */
.h-topbar {
    position: relative; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--g-border);
}
.h-brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.h-brand img { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.h-brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-brand small { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11.5px; color: var(--g-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-brand small i { width: 6px; height: 6px; border-radius: 50%; background: var(--g-primary); flex: none; }
.h-top-right { display: flex; align-items: center; gap: 8px; position: relative; flex: none; }
.h-avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--g-text); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.h-avatar:active { transform: scale(.95); }
.h-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 268px; background: #fff; border: 1px solid var(--g-border); border-radius: 16px; box-shadow: var(--g-shadow-lg); padding: 6px; z-index: 60; transform-origin: top right; animation: h-menu .14s ease both; }
@keyframes h-menu { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.h-menu[hidden] { display: none; }
.h-menu-user { padding: 12px 12px 10px; border-bottom: 1px solid var(--g-border); margin-bottom: 6px; }
.h-menu-user b { display: block; font-size: 14px; font-weight: 800; }
.h-menu-user small { display: block; font-size: 12px; color: var(--g-muted); font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-menu a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--g-text-2); }
.h-menu a:hover, .h-menu a:active { background: var(--g-hover); color: var(--g-text); }
.h-menu a i { width: 16px; text-align: center; color: var(--g-muted); }
.h-menu a.danger, .h-menu a.danger i { color: var(--g-danger); }
.h-desk-nav { display: none; gap: 4px; }
.h-desk-nav a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--g-muted); }
.h-desk-nav a:hover { background: var(--g-hover); color: var(--g-text); }
.h-desk-nav a.is-active { background: var(--g-text); color: #fff; }

.h-main { max-width: 920px; margin: 0 auto; padding: 16px 16px calc(var(--h-bottom) + 28px); }
.h-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; }
.h-sub { font-size: 12.5px; color: var(--g-muted); font-weight: 600; margin: 0 0 14px; }

.h-bottom {
    position: fixed; inset: auto 0 0 0; z-index: 40; height: var(--h-bottom); display: grid; grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, .95); backdrop-filter: saturate(180%) blur(10px); border-top: 1px solid var(--g-border);
    padding-bottom: env(safe-area-inset-bottom);
}
.h-bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 800; color: var(--g-muted); position: relative; }
.h-bottom a i { font-size: 18px; }
.h-bottom a.is-active { color: var(--g-primary); }
.h-bottom a.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--g-primary); }
.h-bottom a.h-scan i {
    width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--g-primary); color: #fff; font-size: 20px; box-shadow: 0 8px 18px -4px rgba(15, 118, 110, .55), 0 0 0 4px var(--g-bg-soft);
}
.h-bottom a.h-scan span { margin-top: 2px; }

@media (min-width: 900px) {
    .h-topbar { position: sticky; top: 0; padding: 10px 28px; }
    .h-brand { flex: 0 1 auto; }
    .h-topbar { gap: 24px; }
    .h-desk-nav { display: flex; flex: 1; }
    .h-bottom { display: none; }
    .h-main { padding-bottom: 40px; }
}

/* ---------------- Agenda ---------------- */
.h-daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.h-daynav .h-date { flex: 1; text-align: center; min-width: 0; }
.h-date b { display: block; font-size: 15px; font-weight: 800; text-transform: capitalize; }
.h-date small { font-size: 11.5px; color: var(--g-muted); font-weight: 600; }
.h-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--g-muted); }
.h-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--h-ok); animation: h-pulse 2s infinite; }
@keyframes h-pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.h-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 12px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.h-filters::-webkit-scrollbar { display: none; }
.h-filters .g-chip { flex: none; }

.h-list { display: flex; flex-direction: column; gap: 10px; }
.h-sec { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); margin: 10px 2px 0; display: flex; align-items: center; gap: 8px; }
.h-sec::after { content: ''; flex: 1; height: 1px; background: var(--g-border); }

.h-ev { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 0; background: #fff; border: 1px solid var(--g-border); border-radius: 14px; overflow: hidden; box-shadow: var(--g-shadow); }
.h-ev.is-now { border-color: var(--g-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.h-ev.is-done { opacity: .72; }
.h-time { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 4px; background: var(--g-bg-soft); border-right: 1px solid var(--g-border); position: relative; }
.h-time::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cor, var(--g-primary)); }
.h-time b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.h-time small { font-size: 10.5px; color: var(--g-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.h-ev-body { padding: 11px 13px; min-width: 0; }
.h-line1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.h-space { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.h-who { font-size: 13px; color: var(--g-text-2); font-weight: 600; margin-top: 1px; }
.h-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.h-pill { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 10.5px; font-weight: 800; background: var(--g-bg-soft); color: var(--g-text-2); border: 1px solid var(--g-border); white-space: nowrap; }
.h-pill.ok { background: var(--g-success-soft); color: var(--h-ok); border-color: #c9f0d8; }
.h-pill.warn { background: #fff7e6; color: #b45309; border-color: #fde7bd; }
.h-pill.info { background: #eff6ff; color: var(--h-info); border-color: #d6e4ff; }
.h-pill.danger { background: var(--g-danger-soft); color: var(--g-danger); border-color: #ffd5dc; }
.h-pill.muted { color: var(--g-muted); }

.h-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.h-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--g-border-strong); background: #fff; font-size: 13.5px; font-weight: 800; color: var(--g-text-2); cursor: pointer; transition: transform .08s, background .12s; }
.h-btn:active { transform: scale(.97); }
.h-btn.primary { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }
.h-btn.primary:hover { background: var(--g-primary-600); }
.h-btn.soft { background: var(--g-bg-soft); }
.h-btn.danger { color: var(--g-danger); }
.h-btn.block { width: 100%; height: 48px; font-size: 15px; border-radius: 13px; }
.h-btn[disabled] { opacity: .5; cursor: not-allowed; }
.h-hint { font-size: 11.5px; color: var(--g-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-top: 9px; }

.h-empty { text-align: center; padding: 48px 16px; color: var(--g-muted); }
.h-empty i { font-size: 34px; color: var(--g-faint); margin-bottom: 10px; }
.h-empty b { display: block; font-size: 14px; color: var(--g-text-2); margin-bottom: 2px; }
.h-skel { height: 92px; border-radius: 14px; background: linear-gradient(90deg, #eef0f4 25%, #f6f7f9 37%, #eef0f4 63%); background-size: 400% 100%; animation: h-skel 1.3s ease infinite; }
@keyframes h-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.h-toast { position: fixed; left: 50%; bottom: calc(var(--h-bottom) + 18px); transform: translate(-50%, 20px); z-index: 90; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: var(--g-text); color: #fff; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .22s; box-shadow: var(--g-shadow-lg); }
.h-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.h-toast.err { background: var(--g-danger); }
.h-toast.ok { background: var(--h-ok); }

/* ---------------- Leitor de QR ---------------- */
.h-scan-page { max-width: 560px; }
.h-cam { position: relative; aspect-ratio: 1 / 1; max-height: 62vh; width: 100%; border-radius: 22px; overflow: hidden; background: #0b0f14; box-shadow: var(--g-shadow-lg); }
.h-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-cam canvas { display: none; }
.h-frame { position: absolute; inset: 14%; border-radius: 22px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(5, 10, 14, .52); }
.h-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.h-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.h-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.h-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.h-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.h-frame.is-hit i { border-color: #4ade80; }
.h-laser { position: absolute; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, transparent, #5eead4, transparent); box-shadow: 0 0 12px 2px rgba(94, 234, 212, .7); animation: h-laser 2.2s ease-in-out infinite; }
@keyframes h-laser { 0%, 100% { top: 6%; } 50% { top: 94%; } }
.h-cam-msg { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #fff; font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); padding: 0 24px; }
.h-cam-off { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; color: #cbd5e1; font-size: 13px; font-weight: 600; line-height: 1.5; }
.h-cam-off i { font-size: 34px; color: #64748b; }
.h-cam.is-off .h-cam-off { display: flex; }
.h-cam.is-off .h-frame, .h-cam.is-off .h-laser, .h-cam.is-off .h-cam-msg { display: none; }
.h-scan-tools { display: flex; gap: 8px; margin-top: 12px; }
.h-scan-tools .h-btn { flex: 1; }
.h-manual { margin-top: 12px; display: flex; gap: 8px; }
.h-manual .g-input { height: 44px; }

/* folha de resultado */
.h-sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(15, 20, 28, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.h-sheet-bg.is-on { opacity: 1; pointer-events: auto; }
.h-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -12px 40px rgba(16, 24, 40, .2); max-height: 88vh; overflow-y: auto; }
.h-sheet.is-on { transform: none; }
.h-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--g-border-strong); margin: 0 auto 14px; }
.h-res-ico { width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.h-res-ico.ok { background: var(--g-success-soft); color: var(--h-ok); animation: h-pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.h-res-ico.warn { background: #fff7e6; color: var(--h-warn); }
.h-res-ico.err { background: var(--g-danger-soft); color: var(--g-danger); }
.h-res-ico.info { background: #eff6ff; color: var(--h-info); }
@keyframes h-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
.h-res-title { text-align: center; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.h-res-msg { text-align: center; font-size: 13px; color: var(--g-text-2); font-weight: 600; margin: 4px 0 14px; line-height: 1.5; }
.h-res-card { border: 1px solid var(--g-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: var(--g-bg-soft); }
.h-res-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.h-res-card .row span { color: var(--g-muted); font-weight: 700; }
.h-res-card .row b { text-align: right; font-weight: 800; }
.h-res-item { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px dashed var(--g-border-strong); margin-top: 6px; font-size: 13px; font-weight: 700; }
.h-res-item i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.h-res-item small { margin-left: auto; color: var(--g-muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- Login (estilo Gestor, sem caixa) ---------------- */
.h-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.h-login-art {
    background: radial-gradient(1000px 520px at 15% 8%, #d9f2ee 0%, transparent 60%), radial-gradient(800px 460px at 95% 95%, #f1efff 0%, transparent 60%), var(--g-bg-soft);
    border-right: 1px solid var(--g-border); padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.h-login-art h2 { font-size: 34px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 12px; font-weight: 800; }
.h-login-art p { color: var(--g-text-2); font-size: 15px; line-height: 1.6; margin: 0 0 28px; max-width: 440px; }
.h-prev { background: #fff; border: 1px solid var(--g-border); border-radius: 16px; padding: 14px; box-shadow: var(--g-shadow-lg); max-width: 400px; }
.h-prev-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; }
.h-prev-row + .h-prev-row { border-top: 1px solid var(--g-border); }
.h-prev-t { width: 48px; text-align: center; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.h-prev-bar { width: 4px; align-self: stretch; border-radius: 4px; }
.h-prev-info { flex: 1; min-width: 0; }
.h-prev-info b { display: block; font-size: 13px; font-weight: 800; }
.h-prev-info span { font-size: 11.5px; color: var(--g-muted); font-weight: 600; }
.h-prev-qr { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--g-text); color: #fff; font-size: 12.5px; font-weight: 700; }
.h-prev-qr i { font-size: 22px; color: #5eead4; }

.h-login-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.h-login-box { width: 100%; max-width: 380px; }
.h-login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.h-login-logo img { width: 38px; height: 38px; border-radius: 10px; }
.h-login-logo b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.h-login-logo b em { font-style: normal; color: var(--g-primary); }
.h-login-box h1 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 6px; }
.h-login-box .lead { margin: 0 0 24px; color: var(--g-muted); font-size: 14px; font-weight: 500; line-height: 1.5; }
.h-pass { position: relative; }
.h-pass .g-input { padding-right: 46px; }
.h-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--g-muted); cursor: pointer; border-radius: 9px; font-size: 15px; }
.h-eye:hover { color: var(--g-text); background: var(--g-hover); }
.h-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--g-primary); cursor: pointer; }
.h-link:hover { text-decoration: underline; }
.h-login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.h-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--g-text-2); cursor: pointer; }
.h-check input { width: 16px; height: 16px; accent-color: var(--g-primary); }
.h-ok { padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; background: var(--g-success-soft); color: #15803d; line-height: 1.5; }
.h-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; }
.h-lojas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.h-loja { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 14px; border: 1px solid var(--g-border-strong); border-radius: 12px; background: #fff; font-weight: 800; font-size: 14px; cursor: pointer; }
.h-loja:hover { border-color: var(--g-primary); background: #f3fbfa; }
.h-loja i { color: var(--g-primary); }

@media (max-width: 899px) {
    .h-login { grid-template-columns: minmax(0, 1fr); }
    .h-login-art { display: none; }
    .h-login-form { align-items: flex-start; padding: 44px 22px 32px; }
    .h-login-logo { margin-bottom: 34px; }
}

/* ---------------- Ingresso público ---------------- */
.h-ticket-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px 16px; background: radial-gradient(900px 480px at 20% 0%, #e6f6f4 0%, transparent 60%), var(--g-bg-soft); }
.h-ticket { width: 100%; max-width: 380px; background: #fff; border-radius: 24px; border: 1px solid var(--g-border); box-shadow: var(--g-shadow-lg); overflow: hidden; }
.h-ticket-top { padding: 20px 22px 16px; background: linear-gradient(135deg, var(--g-primary), #0b5a54); color: #fff; }
.h-ticket-top small { opacity: .8; font-weight: 700; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.h-ticket-top h1 { margin: 3px 0 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.h-ticket-qr { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.h-ticket-qr .qr { padding: 12px; border: 1px solid var(--g-border); border-radius: 16px; background: #fff; }
.h-ticket-qr .qr svg { display: block; width: 220px; height: 220px; }
.h-ticket-qr .code { font-size: 22px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.h-ticket-qr .hint { font-size: 12px; color: var(--g-muted); font-weight: 600; text-align: center; }
.h-ticket-sep { position: relative; height: 0; border-top: 2px dashed var(--g-border-strong); margin: 0 14px; }
.h-ticket-sep::before, .h-ticket-sep::after { content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--g-bg-soft); border: 1px solid var(--g-border); }
.h-ticket-sep::before { left: -26px; }
.h-ticket-sep::after { right: -26px; }
.h-ticket-info { padding: 16px 22px 22px; }
.h-ticket-info .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; }
.h-ticket-info .row span { color: var(--g-muted); font-weight: 700; }
.h-ticket-info .row b { font-weight: 800; text-align: right; }
.h-ticket.is-off .qr { opacity: .25; filter: grayscale(1); }
