/* Pulso Actas — tokens de marca Pulso (ver pulso-web/design-spec.md) */
:root {
  --green: #123A27;
  --green-hover: #0D2C1D;
  --gold: #F4B223;
  --gold-light: #FAD772;
  --gold-wash: #FDF0CC;
  --cream: #FEF6E7;
  --surface: #FFFBF2;
  --bg: #F7ECD5;        /* fondo de la app: crema más profundo para separar las tarjetas */
  --card: #FFFFFF;
  --card-line: rgb(18 58 39 / .16);
  --shadow-card: 0 1px 2px rgb(18 58 39 / .06), 0 6px 18px -10px rgb(18 58 39 / .18);
  --white: #FFFFFF;

  --ink: #123A27;
  --ink-soft: #3E5A4B;
  --ink-mute: #6B7F72;
  --line: rgb(18 58 39 / .12);
  --line-strong: rgb(18 58 39 / .22);
  --red: #A3361A;
  --red-wash: #FBEDE7;

  --font-ui: "Montserrat", system-ui, sans-serif;
  --font-mark: "Comfortaa", "Montserrat", sans-serif;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --shadow-pop: 0 18px 50px -12px rgb(18 58 39 / .28), 0 2px 6px rgb(18 58 39 / .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--ink);
  font: 500 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
svg:not(.iso) { width: 1em; height: 1em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Isotipo ---------- */
.iso { display: block; overflow: visible; }
.iso path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.iso-anim path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s var(--ease-out) forwards; }
.iso-anim .iso-dot { transform-box: view-box; transform-origin: 27.6px 81px; transform: scale(0); animation: pop .4s var(--ease-out) forwards; }
.iso-anim [data-ring="0"] { animation-delay: .25s; }
.iso-anim [data-ring="1"] { animation-delay: .3s; }
.iso-anim [data-ring="2"] { animation-delay: .45s; }
.iso-anim [data-ring="3"] { animation-delay: .6s; }
.iso-anim [data-ring="4"] { animation-delay: .75s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }
.iso-beat .iso-arc { stroke-dasharray: none; animation: beat 3.2s ease-in-out 1.8s infinite; }
.iso-anim.iso-beat .iso-arc { stroke-dasharray: 1; animation: draw .7s var(--ease-out) forwards, beat 3.2s ease-in-out 1.8s infinite; }
.iso-anim.iso-beat [data-ring="1"].iso-arc { animation-delay: .3s, 1.8s; }
.iso-anim.iso-beat [data-ring="2"].iso-arc { animation-delay: .45s, 1.92s; }
.iso-anim.iso-beat [data-ring="3"].iso-arc { animation-delay: .6s, 2.04s; }
@keyframes beat { 0%, 30%, 100% { opacity: 1; } 12% { opacity: .55; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 8px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--white); color: var(--ink);
  font-weight: 600; font-size: .875rem; letter-spacing: .01em; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { border-color: var(--green); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--cream); }
.btn-primary:hover { background: var(--green-hover); box-shadow: 0 0 0 4px var(--gold-light); }
.btn-primary .arrow { transition: transform .2s var(--ease-out); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--green); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgb(18 58 39 / .06); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-wash); }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: .9375rem; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: .8125rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-soft); flex: none;
}
.icon-btn:hover { background: rgb(18 58 39 / .07); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-wash); }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; }
.label, .eyebrow {
  font-size: .6875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.input, .textarea, .select {
  width: 100%; min-height: 42px; padding: 9px 14px;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--gold-light); }
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.input-quiet {
  border-color: transparent; background: transparent; padding-inline: 8px; margin-inline: -8px; width: calc(100% + 16px);
}
.input-quiet:hover { background: rgb(18 58 39 / .04); }
.input-quiet:focus { background: var(--white); }
.check {
  appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border-radius: 7px;
  border: 2px solid var(--line-strong); background: var(--white); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.check:hover { border-color: var(--green); }
.check:checked { background: var(--green); border-color: var(--green); }
.check:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--cream); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }

/* ---------- Chips (personas / mails) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--white);
  font-size: .8125rem; font-weight: 600; color: var(--ink-soft); line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--green); color: var(--ink); }
.chip.on { background: var(--green); border-color: var(--green); color: var(--cream); }
.chip.on .tick { display: inline; }
.chip svg { width: 13px; height: 13px; }
.chip .tick { display: none; }
.chip small { font-weight: 500; opacity: .75; font-size: .75rem; }
.chip.off, .chip[disabled] { border-style: dashed; color: var(--ink-mute); background: transparent; }
.chip[disabled] { cursor: not-allowed; }
.chip.add { border-style: dashed; color: var(--ink-soft); background: transparent; }
.chip.add:hover { background: var(--gold-wash); border-color: var(--gold); }
.chip.mail { background: var(--gold-wash); border-color: var(--gold-light); color: var(--ink); }
.chip .x { border: 0; background: none; padding: 0 0 0 2px; margin-right: -4px; color: inherit; opacity: .6; font-size: 1rem; line-height: 1; }
.chip .x:hover { opacity: 1; }
.chips-sm .chip { min-height: 26px; padding: 2px 10px; font-size: .75rem; }

/* ---------- Avatares ---------- */
.avs { display: inline-flex; }
.av {
  overflow: hidden;
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-light); color: var(--green); font-size: .5625rem; font-weight: 600; letter-spacing: 0; line-height: 1;
  border: 2px solid var(--surface); flex: none;
}
.avs .av + .av { margin-left: -5px; }
.av.more { background: var(--cream); color: var(--ink-soft); }

/* ---------- Estado ---------- */
.estado {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.e-pendiente { background: #ECE9DD; color: #3E5A4B; }
.e-en_curso  { background: #FCE9B8; color: #5C4100; }
.e-bloqueado { background: #F6D9CF; color: #8A2E14; }
.e-resuelto  { background: #D5E8DB; color: #123A27; }
.seg-estado { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-estado button { border: 1px solid transparent; cursor: pointer; opacity: .55; transition: opacity .15s, box-shadow .15s; min-height: 30px; }
.seg-estado button:hover { opacity: .9; }
.seg-estado button.on { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgb(254 246 231 / .92);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1280px; margin: 0 auto; height: 72px; padding-inline: clamp(16px, 4vw, 40px);
  display: flex; align-items: center; gap: var(--s-4);
}
.lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); flex: none; }
.lockup .iso { height: 38px; width: auto; }
.lockup .wm { font: 700 1.5rem/1 var(--font-mark); letter-spacing: -.01em; }
.lockup .desc { display: block; font: 600 .5625rem/1 var(--font-ui); letter-spacing: .3em; margin-top: 5px; }
.esp-switch {
  display: inline-flex; align-items: center; gap: 8px; max-width: 280px; min-height: 40px; padding: 6px 12px 6px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--white); font-weight: 600; font-size: .875rem;
}
.esp-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esp-switch svg { width: 16px; height: 16px; flex: none; color: var(--ink-soft); }
.esp-switch:hover { border-color: var(--green); }
.tabs { display: flex; gap: 2px; padding: 4px; border-radius: var(--radius-pill); background: rgb(18 58 39 / .05); }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .875rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgb(18 58 39 / .12); }
.tab .n { font-size: .6875rem; background: var(--gold-light); color: var(--green); border-radius: var(--radius-pill); padding: 0 6px; }
.spacer { flex: 1; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.me-btn .av { width: 38px; height: 38px; font-size: .75rem; border-color: var(--cream); background: var(--green); color: var(--cream); }

/* ---------- Popover ---------- */
.pop {
  position: absolute; z-index: 60; min-width: 240px; max-width: min(360px, calc(100vw - 32px)); padding: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop);
  animation: popin .16s var(--ease-out);
}
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px;
  background: none; text-align: left; font-weight: 600; font-size: .875rem;
}
.pop-item:hover { background: var(--cream); }
.pop-item small { display: block; font-weight: 500; color: var(--ink-mute); font-size: .75rem; }
.pop-item.on { background: var(--gold-wash); }
.pop-item svg { width: 16px; height: 16px; color: var(--ink-soft); flex: none; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-head { padding: 8px 12px 4px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: var(--s-6) clamp(16px, 4vw, 40px) var(--s-8); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head h1 { margin: 6px 0 0; font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 600; }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-soft); }
.mute { color: var(--ink-mute); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-5); }
.kpi { background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--shadow-card); border-radius: 16px; padding: 14px 16px; }
.kpi b { display: block; font-size: 1.75rem; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 6px; font-size: .8125rem; color: var(--ink-soft); }
.kpi.alert { background: var(--red-wash); border-color: #E9B8A8; }
.kpi.alert b { color: var(--red); }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-4); }
.search { position: relative; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--ink-mute); pointer-events: none; }
.search .input { padding-left: 38px; border-radius: var(--radius-pill); }
.toolbar .select { width: auto; border-radius: var(--radius-pill); min-height: 40px; padding-block: 6px; }
.seg-ctl { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: rgb(18 58 39 / .05); }
.seg-ctl button { border: 0; background: none; padding: 6px 14px; border-radius: var(--radius-pill); font-weight: 600; font-size: .8125rem; color: var(--ink-soft); }
.seg-ctl button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgb(18 58 39 / .12); }

/* Segmentos */
.segs { display: grid; gap: var(--s-4); }
.seg { background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--shadow-card); border-radius: var(--radius-card); overflow: hidden; }
.seg-head { display: flex; align-items: center; gap: var(--s-2); padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.seg-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.seg-head h2 { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-head .count { font-size: .8125rem; color: var(--ink-mute); white-space: nowrap; }
.seg-toggle { border: 0; background: none; padding: 0; display: flex; align-items: center; gap: var(--s-3); text-align: left; min-width: 0; flex: 1; }
.seg-toggle > svg { width: 16px; height: 16px; color: var(--ink-mute); transition: rotate .2s; }

.seg.closed .seg-toggle > svg { rotate: -90deg; }
.seg.closed .seg-body { display: none; }
.seg.closed .seg-head { border-bottom: 0; }

.tema {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 120px 90px 70px; align-items: center; gap: var(--s-3);
  padding: 12px 16px 12px 10px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--card);
  transition: background .12s;
}
.tema:hover { background: #FFF8E8; }
.tema.sel { background: var(--gold-wash); }
.tema .grip { opacity: 0; color: var(--ink-mute); cursor: grab; display: grid; place-items: center; }
.tema:hover .grip { opacity: 1; }
.tema .grip svg { width: 14px; height: 14px; }
.tema-main { min-width: 0; }
.tema-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.tema-title span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tema.res .tema-title span.t { color: var(--ink-mute); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.tema-next { margin-top: 3px; font-size: .8125rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tema-next .late { color: var(--red); font-weight: 600; }
.prog { display: grid; gap: 5px; font-size: .75rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 99px; background: rgb(18 58 39 / .08); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 99px; }
.tema-date { font-size: .8125rem; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.tema-date.late { color: var(--red); font-weight: 600; }
.tema.dragging, .paso.dragging { opacity: .4; }

.add-row { display: flex; gap: var(--s-2); padding: 10px 16px; align-items: center; }
.add-row .input { border-style: dashed; background: transparent; min-height: 38px; }
.add-row .input:focus { border-style: solid; background: var(--white); }
.seg-empty { padding: 18px 20px 6px; color: var(--ink-mute); font-size: .875rem; }

/* ---------- Drawer (detalle del tema) ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(18 58 39 / .38); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 41; inset: 0; margin: auto; width: min(780px, calc(100vw - 32px)); height: min(860px, calc(100svh - 48px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden; animation: dlg .24s var(--ease-out);
}
.drawer-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.paso-draft .num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-light); font-size: .6875rem; font-weight: 600; }
.paso-draft .paso-text { padding-top: 1px; }
.drawer-head { display: flex; align-items: center; gap: var(--s-2); padding: 14px 16px 14px 32px; border-bottom: 1px solid var(--line); }
.drawer-head .select { width: auto; max-width: 260px; min-height: 34px; padding: 4px 30px 4px 12px; border-radius: var(--radius-pill); font-size: .8125rem; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-5) var(--s-6) var(--s-7); display: grid; gap: var(--s-6); align-content: start; }
.drawer-title { font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; resize: none; overflow: hidden; min-height: 0; }
.section { display: grid; gap: var(--s-3); }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }

.pasos { display: grid; gap: 2px; }
.paso {
  display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 10px 8px 10px 4px; border-radius: 12px; background: var(--surface);
}
.paso:hover { background: var(--white); }
.paso .grip { color: var(--ink-mute); cursor: grab; opacity: 0; padding-top: 2px; }
.paso:hover .grip { opacity: 1; }
.paso .grip svg { width: 14px; height: 14px; }
.paso .check { margin-top: 1px; }
.paso-text { width: 100%; border: 0; background: transparent; padding: 0; resize: none; overflow: hidden; line-height: 1.45; min-height: 22px; font-weight: 500; }
.paso-text:focus { outline: none; background: var(--white); box-shadow: 0 0 0 3px var(--gold-light); border-radius: 6px; }
.paso.done .paso-text { color: var(--ink-mute); text-decoration: line-through; }
.paso-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.date-chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 10px;
  border-radius: var(--radius-pill); border: 1px dashed var(--line-strong); font-size: .75rem; font-weight: 600; color: var(--ink-soft);
}
.date-chip.set { border-style: solid; background: var(--white); }
.date-chip.late { border-color: #E9B8A8; background: var(--red-wash); color: var(--red); }
.date-chip svg { width: 13px; height: 13px; }
.date-chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.date-chip input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.picker { margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); }

.new-paso { display: grid; gap: var(--s-2); padding: 12px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--cream); }
.new-paso .row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; }

.refs { display: grid; gap: 6px; }
.ref { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.ref a { flex: 1; min-width: 0; font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.ref a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.ref .host { font-size: .75rem; color: var(--ink-mute); flex: none; }
.ref > svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.ref-add { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: var(--s-2); }

.coms { display: grid; gap: var(--s-3); }
.com { padding: 10px 14px; border-left: 3px solid var(--gold-light); background: var(--white); border-radius: 0 12px 12px 0; }
.com p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.com footer { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .75rem; color: var(--ink-mute); }
.com footer .icon-btn { width: 26px; height: 26px; margin-left: auto; }
.com footer .icon-btn svg { width: 14px; height: 14px; }
.com-add { display: grid; gap: var(--s-2); justify-items: end; }

/* ---------- Diálogos ---------- */
dialog {
  border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgb(18 58 39 / .35); }
dialog[open] { animation: dlg .22s var(--ease-out); }
@keyframes dlg { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg { display: flex; flex-direction: column; max-height: calc(100svh - 24px); }
.dlg-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: 22px 20px 14px 28px; }
.dlg-head h2 { margin: 4px 0 0; font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.dlg-head .icon-btn { margin-left: auto; }
.dlg-body { padding: 4px 28px 20px; overflow-y: auto; display: grid; gap: var(--s-5); }
.dlg-foot { background: var(--surface); display: flex; gap: var(--s-2); justify-content: flex-end; align-items: center; flex-wrap: wrap; padding: 16px 28px 22px; border-top: 1px solid var(--line); }
.dlg-foot .left { margin-right: auto; }
.help { font-size: .8125rem; color: var(--ink-soft); margin: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch.on { box-shadow: 0 0 0 2px var(--green); }
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; }

/* Cerrar reunión */
dialog.wide { width: min(1180px, calc(100vw - 24px)); height: calc(100svh - 24px); }
dialog.wide .dlg { height: 100%; }
.close-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; flex: 1; border-top: 1px solid var(--line); }
.close-form { overflow-y: auto; padding: 20px 28px 24px; display: grid; gap: var(--s-5); align-content: start; border-right: 1px solid var(--line); }
.close-prev { background: var(--cream); display: flex; flex-direction: column; min-height: 0; }
.close-prev-h { display: flex; align-items: center; gap: var(--s-2); padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: .8125rem; color: var(--ink-soft); }
.close-prev-h b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.close-prev iframe { flex: 1; width: 100%; border: 0; min-height: 420px; background: var(--cream); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.mail-add { display: flex; gap: var(--s-2); }
.mail-add .input { min-height: 36px; border-radius: var(--radius-pill); font-size: .875rem; }
.linkish { border: 0; background: none; padding: 0; font-weight: 600; font-size: .75rem; color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.note-test { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--gold-wash); border: 1px solid var(--gold-light); font-size: .8125rem; color: var(--ink); }
.note-test svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: #8A6400; }

.envio { display: grid; gap: 6px; }
.envio div { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.envio .ok { color: var(--green); font-weight: 600; }
.envio .bad { color: var(--red); font-weight: 600; }
.envio small { color: var(--ink-mute); }

/* ---------- Actas ---------- */
.actas { display: grid; gap: var(--s-3); }
.acta {
  box-shadow: var(--shadow-card);
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center;
  padding: 16px 20px; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-card);
  cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, transform .15s;
}
.acta:hover { border-color: var(--gold); transform: translateY(-1px); }
.acta-n { width: 56px; height: 56px; border-radius: 16px; background: var(--green); color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 600; font-size: 1.25rem; line-height: 1; }
.acta-n small { font-size: .5625rem; letter-spacing: .2em; color: var(--gold-light); }
.acta h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.acta p { margin: 2px 0 0; font-size: .8125rem; color: var(--ink-soft); }
.acta .mini { display: flex; gap: var(--s-4); font-size: .8125rem; color: var(--ink-soft); }
.acta .mini b { color: var(--ink); font-weight: 600; }
.acta .mini .late b { color: var(--red); }
.viewer iframe { width: 100%; height: min(70svh, 760px); border: 0; border-radius: 16px; background: var(--cream); }

/* ---------- Personas ---------- */
.people { background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--shadow-card); border-radius: var(--radius-card); overflow: hidden; }
.person { display: grid; grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 170px 76px; gap: var(--s-3); align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .av { width: 36px; height: 36px; font-size: .75rem; }
.person .name { font-weight: 600; }
.person .mail { font-size: .875rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .mail.none { color: var(--ink-mute); font-style: normal; }
.person .rol { font-size: .8125rem; color: var(--ink-soft); }
.person .acts { display: flex; justify-content: flex-end; }
.people-head { font-size: .6875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); background: var(--surface); padding-block: 10px; }

/* ---------- Vacíos / login ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--s-3); padding: var(--s-8) var(--s-4); }
.empty .iso { height: 120px; width: auto; margin-bottom: var(--s-3); }
.empty h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
.empty p { margin: 0 0 var(--s-3); color: var(--ink-soft); max-width: 44ch; }
.empty-sm { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius-card); }

.login { min-height: 100svh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-art { position: relative; overflow: hidden; background: var(--green); color: var(--cream); padding: clamp(24px, 5svh, 48px) var(--s-7); display: flex; flex-direction: column; height: 100svh; min-height: 520px; }
.login-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; margin: var(--s-5) 0; }
.login-art .ripples { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.login-art .ripples span { position: absolute; width: 300px; height: 300px; left: -150px; top: -150px; border-radius: 50%; border: 1.5px solid var(--gold-light); opacity: 0; animation: ripple 4.8s linear infinite; }
.login-art .ripples span:nth-child(2) { animation-delay: 1.6s; }
.login-art .ripples span:nth-child(3) { animation-delay: 3.2s; }
@keyframes ripple { 0% { transform: scale(.25); opacity: .45; } 100% { transform: scale(1.6); opacity: 0; } }
.login-art .big { position: relative; height: clamp(120px, 34svh, 300px); width: auto; max-height: 100%; }
.login-art h1 { position: relative; max-width: 14ch; margin: 0; font-size: clamp(1.875rem, 1rem + 2.2vw + 1.2svh, 3.25rem); line-height: 1.06; letter-spacing: -.025em; font-weight: 600; }
.login-art h1 em { font-style: normal; text-decoration: underline wavy var(--gold) 2px; text-underline-offset: .18em; }
.login-art p { position: relative; max-width: 36ch; color: var(--gold-light); margin: var(--s-4) 0 0; }
.login-art .lockup { color: var(--cream); position: relative; }
.login-form { display: grid; place-items: center; padding: var(--s-6) var(--s-4); background: var(--cream); }
.login-form form { width: min(380px, 100%); display: grid; gap: var(--s-4); }
.login-form h2 { margin: 0 0 var(--s-2); font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.err { color: var(--red); font-size: .875rem; font-weight: 600; min-height: 1.2em; margin: 0; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--green); color: var(--cream); font-weight: 600; font-size: .875rem; box-shadow: var(--shadow-pop);
  animation: toastin .3s var(--ease-out);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.toast.err { background: var(--red); }
.toast.err::before { background: var(--cream); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

.boot { min-height: 100svh; display: grid; place-items: center; }
.boot .iso { height: 72px; width: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tema { grid-template-columns: 20px minmax(0, 1fr) 100px 80px; }
  .tema .tema-date { display: none; }
  .person { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.2fr) 150px 76px; }
  .person .rol { display: none; }
}
@media (max-width: 900px) {
  .topbar-in { height: auto; flex-wrap: wrap; padding-block: 10px; row-gap: 10px; }
  .tabs { order: 5; width: 100%; justify-content: center; }
  .tab { flex: 1; justify-content: center; }
  .close-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; overflow-y: auto; }
  .close-form { border-right: 0; overflow: visible; }
  .close-prev iframe { min-height: 560px; }
  .login { grid-template-columns: 1fr; }
  .login-art { height: auto; min-height: 0; padding: var(--s-5) 16px; }
  .login-stage { min-height: 170px; }
  .login-art .big { height: 150px; }
}
@media (max-width: 700px) {
  .drawer { width: 100vw; height: 100svh; border-radius: 0; border: 0; }
  .drawer-body { padding: var(--s-4) 16px var(--s-7); }
  .drawer-head { padding-left: 16px; }
  .head-acts { width: 100%; }
  .head-acts .btn-gold { flex: 1; }
  .dash { grid-template-columns: 1fr; }
  .estados-row { grid-template-columns: repeat(2, 1fr); }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .tema { grid-template-columns: minmax(0, 1fr) 70px; padding-left: 16px; }
  .tema .grip, .tema .avs-cell { display: none; }
  .person { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .person .mail { grid-column: 2; grid-row: 2; }
  .person .hab { grid-column: 2 / 4; grid-row: 3; }
  .person .acts { grid-column: 3; grid-row: 1; }
  .people-head { display: none; }
  .acta { grid-template-columns: 56px minmax(0, 1fr); }
  .acta .mini { grid-column: 1 / -1; }
  .ref-add { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .lockup .desc { display: none; }
  .wrap { padding-top: var(--s-5); }
}
@media (max-width: 520px) {
  .esp-switch { max-width: 100%; flex: 1; order: 4; }
  .topbar-in .btn-primary .lbl-long { display: none; }
  dialog { border-radius: 20px; }
  .dlg-head { padding: 18px 12px 10px 16px; }
  .dlg-body, .close-form { padding-inline: 16px; }
  .dlg-foot { padding: 14px 16px 18px; }
}

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

/* ---------- Cabecera del espacio ---------- */
.head-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.badge-late { background: var(--red-wash); color: var(--red); border-radius: var(--radius-pill); padding: 1px 8px; font-size: .6875rem; }
.add-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-soft); font-weight: 600; font-size: .875rem; text-align: left;
}
.add-btn:hover { background: var(--gold-wash); border-color: var(--gold); color: var(--ink); }
.back { display: inline-block; font-size: .8125rem; margin-bottom: 6px; text-decoration: none; }

/* ---------- Tablero (Kanban) ---------- */
.wrap-wide { max-width: 1440px; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: var(--s-4); overflow-x: auto; padding-bottom: var(--s-4); align-items: start; }
.kcol { background: rgb(18 58 39 / .06); border: 1px solid rgb(18 58 39 / .08); border-radius: var(--radius-card); display: flex; flex-direction: column; min-height: 240px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 14px; }
.kcol-h .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.kcount { font-size: .75rem; font-weight: 600; color: var(--ink-soft); background: var(--card); border-radius: var(--radius-pill); padding: 1px 8px; border: 1px solid var(--line); }
.kcol-body { flex: 1; display: grid; gap: 10px; align-content: start; padding: 4px 10px 12px; border-radius: 0 0 var(--radius-card) var(--radius-card); transition: background .15s; }
.kcol-body.over { background: var(--gold-wash); box-shadow: inset 0 0 0 2px var(--gold-light); }
.kdrop { display: none; padding: 18px 10px; text-align: center; font-size: .75rem; font-weight: 600; color: var(--ink-mute); border: 2px dashed var(--line-strong); border-radius: 14px; }
.kcol-body:not(:has(.kcard)) .kdrop, .kcol-body.over .kdrop { display: block; }
.kcard {
  background: var(--card); border: 1px solid var(--card-line); border-left: 4px solid var(--seg); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-card); cursor: grab; display: grid; gap: 6px; transition: transform .15s, box-shadow .15s;
}
.kcard:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgb(18 58 39 / .08), 0 10px 24px -12px rgb(18 58 39 / .3); }
.kcard.dragging { opacity: .45; }
.kseg { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.kcard h3 { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.35; }
.knext { margin: 0; font-size: .8125rem; color: var(--ink-soft); line-height: 1.4; }
.knext .late, .kprog.late { color: var(--red); font-weight: 600; }
.kcard footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.kprog { font-size: .75rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Resumen ---------- */
.estados-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-5); }
.estado-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--shadow-card); text-align: left; }
.estado-tile:hover { border-color: var(--gold); }
.estado-tile b { margin-left: auto; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.estado-tile small { color: var(--ink-mute); font-size: .75rem; }
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.panel { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px 20px 20px; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.legend { margin-left: auto; display: flex; gap: 12px; font-size: .75rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-ok { background: var(--gold); }
.sw-late { background: #C4452A; }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .8125rem; }
.hl { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl .seg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.htrack { height: 12px; border-radius: 4px; background: rgb(18 58 39 / .07); overflow: hidden; }
.hfill { display: flex; gap: 2px; height: 100%; min-width: 4px; }
.hfill i { display: block; height: 100%; min-width: 3px; }
.hfill i.ok { background: var(--gold); }
.hfill i.late { background: #C4452A; }
.hfill i:last-child { border-radius: 0 4px 4px 0; }
.hv { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv em { font-style: normal; font-weight: 500; color: var(--ink-mute); }
.list { display: grid; gap: 4px; max-height: 360px; overflow-y: auto; }
.litem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none; text-align: left; }
.litem:hover { background: var(--cream); }
.lmain { flex: 1; min-width: 0; display: grid; }
.lmain b { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmain small { font-size: .75rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltag { flex: none; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--gold-wash); color: var(--ink); }
.ltag.late { background: var(--red-wash); color: var(--red); }

/* ---------- Paleta de color personalizado ---------- */
.swatch-custom { position: relative; background: conic-gradient(#F4B223, #D9734E, #D66D95, #8E6BAE, #5B8DB8, #4FA597, #6B9A7B, #F4B223); }
.swatch-custom::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--c, transparent); }
.swatch-custom:not(.on)::before { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: var(--white); font-weight: 600; font-size: 1rem; text-shadow: 0 0 3px rgb(0 0 0 / .4); }
.pal { margin-top: 10px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); display: grid; gap: 12px; }
.pal-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.pal-c { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06); transition: transform .1s; }
.pal-c:hover { transform: scale(1.1); }
.pal-c.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--green); }
.pal-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pal-native { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: .8125rem; font-weight: 600; cursor: pointer; }
.pal-native input { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.pal-native input::-webkit-color-swatch-wrapper { padding: 0; }
.pal-native input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.pal-native input::-moz-color-swatch { border: 0; border-radius: 50%; }
.hex { width: 104px; min-height: 36px; border-radius: var(--radius-pill); font-family: ui-monospace, monospace; font-size: .8125rem; text-transform: uppercase; }
.pal-preview { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; margin-left: auto; }
.pal-preview i { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- Responsive de tablero, resumen y paleta (va al final para ganar a lo anterior) ---------- */
@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .estados-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .kanban { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .kcol { scroll-snap-align: start; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; }
  .pal-grid { gap: 4px; }
  .pal-preview { margin-left: 0; }
  .estado-tile { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .tab { padding: 7px 8px; font-size: .8125rem; }
  .tab .n { display: none; }
}

/* ---------- Contraseña con "ojito" ---------- */
.pass-wrap { position: relative; display: block; }
.pass-wrap .input { padding-right: 46px; }
.pass-eye {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: none; color: var(--ink-soft); display: grid; place-items: center;
}
.pass-eye:hover { color: var(--ink); background: rgb(18 58 39 / .06); }
.pass-eye svg { width: 18px; height: 18px; }

/* ---------- Home: elegir espacio ---------- */
.home .page-head { margin-bottom: var(--s-6); }
.esp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.esp-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 250px; padding: 26px 22px 20px; overflow: hidden;
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  text-align: left; transition: transform .18s var(--ease-out), box-shadow .18s, border-color .18s;
}
.esp-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 2px 4px rgb(18 58 39 / .08), 0 18px 36px -18px rgb(18 58 39 / .35); }
.esp-card.last { border-color: var(--gold-light); }
.esp-stripe { position: absolute; top: 0; left: 0; right: 0; height: 6px; display: flex; }
.esp-stripe i { flex: 1; }
.esp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.esp-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--green); color: var(--gold-light); font-weight: 600; font-size: .9375rem; letter-spacing: .02em; }
.esp-tag { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--gold-wash); border: 1px solid var(--gold-light); border-radius: var(--radius-pill); padding: 2px 10px; }
.esp-card h2 { margin: 4px 0 0; font-size: 1.1875rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.esp-card > p { margin: 0; font-size: .875rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.esp-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8125rem; color: var(--ink-soft); margin-top: 2px; }
.esp-stats b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.esp-stats .late, .esp-stats .late b { color: var(--red); }
.esp-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: .75rem; color: var(--ink-soft); }
.esp-foot b { color: var(--ink); font-weight: 600; }
.esp-next { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.esp-go { position: absolute; right: 20px; bottom: 18px; font-size: .8125rem; font-weight: 600; color: var(--green); opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s var(--ease-out); }
.esp-card:hover .esp-go, .esp-card:focus-visible .esp-go { opacity: 1; transform: none; }
.esp-new { align-items: center; justify-content: center; text-align: center; background: transparent; border: 2px dashed var(--line-strong); box-shadow: none; color: var(--ink-soft); }
.esp-new svg { width: 28px; height: 28px; color: var(--gold); }
.esp-new b { font-size: 1rem; color: var(--ink); }
.esp-new span { font-size: .8125rem; max-width: 26ch; }
.esp-new:hover { background: var(--gold-wash); }
@media (max-width: 520px) { .esp-grid { grid-template-columns: minmax(0, 1fr); } .esp-card { min-height: 0; } }

/* =========================================================================
   Calma visual (spec UI): texto con punto en lugar de pills, sin mayúsculas
   ========================================================================= */
:root {
  --ink-mute: #5E7266; /* ~4.7:1 sobre crema (AA) */
  --dot-pendiente: #8A9A8F; --dot-en_curso: #C98A00; --dot-bloqueado: #A3361A; --dot-resuelto: #3F8A5C;
}
.eyebrow, .label { text-transform: none; letter-spacing: 0; font-size: .8125rem; font-weight: 500; color: var(--ink-soft); }
.label { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot-pendiente); }
.dot.e-en_curso { background: var(--dot-en_curso); }
.dot.e-bloqueado { background: var(--dot-bloqueado); }
.dot.e-resuelto { background: var(--dot-resuelto); }
.meta-quiet { font-size: .8125rem; font-weight: 500; color: var(--ink-soft); min-width: 0; }
.meta-quiet .late { color: var(--red); font-weight: 600; }

/* ---------- Popup de tema ---------- */
.drawer { width: min(760px, calc(100vw - 32px)); height: min(720px, calc(100svh - 48px)); border: 0; }
.tp-head { padding: 20px 24px 0 28px; display: grid; gap: 8px; }
.tp-row1 { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.seg-tag {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; margin-left: -8px; border: 0; border-radius: 8px;
  background: none; font: 500 .8125rem var(--font-ui); color: var(--ink-soft); max-width: 60%;
}
.seg-tag i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.seg-tag svg { width: 14px; height: 14px; opacity: .6; }
.seg-tag:hover { background: var(--cream); color: var(--ink); }
.tp-new { font-size: .8125rem; color: var(--ink-mute); }
.tp-title { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; resize: none; overflow: hidden; min-height: 0; padding-block: 2px; }
.tp-title::placeholder { color: var(--ink-mute); }
.tp-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.estado-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--card); font: 600 .8125rem var(--font-ui); color: var(--ink);
}
.estado-btn svg { width: 14px; height: 14px; color: var(--ink-soft); }
.estado-btn:hover { border-color: var(--ink-soft); }
.estado-btn.e-bloqueado { border-color: #E9B8A8; background: var(--red-wash); color: var(--red); }

.ptabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 28px; margin-top: 14px; }
.ptab {
  height: 44px; padding: 0 2px; margin-bottom: -1px; background: none; border: 0; border-bottom: 2px solid transparent;
  font: 600 .875rem var(--font-ui); color: var(--ink-soft); display: inline-flex; gap: 6px; align-items: center;
}
.ptab:hover:not([disabled]) { color: var(--ink); }
.ptab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
.ptab[disabled] { opacity: .45; cursor: not-allowed; }
.ptab-n { font-size: .75rem; font-weight: 600; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.drawer .drawer-body { padding: 20px 28px 28px; gap: var(--s-5); }
.drawer-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 24px 16px 28px; }
.tp-actions { display: flex; align-items: center; gap: 8px; }
.tp-actions.confirm { background: var(--red-wash); border-radius: 14px; padding: 8px 8px 8px 16px; font-weight: 600; font-size: .875rem; color: var(--red); }
.tp-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 16px; color: var(--ink-soft); font-size: .875rem; }
.tp-empty svg { width: 28px; height: 28px; color: var(--gold); }
.tp-empty p { margin: 0; }

/* Paso: una línea; responsables/fecha como meta quieta, controles al pasar el mouse */
.drawer .paso {
  grid-template-columns: 16px 20px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  min-height: 44px; padding: 6px 6px 6px 2px; border-radius: 12px; background: transparent;
}
.drawer .paso:hover, .drawer .paso:focus-within { background: var(--cream); }
.drawer .paso .grip { padding-top: 0; }
.paso-text { font-size: .9375rem; }
.draft-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); justify-self: center; }
.paso-side { display: flex; align-items: center; gap: 2px; }
.pside {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px; height: 34px; padding: 0 6px;
  border: 0; border-radius: 10px; background: none; color: var(--ink-soft); font: 600 .8125rem var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer;
}
.pside:hover { background: rgb(18 58 39 / .07); color: var(--ink); }
.pside svg { width: 17px; height: 17px; }
.pside.late { color: var(--red); }
.pside input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pside input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.pside .avs .av { width: 24px; height: 24px; background: var(--cream); border-color: var(--card); color: var(--ink); }
.drawer .paso:hover .pside .av, .drawer .paso:focus-within .pside .av { border-color: var(--cream); }
.pside.ghost { opacity: 0; transition: opacity .15s var(--ease-out); }
.paso:hover .pside.ghost, .paso:focus-within .pside.ghost { opacity: 1; }
.drawer .paso.done .pside { display: none; }
.drawer .paso.done .pside:last-child { display: inline-flex; }
.done-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 4px; font: 600 .8125rem var(--font-ui); color: var(--ink-soft); justify-self: start; }
.done-toggle svg { width: 14px; height: 14px; rotate: -90deg; transition: rotate .2s; }
.done-toggle[aria-expanded="true"] svg { rotate: 0deg; }
.done-toggle:hover { color: var(--ink); }

/* Compositor (pasos y novedades) */
.composer { display: flex; align-items: center; gap: 6px; }
.composer-in { flex: 1; min-height: 44px; border-radius: 14px; resize: none; }
textarea.composer-in { padding-top: 11px; max-height: 160px; }
.cmp-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; height: 44px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); color: var(--ink-soft); font: 600 .8125rem var(--font-ui); cursor: pointer;
}
.cmp-btn:hover { border-color: var(--green); color: var(--ink); }
.cmp-btn.set { border-color: var(--gold-light); background: var(--gold-wash); color: var(--ink); }
.cmp-btn svg { width: 18px; height: 18px; }
.cmp-btn input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.cmp-btn input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.cmp-btn .av { width: 24px; height: 24px; background: var(--cream); border-color: var(--gold-wash); }
.cmp-add { height: 44px; border-radius: 14px; }

/* Popover de responsables / menús */
.pop .dot { margin: 0 2px; }
.pop-item.danger { color: var(--red); }
.pop-item.danger svg { color: var(--red); }
.pop-list { max-height: 280px; overflow-y: auto; }
.pop-search { padding: 4px 6px 6px; }
.pop-search .input { min-height: 36px; border-radius: 10px; font-size: .875rem; }
.pc-box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.pop-check.on .pc-box { background: var(--green); border-color: var(--green); color: var(--cream); }
.pop-check .pc-box svg { width: 12px; height: 12px; color: var(--cream); stroke-width: 3; }
.pop-check.on { background: none; }
.pop-check:hover { background: var(--cream); }

@media (hover: none) {
  .pside.ghost { opacity: 1; color: var(--ink-mute); }
}
@media (max-width: 700px) {
  .tp-head { padding: 14px 12px 0 16px; }
  .ptabs { padding: 0 16px; gap: 0; }
  .ptab { flex: 1; justify-content: center; }
  .drawer .drawer-body { padding: 16px; }
  .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .cmp-add { display: none; }
  .tp-actions .help { display: none; }
}
@media (pointer: coarse) { .pside { min-width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .pside.ghost, .done-toggle svg { transition: none; } }

/* =========================================================================
   Vista del espacio (spec UX/UI): una sola acción rellena, filas calmas
   ========================================================================= */
.btn-outline { background: transparent; border-color: var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--cream); }

.esp-head { align-items: flex-end; }
.esp-head h1 { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); font-weight: 600; letter-spacing: -.015em; margin: 0; }
.esp-title { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.esp-head p { font-size: .9375rem; max-width: 64ch; }
.late-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.late-n { color: var(--red); font-weight: 600; }

/* Toolbar */
.toolbar { gap: 8px; }
.search { max-width: 300px; }
.search .input { background: var(--card); border-color: var(--line-strong); }
.select-quiet { width: auto; background-color: transparent; border-color: var(--line-strong); font-weight: 600; font-size: .875rem; color: var(--ink-soft); }
.select-quiet.on { border-color: var(--green); color: var(--ink); background-color: var(--card); }
.chip-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: transparent; font: 600 .8125rem var(--font-ui); color: var(--ink-soft);
}
.chip-filter:hover { border-color: var(--red); color: var(--red); }
.chip-filter.on { background: var(--red-wash); border-color: #E9B8A8; color: var(--red); }

/* Segmentos en un único panel */
.segs { display: block; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.seg { background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.seg + .seg { border-top: 1px solid var(--line-strong); }
.seg-head { min-height: 52px; padding: 8px 12px 8px 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--seg-color, var(--line)); }
.seg-head h2 { font-size: 1rem; font-weight: 600; }
.seg-head .count { font-weight: 500; }
.seg.closed .seg-head { border-bottom: 0; }
.row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s var(--ease-out); }
.seg-head:hover .row-actions, .seg-head:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }

/* Fila de tema: 2 líneas, sin pills ni barras */
.tema { grid-template-columns: 16px minmax(0, 1fr) auto 64px; gap: 14px; padding: 13px 20px 13px 8px; background: var(--card); }
.tema:hover { background: var(--surface); }
.tema-title { font-size: .9375rem; }
.tema-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.tema-meta .sep { color: var(--line-strong); }
.tema-meta .clip { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tema-meta .est { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.tema-meta .est-block { color: var(--red); font-weight: 600; }
.tema .avs .av { width: 26px; height: 26px; background: var(--cream); color: var(--ink); border-color: var(--card); }
.tema:hover .avs .av { border-color: var(--surface); }
.tema-date { font-weight: 600; }
.tema.res .tema-title span.t { text-decoration: none; color: var(--ink-mute); }
.add-quiet {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 20px 11px 38px; border: 0; background: none;
  font: 600 .8125rem var(--font-ui); color: var(--ink-mute); text-align: left; border-top: 1px solid var(--line);
}
.add-quiet svg { width: 15px; height: 15px; }
.add-quiet:hover { color: var(--ink); background: var(--gold-wash); }
.seg-empty { padding: 14px 20px 14px 38px; font-size: .8125rem; }

/* Tablero más quieto */
.kcol-t { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .875rem; }
.kcol-add { opacity: 0; transition: opacity .15s; }
.kcol:hover .kcol-add, .kcol:focus-within .kcol-add { opacity: 1; }
@media (hover: none) { .kcol-add { opacity: 1; } }
.kseg { text-transform: none; letter-spacing: 0; font-size: .75rem; font-weight: 500; }
.kcard .avs .av { background: var(--cream); color: var(--ink); border-color: var(--card); }

@media (max-width: 1100px) { .tema { grid-template-columns: 16px minmax(0, 1fr) auto 56px; } .tema .tema-date { display: block; } }
@media (max-width: 700px) {
  .tema { grid-template-columns: minmax(0, 1fr) 52px; padding-left: 16px; }
  .toolbar .spacer { display: none; }
  .toolbar .btn-primary { width: 100%; }
  .search { max-width: none; }
  .add-quiet, .seg-empty { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) { .row-actions, .kcol-add { transition: none; } }
@media (max-width: 520px) { .topbar-in .btn-outline .lbl-long { display: none; } .topbar-in .btn-outline { padding-inline: 14px; } }

/* Home simplificado: título, tarjetas con estado + historial, una sola forma de crear */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: var(--s-5); }
.home-head h1 { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); font-weight: 600; letter-spacing: -.015em; }
.esp-card { min-height: 0; gap: 14px; padding: 22px; }
.esp-card h2 { margin: 0; font-size: 1.125rem; }
.esp-foot { margin-top: auto; }
.esp-foot b { font-weight: 600; }
.esp-new { flex-direction: row; gap: 10px; min-height: 160px; }
.esp-new svg { width: 20px; height: 20px; }

/* Fila de tema: metadatos como chips separados (tono suave) */
.tema-meta { gap: 8px; margin-top: 7px; }
.mchip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 24px; padding: 2px 10px;
  border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line);
  font-size: .75rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
}
.mchip svg { width: 12px; height: 12px; }
.mchip-est { border-color: transparent; }
.mchip-est.e-pendiente { background: #EEEBE1; color: #3E5A4B; }
.mchip-est.e-en_curso  { background: #FCEDC4; color: #5C4100; }
.mchip-est.e-bloqueado { background: #F7DED5; color: #8A2E14; }
.mchip-est.e-resuelto  { background: #DCECE1; color: #123A27; }
.mchip-next { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 20px; font-weight: 500; }
.mchip-mute { color: var(--ink-mute); font-weight: 500; }
.tema:hover .mchip:not(.mchip-est) { background: var(--card); }
@media (max-width: 700px) { .tema-meta { flex-wrap: wrap; white-space: normal; } .mchip-next { flex-basis: 100%; } }

/* Descripción en el encabezado del popup (siempre visible) */
.tp-desc {
  width: 100%; margin: 4px 0 0 -8px; width: calc(100% + 16px); padding: 6px 8px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; resize: none; overflow: hidden; min-height: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft);
}
.tp-desc:hover { background: rgb(18 58 39 / .04); }
.tp-desc:focus { outline: none; background: var(--card); border-color: var(--green); box-shadow: 0 0 0 3px var(--gold-light); color: var(--ink); }
.tp-desc::placeholder { color: var(--ink-mute); font-style: italic; }
.tp-desc { max-height: 9.5em; overflow-y: auto; }

/* Menú de responsables: click = única persona; "+" = sumar otra */
.pop:has(.resp-row) { min-width: 300px; }
.resp-row { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.resp-row:hover { background: var(--cream); }
.resp-row.on { background: var(--gold-wash); }
.resp-main { flex: 1; min-width: 0; background: none !important; }
.resp-main .av { width: 28px; height: 28px; background: var(--cream); color: var(--ink); border-color: transparent; }
.resp-row.on .resp-main .av { background: var(--green); color: var(--cream); }
.resp-main > span:nth-child(2) { flex: 1; min-width: 0; }
.resp-ok { width: 16px !important; height: 16px !important; color: var(--green) !important; stroke-width: 3; }
.resp-add { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: 4px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--card); color: var(--ink-soft); }
.resp-add:hover { border-color: var(--green); color: var(--green); }
.resp-add svg { width: 14px; height: 14px; }

/* Temas como tarjetas redondeadas separadas entre sí, agrupadas por segmento */
.segs { display: grid; gap: 28px; background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.seg, .seg + .seg { border: 0; }
.seg-head { min-height: 40px; padding: 0 4px 0 0; background: none; border: 0; box-shadow: none; }
.seg.closed .seg-head { border: 0; }
.seg-body { display: grid; gap: 10px; margin-top: 8px; }
.tema {
  border: 1px solid var(--card-line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-card);
  padding: 14px 20px 14px 8px; transition: border-color .15s, transform .15s var(--ease-out), box-shadow .15s;
}
.tema:hover { background: var(--card); border-color: var(--gold); transform: translateY(-1px); }
.tema.sel { background: var(--gold-wash); }
.tema-meta { margin-top: 8px; }
.add-quiet { border: 1px dashed var(--line-strong); border-radius: 16px; padding: 12px 20px; color: var(--ink-soft); }
.add-quiet:hover { border-color: var(--gold); }
.seg-empty { padding: 4px 4px 0; }
@media (max-width: 700px) { .tema { padding-left: 16px; } .add-quiet { padding-left: 16px; } }
@media (prefers-reduced-motion: reduce) { .tema:hover { transform: none; } }

.home .esp-foot { border-top: 0; padding-top: 0; }

/* Jerarquía: segmento = tarjeta blanca; temas y "Agregar tema" adentro */
.segs { gap: 20px; }
.seg { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px 16px 16px; }
.seg + .seg { border: 1px solid var(--card-line); }
.seg-head { min-height: 40px; padding: 0 0 0 4px; }
.seg.closed { padding-bottom: 14px; }
.seg-body { margin-top: 10px; gap: 8px; }
.seg .tema { background: var(--surface); border: 1px solid var(--line); box-shadow: none; border-radius: 14px; }
.seg .tema:hover { background: var(--card); border-color: var(--gold); transform: none; box-shadow: 0 1px 2px rgb(18 58 39 / .06); }
.seg .tema .avs .av { border-color: var(--surface); }
.seg .tema:hover .avs .av { border-color: var(--card); }
.seg .add-quiet { background: transparent; }

.seg-first { width: 100%; min-height: 140px; }

/* Enlaces y archivos adjuntos */
.ref-new { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ref-new .input { flex: 1 1 260px; }
.ref-file { position: relative; overflow: hidden; cursor: pointer; }
.ref-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.ref-file:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.ref-adj > svg { color: var(--green); }
.ref .ref-name { flex: 1; min-width: 0; font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
