/* ============================================================
   Vert Tech · App (Assiduidade / Agenda / Despesas)
   Clonado do design do app Serrialu — recolorido a preto e branco.
   ============================================================ */
:root {
  --dark: #0a0a0c;
  --dark-soft: #18191c;
  --dark-deep: #050506;
  --steel-a: #f3f4f6;
  --steel-b: #e3e5e9;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e7e9ec;
  --ink: #111214;
  --ink-soft: #4a4d52;
  --muted: #8a8f98;
  --warn: #b8860f;
  --warn-soft: #fbf2dd;
  --danger: #c23a2e;
  --danger-soft: #fbeae8;
  --ok: #1f1f1f;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Google Sans", "Figtree", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --shadow-card: 0 14px 34px -14px rgba(10,10,12,.35);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--dark); -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: max(16px, 1rem); }

.wrap-app { max-width: 640px; margin: 0 auto; padding: 0 18px; }

/* ---------- generic dark / steel cards ---------- */
.card-dark { background: linear-gradient(160deg, var(--dark-soft), var(--dark-deep)); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-steel { background: linear-gradient(160deg, var(--steel-a), var(--steel-b)); color: var(--ink); border-radius: var(--radius); border: 1px solid #dfe2e6; }
.card-white { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- top header ---------- */
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; max-width: 640px; margin: 0 auto; }
.app-header h1 { font-size: 17px; font-weight: 700; color: var(--ink); }
.hbtn { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #eef0f2; color: var(--ink); }
.hbtn:hover { background: #e4e6e9; }
.hbtn svg { width: 20px; height: 20px; stroke: currentColor; }

/* ---------- greeting ---------- */
.greet { padding: 6px 18px 2px; max-width: 640px; margin: 0 auto; }
.greet h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.greet p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- user card ---------- */
.user-card { padding: 20px; }
.user-top { display: flex; align-items: center; gap: 14px; }
.user-av { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px; flex: none; }
.user-greet { font-size: 13px; color: rgba(255,255,255,.62); }
.user-name { font-size: 17px; font-weight: 700; margin-top: 1px; }
.user-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 9px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11.5px; color: rgba(255,255,255,.85); }
.user-times { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.user-times div { padding: 13px; text-align: center; }
.user-times div:first-child { border-right: 1px solid rgba(255,255,255,.1); }
.user-times .ut-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.55); }
.user-times .ut-val { font-size: 21px; font-weight: 700; margin-top: 3px; }

/* ---------- registo diario ---------- */
.reg-card { padding: 20px; margin-top: 14px; }
.reg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.reg-head h3 { font-size: 16px; font-weight: 700; }
.reg-status { font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
.reg-status.done { background: rgba(255,255,255,.92); color: var(--dark); }
.reg-status.pending { background: var(--warn-soft); color: var(--warn); }
.reg-select { margin-bottom: 14px; }
.reg-select label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.6); display: block; margin-bottom: 6px; font-weight: 600; }
.reg-select select { width: 100%; height: 40px; border-radius: 10px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #fff; padding: 0 12px; font-size: 13.5px; }
.reg-active { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); font-size: 12.5px; }
.reg-active .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }

/* swipe to punch */
.swipe-row { display: flex; align-items: center; gap: 16px; }
.swipe-count { width: 74px; height: 74px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.swipe-track { position: relative; height: 56px; flex: 1; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); overflow: hidden; touch-action: none; user-select: none; }
.swipe-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13.5px; color: rgba(255,255,255,.9); pointer-events: none; }
.swipe-knob { position: absolute; top: 3px; left: 3px; width: 50px; height: 50px; border-radius: 50%; background: #fff; color: var(--dark); display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 0 18px rgba(255,255,255,.35); }
.swipe-knob.dragging { cursor: grabbing; }
.swipe-knob:not(.dragging) { transition: transform .25s cubic-bezier(.4,0,.2,1); }
.swipe-knob svg { width: 20px; height: 20px; }
.swipe-track.disabled { opacity: .5; }

.geo-strip { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.geo-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--warn-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.geo-ic svg { width: 17px; height: 17px; stroke: var(--warn); }
.geo-txt { font-size: 12.5px; color: rgba(255,255,255,.9); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- stat cards row ---------- */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stat-mini { padding: 16px; text-align: center; }
.stat-mini .sm-ic { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.card-dark .stat-mini .sm-ic { background: rgba(255,255,255,.1); }
.card-steel .stat-mini .sm-ic { background: rgba(10,10,12,.08); }
.stat-mini svg { width: 17px; height: 17px; stroke: currentColor; }
.stat-mini .sm-lbl { font-size: 12.5px; font-weight: 600; }
.stat-mini .sm-val { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding: 5px 12px; border-radius: 999px; }
.card-dark .stat-mini .sm-val { background: rgba(255,255,255,.1); }
.card-steel .stat-mini .sm-val { background: rgba(10,10,12,.07); }
.stat-mini .sm-val b { font-weight: 700; }
.stat-mini .sm-val span { font-size: 11px; opacity: .7; }

/* ---------- segmented tabs ---------- */
.seg-tabs { display: flex; gap: 8px; margin-top: 14px; }
.seg-tabs button, .seg-tabs a { flex: 1; padding: 11px; border-radius: 999px; font-size: 13px; font-weight: 600; text-align: center; background: #eef0f2; color: var(--muted); }
.seg-tabs button.active { background: var(--dark); color: #fff; }

/* ---------- punch list ---------- */
.punch-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.punch-item { display: flex; align-items: center; gap: 12px; padding: 12px; }
.punch-thumb { width: 52px; height: 52px; border-radius: 12px; background: #eef0f2; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.punch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.punch-thumb .pm { font-size: 9.5px; font-weight: 700; color: var(--ink); text-transform: uppercase; }
.punch-thumb .pd { font-size: 15px; font-weight: 700; color: var(--ink); }
.punch-info { flex: 1; min-width: 0; }
.punch-info .pi-tipo { font-size: 13.5px; font-weight: 700; }
.punch-info .pi-loc { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punch-info .pi-loc svg { width: 11px; height: 11px; stroke: currentColor; flex: none; }
.punch-time { font-weight: 700; font-size: 13.5px; }

/* ---------- empty state ---------- */
.empty-app { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-app .ea-ic { width: 60px; height: 60px; border-radius: 50%; background: #eef0f2; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.empty-app .ea-ic svg { width: 26px; height: 26px; stroke: var(--muted); }
.empty-app .ea-txt { font-weight: 600; color: var(--ink); font-size: 14px; }

/* ---------- page header (agenda/despesas) ---------- */
.page-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; max-width: 640px; margin: 0 auto; }
.page-hd h1 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-hd .back { width: 36px; height: 36px; border-radius: 10px; background: #eef0f2; display: flex; align-items: center; justify-content: center; }
.page-hd .back svg { width: 18px; height: 18px; stroke: var(--ink); }
.page-hd .action { width: 40px; height: 40px; border-radius: 12px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; }
.page-hd .action svg { width: 19px; height: 19px; stroke: currentColor; }

/* ---------- calendar (agenda) ---------- */
.cal-card { overflow: hidden; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.cal-nav button { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center; }
.cal-nav button svg { width: 18px; height: 18px; stroke: currentColor; }
.cal-month { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-weight: 700; font-size: 14px; }
.cal-month span.yr { padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.14); font-size: 11.5px; font-weight: 600; }
.cal-body { background: #fff; padding: 12px 10px 14px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 0 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; padding-top: 8px; }
.cal-cell { height: 42px; margin: 0 3px; border-radius: 11px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; justify-content: center; position: relative; touch-action: none; color: var(--ink); }
.cal-cell.out { color: #c9cbd0; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--dark); }
.cal-cell.sel { background: rgba(10,10,12,.85); color: #fff; }
.cal-cell:not(.out):hover { background: #f2f3f5; }
.cal-dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; }
.cal-hint { text-align: center; font-size: 11px; color: var(--muted); padding: 8px 0 2px; }

.btn-app { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 16px; font-weight: 700; font-size: 14.5px; }
.btn-app svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.btn-app-dark { background: var(--dark); color: #fff; box-shadow: 0 10px 24px -10px rgba(10,10,12,.5); }
.btn-app-ghost { background: #eef0f2; color: var(--ink); }
.btn-app-outline { background: transparent; border: 2px solid var(--dark); color: var(--dark); }
.btn-app:disabled { opacity: .55; }

.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.filter-chip { border-radius: 13px; padding: 10px 4px; text-align: center; transition: background .15s; }
.filter-chip .fc-ic { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 5px; background: #eef0f2; color: var(--ink); }
.filter-chip .fc-ic svg { width: 16px; height: 16px; stroke: currentColor; }
.filter-chip .fc-lbl { font-size: 11px; font-weight: 600; color: var(--ink); }
.filter-chip.active { background: var(--dark); }
.filter-chip.active .fc-ic { background: rgba(255,255,255,.16); color: #fff; }
.filter-chip.active .fc-lbl { color: #fff; }

.req-item { display: flex; align-items: center; gap: 12px; padding: 14px; }
.req-bar { width: 6px; height: 40px; border-radius: 999px; flex: none; }
.req-body { flex: 1; min-width: 0; }
.req-tipo { font-weight: 700; font-size: 14px; }
.req-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.req-status { font-size: 11.5px; font-weight: 700; text-align: right; }

.tag-label { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin: 6px 0 12px; }
.tag-label::before { content: ''; width: 3px; height: 14px; background: var(--dark); border-radius: 2px; }

/* ---------- despesas ---------- */
.scan-cta { display: flex; align-items: center; gap: 12px; padding: 16px; }
.scan-ic { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; flex: none; }
.scan-ic svg { width: 22px; height: 22px; stroke: #fff; }
.scan-txt b { font-size: 13.5px; font-weight: 700; display: block; }
.scan-txt span { font-size: 11.5px; opacity: .75; }

.total-card { padding: 16px; }
.total-card .tc-lbl { font-size: 11.5px; opacity: .7; }
.total-card .tc-val { font-size: 30px; font-weight: 800; margin-top: 3px; }

.desp-item { display: flex; align-items: center; gap: 12px; padding: 12px; }
.desp-info { flex: 1; min-width: 0; }
.desp-info .di-desc { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desp-info .di-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.desp-val { text-align: right; }
.desp-val .dv-eur { font-size: 15px; font-weight: 800; }

.pill-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-top: 4px; }
.pill-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-aprovada, .pill-aprovado { background: #eef0f2; color: #1a1a1c; }
.pill-pendente { background: var(--warn-soft); color: var(--warn); }
.pill-recusado, .pill-rejeitada { background: var(--danger-soft); color: var(--danger); }

/* ---------- forms ---------- */
.app-input, .app-select, .app-textarea { display: block; width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.app-input:focus, .app-select:focus, .app-textarea:focus { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(10,10,12,.08); }
.app-textarea { height: auto; padding: 10px 14px; resize: vertical; min-height: 78px; }
.field-app { margin-bottom: 14px; }
.field-app label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-opt { border-radius: 12px; padding: 9px 4px; text-align: center; border: 2px solid var(--line); font-size: 11px; font-weight: 700; color: var(--ink); }
.type-opt .to-bar { display: block; height: 6px; width: 100%; border-radius: 999px; margin-bottom: 6px; }
.type-opt.active { border-color: var(--dark); background: rgba(10,10,12,.04); }

/* ---------- dialog / sheet ---------- */
.sheet-overlay { position: fixed; inset: 0; background: rgba(6,6,8,.55); z-index: 200; display: flex; align-items: flex-end; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .2s; }
.sheet-overlay.open { opacity: 1; visibility: visible; }
.sheet { background: #fff; border-radius: 22px 22px 0 0; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; padding: 20px 20px 28px; transform: translateY(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h3 { font-size: 17px; font-weight: 700; }
.sheet-close { width: 32px; height: 32px; border-radius: 9px; background: #eef0f2; display: flex; align-items: center; justify-content: center; }
.sheet-close svg { width: 16px; height: 16px; stroke: var(--ink); }
.range-box { background: #f6f7f9; border-radius: 12px; padding: 12px; font-size: 13px; margin-bottom: 14px; }
.range-box .rb-lbl { font-size: 11px; color: var(--muted); }
.range-box .rb-val { font-weight: 700; margin-top: 2px; }
.hint-box { font-size: 11.5px; color: var(--ink-soft); background: #f6f7f9; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }

/* ---------- nav drawer ---------- */
.nav-overlay { position: fixed; inset: 0; background: rgba(6,6,8,.5); z-index: 200; opacity: 0; visibility: hidden; transition: opacity .2s; }
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-drawer { position: fixed; top: 0; left: 0; height: 100%; width: 290px; max-width: 86vw; background: linear-gradient(180deg, var(--dark-soft), var(--dark-deep)); color: #fff; z-index: 210; transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1); overflow-y: auto; padding: 26px 18px; }
.nav-overlay.open .nav-drawer { transform: translateX(0); }
.nav-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 18px; }
.nav-brand img { height: 30px; }
.nav-brand b { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.nav-brand span { display: block; font-size: 10px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .12em; }
.nav-sec-lbl { font-size: 10.5px; letter-spacing: .16em; color: rgba(255,255,255,.42); font-weight: 700; margin: 18px 0 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: rgba(255,255,255,.85); font-weight: 500; font-size: 14px; border: 1px solid rgba(255,255,255,.05); margin-bottom: 8px; width: 100%; text-align: left; }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.05); }
.nav-item.active { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); color: #fff; }
.nav-item.danger { color: #ff8a80; border-color: rgba(255,138,128,.25); }
.nav-item.admin { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); font-weight: 700; }

/* ---------- login ---------- */
.login-shell { min-height: 100vh; min-height: 100dvh; background: var(--dark-deep); position: relative; display: flex; align-items: center; justify-content: center; padding: 18px; overflow: hidden; }
.login-dots { position: absolute; inset: 0; }
.login-box { position: relative; z-index: 1; width: 100%; max-width: 1040px; background: #fff; border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.5); overflow: hidden; display: flex; flex-direction: column; }
.login-brand { background: var(--dark); padding: 46px 36px; color: #fff; text-align: center; }
.login-brand img { height: 52px; margin: 0 auto 18px; }
.login-brand .lb-name { font-size: 26px; font-weight: 800; letter-spacing: .06em; }
.login-brand .lb-tag { font-size: 12.5px; color: rgba(255,255,255,.55); margin-top: 8px; letter-spacing: .02em; }
.login-brand .lb-pill { display: inline-flex; margin-top: 22px; padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.login-form { padding: 34px 30px 30px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.login-tabs button { flex: 1; height: 42px; border-radius: 11px; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--line); color: var(--ink); }
.login-tabs button svg { width: 15px; height: 15px; stroke: currentColor; }
.login-tabs button.active { border-color: var(--dark); background: var(--dark); color: #fff; }
.login-h2 { font-size: 17px; font-weight: 800; margin-bottom: 3px; }
.login-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.pwd-row { display: flex; }
.pwd-row .app-input { border-radius: 12px 0 0 12px; }
.pwd-eye { width: 46px; height: 46px; border: 1px solid var(--line); border-left: none; border-radius: 0 12px 12px 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pwd-eye svg { width: 17px; height: 17px; stroke: currentColor; }
.login-switch { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.login-switch b { color: var(--ink); cursor: pointer; }
.login-err { background: var(--danger-soft); color: var(--danger); font-size: 12.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }

@media (min-width: 860px) {
  .login-box { flex-direction: row; min-height: 480px; }
  .login-brand { width: 42%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .login-form { width: 58%; display: flex; flex-direction: column; justify-content: center; }
}

@media (max-width: 420px) {
  .wrap-app, .app-header, .greet, .page-hd { padding-left: 14px; padding-right: 14px; }
  .filter-grid { padding: 10px; }
}

/* ---------- academia: hub / curso / aula ---------- */
.course-hero-video { border-radius: 22px; overflow: hidden; background: #000; position: relative; width: 100%; height: 0; padding-top: 46%; }
.course-hero-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-hero-info { text-align: center; margin: 16px 0 30px; }
.course-hero-info h1 { font-size: 21px; font-weight: 800; }
.course-hero-info p { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 460px; margin-left: auto; margin-right: auto; line-height: 1.5; }

.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.course-card { border-radius: 22px; overflow: hidden; position: relative; aspect-ratio: 4/3; display: flex; align-items: flex-end; cursor: pointer; border: none; text-align: left; }
.course-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.72) 100%); }
.course-card .cc-label { position: relative; z-index: 1; padding: 16px; color: #fff; }
.course-card .cc-label b { font-size: 16px; font-weight: 800; display: block; }
.course-card .cc-label span { font-size: 11.5px; opacity: .8; }
.course-card .cc-count { position: absolute; top: 12px; right: 12px; z-index: 1; background: rgba(255,255,255,.2); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }

/* capa com logo do cliente: fundo branco, logo centrado, faixa escura em baixo p/ o texto */
.course-card.has-logo, .aula-cover-card.has-logo { background: #fff; border: 1px solid var(--line); }
.course-card.has-logo::after, .aula-cover-card.has-logo::after { background: linear-gradient(180deg, transparent 34%, rgba(10,10,12,.88) 100%); }
.cc-logo { position: absolute; inset: 16% 0 44% 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
.cc-logo img { max-width: 62%; max-height: 82%; object-fit: contain; }
.aula-cover-card.has-logo .cc-logo img { max-width: 52%; max-height: 74%; opacity: .95; }
.course-card.has-logo .cc-count { background: rgba(10,10,12,.72); }
.aula-cover-card.has-logo .ac-badge { background: rgba(10,10,12,.82); color: #fff; }
.aula-cover-card.has-logo.locked .ac-badge { background: rgba(10,10,12,.4); }

.crumb-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.crumb-back svg { width: 15px; height: 15px; stroke: currentColor; }

.aula-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.aula-cover-card { border-radius: 18px; overflow: hidden; position: relative; aspect-ratio: 16/11; display: flex; align-items: flex-end; cursor: pointer; border: none; text-align: left; }
.aula-cover-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,.75) 100%); }
.aula-cover-card .ac-label { position: relative; z-index: 1; padding: 13px; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.32; }
.aula-cover-card .ac-badge { position: absolute; top: 9px; left: 9px; z-index: 1; background: rgba(255,255,255,.92); color: var(--dark); font-size: 9.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.aula-cover-card.locked .ac-badge { background: rgba(255,255,255,.22); color: #fff; }

.lesson-player { border-radius: 22px; overflow: hidden; background: #000; position: relative; width: 100%; height: 0; padding-top: 56.25%; margin-bottom: 18px; }
.lesson-player video, .lesson-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.lesson-soon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,.65); gap: 10px; text-align: center; padding: 20px; }
.lesson-soon svg { width: 30px; height: 30px; stroke: rgba(255,255,255,.5); }

.lesson-nav-row { display: flex; align-items: stretch; gap: 8px; margin: -6px 0 16px; }
.lesson-nav-btn { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, #e5e7eb); background: #f6f7f9; cursor: pointer; text-align: left; min-width: 0; }
.lesson-nav-btn svg { width: 16px; height: 16px; stroke: var(--muted); flex: none; }
.lesson-nav-btn.next { flex-direction: row-reverse; text-align: right; }
.lesson-nav-btn .lnb-txt { min-width: 0; }
.lesson-nav-btn .lnb-txt small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lesson-nav-btn .lnb-txt span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink, #14161a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-nav-spacer { flex: 1; }

.lesson-next-overlay { position: absolute; right: 12px; bottom: 12px; left: 12px; max-width: 300px; margin-left: auto; background: rgba(10,10,12,.92); backdrop-filter: blur(6px); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .22s ease, transform .22s ease; }
.lesson-next-overlay.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lesson-next-overlay .lno-txt { color: #fff; min-width: 0; }
.lesson-next-overlay .lno-txt small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.6); }
.lesson-next-overlay .lno-txt b { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-next-overlay .lno-actions { display: flex; gap: 8px; }
.lesson-next-overlay button { flex: 1; border: none; border-radius: 999px; padding: 8px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.lesson-next-overlay .lno-cancel { background: rgba(255,255,255,.14); color: #fff; }
.lesson-next-overlay .lno-play { background: #fff; color: #0a0a0c; display: flex; align-items: center; justify-content: center; gap: 5px; }
.lesson-next-overlay .lno-count { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #0a0a0c; color: #fff; font-size: 10px; }
@media (max-width: 520px) { .lesson-next-overlay { max-width: none; } }

.appstore-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 4px 0 6px; }
.appstore-btn { display: flex; align-items: center; gap: 10px; background: #000; color: #fff; padding: 10px 18px; border-radius: 12px; }
.appstore-btn svg { width: 26px; height: 26px; flex: none; }
.appstore-btn .as-txt { text-align: left; line-height: 1.16; }
.appstore-btn .as-txt small { display: block; font-size: 9.5px; opacity: .75; }
.appstore-btn .as-txt b { font-size: 15px; font-weight: 700; }

.rating-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.star-btn { background: none; border: none; cursor: pointer; padding: 2px; }
.star-btn svg { width: 26px; height: 26px; stroke: #d8dadd; fill: none; transition: fill .15s, stroke .15s; }
.star-btn.filled svg, .star-btn:hover svg { stroke: #111214; fill: #111214; }
.rating-avg { font-size: 13px; color: var(--muted); margin-left: 8px; }

.comment-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-item .cm-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment-item .cm-text { font-size: 13.5px; line-height: 1.5; }
.comment-reply { margin-top: 10px; margin-left: 14px; padding: 10px 12px; background: #f6f7f9; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.comment-reply b { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }

@media (min-width: 640px) {
  .aula-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-search { margin: 4px 0 14px; }
.chat-list { display: flex; flex-direction: column; }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; border-bottom: 1px solid var(--line); }
.chat-row:hover { background: #f6f7f9; }
.chat-av { width: 50px; height: 50px; border-radius: 50%; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex: none; overflow: hidden; }
.chat-av img { width: 100%; height: 100%; object-fit: cover; }
.chat-row-body { flex: 1; min-width: 0; }
.chat-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-row-top b { font-size: 14.5px; font-weight: 700; }
.chat-row-top span { font-size: 11px; color: var(--muted); flex: none; }
.chat-row-preview { display: flex; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-unread { background: var(--dark); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px; margin-left: 8px; flex: none; }

.chat-fab { position: fixed; bottom: 26px; right: 22px; width: 56px; height: 56px; border-radius: 50%; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px -8px rgba(10,10,12,.5); z-index: 20; }
.chat-fab svg { width: 24px; height: 24px; stroke: currentColor; }

.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 5; }
.chat-header .back { width: 36px; height: 36px; border-radius: 10px; background: #eef0f2; display: flex; align-items: center; justify-content: center; flex: none; }
.chat-header .back svg { width: 18px; height: 18px; stroke: var(--ink); }
.chat-header .chat-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-header .chat-title b { display: block; font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .chat-title span { font-size: 11.5px; color: var(--muted); }

#viewConversa { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat-messages { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fafafb; }
.chat-messages::before { content: ''; position: absolute; inset: 0; z-index: 0; background-image: url('assets/tovele-mark.png'); background-repeat: repeat; background-size: 72px auto; background-position: 10px 10px; opacity: .05; pointer-events: none; }
.chat-messages > * { position: relative; z-index: 1; }
.chat-input-bar { flex: none; }
.msg-row { display: flex; flex-direction: column; max-width: 78%; }
.msg-row.own { align-self: flex-end; align-items: flex-end; }
.msg-row.other { align-self: flex-start; align-items: flex-start; }
.msg-sender { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; padding: 0 4px; }
.msg-bubble { border-radius: 16px; padding: 9px 13px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.msg-row.own .msg-bubble { background: var(--dark); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.other .msg-bubble { background: #eef0f2; color: var(--ink); border-bottom-left-radius: 4px; }
.msg-meta { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.msg-check { width: 15px; height: 15px; stroke: currentColor; }
.msg-check.read { color: #4285f4; }

.msg-img { border-radius: 14px; max-width: 220px; max-height: 260px; display: block; cursor: pointer; }
.msg-pdf { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 200px; }
.msg-row.own .msg-pdf { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.msg-pdf-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.msg-row.own .msg-pdf-ic { background: rgba(255,255,255,.2); }
.msg-pdf-ic svg { width: 17px; height: 17px; stroke: currentColor; }
.msg-audio { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.msg-audio audio { height: 32px; max-width: 190px; }

.chat-input-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 6px; }
.chat-input-bar input[type=text] { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; font-size: 14px; outline: none; min-width: 0; }
.chat-input-bar input[type=text]:focus { border-color: var(--dark); }
.chat-icbtn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); flex: none; }
.chat-icbtn:hover { background: #eef0f2; }
.chat-icbtn svg { width: 20px; height: 20px; stroke: currentColor; }
.chat-send { background: var(--dark); color: #fff; }

.rec-bar { display: flex; align-items: center; gap: 10px; flex: 1; padding: 0 6px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recPulse 1s infinite; flex: none; }
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.rec-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-preview { display: flex; align-items: center; gap: 10px; flex: 1; background: #f6f7f9; border-radius: 999px; padding: 5px 6px 5px 12px; min-width: 0; }
.rec-preview audio { flex: 1; height: 32px; min-width: 0; }

.contact-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; cursor: pointer; }
.contact-row:hover { background: #f6f7f9; }
.contact-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; color: transparent; }
.contact-check.checked { background: var(--dark); border-color: var(--dark); color: #fff; }
.contact-check svg { width: 13px; height: 13px; stroke: currentColor; }

.access-opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--line); margin-bottom: 8px; cursor: pointer; }
.access-opt.active { border-color: var(--dark); background: rgba(10,10,12,.04); }
.access-opt input { accent-color: var(--dark); }
.code-display { text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .2em; background: #f6f7f9; border-radius: 12px; padding: 14px; margin-top: 10px; }

.group-photo-picker { width: 84px; height: 84px; border-radius: 50%; background: #eef0f2; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; cursor: pointer; overflow: hidden; position: relative; }
.group-photo-picker img { width: 100%; height: 100%; object-fit: cover; }
.group-photo-picker svg { width: 26px; height: 26px; stroke: var(--muted); }

.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.member-row .mr-body { flex: 1; min-width: 0; }
.member-row .mr-name { font-size: 13.5px; font-weight: 700; }
.member-row .mr-tag { font-size: 11px; color: var(--muted); }
.member-row .mr-action { font-size: 12px; font-weight: 600; color: var(--danger); }
