/* =========================================================
   Pulse · Allrisk
   Calmo, caro e fácil de usar com uma mão.
   ========================================================= */
:root {
  --accent: #2DD4A0;          /* Allrisk */
  --accent-ink: #16A57A;
  --accent-tint: #E4F8F1;

  --bg: #FFFFFF;
  --ink: #1D1D1F;
  --ink-2: #48484A;
  --muted: #8E8E93;
  --faint: #C7C7CC;
  --line: #ECECEE;
  --field: #E5E5EA;

  --shadow-circle: 0 10px 24px rgba(0,0,0,.075), 0 2px 6px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-lift: 0 24px 60px rgba(0,0,0,.10), 0 4px 14px rgba(0,0,0,.04);

  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }

[data-icon] { display: inline-grid; place-items: center; }
[data-icon] svg { width: 100%; height: 100%; }
svg.i { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; letter-spacing: -.2px; color: var(--ink); }
.logo-mark { width: 24px; height: 24px; color: var(--accent); }
.logo-lg { font-size: 30px; gap: 14px; letter-spacing: -.6px; }
.logo-lg .logo-mark { width: 44px; height: 44px; }
.logo-xl { font-size: 48px; font-weight: 300; gap: 14px; letter-spacing: -1.5px; justify-content: center; }
.logo-xl .logo-mark { width: 46px; height: 46px; }
.logo-mark svg.i { stroke-width: 1.4; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 32px; border-radius: 999px;
  font-size: 17px;
  transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { border: 1px solid #DADADF; color: #3F5A45; background: #fff; }
.btn-outline:hover { border-color: #C9CCD1; }

.x-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: background .2s; }
.x-btn:hover { background: #F5F5F7; }
.x-btn [data-icon] { width: 26px; height: 26px; }
.x-btn svg.i { stroke-width: 1.5; }

.save-btn {
  display: inline-flex; align-items: center; text-decoration: none;
  height: 46px; padding: 0 24px; border-radius: 999px;
  background: #F2F2F4; color: #1A73E8; font-size: 17px; font-weight: 500;
  transition: background .2s, transform .15s;
}
.save-btn:hover { background: #EAEAEE; }
.save-btn:active { transform: scale(.96); }
.save-btn[disabled] { opacity: .5; pointer-events: none; }

/* =========================================================
   LOGIN
   ========================================================= */
#login-screen.active { display: grid; place-items: center; }
.login { width: min(320px, calc(100vw - 56px)); text-align: center; animation: rise .8s var(--ease) both; }
.login .logo { margin-bottom: 56px; }
.login input {
  width: 100%; padding: 16px 0; margin-bottom: 22px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: 17px; font-weight: 300; background: transparent; outline: none;
  transition: border-color .25s;
}
.login input::placeholder { color: var(--faint); }
.login input:focus { border-bottom-color: var(--ink); }
.login .btn { margin-top: 18px; min-width: 160px; }
.login-error { min-height: 18px; font-size: 13px; color: #D0605E; }
.login-foot { margin-top: 48px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); }
.login.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =========================================================
   APP — estado de espera
   ========================================================= */
#app-screen.active { animation: fade .6s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 26px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.controls { display: flex; gap: 8px; }
.ctrl {
  height: 34px; padding: 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.ctrl:hover { color: var(--ink-2); border-color: #DCDCE0; }
.ctrl:active { transform: scale(.95); }
.ctrl.on { color: #B26A00; border-color: #F4D9A8; background: rgba(255,248,235,.8); }
.ctrl-icon { width: 34px; padding: 0; display: grid; place-items: center; }
.ctrl-icon [data-icon] { width: 15px; height: 15px; }

.stage { position: absolute; inset: 0; cursor: pointer; }

.arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arc path { fill: none; stroke-linecap: round; }
.arc-base { stroke: #EDEDEF; stroke-width: 2; }
.arc-elapsed { stroke: url(#elapsed-grad); stroke-width: 2; transition: stroke-dashoffset 1s linear; }
.arc-pause { stroke: #DCDCE0; stroke-width: 6; }
.arc-glow, .arc-glow-core {
  stroke-dasharray: var(--g) var(--len);
  animation: glow 9s linear infinite;
}
.arc-glow { stroke: rgba(45,212,160,.55); stroke-width: 6; }
.arc-glow-core { stroke: rgba(255,255,255,.95); stroke-width: 1.5; }
@keyframes glow {
  from { stroke-dashoffset: var(--g); }
  to   { stroke-dashoffset: calc(-1 * var(--len)); }
}
.is-calm .arc-glow, .is-calm .arc-glow-core { animation-play-state: paused; }
.is-paused .arc-glow, .is-paused .arc-glow-core { opacity: 0; }
#arc-ticks, .marks, .now { transition: opacity .35s var(--ease); }
.is-calm #arc-ticks, .is-calm .marks, .is-calm .now { opacity: .12; }
.is-paused .arc-elapsed { stroke: #D9D9DE; }

.arc-tick { font-size: 11px; fill: var(--faint); text-anchor: middle; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.arc-tick.past { fill: var(--muted); }

/* Ponto "agora" */
.now { position: absolute; left: 0; top: 0; width: 0; height: 0; transition: transform 1s linear; pointer-events: none; }
.now-dot, .now-ring { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.now-dot { width: 12px; height: 12px; background: #fff; border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(45,212,160,.55); }
.now-ring { width: 12px; height: 12px; background: var(--accent); animation: ring 2.4s var(--ease) infinite; }
@keyframes ring { from { opacity: .45; transform: translate(-50%,-50%) scale(1); } to { opacity: 0; transform: translate(-50%,-50%) scale(4.2); } }
.is-paused .now-dot { border-color: var(--faint); box-shadow: none; }
.is-paused .now-ring { display: none; }

/* Marcas */
.marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; }
.mark::before { content: ''; position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; }
.mark-dot {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff; border: 2px solid var(--mid);
  box-shadow: 0 0 10px var(--mid), 0 0 0 3px rgba(255,255,255,.9);
  transition: transform .2s var(--spring);
}
.mark:hover .mark-dot { transform: translate(-50%, -50%) scale(1.45); }
.mark.is-new .mark-dot { animation: markIn .7s var(--spring) both; }
.mark.is-new::after {
  content: ''; position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: var(--mid); transform: translate(-50%, -50%);
  animation: markPulse 1.4s var(--ease) 2;
}
@keyframes markIn { from { transform: translate(-50%,-50%) scale(0); } to { transform: translate(-50%,-50%) scale(1); } }
@keyframes markPulse { from { opacity: .7; transform: translate(-50%,-50%) scale(1); } to { opacity: 0; transform: translate(-50%,-50%) scale(6); } }

/* Texto do rodapé */
.footer-text {
  position: absolute; left: 0; right: 0; bottom: calc(44px + env(safe-area-inset-bottom)); z-index: 12;
  text-align: center; pointer-events: none;
}
.ft-main { font-size: 17px; font-weight: 300; color: #6E6E73; }
.ft-sub { margin-top: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ft-sub b { font-weight: 500; color: var(--ink-2); }
.ft-sub .pause-tag { color: #B26A00; }
.is-idle .ft-main { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* =========================================================
   Seletor de canal (ícones pousados no arco)
   ========================================================= */
.picker {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(255,255,255,0);
  visibility: hidden;
  transition: background .35s var(--ease), visibility 0s .4s;
}
.picker.open { background: rgba(255,255,255,.62); visibility: visible; transition: background .35s var(--ease), visibility 0s; }

.p-item {
  position: absolute; left: 0; top: 0;
  width: var(--s); height: var(--s);
  transform: translate(-50%, -50%) translateY(26px) scale(.6);
  opacity: 0;
  transition: transform .55s var(--spring), opacity .3s var(--ease);
  transition-delay: calc(var(--i) * 45ms);
}
.picker.open .p-item { transform: translate(-50%, -50%); opacity: 1; }

.p-btn {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #FFFFFF 0%, #F8F8F9 100%);
  box-shadow: var(--shadow-circle);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.p-disc {
  width: 76%; height: 76%; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: var(--ink-c);
}
.p-disc [data-icon] { width: 46%; height: 46%; }
.p-disc svg.i { stroke-width: 1.5; }
.p-btn:hover { box-shadow: 0 14px 30px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05); }
.p-btn.pressed { transform: scale(.92); box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.p-btn.release { animation: bounce .45s var(--spring); }
.p-btn.release::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  animation: lightPulse .7s var(--ease) forwards;
}
@keyframes bounce { 0% { transform: scale(.92); } 55% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes lightPulse { from { box-shadow: 0 0 0 0 var(--mid); opacity: .9; } to { box-shadow: 0 0 0 18px var(--mid); opacity: 0; } }

.p-label {
  position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.p-key { color: var(--faint); margin-left: 5px; font-size: 10px; }

/* =========================================================
   Painel de registo
   ========================================================= */
.scrim {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(250,250,251,0); visibility: hidden;
  transition: background .35s, visibility 0s .35s;
}
.scrim.open { background: rgba(250,250,251,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); visibility: visible; transition: background .35s, visibility 0s; }

.sheet {
  position: absolute; left: 50%; bottom: 0; z-index: 25;
  width: min(520px, 100%);
  max-height: calc(100% - 24px); overflow-y: auto;
  background: #fff;
  border-radius: 36px 36px 0 0;
  box-shadow: 0 -12px 50px rgba(0,0,0,.07);
  transform: translate(-50%, 105%);
  visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s .5s;
}
.sheet.open { transform: translate(-50%, 0); visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
@media (min-width: 700px) and (min-height: 800px) {
  .sheet { bottom: 28px; border-radius: 36px; box-shadow: var(--shadow-lift); transform: translate(-50%, calc(100% + 60px)); }
}
.sheet-x { position: absolute; top: 18px; left: 18px; }
.sheet-inner { width: min(400px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; }

.hero-icon {
  width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 1px solid #EFEFF1; color: var(--ink-c);
  box-shadow: 0 6px 18px rgba(0,0,0,.035);
}
.hero-icon [data-icon] { width: 44px; height: 44px; }
.hero-icon svg.i { stroke-width: 1.45; }
.sheet.open .hero-icon { animation: heroIn .6s var(--spring) .1s both; }
@keyframes heroIn { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.chip-ok {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; height: 32px; padding: 0 8px 0 14px; border-radius: 999px;
  background: var(--tint); color: var(--ink-c); font-size: 15px;
}
.chip-ok-check { width: 18px; height: 18px; border-radius: 50%; background: var(--ink-c); color: #fff; padding: 3px; }
.chip-ok-check svg.i { stroke-width: 3; }

.steps { position: relative; width: 100%; height: 12px; margin: 32px 0 34px; display: flex; justify-content: space-around; align-items: center; }
.steps-line { position: absolute; left: -24px; right: -24px; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, #EDEDEF 12%, #EDEDEF 88%, transparent); }
.step { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #E3E3E7; transition: background .3s, transform .3s var(--spring), box-shadow .3s; }
.step.done { background: #4CBF6B; transform: scale(1.15); box-shadow: 0 0 10px rgba(76,191,107,.45); }

.grid-2 { width: 100%; display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; }
.fld { display: block; width: 100%; margin-bottom: 22px; }
.fld-label { display: block; font-size: 14px; color: #6E6E73; margin-bottom: 10px; white-space: nowrap; }
.fld-label em { font-style: normal; color: var(--ink); }

.select, .inp {
  position: relative; display: flex; align-items: center;
  height: 54px; border-radius: 14px;
  border: 1px solid var(--field); background: #fff;
  transition: border-color .25s, box-shadow .25s;
}
.select select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 100%; border: 0; background: transparent; outline: none;
  padding: 0 40px; font-size: 17px; color: var(--faint); cursor: pointer;
}
.select select option { color: var(--ink); }
.select-dot { position: absolute; left: 18px; width: 10px; height: 10px; border-radius: 50%; background: #E0E0E4; pointer-events: none; transition: background .25s; }
.select-chev { position: absolute; right: 14px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.select.filled { border-color: #8FD3A6; }
.select.filled select { color: var(--ink); }
.select.filled .select-dot { background: #4CBF6B; }
.select.filled .select-chev { color: var(--ink-2); }
.select:focus-within, .inp:focus-within { border-color: #8FD3A6; box-shadow: 0 0 0 4px rgba(76,191,107,.10); }

.inp input {
  width: 100%; height: 100%; border: 0; background: transparent; outline: none;
  padding: 0 46px 0 20px; font-size: 17px;
}
.inp input::placeholder { color: #D1D1D6; }
.inp-ico { position: absolute; right: 16px; width: 22px; height: 22px; color: #8E8E93; pointer-events: none; }
.inp-ico svg.i { stroke-width: 1.4; }
#codigo-postal { letter-spacing: 1px; font-variant-numeric: tabular-nums; }

.sheet-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.agendar-ok { width: 0; height: 18px; overflow: hidden; color: var(--accent-ink); transition: width .25s; }
.agendar-ok svg.i { stroke-width: 2.4; }
#agendar-btn.done { border-color: #A9DEC4; color: var(--accent-ink); }
#agendar-btn.done .agendar-ok { width: 18px; }

/* =========================================================
   Agendar
   ========================================================= */
.schedule {
  position: absolute; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(250,250,251,0); visibility: hidden;
  transition: background .3s, visibility 0s .4s;
}
.schedule.open { background: rgba(250,250,251,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); visibility: visible; transition: background .3s, visibility 0s; }
.schedule-card {
  width: min(460px, 100%);
  padding: 26px 28px 30px;
  background: #fff; border-radius: 32px; box-shadow: var(--shadow-lift);
  transform: translateY(24px) scale(.98); opacity: 0;
  transition: transform .45s var(--ease), opacity .3s;
}
.schedule.open .schedule-card { transform: none; opacity: 1; }
.sch-top { display: flex; justify-content: space-between; align-items: center; margin: 0 -6px 34px; }
.sch-title { margin: 44px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 30px; font-weight: 600; letter-spacing: -.6px; line-height: 1.2; }

.sch-row {
  position: relative; display: flex; align-items: center; gap: 18px;
  margin-top: 26px; padding: 14px 22px 14px 14px;
  border: 1px solid var(--field); border-radius: 22px;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.sch-row + .sch-row { margin-top: 16px; }
.sch-row:hover { border-color: #D8D8DD; background: #FDFDFD; }
.sch-ico { width: 56px; height: 56px; border-radius: 14px; background: #F7F8F7; color: #4CB074; padding: 14px; flex: none; }
.sch-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sch-text small { font-size: 17px; color: var(--muted); }
.sch-text b { font-size: 19px; font-weight: 400; font-variant-numeric: tabular-nums; }
.sch-chev { width: 26px; height: 26px; color: var(--ink-2); }
.sch-native { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; }
.sch-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.sch-durations { display: flex; gap: 8px; margin-top: 16px; padding-left: 4px; }
.sch-durations button {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); transition: all .2s;
}
.sch-durations button.on { border-color: #A9DEC4; background: var(--accent-tint); color: var(--accent-ink); }
.sch-foot { margin-top: 64px; font-size: 17px; font-style: italic; font-weight: 300; color: #6E6E73; }

/* =========================================================
   Resumo do turno
   ========================================================= */
.summary {
  position: absolute; inset: 0; z-index: 40;
  background: #fff; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .45s;
}
.summary.open { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s; }
.sum-top {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  background: linear-gradient(#fff 70%, rgba(255,255,255,0));
}
.sum-body { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 10px 0 80px; }

.sum-total { font-size: clamp(88px, 12vw, 148px); font-weight: 200; letter-spacing: -.04em; line-height: .95; color: #2C2C2E; font-variant-numeric: tabular-nums; }
.sum-caption { margin-top: 18px; font-size: 14px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.sum-shift { margin-top: 16px; font-size: 17px; font-weight: 300; color: #6E6E73; }

.area { position: relative; margin: 50px 0 0; }
.area svg { display: block; width: 100%; height: 140px; overflow: visible; }
.area-line { fill: none; stroke: #D3D3D8; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.area-labels { position: relative; height: 30px; margin-top: 16px; }
.area-labels span { position: absolute; top: 0; transform: translateX(-50%); font-size: 13px; color: #AEAEB2; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sum-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; margin-top: 64px; align-items: center; }
.donut-wrap { display: flex; align-items: center; gap: 40px; }
.donut { width: 240px; height: 240px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; }
.donut .seg { transition: stroke-dasharray 1.1s var(--ease); }
.legend { list-style: none; display: grid; gap: 16px; flex: 1; min-width: 0; }
.legend li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; font-size: 17px; }
.legend .lg-ico { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--mid); color: var(--mid-ink); padding: 9px; }
.legend .lg-pct { color: #AEAEB2; font-variant-numeric: tabular-nums; }

.kw-title { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.kw-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr; align-items: center; gap: 18px; margin-bottom: 20px; }
.kw-row > span { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-track { display: flex; align-items: center; gap: 12px; }
.kw-bar { height: 16px; border-radius: 4px; background: var(--c); width: 0; transition: width 1s var(--ease); }
.kw-track b { font-weight: 400; color: #8E8E93; font-size: 14px; font-variant-numeric: tabular-nums; }
.empty { color: var(--faint); font-size: 15px; font-weight: 300; }

/* ---------- Tooltip ---------- */
.tip {
  position: absolute; z-index: 8; pointer-events: none;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255,255,255,.97); color: var(--ink);
  box-shadow: var(--shadow-lift); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.55; white-space: nowrap;
  opacity: 0; transform: translate(-50%, calc(-100% - 10px));
  transition: opacity .15s, transform .15s;
}
.tip.show { opacity: 1; transform: translate(-50%, calc(-100% - 16px)); }
.tip b { font-weight: 600; }
.tip .muted { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 22px; z-index: 60; pointer-events: none;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 18px 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lift);
  font-size: 14px; color: var(--ink); white-space: nowrap;
  transform: translate(-50%, -90px); opacity: 0;
  transition: transform .5s var(--spring), opacity .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .t-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; padding: 5px; }
.toast .t-ico svg.i { stroke-width: 3; }
.toast.error .t-ico { background: #F08A87; }

/* ---------- Ecrãs pequenos ---------- */
@media (max-width: 700px) {
  .topbar { padding: 16px; }
  .ctrl { height: 32px; padding: 0 12px; font-size: 12px; }
  .ctrl-icon { width: 32px; padding: 0; }
  .topbar .logo > span:not(.logo-mark) { display: none; }
  .controls { gap: 6px; }
  .ft-main { font-size: 16px; }
  .sheet-inner { padding-top: 26px; }
  .hero-icon { width: 92px; height: 92px; }
  .hero-icon [data-icon] { width: 38px; height: 38px; }
  .steps { margin: 24px 0 26px; }
  .fld { margin-bottom: 18px; }
  .select, .inp { height: 50px; }
  .select select { padding: 0 34px; font-size: 16px; }
  .select-dot { left: 14px; }
  .schedule-card { height: 100%; border-radius: 0; box-shadow: none; padding: 18px 22px; display: flex; flex-direction: column; }
  .sch-title { font-size: 26px; margin-top: 34px; }
  .sch-foot { margin-top: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sum-body { width: calc(100% - 40px); }
  .sum-grid { grid-template-columns: 1fr; gap: 56px; margin-top: 56px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { width: 220px; height: 220px; align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Saudação e botão do painel
   ========================================================= */
.hello { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 300; }
.hello:empty { display: none; }
.ctrl-accent { color: var(--accent-ink); border-color: #BFEBDB; background: rgba(228,248,241,.75); }
.ctrl-accent:hover { color: #0E8F69; border-color: #9FE0C8; }
.ctrl[hidden] { display: none; }
.ctrl:disabled { opacity: .55; pointer-events: none; }

/* =========================================================
   PAINEL
   ========================================================= */
#admin-screen { overflow-y: auto; background: #fff; }
#admin-screen.active { animation: fade .4s var(--ease); }
.adm-top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 26px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #F2F2F4;
}
.adm-top .controls { justify-self: end; }
.adm-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: #F4F4F6; }
.adm-tab { height: 34px; padding: 0 18px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; }
.adm-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.adm-body { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 90px; }
.adm-pane[hidden] { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 44px; }
.seg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-chips button {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2); background: #fff; transition: all .2s;
}
.seg-chips button:hover { border-color: #D8D8DD; }
.seg-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters-right { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.mini-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.mini-field input, .mini-field select {
  height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--field); background: #fff;
  font-size: 14px; color: var(--ink); outline: none; min-width: 0;
}
.mini-field input:focus, .mini-field select:focus { border-color: #8FD3A6; box-shadow: 0 0 0 3px rgba(76,191,107,.12); }
.btn-sm { height: 38px; padding: 0 18px; font-size: 14px; text-decoration: none; }

.adm-head { display: flex; flex-wrap: wrap; gap: 32px 56px; justify-content: space-between; align-items: flex-end; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px; flex: 0 1 560px; }
.kpi { padding: 18px 20px; border-radius: 20px; background: #F8F8F9; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi b { font-size: 26px; font-weight: 300; letter-spacing: -.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi span { font-size: 12px; color: #AEAEB2; }

.adm-section { margin-top: 64px; }
.scroll { overflow-x: auto; }
.people { width: 100%; border-collapse: collapse; font-size: 15px; }
.people th { font-size: 12px; font-weight: 400; color: var(--muted); text-align: left; padding: 0 12px 12px; white-space: nowrap; }
.people td { padding: 14px 12px; border-top: 1px solid #F0F0F2; white-space: nowrap; }
.people th:first-child, .people td:first-child { padding-left: 0; }
.people .num { text-align: right; font-variant-numeric: tabular-nums; }
.people b { font-weight: 600; }
.people .dim { color: var(--faint); }
.th-ico { width: 16px; height: 16px; color: var(--mid-ink); vertical-align: -3px; margin-right: 6px; }
.empty { color: var(--faint); font-weight: 300; }

/* Equipa */
.team { display: grid; gap: 10px; }
.member {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid #F0F0F2; border-radius: 20px;
}
.member.off { opacity: .55; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-ink); font-weight: 500; }
.member-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.member-main b { font-weight: 500; }
.member-main span { font-size: 13px; color: var(--muted); }
.member-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.member-pass { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.member-pass[hidden] { display: none; }
.member-pass .inp { flex: 1; height: 44px; }

.card { padding: 28px; border: 1px solid #F0F0F2; border-radius: 28px; }
.card .kw-title { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.inp-btn { position: absolute; right: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: #F4F4F6; font-size: 13px; color: var(--ink-2); }
.inp-btn:hover { background: #ECECEF; }
.inp:has(.inp-btn) input { padding-right: 80px; }
.form-msg { min-height: 20px; margin: 4px 0 14px; font-size: 14px; }
.form-msg.ok { color: var(--accent-ink); }
.form-msg.err { color: #D0605E; }
.info-line { font-size: 15px; color: var(--ink-2); line-height: 1.6; margin-bottom: 18px; }
.info-line code { font-size: 13px; background: #F4F4F6; padding: 1px 6px; border-radius: 6px; }

@media (max-width: 700px) {
  .adm-top { grid-template-columns: 1fr auto; padding: 14px 16px; }
  .adm-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .adm-top .logo .hello { display: inline; }
  .adm-body { width: calc(100% - 32px); padding-top: 22px; }
  .filters { margin-bottom: 32px; }
  .filters-right { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filters-right .btn { grid-column: 1 / -1; }
  .kpis { grid-template-columns: 1fr; flex-basis: 100%; }
  .th-txt { display: none; }
  .th-ico { margin-right: 0; }
  .member { grid-template-columns: 40px 1fr; }
  .member-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
}
.adm-pane > .adm-section:first-child { margin-top: 8px; }
.sum-grid.top { align-items: start; }
