/* NEXUS HQ — tema escuro futurista, sem brilhos */
:root {
  --bg: #070b16;
  --panel: #0d1424;
  --panel-2: #121b30;
  --line: #1f2b45;
  --line-2: #2c3b5e;
  --text: #e9efff;
  --muted: #93a0c2;
  --dim: #7482a6;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 55%, #a855f7 100%);
  --r: 16px;
  --font: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Orbitron', 'Sora', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(130, 170, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(130, 170, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
.muted { color: var(--muted); }
.ic { flex: none; display: block; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cyan); color: #04121a; padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }

.shell { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.display { font-family: var(--display); letter-spacing: .02em; }
.spacer { flex: 1; }
.link { color: var(--cyan); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 0; min-height: 24px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); color: #04121a; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .06); border-color: #3f5282; }
.btn-danger { color: var(--red); border-color: rgba(251, 113, 133, .4); }
.btn-danger:hover { background: rgba(251, 113, 133, .1); }
.btn-danger-solid { background: var(--red); color: #1c0309; }
.btn-icon {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--muted);
  transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: var(--text); }
.btn-icon:disabled { opacity: .4; cursor: not-allowed; }
.btn-icon.sm { width: 36px; height: 36px; border-radius: 10px; }

/* ---------- Topbar / navegação ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(7, 11, 22, .94); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { font-family: var(--display); font-weight: 800; letter-spacing: .18em; font-size: 16px; display: block; line-height: 1.1; }
.brand small { color: var(--dim); font-size: 11px; letter-spacing: .08em; display: block; white-space: nowrap; }
.logo { width: 36px; height: 36px; }
.brand-lg .logo { width: 52px; height: 52px; }
.brand-lg b { font-size: 22px; }

.nav-desktop { display: none; gap: 4px; margin-left: 20px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14px; transition: color .15s, background .15s; -webkit-tap-highlight-color: transparent;
}
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-btn[aria-current="page"] { color: var(--text); background: rgba(99, 102, 241, .16); }
.nav-btn[aria-current="page"] .ic { color: var(--cyan); }

.fab {
  position: fixed; right: 16px; bottom: calc(20px + var(--safe-b)); z-index: 41; width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; background: var(--grad); color: #04121a; transition: transform .1s;
}
.fab:active { transform: scale(.94); }

.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sync[data-state="saving"] i { background: var(--amber); animation: pulse 1s infinite; }
.sync[data-state="offline"] i { background: var(--red); }
.sync span { display: none; }

.main { padding-top: 20px; padding-bottom: calc(100px + var(--safe-b)); outline: none; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; animation: fadeUp .3s both; }

/* ---------- Cartões ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; }
.section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 20px; margin-right: auto; display: flex; align-items: center; gap: 10px; }
.section-head h2 .ic { color: var(--cyan); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Avisos / notificações ---------- */
.bell { position: relative; }
.bell i { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #1c0309; font: 700 11px/18px var(--font); font-style: normal; text-align: center; }
.alerts { display: grid; gap: 12px; }
.alert-list { display: grid; gap: 8px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--amber); }
.alert.danger { border-left-color: var(--red); }
.alert.info { border-left-color: var(--line-2); }
.a-main { flex: 1; min-width: 0; }
.a-main b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.a-main small { color: var(--muted); font-size: 12.5px; }
.notify-status { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.notify-status .tag { white-space: normal; border-radius: 12px; }

/* ---------- Início ---------- */
.player { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; }
.lvl {
  --s: 64px; width: var(--s); height: calc(var(--s) * 1.1); display: grid; place-items: center; position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--grad);
}
.lvl::before { content: ""; position: absolute; inset: 3px; clip-path: inherit; background: #0a1124; }
.lvl > div { position: relative; text-align: center; line-height: 1; }
.lvl small { display: block; font-size: 8px; letter-spacing: .2em; color: var(--cyan); font-weight: 700; margin-bottom: 3px; }
.lvl b { font-family: var(--display); font-size: 22px; font-weight: 800; }
.player-info { min-width: 0; }
.player-info h2 { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: .04em; margin: 2px 0 8px; }
.xpbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: var(--w); background: var(--grad); border-radius: inherit; }
.xp-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.player-tags { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); color: var(--text);
}
.tag .ic { width: 14px; height: 14px; }
.tag.hot { color: #ffb86b; border-color: rgba(255, 150, 60, .4); }
.tag.ok { color: var(--green); border-color: rgba(52, 211, 153, .4); }
.tag.warn { color: var(--amber); border-color: rgba(251, 191, 36, .4); }
.tag.danger { color: var(--red); border-color: rgba(251, 113, 133, .4); }
.tag.cyan { color: var(--cyan); border-color: rgba(34, 211, 238, .35); }

.home-row { display: grid; gap: 14px; }
.goal { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .bg { stroke: rgba(255, 255, 255, .08); }
.ring .fg { stroke: url(#ringGrad); stroke-dasharray: 314; stroke-dashoffset: var(--off); transition: stroke-dashoffset .8s ease; }
.ring.done .fg { stroke: var(--green); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c b { font-family: var(--display); font-size: 16px; }
.ring-c small { color: var(--dim); font-size: 11px; }
.goal-info { min-width: 0; }
.goal-info h3 { font-size: 15px; margin: 2px 0 4px; }
.goal-info p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .eyebrow { display: flex; align-items: center; gap: 6px; }
.kpi .eyebrow .ic { width: 14px; height: 14px; color: var(--cyan); }
.kpi b { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 12px; }

.timer { display: grid; gap: 14px; }
.timer-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.timer .t-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(34, 211, 238, .1); color: var(--cyan); border: 1px solid rgba(34, 211, 238, .3); }
.timer.running { border-color: rgba(34, 211, 238, .6); }
.timer.running .t-icon { background: var(--cyan); color: #04121a; animation: pulse 1.8s infinite; }
.t-main { flex: 1 1 200px; min-width: 0; }
.t-main h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trows { display: grid; gap: 8px; }
.trow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--c); }
.trow .a-main { flex: 1 1 140px; }
.clock { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: .04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.clock.sm { font-size: 20px; }
.timer-form { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--dim); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; background: #060a15;
  border: 1px solid var(--line-2); transition: border-color .15s; font-size: 16px; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393a0c2' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea { resize: vertical; min-height: 70px; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); }
input[type=date] { color-scheme: dark; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--cyan); }
.form-error { color: var(--red); font-size: 13px; }
.form-error:empty { display: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatches span { display: block; width: 36px; height: 36px; border-radius: 10px; background: var(--c); border: 2px solid transparent; transition: transform .1s; }
.swatches input:checked + span { border-color: #fff; transform: scale(1.1); }
.swatches input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--cyan); }
.chip-btn:hover { background: rgba(34, 211, 238, .12); }
.preview { font-size: 13px; color: var(--green); min-height: 20px; }
.preview.err { color: var(--dim); }

/* ---------- Diálogos ---------- */
dialog {
  margin: auto; width: min(480px, calc(100vw - 24px)); max-height: 92dvh; overflow-x: hidden; overflow-y: auto; padding: 0; border-radius: 20px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
dialog[open] { animation: pop .18s ease-out; }
dialog::backdrop { background: rgba(3, 6, 14, .75); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.dlg-head h3 { font-size: 18px; }
.dlg-body { display: grid; gap: 16px; padding: 12px 20px 8px; }
.dlg-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px 20px; }

/* ---------- Abas / busca ---------- */
.tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.tab { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: rgba(99, 102, 241, .22); color: var(--text); }
.tab em { font-style: normal; opacity: .65; margin-left: 4px; }
.search { position: relative; flex: 1 1 200px; max-width: 320px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; width: 17px; height: 17px; }
.search > input[type=search] { padding-left: 40px; min-height: 44px; }

/* ---------- Progresso ---------- */
.prog { position: relative; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.prog.thin { height: 8px; }
.prog > i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--c, var(--cyan)); transition: width .6s ease; }
.prog .ticks { position: absolute; inset: 0; }
.prog .ticks b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--panel); opacity: .7; }
.prog .ticks b:nth-child(1) { left: 25%; } .prog .ticks b:nth-child(2) { left: 50%; } .prog .ticks b:nth-child(3) { left: 75%; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.c-pct { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--c, var(--cyan)); }

/* ---------- Clientes (lista) ---------- */
.crows { display: grid; gap: 10px; }
.crow { display: grid; gap: 12px; border-left: 3px solid var(--c); border-radius: 6px var(--r) var(--r) 6px; }
.crow.done { background: var(--panel-2); }
.crow-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.crow-top { display: grid; gap: 12px; cursor: pointer; }
.crow-name { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; text-align: left; color: var(--text); border-radius: 8px; }
.crow-name .ic { color: var(--muted); transition: transform .15s; }
.crow.open .crow-name .ic { transform: rotate(180deg); }
.crow-title { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.crow-desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crow-detail { display: grid; gap: 18px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); cursor: default; }
.detail-section { display: grid; gap: 10px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.detail-head h4 { font-size: 14px; font-weight: 600; }
.small { font-size: 13px; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dgrid > div { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.dgrid dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.dgrid dd { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 2px 0 0; }
.history { max-height: 340px; overflow-y: auto; padding-right: 4px; }
.rem-list { display: grid; gap: 8px; }
.rem { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--line-2); }
.rem.today { border-left-color: var(--amber); }
.rem.overdue { border-left-color: var(--red); }
.rem-check { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: transparent; transition: .15s; }
.rem-check:hover { border-color: var(--green); color: var(--green); }
.c-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.crow-head > .c-tags:empty { display: none; }
.crow-btns { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.crow-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; }
.crow-nums .display { font-size: 18px; }
.overall { display: grid; gap: 10px; }

.empty { text-align: center; padding: 36px 20px; display: grid; gap: 12px; justify-items: center; }
.empty .glyph { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(99, 102, 241, .14); color: var(--cyan); border: 1px solid var(--line-2); }
.empty h3 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 380px; font-size: 14px; }

/* ---------- Registros (quadro estilo ClickUp) ---------- */
.board { columns: 340px; column-gap: 14px; }
.bcard { display: grid; gap: 12px; break-inside: avoid; margin-bottom: 14px; border-top: 3px solid var(--c); border-radius: 6px 6px var(--r) var(--r); padding: 14px; }
.bcard.flash { border-color: var(--cyan); animation: flash 1.4s; }
.bcard-head { display: flex; align-items: center; gap: 8px; }
.bcard-head h3 { font-size: 16px; overflow-wrap: anywhere; }
.bcard-prog { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.bcard-prog .display { color: var(--text); font-size: 14px; }
.bcard .entries { border-top: 1px solid var(--line); padding-top: 6px; }
.bempty { font-size: 13px; padding: 10px 2px; }
.more { justify-self: start; }
.entries { display: grid; }
.entry { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0 4px 2px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-date { font-size: 12px; color: var(--muted); }
.entry-note { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-h { font-family: var(--display); font-weight: 700; font-size: 13px; white-space: nowrap; }
.entry-btns { display: flex; }

/* ---------- Conquistas ---------- */
.card.week { display: grid; gap: 12px; }
.card.week .section-head h2 { font-size: 17px; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; min-height: 190px; align-items: stretch; position: relative; padding-top: 22px; }
.bar { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 8px; text-align: center; min-width: 0; }
.bar-track { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill { width: min(100%, 32px); height: var(--h); min-height: 3px; border-radius: 8px 8px 3px 3px; background: #4a55c9; transition: height .6s ease; }
.bar.today .bar-fill { background: var(--cyan); }
.bar.hit .bar-fill { background: var(--green); }
.bar-val { position: absolute; bottom: calc(var(--h) + 4px); font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bar span { font-size: 12px; color: var(--dim); }
.bar.today span { color: var(--cyan); font-weight: 700; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(251, 191, 36, .6); pointer-events: none; }
.goal-line em { position: absolute; right: 0; top: -18px; font-style: normal; font-size: 10px; color: var(--amber); letter-spacing: .08em; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.badge { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px; }
.badge .b-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; grid-row: span 2; background: rgba(255, 255, 255, .05); color: var(--dim); border: 1px solid var(--line); }
.badge h3 { font-size: 15px; align-self: end; }
.badge p { font-size: 12.5px; color: var(--muted); align-self: start; }
.badge .b-prog { grid-column: 1 / -1; margin-top: 6px; }
.badge .b-prog .xpbar { height: 6px; }
.badge .b-prog small { display: block; margin-top: 4px; font-size: 11px; color: var(--dim); }
.badge.on { border-color: rgba(251, 191, 36, .45); }
.badge.on .b-ic { color: #1c1200; background: linear-gradient(135deg, #fde68a, #f59e0b); border-color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Toasts / FX / Login ---------- */
.toasts { position: fixed; z-index: 100; top: 12px; left: 12px; right: 12px; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; width: min(420px, 100%); padding: 12px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: toastIn .25s ease-out; }
.toast.out { animation: toastOut .25s forwards; }
.toast .t-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(34, 211, 238, .12); color: var(--cyan); }
.toast.gold { border-color: rgba(251, 191, 36, .5); }
.toast.gold .t-ic { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #1c1200; }
.toast.error { border-color: rgba(251, 113, 133, .5); }
.toast.error .t-ic { background: rgba(251, 113, 133, .14); color: var(--red); }
.toast.level { border-color: rgba(139, 92, 246, .6); }
.toast.level .t-ic { background: var(--grad); color: #04121a; }
.toast b { display: block; font-size: 14px; }
.toast small { color: var(--muted); font-size: 12.5px; display: block; }
#hero { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
#btn-hero[aria-pressed="false"] { opacity: .5; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); display: grid; gap: 20px; padding: 28px; }

/* ---------- Animações ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes pulse { 50% { opacity: .4; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes grow { from { width: 0; } }
@keyframes rise { from { height: 0; } }
@keyframes flash { 0%, 60% { background: var(--panel-2); } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.intro .prog > i, .intro .xpbar i { animation: grow .9s ease-out both; }
.intro .bar-fill { animation: rise .7s ease-out both; }

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  dialog { margin: auto 0 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; padding-bottom: var(--safe-b); }
  dialog[open] { animation: sheet .24s ease-out; }
  .hide-sm { display: none; }
  .brand small { display: none; }
  .kpi b { font-size: 17px; }
  .crow-btns { margin-left: 0; width: 100%; }
  .crow-btns .btn-primary { flex: 1; }
  .entry { grid-template-columns: 62px 1fr auto auto; }
  .entry-btns [data-act="del-entry"] { display: none; }
  .search { max-width: none; }
}
@media (min-width: 641px) {
  .shell { padding-inline: 24px; }
  .sync span { display: inline; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .stat-grid > .card:last-child:nth-child(odd) { grid-column: auto; }
  .timer-form { grid-template-columns: minmax(160px, 1fr) minmax(160px, 1.6fr) auto; }
  .t-actions { flex: 0 0 auto; }
  .t-actions .btn { flex: none; }
  .toasts { left: auto; right: 20px; top: 74px; justify-items: end; }
  .entry-btns { opacity: 0; transition: opacity .12s; }
  .entry:hover .entry-btns, .entry:focus-within .entry-btns { opacity: 1; }
}
@media (hover: none) { .entry-btns { opacity: 1 !important; } }
@media (min-width: 900px) {
  .main { padding-top: 28px; padding-bottom: 60px; }
  .home-row { grid-template-columns: 1fr 1.5fr; }
  .player { grid-template-columns: auto 1fr auto; }
  .player-tags { grid-column: auto; flex-direction: column; align-items: flex-end; }
}
@media (max-width: 380px) { .goal { flex-direction: column; text-align: center; } .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #fx { display: none; }
}

/* ---------- Etiquetas, fora de hora, prospecção ---------- */
.lbl { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); white-space: nowrap; }
.lbl-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.lbl.pick { min-height: 34px; padding: 4px 14px; font-size: 13px; background: transparent; cursor: pointer; transition: background .12s; }
.lbl.pick:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.lbl.pick.on { background: color-mix(in srgb, var(--c) 30%, transparent); color: var(--text); border-color: var(--c); }
.label-filter { width: auto; min-width: 180px; max-width: 240px; min-height: 44px; }
.label-list { display: grid; gap: 6px; }
.label-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--panel); }
.label-form { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.label-form h4 { font-size: 14px; }
.label-btns { display: flex; justify-content: flex-end; gap: 8px; }
.off-ic { display: inline-block; vertical-align: -2px; color: var(--violet); margin-right: 6px; }
.off-ic .ic { display: inline-block; }
.xp2 { color: var(--violet); font-weight: 700; }
.timer-form .check { grid-column: 1 / -1; min-height: 32px; }
.meetings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; align-items: start; }
.meeting { display: grid; gap: 10px; border-top: 3px solid var(--violet); border-radius: 6px 6px var(--r) var(--r); }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-head h3 { font-size: 16px; overflow-wrap: anywhere; }
.m-time { display: flex; align-items: baseline; gap: 8px; }
.m-time .display { font-size: 24px; }
.m-note { color: var(--muted); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.meeting .btn { justify-self: start; }
.bcard-head .lbl { display: none; }
@media (min-width: 641px) { .bcard-head .lbl { display: inline-flex; } }

@media (min-width: 1024px) {
  .nav-desktop { display: flex; }
  .fab, .topbar .menu-btn { display: none; }
  .main { padding-bottom: 60px; }
}
@media (min-width: 900px) and (max-width: 1023px) { .hide-sm { display: none; } }

/* ---------- Contas, usuários e ranking ---------- */
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; font-weight: 700; font-size: 13px; color: #04121a; background: var(--grad); }
.avatar.lg { width: 40px; height: 40px; font-size: 17px; }
.user-btn { padding: 0; }
.login-hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.acc-form { display: grid; gap: 10px; justify-items: start; }
.acc-form .field { width: 100%; }
.acc-admin { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.acc-admin h4 { font-size: 14px; }
.user-list { display: grid; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); flex-wrap: wrap; }
.user-row .u-main { flex: 1; min-width: 120px; display: grid; }
.user-row small { color: var(--muted); font-size: 12px; }

.rank-list { list-style: none; display: grid; gap: 10px; padding: 0; margin: 0; }
.rank-row { display: grid; grid-template-columns: 32px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.rank-row.you { border-color: rgba(34, 211, 238, .5); }
.rk-pos { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted); text-align: center; }
.rank-row.top1 .rk-pos { color: #fbbf24; }
.rank-row.top2 .rk-pos { color: #cbd5e1; }
.rank-row.top3 .rk-pos { color: #fb923c; }
.rk-main { display: grid; gap: 4px; min-width: 0; }
.rk-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-main small { color: var(--muted); font-size: 12px; }
.rk-xp { text-align: right; display: grid; }
.rk-xp b { font-size: 18px; color: var(--cyan); }
.rk-xp small { color: var(--muted); font-size: 11px; }
@media (max-width: 520px) { .rank-row { grid-template-columns: 24px 36px minmax(0, 1fr) auto; gap: 8px; padding: 10px; } .rank-row .avatar.lg { width: 34px; height: 34px; } }

/* ---------- Etapas (checklist) ---------- */
.task-list { display: grid; gap: 6px; margin: 10px 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--line-2); }
.task.overdue { border-left-color: var(--rose, #fb7185); }
.task.today { border-left-color: #fbbf24; }
.task.done .task-text { text-decoration: line-through; color: var(--muted); }
.task-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.task-check { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; border: 2px solid var(--line-2); color: #04121a; transition: .15s; }
.task.done .task-check, .cal-ev.done .task-check, .task-check[aria-checked="true"] { background: var(--cyan); border-color: var(--cyan); }
.task input.task-due { width: 132px; flex: none; min-height: 34px; padding: 0 8px; font-size: 13px; }
.task.overdue .task-due { color: #fb7185; }
.task-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-form input[name="text"] { flex: 1 1 200px; min-width: 0; }
.task-form input[type="date"] { width: 150px; }
@media (max-width: 520px) { .task { flex-wrap: wrap; } .task-text { flex-basis: calc(100% - 80px); } .task input.task-due { margin-left: 38px; } }

/* ---------- Calendário ---------- */
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--text); }
.cal-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cal-chip.off { opacity: .45; }
.cal-chip.off i { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.cal-chip.static { color: var(--muted); border-style: dashed; }
.cal-chip.static b { color: var(--cyan); font-size: 11px; }
.cal-wrap { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) { .cal-wrap { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); } }
.cal-side { display: grid; gap: 16px; min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; }
.cal-cell { min-height: 64px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; transition: border-color .12s; }
.cal-cell:hover { border-color: var(--line-2); }
.cal-cell.out { opacity: .42; }
.cal-cell.today .cal-n { background: var(--cyan); color: #04121a; }
.cal-cell.sel { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.cal-cell.late { border-color: rgba(251, 113, 133, .55); }
.cal-n { font-size: 12.5px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 7px; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.cal-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cal-dots i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); opacity: .7; }
.cal-dots em { font-size: 10px; color: var(--muted); font-style: normal; }
.cal-h { margin-top: auto; font-size: 10.5px; color: var(--cyan); font-weight: 600; }
@media (max-width: 520px) { .cal-cell { min-height: 52px; padding: 4px; } .cal-dots i { width: 6px; height: 6px; } .cal-h { display: none; } }
.cal-list { display: grid; gap: 8px; margin-top: 10px; }
.cal-ev { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--c, var(--line-2)); }
.cal-ev.done .a-main b { text-decoration: line-through; color: var(--muted); }
.cal-ev.overdue { background: rgba(251, 113, 133, .08); }
.cal-ev .a-main { flex: 1; min-width: 0; }
.cal-ev .a-main small { color: var(--muted); font-size: 12px; display: block; }
.cal-ic { display: grid; place-items: center; width: 28px; flex: none; }

/* ---------- Barra lateral (desktop), recolhível ---------- */
.collapse-btn, .sb-label { display: none; }
@media (min-width: 1024px) {
  :root { --sb-w: 252px; }
  body.sb-collapsed { --sb-w: 76px; }
  body { padding-left: var(--sb-w); transition: padding-left .22s ease; }
  .topbar {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--sb-w); height: 100dvh; z-index: 40;
    background: rgba(9, 13, 26, .98); border-bottom: 0; border-right: 1px solid var(--line);
    transition: width .22s ease; overflow-x: hidden; overflow-y: auto;
  }
  .topbar-in { flex-direction: column; align-items: stretch; gap: 4px; width: 100%; max-width: none; margin: 0; padding: 18px 12px 14px; min-height: 100%; }
  .topbar .brand { order: 0; padding: 2px 6px 16px; }
  .topbar-end { display: contents; }
  #btn-top-log { order: 1; display: inline-flex !important; width: 100%; margin-bottom: 12px; justify-content: center; }
  .nav-desktop { order: 2; display: flex; flex-direction: column; margin: 0; gap: 2px; }
  .nav-desktop .nav-btn { width: 100%; padding: 0 14px; gap: 12px; justify-content: flex-start; white-space: nowrap; }
  .nav-desktop .nav-btn[aria-current="page"] { box-shadow: inset 3px 0 0 var(--cyan); }
  #sync { order: 10; margin-top: auto; width: 100%; justify-content: flex-start; border-radius: 10px; padding: 9px 14px; }
  .sync > span { display: inline; }
  #btn-hero { order: 11; } #btn-bell { order: 12; } #btn-user { order: 13; } .collapse-btn { order: 14; }
  .topbar .btn-icon { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; white-space: nowrap; font-size: 14px; color: var(--muted); }
  .topbar .btn-icon:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
  .topbar .user-btn { padding: 0 11px; color: var(--text); }
  .sb-label { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .collapse-btn { display: flex; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 4px; height: 48px; }
  .bell i { top: 50%; right: 12px; transform: translateY(-50%); }

  body.sb-collapsed .sb-label,
  body.sb-collapsed .nav-desktop .nav-btn span,
  body.sb-collapsed .topbar .brand > div,
  body.sb-collapsed .sync > span,
  body.sb-collapsed #btn-top-log span { display: none; }
  body.sb-collapsed .topbar .brand { justify-content: center; padding-inline: 0; }
  body.sb-collapsed .nav-desktop .nav-btn,
  body.sb-collapsed .topbar .btn-icon,
  body.sb-collapsed #sync,
  body.sb-collapsed #btn-top-log { justify-content: center; padding-inline: 0; }
  body.sb-collapsed .bell i { top: 3px; right: 14px; transform: none; }
  body.sb-collapsed .collapse-btn .ic { transform: scaleX(-1); }
}

/* ---------- Menu hambúrguer (abaixo de 1024px) ---------- */
.menu-btn { flex: none; }
.topbar-in { gap: 10px; }
dialog.drawer {
  margin: 0; inset: 0 auto 0 0; height: 100dvh; max-height: none; width: min(310px, 86vw); max-width: none;
  padding: 0; border-radius: 0 20px 20px 0; display: none; flex-direction: column;
}
dialog.drawer[open] { display: flex; animation: drawerIn .22s ease-out; }
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px 20px; }
.drawer-nav { display: grid; gap: 4px; padding: 8px 12px; flex: 1; align-content: start; overflow-y: auto; }
.drawer-nav .nav-btn { width: 100%; min-height: 52px; padding: 0 16px; gap: 14px; font-size: 16px; justify-content: flex-start; }
.drawer-nav .nav-btn[aria-current="page"] { box-shadow: inset 3px 0 0 var(--cyan); }
.drawer-foot { padding: 12px 16px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }
@media (max-width: 430px) {
  #sync[data-state="ok"] { display: none; } /* em telas estreitas, só aparece quando há algo errado */
  .topbar-in { gap: 8px; }
}
@media (min-width: 1024px) { .topbar .menu-btn { display: none; } }
