:root {
  --sky: #18b0fd;
  --sky-dark: #0a90d8;
  --sky-soft: #e6f6ff;
  --blurple: #616ef4;
  --blurple-dark: #5865f2;
  --page: #fbfbfb;
  --card: #ffffff;
  --line: #ececf0;
  --line-2: #dcdce3;
  --text: #16181d;
  --muted: #5f6470;
  --dim: #9297a3;
  --ok: #16a34a;
  --ok-soft: #e8f8ee;
  --warn: #c2410c;
  --warn-soft: #fff1e7;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ================= LOGIN (Figma: Slide 16:9 - 1) ================= */
.login {
  /* 1 unidade = 1px do Figma (1920x1080) */
  --u: clamp(0.62px, min(0.0926vh, 0.0521vw), 1.15px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: url('/assets/bg.png') center / cover no-repeat, #1db4fd;
}
.login-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--u) * 40) 16px 0;
}
.login-logo {
  width: calc(var(--u) * 440);
  height: calc(var(--u) * 440);
  object-fit: contain;
  margin-bottom: calc(var(--u) * -38);
}
.discord-login {
  display: flex;
  width: calc(var(--u) * 368);
  height: calc(var(--u) * 112);
  border-radius: calc(var(--u) * 16);
  overflow: hidden;
  background: var(--blurple);
  box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 13) rgba(0, 0, 0, 0.25);
  transition: transform 0.12s, filter 0.12s;
}
.discord-login:hover { filter: brightness(1.06); }
.discord-login:active { transform: scale(0.98); }
.discord-login.disabled { pointer-events: none; filter: grayscale(0.5) opacity(0.7); }
.discord-login-text {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: calc(var(--u) * 41);
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--u) * 36);
  line-height: 1.07;
}
.discord-login-icon {
  width: calc(var(--u) * 122);
  display: grid;
  place-items: center;
  background: var(--blurple-dark);
}
.discord-login-icon img { width: calc(var(--u) * 84); height: calc(var(--u) * 84); }
.captcha { margin-top: calc(var(--u) * 30); min-height: 78px; }
.login-error {
  margin: 16px 0 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}
.login-footer {
  text-align: center;
  padding: 16px 16px calc(var(--u) * 18);
  font-weight: 600;
  font-size: max(12px, calc(var(--u) * 16));
  color: #000;
}
.login-footer p { margin: 0; }
.login-footer .credit { opacity: 0.58; }
.denied-box {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.15);
}
.denied-box strong { font-size: 20px; }
.denied-box p { color: var(--muted); margin: 6px 0 16px; }

/* ================= PAINEL (Figma: Slide 16:9 - 2) ================= */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: url('/assets/bg.png') left top / auto 140% no-repeat, #1db4fd;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #fff;
  z-index: 10;
}
.sidebar-top { padding: 18px 16px; overflow-y: auto; }
.side-logo { display: block; width: 120px; margin: 0 auto 14px; }
.side-logo img { width: 100%; }

.server-switch { position: relative; margin-bottom: 18px; }
.server-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.server-btn:hover { background: rgba(255, 255, 255, 0.28); }
.server-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.server-name small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; }
.server-name strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { transition: transform 0.15s; flex: none; }
.server-btn[aria-expanded='true'] .chev { transform: rotate(180deg); }
.server-icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: #fff; color: var(--sky-dark); font-weight: 800; font-size: 13px;
}
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: #fff; color: var(--text); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.server-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left;
}
.server-opt:hover { background: #f3f4f6; }
.server-opt.active { background: var(--sky-soft); }
.server-opt .server-icon { background: var(--sky); color: #fff; }
.server-opt span:not(.server-icon) { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.server-opt small { color: var(--dim); font-size: 12px; }

.sidenav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  font-weight: 700; color: rgba(255, 255, 255, 0.92);
}
.nav-item svg { flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.16); }
.nav-item.active { background: #fff; color: var(--sky-dark); }
.nav-item .badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: #fff; color: var(--sky-dark); font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.nav-item.active .badge { background: var(--sky); color: #fff; }

.side-user { display: flex; align-items: center; gap: 12px; padding: 16px; }
.side-user img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.side-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; }
.side-user-meta strong { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta small { font-size: 15px; }
.logout {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.18); color: #fff;
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.logout:hover { background: rgba(255, 255, 255, 0.3); }

.view { min-width: 0; padding: 32px 36px 48px; max-width: 1320px; }

/* ---------- títulos ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }

.card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.card .sub { color: var(--muted); margin: 2px 0 16px; font-size: 14px; }
.card-head .sub { margin: 2px 0 0; }

/* ---------- números ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-card); }
.stat small { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { display: block; font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.stat.hl strong { color: var(--sky-dark); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--sky); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sky-dark); }
.btn-light { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn-light:hover { background: #f5f5f7; }
.btn-danger { background: #fff; border-color: #f3c4c4; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(24, 176, 253, 0.18); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.search { position: relative; }
.search .input { padding-left: 40px; height: 46px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.hint { color: var(--dim); font-size: 13px; }

/* ---------- membros ---------- */
.results { display: flex; flex-direction: column; margin-top: 8px; max-height: 340px; overflow: auto; }
.member {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; cursor: pointer; text-align: left;
}
.member:hover { background: #f4f5f7; }
.member img { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: #f2f3f5; color: var(--muted); white-space: nowrap;
}
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.role::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rc, var(--dim)); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.picked {
  display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 16px;
  border-radius: var(--radius-sm); background: var(--sky-soft); border: 1px solid #c4e9fd;
}
.picked img { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.picked .who strong { font-size: 16px; }

/* ---------- cargos ---------- */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; padding: 11px 12px; border-radius: var(--radius-sm);
  background: #fff; border: 1.5px solid var(--line-2); cursor: pointer; text-align: left;
}
.choice:hover { border-color: #b9bcc6; }
.choice strong { font-size: 15px; }
.choice small { color: var(--dim); font-size: 12px; }
.choice.on { border-color: var(--sky); background: var(--sky-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line-2);
  cursor: pointer; font-weight: 700; font-size: 14px;
}
.chip.on { border-color: var(--blurple); background: #eef0fe; color: var(--blurple-dark); }
.summary { background: #f7f8fa; border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }

/* ---------- listas ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:first-child { padding-top: 0; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item > img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.item .who p { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: normal; }
.item .actions { display: flex; gap: 6px; flex: none; align-items: center; }
.countdown { font-weight: 800; font-size: 13px; color: var(--sky-dark); white-space: nowrap; }
.empty { text-align: center; padding: 22px 12px; color: var(--dim); font-size: 14px; }

.soon { text-align: center; padding: 70px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.soon h2 { margin: 0 0 6px; font-size: 22px; }
.soon p { margin: 0; color: var(--muted); }

/* prévia da mensagem no Discord */
.embed-preview { display: flex; gap: 12px; padding: 14px; background: #313338; border-radius: 10px; color: #dbdee1; font-family: 'gg sans', 'Nunito Sans', sans-serif; }
.embed-preview .bar { width: 4px; border-radius: 4px; background: #8b5cf6; flex: none; }
.embed-preview strong { color: #fff; }
.embed-preview p { margin: 6px 0 10px; font-size: 14px; }
.embed-preview img { width: 100%; max-width: 400px; border-radius: 6px; }
.discord-btn { margin-top: 10px; display: inline-flex; padding: 7px 16px; border-radius: 6px; background: #248046; color: #fff; font-size: 14px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast {
  max-width: 380px; padding: 12px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--ok); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); font-size: 14px; font-weight: 600;
}
.toast.err { border-left-color: var(--danger); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, 0.15); border-top-color: currentColor; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsivo ---------- */
@media (max-width: 1150px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; height: auto; background-size: cover; }
  .sidebar-top { display: flex; align-items: center; gap: 10px; padding: 10px 112px 10px 16px; overflow: visible; }
  .side-logo { width: 50px; margin: 0; flex: none; }
  .server-switch { margin: 0; flex: 1; min-width: 0; }
  .side-user { position: absolute; top: 50%; transform: translateY(-50%); right: 16px; padding: 0; }
  .side-user img { width: 38px; height: 38px; }
  .side-user-meta { display: none; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .stats { gap: 10px; }
  .stat strong { font-size: 26px; }
  .row { flex-direction: column; gap: 0; }
  .item { flex-wrap: wrap; }
  .item .actions { width: 100%; }
  .item .actions .btn { flex: 1; }
}

/* ================= ANIMAÇÕES ================= */
:root {
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* efeito de clique (ripple) — criado pelo app.js */
.btn, .choice, .chip, .discord-login, .server-btn, .nav-item, .member { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: 0.25; transform: scale(0);
  animation: ripple 0.6s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* botões */
.btn { transition: transform 0.25s var(--spring), box-shadow 0.25s var(--ease), background 0.15s, border-color 0.15s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(16, 24, 40, 0.25); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.95); transition-duration: 0.08s; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px -6px rgba(24, 176, 253, 0.6); }
.btn-danger:hover:not(:disabled) { box-shadow: 0 6px 16px -6px rgba(220, 38, 38, 0.35); }
.btn-primary::after, .discord-login::after {
  content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover:not(:disabled)::after, .discord-login:hover::after { animation: shine 0.75s var(--ease); }
@keyframes shine { to { left: 130%; } }

/* login */
.login-logo { animation: pop-in 0.7s var(--spring) both, float 3.5s ease-in-out 0.7s infinite; }
.discord-login { animation: pop-in 0.6s var(--spring) 0.15s both; transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease), filter 0.15s; }
.discord-login:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 calc(var(--u) * 14) calc(var(--u) * 30) rgba(40, 50, 160, 0.35); }
.discord-login:active { transform: scale(0.97); transition-duration: 0.08s; }
.discord-login-icon img { transition: transform 0.3s var(--spring); }
.discord-login:hover .discord-login-icon img { animation: wiggle 0.6s ease-in-out; }
.login-footer { animation: fade-in 0.8s ease 0.4s both; }
.denied-box { animation: pop-in 0.5s var(--spring) both; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
@keyframes wiggle { 20% { transform: rotate(-12deg) scale(1.1); } 40% { transform: rotate(10deg) scale(1.1); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85) translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }

/* barra lateral */
.side-logo img { transition: transform 0.35s var(--spring); }
.side-logo:hover img { transform: scale(1.08) rotate(-4deg); }
.nav-item { transition: background 0.2s, color 0.2s, transform 0.25s var(--spring), box-shadow 0.2s; }
.nav-item:hover:not(.active) { transform: translateX(5px); }
.nav-item svg { transition: transform 0.3s var(--spring); }
.nav-item:hover svg { transform: scale(1.18) rotate(-6deg); }
.nav-item.active { box-shadow: 0 6px 16px -8px rgba(0, 60, 110, 0.45); }
.nav-item.active svg { animation: bounce 0.5s var(--spring); }
.badge { animation: pop-in 0.4s var(--spring) both; }
.nav-item:not(.active) .badge { animation: pop-in 0.4s var(--spring) both, pulse 2s ease-in-out 0.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }
@keyframes bounce { 40% { transform: scale(1.25); } }
.server-btn { transition: background 0.2s, transform 0.25s var(--spring); }
.server-btn:active { transform: scale(0.97); }
.server-menu:not(.hidden) { animation: drop 0.22s var(--ease); transform-origin: top center; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.server-opt { transition: background 0.15s, transform 0.2s var(--spring); }
.server-opt:hover { transform: translateX(3px); }
.logout { transition: background 0.2s, transform 0.3s var(--spring); }
.logout:hover { transform: translateX(3px); }
.side-user img { transition: transform 0.3s var(--spring); }
.side-user img:hover { transform: scale(1.08); }

/* conteúdo entrando ao trocar de aba */
.view > * { animation: rise 0.45s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: 0.06s; }
.view > *:nth-child(3) { animation-delay: 0.12s; }
.stats .stat { animation: rise 0.45s var(--ease) both; }
.stats .stat:nth-child(2) { animation-delay: 0.05s; }
.stats .stat:nth-child(3) { animation-delay: 0.1s; }
.stats .stat:nth-child(4) { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.stat, .card { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -12px rgba(16, 24, 40, 0.2); }

/* escolhas */
.choice { transition: border-color 0.15s, background 0.15s, transform 0.25s var(--spring), box-shadow 0.2s; }
.choice:hover { transform: translateY(-3px); box-shadow: 0 8px 18px -10px rgba(16, 24, 40, 0.3); }
.choice:active { transform: scale(0.96); }
.choice.on { animation: select 0.35s var(--spring); }
.chip { transition: border-color 0.15s, background 0.15s, transform 0.25s var(--spring); }
.chip:hover { transform: translateY(-2px); }
.chip:active { transform: scale(0.94); }
.chip.on { animation: select 0.35s var(--spring); }
@keyframes select { 0% { transform: scale(0.94); } 60% { transform: scale(1.04); } }
.member { transition: background 0.15s, transform 0.2s var(--spring); }
.member:hover { transform: translateX(4px); }
.results .member { animation: rise 0.3s var(--ease) both; }
.picked.enter { animation: pop-in 0.4s var(--spring) both; }
.summary .tag { animation: pop-in 0.3s var(--spring) both; }
.input, .select, .textarea { transition: border-color 0.15s, box-shadow 0.2s; }

/* avisos */
.toast { animation: toast-in 0.4s var(--spring) both; }
.toast.out { animation: toast-out 0.3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(0.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= CELULAR: topo azul fino + barra de abas azul ================= */
/* fica no fim do arquivo para vencer as regras de animação do desktop */
@media (max-width: 860px) {
  .sidebar {
    position: sticky; top: 0; height: auto; box-shadow: 0 2px 10px rgba(0, 60, 110, 0.25);
    background: linear-gradient(90deg, #12a9f8, #2cc4fd);
  }
  .sidebar-top { display: flex; align-items: center; gap: 10px; padding: 8px 16px; overflow: visible; }
  .side-logo { width: 42px; margin: 0; flex: none; }
  .server-switch { margin: 0; flex: 1; min-width: 0; max-width: 300px; }
  .server-btn { padding: 5px 10px 5px 5px; }
  .server-btn .server-icon { width: 30px; height: 30px; font-size: 12px; }
  .server-name small { display: none; }

  /* barra de abas embaixo, azul igual à sidebar */
  .sidenav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
    padding: 7px 72px calc(7px + env(safe-area-inset-bottom)) 8px;
    background: linear-gradient(90deg, #12a9f8, #2cc4fd);
    box-shadow: 0 -4px 16px rgba(0, 60, 110, 0.25);
  }
  .nav-item {
    flex-direction: column; gap: 3px; padding: 7px 2px 6px; border-radius: 14px;
    color: rgba(255, 255, 255, 0.85); font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.1;
  }
  .nav-item:hover:not(.active) { transform: none; background: none; }
  .nav-item:hover svg { transform: none; }
  .nav-item.active { background: #fff; color: var(--sky-dark); box-shadow: 0 4px 12px rgba(0, 60, 110, 0.25); }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item .badge,
  .nav-item.active .badge {
    position: absolute; top: 2px; left: calc(50% + 6px); margin: 0;
    min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; background: #ef4444; color: #fff;
    box-shadow: 0 0 0 2px #1db4fd;
  }
  .nav-item.active .badge { box-shadow: 0 0 0 2px #fff; }
  .nav-item:not(.active) .badge { animation: pop-in 0.4s var(--spring) both; }

  /* avatar no canto da barra; toque abre o cartão com nome, cargo e sair */
  .side-user {
    position: fixed; top: auto; transform: none; right: 8px; bottom: calc(7px + env(safe-area-inset-bottom)); z-index: 41;
    width: 58px; height: 52px; padding: 0; display: grid; place-items: center; cursor: pointer;
  }
  .side-user img { width: 40px; height: 40px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 60, 110, 0.3); }
  .side-user img:hover { transform: none; }
  .side-user-meta, .side-user .logout { display: none; }
  .side-user.open .side-user-meta,
  .side-user.open .logout { display: flex; }
  .side-user.open::before {
    content: ''; position: absolute; right: 0; bottom: 60px; width: 230px; height: 64px;
    background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    animation: drop 0.2s var(--ease);
  }
  .side-user.open .side-user-meta {
    position: absolute; right: 64px; bottom: 72px; width: 152px; color: var(--text); z-index: 1;
  }
  .side-user.open .side-user-meta strong { font-size: 15px; font-weight: 800; }
  .side-user.open .side-user-meta small { font-size: 13px; color: var(--muted); }
  .side-user.open .logout {
    position: absolute; right: 12px; bottom: 74px; z-index: 1; width: 40px; height: 40px;
    background: var(--danger-soft); color: var(--danger); display: grid;
  }

  .view { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .toasts { left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .server-menu { min-width: 0; }
  .btn, .input, .select, .chip { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  /* 16px evita o zoom automático do iPhone ao tocar no campo */
  .input, .select, .textarea { font-size: 16px; }
}
