/* Encantadas Team — v2
   Paleta de marca (lila, rosa, celeste, marfil, malva) + acentos con contraste AA para texto y acciones. */
:root {
  --ivory: #f6f5fb;
  --surface: #ffffff;
  --lila: #e6e5fb;
  --lila-2: #f2f1fd;
  --rosa: #ffe1f1;
  --rosa-2: #fff1f8;
  --celeste: #ddefff;
  --celeste-2: #eff7ff;
  --mauve: #7c7a93;
  --primary: #5753c9;
  --primary-ink: #403ca8;
  --berry: #c0307f;
  --teal: #1d6f8a;
  --amber: #fff1c2;
  --amber-ink: #7a4b00;
  --ink: #23212f;
  --ink-2: #55536a;
  --line: #e3e1ee;
  --shadow: 0 1px 2px rgba(35, 33, 47, 0.06), 0 4px 14px -8px rgba(35, 33, 47, 0.14);
  --r: 12px;
  --tint: var(--lila);
  --font-title: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
body[data-tab='calendario'] { --tint: var(--celeste); }
body[data-tab='encuestas'] { --tint: var(--rosa); }
body[data-tab='posteos'] { --tint: #fff4d1; }
body[data-tab='asignacion'] { --tint: #e9e6f8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-title); font-weight: 700; color: var(--ink); letter-spacing: -0.012em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 700; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack.sm { gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
p, h1, h2, h3, .card { overflow-wrap: anywhere; }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(246, 245, 251, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 700; letter-spacing: -0.01em; font-size: 18px; color: var(--primary-ink); min-width: 0; white-space: nowrap; }
.logo { width: 38px; height: 38px; display: grid; place-items: center; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); min-width: 0; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.nav button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 6px 1px; border: 0; background: none; border-radius: 10px;
  font-size: 11px; white-space: nowrap; font-weight: 600; color: var(--ink-2);
}
.nav button[aria-current='page'] { color: var(--primary-ink); background: var(--lila-2); }
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--berry); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.hero { margin: 0 -16px 18px; padding: 20px 16px 18px; background: var(--tint); border-bottom: 1px solid var(--line); }
.hero p { margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.tinted { background: var(--lila-2); box-shadow: none; }
.card.attn { background: var(--rosa-2); border-color: #efcfdd; box-shadow: none; }
.card.unread { border-color: #c9c7f0; box-shadow: 0 0 0 3px var(--lila-2), var(--shadow); }
.card.pin { background: #fffbea; border-color: #f0e2a8; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; background: var(--primary); color: #fff;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:hover { background: var(--primary-ink); }
.btn:active { transform: translateY(1px); }
.btn.soft { background: var(--lila); color: var(--primary-ink); }
.btn.soft:hover { background: #d4d2f6; }
.btn.line { background: #fff; color: var(--primary-ink); border-color: #c9c7f0; }
.btn.ok { background: var(--teal); }
.btn.danger { background: #fff; color: var(--berry); border-color: #e7b7cd; }
.btn.ghost { background: transparent; color: var(--primary-ink); }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--lila-2); color: var(--primary-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--lila); color: var(--primary-ink); white-space: nowrap; }
.chip.sin, .chip.rechazo, .chip.no, .chip.encuesta, .chip.declined { background: var(--rosa); color: #8f2a58; }
.chip.falta, .chip.pend, .chip.pending { background: var(--amber); color: var(--amber-ink); }
.chip.ok, .chip.si, .chip.confirmed, .chip.evento { background: var(--celeste); color: #145a73; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mauve); flex: none; }
.dot.sin, .dot.rechazo { background: var(--berry); }
.dot.falta, .dot.pend { background: #d79a1a; }
.dot.ok { background: var(--teal); }
.avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; object-fit: cover; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--primary-ink); background: var(--lila); flex: none; }
.avatar.c1 { background: var(--rosa); color: #8f2a58; }
.avatar.c2 { background: var(--celeste); color: #145a73; }
.avatar.c3 { background: var(--amber); color: var(--amber-ink); }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.team { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--lila-2); font-size: 13.5px; font-weight: 600; }
.person.confirmed { background: var(--celeste-2); }
.person.declined { background: var(--rosa-2); text-decoration: line-through; text-decoration-color: var(--berry); }
.person .st { font-size: 12px; font-weight: 700; }
.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); }
.empty .logo { margin: 0 auto 10px; width: 56px; height: 56px; opacity: 0.9; }
.meter { height: 8px; border-radius: 6px; background: var(--lila); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width 0.25s ease; }
.meter.full > i { background: var(--teal); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--lila-2); border: 1px solid var(--line); max-width: 100%; }
.seg button { min-height: 38px; padding: 4px 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] { background: #fff; color: var(--primary-ink); box-shadow: 0 1px 3px rgba(35, 33, 47, 0.18); }
.seg .yes[aria-pressed='true'] { background: var(--celeste); color: #145a73; }
.seg .nop[aria-pressed='true'] { background: var(--rosa); color: #8f2a58; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.pill[aria-pressed='true'] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Formularios ---------- */
label.f { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); }
label.f > span { display: block; margin-bottom: 6px; }
input[type='text'], input[type='password'], input[type='date'], input[type='time'], input[type='number'], input[type='tel'], textarea, select {
  width: 100%; min-height: 46px; padding: 10px 14px; font-size: 16px;
  border: 1.5px solid #d5d3e6; border-radius: 12px; background: #fff; color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(87, 83, 201, 0.2); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.err { color: #a32a62; font-weight: 600; font-size: 14px; }
.err:empty { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { text-transform: capitalize; text-align: center; flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--mauve); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.cal .day {
  position: relative; aspect-ratio: 1 / 1; min-height: 44px; border-radius: 12px; border: 1px solid transparent; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 5px 2px 2px; font-weight: 600; font-size: 14px;
}
.cal .day.out { background: transparent; color: #b7aac6; }
.cal .day.today { border-color: var(--primary); }
.cal .day.sel { background: var(--primary); color: #fff; }
.cal .day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.cal .day.sel .dot { box-shadow: 0 0 0 1.5px #fff; }
.ev-time { font-weight: 800; color: var(--primary-ink); font-size: 15px; white-space: nowrap; }
.ev { display: flex; flex-direction: column; gap: 10px; }
.ev h3 { font-size: 17px; }
.datehead { margin: 18px 0 8px; font-weight: 800; color: var(--primary-ink); font-size: 15px; }
.datehead::first-letter { text-transform: uppercase; }
.datehead.today::after { content: 'Hoy'; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--rosa); color: #8f2a58; font-size: 12px; text-transform: none; }

/* ---------- Avisos ---------- */
.notice h3 { font-size: 17px; }
.notice .body { white-space: pre-wrap; margin-top: 6px; }
.notice-actions { display: flex; gap: 4px; margin: 8px -8px -8px; flex-wrap: wrap; align-items: center; }
.udot { width: 10px; height: 10px; border-radius: 50%; background: var(--berry); flex: none; }

.poll-row { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); cursor: pointer; transition: border-color 0.15s ease, transform 0.12s ease; }
.poll-row:hover { border-color: #aeacec; }
.ans-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.ans-row:first-child { border-top: 0; }
.ans-row .seg { flex: none; }
.res { display: grid; gap: 8px; }
.res b { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--lila-2); align-self: flex-start; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--primary-ink); }
.msg.mine .who { color: #e8ddf7; }
.msg .t { font-size: 11.5px; opacity: 0.75; margin-top: 2px; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.composer textarea { min-height: 46px; height: 46px; resize: none; }

/* ---------- Asignación ---------- */
.pick { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; width: 100%; text-align: left; }
.pick.on { border-color: #aeacec; background: var(--lila-2); }
.pick[disabled] { opacity: 0.55; cursor: not-allowed; }
.pick .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #c5b3df; display: grid; place-items: center; flex: none; color: #fff; }
.pick.on .box { background: var(--primary); border-color: var(--primary); }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 12px; background: var(--amber); color: var(--amber-ink); font-size: 13.5px; font-weight: 600; }

/* ---------- Modal y avisos ---------- */
body.modal-open { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(35, 33, 47, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.18s ease; }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; background: var(--ivory); border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: rise 0.22s ease; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.sheet h2 { margin-bottom: 14px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sheet .actions .btn { flex: 1; min-width: 120px; }
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 70; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #8f2a58; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 28px 18px; background: radial-gradient(700px 360px at 10% -10%, var(--lila), transparent 60%), radial-gradient(600px 320px at 100% 0%, var(--rosa), transparent 60%), radial-gradient(700px 360px at 50% 115%, var(--celeste), transparent 60%), var(--ivory); }
.auth .panel { width: 100%; max-width: 420px; }
.auth .logo { width: 96px; height: 96px; margin: 0 auto 8px; }
.auth h1 { text-align: center; }
.auth .lead { text-align: center; margin: 6px 0 22px; color: var(--ink-2); }
.who-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; font-weight: 700; box-shadow: var(--shadow); }
.who:hover { border-color: #aeacec; }
.who .avatar { width: 48px; height: 48px; font-size: 19px; }
.pin-input { text-align: center; letter-spacing: 0.5em; font-size: 24px !important; font-weight: 700; }
.pin-sheet { display: grid; gap: 8px; }
.pin-sheet .row { padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px dashed #c9c7f0; justify-content: space-between; }
.pin-sheet code { font-size: 22px; font-weight: 800; letter-spacing: 0.2em; color: var(--primary-ink); }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--primary); }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--lila); border-top-color: var(--primary); animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 12px 28px; }
  .nav {
    position: sticky; top: 70px; align-self: start; grid-row: 2; display: flex; flex-direction: column; gap: 4px;
    height: calc(100vh - 70px); padding: 20px 14px; background: transparent; backdrop-filter: none; border-top: 0; border-right: 1px solid var(--line);
  }
  .nav button { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 10px 14px; font-size: 15px; }
  .badge { position: static; margin-left: auto; }
  .main { max-width: 1040px; padding: 0 32px 48px; }
  .hero { margin: 0 -32px 22px; padding: 26px 32px 22px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .cols .sticky { position: sticky; top: 96px; }
  #toast { bottom: 28px; }
  .overlay { align-items: center; }
  .sheet { border-radius: 24px; }
  .who-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .auth .panel { max-width: 560px; }
}
@media (max-width: 380px) {
  h1 { font-size: 27px; }
  .grid2 { grid-template-columns: 1fr; }
  .cal .day { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- v2.1: posteos, personajes, perfil, recordatorios ---------- */
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--lila); color: var(--primary-ink); letter-spacing: 0.01em; }
.tag.t1 { background: var(--rosa); color: #8f2a58; }
.tag.t2 { background: var(--celeste); color: #145a73; }
.tag.t3 { background: var(--amber); color: var(--amber-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chk-grid .check { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ava-btn { padding: 4px; border-radius: 50%; border: 3px solid transparent; background: none; aspect-ratio: 1; }
.ava-btn .avatar { width: 100%; height: 100%; }
.ava-btn[aria-pressed='true'] { border-color: var(--primary); }
.ava-btn.none .avatar { font-size: 22px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.post { display: flex; flex-direction: column; gap: 10px; }
.post .post-img { width: 100%; max-height: 440px; object-fit: contain; border-radius: 10px; background: var(--lila-2); border: 1px solid var(--line); display: block; }
.post h3 { font-size: 17px; }
.post .txt { white-space: pre-wrap; }
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid #f0e2a8; background: #fffbea; }
.banner.hot { background: var(--rosa-2); border-color: #f2cadf; }
.banner b { display: block; }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-pick input[type='file'] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.img-prev { max-width: 100%; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.hint { font-size: 13.5px; color: var(--ink-2); }
select.compact { width: auto; min-height: 36px; padding: 4px 42px 4px 12px; font-size: 14px; font-weight: 600; border-radius: 999px; appearance: none; -webkit-appearance: none; 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='%235753c9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 400px) {
  .topbar .btn.soft span:last-child { display: none; }
  .topbar .btn.soft { padding: 6px; min-width: 44px; }
  .nav button { font-size: 10.5px; }
}
.msg .who { display: block; flex-direction: row; align-items: flex-start; padding: 0; border: 0; background: none; box-shadow: none; gap: 0; font-weight: 800; }
/* Tipo de evento: botones con aria-pressed */
.btn-evtype { background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.evtype-seg .btn-evtype[aria-pressed="true"],
.btn-evtype[aria-pressed="true"] { color: #fff !important; }
.evtype-seg .btn-evtype:nth-child(1)[aria-pressed="true"] { background: var(--primary); }
.evtype-seg .btn-evtype:nth-child(2)[aria-pressed="true"] { background: var(--teal); }
.evtype-seg .btn-evtype:nth-child(3)[aria-pressed="true"] { background: var(--berry); }

/* ========================================================
   EQUIPO — Modal rediseñado (team v3)
   ======================================================== */

/* Contenedor principal del modal de equipo */
.team-modal {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Encabezado: título + estadísticas */
.team-modal__header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.team-modal__header h2 {
  margin-bottom: 4px;
}
.team-modal__stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.team-stat {
  font-size: 13px;
  color: var(--ink-2);
}
.team-stat b {
  color: var(--ink);
}
.team-stat-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mauve);
  flex: none;
  opacity: 0.5;
}

/* Barra de búsqueda + filtros */
.team-modal__search {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.team-search-wrap {
  position: relative;
}
.team-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mauve);
  pointer-events: none;
  width: 17px;
  height: 17px;
}
.team-search-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px 8px 38px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--ivory);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.team-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(87, 83, 201, 0.15);
}
.team-search-input::placeholder { color: var(--mauve); }

/* Filtros de rol */
.team-filter-tabs {
  display: flex;
  gap: 6px;
}
.team-filter-btn {
  flex: 1;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.13s, border-color 0.13s, color 0.13s;
  cursor: pointer;
}
.team-filter-btn:hover {
  border-color: #c5c3ec;
  color: var(--primary-ink);
}
.team-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Lista de integrantes */
.team-modal__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

/* Tarjeta de integrante */
.team-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 64px;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.team-card:hover {
  border-color: #c9c7f0;
  box-shadow: 0 1px 6px rgba(87, 83, 201, 0.07);
}
.team-card--menu-open {
  border-color: #c9c7f0;
  box-shadow: 0 2px 10px rgba(87, 83, 201, 0.1);
  z-index: 10;
}

/* Cuerpo de la tarjeta: avatar + info */
.team-card__body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Avatar dentro de la tarjeta */
.team-card__avatar .avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
  flex: none;
}
.team-card__avatar .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info: nombre + rol */
.team-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.team-card__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.team-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.team-card__role {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-card__role--me {
  color: var(--primary-ink);
  font-weight: 600;
}

/* Insignia de admin */
.team-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.team-badge--admin {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--lila);
  color: var(--primary-ink);
}
.team-badge--admin .i {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

/* Chip "Vos" */
.team-me-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--lila);
  color: var(--primary-ink);
  white-space: nowrap;
  flex: none;
  margin-left: 8px;
}

/* Zona de acciones (botón 3 puntos + menú desplegable) */
.team-card__actions {
  position: relative;
  flex: none;
  margin-left: 8px;
}

/* Botón de tres puntos */
.team-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--mauve);
  transition: background 0.13s, color 0.13s;
}
.team-menu-btn:hover,
.team-card--menu-open .team-menu-btn {
  background: var(--lila-2);
  color: var(--primary-ink);
}
.team-menu-dots {
  display: flex;
  flex-direction: column;
  gap: 3.5px;
  align-items: center;
}
.team-menu-dots span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Menú contextual desplegable */
.team-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(35, 33, 47, 0.14), 0 1px 4px rgba(35, 33, 47, 0.06);
  min-width: 190px;
  overflow: hidden;
  animation: menuPop 0.14s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}
@keyframes menuPop {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.team-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.team-menu__item:hover {
  background: var(--lila-2);
  color: var(--primary-ink);
}
.team-menu__item .i {
  width: 17px;
  height: 17px;
  color: var(--mauve);
  flex: none;
}
.team-menu__item:hover .i { color: var(--primary-ink); }

/* Acción destructiva: Quitar del equipo */
.team-menu__item--danger {
  color: var(--berry);
}
.team-menu__item--danger:hover {
  background: var(--rosa-2);
  color: var(--berry);
}
.team-menu__item--danger .i {
  color: var(--berry);
}
.team-menu__item--danger:hover .i { color: var(--berry); }

.team-menu__divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

/* Estado vacío */
.team-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
}

/* Formulario de agregar persona */
.team-add-form {
  background: var(--lila-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-add-form__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.team-add-form__title .i {
  width: 17px;
  height: 17px;
}
.team-add-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 420px) {
  .team-add-form__fields {
    grid-template-columns: 1fr;
  }
}

/* Ajuste del sheet para el modal de equipo: más espacio útil */
.sheet .team-modal {
  padding-bottom: 4px;
}

/* Cierre del menú contextual al hacer clic fuera (via overlay) */
/* El overlay maneja esto mediante el listener de click existente */

@media (min-width: 600px) {
  .team-card__avatar .avatar {
    width: 44px;
    height: 44px;
  }
  .team-card__name {
    font-size: 15px;
  }
  .team-filter-tabs {
    gap: 8px;
  }
}
