:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e5e7eb;
  --accent: #e71d35; --accent-dark: #ba1f2c; --accent-soft: #fdecee; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 16px; } h2 { font-size: 15px; margin: 0 0 12px; } h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav.side { background: #111827; color: #cbd5e1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
nav.side .brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
nav.side a { color: #cbd5e1; padding: 8px 10px; border-radius: 8px; display: block; }
nav.side a.active, nav.side a:hover { background: #1f2937; color: #fff; }
nav.side .bottom { margin-top: auto; font-size: 12px; padding: 10px; border-top: 1px solid #1f2937; }
nav.side .bottom button { margin-top: 6px; }
main { padding: 24px 28px; min-width: 0; }
.banner { background: #fff7ed; border: 1px solid #fed7aa; color: var(--warn); padding: 8px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 2fr 1fr; }
.kpi .label { color: var(--muted); font-size: 12px; } .kpi .value { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
button { font: inherit; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .6; cursor: wait; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click:hover { background: #f9fafb; cursor: pointer; }
tfoot td { font-weight: 650; background: #fafbfc; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #f1f5f9; color: #334155; }
.pill.ok { background: #dcfce7; color: var(--ok); } .pill.warn { background: #fef3c7; color: var(--warn); } .pill.bad { background: #fee2e2; color: var(--bad); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.col { background: #eef0f4; border-radius: var(--radius); min-width: 240px; width: 240px; padding: 10px; }
.col.drop { outline: 2px dashed var(--accent); }
.col header { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.lead { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.lead .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b:hover i { background: var(--accent-dark); }
.bars .b span { font-size: 11px; color: var(--muted); margin-top: 4px; }
.list > div { padding: 8px 0; border-bottom: 1px solid var(--line); } .list > div:last-child { border-bottom: 0; }
.overdue { color: var(--bad); font-weight: 600; }
dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15,23,42,.45); }
dialog form { padding: 20px; display: grid; gap: 10px; }
dialog label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.lines td { padding: 4px; } .lines input { width: 100%; }
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: 340px; display: grid; gap: 10px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 99; }
.toast.err { background: var(--bad); }
.heat td.num { transition: background .2s; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; } nav.side { flex-direction: row; overflow-x: auto; } nav.side .bottom { display: none; }
  .g4, .g2, .g3 { grid-template-columns: 1fr 1fr; } main { padding: 16px; }
}

/* ---------- Calendario ---------- */
dialog .row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; } .seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border-left: 0 !important; }
.k-visita { --k: #15803d; --kb: #dcfce7; } .k-reunion { --k: #7c3aed; --kb: #ede9fe; } .k-llamada { --k: #2563eb; --kb: #dbeafe; }
.k-email { --k: #b45309; --kb: #fef3c7; } .k-otro { --k: #475569; --kb: #e2e8f0; }
.legend i, .pill[class*="k-"] { background: var(--kb); color: var(--k); }
.legend i { background: var(--k); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: #fafbfc; padding: 6px 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.cal .day { background: #fff; min-height: 112px; padding: 4px 5px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal.week .day { min-height: 420px; }
.cal .day:hover { background: #fbfcff; }
.cal .day.other { background: #f9fafb; } .cal .day.other .dn { color: #b6bcc6; }
.cal .day.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.cal .dn { font-size: 12px; color: var(--muted); padding: 2px 3px; text-transform: capitalize; }
.cal .day.today .dn { color: var(--accent); font-weight: 700; }
.cal.month .day.today .dn { display: inline-block; align-self: flex-start; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.ev { position: relative; background: var(--kb); color: #111827; border-left: 3px solid var(--k); border-radius: 5px; padding: 3px 6px; font-size: 12px; line-height: 1.3; cursor: grab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal.week .ev { white-space: normal; padding: 6px 8px; }
.ev b { color: var(--k); }
.ev .small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.ev.done { opacity: .55; text-decoration: line-through; }
.ev.over { box-shadow: inset 0 0 0 1px var(--bad); }
.ev .who { position: absolute; right: 3px; top: 3px; font-size: 10px; font-weight: 700; background: #fff; color: var(--k); border-radius: 999px; padding: 0 4px; }
.cal.week .ev .who { top: 5px; }
.cal .more { align-self: flex-start; padding-left: 4px; }
.cal .empty { padding: 4px; }
@media (max-width: 900px) { .cal.month .day { min-height: 70px; } .cal.week { grid-template-columns: 1fr; } .cal.week .day { min-height: 0; } }
.ev:has(.who) { padding-right: 26px; }

/* Calendario: panel lateral de vencidas y resumen */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.side-card h2 { display: flex; align-items: center; gap: 8px; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); }
.sum-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.sum-kpis div { background: #f8fafc; border-radius: 8px; padding: 8px 4px; text-align: center; }
.sum-kpis b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.sum-kpis span { font-size: 11px; color: var(--muted); }
.meter { height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
table.mini td, table.mini th { padding: 4px 2px; font-size: 13px; background: none; position: static; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k); margin-right: 6px; }
.od-list { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.od { display: flex; gap: 8px; padding: 8px; border-radius: 8px; border: 1px solid #fecaca; border-left: 3px solid var(--k); background: #fff; cursor: grab; }
.od:hover { background: #fffafa; }
.od label { padding-top: 2px; } .od-body { min-width: 0; }
.od-title { font-weight: 600; cursor: pointer; } .od-title:hover { color: var(--accent); }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .cal-side { position: static; grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .cal-side { grid-template-columns: 1fr; } }

/* Rol comercial: se ocultan los controles de equipo */
.role-comercial .admin-only { display: none !important; }

/* ---------- Voz ---------- */
.mic-ico { vertical-align: -3px; }
.voice-btn { display: inline-flex; align-items: center; gap: 6px; color: #b91c1c; border-color: #fecaca; background: #fff5f5; }
.voice-btn:hover { background: #fee2e2; }
h2 .voice-btn { font-weight: 500; padding: 4px 10px; }
.dictate { position: relative; }
.dictate textarea { padding-right: 44px; }
.dictate .mic { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; padding: 0; border-radius: 999px; display: grid; place-items: center; color: var(--muted); background: #f8fafc; }
.dictate .mic:hover { color: #b91c1c; }
.dictate .mic.rec, .big-mic.rec { color: #fff; background: #dc2626; border-color: #dc2626; animation: pulse 1.2s infinite; }
.dictate-hint { color: #b91c1c; min-height: 0; margin-top: 2px; }
.dictate-hint:empty { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 12px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.voice-stage { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.big-mic { width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; color: #b91c1c; background: #fff5f5; border: 1px solid #fecaca; flex: none; }
.big-mic .mic-ico { width: 28px; height: 28px; }
.voice-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { font-size: 12px; background: #f1f5f9; border-radius: 8px; padding: 4px 8px; }
.vchip b { color: var(--muted); font-weight: 600; margin-right: 2px; }
.vchip.miss { background: #fff7ed; color: var(--warn); }
.voice-heard { display: flex; gap: 8px; align-items: flex-start; background: #fff5f5; color: #7f1d1d; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.voice-heard .mic-ico { flex: none; margin-top: 2px; color: #b91c1c; }

/* Asistente de configuración */
.login .card.setup { width: 420px; }
.setup label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.setup h3 { margin: 10px 0 0; }
.banner.info { background: var(--accent-soft); border-color: #f9c5cc; color: var(--accent-dark); }

/* ================= Marca Codentsa: rojo y blanco ================= */
body { background: #f7f7f8; }
h1, h2, .kpi .value, nav.side a, button.primary { font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-weight: 600; letter-spacing: -.01em; }
nav.side { background: #fff; color: var(--text); border-right: 1px solid var(--line); padding: 20px 14px; gap: 4px; }
nav.side .brand { padding: 4px 8px 22px; display: grid; gap: 6px; }
nav.side .brand img { width: 160px; height: auto; display: block; }
nav.side .brand span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
nav.side a { color: #374151; font-weight: 500; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; }
nav.side a:hover { background: var(--accent-soft); color: var(--accent-dark); }
nav.side a.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(231,29,53,.25); }
nav.side .bottom { border-top: 1px solid var(--line); color: var(--text); }
main { border-top: 4px solid var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 500; }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:not(.primary):not(.link):not(.mic):not(.big-mic):hover { border-color: #f3a8b2; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(231,29,53,.25); border-color: var(--accent); }
.kpi { border-top: 3px solid var(--accent); }
.kpi .value { color: #111827; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.seg button.on { background: var(--accent-soft); color: var(--accent-dark); }
.bars .b i { background: var(--accent); }
.col.drop { outline-color: var(--accent); }
.toast { background: #1f1f23; }
/* Inicio de sesión y asistente: fondo rojo, tarjeta blanca */
.login { background: radial-gradient(1200px 600px at 20% 0%, #f2394d 0%, var(--accent) 40%, var(--accent-dark) 100%); padding: 16px; }
.login .card { border: 0; box-shadow: 0 20px 50px rgba(80,0,10,.35); border-radius: 16px; padding: 28px; }
.login-logo { width: 200px; height: auto; display: block; margin: 0 0 6px; }
@media (max-width: 900px) {
  nav.side { flex-wrap: wrap; padding: 10px 12px; gap: 4px; position: sticky; top: 0; z-index: 5; }
  nav.side .brand { flex-basis: 100%; padding: 2px 4px 6px; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  nav.side .brand img { width: 120px; }
  nav.side { flex-wrap: nowrap; overflow-x: auto; }
  nav.side .brand { flex: 0 0 auto; flex-basis: auto; }
  nav.side .brand span { display: none; }
  nav.side a { white-space: nowrap; }
  main { border-top-width: 3px; }
}
@media (max-width: 700px) {
  .g3, .g2 { grid-template-columns: 1fr; }
  .toolbar h1 { font-size: 18px; }
}
.login .card, .login .card.setup { width: min(420px, 100%); }
.share { height: 4px; background: #f3f4f6; border-radius: 4px; margin-top: 5px; overflow: hidden; } .share i { display: block; height: 100%; background: var(--accent); opacity: .75; border-radius: 4px; }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1200px) { .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 700px) { .g5 { grid-template-columns: 1fr 1fr; } }

/* Buscador de clientes */
.cpick { position: relative; }
.cpick .cp-q { width: 100%; }
.cp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16,24,40,.15); max-height: 260px; overflow: auto; padding: 4px; color: var(--text); font-size: 14px; }
.cp-item { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: grid; gap: 1px; }
.cp-item.on, .cp-item:hover { background: var(--accent-soft); }
.cp-item b { font-weight: 600; }
.cp-empty { padding: 10px; }
dialog { overflow: visible; } dialog form { max-height: 88vh; overflow: auto; }

/* Asignación masiva */
.bulk { position: sticky; top: 8px; z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #1f1f23; color: #fff;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bulk .spacer { flex: 1; } .bulk label { color: #d1d5db; } .bulk select { min-width: 180px; }
.bulk button:not(.primary) { background: transparent; color: #fff; border-color: #4b5563; }
td.chk { cursor: pointer; } td.chk input, #selAll { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.owners-pick { display: grid; gap: 4px; margin: 6px 0 4px; } .owners-pick label { display: flex; gap: 8px; align-items: center; font-size: 13px; } .owners-pick input { accent-color: var(--accent); }

/* ---- Tareas repetitivas y avisos ---- */
.ti { display: inline-flex; vertical-align: -1px; margin-left: 4px; color: var(--muted); opacity: .85; }
.ev .ti { color: inherit; opacity: .7; margin-left: 3px; }
.series-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: grid; gap: 8px; }
.series-note svg { vertical-align: -1px; }
.series-note label { margin: 0; }
nav.side .bottom .link svg { vertical-align: -1px; }
.avisos-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #f4f4f5; color: var(--muted); }
.avisos-state.on { background: #e8f6ee; color: #17803d; }
.avisos-state svg { width: 16px; height: 16px; }
.ios-steps { background: #f8f8f9; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.ios-steps ol { margin: 6px 0; padding-left: 20px; }
.reminder-pop { position: fixed; right: 16px; bottom: 16px; z-index: 1000; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  max-width: min(340px, calc(100vw - 32px)); display: grid; gap: 2px; font-size: 14px; animation: popin .2s ease-out; }
.reminder-pop svg { width: 14px; height: 14px; color: var(--accent); vertical-align: -2px; }
@keyframes popin { from { transform: translateY(-8px); opacity: 0; } }
dialog .row > *, dialog .row3 > * { min-width: 0; }
dialog input, dialog select { min-width: 0; max-width: 100%; }
@media (max-width: 600px) {
  dialog .row3 { grid-template-columns: 1fr 1fr; }
  dialog .row3 > :first-child { grid-column: 1 / -1; }
}
.ventas-client { min-width: 260px; flex: 1 1 260px; max-width: 380px; position: relative; }
.ventas-client .cp-q { width: 100%; }
/* En el móvil, Avisos / contraseña / salir quedan al final del menú deslizable */
@media (max-width: 900px) {
  nav.side .bottom { display: flex; align-items: center; gap: 12px; margin: 0 0 0 8px; padding: 0 12px; border-top: 0; border-left: 1px solid var(--line); white-space: nowrap; }
  nav.side .bottom br, nav.side .bottom .who-me { display: none; }
  nav.side .bottom button { margin-top: 0; font-size: 14px; }
}
.lead-ref svg, .lead-next svg { vertical-align: -1px; }
.lead-next { margin-top: 6px; padding: 4px 6px; background: #f6f7f9; border-radius: 6px; }
.lead-next.overdue { background: #fef2f2; }
.lead-next.overdue .link { color: var(--bad); }

/* ---- Catálogos ---- */
.cat-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); margin-bottom: 14px; background: #fff; }
.cat-drop.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.cat-h { margin: 18px 0 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cat-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }
.cat-body { min-width: 0; flex: 1; display: grid; gap: 3px; }
.cat-name { overflow-wrap: anywhere; }
.cat-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-ico { flex: none; width: 42px; height: 50px; border-radius: 6px; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 7px; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .03em; }
.cat-ico.pdf { background: linear-gradient(160deg, #ef4444, #b91c1c); }
.cat-ico.xls { background: linear-gradient(160deg, #22a35a, #15703d); }
.cat-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.btn-s { display: inline-block; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.btn-s.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.up-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.up-row { display: flex; gap: 10px; align-items: center; }
.up-row .cat-ico { width: 32px; height: 38px; font-size: 9px; padding-bottom: 5px; }
.up-name { width: 100%; }
.up-bar { height: 4px; background: #eef0f3; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up-row.ok .up-bar i { background: var(--ok); }
.up-row.err .up-bar i { background: var(--bad); width: 100%; }
.cal-sub { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-sub .btn-s { padding: 8px 14px; }
.cal-help { background: #f8f8f9; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.cal-help summary { cursor: pointer; }
.cal-help ol { margin: 6px 0 2px; padding-left: 20px; } .cal-help li { margin-bottom: 3px; }
.cal-help p { margin: 6px 0 2px; }

/* ---- Calendario personal (iCloud, Google…) en la agenda ---- */
.ev.ext { --k: var(--ext); --kb: color-mix(in srgb, var(--ext) 12%, #fff); color: #374151; cursor: pointer; border-left-style: dashed; }
.ev.ext::before { content: none; }
.legend i.k-ext { background: #9ca3af; }
.ext-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ext); font-weight: 600; }
.ext-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.ext-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal-tabs { display: flex; gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 10px; }
.cal-tabs button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.cal-tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal-pane { display: grid; gap: 10px; }
.cal-pane[hidden] { display: none; }

/* ---- Documentos e información: carpetas ---- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.crumbs a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }
.crumb-act { margin-left: auto; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.folder-tile { display: grid; gap: 2px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.folder-tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(231,29,53,.08); }
.folder-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.folder-ico { color: #f2b84b; line-height: 0; }
.folder-name { font-weight: 650; overflow-wrap: anywhere; }
.cat-ico.doc { background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.cat-ico.ppt { background: linear-gradient(160deg, #f97316, #c2410c); }
.cat-ico.img { background: linear-gradient(160deg, #a855f7, #7e22ce); }
@media (max-width: 900px) {
  nav.side { align-items: center; }
  nav.side a, nav.side .brand { white-space: nowrap; flex: none; }
}

/* ---- Participantes del equipo en una tarea ---- */
.pp-field { display: grid; gap: 6px; }
.pp-label { font-size: 12px; color: var(--muted); }
.pp-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pp { display: inline-flex !important; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px !important; color: var(--text) !important; cursor: pointer; background: #fff; }
.pp input { margin: 0; accent-color: var(--accent); }
.pp:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark) !important; font-weight: 600; }
.ev.guest { cursor: pointer; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.55) 6px 9px); }
.cp-new { color: var(--accent-dark); border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; font-weight: 600; }
.cp-create { margin-top: 8px; padding: 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; display: grid; gap: 8px; }
.cp-create-h { font-weight: 650; color: var(--text); font-size: 13px; }
.cp-create .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 600px) { .cp-create .row { grid-template-columns: 1fr; } }
/* Tareas hechas: se ven tachadas */
.tl-done [data-edit-task] { text-decoration: line-through; color: var(--muted) !important; font-weight: 500 !important; }
.tl-done .pill, .tl-done .small { opacity: .6; }
.tl-done .overdue { color: var(--muted); font-weight: 400; }
.ev.done { opacity: .6; text-decoration: line-through; }
.new-version { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 1001; background: #111827; color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; max-width: calc(100vw - 32px); }

/* ---- Leads del CRM (posibles clientes que aún no están en Holded) ---- */
.lead-pill { background: #fff4e5 !important; color: #b45309 !important; border: 1px solid #fcd9a8; font-weight: 700; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.lead-note { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff8ed; border: 1px solid #fcd9a8; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.lk-res { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.lk-item { display: grid; gap: 2px; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.lk-item:hover, .lk-item.on { border-color: var(--accent); background: var(--accent-soft); }
.cp-create-h .small { font-weight: 400; }
